diff -u --recursive --new-file v2.4.9/linux/CREDITS linux/CREDITS
--- v2.4.9/linux/CREDITS	Mon Aug 27 12:41:37 2001
+++ linux/CREDITS	Sun Sep  9 10:43:02 2001
@@ -400,13 +400,12 @@
 S: USA
 
 N: Peter Braam
-E: braam@cs.cmu.edu
-W: http://coda.cs.cmu.edu/~braam
-D: Coda Filesystem
-S: Dept of Computer Science
-S: 5000 Forbes Avenue
-S: Pittsburgh, Pennsylvania 15213
-S: USA
+E: braam@clusterfs.com
+W: http://www.clusterfs.com/
+D: Coda & InterMezzo filesystems
+S: 181 McNeil
+S: Canmore, AB
+S: Canada, T1W 2R9
 
 N: Ryan Bradetich
 E: rbradetich@uswest.net
@@ -535,6 +534,12 @@
 S: Stanford, California 94305
 S: USA
 
+N: Randolph Chung
+E: tausq@debian.org
+D: Linux/PA-RISC hacker
+S: Fremont, CA 94538
+S: USA
+
 N: Juan Jose Ciarlante
 W: http://juanjox.kernelnotes.org/
 E: jjciarla@raiz.uncu.edu.ar
@@ -633,10 +638,11 @@
 S: USA
 
 N: Frank Davis
+E: fdavis@si.rr.com
 E: fdavis112@juno.com
 D: Various kernel patches
 S: 8 Lakeview Terr.
-S: Kerhonskon, NY 12446
+S: Kerhonkson, NY 12446
 S: USA
 
 N: Wayne Davison
@@ -714,7 +720,7 @@
 N: Oleg Drokin
 E: green@ccssu.crimea.ua
 W: http://www.ccssu.crimea.ua/~green
-D: Cleaning up sound drivers.
+D: Cleaning up sound drivers, SA1100 Watchdog.
 S: Skvoznoy per., 14a
 S: Evpatoria
 S: Crimea
diff -u --recursive --new-file v2.4.9/linux/Documentation/00-INDEX linux/Documentation/00-INDEX
--- v2.4.9/linux/Documentation/00-INDEX	Thu Feb  8 16:32:44 2001
+++ linux/Documentation/00-INDEX	Mon Aug 27 07:44:15 2001
@@ -5,6 +5,11 @@
 Please try and keep the descriptions small enough to fit on one line.
 							 Thanks -- Paul G.
 
+Following translations are available on the WWW:
+
+   - Japanese, maintained by the JF Project (JF@linux.or.jp), at
+     http://www.linux.or.jp/JF/
+
 00-INDEX
 	- this file.
 BUG-HUNTING
diff -u --recursive --new-file v2.4.9/linux/Documentation/Changes linux/Documentation/Changes
--- v2.4.9/linux/Documentation/Changes	Tue Jul  3 17:08:18 2001
+++ linux/Documentation/Changes	Mon Sep 17 23:10:44 2001
@@ -48,7 +48,7 @@
 Card) hardware, for example, you probably needn't concern yourself
 with pcmcia-cs.
 
-o  Gnu C                  2.91.66                 # gcc --version
+o  Gnu C                  2.95.3                  # gcc --version
 o  Gnu make               3.77                    # make --version
 o  binutils               2.9.1.0.25              # ld -v
 o  util-linux             2.10o                   # fdformat --version
@@ -70,17 +70,23 @@
 necessarily to users of other CPUs. Users of other CPUs should obtain
 information about their gcc version requirements from another source.
 
-The recommended compiler for the kernel is egcs 1.1.2 (gcc 2.91.66), and it
-should be used when you need absolute stability. You may use gcc 2.95.x
-instead if you wish, although it may cause problems. Later versions of gcc
-have not received much testing for Linux kernel compilation, and there are
+The recommended compiler for the kernel is gcc 2.95.3 or .4, and it
+should be used when you need absolute stability. You may use gcc 3.0.x
+instead if you wish, although it may cause problems. Later  versions of gcc 
+have not received much testing for Linux kernel compilation, and there are 
 almost certainly bugs (mainly, but not exclusively, in the kernel) that
 will need to be fixed in order to use these compilers. In any case, using
 pgcc instead of egcs or plain gcc is just asking for trouble.
 
 Note that gcc 2.7.2.3 is no longer a supported kernel compiler. The kernel
 no longer works around bugs in gcc 2.7.2.3 and, in fact, will refuse to
-be compiled with it.
+be compiled with it. egcs-1.1.2 has register allocation problems in very
+obscure cases. We have ensured the kernel does not trip these in any known
+situation. The 2.5 tree is likely to drop egcs-1.1.2 workarounds.
+
+The Red Hat gcc 2.96 compiler subtree can also be used to build this tree.
+You should ensure you use gcc-2.96-74 or later. gcc-2.96-54 will not build
+the kernel correctly.
 
 In addition, please pay attention to compiler optimization.  Anything
 greater than -O2 may not be wise.  Similarly, if you choose to use gcc-2.95.x
diff -u --recursive --new-file v2.4.9/linux/Documentation/CodingStyle linux/Documentation/CodingStyle
--- v2.4.9/linux/Documentation/CodingStyle	Wed Sep 29 13:59:12 1999
+++ linux/Documentation/CodingStyle	Sun Sep  9 16:40:43 2001
@@ -233,3 +233,34 @@
 stable. All options that are known to trash data (experimental write-
 support for file-systems, for instance) should be denoted (DANGEROUS), other
 Experimental options should be denoted (EXPERIMENTAL).
+
+
+		Chapter 8: Data structures
+
+Data structures that have visibility outside the single-threaded
+environment they are created and destroyed in should always have
+reference counts.  In the kernel, garbage collection doesn't exist (and
+outside the kernel garbage collection is slow and inefficient), which
+means that you absolutely _have_ to reference count all your uses. 
+
+Reference counting means that you can avoid locking, and allows multiple
+users to have access to the data structure in parallel - and not having
+to worry about the structure suddenly going away from under them just
+because they slept or did something else for a while. 
+
+Note that locking is _not_ a replacement for reference counting. 
+Locking is used to keep data structures coherent, while reference
+counting is a memory management technique.  Usually both are needed, and
+they are not to be confused with each other.
+
+Many data structures can indeed have two levels of reference counting,
+when there are users of different "classes".  The subclass count counts
+the number of subclass users, and decrements the global count just once
+when the subclass count goes to zero.
+
+Examples of this kind of "multi-reference-counting" can be found in
+memory management ("struct mm_struct": mm_users and mm_count), and in
+filesystem code ("struct super_block": s_count and s_active).
+
+Remember: if another thread can find your data structure, and you don't
+have a reference count on it, you almost certainly have a bug.
diff -u --recursive --new-file v2.4.9/linux/Documentation/Configure.help linux/Documentation/Configure.help
--- v2.4.9/linux/Documentation/Configure.help	Mon Aug 27 12:41:37 2001
+++ linux/Documentation/Configure.help	Thu Sep 20 20:56:31 2001
@@ -1746,6 +1746,36 @@
   similar) CPU, R4xx0 might be a safe bet.
   If the resulting Kernel does not work try to recompile with R3000.
 
+CPU type
+CONFIG_CPU_VR41XX
+  The options selects support for the NEC VR41xx series of processors.
+  Only choose this option if you have one of these processors as a
+  kernel built with this option will not run on any other type of
+  processor or vice versa.
+
+CPU feature configuration
+CONFIG_CPU_ADVANCED
+  Saying yes here allows you to select support for various features your
+  CPU may or may not have.  Most people should say N here.
+
+ll and sc instructions
+CONFIG_CPU_HAS_LLSC
+  Say Y here if your CPU has the ll and sc instructions.  Say Y here for
+  better performance, N if you don't know.  You must say Y here for
+  multiprocessor machines.
+
+lld and scd instructions
+CONFIG_CPU_HAS_LLDSCD
+  Say Y here if your CPU has the lld and scd instructions, the 64-bit
+  equivalents of ll and sc.  Say Y here for better performance, N if
+  you don't know.  You must say Y here for multiprocessor machines.
+
+Support for writebuffer flushing
+CONFIG_CPU_HAS_WB
+  Say N here for slightly better performance.  You must say Y here for
+  machines which require flushing of write buffers in software.  Saying
+  Y is the safe option; N may result in kernel malfunction and crashes.
+
 Support for large 64-bit configurations
 CONFIG_MIPS_INSANE_LARGE
   MIPS R10000 does support a 44 bit / 16TB address space as opposed to
@@ -2551,7 +2581,7 @@
 AMD Irongate support
 CONFIG_AGP_AMD
   This option gives you AGP support for the GLX component of the
-  XFree86 4.x on AMD Irongate chipset.
+  XFree86 4.x on AMD Irongate and 761 chipsets.
 
   For the moment, you should probably say N, unless you want to test
   the GLX component for XFree86 3.3.6, which can be downloaded from
@@ -8779,13 +8809,13 @@
   say M here and read Documentation/modules.txt. This is recommended.
   The module will be called sis900.o.
 
-Packet Engines Yellowfin Gigabit-NIC support
+Packet Engines Yellowfin Gigabit-NIC / Symbios 53c885 support
 CONFIG_YELLOWFIN
   Say Y here if you have a Packet Engines G-NIC PCI Gigabit Ethernet
-  adapter. This adapter is used by the Beowulf Linux cluster project.
-  See http://cesdis.gsfc.nasa.gov/linux/drivers/yellowfin.html for
-  more information about this driver in particular and Beowulf in
-  general.
+  adapter or the SYM53C885 Ethernet controller. The Gigabit adapter is
+  used by the Beowulf Linux cluster project.  See
+  http://cesdis.gsfc.nasa.gov/linux/drivers/yellowfin.html for more
+  information about this driver in particular and Beowulf in general.
 
   If you want to compile this driver as a module ( = code which can be
   inserted in and removed from the running kernel whenever you want),
@@ -11220,6 +11250,17 @@
   The module will be called keyspan_pda.o. If you want to compile it 
   as a module, say M here and read Documentation/modules.txt.
 
+USB Xircom / Entregra Single Port Serial Driver
+CONFIG_USB_SERIAL_XIRCOM
+  Say Y here if you want to use a Xircom or Entregra single port USB to
+  serial converter device.  This driver makes use of firmware
+  developed from scratch by Brian Warner.
+
+  This code is also available as a module ( = code which can be
+  inserted in and removed from the running kernel whenever you want).
+  The module will be called keyspan_pda.o. If you want to compile it
+  as a module, say M here and read <file:Documentation/modules.txt>.
+
 USB Keyspan USA-xxx Serial Driver
 CONFIG_USB_SERIAL_KEYSPAN
   Say Y here if you want to use Keyspan USB to serial converter
@@ -11478,6 +11519,45 @@
   The module will be called pegasus.o. If you want to compile it as a
   module, say M here and read Documentation/modules.txt.
 
+CONFIG_USB_KAWETH
+  Say Y here if you want to use one of the following 10Mbps only
+  USB Ethernet adapters based on the KLSI KL5KUSB101B chipset:
+       3Com 3C19250
+       ADS USB-10BT
+       ATEN USB Ethernet
+       ASANTE USB To Ethernet Adapter
+       AOX Endpoints USB Ethernet
+       Correga K.K.
+       D-Link DSB-650C and DU-E10
+       Entrega / Portgear E45
+       I-O DATA USB-ET/T
+       Jaton USB Ethernet Device Adapter
+       Kingston Technology USB Ethernet Adapter
+       Linksys USB10T
+       Mobility USB-Ethernet Adapter
+        NetGear EA-101
+       Peracom Enet and Enet2
+       Portsmith Express Ethernet Adapter
+       Shark Pocket Adapter
+       SMC 2202USB
+       Sony Vaio port extender
+
+  This driver is likely to work with most 10Mbps only USB Ethernet
+  adapters, including some "no brand" devices. It does NOT work on
+  SmartBridges smartNIC or on Belkin F5U111 devices - you should use
+  the CATC NetMate driver for those. If you are not sure which one
+  you need, select both, and the correct one should be selected for
+  you.
+
+  This driver makes the adapter appear as a normal Ethernet interface,
+  typically on eth0, if it is the only ethernet device, or perhaps on
+  eth1, if you have a PCI or ISA ethernet card installed.
+
+  This code is also available as a module ( = code which can be
+  inserted in and removed from the running kernel whenever you want).
+  The module will be called kaweth.o. If you want to compile it as a
+  module, say M here and read <file:Documentation/modules.txt>.
+
 USB CATC NetMate-based Ethernet device support
 CONFIG_USB_CATC
   Say Y if you want to use one of the following 10Mbps USB Ethernet
@@ -11532,6 +11612,20 @@
   Say Y here in order to have the USB Mass Storage code generate
   verbose debugging messages.
 
+ISD-200 USB/ATA driver
+CONFIG_USB_STORAGE_ISD200
+  Say Y here if you want to use USB Mass Store devices based
+  on the In-Systems Design ISD-200 USB/ATA bridge.
+
+  Some of the products that use this chip are:
+
+    - Archos Jukebox 6000
+    - ISD SmartCable for Storage
+    - Taiwan Skymaster CD530U/DEL-0241 IDE bridge
+    - Sony CRX10U CD-R/RW drive
+    - CyQ've CQ8060A CDRW drive
+    - Planex eXtreme Drive RX-25HU USB-IDE cable (not model RX-25U)
+
 USS720 parport driver
 CONFIG_USB_USS720
   This driver is for USB parallel port adapters that use the Lucent
@@ -11604,18 +11698,22 @@
   The module will be called dabusb.o. If you want to compile it as a
   module, say M here and read Documentation/modules.txt.
 
-PLUSB driver
-CONFIG_USB_PLUSB
-  A driver for the Prolific PL-2302 USB-to-USB network device. This
-  'USB cable' connects two hosts via a point-to-point network with
-  bandwidth of 5 Mbit/s. Configure this driver after connecting the
-  USB cable via ifconfig plusb0 10.0.0.1 pointopoint 10.0.0.2 (and
-  vice versa on the other host).
+Host-to-Host USB networking
+CONFIG_USB_USBNET
+  This driver supports network links over USB with USB "Network"
+  or "data transfer" cables, often used to network laptops to PCs.
+  Such cables have chips from suppliers such as NetChip and Prolific.
+  Intelligent USB devices could also use this approach to provide
+  Internet access, using standard USB cabling.
+
+  These links will have names like "usb0", "usb1", etc.  They act
+  like two-node Ethernets, so you can use 802.1d Ethernet Bridging
+  (CONFIG_BRIDGE) to simplify your network routing.
 
-  This code is also available as a module ( = code which can be
+  This code is also available as a kernel module (code which can be
   inserted in and removed from the running kernel whenever you want).
-  The module will be called plusb.o. If you want to compile it as a
-  module, say M here and read Documentation/modules.txt.
+  The module will be called usbnet.o. If you want to compile it as a
+  module, say M here and read <file:Documentation/modules.txt>.
 
 USB Diamond Rio500 support
 CONFIG_USB_RIO500
@@ -15754,6 +15852,14 @@
   better 32 MB RAM to avoid excessive linking time. This is only
   useful for kernel hackers. If unsure, say N.
 
+Run uncached
+CONFIG_MIPS_UNCACHED
+  If you say Y here there kernel will disable all CPU caches.  This will
+  reduce the system's performance dramatically but can help finding
+  otherwise hard to track bugs.  It can also useful if you're doing
+  hardware debugging with a logic analyzer and need to see all traffic
+  on the bus.
+
 Magic System Request Key support
 CONFIG_MAGIC_SYSRQ
   If you say Y here, you will have some control over the system even
@@ -16960,12 +17066,12 @@
 
 Motorola MPC8260 CPM support
 CONFIG_8260
-   The MPC8260 CPM (Communications Processor Module) is a typically
-   embedded CPU made by Motorola.  Selecting this option means that
-   you wish to build a kernel for a machine with specifically an 8260
-   for a CPU.
+  The MPC8260 CPM (Communications Processor Module) is a typical
+  embedded CPU made by Motorola. Selecting this option means that you
+  wish to build a kernel for a machine with specifically an 8260 for
+  a CPU.
 
-   If in doubt, say N.
+  If in doubt, say N.
 
 Workarounds for PPC601 bugs
 CONFIG_PPC601_SYNC_FIX
@@ -16983,11 +17089,190 @@
 CONFIG_ALL_PPC
   Linux currently supports several different kinds of PowerPC-based
   machines: Apple Power Macintoshes and clones (such as the Motorola
-  Starmax series), PReP (PowerPC Reference Platform) machines such as
-  the Motorola PowerStack, CHRP (Common Hardware Reference Platform), 
-  the embedded MBX boards from Motorola and many others. Currently, 
-  the default option is to build a kernel which works on the first 
-  three.  Support for other machines is currently incomplete.
+  Starmax series), PReP (PowerPC Reference Platform) machines (such
+  as the Motorola PowerStacks, Motorola cPCI/VME embedded systems,
+  and some IBM RS/6000 systems), CHRP (Common Hardware Reference
+  Platform), and several embedded PowerPC systems containing 4xx, 6xx,
+  7xx, 8xx, 74xx, and 82xx processors.  Currently, the default option
+  is to build a kernel which works on the first three. 
+
+Embedded 8xx Board Type
+CONFIG_RPXLITE
+  RPX-Lite:
+    Embedded Planet RPX Lite
+
+  RPX-Classic:
+    Embedded Planet RPX Classic Low-fat.
+
+  BSE-IP: 
+    Bright Star Engineering ip-Engine.
+
+  TQM823L:
+  TQM850L:
+  TQM855L:
+  TQM860L:
+    MPC8xx based family of mini modules, half credit card size,
+    up to 64 MB of RAM, 8 MB Flash, (Fast) Ethernet, 2 x serial ports,
+    2 x CAN bus interface, ...
+      Manufacturer: TQ Components, www.tq-group.de
+      Date of Release: October (?) 1999
+      End of Life: not yet :-)
+      URL:
+      - module: http://www.denx.de/PDF/TQM8xxLHWM201.pdf
+      - starter kit: http://www.denx.de/PDF/STK8xxLHWM201.pdf
+      - images: http://www.denx.de/embedded-ppc-en.html
+
+  FPS850L:
+    FingerPrint Sensor System (based on TQM850L)
+      Manufacturer: IKENDI AG, http://www.ikendi.com/
+      Date of Release: November 1999
+      End of life: end 2000 ?
+      URL: see TQM850L
+
+  SPD823TS:
+    MPC823 based board used in the "Tele Server" product
+    Manufacturer: Speech Design, http://www.speech-design.de/
+    Date of Release: Mid 2000 (?)
+    End of life: -
+    URL: http://www.speech-design.de/
+         select "English", then "Teleteam Solutions", then "TeleServer"
+
+  IVMS8:
+    MPC860 based board used in the "Integrated Voice Mail System",
+    Small Version (8 voice channels)
+    Manufacturer: Speech Design, http://www.speech-design.de/
+    Date of Release: December 2000 (?)
+    End of life: -
+    URL: http://www.speech-design.de/
+
+  IVML24:
+    MPC860 based board used in the "Integrated Voice Mail System", 
+    Large Version (24 voice channels)
+    Manufacturer: Speech Design, http://www.speech-design.de/
+    Date of Release: March 2001  (?)
+    End of life: -
+    URL: http://www.speech-design.de/
+
+  SM850:
+    Service Module (based on TQM850L)
+    Manufacturer: Dependable Computer Systems, http://www.decomsys.com/
+    Date of Release: end 2000 (?)
+    End of life: mid 2001 (?)
+    URL: http://www.tz-mikroelektronik.de/ServiceModule/index.html
+
+  HERMES:
+    Hermes-Pro ISDN/LAN router with integrated 8 x hub
+    Manufacturer: Multidata Gesellschaft für Datentechnik und Informatik
+      http://www.multidata.de/
+    Date of Release: 2000 (?)
+    End of life: -
+    URL: http://www.multidata.de/english/products/hpro.htm
+
+  IP860:	
+    VMEBus IP (Industry Pack) carrier board with MPC860
+    Manufacturer: MicroSys GmbH, http://www.microsys.de/
+    Date of Release: ?
+    End of life: -
+    URL: http://www.microsys.de/html/ip860.html
+
+  PCU_E:
+    PCU = Peripheral Controller Unit, Extended
+    Manufacturer: Siemens AG, ICN (Information and Communication Networks)
+    	http://www.siemens.de/page/1,3771,224315-1-999_2_226207-0,00.html
+    Date of Release: April 2001
+    End of life: August 2001
+    URL: n. a.
+
+Embedded 82xx Board Type
+CONFIG_EST8260
+  EST8260: Wind River System, Inc. EST SBC8260
+
+  TQM8260:
+    MPC8260 based module, little larger than credit card,
+    up to 128 MB global + 64 MB local RAM, 32 MB Flash,
+    32 kB EEPROM, 256 kB L@ Cache, 10baseT + 100baseT Ethernet,
+    2 x serial ports, ...
+      Manufacturer: TQ Components, www.tq-group.de
+      Date of Release: June 2001
+      End of Life: not yet :-)
+      URL: http://www.denx.de/PDF/TQM82xx_SPEC_Rev005.pdf
+
+  PM826:
+    Modular system with MPC8260 CPU
+    Manufacturer: MicroSys GmbH, http://www.microsys.de/
+    Date of Release: mid 2001
+    End of life: -
+    URL: http://www.microsys.de/html/pm826.html
+
+  CU824:
+    VMEBus Board with PCI extension with MPC8240 CPU
+    Manufacturer: MicroSys GmbH, http://www.microsys.de/
+    Date of Release: early 2001 (?)
+    End of life: -
+    URL: http://www.microsys.de/html/cu824.html
+
+AltiVec Kernel Support
+CONFIG_ALTIVEC
+  This option enables kernel support for the Altivec extensions to the
+  PowerPC processor. The kernel currently supports saving and restoring
+  altivec registers, and turning on the 'altivec enable' bit so user
+  processes can execute altivec instructions.
+
+  This option is only usefully if you have a processor that supports 
+  altivec (G4, otherwise known as 74xx series), but does not have
+  any affect on a non-altivec cpu (it does, however add code to the
+  kernel).
+
+  If in doubt, say Y here.
+
+Thermal Management Support
+CONFIG_TAU
+  G3 and G4 processors have an on-chip temperature sensor called the
+  'Thermal Assist Unit (TAU)', which, in theory, can measure the on-die
+  temperature within 2-4 degrees celcius. This option shows the current
+  on-die temperature in /proc/cpuinfo if the cpu supports it.
+
+  Unfortunately, on some chip revisions, this sensor is very inaccurate
+  and in some cases, does not work at all, so don't assume the cpu
+  temp is actually what /proc/cpuinfo says it is.
+
+Interrupt driven TAU driver
+CONFIG_TAU_INT
+  The TAU supports an interrupt driven mode which causes an interrupt
+  whenever the temperature goes out of range. This is the fastest way
+  to get notified the temp has exceeded a range. With this option off,
+  a timer is used to re-check the temperature periodically.
+
+  However, on some cpus it appears that the TAU interrupt hardware
+  is buggy and can cause a situation which would lead unexplained hard
+  lockups.
+
+  Unless you are extending the TAU driver, or enjoy kernel/hardware
+  debugging, leave this option off.
+
+Average high and low temp
+CONFIG_TAU_AVERAGE
+  The TAU hardware can compare the temperature to an upper and lower bound.
+  The default behavior is to show both the upper and lower bound in 
+  /proc/cpuinfo. If the range is large, the temperature is either changing
+  a lot, or the TAU hardware is broken (likely on some G4's). If the range
+  is small (around 4 degrees), the temperature is relatively stable.
+
+Support for CUDA based PowerMacs
+CONFIG_ADB_CUDA
+  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.
+
+  If unsure say Y.
+
+Support for PMU based PowerMacs
+CONFIG_ADB_PMU
+  This provides support for PMU based Power Macintosh systems.  This
+  includes all PowerBooks and all AGP-based machines.
+  
+  If unsure say Y.
 
 Power management support for PowerBooks
 CONFIG_PMAC_PBOOK
@@ -17005,13 +17290,6 @@
   have it autoloaded. The act of removing the module shuts down the
   sound hardware for more power savings.
 
-Mac-on-Linux support
-CONFIG_MOL
-  This option enables low-level support for Mac-on-Linux.
-  MOL lets you run MacOS and Linux simultaneously. Please
-  visit <http://www.maconlinux.org> for more information.
-  If unsure, say Y.
-
 ADB raw keycode support
 CONFIG_MAC_ADBKEYCODES
   This provides support for sending raw ADB keycodes to console
@@ -17148,16 +17426,6 @@
   and iBook computers. 
 
   This driver is also available as a module called gmac.o ( = code
-  which can be inserted in and removed from the running kernel
-  whenever you want). If you want to compile it as a module, say M
-  here and read Documentation/modules.txt.
-
-Symbios 53c885 (Synergy ethernet) support
-CONFIG_NCR885E
-  This is and Ethernet driver for the dual-function NCR 53C885
-  SCSI/Ethernet controller.
-
-  This driver is also available as a module called ncr885e.o ( = code
   which can be inserted in and removed from the running kernel
   whenever you want). If you want to compile it as a module, say M
   here and read Documentation/modules.txt.
diff -u --recursive --new-file v2.4.9/linux/Documentation/DocBook/Makefile linux/Documentation/DocBook/Makefile
--- v2.4.9/linux/Documentation/DocBook/Makefile	Wed Jul 25 17:10:16 2001
+++ linux/Documentation/DocBook/Makefile	Sun Sep 16 21:23:15 2001
@@ -24,10 +24,10 @@
 html:	$(HTML)
 
 %.eps: %.fig
-	-fig2dev -Leps $< $@
+	fig2dev -Leps $< $@
 
 %.jpeg: %.fig
-	-fig2dev -Ljpeg $< $@
+	fig2dev -Ljpeg $< $@
 
 %.sgml: %.c
 	echo "<programlisting>" > $@
@@ -88,6 +88,7 @@
 		$(TOPDIR)/arch/i386/kernel/mca.c \
 		$(TOPDIR)/arch/i386/kernel/mtrr.c \
 		$(TOPDIR)/drivers/char/misc.c \
+		$(TOPDIR)/kernel/printk.c \
 		$(TOPDIR)/drivers/net/net_init.c \
 		$(TOPDIR)/drivers/net/8390.c \
 		$(TOPDIR)/drivers/char/serial.c \
@@ -129,7 +130,7 @@
 		$(PERL) $(TOPDIR)/scripts/split-man $(TOPDIR)/Documentation/man
 
 parportbook: $(JPG-parportbook)
-parportbook.ps: $(EPS-parportbook)
+parportbook.ps parportbook.pdf: $(EPS-parportbook)
 parportbook.sgml: parportbook.tmpl $(TOPDIR)/drivers/parport/init.c
 	$(TOPDIR)/scripts/docgen $(TOPDIR)/drivers/parport/init.c <$< >$@
 
diff -u --recursive --new-file v2.4.9/linux/Documentation/DocBook/kernel-api.tmpl linux/Documentation/DocBook/kernel-api.tmpl
--- v2.4.9/linux/Documentation/DocBook/kernel-api.tmpl	Thu May 24 15:14:08 2001
+++ linux/Documentation/DocBook/kernel-api.tmpl	Sun Sep  9 12:00:55 2001
@@ -187,6 +187,11 @@
 !Edrivers/block/ll_rw_blk.c
   </chapter>
 
+  <chapter id="part">
+     <title>Partition Handling</title>
+!Edrivers/block/genhd.c
+  </chapter>
+
   <chapter id="miscdev">
      <title>Miscellaneous Devices</title>
 !Edrivers/char/misc.c
diff -u --recursive --new-file v2.4.9/linux/Documentation/DocBook/parportbook.tmpl linux/Documentation/DocBook/parportbook.tmpl
--- v2.4.9/linux/Documentation/DocBook/parportbook.tmpl	Sun Aug 12 13:27:58 2001
+++ linux/Documentation/DocBook/parportbook.tmpl	Fri Sep  7 18:15:17 2001
@@ -1654,6 +1654,16 @@
 
       </listitem></varlistentry>
 
+     <varlistentry><term><constant>PPGETMODE</constant></term>
+      <listitem>
+
+       <para>
+	Retrieves the current IEEE 1284 mode to use for
+	<function>read</function> and <function>write</function>.
+       </para>
+
+      </listitem></varlistentry>
+
      <varlistentry><term><constant>PPGETTIME</constant></term>
       <listitem>
 
@@ -1681,6 +1691,36 @@
 	should be a pointer to a <structname>struct
 	timeval</structname>.
        </para>
+
+      </listitem></varlistentry>
+
+     <varlistentry><term><constant>PPGETMODES</constant></term>
+      <listitem>
+
+       <para>
+	Retrieves the capabilities of the hardware (i.e. the
+	<structfield>modes</structfield> field of the
+	<structname>parport</structname> structure).
+       </para>
+
+      </listitem></varlistentry>
+
+     <varlistentry><term><constant>PPSETFLAGS</constant></term>
+      <listitem>
+
+       <para>
+	Sets flags on the <literal>ppdev</literal> device which can
+	affect future I/O operations.  Available flags are:
+       </para>
+
+       <itemizedlist spacing=compact>
+	<listitem><para>
+	  <constant>PP_FASTWRITE</constant></para></listitem>
+	<listitem><para>
+	  <constant>PP_FASTREAD</constant></para></listitem>
+	<listitem><para>
+	  <constant>PP_W91284PIC</constant></para></listitem>
+       </itemizedlist>
 
       </listitem></varlistentry>
 
diff -u --recursive --new-file v2.4.9/linux/Documentation/DocBook/procfs-guide.tmpl linux/Documentation/DocBook/procfs-guide.tmpl
--- v2.4.9/linux/Documentation/DocBook/procfs-guide.tmpl	Tue Jul  3 17:08:18 2001
+++ linux/Documentation/DocBook/procfs-guide.tmpl	Sat Sep  8 12:20:25 2001
@@ -207,7 +207,7 @@
         will return <constant>NULL</constant>. <xref
         linkend="userland"> describes how to do something useful with
         regular files.
-      <para>
+      </para>
 
       <para>
         Note that it is specifically supported that you can pass a
@@ -577,7 +577,7 @@
         the <structfield>owner</structfield> field in the
         <structname>struct proc_dir_entry</structname> to
         <constant>THIS_MODULE</constant>.
-      <para>
+      </para>
 
       <programlisting>
 struct proc_dir_entry* entry;
diff -u --recursive --new-file v2.4.9/linux/Documentation/arm/SA1100/Assabet linux/Documentation/arm/SA1100/Assabet
--- v2.4.9/linux/Documentation/arm/SA1100/Assabet	Fri May 12 11:21:20 2000
+++ linux/Documentation/arm/SA1100/Assabet	Fri Sep  7 09:28:38 2001
@@ -9,38 +9,268 @@
 http://www.cs.cmu.edu/~wearable/software/assabet.html
 
 
-To build the kernel:
+Building the kernel
+-------------------
+
+To build the kernel with current defaults:
 
 	make assabet_config
-	make config
-	[accept all defaults]
+	make oldconfig
 	make dep
 	make zImage
 
-Typically, you'll need angelboot to load the kernel.
-The following angelboot.opt file should be used:
+The resulting kernel image should be available in linux/arch/arm/boot/zImage.
+
+
+Installing a bootloader
+-----------------------
+
+A couple of bootloaders able to boot Linux on Assabet are available:
+
+BLOB (http://www.lart.tudelft.nl/lartware/blob/)
+
+   BLOB is a bootloader used within the LART project.  Some contributed
+   patches were merged into BLOB to add support for Assabet.
+
+Compaq's Bootldr + John Dorsey's patch for Assabet support
+(http://www.handhelds.org/Compaq/bootldr.html)
+(http://www.wearablegroup.org/software/bootldr/)
+
+   Bootldr is the bootloader developed by Compaq for the iPAQ Pocket PC.
+   John Dorsey has produced add-on patches to add support for Assabet and
+   the JFFS filesystem.
+
+RedBoot (http://sources.redhat.com/redboot/)
+
+   RedBoot is a bootloader developed by Red Hat based on the eCos RTOS
+   hardware abstraction layer.  It supports Assabet amongst many other
+   hardware platforms.
+
+RedBoot is currently the recommended choice since it's the only one to have
+networking support, and is the most actively maintained.
+
+Brief examples on how to boot Linux with RedBoot are shown below.  But first
+you need to have RedBoot installed in your flash memory.  A known to work
+precompiled RedBoot binary is available from the following location:
+
+ftp://ftp.netwinder.org/users/n/nico/
+ftp://ftp.arm.linux.org.uk/pub/linux/arm/people/nico/
+ftp://ftp.handhelds.org/pub/linux/arm/sa-1100-patches/
+
+Look for redboot-assabet*.tgz.  Some installation infos are provided in
+redboot-assabet*.txt.
+
+
+Initial RedBoot configuration
+-----------------------------
+
+The commands used here are explained in The RedBoot User's Guide available
+on-line at http://sources.redhat.com/ecos/docs-latest/redboot/redboot.html.
+Please refer to it for explanations.
+
+If you have a CF network card (my Assabet kit contained a CF+ LP-E from
+Socket Communications Inc.), you should strongly consider using it for TFTP
+file transfers.  You must insert it before RedBoot runs since it can't detect
+it dynamically.
+
+To initialize the flash directory:
+
+	fis init -f
+
+To initialize the non-volatile settings, like whether you want to use BOOTP or
+a static IP address, etc, use this command:
+
+	fconfig -i
+
+
+Writing a kernel image into flash
+---------------------------------
+
+First, the kernel image must be loaded into RAM.  If you have the zImage file
+available on a TFTP server:
+
+	load zImage -r -b 0x100000
+
+If you rather want to use Y-Modem upload over the serial port:
+
+	load -m ymodem -r -b 0x100000
+
+To write it to flash:
+
+	fis create "Linux kernel" -b 0x100000 -l 0xc0000
+
+
+Booting the kernel
+------------------
+
+The kernel still requires a filesystem to boot.  A ramdisk image can be loaded
+as follows:
+
+	load ramdisk_image.gz -r -b 0x800000
+
+Again, Y-Modem upload can be used instead of TFTP by replacing the file name
+by '-y ymodem'.
+
+Now the kernel can be retrieved from flash like this:
+
+	fis load "Linux kernel"
+
+or loaded as described previously.  To boot the kernel:
+
+	exec -b 0x100000 -l 0xc0000
+
+The ramdisk image could be stored into flash as well, but there are better
+solutions for on-flash filesystems as mentioned below.
+
+
+Using JFFS2
+-----------
+
+Using JFFS2 (the Second Journaling Flash File System) is probably the most
+convenient way to store a writable filesystem into flash.  JFFS2 is used in
+conjunction with the MTD layer which is responsible for low-level flash
+management.  More information on the Linux MTD can be found on-line at:
+http://www.linux-mtd.infradead.org/.  A JFFS howto with some infos about
+creating JFFS/JFFS2 images is available from the same site.
+
+For instance, a sample JFFS2 image can be retrieved from the same FTP sites
+mentioned below for the precompiled RedBoot image.
+
+To load this file:
+
+	load sample_img.jffs2 -r -b 0x100000
+
+The result should look like:
+
+RedBoot> load sample_img.jffs2 -r -b 0x100000
+Raw file loaded 0x00100000-0x00377424
+
+Now we must know the size of the unallocated flash:
+
+	fis free
+
+Result:
+
+RedBoot> fis free
+  0x500E0000 .. 0x503C0000
+
+The values above may be different depending on the size of the filesystem and
+the type of flash.  See their usage below as an example and take care of
+substituting yours appropriately.
+
+We must determine some values:
+
+size of unallocated flash:	0x503c0000 - 0x500e0000 = 0x2e0000
+size of the filesystem image:	0x00377424 - 0x00100000 = 0x277424
+
+We want to fit the filesystem image of course, but we also want to give it all
+the remaining flash space as well.  To write it:
+
+	fis unlock -f 0x500E0000 -l 0x2e0000
+	fis erase -f 0x500E0000 -l 0x2e0000
+	fis write -b 0x100000 -l 0x277424 -f 0x500E0000
+	fis create "JFFS2" -n -f 0x500E0000 -l 0x2e0000
+
+Now the filesystem is associated to a MTD "partition" once Linux has discovered
+what they are in the boot process.  From Redboot, the 'fis list' command
+displays them:
+
+RedBoot> fis list
+Name              FLASH addr  Mem addr    Length      Entry point
+RedBoot           0x50000000  0x50000000  0x00020000  0x00000000
+RedBoot config    0x503C0000  0x503C0000  0x00020000  0x00000000
+FIS directory     0x503E0000  0x503E0000  0x00020000  0x00000000
+Linux kernel      0x50020000  0x00100000  0x000C0000  0x00000000
+JFFS2             0x500E0000  0x500E0000  0x002E0000  0x00000000
+
+However Linux should display something like:
+
+SA1100 flash: probing 32-bit flash bus
+SA1100 flash: Found 2 x16 devices at 0x0 in 32-bit mode
+Using RedBoot partition definition
+Creating 5 MTD partitions on "SA1100 flash":
+0x00000000-0x00020000 : "RedBoot"
+0x00020000-0x000e0000 : "Linux kernel"
+0x000e0000-0x003c0000 : "JFFS2"
+0x003c0000-0x003e0000 : "RedBoot config"
+0x003e0000-0x00400000 : "FIS directory"
+
+What's important here is the position of the partition we are interested in,
+which is the third one.  Within Linux, this correspond to /dev/mtdblock2.
+Therefore to boot Linux with the kernel and its root filesystem in flash, we
+need this RedBoot command:
+
+	fis load "Linux kernel"
+	exec -b 0x100000 -l 0xc0000 -c "root=/dev/mtdblock2"
+
+Of course other filesystems than JFFS might be used, like cramfs for example.
+You might want to boot with a root filesystem over NFS, etc.  It is also
+possible, and sometimes more convenient, to flash a filesystem directly from
+within Linux while booted from a ramdisk or NFS.  The Linux MTD repository has
+many tools to deal with flash memory as well, to erase it for example.  JFFS2
+can then be mounted directly on a freshly erased partition and files can be
+copied over directly.  Etc...
+
+
+RedBoot scripting
+-----------------
+
+All the commands above aren't so useful if they have to be typed in every
+time the Assabet is rebooted.  Therefore it's possible to automatize the boot
+process using RedBoot's scripting capability.
+
+For example, I use this to boot Linux with both the kernel and the ramdisk
+images retrieved from a TFTP server on the network:
+
+RedBoot> fconfig
+Run script at boot: false true
+Boot script:
+Enter script, terminate with empty line
+>> load zImage -r -b 0x100000
+>> load ramdisk_ks.gz -r -b 0x800000
+>> exec -b 0x100000 -l 0xc0000
+>>
+Boot script timeout (1000ms resolution): 3
+Use BOOTP for network configuration: true
+GDB connection port: 9000
+Network debug at boot time: false
+Update RedBoot non-volatile configuration - are you sure (y/n)? y
+
+Then, rebooting the Assabet is just a matter of waiting for the login prompt.
+
+
+
+Nicolas Pitre
+nico@cam.org
+June 12, 2001
+
+
+Status of peripherals in -rmk tree
+----------------------------------
+
+Assabet:
+ Serial ports:
+  Radio:	TX, RX, CTS, DSR, DCD, RI
+  COM:		TX, RX, CTS, DSR, DCD, RTS, DTR, PM
+  I2C:		TX, RX
+  L3:		No
+
+ Video:
+  LCD:		PM
+  Video out:	Not fully
+  Touchscreen:	No
+
+ Audio:
+  Codec:	No
+  POTS:		No
+
+ Other:
+  PCMCIA:	Yes
+  USB:		No
 
------ begin angelboot.opt -----
-base 0xc0008000
-entry 0xc0008000
-r0 0x00000000
-r1 0x00000019
-device /dev/ttyS1
-options "9600 8N1"
-baud 115200
-otherfile ramdisk_img.gz
-otherbase 0xc0800000
-exec minicom
------ end angelboot.opt -----
-
-Then load the kernel and ramdisk with:
-
-	angelboot -f angelboot.opt zImage
-
-Here it is assumed that your Assabet is connected to ttyS1 and that
-minicom is preconfigured with /dev/ttyS1, 9600 baud, 8N1, no flow control
-by default.
+Neponset:
+ Serial ports:
+  COM1,2:	TX, RX, CTS, DSR, DCD, RTS, DTR
 
-This is work in progress...
+More stuff can be found in the -np (Nicolas Pitre's) tree.
 
-Please send any patches to nico@cam.org.
diff -u --recursive --new-file v2.4.9/linux/Documentation/arm/SA1100/DMA linux/Documentation/arm/SA1100/DMA
--- v2.4.9/linux/Documentation/arm/SA1100/DMA	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/arm/SA1100/DMA	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,248 @@
+Support functions for the SA11x0 internal DMA channels
+======================================================
+
+Nicolas Pitre <nico@cam.org>
+Last updated: 2001/07/15
+
+
+The DMA controller consists of six independent DMA channels. Each channel
+can be configured to service any of the serial controllers. Two channels
+are required to service a full-duplex serial controller. The DMA
+controller is intended to relieve the processor of the interrupt overhead
+in servicing these ports with programmed I/ O.
+
+If desired, any or all peripherals (except the UDC) may be serviced with
+programmed I/ O instead of DMA. Each peripheral is capable of requesting
+processor service through its own interrupt lines or through a DMA
+request.
+
+A set of functions is provided to support drivers working with DMA buffers
+through a generic interface for (wishfully) all DMA usages.  Those
+functions will take care of buffer queueing and splitting, DMA register
+management, interrupt handling, etc.
+
+
+SA11x0 DMA API
+--------------
+
+Here is the description for the DMA API.
+
+
+int sa1100_request_dma( dmach_t *channel, const char *device_id,
+			dma_device_t device );
+
+This function will search for a free DMA channel and returns the channel
+number in '*channel'.  'device_id' should point to a string identifying
+the DMA usage or device (mainly for /proc).  'device' is the SA11x0
+peripheral's ports.  Note that reading from a port and writing to the
+same port are actually considered as two different streams requiring
+two DMA channels with their own device type.  All possible dma_device_t
+are defined in include/asm-arm/arch-sa1100/dma.h.  If no channel is
+available, or if the desired device is already in use by another DMA
+channel, then an error code is returned.  This function must be called
+before any other DMA calls.
+
+
+int sa1100_dma_queue_buffer( dmach_t channel, void *buf_id,
+                             dma_addr_t data, int size );
+
+This function enqueue the specified buffer for DMA processing.  The buffer
+will be transmitted or filled with incoming data depending on the channel
+configuration made through sa1100_dma_set_device().  If the queue is
+empty, DMA starts immediately on the given buffer.
+
+Arguments are:
+
+dmach_t channel:	the channel number.
+void *buf_id:		a buffer identification known by the caller.
+dma_addr_t data:	the buffer's physical address.
+int size:		the buffer size in bytes.
+
+Note here the dma_addr_t which is not the same as the virtual address as
+returned by kmalloc() and friends.  The DMA controller must be given a
+physical address to a buffer which is not cached bye the CPU data cache.
+To get such address, the DMA mapping functions (see
+Documentation/DMA-mapping.txt) are recommended.  The only relevant
+functions are pci_alloc_consistent(), pci_map_single() and their unmap
+counterparts.  The PCI dev argument is NULL of course.
+
+There is no restriction on the buffer size.  The DMA code will split it up
+internally to acommodate the DMA controller as needed.  If the buffer
+can't be enqueued the appropriate error code is returned.
+
+
+int sa1100_dma_set_callback( dmach_t channel, dma_callback_t cb );
+
+As soon as the DMa completes with a buffer, a callback function is used to
+notify the driver which would have registered one.  The callback function
+is prototyped as:
+
+void dma_callback( void *buf_id, int size );
+
+The 'buf_id' argument is the buffer identifier as passed to
+sa1100_dma_queue_buffer().  The 'size' argument is the number of bytes the
+DMA processed (should be the same as the buffer size).
+
+Note that this callback function is called while in interrupt context.
+So it has to be small and efficient while posponing more complex
+processing to a bottom-half function or similar.  All
+restrictions for interrupt handlers still apply.
+
+
+int sa1100_dma_get_current( dmach_t channel, void **buf_id,
+                            dma_addr_t *addr );
+
+This returns the buffer ID and the DMA address pointer within the buffer
+currently being processed.  If no such buffer is currently processed, an
+error code is returned.  This is useful for mmap()'ed buffers like in
+audio drivers.
+
+
+int sa1100_dma_stop( dmach_t channel );
+
+This call stops any DMA transfer on the given channel.
+
+
+int sa1100_dma_resume( dmach_t channel );
+
+This call resumes a DMA transfer which would have been stopped through
+sa1100_dma_stop().
+
+
+int sa1100_dma_flush_all( dmach_t channel );
+
+This completely flushes all queued buffers and on-going DMA transfers on a
+given channel.  The next enqueued buffer following this call will be
+processed right away.
+
+
+int sa1100_dma_set_spin( dmach_t channel, dma_addr_t addr, int size );
+
+Because there is at least one device out there that uses its receive
+signal for its transmit clock reference, we need a mecanism to make the
+DMA "spin" on a certain buffer for when there is no more actual buffer to
+process.  The 'addr' argument is the physical memory address to use, and
+the 'size' argument determines the spin DMA chunk.  This size can't be
+larger than 8191 (if so, it is clamped to 4096).  When the size is 0,
+the spin function is turned off.
+
+When activated, DMA will "spin" until there is any buffer in the queue.
+The current DMA chunk will terminate before a newly queued buffer is
+processed.  The spin buffer will only be reused when there is no more
+acctual buffer to process.
+
+It is important not to choose a too small 'size' value since it will
+greatly increase the interrupt load required to restart the spin.  Since
+this feature will typically be used on transmit DMAs, and because a buffer
+full of zeros is probably the best thing to spin out, the 'addr' argument
+may well be used with FLUSH_BASE_PHYS for which no allocation nor memory
+bus request are needed.
+
+The spinning DMA is affected by sa1100_dma_stop() and sa1100_dma_resume()
+but not bu sa1100_dma_flush_all().
+
+
+void sa1100_free_dma( dmach_t channel );
+
+This clears all activities on a given DMA channel and releases it for
+future requests.
+
+
+Buffer allocation
+-----------------
+
+Like mentionned above, it is the driver's responsibility to allocate, free
+and keep track of buffer space with dma_addr_t type addresses. However the
+driver must not change the state of any buffer after it has been sent to
+sa1100-dma_queue_buffer().  When that function has been called, the buffer
+becomes the DMA's ownership until one of these events occur:
+
+- The callback function is called by the DMA code with a buffer ID to
+  indicate that DMA processing terminated on that buffer.  Then the
+  driver owns the buffer again.
+- The sa1100-dma_flush_all() function is called by the driver at which
+  point *all* queued buffers are owned by the driver again.
+- The sa1100-free_dma() does the same as sa1100-dma_flush_all().
+
+This doesn't mean that you can't change the content of a queued buffer in
+conjonction with the usage of pci_map_consistent() and
+sa1100_dma_get_current()... but then you must be sure you know what you're
+doing (this doesn't work with pci_map_single()).
+
+
+Examples
+--------
+
+A real example of audio ring buffers is implemented in the
+drivers/sound/sa1100-audio.c driver.  The SA1110 USB client and the
+SA11x0 FIR drivers are also using this interface to implement packetized
+DMA.
+
+A transmit DMA for network packets could look like this (largely simplified):
+
+struct sk_buff *tx_ring_skb[RING_SIZE];
+dma_addr_t      tx_ring_dma[RING_SIZE];
+int cur_tx;
+...
+
+transmit function:
+
+	tx_ring_skb[cur_tx] = skb;
+	tx_ring_dma[cur_tx] = pci_map_single(NULL, skb->data, skb->len,
+	                                     PCI_DMA_TODEVICE);
+	sa1100_dma_queue_buffer(channel, (void*)cur_tx,
+	                        tx_ring_dma[cur_tx], skb->len);
+	cur_tx++; cur_tx %= RING_SIZE;
+	...
+
+and the callback function:
+
+void tx_done_callback( void *buf_id, int size ) {
+	int done_tx = (int) buf_id;
+	struct sk_buff *skb = tx_ring_skb[done_tx];
+	pci_unmap_single(NULL, tx_ring_dma[done_tx], skb->len,
+	                 PCI_DMA_TODEVICE);
+	stats.tx_packets++;
+	stats.tx_bytes += size;
+	dev_kfree_skb_irq(skb);
+	tx_ring_skb[done_tx] = NULL;
+}
+
+
+For drivers expecting variable length packets i.e. USB client, it is
+necessary to register the appropriate IRQ to be notified when the receiver
+is idle, the packet is complete, etc.  We could use one buffer at a time
+with its ID being the virtual address of the buffer.
+
+Then the sequence:
+
+	/* be sure DMA won't continue under our feet */
+	sa1100_dma_stop(channel);
+	/* get the actual DMA length */
+	sa1100_get_current(channel, &data, &dma_ptr);
+	/* acquire ownership for the buffer */
+	sa1100_dma_flush_all(channel);
+	/* unmap the DMA buffer (actually doing cache coherency on ARM) */
+	pci_unmap_single (NULL, dma_addr, MAX_PKT_SIZE, PCI_DMA_FROMDEVICE);
+	/* get remaining bytes from the fifo */
+	ptr = data + dma_ptr - dma_addr;
+	while (fifo_not_empty)
+		*ptr++ = get_byte_from_fifo;
+	/* feed another free buffer for the next packet */
+	dma_addr2 = pci_map_single(NULL, data2, MAX_PKT_SIZE,
+					PCI_DMA_FROMDEVICE);
+	sa1100_dma_queue_buffer(channel, data2, dma_addr2, MAX_PKT_SIZE);
+	/* process the current packet */
+	...
+
+might do the trick.  This looks a bit ugly but that's a starting point for
+improvements.
+
+
+TODO
+----
+
+- Create kernel-doc comments in the source to document the API and
+  let the documentation be generated automatically.
+
+
diff -u --recursive --new-file v2.4.9/linux/Documentation/arm/SA1100/FreeBird linux/Documentation/arm/SA1100/FreeBird
--- v2.4.9/linux/Documentation/arm/SA1100/FreeBird	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/arm/SA1100/FreeBird	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,21 @@
+Freebird-1.1 is produced by Legned(C) ,Inc.
+(http://www.legend.com.cn)
+and software/linux mainatined by Coventive(C),Inc.
+(http://www.coventive.com)
+
+Based on the Nicolas's strongarm kernel tree.
+
+===============================================================
+Maintainer:
+
+Chester Kuo <chester@coventive.com>
+	    <chester@linux.org.tw>
+
+Author :
+Tim wu <timwu@coventive.com>
+CIH <cih@coventive.com>
+Eric Peng <ericpeng@coventive.com>
+Jeff Lee <jeff_lee@coventive.com>
+Allen Cheng
+Tony Liu <tonyliu@coventive.com>
+
diff -u --recursive --new-file v2.4.9/linux/Documentation/arm/SA1100/GraphicsClient linux/Documentation/arm/SA1100/GraphicsClient
--- v2.4.9/linux/Documentation/arm/SA1100/GraphicsClient	Mon Nov 27 17:07:59 2000
+++ linux/Documentation/arm/SA1100/GraphicsClient	Fri Sep  7 09:28:38 2001
@@ -1,15 +1,18 @@
-ADS GraphicsClient/ThinClient Single Board Computer
+ADS GraphicsClient Plus Single Board Computer
 
 For more details, contact Applied Data Systems or see
-http://www.flatpanels.com/products.html
+http://www.applieddata.net/products.html
 
 The original Linux support for this product has been provided by 
-Nicolas Pitre <nico@cam.org>.
+Nicolas Pitre <nico@cam.org>. Continued development work by
+Woojung Huh <whuh@applieddata.net>
 
 It's currently possible to mount a root filesystem via NFS providing a
-complete Linux environment.  Otherwise a ramdisk image may be used.  Use
-'make graphicsclient_config' before any 'make config'.  This will set up
-defaults for GraphicsClient/ThinClient support.
+complete Linux environment.  Otherwise a ramdisk image may be used.  The
+board supports MTD/JFFS, so you could also mount something on there.
+
+Use 'make graphicsclient_config' before any 'make config'.  This will set up
+defaults for GraphicsClient Plus support.
 
 The kernel zImage is linked to be loaded and executed at 0xc0200000.  
 Also the following registers should have the specified values upon entry:
@@ -17,8 +20,18 @@
 	r0 = 0
 	r1 = 29	(this is the GraphicsClient architecture number)
 
-Here is a tipical angel.opt option file if the kernel is loaded through
-the Angel Debug Monitor:
+Linux can  be used with the ADS BootLoader that ships with the
+newer rev boards. See their documentation on how to load Linux.
+Angel is not available for the GraphicsClient Plus AFAIK.
+
+There is a  board known as just the GraphicsClient that ADS used to
+produce but has end of lifed. This code will not work on the older
+board with the ADS bootloader, but should still work with Angel,
+as outlined below.  In any case, if you're planning on deploying
+something en masse, you should probably get the newer board.
+
+If using Angel on the older boards, here is a typical angel.opt option file
+if the kernel is loaded through the Angel Debug Monitor:
 
 ----- begin angelboot.opt -----
 base 0xc0200000
@@ -26,7 +39,7 @@
 r0 0x00000000
 r1 0x0000001d
 device /dev/ttyS1
-options "9600 8N1"
+options "38400 8N1"
 baud 115200
 #otherfile ramdisk.gz
 #otherbase 0xc0800000
@@ -39,7 +52,7 @@
 	angelboot -f angelboot.opt zImage
 
 Here it is assumed that the board is connected to ttyS1 on your PC
-and that minicom is preconfigured with /dev/ttyS1, 9600 baud, 8N1, no flow
+and that minicom is preconfigured with /dev/ttyS1, 38400 baud, 8N1, no flow
 control by default.
 
 If any other bootloader is used, ensure it accomplish the same, especially
@@ -47,19 +60,39 @@
 
 
 Supported peripherals:
-- SA1100 LCD frame buffer (only 8bpp yet)
-- on-board SMC 92C94 ethernet NIC
+- SA1100 LCD frame buffer (8/16bpp...sort of)
+- on-board SMC 92C96 ethernet NIC
 - SA1100 serial port
-- flash memory access
+- flash memory access (MTD/JFFS)
 - pcmcia
-- possibly UCB1200 audio (not tested yet)
+- touchscreen(ucb1200)
+- ps/2 keyboard
+- console on LCD screen
+- serial ports (ttyS[0-2])
+  - ttyS0 is default for serial console
+- Smart I/O (ADC, keypad, digital inputs, etc)
+  See http://www.applieddata.com/developers/linux for IOCTL documentation
+  and example user space code. ps/2 keybd is multiplexed through this driver
 
 To do:
-- touchscreen driver
-- 16bpp frame buffer support
-- extra (external) serial port driver
-- some console keyboard support (maybe IR?)
+- UCB1200 audio with new ucb_generic layer
 - everything else!  :-)
+
+Notes:
+
+- The flash on board is divided into 3 partitions.  mtd0 is where
+  the ADS boot ROM and zImage is stored.  It's been marked as
+  read-only to keep you from blasting over the bootloader. :)  mtd1 is
+  for the ramdisk.gz image.  mtd2 is user flash space and can be
+  utilized for either JFFS or if you're feeling crazy, running ext2
+  on top of it. If you're not using the ADS bootloader, you're
+  welcome to blast over the mtd1 partition also.
+
+- 16bpp mode requires a different cable than what ships with the board.
+  Contact ADS or look through the manual to wire your own. Currently,
+  if you compile with 16bit mode support and switch into a lower bpp
+  mode, the timing is off so the image is corrupted.  This will be
+  fixed soon.
 
 Any contribution can be sent to nico@cam.org and will be greatly welcome!
 
diff -u --recursive --new-file v2.4.9/linux/Documentation/arm/SA1100/HUW_WEBPANEL linux/Documentation/arm/SA1100/HUW_WEBPANEL
--- v2.4.9/linux/Documentation/arm/SA1100/HUW_WEBPANEL	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/arm/SA1100/HUW_WEBPANEL	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,18 @@
+The HUW_WEBPANEL is a product of the german company Hoeft & Wessel AG
+
+If you want more information, please visit
+http://www.hoeft-wessel.de
+
+To build the kernel:
+	make huw_webpanel_config
+	make oldconfig
+	[accept all defaults]
+	make dep
+	make zImage
+
+Mostly of the work is done by:
+Roman Jordan         jor@hoeft-wessel.de
+Christoph Schulz    schu@hoeft-wessel.de
+
+2000/12/18/
+
diff -u --recursive --new-file v2.4.9/linux/Documentation/arm/SA1100/Itsy linux/Documentation/arm/SA1100/Itsy
--- v2.4.9/linux/Documentation/arm/SA1100/Itsy	Wed Oct 20 16:29:07 1999
+++ linux/Documentation/arm/SA1100/Itsy	Fri Sep  7 09:28:38 2001
@@ -2,11 +2,38 @@
 Research Center in Palo Alto, CA. The Itsy project is one of several
 research projects at Compaq that are related to pocket computing.
 
-Itsy support has yet to be fully integrated in this kernel.  Linux 2.0.x
-support is available though.
-
 For more information, see:
 
 	http://www.research.digital.com/wrl/itsy/index.html
 
+Notes on initial 2.4 Itsy support (8/27/2000) :
+The port was done on an Itsy version 1.5 machine with a daughtercard with
+64 Meg of DRAM and 32 Meg of Flash. The initial work includes support for
+serial console (to see what you're doing).  No other devices have been
+enabled.
+
+To build, do a "make menuconfig" (or xmenuconfig) and select Itsy support.
+Disable Flash and LCD support. and then do a make dep and a make zImage.
+Finally, you will need to cd to arch/arm/boot/tools and execute a make there
+to build the params-itsy program used to boot the kernel.
+
+In order to install the port of 2.4 to the itsy, You will need to set the
+configuration parameters in the monitor as follows:
+Arg 1:0x08340000, Arg2: 0xC0000000, Arg3:18 (0x12), Arg4:0
+Make sure the start-routine address is set to 0x00060000.
+
+Next, flash the params-itsy program to 0x00060000 ("p 1 0x00060000" in the
+flash menu)  Flash the kernel in arch/arm/boot/zImage into 0x08340000
+("p 1 0x00340000").  Finally flash an initial ramdisk into 0xC8000000
+("p 2 0x0")  We used ramdisk-2-30.gz from the 0.11 version directory on
+handhelds.org.
+
+The serial connection we established was at:
+ 8-bit data, no parity, 1 stop bit(s), 115200.00 b/s. in the monitor, in the
+params-itsy program, and in the kernel itself.  This can be changed, but
+not easily. The monitor parameters are easily changed, the params program
+setup is assembly outl's, and the kernel is a configuration item specific to
+the itsy. (i.e. grep for CONFIG_SA1100_ITSY and you'll find where it is.)
+
 
+This should get you a properly booting 2.4 kernel on the itsy.
diff -u --recursive --new-file v2.4.9/linux/Documentation/arm/SA1100/PCMCIA linux/Documentation/arm/SA1100/PCMCIA
--- v2.4.9/linux/Documentation/arm/SA1100/PCMCIA	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/arm/SA1100/PCMCIA	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,374 @@
+Kernel Low-Level PCMCIA Interface Documentation
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+John G Dorsey <john+@cs.cmu.edu>
+Updated: 30 June, 2000
+
+
+Note: this interface has not been finalized!
+See also: http://www.cs.cmu.edu/~wearable/software/pcmcia-arm.html
+
+
+Introduction
+
+Early versions of PCMCIA Card Services for StrongARM were designed to
+permit a single socket driver to run on a variety of SA-1100 boards by
+using a userland configuration process. During the conversion to the 2.3
+kernel series, all of the configuration has moved into sub-drivers in the
+kernel proper (see linux/drivers/pcmcia/sa1100*). This document describes
+the low-level interface between those sub-drivers and the sa1100 socket
+driver module.
+
+Presently, there are six operations which must be provided by the
+board-specific code. Only functions whose implementation is likely to
+differ across board designs are required at this level. Some examples
+include:
+
+  - configuring card detect lines to generate interrupts
+  - sensing the legal voltage levels for inserted cards
+  - asserting the reset signal for a card
+
+Functions which are assumed to be the same across all designs are
+performed within the generic socket driver itself. Some examples of these
+kinds of operations include:
+
+  - configuring memory access times based on the core clock frequency
+  - reads/writes on memory, byte swizzling, ...
+
+The current implementation allows the specific per-board set of low-level
+operations to be determined at run time. For each specific board, the
+following structure should be filled in:
+
+  struct pcmcia_low_level {
+    int (*init)(struct pcmcia_init *);
+    int (*shutdown)(void);
+    int (*socket_state)(struct pcmcia_state_array *);
+    int (*get_irq_info)(struct pcmcia_irq_info *);
+    int (*configure_socket)(const struct pcmcia_configure *);
+  };
+
+The component functions are described in detail below. Using the
+machine_is_*() tests, the pointer `pcmcia_low_level' should be assigned to
+the location of the table for your board.
+
+
+0. init(struct pcmcia_init *init)
+
+This operation has three responsibilities:
+
+  - perform any board-specific initialization tasks
+  - associate the given handler with any interrupt-generating signals
+    such as card detection, or battery voltage detection
+  - set up any necessary edge detection for card ready signals
+
+Argument passing for this operation is implemented by the following
+structure:
+
+  struct pcmcia_init {
+    void (*handler)(int irq, void *dev, struct pt_regs *regs);
+    struct pcmcia_maps *maps;
+  };
+
+Here, `handler' is provided by the socket driver, and `maps' must be
+modified if the default mapping isn't appropriate. This operation should
+return one of two values:
+
+  - the highest-numbered socket available, plus one
+  - a negative number, indicating an error in configuration
+
+Note that the former case is _not_ the same as "the number of sockets
+available." In particular, if your design uses SA-1100 slot "one" but
+not slot "zero," you MUST report "2" to the socket driver.
+
+
+1. shutdown(void)
+
+This operation takes no arguments, and will be called during cleanup for
+the socket driver module. Any state associated with the socket controller,
+including allocated data structures, reserved IRQs, etc. should be
+released in this routine.
+
+The return value for this operation is not examined.
+
+
+2. socket_state(struct pcmcia_state_array *state_array)
+
+This operation will be invoked from the interrupt handler which was set up
+in the earlier call to init(). Note, however, that it should not include
+any side effects which would be inappropriate if the operation were to
+occur when no interrupt is pending. (An extra invocation of this operation
+currently takes place to initialize state in the socket driver.)
+
+Argument passing for this operation is handled by a structure which
+contains an array of the following type:
+
+  struct pcmcia_state {
+    unsigned detect: 1,
+              ready: 1,
+               bvd1: 1,
+               bvd2: 1,
+             wrprot: 1,
+              vs_3v: 1,
+              vs_Xv: 1;
+  };
+
+Upon return from the operation, a struct pcmcia_state should be filled in
+for each socket available in the hardware. For every array element (up to
+`size' in the struct pcmcia_state_saarray) which does not correspond to an
+available socket, zero the element bits. (This includes element [0] if
+socket zero is not used.)
+
+Regardless of how the various signals are routed to the SA-1100, the bits
+in struct pcmcia_state always have the following semantics:
+
+  detect - 1 if a card is fully inserted, 0 otherwise
+  ready  - 1 if the card ready signal is asserted, 0 otherwise
+  bvd1   - the value of the Battery Voltage Detect 1 signal
+  bvd2   - the value of the Battery Voltage Detect 2 signal
+  wrprot - 1 if the card is write-protected, 0 otherwise
+  vs_3v  - 1 if the card must be operated at 3.3V, 0 otherwise
+  vs_Xv  - 1 if the card must be operated at X.XV, 0 otherwise
+
+A note about the BVD signals: if your board does not make both lines
+directly observable to the processor, just return reasonable values. The
+standard interpretation of the BVD signals is:
+
+  BVD1  BVD2
+
+   0     x    battery is dead
+   1     0    battery warning
+   1     1    battery ok
+
+Regarding the voltage sense flags (vs_3v, vs_Xv), these bits should be set
+based on a sampling of the Voltage Sense pins, if available. The standard
+interpretation of the VS signals (for a "low-voltage" socket) is:
+
+  VS1   VS2
+
+   0     0    X.XV, else 3.3V, else none
+   0     1    3.3V, else none
+   1     0    X.XV, else none
+   1     1    5V, else none
+
+More information about the BVD and VS conventions is available in chapter
+5 of "PCMCIA System Architecture," 2nd ed., by Don Anderson.
+
+This operation should return 1 if an IRQ is actually pending for the
+socket controller, 0 if no IRQ is pending (but no error condition exists,
+such as an undersized state array), or -1 on any error.
+
+
+3. get_irq_info(struct pcmcia_irq_info *info)
+
+This operation obtains the IRQ assignment which is legal for the given
+socket. An argument of the following type is passed:
+
+  struct pcmcia_irq_info {
+    unsigned int sock;
+    unsigned int irq ;
+  };
+
+The `sock' field contains the socket index being queried. The `irq' field
+should contain the IRQ number corresponding to the card ready signal from
+the device.
+
+This operation should return 0 on success, or -1 on any error.
+
+
+4. configure_socket(const struct pcmcia_configure *configure)
+
+This operation allows the caller to apply power to the socket, issue a
+reset, or enable various outputs. The argument is of the following type:
+
+  struct pcmcia_configure {
+    unsigned sock: 8,
+              vcc: 8,
+              vpp: 8,
+           output: 1,
+          speaker: 1,
+            reset: 1;
+  };
+
+The `sock' field contains the index of the socket to be configured. The
+`vcc' and `vpp' fields contain the voltages to be applied for Vcc and Vpp,
+respectively, in units of 0.1V. (Note that vpp==120 indicates that
+programming voltage should be applied.)
+
+The two output enables, `output' and `speaker', refer to the card data
+signal enable and the card speaker enable, respectively. The `reset' bit,
+when set, indicates that the card reset should be asserted.
+
+This operation should return 0 on success, or -1 on any error.
+
+
+Board-Specific Notes
+
+The following information is known about various SA-11x0 board designs
+which may be used as reference while adding support to the kernel.
+
+
+Carnegie Mellon Itsy/Cue (http://www.cs.cmu.edu/~wearable/itsy/)
+
+  Itsy Chip Select 3 (CS3) Interface
+  ("ITSY MEMORY/PCMCIA ADD-ON BOARD with BATTERY and CHARGER CIRCUITRY,"
+   memo dated 5-20-99, from Tim Manns to Richard Martin, et. al)
+
+  Read:
+    ABVD2    (SS)D0          A slot, Battery Voltage Detect
+    ABVD1    (SS)D1
+    AVSS2    (SS)D2          A slot, Voltage Sense
+    AVSS1    (SS)D3
+    GND      (SS)D4
+    GND      (SS)D5
+    GND      (SS)D6
+    GND      (SS)D7
+  
+    BBVD2    (SS)D8          B slot, Battery Voltage Detect
+    BBVD1    (SS)D9
+    BVSS2    (SS)D10         B slot, Voltage Sense
+    BVSS1    (SS)D11
+    GND      (SS)D12
+    GND      (SS)D13
+    GND      (SS)D14
+    GND      (SS)D15
+  
+  Write:
+    (SS)D0   A_VPP_VCC       LTC1472 VPPEN1
+    (SS)D1   A_VPP_PGM       LTC1472 VPPEN0
+    (SS)D2   A_VCC_3         LTC1472 VCCEN0
+    (SS)D3   A_VCC_5         LTC1472 VCCEN1
+    (SS)D4   RESET (A SLOT)
+    (SS)D5   GND
+    (SS)D6   GND
+    (SS)D7   GND
+ 
+    (SS)D8   B_VPP_VCC       LTC1472 VPPEN1
+    (SS)D9   B_VPP_PGM       LTC1472 VPPEN0
+    (SS)D10  B_VCC_3         LTC1472 VCCEN0
+    (SS)D11  B_VCC_5         LTC1472 VCCEN1
+    (SS)D12  RESET (B SLOT)
+    (SS)D13  GND
+    (SS)D14  GND
+    (SS)D15  GND
+ 
+  GPIO pin assignments are as follows: (from schematics)
+ 
+    GPIO 10                  Slot 0 Card Detect
+    GPIO 11                  Slot 1 Card Detect
+    GPIO 12                  Slot 0 Ready/Interrupt
+    GPIO 13                  Slot 1 Ready/Interrupt
+
+
+
+Intel SA-1100 Multimedia Board (http://developer.intel.com/design/strong/)
+
+  CPLD Registers
+  SA-1100 Multimedia Development Board with Companion SA-1101 Development
+    Board User's Guide, p.4-42
+
+  This SA-1100/1101 development package uses only one GPIO pin (24) to
+  signal changes in card status, and requires software to inspect a
+  PCMCIA status register to determine the source.
+
+  Read: (PCMCIA Power Sense Register - 0x19400000)
+    S0VS1           0        Slot 0 voltage sense
+    S0VS2           1
+    S0BVD1          2        Slot 0 battery voltage sense
+    S0BVD2          3
+    S1VS1           4        Slot 1 voltage sense
+    S1VS2           5
+    S1BVD1          6        Slot 1 battery voltage sense
+    S1BVD2          7
+
+  Read/Write: (PCMCIA Power Control Register - 0x19400002)
+    S0VPP0          0        Slot 0 Vpp
+    S0VPP1          1
+    S0VCC0          2        Slot 0 Vcc
+    S0VCC1          3
+    S1VPP0          4        Slot 1 Vpp
+    S1VPP1          5
+    S1VCC0          6        Slot 1 Vcc
+    S1VCC1          7
+
+  Read: (PCMCIA Status Register - 0x19400004)
+    S0CD1           0        Slot 0 Card Detect 1
+    S0RDY           1        Slot 0 Ready/Interrupt
+    S0STSCHG        2        Slot 0 Status Change
+    S0Reset         3        Slot 0 Reset (RW)
+    S1CD1           4        Slot 1 Card Detect 1
+    S1RDY           5        Slot 1 Ready/Interrupt
+    S1STSCHG        6        Slot 1 Status Change
+    S1Reset         7        Slot 1 Reset (RW)
+
+
+
+Intel SA-1100 Evaluation Platform (http://developer.intel.com/design/strong/)
+
+  Brutus I/O Pins and Chipselect Register
+  pcmcia-brutus.c, by Ivo Clarysse
+  (What's the official reference for this info?)
+
+  This SA-1100 development board uses more GPIO pins than say, the Itsy
+  or the SA-1100/1101 multimedia package. The pin assignments are as
+  follows:
+
+    GPIO 2                   Slot 0 Battery Voltage Detect 1
+    GPIO 3                   Slot 0 Ready/Interrupt
+    GPIO 4                   Slot 0 Card Detect
+    GPIO 5                   Slot 1 Battery Voltage Detect 1
+    GPIO 6                   Slot 1 Ready/Interrupt
+    GPIO 7                   Slot 1 Card Detect
+
+  Like the Itsy, Brutus uses a chipselect register in static memory
+  bank 3 for the other signals, such as voltage sense or reset:
+
+  Read:
+    P0_VS1          8        Slot 0 Voltage Sense
+    P0_VS2          9
+    P0_STSCHG      10        Slot 0 Status Change
+    P1_VS1         12        Slot 1 Voltage Sense
+    P1_VS2         13
+    P1_STSCHG      14        Slot 1 Status Change
+
+  Read/Write:
+    P0_            16        Slot 0 MAX1600EAI control line
+    P0_            17        Slot 0 MAX1600EAI control line
+    P0_            18        Slot 0 MAX1600EAI control line
+    P0_            19        Slot 0 MAX1600EAI control line
+    P0_            20        Slot 0 12V
+    P0_            21        Slot 0 Vpp to Vcc (CONFIRM?)
+    P0_            22        Slot 0 enable fan-out drivers & xcvrs
+    P0_SW_RST      23        Slot 0 Reset
+    P1_            24        Slot 1 MAX1600EAI control line
+    P1_            25        Slot 1 MAX1600EAI control line
+    P1_            26        Slot 1 MAX1600EAI control line
+    P1_            27        Slot 1 MAX1600EAI control line
+    P1_            28        Slot 1 12V
+    P1_            29        Slot 1 Vpp to Vcc (CONFIRM?)
+    P1_            30        Slot 1 enable fan-out drivers & xcvrs
+    P1_SW_RST      31        Slot 1 Reset
+
+  For each slot, the bits labelled "MAX1600EAI" should (apparently)
+  be written with the value 0101 for Vcc 3.3V, and 1001 for Vcc 5V.
+
+
+
+Intel SA-1110 Development Platform (http://developer.intel.com/design/strong/)
+
+  GPIO Pin Descriptions and Board Control Register
+  SA-1110 Microprocessor Development Board User's Guide, p.4-7, 4-10
+
+  The Assabet board contains only a single Compact Flash slot,
+  attached to slot 1 on the SA-1110. Card detect, ready, and BVD
+  signals are routed through GPIO, with power and reset placed in a
+  control register. Note that the CF bus must be enabled before use.
+
+    GPIO 21                  Slot 1 Compact Flash interrupt
+    GPIO 22                  Slot 1 card detect (CD1 NOR CD2)
+    GPIO 24                  Slot 1 Battery Voltage Detect 2
+    GPIO 25                  Slot 1 Battery Voltage Detect 1
+
+  Write-only: (Board Control Register - 0x12000000)
+    CF_PWR          0        CF bus power (3.3V)
+    CF_RST          1        CF reset
+    CF_Bus_On       7        CF bus enable
+
diff -u --recursive --new-file v2.4.9/linux/Documentation/arm/SA1100/Pangolin linux/Documentation/arm/SA1100/Pangolin
--- v2.4.9/linux/Documentation/arm/SA1100/Pangolin	Mon Nov 27 17:07:59 2000
+++ linux/Documentation/arm/SA1100/Pangolin	Fri Sep  7 09:28:38 2001
@@ -1,25 +1,20 @@
-Pangolin is a StrongARM 1110-based evaluation  platform produced
-by Dialogue Technoloy (http://www.dialogue.com.tw/).
+Pangolin is a StrongARM 1110-based evaluation platform produced
+by Dialogue Technology (http://www.dialogue.com.tw/).
 It has EISA slots for ease of configuration with SDRAM/Flash
 memory card, USB/Serial/Audio card, Compact Flash card,
 and TFT-LCD card.
-This platform is currently under development.
 
 To compile for Pangolin, you must issue the following commands:
 
 	make pangolin_config
-	make config
-	[accept all defaults]
+	make oldconfig
 	make dep
 	make zImage
 
 Supported peripherals:
-- SA1110 serial port
+- SA1110 serial port (UART1/UART2/UART3)
 - flash memory access
-
-Testing:
-- pcmcia driver
-- sound driver
-
-To do:
-- MQ-200 driver
+- compact flash driver
+- UDA1341 sound driver
+- SA1100 LCD controller for 800x600 16bpp TFT-LCD
+- MQ-200 driver for 800x600 16bpp TFT-LCD
diff -u --recursive --new-file v2.4.9/linux/Documentation/arm/SA1100/Yopy linux/Documentation/arm/SA1100/Yopy
--- v2.4.9/linux/Documentation/arm/SA1100/Yopy	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/arm/SA1100/Yopy	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,2 @@
+See http://www.yopydeveloper.org for more.
+
diff -u --recursive --new-file v2.4.9/linux/Documentation/arm/SA1100/nanoEngine linux/Documentation/arm/SA1100/nanoEngine
--- v2.4.9/linux/Documentation/arm/SA1100/nanoEngine	Sun Aug 13 09:58:24 2000
+++ linux/Documentation/arm/SA1100/nanoEngine	Fri Sep  7 09:28:38 2001
@@ -4,6 +4,8 @@
 "nanoEngine" is a SA1110 based single board computer from 
 Bright Star Engineering Inc.  See www.brightstareng.com/arm
 for more info.
+(Ref: Stuart Adams <sja@brightstareng.com>)
 
-Ref: Stuart Adams <sja@brightstareng.com>
+Also visit Larry Doolittle's "Linux for the nanoEngine" site:
+http://recycle.lbl.gov/~ldoolitt/bse/
 
diff -u --recursive --new-file v2.4.9/linux/Documentation/arm/SA1100/serial_UART linux/Documentation/arm/SA1100/serial_UART
--- v2.4.9/linux/Documentation/arm/SA1100/serial_UART	Mon Nov 27 17:07:59 2000
+++ linux/Documentation/arm/SA1100/serial_UART	Fri Sep  7 09:28:38 2001
@@ -1,5 +1,4 @@
-The SA1100 serial port finally had its major/minor numbers officially 
-assigned:
+The SA1100 serial port had its major/minor numbers officially assigned:
 
 > Date: Sun, 24 Sep 2000 21:40:27 -0700
 > From: H. Peter Anvin <hpa@transmeta.com>
@@ -25,7 +24,7 @@
 >                   7 = /dev/cusa2                Callout device for ttySA2
 >
 
-So, if you're not using devfs, you must create those inodes in /dev
+If you're not using devfs, you must create those inodes in /dev
 on the root filesystem used by your SA1100-based device:
 
 	mknod ttySA0 c 204 5
@@ -35,31 +34,14 @@
 	mknod cusa1 c 205 6
 	mknod cusa2 c 205 7
 
-Note that the old incorrect use of /dev/ttyS0 in order to use the serial port 
-won't work anymore.  This device node is reserved to the conventionnal 16x50
-UART which may appear on devices like PCMCIA modem, etc.
-
-In addition to the creation of the appropriate device nodes above, you must
-ensure your user space applications make use of the correct device name.
-The classic example is the content of the /etc/inittab where you might have 
-a getty process started on ttyS0.  In this case you have two choices:
-
-1- replace occurences of ttyS0 with ttySA0, ttyS1 with ttySA1, etc.
-
-2- in the occurence of 'ttyS0', you may consider replacing it with 'console'.
-   as in "T0:12345:respawn:/sbin/getty -L console 9600 vt100"
-
-(don't forget to add 'ttySA0', 'console', or the appropriate tty name 
- in /etc/securetty for root to be allowed to login as well.)
-
-The use of /dev/console has the advantage of being independent of the real
-serial device used.  The kernel automatically forward all operations on
-/dev/console to the apropriate serial device.  The nature of the console may
-also be modified with a kernel command line parameter (see
-Documentation/serial-console.txt for the details).  Of course, 
-/dev/console must have been created as a char device with major 5 minor 1.
-
-Using /dev/console is also compatible with older kernels that used /dev/ttyS0.
-Therefore it is handy for ramdisk images which are targetted for different
-StrongARM platforms and older kernels.
+In addition to the creation of the appropriate device nodes above, you
+must ensure your user space applications make use of the correct device
+name. The classic example is the content of the /etc/inittab file where
+you might have a getty process started on ttyS0.  In this case:
+
+- replace occurences of ttyS0 with ttySA0, ttyS1 with ttySA1, etc.
+
+- don't forget to add 'ttySA0', 'console', or the appropriate tty name
+  in /etc/securetty for root to be allowed to login as well.
+
 
diff -u --recursive --new-file v2.4.9/linux/Documentation/fb/README-sstfb.txt linux/Documentation/fb/README-sstfb.txt
--- v2.4.9/linux/Documentation/fb/README-sstfb.txt	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/fb/README-sstfb.txt	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,167 @@
+
+Introduction
+
+	  This is a frame buffer device driver for 3dfx' Voodoo Graphics 
+	(aka voodoo 1, aka sst1) and Voodoo² (aka Voodoo 2, aka CVG) based 
+	video boards. It's highly experimental code, but is guaranteed to work
+	on my computer, with my "Maxi Gamer 3D" and "Maxi Gamer 3d²" boards,
+	and with me "between chair and keyboard". Some people tested other
+	combinations and it seems that it works.
+	  The main page is located at <http://sstfb.sourceforge.net>, and if
+	you want the latest version, check out the CVS, as the driver is a work
+	in progress, i feel incomfortable with releasing tarballs of something
+	not completely working...Don't worry, it's still more than useable
+	(I eat my own dog food)
+
+	  Please read the Bug section, and report any success or failure to me
+	(Ghozlane Toumi <gtoumi@messel.emse.fr>).
+	  BTW, If you have only one monitor , and you don't feel like playing
+	with the vga passthrou cable, I can only suggest borrowing a screen
+	somewhere... 
+
+
+Installation 
+
+	  This driver (should) work on ix86, with any 2.2.x kernel (tested
+	with x = 19) and "recent" 2.4.x kernel, as a module or compiled in.
+	  You can apply the patches found in sstfb/kernel/*-2.{2|4}.x.patch,
+	and copy sstfb.c to linux/drivers/video/, or apply a single patch, 
+	sstfb/patch-2.{2|4}.x-sstfb-yymmdd to your linux source tree.
+
+	  Then configure your kernel as usual: choose "m" or "y" to 3Dfx Voodoo
+	Graphics in section "console". Compile, install, have fun... and please
+	drop me a report :)
+
+
+Module Usage
+	
+	Warnings.
+	# You should read completely this section before issuing any command.
+	# If you have only one monitor to play with, once you insmod the
+	  module, the 3dfx takes control of the output, so you'll have to
+	  plug the monitor to the "normal" video board in order to issue
+	  the commands, or you can blindly use sst_dbg_vgapass
+          in the tools directory (See Tools). The latest option is pass the
+	  parameter vgapass=1 when insmodding the driver. (See Kernel/Modules
+	  Options)
+
+	Module insertion:
+	# insmod sstfb.o
+	  you should see some strange output frome the board: 
+	  a big blue square, a green and a red small squares and a vertical
+	  white rectangle. why ? the function's name is self explanatory :
+	  "sstfb_test()"...
+	  (if you don't have a second monitor, you'll have to plug your monitor
+	  directely to the 2D videocard to see what you're typing)
+	# con2fb /dev/fbx /dev/ttyx
+	  bind a tty to the new frame buffer. if you already have a frame
+	  buffer driver, the voodoo fb will likely be /dev/fb1. if not, 
+	  the device will be /dev/fb0. You can check this by doing a 
+	  cat /proc/fb. You can find a copy of con2fb in tools/ directory.
+	  if you don't have another fb device, this step is superfluous,
+	  as the console subsystem automagicaly binds ttys to the fb.
+	# switch to the virtual console you just mapped. "tadaaa" ...
+
+	Module removal:
+	# con2fb /dev/fbx /dev/ttyx
+	  bind the tty to the old frame buffer so the module can be removed.
+	  (how does it work with vgacon ? short answer : it doesn't work)
+	# rmmod sstfb
+
+
+Kernel/Modules Options
+
+	You can pass some otions to sstfb module, and via the kernel command
+	line when the driver is compiled in :
+	for module : insmod sstfb.o option1=value1 option2=value2 ...
+	in kernel :  video=sstfb:option1,option2:value2,option3 ...
+	
+	sstfb supports the folowing options :
+	module		kernel		description
+
+	vgapass=1	vgapass		enable or disable VGA passthrou cable
+	vgapass=0	vganopass	when enabled, the monitor will
+					get the signal from the VGA board
+					and not from the voodoo. default nopass
+
+	mem=x		mem:x		force frame buffer memory in MiB
+					allowed values: 1, 2, 4. default detect
+
+	inverse=1	inverse		suposed to enable inverse console.
+					doesn't work ...
+
+	clipping=1	clipping	enable or disable clipping . with
+	clipping=0	noclipping	clipping enabled, all offscreen reads
+					and writes are disgarded. default:
+					enable clipping.
+
+	gfxclk=x	gfxclk:x	force graphic clock frequency (in MHz)
+					becarefull with this option .
+					default is 50Mhz for voodoo1, 75MHz
+					for voodoo2. Be carefull, this one is
+					dangerous. default=auto
+
+	slowpci=0	slowpci		enable or disable fast PCI read/writes
+	slowpci=1	fastpci		default : fastpci
+
+	dev=x		dev:x		attach the driver to device number x
+					0 is the first compatible board (in 
+					lspci order)
+
+Tools
+
+	These tools are mostly for debugging purposes, but you can 
+	find some of these interesting :
+	 - con2fb , maps a tty to a fbramebuffer .
+		con2fb /dev/fb1 /dev/tty5
+	 - sst_dbg_vgapass , changes vga passthrou. You have to recompile the
+	driver with SST_DEBUG and SST_DEBUG_IOCTL set to 1
+		sst_dbg_vgapass /dev/fb1 1 (enables vga cable)
+		sst_dbg_vgapass /dev/fb1 0 (disables vga cable)
+	 - glide_reset , resets the voodoo using glide
+		use this after rmmoding sstfb, if the module refuses to
+		reinsert .
+
+Bugs
+
+	- DO NOT use glide while the sstfb module is in, you'll most likely
+	hang your computer.
+	- if you see some artefacts (pixels not cleaning and stuff like that), 
+	try turning off clipping (clipping=0)
+	- the driver don't detect the 4Mb frame buffer voodoos, it seems that
+	the 2 last Mbs wrap around. looking into that .
+	- The driver is 16 bpp only, 24/32 won't work.
+	- The driver is not your_favorite_toy-safe. this includes SMP...
+          [Actually from inspection it seems to be safe - Alan]
+	- when using XFree86 FBdev (X over fbdev) you may see strange color
+	patterns at the border of your windows (the pixels loose the lowest
+	byte -> basicaly the blue component nd some of the green) . I'm unable
+	to reproduce this with XFree86-3.3, but one of the testers has this
+	problem with XFree86-4. I don't know yet if this is the drivers fault
+	or X's (most likely the driver, of course).
+	- I didn't really test changing the palette, so you may find some weird
+	things when playing with that.
+	- Sometimes the driver will not recognise the DAC , and the
+        initialisation will fail. this is specificaly true for
+	voodoo 2 boards , but it should be solved in recent versions. please
+	contact me .
+	- the 24/32 is not likely to work anytime soon , knowing that the
+	hardware does ... unusual thigs in 24/32 bpp
+
+Todo
+
+	- Get rid of the previous paragraph.
+	- Buy more coffee.
+	- test/port to other arch.
+	- try to add panning using tweeks with front and back buffer .
+	- try to implement accel en voodoo2 , this board can actualy do a 
+	  lot in 2D even if it was sold as a 3D only board ...
+
+ghoz.
+
+-- 
+Ghozlane Toumi <gtoumi@messel.emse.fr>
+
+
+$Date: 2001/08/29 00:21:11 $
+http://sstfb.sourceforge.net/README
diff -u --recursive --new-file v2.4.9/linux/Documentation/filesystems/devfs/ChangeLog linux/Documentation/filesystems/devfs/ChangeLog
--- v2.4.9/linux/Documentation/filesystems/devfs/ChangeLog	Wed Jul 25 17:10:17 2001
+++ linux/Documentation/filesystems/devfs/ChangeLog	Fri Sep 21 10:55:22 2001
@@ -1675,3 +1675,83 @@
 - Fixed number leak for /dev/cdroms/cdrom%d
 
 - Fixed number leak for /dev/discs/disc%d
+===============================================================================
+Changes for patch v183
+
+- Fixed bug in <devfs_setup> which could hang boot process
+===============================================================================
+Changes for patch v184
+
+- Documentation typo fix for fs/devfs/util.c
+
+- Fixed drivers/char/stallion.c for devfs
+
+- Added DEVFSD_NOTIFY_DELETE event
+
+- Updated README from master HTML file
+
+- Removed #include <asm/segment.h> from fs/devfs/base.c
+===============================================================================
+Changes for patch v185
+
+- Made <block_semaphore> and <char_semaphore> in fs/devfs/util.c
+  private
+
+- Fixed inode table races by removing it and using inode->u.generic_ip
+  instead
+
+- Moved <devfs_read_inode> into <get_vfs_inode>
+
+- Moved <devfs_write_inode> into <devfs_notify_change>
+===============================================================================
+Changes for patch v186
+
+- Fixed race in <devfs_do_symlink> for uni-processor
+
+- Updated README from master HTML file
+===============================================================================
+Changes for patch v187
+
+- Fixed drivers/char/stallion.c for devfs
+
+- Fixed drivers/char/rocket.c for devfs
+
+- Fixed bug in <devfs_alloc_unique_number>: limited to 128 numbers
+===============================================================================
+Changes for patch v188
+
+- Updated major masks in fs/devfs/util.c up to Linus' "no new majors"
+  proclamation. Block: were 126 now 122 free, char: were 26 now 19 free
+
+- Updated README from master HTML file
+
+- Removed remnant of multi-mount support in <devfs_mknod>
+
+- Removed unused DEVFS_FL_SHOW_UNREG flag
+===============================================================================
+Changes for patch v189
+
+- Removed nlink field from struct devfs_inode
+
+- Removed auto-ownership for /dev/pty/* (BSD ptys) and used
+  DEVFS_FL_CURRENT_OWNER|DEVFS_FL_NO_PERSISTENCE for /dev/pty/s* (just
+  like Unix98 pty slaves) and made /dev/pty/m* rw-rw-rw- access
+===============================================================================
+Changes for patch v190
+
+- Updated README from master HTML file
+
+- Replaced BKL with global rwsem to protect symlink data (quick and
+  dirty hack)
+===============================================================================
+Changes for patch v191
+
+- Replaced global rwsem for symlink with per-link refcount
+===============================================================================
+Changes for patch v192
+
+- Removed unnecessary #ifdef CONFIG_DEVFS_FS from arch/i386/kernel/mtrr.c
+
+- Ported to kernel 2.4.10-pre11
+
+- Set inode->i_mapping->a_ops for block nodes in <get_vfs_inode>
diff -u --recursive --new-file v2.4.9/linux/Documentation/filesystems/devfs/README linux/Documentation/filesystems/devfs/README
--- v2.4.9/linux/Documentation/filesystems/devfs/README	Tue Jul  3 17:08:18 2001
+++ linux/Documentation/filesystems/devfs/README	Fri Sep 21 10:55:22 2001
@@ -3,7 +3,7 @@
 
 Linux Devfs (Device File System) FAQ
 Richard Gooch
-26-APR-2001
+23-AUG-2001
 
 -----------------------------------------------------------------------------
 
@@ -18,17 +18,14 @@
 
 http://www.atnf.csiro.au/~rgooch/linux/
 
-NEWSFLASH: The official 2.3.46 kernel has
-included the devfs patch. Future patches will be released which
-build on this. These patches are rolled into Linus' tree from time to
-time.
-
 A mailing list is available which you may subscribe to. Send
 email
 to majordomo@oss.sgi.com with the following line in the
 body of the message:
 subscribe devfs
-The list is archived at
+To unsubscribe, send the message body:
+unsubscribe devfs
+instead. The list is archived at
 
 http://oss.sgi.com/projects/devfs/archive/.
 
@@ -71,6 +68,8 @@
 
 Other resources
 
+Translations of this document
+
 
 -----------------------------------------------------------------------------
 
@@ -82,7 +81,7 @@
 name rather than major and minor numbers. These devices will appear in
 devfs automatically, with whatever default ownership and
 protection the driver specified. A daemon (devfsd) can be used to
-override these defaults.
+override these defaults. Devfs has been in the kernel since 2.3.46.
 
 NOTE that devfs is entirely optional. If you prefer the old
 disc-based device nodes, then simply leave CONFIG_DEVFS_FS=n (the
@@ -604,6 +603,20 @@
 has problems with symbolic links. Append the following lines to your
 /etc/securetty file:
 
+vc/1
+vc/2
+vc/3
+vc/4
+vc/5
+vc/6
+vc/7
+vc/8
+
+This will not weaken security. If you have a version of util-linux
+earlier than 2.10.h, please upgrade to 2.10.h or later. If you
+absolutely cannot upgrade, then also append the following lines to
+your /etc/securetty file:
+
 1
 2
 3
@@ -618,27 +631,13 @@
 are problems with dealing with symlinks, I'm suspicious of the level
 of security offered in any case.
 
-A better solution is to install util-linux-2.10.h or later, which
-fixes a bug with ttyname handling in the login programme. Then append
-the following lines to your /etc/securetty file:
-
-vc/1
-vc/2
-vc/3
-vc/4
-vc/5
-vc/6
-vc/7
-vc/8
-
-This will not weaken security.
-
 XFree86
 While not essential, it's probably a good idea to upgrade to XFree86
 4.0, as patches went in to make it more devfs-friendly. If you don't,
 you'll probably need to apply the following patch to
 /etc/security/console.perms so that ordinary users can run
-startx.
+startx. Note that not all distributions have this file (e.g. Debian),
+so if it's not present, don't worry about it.
 
 --- /etc/security/console.perms.orig    Sat Apr 17 16:26:47 1999 
 +++ /etc/security/console.perms Fri Feb 25 23:53:55 2000 
@@ -691,9 +690,12 @@
 described above.
 
 The Kernel
-Finally, you need to make sure devfs is compiled into your
-kernel. Set CONFIG_DEVFS_FS=y and CONFIG_DEVFS_MOUNT=y and recompile
-your kernel. At boot, devfs will be mounted onto /dev.
+Finally, you need to make sure devfs is compiled into your kernel. Set
+CONFIG_EXPERIMENTAL=y, CONFIG_DEVFS_FS=y and CONFIG_DEVFS_MOUNT=y by
+using favourite configuration tool (i.e. make config or
+make xconfig) and then make dep; make clean and then
+recompile your kernel and modules. At boot, devfs will be mounted onto
+/dev.
 
 If you encounter problems booting (for example if you forgot a
 configuration step), you can pass devfs=nomount at the kernel
@@ -805,8 +807,17 @@
 directory to store the database. The sample /etc/devfsd.conf
 file above may still be used. You will need to create the
 /dev-state directory prior to installing devfsd. If you have
-old permissions in /dev, then just copy the device nodes over
-to the new directory.
+old permissions in /dev, then just copy (or move) the device
+nodes over to the new directory.
+
+Which method is better?
+
+The best method is to have the permissions database stored in the
+mounted-over /dev. This is because you will not need to copy
+device nodes over to /dev-state, and because it allows you to
+switch between devfs and non-devfs kernels, without requiring you to
+copy permissions between /dev-state (for devfs) and
+/dev (for non-devfs).
 
 
 Dealing with drivers without devfs support
@@ -1038,6 +1049,13 @@
 directory tree that reflects the topology of available devices. The
 topological tree is useful for finding how your devices are arranged.
 
+Below is a list of the naming schemes for the most common drivers. A
+list of reserved device names is
+available for reference. Please send email to
+rgooch@atnf.csiro.au to obtain an allocation. Please be
+patient (the maintainer is busy). An alternative name may be allocated
+instead of the requested name, at the discretion of the maintainer.
+
 Disc Devices
 
 All discs, whether SCSI, IDE or whatever, are placed under the
@@ -1486,6 +1504,47 @@
 namespace, but have had no response.
 
 
+How can I test if I have devfs compiled into my kernel?
+
+All filesystems built-in or currently loaded are listed in
+/proc/filesystems. If you see a devfs entry, then
+you know that devfs was compiled into your kernel. If you have
+correctly configured and rebuilt your kernel, then devfs will be
+built-in. If you think you've configured it in, but
+/proc/filesystems doesn't show it, you've made a mistake.
+Common mistakes include:
+
+Using a 2.2.x kernel without applying the devfs patch (if you
+don't know how to patch your kernel, use 2.4.x instead, don't bother
+asking me how to patch)
+Forgetting to set CONFIG_EXPERIMENTAL=y
+Forgetting to set CONFIG_DEVFS_FS=y
+Forgetting to set CONFIG_DEVFS_MOUNT=y (if you want devfs
+to be automatically mounted at boot)
+Editing your .config manually, instead of using make
+config or make xconfig
+Forgetting to run make dep; make clean after changing the
+configuration and before compiling
+Forgetting to compile your kernel and modules
+Forgetting to install your kernel
+Forgetting to install your modules
+
+Please check twice that you've done all these steps before sending in
+a bug report.
+
+
+
+How can I test if devfs is mounted on /dev?
+
+The device filesystem will always create an entry called
+".devfsd", which is used to communicate with the daemon. Even
+if the daemon is not running, this entry will exist. Testing for the
+existence of this entry is the approved method of determining if devfs
+is mounted or not. Note that the type of entry (i.e. regular file,
+character device, named pipe, etc.) may change without notice. Only
+the existence of the entry should be relied upon.
+
+
 
 
 
@@ -1713,6 +1772,23 @@
 
 2nd Annual Storage Management Workshop held in Miamia, Florida,
 U.S.A. in October 2000.
+
+
+
+
+-----------------------------------------------------------------------------
+
+
+Translations of this document
+
+This document has been translated into other languages.
+
+
+
+
+A Korean translation by viatoris@nownuri.net is available at
+
+http://home.nownuri.net/~viatoris/devfs/devfs.html 
 
 
 
diff -u --recursive --new-file v2.4.9/linux/Documentation/filesystems/devfs/boot-options linux/Documentation/filesystems/devfs/boot-options
--- v2.4.9/linux/Documentation/filesystems/devfs/boot-options	Mon May  8 22:00:41 2000
+++ linux/Documentation/filesystems/devfs/boot-options	Fri Sep 21 10:55:22 2001
@@ -4,7 +4,7 @@
 
 		Richard Gooch <rgooch@atnf.csiro.au>
 
-			      30-APR-2000
+			      18-AUG-2001
 
 
 When CONFIG_DEVFS_DEBUG is enabled, you can pass several boot options
@@ -19,6 +19,8 @@
 
 devfs=dmod,dreg
 
+You may prefix "no" to any option. This will invert the option.
+
 
 Debugging Options
 =================
@@ -42,11 +44,11 @@
 
 dilookup	print inode lookup requests
 
-diread		print inode reads
+diget		print VFS inode allocations
 
 diunlink	print inode unlinks
 
-diwrite		print inode writes
+dichange	print inode changes
 
 dimknod		print calls to mknod(2)
 
@@ -58,10 +60,6 @@
 
 These control the default behaviour of devfs. The options are:
 
-show		show unregistered devices by default
-
 mount		mount devfs onto /dev at boot time
-
-nomount		do not mount devfs onto /dev at boot time
 
 only		disable non-devfs device nodes for devfs-capable drivers
diff -u --recursive --new-file v2.4.9/linux/Documentation/filesystems/ntfs.txt linux/Documentation/filesystems/ntfs.txt
--- v2.4.9/linux/Documentation/filesystems/ntfs.txt	Mon Aug 27 12:41:37 2001
+++ linux/Documentation/filesystems/ntfs.txt	Tue Sep 11 17:02:46 2001
@@ -64,6 +64,25 @@
 			Be careful not to write anything to them or you could
 			crash the kernel and/or corrupt your file system!
 
+mft_zone_multiplier=	Set the MFT zone multiplier for the volume (this
+			setting is not persistent across mounts and can be
+			changed from mount to mount but cannot be changed on
+			remount). Values of 1 to 4 are allowed, 1 being the
+			default. The MFT zone multiplier determines how much
+			space is reserved for the MFT on the volume. If all
+			other space is used up, then the MFT zone will be
+			shrunk dynamically, so this has no impact on the
+			amount of free space. However, it can have an impact
+			on performance by affecting fragmentation of the MFT.
+			In general use the default. If you have a lot of small
+			files then use a higher value. The values have the
+			following meaning:
+			      Value	     MFT zone size (% of volume size)
+				1		12.5%
+				2		25%
+				3		37.5%
+				4		50%
+
 Known bugs and (mis-)features
 =============================
 
@@ -71,10 +90,6 @@
   use it, get the Linux-NTFS tools and use the ntfsfix utility after
   dismounting a partition you wrote to.
 
-- Use the show_sys_files mount option which should make things work generally
-  better. (It results in both the short and long file names being shown as well
-  as the sytem files.)
-
 - Writing of extension records is not supported properly.
 
 Please send bug reports/comments/feed back/abuse to the Linux-NTFS development
@@ -82,6 +97,96 @@
 
 ChangeLog
 =========
+
+NTFS 1.1.19:
+	- Fixed ntfs_getdir_unsorted(), ntfs_readdir() and ntfs_printcb() to
+	  cope with arbitrary cluster sizes. Very important for Win2k+. Also,
+	  make them detect directories which are too large and truncate the
+	  enumeration pretending end of directory was reached. Detect more
+	  error conditions and overflows. All this fixes the problem where the
+	  driver could end up in an infinite loop under certain circumstances.
+	- Fixed potential memory leaks in Unicode conversion functions and
+	  setup correct NULL return values.
+
+NTFS 1.1.18:
+
+	- Enhanced & bug fixed cluster deallocation (race fixes, etc.)
+	- Complete rewrite of cluster allocation, now race free.
+	- Fixed several bugs in the attribute modification codepaths.
+	- Hopefully fixed bug where the first sectors of some people's
+	  partitions would be overwritten by the mft. And in general fixed up
+	  mft extension code a bit (still incomplete though).
+	- Introduce splice_runlist() to allow generic splicing of two run
+	  lists into one.
+	- MFT zone is now implemented. [Stage 2 of 3; only lack dynamic
+	  growing of mft zone but that is AFAIK not even done by Windows, and
+	  the overhead would be so large that it is probably not worth doing
+	  at all, so Stage 3 might never happen...]
+	- Complete rewrite of $MFT extension and ntfs inode allocation code.
+	- Made the NTFS driver initialization string show the compile options
+	  used (i.e. whether read-only or read-write, whether a module, and
+	  whether with debug support).
+	- Modify ntfs_fill_mft_header() to set all fields and to accept more
+	  arguments.
+	- Get rid of superfluous add_mft_header().
+	- Get rid of some unused code.
+	- Fixed several bugs in and generally cleaned up ntfs_readdir,
+	  ntfs_getdir_unsorted(), and ntfs_printcb. Now they spew out huge
+	  amounts of debug output if debugging is enabled. This will be
+	  removed once I know that this works for everyone.
+	- ntfs_readdir now shows hidden files. The only files that are now
+	  hidden are the first 16 inodes (i.e. the hard coded system files),
+	  which is consistent with Windows NT4. Using the show_sys_files mount
+	  option, these files are then shown, too.
+	- Fixed the displaying of the "." and ".." directories. We still cannot
+	  cope with more than 65536 files in a directory index block which is
+	  not a problem and we now cannot cope with more than 32766 directory
+	  index blocks which should not be a problem unless you have a
+	  directory with an insanely large number of files in it. The exact
+	  number depends on the length of the file names of the directory
+	  entries and on the size of the dircetory index blocks.
+	- Fixed all problems with the last file in a directory (e.g. the last
+	  file should no longer disappear and tab completion should work). If
+	  there are still disappearing files or any other problems with the
+	  last file in a directory, please report them! Thanks.
+	- Rewrote ntfs_extend_attr() to use the new cluster allocator and the
+	  freshly introduced splice_runlists() function. This simplified
+	  ntfs_extend_attr() a lot which in turn seems to have removed one or
+	  more bugs from it.
+	- Probably other things I have forgotten... (-;
+	- Removed dollar signs from the names in the system file enumeration.
+	  Apparently gcc doesn't support dollar signs on PPC architecture.
+	  (Andrzej Krzysztofowicz)
+
+NTFS 1.1.17:
+
+	- Fixed system file handling. No longer need to use show_sys_files
+	  option for driver to work fine. System files are now always treated
+	  the same, but without the option, they are made invisible to
+	  directory listings. As a result system files can once again be opened
+	  even without the show_sys_files option. This is important for the
+	  statfs system call to work properly, for example.
+	- Implemented MFT zone including mount parameter to tune it (just like
+	  in Windows via the registry, only we make it per mount rather than
+	  global for the whole driver, so we are better but we have no way of
+	  storing the value as we don't have a registry so either specify on
+	  each mount or put it in /etc/fstab). [Stage 1 of 3, mount parameter
+	  handling.]
+	- Fixed fixup functions to handle corruption cases and to return error
+	  codes to the caller.
+	- Made fixup functions apply hotfixes where sensible. [Stage 1 of 2+,
+	  in memory only.]
+	- Fixed ommission of "NTFS: " string in ntfs_error() output.
+	- Fixed stupid if statement bug in unistr.c. Thanks to Yann E. Morin
+	  for spotting it. 
+	- Get rid of all uses of max and min macros. This actually allowed for
+	  optimizing the code in several places so it was a Good Thing(TM).
+	- Make ntfs use generic_file_open to enforce the O_LARGEFILE flag.
+	- Detect encrypted files and refuse to access them (return EACCES
+	  error code to user space).
+	- Fix handling of encrypted & compressed files so that an encrypted
+	  file no longer is considered to be compressed (this was causing
+	  kernel segmentation faults).
 
 NTFS 1.1.16:
 
diff -u --recursive --new-file v2.4.9/linux/Documentation/ide.txt linux/Documentation/ide.txt
--- v2.4.9/linux/Documentation/ide.txt	Sat Feb 26 20:32:12 2000
+++ linux/Documentation/ide.txt	Fri Sep  7 09:28:38 2001
@@ -314,7 +314,7 @@
  "ide0=ht6560b"		: probe/support HT6560B interface
  "ide0=cmd640_vlb"	: *REQUIRED* for VLB cards with the CMD640 chip
 			  (not for PCI -- automatically detected)
- "ide0=qd6580"		: probe/support qd6580 interface
+ "ide0=qd65xx"		: probe/support qd65xx interface
  "ide0=ali14xx"		: probe/support ali14xx chipsets (ALI M1439/M1445)
  "ide0=umc8672"		: probe/support umc8672 chipsets
 
diff -u --recursive --new-file v2.4.9/linux/Documentation/input/cs461x.txt linux/Documentation/input/cs461x.txt
--- v2.4.9/linux/Documentation/input/cs461x.txt	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/input/cs461x.txt	Wed Sep 12 15:34:06 2001
@@ -0,0 +1,45 @@
+Preface.
+
+This is a new low-level driver to support analog joystick attached to
+Crystal SoundFusion CS4610/CS4612/CS4615. This code is based upon 
+Vortex/Solo drivers as an example of decoration style, and ALSA
+0.5.8a kernel drivers as an chipset documentation and samples.
+
+This version does not have cooked mode support; the basic code 
+is present here, but have not tested completely. The button analysis 
+is completed in this mode, but the axis movement is not. 
+
+Raw mode works fine with analog joystick front-end driver and cs461x
+driver as a backend. I've tested this driver with CS4610, 4-axis and 
+4-button joystick; I mean the jstest utility. Also I've tried to
+play in xracer game using joystick, and the result is better than
+keyboard only mode.
+
+The sensitivity and calibrate quality have not been tested; the two
+reasons are performed: the same hardware cannot work under Win95 (blue 
+screen in VJOYD); I have no documentation on my chip; and the existing 
+behavior in my case was not raised the requirement of joystick calibration. 
+So the driver have no code to perform hardware related calibration.
+
+The patch contains minor changes of Config.in and Makefile files. All
+needed code have been moved to one separate file cs461x.c like ns558.c
+This driver have the basic support for PCI devices only; there is no
+ISA or PnP ISA cards supported. AFAIK the ns558 have support for Crystal 
+ISA and PnP ISA series.
+
+The driver works witn ALSA drivers simultaneously. For exmple, the xracer
+uses joystick as input device and PCM device as sound output in one time.
+There are no sound or input collisions detected. The source code have
+comments about them; but I've found the joystick can be initialized 
+separately of ALSA modules. So, you canm use only one joystick driver
+without ALSA drivers. The ALSA drivers are not needed to compile or
+run this driver.
+
+There are no debug information print have been placed in source, and no
+specific options required to work this driver. The found chipset parameters
+are printed via printk(KERN_INFO "..."), see the /var/log/messages to
+inspect cs461x: prefixed messages to determine possible card detection 
+errors.
+
+Regards,
+Viktor
diff -u --recursive --new-file v2.4.9/linux/Documentation/input/ff.txt linux/Documentation/input/ff.txt
--- v2.4.9/linux/Documentation/input/ff.txt	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/input/ff.txt	Wed Sep 12 15:34:06 2001
@@ -0,0 +1,194 @@
+Force feedback for Linux.
+By Johann Deneux <deneux@ifrance.com> on 2001/04/22.
+
+----------------------------------------------------------------------------
+
+0. Introduction
+~~~~~~~~~~~~~~~
+This document describes how to use force feedback devices under Linux. The
+goal is not to support these devices as if they were simple input-only devices
+(as it is already the case), but to really enable the rendering of force
+effects.
+At the moment, only I-Force devices are supported, and not officially. That
+means I had to find out how the protocol works on my own. Of course, the
+information I managed to grasp is far from being complete, and I can not
+guarranty that this driver will work for you.
+This document only describes the force feedback part of the driver for I-Force
+devices. Please read joystick.txt before reading further this document.
+
+2. Instructions to the user
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Here are instructions on how to compile and use the driver. In fact, this
+driver is the normal iforce.o, input.o and evdev.o drivers written by Vojtech
+Pavlik, plus additions to support force feedback.
+
+Before you start, let me WARN you that some devices shake violently during the
+initialisation phase. This happens for example with my "AVB Top Shot Pegasus".
+To stop this annoying behaviour, move you joystick to its limits. Anyway, you
+should keep a hand on your device, in order to avoid it to brake down if
+something goes wrong.
+
+At the kernel's compilation:
+	- Enable IForce/Serial
+	- Enable Event interface
+
+Compile the modules, install them.
+
+You also need inputattach.
+
+You then need to insert the modules into the following order:
+% modprobe joydev
+% modprobe serport
+% modprobe iforce
+% modprobe evdev
+% ./inputattach -ifor $2 &	# Only for serial
+For convenience, you may use the shell script named "ff" available from
+the cvs tree of the Linux Console Project at sourceforge. You can also
+retrieve it from http://www.esil.univ-mrs.fr/~jdeneux/projects/ff/.
+If you are using USB, you don't need the inputattach step.
+
+Please check that you have all the /dev/input entries needed:
+cd /dev
+rm js*
+mkdir input
+mknod input/js0 c 13 0
+mknod input/js1 c 13 1
+mknod input/js2 c 13 2
+mknod input/js3 c 13 3
+ln -s input/js0 js0
+ln -s input/js1 js1
+ln -s input/js2 js2
+ln -s input/js3 js3
+
+mknod input/event0 c 13 64
+mknod input/event1 c 13 65
+mknod input/event2 c 13 66
+mknod input/event3 c 13 67
+
+2.1 Does it work ?
+~~~~~~~~~~~~~~~~~~
+There is an utility called fftest that will allow you to test the driver.
+% fftest /dev/eventXX
+
+3. Instructions to the developper
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  All interactions are done using the event API. That is, you can use ioctl()
+and write() on /dev/input/eventXX.
+  This information is subject to change.
+
+3.1 Querying device capabilities
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#include <linux/input.h>
+#include <sys/ioctl.h>
+
+int ioctl(int file_descriptor, int request, unsigned long *features);
+
+"request" must be EVIOCGBIT(EV_FF, sizeof(unsigned long))
+
+Returns the features supported by the device. features is a bitfield with the
+following bits:
+- FF_X		has an X axis (should allways be the case)
+- FF_Y		has an Y axis (usually not the case for wheels)
+- FF_CONSTANT	can render constant force effects
+- FF_PERIODIC	can render periodic effects (sine, ramp, square...)
+- FF_SPRING	can simulate the presence of a spring
+- FF_FRICTION	can simulate friction (aka drag, damper effect...)
+- FF_RUMBLE	rumble effects (normally the only effect supported by rumble
+		pads)
+- 8 bits from FF_N_EFFECTS_0 containing the number of effects that can be
+		simultaneously played.
+
+3.2 Uploading effects to the device
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#include <linux/input.h>
+#include <sys/ioctl.h>
+ 
+int ioctl(int file_descriptor, int request, struct ff_effect *effect);
+
+"request" must be EVIOCSFF.
+
+"effect" points to a structure describing the effect to upload. The effect is
+uploaded, but not played.
+The content of effect may be modified. In particular, its field "id" is set
+to the unique id assigned by the driver. This data is required for performing
+some operations (removing an effect, controlling the playback).
+See <linux/input.h> for a description of the ff_effect stuct.
+
+3.3 Removing an effect from the device
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+int ioctl(int fd, EVIOCRMFF, effect.id);
+
+This makes room for new effects in the device's memory. Please note this won't
+stop the effect if it was playing.
+
+3.4 Controlling the playback of effects
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Control of playing is done with write(). Below is an example:
+
+#include <linux/input.h>
+#include <unistd.h>
+
+	struct input_event play;
+	struct input_event stop;
+	struct ff_effect effect;
+	int fd;
+...
+	fd = open("/dev/input/eventXX", O_RDWR);
+...
+	/* Play three times */
+	play.type = EV_FF;
+	play.code = effect.id;
+	play.value = 3;
+	
+	write(fd, (const void*) &play, sizeof(play));
+...
+	/* Stop an effect */
+	stop.type = EV_FF;
+	stop.code = effect.id;
+	stop.value = 0;
+	
+	write(fd, (const void*) &play, sizeof(stop));
+
+3.5 Setting the gain
+~~~~~~~~~~~~~~~~~~~~
+Not all devices have the same strength. Therefore, users should set a gain
+factor depending on how strong they want effects to be. This setting is
+persistent accross access to the driver, so you should not care about it if
+you are writing games, as another utility probably already set this for you.
+
+/* Set the gain of the device
+int gain;		/* between 0 and 100 */
+struct input_event ie;	/* structure used to communicate with the driver */
+
+ie.type = EV_FF;
+ie.code = FF_GAIN;
+ie.value = 0xFFFFUL * gain / 100;
+
+if (write(fd, &ie, sizeof(ie)) == -1)
+	perror("set gain");
+
+3.6 Enabling/Disabling autocenter
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The autocenter feature quite disturbs the rendering of effects in my opinion,
+and I think it should be an effect, which computation depends on the game
+type. But you can enable it if you want.
+
+int autocenter;		/* between 0 and 100 */
+struct input_event ie;
+
+ie.type = EV_FF;
+ie.code = FF_AUTOCENTER;
+ie.value = 0xFFFFUL * autocenter / 100;
+
+if (write(fd, &ie, sizeof(ie)) == -1)
+	perror("set auto-center");
+
+A value of 0 means "no auto-center".
+
+3.7 Dynamic update of an effect
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+This consists in changing some parameters of an effect while it's playing. The
+driver currently does not support that. You still have the brute-force method,
+which consists in erasing the effect and uploading the updated version. It
+actually works pretty well. You don't need to stop-and-start the effect.
+
diff -u --recursive --new-file v2.4.9/linux/Documentation/input/gameport-programming.txt linux/Documentation/input/gameport-programming.txt
--- v2.4.9/linux/Documentation/input/gameport-programming.txt	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/input/gameport-programming.txt	Wed Sep 12 15:34:06 2001
@@ -0,0 +1,189 @@
+$Id: gameport-programming.txt,v 1.3 2001/04/24 13:51:37 vojtech Exp $
+
+Programming gameport drivers
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+1. A basic classic gameport
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If the gameport doesn't provide more than the inb()/outb() functionality,
+the code needed to register it with the joystick drivers is simple:
+
+	struct gameport gameport;
+
+	gameport.io = MY_IO_ADDRESS;
+	gameport_register_port(&gameport);
+
+Make sure struct gameport is initialized to 0 in all other fields. The
+gameport generic code will take care of the rest.
+
+If your hardware supports more than one io address, and your driver can
+choose which one program the hardware to, starting from the more exotic
+addresses is preferred, because the likelyhood of clashing with the standard
+0x201 address is smaller.
+
+Eg. if your driver supports addresses 0x200, 0x208, 0x210 and 0x218, then
+0x218 would be the address of first choice.
+
+If your hardware supports a gameport address that is not mapped to ISA io
+space (is above 0x1000), use that one, and don't map the ISA mirror.
+
+Also, always request_region() on the whole io space occupied by the
+gameport. Although only one ioport is really used, the gameport usually
+occupies from one to sixteen addresses in the io space.
+
+Please also consider enabling the gameport on the card in the ->open()
+callback if the io is mapped to ISA space - this way it'll occupy the io
+space only when something really is using it. Disable it again in the
+->close() callback. You also can select the io address in the ->open()
+callback, so that it doesn't fail if some of the possible addresses are
+already occupied by other gameports.
+
+2. Memory mapped gameport
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+When a gameport can be accessed through MMIO, this way is preferred, because
+it is faster, allowing more reads per second. Registering such a gameport
+isn't as easy as a basic IO one, but not so much complex:
+
+	struct gameport gameport;
+
+	void my_trigger(struct gameport *gameport)
+	{
+		my_mmio = 0xff;
+	}
+
+	unsigned char my_read(struct gameport *gameport)
+	{
+		return my_mmio;	
+	}
+
+	gameport.read = my_read;
+	gameport.trigger = my_trigger;
+	gameport_register_port(&gameport);
+
+3. Cooked mode gameport
+~~~~~~~~~~~~~~~~~~~~~~~
+
+There are gameports that can report the axis values as numbers, that means
+the driver doesn't have to measure them the old way - an ADC is built into
+the gameport. To register a cooked gameport:
+
+	struct gameport gameport;
+
+	int my_cooked_read(struct gameport *gameport, int *axes, int *buttons)
+	{
+		int i;
+
+		for (i = 0; i < 4; i++)
+			axes[i] = my_mmio[i];
+		buttons[i] = my_mmio[4];
+	}
+
+	int my_open(struct gameport *gameport, int mode)
+	{
+		return -(mode != GAMEPORT_MODE_COOKED);
+	}
+
+	gameport.cooked_read = my_cooked_read;
+	gameport.open = my_open;
+	gameport.fuzz = 8;
+	gameport_register_port(&gameport);
+
+The only confusing thing here is the fuzz value. Best determined by
+experimentation, it is the amount of noise in the ADC data. Perfect
+gameports can set this to zero, most common have fuzz between 8 and 32.
+See analog.c and input.c for handling of fuzz - the fuzz value determines
+the size of a gaussian filter window that is used to eliminate the noise
+in the data.
+
+4. More complex gameports
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Gameports can support both raw and cooked modes. In that case combine either
+examples 1+2 or 1+3. Gameports can support internal calibration - see below,
+and also lightning.c and analog.c on how that works. If your driver supports
+more than one gameport instance simultaneously, use the ->private member of
+the gameport struct to point to your data.
+
+5. Unregistering a gameport
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Simple:
+
+gameport_unregister_port(&gameport);
+
+6. The gameport structure
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+struct gameport {
+
+	void *private;
+
+A private pointer for free use in the gameport driver. (Not the joystick
+driver!)
+
+	int number;
+
+Number assigned to the gameport when registered. Informational purpose only.
+
+	int io;
+
+I/O address for use with raw mode. You have to either set this, or ->read()
+to some value if your gameport supports raw mode.
+
+	int speed;
+
+Raw mode speed of the gameport reads in thousands of reads per second.
+
+	int fuzz;
+
+If the gameport supports cooked mode, this should be set to a value that
+represents the amount of noise in the data. See section 3.
+
+	void (*trigger)(struct gameport *);
+
+Trigger. This function should trigger the ns558 oneshots. If set to NULL,
+outb(0xff, io) will be used.
+
+	unsigned char (*read)(struct gameport *);
+
+Read the buttons and ns558 oneshot bits. If set to NULL, inb(io) will be
+used instead.
+
+	int (*cooked_read)(struct gameport *, int *axes, int *buttons);	
+
+If the gameport supports cooked mode, it should point this to its cooked
+read function. It should fill axes[0..3] with four values of the joystick axes
+and buttons[0] with four bits representing the buttons.
+
+	int (*calibrate)(struct gameport *, int *axes, int *max); 
+
+Function for calibrating the ADC hardware. When called, axes[0..3] should be
+pre-filled by cooked data by the caller, max[0..3] should be pre-filled with
+expected maximums for each axis. The calibrate() function should set the
+sensitivity of the ADC hardware so that the maximums fit in its range and
+recompute the axes[] values to match the new sensitivity or re-read them from
+the hardware so that they give valid values. 
+
+	int (*open)(struct gameport *, int mode);
+
+Open() serves two purposes. First a driver either opens the port in raw or
+in cooked mode, the open() callback can decide which modes are supported.
+Second, resource allocation can happen here. The port can also be enabled
+here. Prior to this call, other fields of the gameport struct (namely the io
+member) need not to be valid.
+
+	void (*close)(struct gameport *);
+
+Close() should free the resources allocated by open, possibly disabling the
+gameport.
+
+	struct gameport_dev *dev;
+	struct gameport *next;
+
+For internal use by the gameport layer.
+
+};
+
+Enjoy!
diff -u --recursive --new-file v2.4.9/linux/Documentation/input/input-programming.txt linux/Documentation/input/input-programming.txt
--- v2.4.9/linux/Documentation/input/input-programming.txt	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/input/input-programming.txt	Wed Sep 12 15:34:06 2001
@@ -0,0 +1,271 @@
+$Id: input-programming.txt,v 1.4 2001/05/04 09:47:14 vojtech Exp $
+
+Programming input drivers
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+1. Creating an input device driver
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+1.0 The simplest example
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Here comes a very simple example of an input device driver. The device has
+just one button and the button is accessible at i/o port BUTTON_PORT. When
+pressed or released a BUTTON_IRQ happens. The driver could look like:
+
+#include <linux/input.h>
+#include <linux/module.h>
+#include <linux/init.h>
+
+#include <asm/irq.h>
+#include <asm/io.h>
+
+static void button_interrupt(int irq, void *dummy, struct pt_regs *fp)
+{
+	input_report_key(&button_dev, BTN_1, inb(BUTTON_PORT) & 1);
+}
+
+static int __init button_init(void)
+{
+	if (request_irq(BUTTON_IRQ, button_interrupt, 0, "button", NULL)) {
+                printk(KERN_ERR "button.c: Can't allocate irq %d\n", button_irq);
+                return -EBUSY;
+        }
+	
+	button_dev.evbit[0] = BIT(EV_KEY);
+	button_dev.keybit[LONG(BTN_0)] = BIT(BTN_0);
+	
+	input_register_device(&button_dev);
+}
+
+static void __exit button_exit(void)
+{
+        input_unregister_device(&button_dev);
+	free_irq(BUTTON_IRQ, button_interrupt);
+}
+
+module_init(button_init);
+module_exit(button_exit);
+
+1.1 What the example does
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+First it has to include the <linux/input.h> file, which interfaces to the
+input subsystem. This provides all the definitions needed.
+
+In the _init function, which is called either upon module load or when
+booting the kernel, it grabs the required resources (it should also check
+for the presence of the device).
+
+Then it sets the input bitfields. This way the device driver tells the other
+parts of the input systems what it is - what events can be generated or
+accepted by this input device. Our example device can only generate EV_KEY type
+events, and from those only BTN_0 event code. Thus we only set these two
+bits. We could have used
+
+	set_bit(EV_KEY, button_dev.evbit);
+	set_bit(BTN_0, button_dev.keybit);
+
+as well, but with more than single bits the first approach tends to be
+shorter. 
+
+Then the example driver registers the input device structure by calling
+
+	input_register_device(&button_dev);
+
+This adds the button_dev structure to linked lists of the input driver and
+calls device handler modules _connect functions to tell them a new input
+device has appeared. Because the _connect functions may call kmalloc(,
+GFP_KERNEL), which can sleep, input_register_device() must not be called
+from an interrupt or with a spinlock held.
+
+While in use, the only used function of the driver is
+
+	button_interrupt()
+
+which upon every interrupt from the button checks its state and reports it
+via the 
+
+	input_report_btn()
+
+call to the input system. There is no need to check whether the interrupt
+routine isn't reporting two same value events (press, press for example) to
+the input system, because the input_report_* functions check that
+themselves.
+
+1.2 dev->open() and dev->close()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In case the driver has to repeatedly poll the device, because it doesn't
+have an interrupt coming from it and the polling is too expensive to be done
+all the time, or if the device uses a valuable resource (eg. interrupt), it
+can use the open and close callback to know when it can stop polling or
+release the interrupt and when it must resume polling or grab the interrupt
+again. To do that, we would add this to our example driver:
+
+int button_used = 0;
+
+static int button_open(struct input_dev *dev)
+{
+        if (button_used++)
+                return 0;
+
+	if (request_irq(BUTTON_IRQ, button_interrupt, 0, "button", NULL)) {
+                printk(KERN_ERR "button.c: Can't allocate irq %d\n", button_irq);
+                button_used--;
+                return -EBUSY;
+        }
+
+        return 0;
+}
+
+static void button_close(struct input_dev *dev)
+{
+        if (!--button_used)
+                free_irq(IRQ_AMIGA_VERTB, button_interrupt);
+}
+
+static int __init button_init(void)
+{
+	...
+	button_dev.open = button_open;
+	button_dev.close = button_close;
+	...
+}
+
+Note the button_used variable - we have to track how many times the open
+function was called to know when exactly our device stops being used.
+
+The open() callback should return a 0 in case of succes or any nonzero value
+in case of failure. The close() callback (which is void) must always succeed.
+
+1.3 Basic event types
+~~~~~~~~~~~~~~~~~~~~~
+
+The most simple event type is EV_KEY, which is used for keys and buttons.
+It's reported to the input system via:
+
+	input_report_key(struct input_dev *dev, int code, int value)
+
+See linux/input.h for the allowable values of code (from 0 to KEY_MAX).
+Value is interpreted as a truth value, ie any nonzero value means key
+pressed, zero value means key released. The input code generates events only
+in case the value is different from before.
+
+In addition to EV_KEY, there are two more basic event types: EV_REL and
+EV_ABS. They are used for relative and absolute values supplied by the
+device. A relative value may be for example a mouse movement in the X axis.
+The mouse reports it as a relative difference from the last position,
+because it doesn't have any absolute coordinate system to work in. Absolute
+events are namely for joysticks and digitizers - devices that do work in an
+absolute coordinate systems.
+
+Having the device report EV_REL buttons is as simple as with EV_KEY, simply
+set the corresponding bits and call the
+
+	input_report_rel(struct input_dev *dev, int code, int value)
+
+function. Events are generated only for nonzero value. 
+
+However EV_ABS requires a little special care. Before calling
+input_register_devices, you have to fill additional fields in the input_dev
+struct for each absolute axis your device has. If our button device had also
+the ABS_X axis:
+
+	button_dev.absmin[ABS_X] = 0;
+	button_dev.absmax[ABS_X] = 255;
+	button_dev.absfuzz[ABS_X] = 4;
+	button_dev.absflat[ABS_X] = 8;
+
+This setting would be appropriate for a joystick X axis, with the minimum of
+0, maximum of 255 (which the joystick *must* be able to reach, no problem if
+it sometimes reports more, but it must be able to always reach the min and
+max values), with noise in the data up to +- 4, and with a center flat
+position of size 8.
+
+If you don't need absfuzz and absflat, you can set them to zero, which mean
+that the thing is precise and always returns to exactly the center position
+(if it has any).
+
+1.4 The void *private field
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This field in the input structure can be used to point to any private data
+structures in the input device driver, in case the driver handles more than
+one device. You'll need it in the open and close callbacks.
+
+1.5 NBITS(), LONG(), BIT()
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+These three macros frin input.h help some bitfield computations:
+
+	NBITS(x) - returns the length of a bitfield array in longs for x bits
+	LONG(x)  - returns the index in the array in longs for bit x
+	BIT(x)   - returns the indes in a long for bit x
+
+1.6 The number, id* and name fields
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The dev->number is assigned by the input system to the input device when it
+is registered. It has no use except for identifying the device to the user
+in system messages.
+
+The dev->name should be set before registering the input device by the input
+device driver. It's a string like 'Generic button device' containing an
+user friendly name of the device.
+
+The id* fields contain the bus ID (PCI, USB, ...), vendor ID and device ID
+of the device. The bus IDs are defined in input.h. The vendor and device ids
+are defined in pci_ids.h, usb_ids.h and similar include files. These fields
+should be set by the input device driver before registering it.
+
+The idtype field can be used for specific information for the input device
+driver.
+
+The id and name fields can be passed to userland via the evdev interface.
+
+1.7 The keycode, keycodemax, keycodesize fields
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+These two fields will be used for any inpur devices that report their data
+as scancodes. If not all scancodes can be known by autodetection, they may
+need to be set by userland utilities. The keycode array then is an array
+used to map from scancodes to input system keycodes. The keycode max will
+contain the size of the array and keycodesize the size of each entry in it
+(in bytes).
+
+1.8 Key autorepeat
+~~~~~~~~~~~~~~~~~~
+
+... is simple. It is handled by the input.c module. Hardware autorepeat is
+not used, because it's not present in many devices and even where it is
+present, it is broken sometimes (at keyboards: Toshiba notebooks). To enable
+autorepeat for your device, just set EV_REP in dev->evbit. All will be
+handled by the input system.
+
+1.9 Other event types, handling output events
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The other event types up to now are:
+
+EV_LED - used for the keyboad LEDs.
+EV_SND - used for keyboard beeps.
+
+They are very similar to for example key events, but they go in the other
+direction - from the system to the input device driver. If your input device
+driver can handle these events, it has to set the respective bits in evbit,
+*and* also the callback routine:
+
+	button_dev.event = button_event;
+
+int button_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
+{
+	if (type == EV_SND && code == EV_BELL) {
+		outb(value, BUTTON_BELL);
+		return 0;
+	}
+	return -1;
+}
+
+This callback routine can be called from an interrupt or a BH (although that
+isn't a rule), and thus must not sleep, and must not take too long to finish.
diff -u --recursive --new-file v2.4.9/linux/Documentation/input/input.txt linux/Documentation/input/input.txt
--- v2.4.9/linux/Documentation/input/input.txt	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/input/input.txt	Wed Sep 12 15:34:06 2001
@@ -0,0 +1,297 @@
+			  Linux Input drivers v1.0
+	       (c) 1999-2001 Vojtech Pavlik <vojtech@suse.cz>
+			     Sponsored by SuSE
+	    $Id: input.txt,v 1.5 2001/06/06 11:05:33 vojtech Exp $
+----------------------------------------------------------------------------
+
+0. Disclaimer
+~~~~~~~~~~~~~
+  This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option)
+any later version.
+
+  This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+more details.
+
+  You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc., 59
+Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+  Should you need to contact me, the author, you can do so either by e-mail
+- mail your message to <vojtech@suse.cz>, or by paper mail: Vojtech Pavlik,
+Simunkova 1594, Prague 8, 182 00 Czech Republic
+
+  For your convenience, the GNU General Public License version 2 is included
+in the package: See the file COPYING.
+
+1. Introduction
+~~~~~~~~~~~~~~~
+  This is a collection of drivers that is designed to support all input
+devices under Linux. However, in the current kernels, although it's
+possibilities are much bigger, it's limited to USB devices only. This is
+also why it resides in the drivers/usb subdirectory.
+
+  The center of the input drivers is the input.o module, which must be
+loaded before any other of the input modules - it serves as a way of
+communication between two groups of modules:
+
+1.1 Device drivers
+~~~~~~~~~~~~~~~~~~
+  These modules talk to the hardware (for example via USB), and provide
+events (keystrokes, mouse movements) to the input.o module.
+
+1.2 Event handlers
+~~~~~~~~~~~~~~~~~~
+  These modules get events from input.o and pass them where needed via
+various interfaces - keystrokes to the kernel, mouse movements via a
+simulated PS/2 interface to GPM and X and so on.
+
+2. Simple Usage
+~~~~~~~~~~~~~~~
+  For the most usual configuration, with one USB mouse and one USB keyboard,
+you'll have to load the following modules (or have them built in to the
+kernel):
+
+	input.o
+	mousedev.o
+	keybdev.o
+	usbcore.o
+	usb-[uo]hci.o
+	hid.o
+
+  After this, the USB keyboard will work straight away, and the USB mouse
+will be available as a character device on major 13, minor 63:
+
+	crw-r--r--   1 root     root      13,  63 Mar 28 22:45 mice
+
+  This device, has to be created, unless you use devfs, in which case it's
+created automatically. The commands to do that are:
+
+	cd /dev
+	mkdir input
+	mknod input/mice c 13 63
+
+  After that you have to point GPM (the textmode mouse cut&paste tool) and
+XFree to this device to use it - GPM should be called like:
+
+	gpm -t ps2 -m /dev/input/mice
+
+  And in X:
+
+	Section "Pointer"
+	    Protocol    "ImPS/2"
+	    Device      "/dev/input/mice"
+	    ZAxisMapping 4 5
+	EndSection
+
+  When you do all of the above, you can use your USB mouse and keyboard.
+
+3. Detailed Description
+~~~~~~~~~~~~~~~~~~~~~~~
+3.1 Device drivers
+~~~~~~~~~~~~~~~~~~
+  Device drivers are the modules that generate events. The events are
+however not useful without being handled, so you also will need to use some
+of the modules from section 3.2.
+
+3.1.1 hid.c
+~~~~~~~~~~~
+  Hid.c is the largest and most complex driver of the whole suite. It
+handles all HID devices, and because there is a very wide variety of them,
+and because the USB HID specification isn't simple, it needs to be this big.
+
+  Currently, it handles USB mice, joysticks, gamepads, steering wheels
+keyboards, trackballs and digitizers.
+
+ However, USB uses HID also for monitor controls, speaker controls, UPSs,
+LCDs and many other purposes.
+
+ The monitor and speaker controls should be easy to add to the hid/input
+interface, but for the UPSs and LCDs it doesn't make much sense. For this,
+the hiddev interface was designed. See Documentation/usb/hiddev.txt
+for more information about it.
+
+  The usage of the hid.o module is very simple, it takes no parameters,
+detects everything automatically and when a HID device is inserted, it
+detects it appropriately.
+
+  However, because the devices vary wildly, you might happen to have a
+device that doesn't work well. In that case #define DEBUG at the beginning
+of hid.c and send me the syslog traces.
+
+3.1.2 usbmouse.c
+~~~~~~~~~~~~~~~~
+  For embedded systems, for mice with broken HID descriptors and just any
+other use when the big hid.c wouldn't be a good choice, there is the
+usbmouse.c driver. It handles USB mice only. It uses a simpler HIDBP
+protocol. This also means the mice must support this simpler protocol. Not
+all do. If you don't have any strong reason to use this module, use hid.c
+instead.
+
+3.1.3 usbkbd.c
+~~~~~~~~~~~~~~
+  Much like usbmouse.c, this module talks to keyboards with a simpplified
+HIDBP protocol. It's smaller, but doesn't support any extra special keys.
+Use hid.c instead if there isn't any special reason to use this.
+
+3.1.4 wacom.c
+~~~~~~~~~~~~~
+  This is a driver for Wacom Graphire and Intuos tablets. Not for Wacom
+PenPartner, that one is handled by the HID driver. Although the Intuos and
+Graphire tablets claim that they are HID tablets as well, they are not and
+thus need this specific driver.
+
+3.1.5 iforce.c
+~~~~~~~~~~~~~~~
+  A driver for I-Force joysticks and wheels, both over USB and RS232. 
+It includes ForceFeedback support now, even though Immersion Corp. considers
+the protocol a trade secret and won't disclose a word about it.
+
+3.2 Event handlers
+~~~~~~~~~~~~~~~~~~
+  Event handlers distrubite the events from the devices to userland and
+kernel, as needed.
+
+3.2.1 keybdev.c
+~~~~~~~~~~~~~~~
+  Keybdev is currently a rather ugly hack that translates the input events
+into architecture-specific keyboard raw mode (Xlated AT Set2 on x86), and
+passes them into the handle_scancode function of the keyboard.c module. This
+works well enough on all architectures that keybdev can generate rawmode on,
+other architectures can be added to it.
+
+  The right way would be to pass the events to keyboard.c directly, best if
+keyboard.c would itself be an event handler. This is done in the input
+patch, available on the webpage mentioned below.
+
+3.2.2 mousedev.c
+~~~~~~~~~~~~~~~~
+  Mousedev is also a hack to make programs that use mouse input work. It
+takes events from either mice or digitizers/tablets and makes a PS/2-style
+(a la /dev/psaux) mouse device available to the userland. Ideally, the
+programs could use a more reasonable interface, for example evdev.c
+
+  Mousedev devices in /dev/input (as shown above) are:
+
+	crw-r--r--   1 root     root      13,  32 Mar 28 22:45 mouse0
+	crw-r--r--   1 root     root      13,  33 Mar 29 00:41 mouse1
+	crw-r--r--   1 root     root      13,  34 Mar 29 00:41 mouse2
+	crw-r--r--   1 root     root      13,  35 Apr  1 10:50 mouse3
+	...
+	...
+	crw-r--r--   1 root     root      13,  62 Apr  1 10:50 mouse30
+	crw-r--r--   1 root     root      13,  63 Apr  1 10:50 mice
+
+Each 'mouse' device is assigned to a single mouse or digitizer, except the last
+one - 'mice'. This single character device is shared by all mice and
+digitizers, and even if none are connected, the device is present.  This is
+useful for hotplugging USB mice, so that programs can open the device even when
+no mice are present.
+
+  CONFIG_INPUT_MOUSEDEV_SCREEN_[XY] in the kernel configuration are the size
+of your screen (in pixels) in XFree86. This is needed if you want to use
+your digitizer in X, because it's movement is sent to X via a virtual PS/2
+mouse and thus needs to be scaled accordingly. These values won't be used if
+you use a mouse only.
+
+  Mousedev will generate either PS/2, ImPS/2 (Microsoft IntelliMouse) or
+ExplorerPS/2 (IntelliMouse Explorer) protocols, depending on what the program
+reading the data wishes. You can set GPM and X to any of these. You'll need
+ImPS/2 if you want to make use of a wheel on a USB mouse and ExplorerPS/2 if you
+want to use extra (up to 5) buttons. 
+
+3.2.3 joydev.c
+~~~~~~~~~~~~~~
+  Joydev implements v0.x and v1.x Linux joystick api, much like
+drivers/char/joystick/joystick.c used to in earlier versions. See
+joystick-api.txt in the Documentation subdirectory for details.  As soon as
+any joystick is connected, it can be accessed in /dev/input on:
+
+	crw-r--r--   1 root     root      13,   0 Apr  1 10:50 js0
+	crw-r--r--   1 root     root      13,   1 Apr  1 10:50 js1
+	crw-r--r--   1 root     root      13,   2 Apr  1 10:50 js2
+	crw-r--r--   1 root     root      13,   3 Apr  1 10:50 js3
+	...
+
+And so on up to js31.
+
+3.2.4 evdev.c
+~~~~~~~~~~~~~
+  Evdev is the generic input event interface. It passes the events generated
+in the kernel straight to the program, with timestamps. The API is still
+evolving, but should be useable now. It's described in section 5.
+
+  This should be the way for GPM and X to get keyboard and mouse mouse
+events. It allows for multihead in X without any specific multihead kernel
+support. The event codes are the same on all architectures and are hardware
+independent.
+
+  The devices are in /dev/input:
+
+	crw-r--r--   1 root     root      13,  64 Apr  1 10:49 event0
+	crw-r--r--   1 root     root      13,  65 Apr  1 10:50 event1
+	crw-r--r--   1 root     root      13,  66 Apr  1 10:50 event2
+	crw-r--r--   1 root     root      13,  67 Apr  1 10:50 event3
+	...
+
+3. Contacts
+~~~~~~~~~~~
+  This effort has it's home page at:
+
+	http://www.suse.cz/development/input/
+
+You'll find both the latest HID driver and the complete Input driver there
+as well as information how to access the CVS repository for latest revisions
+of the drivers.
+
+  There is also a mailing list for this:
+
+	majordomo@atrey.karlin.mff.cuni.cz
+
+Send "subscribe linux-input" to subscribe to it.
+
+4. Verifying if it works
+~~~~~~~~~~~~~~~~~~~~~~~~
+  Typing a couple keys on the keyboard should be enough to check that a USB
+keyboard works and is correctly connected to the kernel keyboard driver.
+
+  Doing a cat /dev/input/mouse0 (c, 13, 32) will verify that a mouse is also
+emulated, characters should appear if you move it.
+
+  You can test the joystick emulation with the 'jstest' utility, available
+in the joystick package (see Documentation/joystick.txt).
+
+  You can test the event devics with the 'evtest' utitily available on the
+input driver homepage (see the URL above).
+
+5. Event interface
+~~~~~~~~~~~~~~~~~~
+  Should you want to add event device support into any application (X, gpm,
+svgalib ...) I <vojtech@suse.cz> will be happy to provide you any help I
+can. Here goes a description of the current state of things, which is going
+to be extended, but not changed incompatibly as time goes:
+
+  You can use blocking and nonblocking reads, also select() on the
+/dev/input/eventX devices, and you'll always get a whole number of input
+events on a read. Their layout is:
+
+struct input_event {
+	struct timeval time;
+	unsigned short type;
+	unsigned short code;
+	unsigned int value;
+};
+
+  'time' is the timestamp, it returns the time at which the event happened.
+Type is for example EV_REL for relative momement, REL_KEY for a keypress or
+release. More types are defined in include/linux/input.h.
+
+  'code' is event code, for example REL_X or KEY_BACKSPACE, again a complete
+list is in include/linux/input.h.
+
+  'value' is the value the event carries. Either a relative change for
+EV_REL, absolute new value for EV_ABS (joysticks ...), or 0 for EV_KEY for
+release, 1 for keypress and 2 for autorepeat.
diff -u --recursive --new-file v2.4.9/linux/Documentation/input/joystick-api.txt linux/Documentation/input/joystick-api.txt
--- v2.4.9/linux/Documentation/input/joystick-api.txt	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/input/joystick-api.txt	Wed Sep 12 15:34:06 2001
@@ -0,0 +1,316 @@
+		      Joystick API Documentation                -*-Text-*-
+
+		        Ragnar Hojland Espinosa
+			  <ragnar@macula.net>
+
+			      7 Aug 1998
+
+	$Id: joystick-api.txt,v 1.2 2001/05/08 21:21:23 vojtech Exp $
+
+1. Initialization
+~~~~~~~~~~~~~~~~~
+
+Open the joystick device following the usual semantics (that is, with open).
+Since the driver now reports events instead of polling for changes,
+immediately after the open it will issue a series of synthetic events
+(JS_EVENT_INIT) that you can read to check the initial state of the
+joystick.
+
+By default, the device is opened in blocking mode.
+
+	int fd = open ("/dev/js0", O_RDONLY);
+
+
+2. Event Reading
+~~~~~~~~~~~~~~~~
+
+	struct js_event e;
+	read (fd, &e, sizeof(struct js_event));
+
+where js_event is defined as
+
+	struct js_event {
+		__u32 time;     /* event timestamp in milliseconds */
+		__s16 value;    /* value */
+		__u8 type;      /* event type */
+		__u8 number;    /* axis/button number */
+	};
+
+If the read is successful, it will return sizeof(struct js_event), unless
+you wanted to read more than one event per read as described in section 3.1.
+
+
+2.1 js_event.type
+~~~~~~~~~~~~~~~~~
+
+The possible values of ``type'' are
+
+	#define JS_EVENT_BUTTON         0x01    /* button pressed/released */
+	#define JS_EVENT_AXIS           0x02    /* joystick moved */
+	#define JS_EVENT_INIT           0x80    /* initial state of device */
+
+As mentioned above, the driver will issue synthetic JS_EVENT_INIT ORed
+events on open. That is, if it's issuing a INIT BUTTON event, the
+current type value will be
+
+	int type = JS_EVENT_BUTTON | JS_EVENT_INIT;	/* 0x81 */
+
+If you choose not to differentiate between synthetic or real events
+you can turn off the JS_EVENT_INIT bits
+
+	type &= ~JS_EVENT_INIT;				/* 0x01 */
+
+
+2.2 js_event.number
+~~~~~~~~~~~~~~~~~~~
+
+The values of ``number'' correspond to the axis or button that
+generated the event. Note that they carry separate numeration (that
+is, you have both an axis 0 and a button 0). Generally,
+
+			number
+	1st Axis X	0
+	1st Axis Y	1
+	2nd Axis X	2
+	2nd Axis Y	3
+	...and so on
+
+Hats vary from one joystick type to another. Some can be moved in 8
+directions, some only in 4, The driver, however, always reports a hat as two
+independent axis, even if the hardware doesn't allow independent movement.
+
+
+2.3 js_event.value
+~~~~~~~~~~~~~~~~~~
+
+For an axis, ``value'' is a signed integer between -32767 and +32767
+representing the position of the joystick along that axis. If you
+don't read a 0 when the joystick is `dead', or if it doesn't span the
+full range, you should recalibrate it (with, for example, jscal).
+
+For a button, ``value'' for a press button event is 1 and for a release
+button event is 0.
+
+Though this
+
+	if (js_event.type == JS_EVENT_BUTTON) {
+		buttons_state ^= (1 << js_event.number);
+	}
+
+may work well if you handle JS_EVENT_INIT events separately,
+
+	if ((js_event.type & ~JS_EVENT_INIT) == JS_EVENT_BUTTON) {
+		if (js_event.value)
+	        	buttons_state |= (1 << js_event.number);
+	   	else
+	      		buttons_state &= ~(1 << js_event.number);
+	}
+
+is much safer since it can't lose sync with the driver. As you would
+have to write a separate handler for JS_EVENT_INIT events in the first
+snippet, this ends up being shorter.
+
+
+2.4 js_event.time
+~~~~~~~~~~~~~~~~~
+
+The time an event was generated is stored in ``js_event.time''. It's a time
+in milliseconds since ... well, since sometime in the past.  This eases the
+task of detecting double clicks, figuring out if movement of axis and button
+presses happened at the same time, and similar.
+
+
+3. Reading
+~~~~~~~~~~
+
+If you open the device in blocking mode, a read will block (that is,
+wait) forever until an event is generated and effectively read. There
+are two alternatives if you can't afford to wait forever (which is,
+admittedly, a long time;)
+
+	a) use select to wait until there's data to be read on fd, or
+	   until it timeouts. There's a good example on the select(2)
+	   man page.
+
+	b) open the device in non-blocking mode (O_NONBLOCK)
+
+
+3.1 O_NONBLOCK
+~~~~~~~~~~~~~~
+
+If read returns -1 when reading in O_NONBLOCK mode, this isn't
+necessarily a "real" error (check errno(3)); it can just mean there
+are no events pending to be read on the driver queue. You should read
+all events on the queue (that is, until you get a -1).
+
+For example,
+
+	while (1) {
+		while (read (fd, &e, sizeof(struct js_event)) > 0) {
+	        	process_event (e);
+	   	}
+	   	/* EAGAIN is returned when the queue is empty */
+	   	if (errno != EAGAIN) {
+	      		/* error */
+	   	}
+	   	/* do something interesting with processed events */
+	}
+
+One reason for emptying the queue is that if it gets full you'll start
+missing events since the queue is finite, and older events will get
+overwritten.
+
+The other reason is that you want to know all what happened, and not
+delay the processing till later.
+
+Why can get the queue full? Because you don't empty the queue as
+mentioned, or because too much time elapses from one read to another
+and too many events to store in the queue get generated. Note that
+high system load may contribute to space those reads even more.
+
+If time between reads is enough to fill the queue and loose an event,
+the driver will switch to startup mode and next time you read it,
+synthetic events (JS_EVENT_INIT) will be generated to inform you of
+the actual state of the joystick.
+
+[As for version 1.2.8, the queue is circular and able to hold 64
+ events. You can increment this size bumping up JS_BUFF_SIZE in
+ joystick.h and recompiling the driver.]
+
+
+In the above code, you might as well want to read more than one event
+at a time using the typical read(2) functionality. For that, you would
+replace the read above with something like
+
+	struct js_event mybuffer[0xff];
+	int i = read (fd, mybuffer, sizeof(struct mybuffer));
+
+In this case, read would return -1 if the queue was empty, or some
+other value in which the number of events read would be i /
+sizeof(js_event)  Again, if the buffer was full, it's a good idea to
+process the events and keep reading it until you empty the driver queue.
+
+
+4. IOCTLs
+~~~~~~~~~
+
+The joystick driver defines the following ioctl(2) operations.
+
+				/* function			3rd arg  */
+	#define JSIOCGAXES	/* get number of axes		char	 */
+	#define JSIOCGBUTTONS	/* get number of buttons	char	 */
+	#define JSIOCGVERSION	/* get driver version		int	 */
+	#define JSIOCGNAME(len) /* get identifier string	char	 */
+	#define JSIOCSCORR	/* set correction values	&js_corr */
+	#define JSIOCGCORR	/* get correction values	&js_corr */
+
+For example, to read the number of axes
+
+	char number_of_axes;
+	ioctl (fd, JSIOCGAXES, &number_of_axes);
+
+
+4.1 JSIOGCVERSION
+~~~~~~~~~~~~~~~~~
+
+JSIOGCVERSION is a good way to check in run-time whether the running
+driver is 1.0+ and supports the event interface. If it is not, the
+IOCTL will fail. For a compile-time decision, you can test the
+JS_VERSION symbol
+
+	#ifdef JS_VERSION
+	#if JS_VERSION > 0xsomething
+
+
+4.2 JSIOCGNAME
+~~~~~~~~~~~~~~
+
+JSIOCGNAME(len) allows you to get the name string of the joystick - the same
+as is being printed at boot time. The 'len' argument is the length of the
+buffer provided by the application asking for the name. It is used to avoid
+possible overrun should the name be too long.
+
+	char name[128];
+	if (ioctl(fd, JSIOCGNAME(sizeof(name)), name) < 0)
+		strncpy(name, "Unknown", sizeof(name));
+	printf("Name: %s\n", name);
+
+
+4.3 JSIOC[SG]CORR
+~~~~~~~~~~~~~~~~~
+
+For usage on JSIOC[SG]CORR I suggest you to look into jscal.c  They are
+not needed in a normal program, only in joystick calibration software
+such as jscal or kcmjoy. These IOCTLs and data types aren't considered
+to be in the stable part of the API, and therefore may change without
+warning in following releases of the driver.
+
+Both JSIOCSCORR and JSIOCGCORR expect &js_corr to be able to hold
+information for all axis. That is, struct js_corr corr[MAX_AXIS];
+
+struct js_corr is defined as
+
+	struct js_corr {
+		__s32 coef[8];
+		__u16 prec;
+		__u16 type;
+	};
+
+and ``type''
+
+	#define JS_CORR_NONE            0x00    /* returns raw values */
+	#define JS_CORR_BROKEN          0x01    /* broken line */
+
+
+5. Backward compatibility
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The 0.x joystick driver API is quite limited and its usage is deprecated.
+The driver offers backward compatibility, though. Here's a quick summary:
+
+	struct JS_DATA_TYPE js;
+	while (1) {
+		if (read (fd, &js, JS_RETURN) != JS_RETURN) {
+	      		/* error */
+	   	}
+	   	usleep (1000);
+	}
+
+As you can figure out from the example, the read returns immediately,
+with the actual state of the joystick.
+
+	struct JS_DATA_TYPE {
+		int buttons;    /* immediate button state */
+		int x;          /* immediate x axis value */
+		int y;          /* immediate y axis value */
+	};
+
+and JS_RETURN is defined as
+
+	#define JS_RETURN       sizeof(struct JS_DATA_TYPE)
+
+To test the state of the buttons,
+
+	first_button_state  = js.buttons & 1;
+	second_button_state = js.buttons & 2;
+
+The axis values do not have a defined range in the original 0.x driver,
+except for that the values are non-negative. The 1.2.8+ drivers use a
+fixed range for reporting the values, 1 being the minimum, 128 the
+center, and 255 maximum value.
+
+The v0.8.0.2 driver also had an interface for 'digital joysticks', (now
+called Multisystem joysticks in this driver), under /dev/djsX. This driver
+doesn't try to be compatible with that interface.
+
+
+6. Final Notes
+~~~~~~~~~~~~~~
+
+____/|	Comments, additions, and specially corrections are welcome.
+\ o.O|	Documentation valid for at least version 1.2.8 of the joystick
+ =(_)=	driver and as usual, the ultimate source for documentation is
+   U	to "Use The Source Luke" or, at your convenience, Vojtech ;)
+
+					- Ragnar
+EOF
diff -u --recursive --new-file v2.4.9/linux/Documentation/input/joystick-parport.txt linux/Documentation/input/joystick-parport.txt
--- v2.4.9/linux/Documentation/input/joystick-parport.txt	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/input/joystick-parport.txt	Wed Sep 12 15:34:06 2001
@@ -0,0 +1,533 @@
+		    Linux Joystick parport drivers v2.0
+	       (c) 1998-2000 Vojtech Pavlik <vojtech@suse.cz>
+	       (c) 1998 Andree Borrmann <a.borrmann@tu-bs.de>
+			     Sponsored by SuSE
+	$Id: joystick-parport.txt,v 1.5 2001/05/15 06:41:00 vojtech Exp $
+----------------------------------------------------------------------------
+
+0. Disclaimer
+~~~~~~~~~~~~~
+  Any information in this file is provided as-is, without any guarantee that
+it will be true. So, use it at your own risk. The possible damages that can
+happen include burning your parallel port, and/or the sticks and joystick
+and maybe even more. Like when a lightning kills you it is not our problem.
+
+1. Intro
+~~~~~~~~
+  The joystick parport drivers are used for joysticks and gamepads not
+originally designed for PCs and other computers Linux runs on. Because of
+that, PCs usually lack the right ports to connect these devices to. Parallel
+port, because of its ability to change single bits at will, and providing
+both output and input bits is the most suitable port on the PC for
+connecting such devices.
+
+2. Devices supported
+~~~~~~~~~~~~~~~~~~~~
+  Many console and 8-bit computer gamepads and joysticks are supported. The
+following subsections discuss usage of each.
+
+2.1 NES and SNES
+~~~~~~~~~~~~~~~~
+  The Nintendo Entertainment System and Super Nintendo Entertainment System
+gamepads are widely available, and easy to get. Also, they are quite easy to
+connect to a PC, and don't need much processing speed (108 us for NES and
+165 us for SNES, compared to about 1000 us for PC gamepads) to communicate
+with them.
+
+  All NES and SNES use the same synchronous serial protocol, clocked from
+the computer's side (and thus timing insensitive). To allow up to 5 NES
+and/or SNES gamepads connected to the parallel port at once, the output
+lines of the parallel port are shared, while one of 5 available input lines
+is assigned to each gamepad.
+
+  This protocol is handled by the gamecon.c driver, so that's the one
+you'll use for NES and SNES gamepads.
+
+  The main problem with PC parallel ports is that they don't have +5V power
+source on any of their pins. So, if you want a reliable source of power
+for your pads, use either keyboard or joystick port, and make a pass-through
+cable. You can also pull the power directly from the power supply (the red
+wire is +5V).
+
+  If you want to use the parallel port only, you can take the power is from
+some data pin. For most gamepad and parport implementations only one pin is
+needed, and I'd recommend pin 9 for that, the highest data bit. On the other
+hand, if you are not planning to use anything else than NES / SNES on the
+port, anything between and including pin 4 and pin 9 will work.
+
+(pin 9) -----> Power
+
+  Unfortunately, there are pads that need a lot more of power, and parallel
+ports that can't give much current through the data pins. If this is your
+case, you'll need to use diodes (as a prevention of destroying your parallel
+port), and combine the currents of two or more data bits together.
+
+	   Diodes
+(pin 9) ----|>|-------+------> Power
+		      |
+(pin 8) ----|>|-------+
+		      |
+(pin 7) ----|>|-------+
+		      |
+ <and so on>          :
+		      |
+(pin 4) ----|>|-------+
+
+  Ground is quite easy. On PC's parallel port the ground is on any of the
+pins from pin 18 to pin 25. So use any pin of these you like for the ground.
+
+(pin 18) -----> Ground
+
+  NES and SNES pads have two input bits, Clock and Latch, which drive the
+serial transfer. These are connected to pins 2 and 3 of the parallel port,
+respectively.
+
+(pin 2) -----> Clock
+(pin 3) -----> Latch
+
+  And the last thing is the NES / SNES data wire. Only that isn't shared and
+each pad needs its own data pin. The parallel port pins are:
+
+(pin 10) -----> Pad 1 data
+(pin 11) -----> Pad 2 data
+(pin 12) -----> Pad 3 data
+(pin 13) -----> Pad 4 data
+(pin 15) -----> Pad 5 data
+
+  Note that pin 14 is not used, since it is not an input pin on the parallel
+port.
+
+  This is everything you need on the PC's side of the connection, now on to
+the gamepads side. The NES and SNES have different connectors. Also, there
+are quite a lot of NES clones, and because Nintendo used proprietary
+connectors for their machines, the cloners couldn't and used standard D-Cannon
+connectors. Anyway, if you've got a gamepad, and it has buttons A, B, Turbo
+A, Turbo B, Select and Start, and is connected through 5 wires, then it is
+either a NES or NES clone and will work with this connection. SNES gamepads
+also use 5 wires, but have more buttons. They will work as well, of course.
+
+Pinout for NES gamepads                 Pinout for SNES gamepads
+
+	   +----> Power                   +-----------------------\
+	   |                            7 | o  o  o  o |  x  x  o  | 1
+ 5 +---------+  7                         +-----------------------/
+   | x  x  o   \                            |  |  |  |          |
+   | o  o  o  o |                           |  |  |  |          +-> Ground
+ 4 +------------+ 1                         |  |  |  +------------> Data
+     |  |  |  |                             |  |  +---------------> Latch
+     |  |  |  +-> Ground                    |  +------------------> Clock
+     |  |  +----> Clock                     +---------------------> Power
+     |  +-------> Latch
+     +----------> Data
+
+Pinout for NES clone (db9) gamepads     Pinout for NES clone (db15) gamepads
+
+	+---------> Clock                    +-----------------> Data
+	| +-------> Latch                    |             +---> Ground
+	| | +-----> Data                     |             |
+	| | |                              ___________________
+    _____________                        8 \ o x x x x x x o / 1
+  5 \ x o o o x / 1                         \ o x x o x x o /
+     \ x o x o /                          15 `~~~~~~~~~~~~~' 9
+    9 `~~~~~~~' 6                             |     |     |
+	 |   |                                |     |     +----> Clock
+	 |   +----> Power                     |     +----------> Latch
+	 +--------> Ground                    +----------------> Power
+
+2.2 Multisystem joysticks
+~~~~~~~~~~~~~~~~~~~~~~~~~
+  In the era of 8-bit machines, there was something like de-facto standard
+for joystick ports. They were all digital, and all used D-Cannon 9 pin
+connectors (db9). Because of that, a single joystick could be used without
+hassle on Atari (130, 800XE, 800XL, 2600, 7200), Amiga, Commodore C64,
+Amstrad CPC, Sinclair ZX Spectrum and many other machines. That's why these
+joysticks are called "Multisystem".
+
+  Now their pinout:
+
+      +---------> Right
+      | +-------> Left
+      | | +-----> Down
+      | | | +---> Up
+      | | | |
+  _____________
+5 \ x o o o o / 1
+   \ x o x o /
+  9 `~~~~~~~' 6
+       |   |
+       |   +----> Button
+       +--------> Ground
+
+  However, as time passed, extensions to this standard developed, and these
+were not compatible with each other:
+
+
+	Atari 130, 800/XL/XE		   MSX
+
+					 +-----------> Power
+      +---------> Right                  | +---------> Right
+      | +-------> Left                   | | +-------> Left
+      | | +-----> Down                   | | | +-----> Down
+      | | | +---> Up                     | | | | +---> Up
+      | | | |                            | | | | |
+  _____________                        _____________
+5 \ x o o o o / 1                    5 \ o o o o o / 1
+   \ x o o o /                          \ o o o o /
+  9 `~~~~~~~' 6                        9 `~~~~~~~' 6
+       | | |                              | | | |
+       | | +----> Button                  | | | +----> Button 1
+       | +------> Power                   | | +------> Button 2
+       +--------> Ground                  | +--------> Output 3
+					  +----------> Ground
+
+	Amstrad CPC			   Commodore C64
+
+					 +-----------> Analog Y
+      +---------> Right                  | +---------> Right
+      | +-------> Left                   | | +-------> Left
+      | | +-----> Down                   | | | +-----> Down
+      | | | +---> Up                     | | | | +---> Up
+      | | | |                            | | | | |
+  _____________                        _____________
+5 \ x o o o o / 1                    5 \ o o o o o / 1
+   \ x o o o /                          \ o o o o /
+  9 `~~~~~~~' 6                        9 `~~~~~~~' 6
+       | | |                              | | | |
+       | | +----> Button 1                | | | +----> Button
+       | +------> Button 2                | | +------> Power
+       +--------> Ground                  | +--------> Ground
+					  +----------> Analog X
+
+	Sinclair Spectrum +2A/+3           Amiga 1200
+                                     
+    +-----------> Up                     +-----------> Button 3
+    | +---------> Fire                   | +---------> Right
+    | |                                  | | +-------> Left
+    | |   +-----> Ground                 | | | +-----> Down
+    | |   |                              | | | | +---> Up
+    | |   |                              | | | | |
+  _____________                        _____________
+5 \ o o x o x / 1                    5 \ o o o o o / 1
+   \ o o o o /                          \ o o o o /
+  9 `~~~~~~~' 6                        9 `~~~~~~~' 6
+     | | | |                              | | | |
+     | | | +----> Right                   | | | +----> Button 1
+     | | +------> Left                    | | +------> Power
+     | +--------> Ground                  | +--------> Ground
+     +----------> Down                    +----------> Button 2
+
+  And there were many others.
+
+2.2.1 Multisystem joysticks using db9.c
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  For the Multisystem joysticks, and their derivatives, the db9.c driver
+was written. It allows only one joystick / gamepad per parallel port, but
+the interface is easy to build and works with almost anything.
+
+  For the basic 1-button Multisystem joystick you connect its wires to the
+parallel port like this:
+
+(pin  1) -----> Power
+(pin 18) -----> Ground
+
+(pin  2) -----> Up
+(pin  3) -----> Down
+(pin  4) -----> Left
+(pin  5) -----> Right
+(pin  6) -----> Button 1
+
+  However, if the joystick is switch based (eg. clicks when you move it),
+you might or might not, depending on your parallel port, need 10 kOhm pullup
+resistors on each of the direction and button signals, like this:
+
+(pin 2) ------------+------> Up
+	  Resistor  |
+(pin 1) --[10kOhm]--+
+
+  Try without, and if it doesn't work, add them. For TTL based joysticks /
+gamepads the pullups are not needed.
+
+  For joysticks with two buttons you connect the second button to pin 7 on
+the parallel port.
+
+(pin 7) -----> Button 2
+
+  And that's it.
+
+  On a side note, if you have already built a different adapter for use with
+the digital joystick driver 0.8.0.2, this is also supported by the db9.c
+driver, as device type 8. (See section 3.2)
+
+2.2.2 Multisystem joysticks using gamecon.c
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  For some people just one joystick per parallel port is not enough, and/or
+want to use them on one parallel port together with NES/SNES/PSX pads. This is
+possible using the gamecon.c. It supports up to 5 devices of the above types,
+including 1 and 2 buttons Multisystem joysticks.
+
+  However, there is nothing for free. To allow more sticks to be used at
+once, you need the sticks to be purely switch based (that is non-TTL), and
+not to need power. Just a plain simple six switches inside. If your
+joystick can do more (eg. turbofire) you'll need to disable it totally first
+if you want to use gamecon.c.
+
+  Also, the connection is a bit more complex. You'll need a bunch of diodes,
+and one pullup resistor. First, you connect the Directions and the button
+the same as for db9, however with the diodes inbetween.
+
+	    Diodes
+(pin 2) -----|<|----> Up
+(pin 3) -----|<|----> Down
+(pin 4) -----|<|----> Left
+(pin 5) -----|<|----> Right
+(pin 6) -----|<|----> Button 1
+
+  For two button sticks you also connect the other button.
+
+(pin 7) -----|<|----> Button 2
+
+  And finally, you connect the Ground wire of the joystick, like done in
+this little schematic to Power and Data on the parallel port, as described
+for the NES / SNES pads in section 2.1 of this file - that is, one data pin
+for each joystick. The power source is shared.
+
+Data    ------------+-----> Ground
+	  Resistor  |
+Power   --[10kOhm]--+
+
+  And that's all, here we go!
+
+2.2.3 Multisystem joysticks using turbografx.c
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  The TurboGraFX interface, designed by
+
+	Steffen Schwenke <schwenke@burg-halle.de>
+
+  allows up to 7 Multisystem joysticks connected to the parallel port. In
+Steffen's version, there is support for up to 5 buttons per joystick.  However,
+since this doesn't work reliably on all parallel ports, the turbografx.c driver
+supports only one button per joystick. For more information on how to build the
+interface, see
+
+	http://www2.burg-halle.de/~schwenke/parport.html
+
+2.3 Sony Playstation
+~~~~~~~~~~~~~~~~~~~~
+
+  The PSX controller is supported by the gamecon.c. Pinout of the PSX
+controller (compatible with DirectPadPro):
+
+  +---------+---------+---------+
+9 | o  o  o | o  o  o | o  o  o | 1               parallel
+   \________|_________|________/                  port pins
+    |  |      |  |  |   |
+    |  |      |  |  |   +-------->  Clock    ---  (4)
+    |  |      |  |  +------------>  Select   ---  (3)
+    |  |      |  +--------------->  Power    ---  (5-9)
+    |  |      +------------------>  Ground   ---  (18-25)
+    |  +------------------------->  Command  ---  (2)
+    +---------------------------->  Data     ---  (one of 10,11,12,13,15)
+
+  The driver supports these controllers:
+
+ * Standard PSX Pad
+ * NegCon PSX Pad
+ * Analog PSX Pad (red mode)
+ * Analog PSX Pad (green mode)
+ * PSX Rumble Pad
+
+2.4 Sega
+~~~~~~~~
+  All the Sega controllers are more or less based on the standard 2-button
+Multisystem joystick. However, since they don't use switches and use TTL
+logic, the only driver usable with them is the db9.c driver.
+
+2.4.1 Sega Master System
+~~~~~~~~~~~~~~~~~~~~~~~~
+  The SMS gamepads are almost exactly the same as normal 2-button
+Multisystem joysticks. Set the driver to Multi2 mode, use the corresponding
+parallel port pins, and the following schematic:
+
+    +-----------> Power
+    | +---------> Right
+    | | +-------> Left
+    | | | +-----> Down
+    | | | | +---> Up
+    | | | | |
+  _____________
+5 \ o o o o o / 1
+   \ o o x o /
+  9 `~~~~~~~' 6
+     | |   |
+     | |   +----> Button 1
+     | +--------> Ground
+     +----------> Button 2
+
+2.4.2 Sega Genesis aka MegaDrive
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  The Sega Genesis (in Europe sold as Sega MegaDrive) pads are an extension
+to the Sega Master System pads. They use more buttons (3+1, 5+1, 6+1).  Use
+the following schematic:
+
+    +-----------> Power
+    | +---------> Right
+    | | +-------> Left
+    | | | +-----> Down
+    | | | | +---> Up
+    | | | | |
+  _____________
+5 \ o o o o o / 1
+   \ o o o o /
+  9 `~~~~~~~' 6
+     | | | |
+     | | | +----> Button 1
+     | | +------> Select
+     | +--------> Ground
+     +----------> Button 2
+
+  The Select pin goes to pin 14 on the parallel port.
+
+(pin 14) -----> Select
+
+  The rest is the same as for Multi2 joysticks using db9.c
+
+2.4.3 Sega Saturn
+~~~~~~~~~~~~~~~~~
+  Sega Saturn has eight buttons, and to transfer that, without hacks like
+Genesis 6 pads use, it needs one more select pin. Anyway, it is still
+handled by the db9.c driver. Its pinout is very different from anything
+else.  Use this schematic:
+
+    +-----------> Select 1
+    | +---------> Power
+    | | +-------> Up
+    | | | +-----> Down
+    | | | | +---> Ground
+    | | | | |
+  _____________
+5 \ o o o o o / 1
+   \ o o o o /
+  9 `~~~~~~~' 6
+     | | | |
+     | | | +----> Select 2
+     | | +------> Right
+     | +--------> Left
+     +----------> Power
+
+  Select 1 is pin 14 on the parallel port, Select 2 is pin 16 on the
+parallel port.
+
+(pin 14) -----> Select 1
+(pin 16) -----> Select 2
+
+  The other pins (Up, Down, Right, Left, Power, Ground) are the same as for
+Multi joysticks using db9.c
+
+3. The drivers
+~~~~~~~~~~~~~~
+  There are three drivers for the parallel port interfaces. Each, as
+described above, allows to connect a different group of joysticks and pads.
+Here are described their command lines:
+
+3.1 gamecon.c
+~~~~~~~~~~~~~
+  Using gamecon.c you can connect up to five devices to one parallel port. It
+uses the following kernel/module command line:
+
+	gc=port,pad1,pad2,pad3,pad4,pad5
+
+  Where 'port' the number of the parport interface (eg. 0 for parport0).
+
+  And 'pad1' to 'pad5' are pad types connected to different data input pins
+(10,11,12,13,15), as described in section 2.1 of this file.
+
+  The types are:
+
+	Type | Joystick/Pad
+	--------------------
+	  0  | None
+	  1  | SNES pad
+	  2  | NES pad
+	  4  | Multisystem 1-button joystick
+	  5  | Multisystem 2-button joystick
+	  6  | N64 pad
+	  7  | Sony PSX controller
+
+  The exact type of the PSX controller type is autoprobed, so you must have
+your controller plugged in before initializing.
+
+  Should you want to use more than one of parallel ports at once, you can use
+gc_2 and gc_3 as additional command line parameters for two more parallel
+ports.
+
+3.2 db9.c
+~~~~~~~~~
+  Apart from making an interface, there is nothing difficult on using the
+db9.c driver. It uses the following kernel/module command line:
+
+	db9=port,type
+
+  Where 'port' is the number of the parport interface (eg. 0 for parport0).
+
+  Caveat here: This driver only works on bidirectional parallel ports. If
+your parallel port is recent enough, you should have no trouble with this.
+Old parallel ports may not have this feature.
+
+  'Type' is the type of joystick or pad attached:
+
+	Type | Joystick/Pad
+	--------------------
+	  0  | None
+	  1  | Multisystem 1-button joystick
+	  2  | Multisystem 2-button joystick
+	  3  | Genesis pad (3+1 buttons)
+	  5  | Genesis pad (5+1 buttons)
+	  6  | Genesis pad (6+2 buttons)
+	  7  | Saturn pad (8 buttons)
+	  8  | Multisystem 1-button joystick (v0.8.0.2 pin-out)
+	  9  | Two Multisystem 1-button joysticks (v0.8.0.2 pin-out) 
+	 10  | Amiga CD32 pad
+
+  Should you want to use more than one of these joysticks/pads at once, you
+can use db9_2 and db9_3 as additional command line parameters for two
+more joysticks/pads.
+
+3.3 turbografx.c
+~~~~~~~~~~~~~~~~
+  The turbografx.c driver uses a very simple kernel/module command line:
+
+	tgfx=port,js1,js2,js3,js4,js5,js6,js7
+
+  Where 'port' is the number of the parport interface (eg. 0 for parport0).
+
+  'jsX' is the number of buttons the Multisystem joysticks connected to the
+interface ports 1-7 have. For a standard multisystem joystick, this is 1.
+
+  Should you want to use more than one of these interfaces at once, you can
+use tgfx_2 and tgfx_3 as additional command line parameters for two more
+interfaces.
+
+3.4 PC parallel port pinout
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		  .----------------------------------------.
+   At the PC:     \ 13 12 11 10  9  8  7  6  5  4  3  2  1 /
+                   \  25 24 23 22 21 20 19 18 17 16 15 14 /
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+	  Pin | Name    | Description
+	~~~~~~|~~~~~~~~~|~~~~~~~~~~
+	    1 | /STROBE | Strobe
+	  2-9 | D0-D7   | Data Bit 0-7
+	   10 | /ACK    | Acknowledge
+	   11 | BUSY    | Busy
+	   12 | PE      | Paper End
+	   13 | SELIN   | Select In
+	   14 | /AUTOFD | Autofeed
+	   15 | /ERROR  | Error
+	   16 | /INIT   | Initialize
+	   17 | /SEL    | Select
+	18-25 | GND     | Signal Ground
+
+3.5 End
+~~~~~~~
+  That's all, folks! Have fun!
diff -u --recursive --new-file v2.4.9/linux/Documentation/input/joystick.txt linux/Documentation/input/joystick.txt
--- v2.4.9/linux/Documentation/input/joystick.txt	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/input/joystick.txt	Wed Sep 12 15:34:06 2001
@@ -0,0 +1,583 @@
+		       Linux Joystick driver v2.0.0
+	       (c) 1996-2000 Vojtech Pavlik <vojtech@suse.cz>
+			     Sponsored by SuSE
+	   $Id: joystick.txt,v 1.6 2001/06/05 09:57:01 vojtech Exp $
+----------------------------------------------------------------------------
+
+0. Disclaimer
+~~~~~~~~~~~~~
+  This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option)
+any later version.
+
+  This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+more details.
+
+  You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc., 59
+Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+  Should you need to contact me, the author, you can do so either by e-mail
+- mail your message to <vojtech@suse.cz>, or by paper mail: Vojtech Pavlik,
+Ucitelska 1576, Prague 8, 182 00 Czech Republic
+
+  For your convenience, the GNU General Public License version 2 is included
+in the package: See the file COPYING.
+
+1. Intro
+~~~~~~~~
+  The joystick driver for Linux provides support for a variety of joysticks
+and similar devices. It is based on a larger project aiming to support all
+input devices in Linux.
+
+  Should you encounter any problems while using the driver, or joysticks
+this driver can't make complete use of, I'm very interested in hearing about
+them. Bug reports and success stories are also welcome.
+
+  The input project website is at:
+
+	http://www.suse.cz/development/input/
+	http://atrey.karlin.mff.cuni.cz/~vojtech/input/
+
+  There is also a mailing list for the driver at:
+
+	listproc@atrey.karlin.mff.cuni.cz
+
+send "subscribe linux-joystick Your Name" to subscribe to it.
+
+2. Usage
+~~~~~~~~
+  For basic usage you just choose the right options in kernel config and
+you should be set.
+
+2.1 inpututils
+~~~~~~~~~~~~~~
+For testing and other purposes (for example serial devices), a set of
+utilities is available at the abovementioned website. I suggest you download
+and install it before going on.
+
+2.2 Device nodes
+~~~~~~~~~~~~~~~~
+For applications to be able to use the joysticks, in you don't use devfs,
+you'll have to manually create these nodes in /dev:
+
+cd /dev
+rm js*
+mkdir input
+mknod input/js0 c 13 0
+mknod input/js1 c 13 1
+mknod input/js2 c 13 2
+mknod input/js3 c 13 3
+ln -s input/js0 js0
+ln -s input/js1 js1
+ln -s input/js2 js2
+ln -s input/js3 js3
+
+For testing with inpututils it's also convenient to create these:
+
+mknod input/event0 c 13 64
+mknod input/event1 c 13 65
+mknod input/event2 c 13 66
+mknod input/event3 c 13 67
+
+2.4 Modules needed 
+~~~~~~~~~~~~~~~~~~
+  For all joystick drivers to function, you'll need the userland interface
+module in kernel, either loaded or compiled in:
+
+	modprobe joydev
+
+  For gameport joysticks, you'll have to load the gameport driver as well;
+
+	modprobe ns558
+
+  And for serial port joysticks, you'll need the serial input line
+discipline module loaded and the inputattach utility started:
+
+	modprobe serport
+	inputattach -xxx /dev/tts/X &
+
+  In addition to that, you'll need the joystick driver module itself, most
+usually you'll have an analog joystick:
+
+	modprobe analog
+	
+  For automatic module loading, something like this might work - tailor to
+your needs:
+
+	alias tty-ldisc-2 serport
+	alias char-major-13 input
+	above input joydev ns558 analog
+	options analog js=gameport
+
+2.5 Verifying that it works
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  For testing the joystick driver functionality, there is the jstest
+program in the utilities package. You run it by typing:
+
+	jstest /dev/js0
+
+  And it should show a line with the joystick values, which update as you
+move the stick, and press its buttons. The axes should all be zero when the
+joystick is in the center position. They should not jitter by themselves to
+other close values, and they also should be steady in any other position of
+the stick. They should have the full range from -32767 to 32767. If all this
+is met, then it's all fine, and you can play the games. :)
+
+  If it's not, then there might be a problem. Try to calibrate the joystick,
+and if it still doesn't work, read the drivers section of this file, the
+troubleshooting section, and the FAQ.
+
+2.6. Calibration
+~~~~~~~~~~~~~~~~
+  For most joysticks you won't need any manual calibration, since the
+joystick should be autocalibrated by the driver automagically. However, with
+some analog joysticks, that either do not use linear resistors, or if you
+want better precision, you can use the jscal program
+
+	jscal -c /dev/js0
+
+ included in the joystick package to set better correction coefficients than
+what the driver would choose itself.
+
+  After calibrating the joystick you can verify if you like the new
+calibration using the jstest command, and if you do, you then can save the
+correction coefficients into a file
+
+	jscal -p /dev/js0 > /etc/joystick.cal
+
+  And add a line to your rc script executing that file
+
+	source /etc/joystick.cal
+
+  This way, after the next reboot your joystick will remain calibrated. You
+can also add the jscal -p line to your shutdown script.
+
+
+3. HW specific driver information
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+In this section each of the separate hardware specific drivers is described.
+
+3.1 Analog joysticks
+~~~~~~~~~~~~~~~~~~~~
+  The analog.c uses the standard analog inputs of the gameport, and thus
+supports all standard joysticks and gamepads. It uses a very advanced
+routine for this, allowing for data precision that can't be found on any
+other system.
+
+  It also supports extensions like additional hats and buttons compatible
+with CH Flightstick Pro, ThrustMaster FCS or 6 and 8 button gamepads. Saitek
+Cyborg 'digital' joysticks are also supported by this driver, because
+they're basically souped up CHF sticks.
+
+  However the only types that can be autodetected are:
+
+* 2-axis, 4-button joystick
+* 3-axis, 4-button joystick
+* 4-axis, 4-button joystick
+* Saitek Cyborg 'digital' joysticks
+
+  For other joystick types (more/less axes, hats, and buttons) support
+you'll need to specify the types either on the kernel command line or on the
+module command line, when inserting analog.o into the kernel. The
+parameters are:
+
+	js=type,type,type,....
+
+  'type' is type of the joystick from the table below, defining joysticks
+present on gameports in the system, starting with gameport0, second 'type'
+entry defining joystick on gameport1 and so on.
+
+	Type     | Meaning
+	-----------------------------------
+	none     | No analog joystick on that port
+	auto     | Autodetect joystick
+	2btn     | 2-button n-axis joystick
+	y-joy    | Two 2-button 2-axis joysticks on an Y-cable
+	y-pad    | Two 2-button 2-axis gamepads on an Y-cable
+	fcs      | Thrustmaster FCS compatible joystick
+	chf      | Joystick with a CH Flightstick compatible hat
+	fullchf  | CH Flightstick compatible with two hats and 6 buttons
+	gamepad  | 4/6-button n-axis gamepad
+	gamepad8 | 8-button 2-axis gamepad
+
+  In case your joystick doesn't fit in any of the above categories, you can
+specify the type as a number by combining the bits in the table below. This
+is not recommended unless you really know what are you doing. It's not
+dangerous, but not simple either.
+
+	Bit | Meaning
+	--------------------------
+	 0  | Axis X1
+	 1  | Axis Y1
+	 2  | Axis X2
+	 3  | Axis Y2
+	 4  | Button A
+	 5  | Button B
+	 6  | Button C
+	 7  | Button D
+	 8  | CHF Buttons X and Y
+	 9  | CHF Hat 1
+	10  | CHF Hat 2
+	11  | FCS Hat
+	12  | Pad Button X
+	13  | Pad Button Y
+	14  | Pad Button U
+	15  | Pad Button V
+	16  | Saitek F1-F4 Buttons
+	17  | Saitek Digital Mode
+	19  | GamePad
+	20  | Joy2 Axis X1
+	21  | Joy2 Axis Y1
+	22  | Joy2 Axis X2
+	23  | Joy2 Axis Y2
+	24  | Joy2 Button A
+	25  | Joy2 Button B
+	26  | Joy2 Button C
+	27  | Joy2 Button D
+	31  | Joy2 GamePad
+
+3.2 Microsoft SideWinder joysticks
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  Microsoft 'Digital Overdrive' protocol is supported by the sidewinder.c
+module. All currently supported joysticks:
+
+* Microsoft SideWinder 3D Pro
+* Microsoft SideWinder Force Feedback Pro
+* Microsoft SideWinder Force Feedback Wheel
+* Microsoft SideWinder FreeStyle Pro 
+* Microsoft SideWinder GamePad (up to four, chained)
+* Microsoft SideWinder Precision Pro 
+* Microsoft SideWinder Precision Pro USB 
+
+  are autodetected, and thus no module parameters are needed.
+
+  There is one caveat with the 3D Pro. There are 9 buttons reported,
+although the joystick has only 8. The 9th button is the mode switch on the
+rear side of the joystick. However, moving it, you'll reset the joystick,
+and make it unresponsive for about a one third of a second. Furthermore, the
+joystick will also re-center itself, taking the position it was in during
+this time as a new center position. Use it if you want, but think first.
+
+  The SideWinder Standard is not a digital joystick, and thus is supported
+by the analog driver described above. 
+
+3.3 Logitech ADI devices
+~~~~~~~~~~~~~~~~~~~~~~~~
+  Logitech ADI protocol is supported by the adi.c module. It should support
+any Logitech device using this protocol. This includes, but is not limited
+to:
+
+* Logitech CyberMan 2
+* Logitech ThunderPad Digital
+* Logitech WingMan Extreme Digital
+* Logitech WingMan Formula
+* Logitech WingMan Interceptor
+* Logitech WingMan GamePad
+* Logitech WingMan GamePad USB
+* Logitech WingMan GamePad Extreme
+* Logitech WingMan Extreme Digital 3D
+
+  ADI devices are autodetected, and the driver supports up to two (any
+combination of) devices on a single gameport, using an Y-cable or chained
+together.
+
+  Logitech WingMan Joystick, Logitech WingMan Attack, Logitech WingMan
+Extreme and Logitech WingMan ThunderPad are not digital joysticks and are
+handled by the analog driver described above. Logitech WingMan Warrior and
+Logitech Magellan are supported by serial drivers described below.  Logitech
+WingMan Force and Logitech WingMan Formula Force are supported by the
+I-Force driver described below. Logitech CyberMan is not supported yet.
+
+3.4 Gravis GrIP
+~~~~~~~~~~~~~~~
+  Gravis GrIP protocol is supported by the grip.c module. It currently
+supports:
+
+* Gravis GamePad Pro
+* Gravis BlackHawk Digital
+* Gravis Xterminator
+* Gravis Xterminator DualControl
+
+  All these devices are autodetected, and you can even use any combination
+of up to two of these pads either chained together or using an Y-cable on a
+single gameport.
+
+GrIP MultiPort isn't supported yet. Gravis Stinger is a serial device and is
+supported by the stinger driver. Other Gravis joysticks are supported by the
+analog driver.
+
+3.5 FPGaming A3D and MadCatz A3D
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  The Assassin 3D protocol created by FPGaming, is used both by FPGaming
+themselves and is licensed to MadCatz. A3D devices are supported by the
+a3d.c module. It currently supports:
+
+* FPGaming Assassin 3D
+* MadCatz Panther
+* MadCatz Panther XL
+
+  All these devices are autodetected. Because the Assassin 3D and the Panther
+allow connecting analog joysticks to them, you'll need to load the analog
+driver as well to handle the attached joysticks.
+
+  The trackball should work with USB mousedev module as a normal mouse. See
+the USB documentation for how to setup an USB mouse.
+
+3.6 ThrustMaster DirectConnect (BSP)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  The TM DirectConnect (BSP) protocol is supported by the tmdc.c
+module. This includes, but is not limited to:
+
+* ThrustMaster Millenium 3D Inceptor
+* ThrustMaster 3D Rage Pad
+* ThrustMaster Fusion Digital Game Pad
+
+  Devices not directly supported, but hopefully working are:
+
+* ThrustMaster FragMaster
+* ThrustMaster Attack Throttle
+
+  If you have one of these, contact me.
+
+  TMDC devices are autodetected, and thus no parameters to the module
+are needed. Up to two TMDC devices can be connected to one gameport, using
+an Y-cable.
+
+3.7 Creative Labs Blaster
+~~~~~~~~~~~~~~~~~~~~~~~~~
+  The Blaster protocol is supported by the cobra.c module. It supports only
+the:
+
+* Creative Blaster GamePad Cobra
+
+  Up to two of these can be used on a single gameport, using an Y-cable.
+
+3.8 Genius Digital joysticks 
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  The Genius digitally communicating joysticks are supported by the gf2k.c
+module. This includes:
+
+* Genius Flight2000 F-23 joystick 
+* Genius Flight2000 F-31 joystick 
+* Genius G-09D gamepad
+
+  Other Genius digital joysticks are not supported yet, but support can be
+added fairly easily.
+
+3.9 InterAct Digital joysticks
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  The InterAct digitally communicating joysticks are supported by the
+interact.c module. This includes:
+
+* InterAct HammerHead/FX gamepad
+* InterAct ProPad8 gamepad 
+
+  Other InterAct digital joysticks are not supported yet, but support can be 
+added fairly easily.
+
+3.10 PDPI Lightning 4 gamecards
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  PDPI Lightning 4 gamecards are supported by the lightning.c module.
+Once the module is loaded, the analog driver can be used to handle the
+joysticks. Digitally communicating joystick will work only on port 0, while
+using Y-cables, you can connect up to 8 analog joysticks to a single L4
+card, 16 in case you have two in your system.
+
+3.11 Trident 4DWave / Aureal Vortex
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  Soundcards with a Trident 4DWave DX/NX or Aureal Vortex/Vortex2 chipsets
+provide an "Enhanced Game Port" mode where the soundcard handles polling the
+joystick.  This mode is supported by the pcigame.c module. Once loaded the
+analog driver can use the enhanced features of these gameports..
+
+3.13 Crystal SoundFusion
+~~~~~~~~~~~~~~~~~~~~~~~~
+  Soundcards with Crystal SoundFusion chipsets provide an "Enhanced Game
+Port", much like the 4DWave or Vortex above. This, and also the normal mode
+for the port of the SoundFusion is supported by the cs461x.c module.
+
+3.14 SoundBlaster Live!
+~~~~~~~~~~~~~~~~~~~~~~~~
+  The Live! has a special PCI gameport, which, although it doesn't provide
+any "Enhanced" stuff like 4DWave and friends, is quite a bit faster than
+it's ISA counterparts. It also requires special support, hence the
+emu10k1-gp.c module for it instead of the normal ns558.c one.
+
+3.15 SoundBlaster 64 and 128 - ES1370 and ES1371, ESS Solo1 and S3 SonicVibes
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  These PCI soundcards have specific gameports. They are handled by the
+sound drivers themselves. Make sure you select gameport support in the
+joystick menu and sound card support in the sound menu for your appropriate
+card.
+
+3.16 Amiga
+~~~~~~~~~~
+  Amiga joysticks, connected to an Amiga, are supported by the amijoy.c
+driver. Since they can't be autodetected, the driver has a command line.
+
+	amijoy=a,b
+
+  a and b define the joysticks connected to the JOY0DAT and JOY1DAT ports of
+the Amiga.
+
+	Value | Joystick type
+	---------------------
+	  0   | None
+	  1   | 1-button digital joystick
+
+  No more joystick types are supported now, but that should change in the
+future if I get an Amiga in the reach of my fingers.
+
+3.17 Game console and 8-bit pads and joysticks
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+See joystick-parport.txt for more info.
+
+3.18 SpaceTec/LabTec devices
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  SpaceTec serial devices communicate using the SpaceWare protocol. It is
+supported by the spaceorb.c and spaceball.c drivers. The devices currently
+supported by spaceorb.c are:
+
+* SpaceTec SpaceBall Avenger
+* SpaceTec SpaceOrb 360
+
+Devices currently supported by spaceball.c are:
+
+* SpaceTec SpaceBall 4000 FLX
+
+  In addition to having the spaceorb/spaceball and serport modules in the
+kernel, you also need to attach a serial port to it. to do that, run the
+inputattach program:
+
+	inputattach --spaceorb /dev/tts/x &
+or
+	inputattach --spaceball /dev/tts/x &
+
+where /dev/tts/x is the serial port which the device is connected to. After
+doing this, the device will be reported and will start working.
+
+  There is one caveat with the SpaceOrb. The button #6, the on the bottom
+side of the orb, although reported as an ordinary button, causes internal
+recentering of the spaceorb, moving the zero point to the position in which
+the ball is at the moment of pressing the button. So, think first before
+you bind it to some other function.
+
+SpaceTec SpaceBall 2003 FLX and 3003 FLX are not supported yet. 
+
+3.19 Logitech SWIFT devices
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  The SWIFT serial protocol is supported by the warrior.c module. It
+currently supports only the:
+
+* Logitech WingMan Warrior
+
+but in the future, Logitech CyberMan (the original one, not CM2) could be
+supported as well. To use the module, you need to run inputattach after you
+insert/compile the module into your kernel:
+
+	inputattach --warrior /dev/tts/x &
+
+/dev/tts/x is the serial port your Warrior is attached to.
+
+3.20 Magellan / Space Mouse
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  The Magellan (or Space Mouse), manufactured by LogiCad3d (formerly Space
+Systems), for many other companies (Logitech, HP, ...) is supported by the
+joy-magellan module. It currently supports only the:
+
+* Magellan 3D
+* Space Mouse
+
+models, the additional buttons on the 'Plus' versions are not supported yet.
+
+  To use it, you need to attach the serial port to the driver using the
+
+	inputattach --magellan /dev/tts/x &
+
+command. After that the Magellan will be detected, initialized, will beep,
+and the /dev/input/jsX device should become usable.
+
+3.21 I-Force devices 
+~~~~~~~~~~~~~~~~~~~~
+  All I-Force devices are supported by the iforce.c module. This includes:
+
+* AVB Mag Turbo Force
+* AVB Top Shot Pegasus
+* Logitech WingMan Force
+* Logitech WingMan Force 3D
+* Logitech WingMan Force Wheel 
+* Logitech WingMan Strike Force 3D
+* Guillemot Race Leader Force Feedback
+
+  To use it, you need to attach the serial port to the driver using the
+
+	inputattach --iforce /dev/tts/x &
+
+command. After that the I-Force device will be detected, and the
+/dev/input/jsX device should become usable.
+
+  In case you're using the device via the USB port, the inputattach command
+isn't needed.
+
+  The I-Force driver now supports force feedback via the event interface.
+
+3.22 Gravis Stinger gamepad 
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  The Gravis Stinger serial port gamepad, designed for use with laptop
+computers, is supported by the stinger.c module. To use it, attach the
+serial port to the driver using:
+
+        inputattach --stinger /dev/tty/x &
+
+where x is the number of the serial port.
+
+4. Troubleshooting
+~~~~~~~~~~~~~~~~~~
+  There is quite a high probability that you run into some problems. For
+testing whether the driver works, if in doubt, use the jstest utility in
+some of its modes. The most useful modes are "normal" - for the 1.x
+interface, and "old" for the "0.x" interface. You run it by typing:
+
+	jstest --normal /dev/input/js0
+	jstest --old    /dev/input/js0
+
+  Additionally you can do a test with the evtest utility:
+
+	evtest /dev/input/event0
+
+  Oh, and read the FAQ! :)
+
+5. FAQ
+~~~~~~
+Q: Running 'jstest /dev/js0' results in "File not found" error. What's the
+   cause?
+A: The device files don't exist. Create them (see section 2.2).
+
+Q: Is it possible to connect my old Atari/Commodore/Amiga/console joystick
+   or pad that uses a 9-pin D-type cannon connector to the serial port of my
+   PC?
+A: Yes, it is possible, but it'll burn your serial port or the pad. It
+   won't work, of course.
+
+Q: My joystick doesn't work with Quake / Quake 2. What's the cause?
+A: Quake / Quake 2 don't support joystick. Use joy2key to simulate keypresses
+   for them.
+
+6. Programming Interface
+~~~~~~~~~~~~~~~~~~~~~~~~
+  The 1.0 driver uses a new, event based approach to the joystick driver.
+Instead of the user program polling for the joystick values, the joystick
+driver now reports only any changes of its state. See joystick-api.txt,
+joystick.h and jstest.c included in the joystick package for more
+information. The joystick device can be used in either blocking or
+nonblocking mode and supports select() calls.
+
+  For backward compatibility the old (v0.x) interface is still included.
+Any call to the joystick driver using the old interface will return values
+that are compatible to the old interface.  This interface is still limited
+to 2 axes, and applications using it usually decode only 2 buttons, although
+the driver provides up to 32.
diff -u --recursive --new-file v2.4.9/linux/Documentation/isdn/README linux/Documentation/isdn/README
--- v2.4.9/linux/Documentation/isdn/README	Sun Aug 13 10:05:32 2000
+++ linux/Documentation/isdn/README	Sun Sep  9 10:52:35 2001
@@ -276,6 +276,8 @@
                                       1 = Add CPN to RING message on
                             Bit 1:    0 = Add CPN to FCON message off
                                       1 = Add CPN to FCON message on
+                            Bit 2:    0 = Add CDN to RING/FCON message off
+                                      1 = Add CDN to RING/FCON message on
 
   Last but not least a (at the moment fairly primitive) device to request
   the line-status (/dev/isdninfo) is made available.
diff -u --recursive --new-file v2.4.9/linux/Documentation/joystick-api.txt linux/Documentation/joystick-api.txt
--- v2.4.9/linux/Documentation/joystick-api.txt	Fri Apr  6 10:42:48 2001
+++ linux/Documentation/joystick-api.txt	Wed Dec 31 16:00:00 1969
@@ -1,315 +0,0 @@
-		      Joystick API Documentation                -*-Text-*-
-
-		        Ragnar Hojland Espinosa
-		          <ragnar@macula.net>
-
-			      7 Aug 1998
-
-
-1. Initialization
-~~~~~~~~~~~~~~~~~
-
-Open the joystick device following the usual semantics (that is, with open).
-Since the driver now reports events instead of polling for changes,
-immediately after the open it will issue a series of synthetic events
-(JS_EVENT_INIT) that you can read to check the initial state of the
-joystick.
-
-By default, the device is opened in blocking mode.
-
-	int fd = open ("/dev/js0", O_RDONLY);
-
-
-2. Event Reading
-~~~~~~~~~~~~~~~~
-
-	struct js_event e;
-	read (fd, &e, sizeof(struct js_event));
-
-where js_event is defined as
-
-	struct js_event {
-		__u32 time;     /* event timestamp in milliseconds */
-		__s16 value;    /* value */
-		__u8 type;      /* event type */
-		__u8 number;    /* axis/button number */
-	};
-
-If the read is successful, it will return sizeof(struct js_event), unless
-you wanted to read more than one event per read as described in section 3.1.
-
-
-2.1 js_event.type
-~~~~~~~~~~~~~~~~~
-
-The possible values of ``type'' are
-
-	#define JS_EVENT_BUTTON         0x01    /* button pressed/released */
-	#define JS_EVENT_AXIS           0x02    /* joystick moved */
-	#define JS_EVENT_INIT           0x80    /* initial state of device */
-
-As mentioned above, the driver will issue synthetic JS_EVENT_INIT ORed
-events on open. That is, if it's issuing a INIT BUTTON event, the
-current type value will be
-
-	int type = JS_EVENT_BUTTON | JS_EVENT_INIT;	/* 0x81 */
-
-If you choose not to differentiate between synthetic or real events
-you can turn off the JS_EVENT_INIT bits
-
-	type &= ~JS_EVENT_INIT;				/* 0x01 */
-
-
-2.2 js_event.number
-~~~~~~~~~~~~~~~~~~~
-
-The values of ``number'' correspond to the axis or button that
-generated the event. Note that they carry separate numeration (that
-is, you have both an axis 0 and a button 0). Generally,
-
-			number
-	1st Axis X	0
-	1st Axis Y	1
-	2nd Axis X	2
-	2nd Axis Y	3
-	...and so on
-
-Hats vary from one joystick type to another. Some can be moved in 8
-directions, some only in 4, The driver, however, always reports a hat as two
-independent axis, even if the hardware doesn't allow independent movement.
-
-
-2.3 js_event.value
-~~~~~~~~~~~~~~~~~~
-
-For an axis, ``value'' is a signed integer between -32767 and +32767
-representing the position of the joystick along that axis. If you
-don't read a 0 when the joystick is `dead', or if it doesn't span the
-full range, you should recalibrate it (with, for example, jscal).
-
-For a button, ``value'' for a press button event is 1 and for a release
-button event is 0.
-
-Though this
-
-	if (js_event.type == JS_EVENT_BUTTON) {
-		buttons_state ^= (1 << js_event.number);
-	}
-
-may work well if you handle JS_EVENT_INIT events separately,
-
-	if ((js_event.type & ~JS_EVENT_INIT) == JS_EVENT_BUTTON) {
-		if (js_event.value)
-	        	buttons_state |= (1 << js_event.number);
-	   	else
-	      		buttons_state &= ~(1 << js_event.number);
-	}
-
-is much safer since it can't lose sync with the driver. As you would
-have to write a separate handler for JS_EVENT_INIT events in the first
-snippet, this ends up being shorter.
-
-
-2.4 js_event.time
-~~~~~~~~~~~~~~~~~
-
-The time an event was generated is stored in ``js_event.time''. It's a time
-in milliseconds since ... well, since sometime in the past.  This eases the
-task of detecting double clicks, figuring out if movement of axis and button
-presses happened at the same time, and similar.
-
-
-3. Reading
-~~~~~~~~~~
-
-If you open the device in blocking mode, a read will block (that is,
-wait) forever until an event is generated and effectively read. There
-are two alternatives if you can't afford to wait forever (which is,
-admittedly, a long time;)
-
-	a) use select to wait until there's data to be read on fd, or
-	   until it timeouts. There's a good example on the select(2)
-	   man page.
-
-	b) open the device in non-blocking mode (O_NONBLOCK)
-
-
-3.1 O_NONBLOCK
-~~~~~~~~~~~~~~
-
-If read returns -1 when reading in O_NONBLOCK mode, this isn't
-necessarily a "real" error (check errno(3)); it can just mean there
-are no events pending to be read on the driver queue. You should read
-all events on the queue (that is, until you get a -1).
-
-For example,
-
-	while (1) {
-		while (read (fd, &e, sizeof(struct js_event)) > 0) {
-	        	process_event (e);
-	   	}
-	   	/* EAGAIN is returned when the queue is empty */
-	   	if (errno != EAGAIN) {
-	      		/* error */
-	   	}
-	   	/* do something interesting with processed events */
-	}
-
-One reason for emptying the queue is that if it gets full you'll start
-missing events since the queue is finite, and older events will get
-overwritten.
-
-The other reason is that you want to know all what happened, and not
-delay the processing till later.
-
-Why can get the queue full? Because you don't empty the queue as
-mentioned, or because too much time elapses from one read to another
-and too many events to store in the queue get generated. Note that
-high system load may contribute to space those reads even more.
-
-If time between reads is enough to fill the queue and loose an event,
-the driver will switch to startup mode and next time you read it,
-synthetic events (JS_EVENT_INIT) will be generated to inform you of
-the actual state of the joystick.
-
-[As for version 1.2.8, the queue is circular and able to hold 64
- events. You can increment this size bumping up JS_BUFF_SIZE in
- joystick.h and recompiling the driver.]
-
-
-In the above code, you might as well want to read more than one event
-at a time using the typical read(2) functionality. For that, you would
-replace the read above with something like
-
-	struct js_event mybuffer[0xff];
-	int i = read (fd, mybuffer, sizeof(struct mybuffer));
-
-In this case, read would return -1 if the queue was empty, or some
-other value in which the number of events read would be i /
-sizeof(js_event)  Again, if the buffer was full, it's a good idea to
-process the events and keep reading it until you empty the driver queue.
-
-
-4. IOCTLs
-~~~~~~~~~
-
-The joystick driver defines the following ioctl(2) operations.
-
-				/* function			3rd arg  */
-	#define JSIOCGAXES	/* get number of axes		char	 */
-	#define JSIOCGBUTTONS	/* get number of buttons	char	 */
-	#define JSIOCGVERSION	/* get driver version		int	 */
-	#define JSIOCGNAME(len) /* get identifier string	char	 */
-	#define JSIOCSCORR	/* set correction values	&js_corr */
-	#define JSIOCGCORR	/* get correction values	&js_corr */
-
-For example, to read the number of axes
-
-	char number_of_axes;
-	ioctl (fd, JSIOCGAXES, &number_of_axes);
-
-
-4.1 JSIOGCVERSION
-~~~~~~~~~~~~~~~~~
-
-JSIOGCVERSION is a good way to check in run-time whether the running
-driver is 1.0+ and supports the event interface. If it is not, the
-IOCTL will fail. For a compile-time decision, you can test the
-JS_VERSION symbol
-
-	#ifdef JS_VERSION
-	#if JS_VERSION > 0xsomething
-
-
-4.2 JSIOCGNAME
-~~~~~~~~~~~~~~
-
-JSIOCGNAME(len) allows you to get the name string of the joystick - the same
-as is being printed at boot time. The 'len' argument is the length of the
-buffer provided by the application asking for the name. It is used to avoid
-possible overrun should the name be too long.
-
-	char name[128];
-	if (ioctl(fd, JSIOCGNAME(sizeof(name)), name) < 0)
-		strncpy(name, "Unknown", sizeof(name));
-	printf("Name: %s\n", name);
-
-
-4.3 JSIOC[SG]CORR
-~~~~~~~~~~~~~~~~~
-
-For usage on JSIOC[SG]CORR I suggest you to look into jscal.c  They are
-not needed in a normal program, only in joystick calibration software
-such as jscal or kcmjoy. These IOCTLs and data types aren't considered
-to be in the stable part of the API, and therefore may change without
-warning in following releases of the driver.
-
-Both JSIOCSCORR and JSIOCGCORR expect &js_corr to be able to hold
-information for all axis. That is, struct js_corr corr[MAX_AXIS];
-
-struct js_corr is defined as
-
-	struct js_corr {
-		__s32 coef[8];
-		__u16 prec;
-		__u16 type;
-	};
-
-and ``type''
-
-	#define JS_CORR_NONE            0x00    /* returns raw values */
-	#define JS_CORR_BROKEN          0x01    /* broken line */
-
-
-5. Backward compatibility
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The 0.x joystick driver API is quite limited and its usage is deprecated.
-The driver offers backward compatibility, though. Here's a quick summary:
-
-	struct JS_DATA_TYPE js;
-	while (1) {
-		if (read (fd, &js, JS_RETURN) != JS_RETURN) {
-	      		/* error */
-	   	}
-	   	usleep (1000);
-	}
-
-As you can figure out from the example, the read returns immediately,
-with the actual state of the joystick.
-
-	struct JS_DATA_TYPE {
-		int buttons;    /* immediate button state */
-		int x;          /* immediate x axis value */
-		int y;          /* immediate y axis value */
-	};
-
-and JS_RETURN is defined as
-
-	#define JS_RETURN       sizeof(struct JS_DATA_TYPE)
-
-To test the state of the buttons,
-
-	first_button_state  = js.buttons & 1;
-	second_button_state = js.buttons & 2;
-
-The axis values do not have a defined range in the original 0.x driver,
-except for that the values are non-negative. The 1.2.8+ drivers use a
-fixed range for reporting the values, 1 being the minimum, 128 the
-center, and 255 maximum value.
-
-The v0.8.0.2 driver also had an interface for 'digital joysticks', (now
-called Multisystem joysticks in this driver), under /dev/djsX. This driver
-doesn't try to be compatible with that interface.
-
-
-6. Final Notes
-~~~~~~~~~~~~~~
-
-____/|	Comments, additions, and specially corrections are welcome.
-\ o.O|	Documentation valid for at least version 1.2.8 of the joystick
- =(_)=	driver and as usual, the ultimate source for documentation is
-   U	to "Use The Source Luke" or, at your convenience, Vojtech ;)
-
-					- Ragnar
-EOF
diff -u --recursive --new-file v2.4.9/linux/Documentation/joystick-parport.txt linux/Documentation/joystick-parport.txt
--- v2.4.9/linux/Documentation/joystick-parport.txt	Fri Jul 28 12:50:51 2000
+++ linux/Documentation/joystick-parport.txt	Wed Dec 31 16:00:00 1969
@@ -1,521 +0,0 @@
-		    Linux Joystick parport drivers v2.0
-	       (c) 1998-2000 Vojtech Pavlik <vojtech@suse.cz>
-	       (c) 1998 Andree Borrmann <a.borrmann@tu-bs.de>
-			     Sponsored by SuSE
-----------------------------------------------------------------------------
-
-0. Disclaimer
-~~~~~~~~~~~~~
-  Any information in this file is provided as-is, without any guarantee that
-it will be true. So, use it at your own risk. The possible damages that can
-happen include burning your parallel port, and/or the sticks and joystick
-and maybe even more. Like when a lightning kills you it is not our problem.
-
-1. Intro
-~~~~~~~~
-  The joystick parport drivers are used for joysticks and gamepads not
-originally designed for PCs and other computers Linux runs on. Because of
-that, PCs usually lack the right ports to connect these devices to. Parallel
-port, because of its ability to change single bits at will, and providing
-both output and input bits is the most suitable port on the PC for
-connecting such devices.
-
-2. Devices supported
-~~~~~~~~~~~~~~~~~~~~
-  Many console and 8-bit computer gamepads and joysticks are supported. The
-following subsections discuss usage of each.
-
-2.1 NES and SNES
-~~~~~~~~~~~~~~~~
-  The Nintendo Entertainment System and Super Nintendo Entertainment System
-gamepads are widely available, and easy to get. Also, they are quite easy to
-connect to a PC, and don't need much processing speed (108 us for NES and
-165 us for SNES, compared to about 1000 us for PC gamepads) to communicate
-with them.
-
-  All NES and SNES use the same synchronous serial protocol, clocked from
-the computer's side (and thus timing insensitive). To allow up to 5 NES
-and/or SNES gamepads connected to the parallel port at once, the output
-lines of the parallel port are shared, while one of 5 available input lines
-is assigned to each gamepad.
-
-  This protocol is handled by the gamecon.c driver, so that's the one
-you'll use for NES and SNES gamepads.
-
-  The main problem with PC parallel ports is that they don't have +5V power
-source on any of their pins. So, if you want a reliable source of power
-for your pads, use either keyboard or joystick port, and make a pass-through
-cable. You can also pull the power directly from the power supply (the red
-wire is +5V).
-
-  If you want to use the parallel port only, you can take the power is from
-some data pin. For most gamepad and parport implementations only one pin is
-needed, and I'd recommend pin 9 for that, the highest data bit. On the other
-hand, if you are not planning to use anything else than NES / SNES on the
-port, anything between and including pin 4 and pin 9 will work.
-
-(pin 9) -----> Power
-
-  Unfortunately, there are pads that need a lot more of power, and parallel
-ports that can't give much current through the data pins. If this is your
-case, you'll need to use diodes (as a prevention of destroying your parallel
-port), and combine the currents of two or more data bits together.
-
-	   Diodes
-(pin 9) ----|>|-------+------> Power
-		      |
-(pin 8) ----|>|-------+
-		      |
-(pin 7) ----|>|-------+
-		      |
- <and so on>          :
-		      |
-(pin 4) ----|>|-------+
-
-  Ground is quite easy. On PC's parallel port the ground is on any of the
-pins from pin 18 to pin 25. So use any pin of these you like for the ground.
-
-(pin 18) -----> Ground
-
-  NES and SNES pads have two input bits, Clock and Latch, which drive the
-serial transfer. These are connected to pins 2 and 3 of the parallel port,
-respectively.
-
-(pin 2) -----> Clock
-(pin 3) -----> Latch
-
-  And the last thing is the NES / SNES data wire. Only that isn't shared and
-each pad needs its own data pin. The parallel port pins are:
-
-(pin 10) -----> Pad 1 data
-(pin 11) -----> Pad 2 data
-(pin 12) -----> Pad 3 data
-(pin 13) -----> Pad 4 data
-(pin 15) -----> Pad 5 data
-
-  Note that pin 14 is not used, since it is not an input pin on the parallel
-port.
-
-  This is everything you need on the PC's side of the connection, now on to
-the gamepads side. The NES and SNES have different connectors. Also, there
-are quite a lot of NES clones, and because Nintendo used proprietary
-connectors for their machines, the cloners couldn't and used standard D-Cannon
-connectors. Anyway, if you've got a gamepad, and it has buttons A, B, Turbo
-A, Turbo B, Select and Start, and is connected through 5 wires, then it is
-either a NES or NES clone and will work with this connection. SNES gamepads
-also use 5 wires, but have more buttons. They will work as well, of course.
-
-Pinout for NES gamepads                 Pinout for SNES gamepads
-
-	   +----> Power                   +-----------------------\
-	   |                            7 | o  o  o  o |  x  x  o  | 1
- 5 +---------+  7                         +-----------------------/
-   | x  x  o   \                            |  |  |  |          |
-   | o  o  o  o |                           |  |  |  |          +-> Ground
- 4 +------------+ 1                         |  |  |  +------------> Data
-     |  |  |  |                             |  |  +---------------> Latch
-     |  |  |  +-> Ground                    |  +------------------> Clock
-     |  |  +----> Clock                     +---------------------> Power
-     |  +-------> Latch
-     +----------> Data
-
-Pinout for NES clone (db9) gamepads     Pinout for NES clone (db15) gamepads
-
-	+---------> Clock                    +-----------------> Data
-	| +-------> Latch                    |             +---> Ground
-	| | +-----> Data                     |             |
-	| | |                              ___________________
-    _____________                        8 \ o x x x x x x o / 1
-  5 \ x o o o x / 1                         \ o x x o x x o /
-     \ x o x o /                          15 `~~~~~~~~~~~~~' 9
-    9 `~~~~~~~' 6                             |     |     |
-	 |   |                                |     |     +----> Clock
-	 |   +----> Power                     |     +----------> Latch
-	 +--------> Ground                    +----------------> Power
-
-2.2 Multisystem joysticks
-~~~~~~~~~~~~~~~~~~~~~~~~~
-  In the era of 8-bit machines, there was something like de-facto standard
-for joystick ports. They were all digital, and all used D-Cannon 9 pin
-connectors (db9). Because of that, a single joystick could be used without
-hassle on Atari (130, 800XE, 800XL, 2600, 7200), Amiga, Commodore C64,
-Amstrad CPC, Sinclair ZX Spectrum and many other machines. That's why these
-joysticks are called "Multisystem".
-
-  Now their pinout:
-
-      +---------> Right
-      | +-------> Left
-      | | +-----> Down
-      | | | +---> Up
-      | | | |
-  _____________
-5 \ x o o o o / 1
-   \ x o x o /
-  9 `~~~~~~~' 6
-       |   |
-       |   +----> Button
-       +--------> Ground
-
-  However, as time passed, extension to this standard developed, and these
-were not compatible with each other:
-
-
-  Atari 130, 800(XL/XE)                    MSX
-
-					 +-----------> Power
-      +---------> Right                  | +---------> Right
-      | +-------> Left                   | | +-------> Left
-      | | +-----> Down                   | | | +-----> Down
-      | | | +---> Up                     | | | | +---> Up
-      | | | |                            | | | | |
-  _____________                        _____________
-5 \ x o o o o / 1                    5 \ o o o o o / 1
-   \ x o o o /                          \ o o o o /
-  9 `~~~~~~~' 6                        9 `~~~~~~~' 6
-       | | |                              | | | |
-       | | +----> Button                  | | | +----> Button 1
-       | +------> Power                   | | +------> Button 2
-       +--------> Ground                  | +--------> Output 3
-					  +----------> Ground
-
-       Amstrad CPC                         Commodore C64
-
-					 +-----------> Analog Y
-      +---------> Right                  | +---------> Right
-      | +-------> Left                   | | +-------> Left
-      | | +-----> Down                   | | | +-----> Down
-      | | | +---> Up                     | | | | +---> Up
-      | | | |                            | | | | |
-  _____________                        _____________
-5 \ x o o o o / 1                    5 \ o o o o o / 1
-   \ x o o o /                          \ o o o o /
-  9 `~~~~~~~' 6                        9 `~~~~~~~' 6
-       | | |                              | | | |
-       | | +----> Button 1                | | | +----> Button
-       | +------> Button 2                | | +------> Power
-       +--------> Ground                  | +--------> Ground
-					  +----------> Analog X
-
-  And there were many others.
-
-2.2.1 Multisystem joysticks using db9.c
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  For the Multisystem joysticks, and their derivatives, the db9.c driver
-was written. It allows only one joystick / gamepad per parallel port, but
-the interface is easy to build and works with almost anything.
-
-  For the basic 1-button Multisystem joystick you connect its wires to the
-parallel port like this:
-
-(pin  1) -----> Power
-(pin 18) -----> Ground
-
-(pin  2) -----> Up
-(pin  3) -----> Down
-(pin  4) -----> Left
-(pin  5) -----> Right
-(pin  6) -----> Button 1
-
-  However, if the joystick is switch based (eg. clicks when you move it),
-you might or might not, depending on your parallel port, need 10 kOhm pullup
-resistors on each of the direction and button signals, like this:
-
-(pin 2) ------------+------> Up
-	  Resistor  |
-(pin 1) --[10kOhm]--+
-
-  Try without, and if it doesn't work, add them. For TTL based joysticks /
-gamepads the pullups are not needed.
-
-  For joysticks with two buttons you connect the second button to pin 7 on
-the parallel port.
-
-(pin 7) -----> Button 2
-
-  And that's it.
-
-  On a side note, if you have already built a different adapter for use with
-the digital joystick driver 0.8.0.2, this is also supported by the db9.c
-driver, as device type 8. (See section 3.2)
-
-2.2.2 Multisystem joysticks using gamecon.c
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  For some people just one joystick per parallel port is not enough, and/or
-want to use them on one parallel port together with NES/SNES/PSX pads. This is
-possible using the gamecon.c. It supports up to 5 devices of the above types,
-including 1 and 2 buttons Multisystem joysticks.
-
-  However, there is nothing for free. To allow more sticks to be used at
-once, you need the sticks to be purely switch based (that is non-TTL), and
-not to need power. Just a plain simple six switches inside. If your
-joystick can do more (eg. turbofire) you'll need to disable it totally first
-if you want to use gamecon.c.
-
-  Also, the connection is a bit more complex. You'll need a bunch of diodes,
-and one pullup resistor. First, you connect the Directions and the button
-the same as for db9, however with the diodes inbetween.
-
-	    Diodes
-(pin 2) -----|<|----> Up
-(pin 3) -----|<|----> Down
-(pin 4) -----|<|----> Left
-(pin 5) -----|<|----> Right
-(pin 6) -----|<|----> Button 1
-
-  For two button sticks you also connect the other button.
-
-(pin 7) -----|<|----> Button 2
-
-  And finally, you connect the Ground wire of the joystick, like done in
-this little schematic to Power and Data on the parallel port, as described
-for the NES / SNES pads in section 2.1 of this file - that is, one data pin
-for each joystick. The power source is shared.
-
-Data    ------------+-----> Ground
-	  Resistor  |
-Power   --[10kOhm]--+
-
-  And that's all, here we go!
-
-2.2.3 Multisystem joysticks using turbografx.c
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  The TurboGraFX interface, designed by
-
-	Steffen Schwenke <schwenke@burg-halle.de>
-
-  allows up to 7 Multisystem joysticks connected to the parallel port. In
-Steffen's version, there is support for up to 5 buttons per joystick.  However,
-since this doesn't work reliably on all parallel ports, the turbografx.c driver
-supports only one button per joystick. For more information on how to build the
-interface, see
-
-	http://www2.burg-halle.de/~schwenke/parport.html
-
-2.3 Sony Playstation
-~~~~~~~~~~~~~~~~~~~~
-
-  WARNING: PSX support is experimental, and at the moment doesn't seem to
-work for most people. If you like adventure, you can try yourself.
-
-  The PSX controller is supported by the gamecon.c.
-
-Pinout of the PSX controller (compatible with DirectPadPro):
-
-  +---------+---------+---------+
-9 | o  o  o | o  o  o | o  o  o | 1               parallel
-   \________|_________|________/                  port pins
-    |  |      |  |  |   |
-    |  |      |  |  |   +-------->  Clock    ---  (4)
-    |  |      |  |  +------------>  Select   ---  (3)
-    |  |      |  +--------------->  Power    ---  (5-9)
-    |  |      +------------------>  Ground   ---  (18-25)
-    |  +------------------------->  Command  ---  (2)
-    +---------------------------->  Data     ---  (10,11,12,13,15) one only...
-
-  You may have to add pull up/down resistors. Maybe your pad also won't like
-the 5V (PSX uses 3.7V).
-
-  Currently the driver supports only one psx pad per parallel port, and these
-controllers:
-
- * Standard PSX Pad
- * NegCon PSX Pad
- * Analog PSX Pad (red mode)
- * Analog PSX Pad (green mode)
-
-2.4 Sega
-~~~~~~~~
-  All the Sega controllers are more or less based on the standard 2-button
-Multisystem joystick. However, since they don't use switches and use TTL
-logic, the only driver usable with them is the db9.c driver.
-
-2.4.1 Sega Master System
-~~~~~~~~~~~~~~~~~~~~~~~~
-  The SMS gamepads are almost exactly the same as normal 2-button
-Multisystem joysticks. Set the driver to Multi2 mode, use the corresponding
-parallel port pins, and the following schematic:
-
-    +-----------> Power
-    | +---------> Right
-    | | +-------> Left
-    | | | +-----> Down
-    | | | | +---> Up
-    | | | | |
-  _____________
-5 \ o o o o o / 1
-   \ o o x o /
-  9 `~~~~~~~' 6
-     | |   |
-     | |   +----> Button 1
-     | +--------> Ground
-     +----------> Button 2
-
-2.4.2 Sega Genesis aka MegaDrive
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  The Sega Genesis (in Europe sold as Sega MegaDrive) pads are an extension
-to the Sega Master System pads. They use more buttons (3+1, 5+1, 6+1).  Use
-the following schematic:
-
-    +-----------> Power
-    | +---------> Right
-    | | +-------> Left
-    | | | +-----> Down
-    | | | | +---> Up
-    | | | | |
-  _____________
-5 \ o o o o o / 1
-   \ o o o o /
-  9 `~~~~~~~' 6
-     | | | |
-     | | | +----> Button 1
-     | | +------> Select
-     | +--------> Ground
-     +----------> Button 2
-
-  The Select pin goes to pin 14 on the parallel port.
-
-(pin 14) -----> Select
-
-  The rest is the same as for Multi2 joysticks using db9.c
-
-2.4.3 Sega Saturn
-~~~~~~~~~~~~~~~~~
-  Sega Saturn has eight buttons, and to transfer that, without hacks like
-Genesis 6 pads use, it needs one more select pin. Anyway, it is still
-handled by the db9.c driver. Its pinout is very different from anything
-else.  Use this schematic:
-
-    +-----------> Select 1
-    | +---------> Power
-    | | +-------> Up
-    | | | +-----> Down
-    | | | | +---> Ground
-    | | | | |
-  _____________
-5 \ o o o o o / 1
-   \ o o o o /
-  9 `~~~~~~~' 6
-     | | | |
-     | | | +----> Select 2
-     | | +------> Right
-     | +--------> Left
-     +----------> Power
-
-  Select 1 is pin 14 on the parallel port, Select 2 is pin 16 on the
-parallel port.
-
-(pin 14) -----> Select 1
-(pin 16) -----> Select 2
-
-  The other pins (Up, Down, Right, Left, Power, Ground) are the same as for
-Multi joysticks using db9.c
-
-3. The drivers
-~~~~~~~~~~~~~~
-  There are three drivers for the parallel port interfaces. Each, as
-described above, allows to connect a different group of joysticks and pads.
-Here are described their command lines:
-
-3.1 gamecon.c
-~~~~~~~~~~~~~
-  Using gamecon.c you can connect up to five devices to one parallel port. It
-uses the following kernel/module command line:
-
-	gc=port,pad1,pad2,pad3,pad4,pad5
-
-  Where 'port' the number of the parport interface (eg. 0 for parport0).
-
-  And 'pad1' to 'pad5' are pad types connected to different data input pins
-(10,11,12,13,15), as described in section 2.1 of this file.
-
-  The types are:
-
-	Type | Joystick/Pad
-	--------------------
-	  0  | None
-	  1  | SNES pad
-	  2  | NES pad
-	  4  | Multisystem 1-button joystick
-	  5  | Multisystem 2-button joystick
-	  6  | Sony PSX controller
-	  7  | N64 pad
-
-  The exact type of the PSX controller type is autoprobed, so you must have
-your controller plugged in before initializing.
-
-  Should you want to use more than one of parallel ports at once, you can use
-gc_2 and gc_3 as additional command line parameters for two more parallel
-ports.
-
-3.2 db9.c
-~~~~~~~~~
-  Apart from making an interface, there is nothing difficult on using the
-db9.c driver. It uses the following kernel/module command line:
-
-	db9=port,type
-
-  Where 'port' is the number of the parport interface (eg. 0 for parport0).
-
-  Caveat here: This driver only works on bidirectional parallel ports. If
-your parallel port is recent enough, you should have no trouble with this.
-Old parallel ports may not have this feature.
-
-  'Type' is the type of joystick or pad attached:
-
-	Type | Joystick/Pad
-	--------------------
-	  0  | None
-	  1  | Multisystem 1-button joystick
-	  2  | Multisystem 2-button joystick
-	  3  | Genesis pad (3+1 buttons)
-	  5  | Genesis pad (5+1 buttons)
-	  6  | Genesis pad (6+2 buttons)
-	  7  | Saturn pad (8 buttons)
-	  8  | Multisystem 1-button joystick (v0.8.0.2 pin-out)
-	  9  | Two Multisystem 1-button joysticks (v0.8.0.2 pin-out) 
-	 10  | Amiga CD32 pad
-
-  Should you want to use more than one of these joysticks/pads at once, you
-can use db9_2 and db9_3 as additional command line parameters for two
-more joysticks/pads.
-
-3.3 turbografx.c
-~~~~~~~~~~~~~~~~
-  The turbografx.c driver uses a very simple kernel/module command line:
-
-	tgfx=port,js1,js2,js3,js4,js5,js6,js7
-
-  Where 'port' is the number of the parport interface (eg. 0 for parport0).
-
-  'jsX' is the number of buttons the Multisystem joysticks connected to the
-interface ports 1-7 have. For a standard multisystem joystick, this is 1.
-
-  Should you want to use more than one of these interfaces at once, you can
-use tgfx_2 and tgfx_3 as additional command line parameters for two more
-interfaces.
-
-3.4 PC parallel port pinout
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  .----------------------------------------.
-   At the PC:     \ 13 12 11 10  9  8  7  6  5  4  3  2  1 /
-                   \  25 24 23 22 21 20 19 18 17 16 15 14 /
-                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-	  Pin | Name    | Description
-	~~~~~~|~~~~~~~~~|~~~~~~~~~~
-	    1 | /STROBE | Strobe
-	  2-9 | D0-D7   | Data Bit 0-7
-	   10 | /ACK    | Acknowledge
-	   11 | BUSY    | Busy
-	   12 | PE      | Paper End
-	   13 | SELIN   | Select In
-	   14 | /AUTOFD | Autofeed
-	   15 | /ERROR  | Error
-	   16 | /INIT   | Initialize
-	   17 | /SEL    | Select
-	18-25 | GND     | Signal Ground
-
-3.5 End
-~~~~~~~
-  That's all, folks! Have fun!
diff -u --recursive --new-file v2.4.9/linux/Documentation/joystick.txt linux/Documentation/joystick.txt
--- v2.4.9/linux/Documentation/joystick.txt	Fri Jul 28 12:50:51 2000
+++ linux/Documentation/joystick.txt	Wed Dec 31 16:00:00 1969
@@ -1,582 +0,0 @@
-		       Linux Joystick driver v2.0.0
-	       (c) 1996-2000 Vojtech Pavlik <vojtech@suse.cz>
-			     Sponsored by SuSE
-----------------------------------------------------------------------------
-
-0. Disclaimer
-~~~~~~~~~~~~~
-  This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your option)
-any later version.
-
-  This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-more details.
-
-  You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc., 59
-Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-  Should you need to contact me, the author, you can do so either by e-mail
-- mail your message to <vojtech@suse.cz>, or by paper mail: Vojtech Pavlik,
-Ucitelska 1576, Prague 8, 182 00 Czech Republic
-
-  For your convenience, the GNU General Public License version 2 is included
-in the package: See the file COPYING.
-
-1. Intro
-~~~~~~~~
-  The joystick driver for Linux provides support for a variety of joysticks
-and similar devices. It is based on a larger project aiming to support all
-input devices in Linux.
-
-  Should you encounter any problems while using the driver, or joysticks
-this driver can't make complete use of, I'm very interested in hearing about
-them. Bug reports and success stories are also welcome.
-
-  The input project website is at:
-
-	http://www.suse.cz/development/input/
-	http://atrey.karlin.mff.cuni.cz/~vojtech/input/
-
-  There is also a mailing list for the driver at:
-
-	listproc@atrey.karlin.mff.cuni.cz
-
-send "subscribe linux-joystick Your Name" to subscribe to it.
-
-2. Usage
-~~~~~~~~
-  For basic usage you just choose the right options in kernel config and
-you should be set.
-
-2.1 inpututils
-~~~~~~~~~~~~~~
-For testing and other purposes (for example serial devices), a set of
-utilities is available at the abovementioned website. I suggest you download
-and install it before going on.
-
-2.2 Device nodes
-~~~~~~~~~~~~~~~~
-For applications to be able to use the joysticks, in you don't use devfs,
-you'll have to manually create these nodes in /dev:
-
-cd /dev
-rm js*
-mkdir input
-mknod input/js0 c 13 0
-mknod input/js1 c 13 1
-mknod input/js2 c 13 2
-mknod input/js3 c 13 3
-ln -s input/js0 js0
-ln -s input/js1 js1
-ln -s input/js2 js2
-ln -s input/js3 js3
-
-For testing with inpututils it's also convenient to create these:
-
-mknod input/event0 c 13 64
-mknod input/event1 c 13 65
-mknod input/event2 c 13 66
-mknod input/event3 c 13 67
-
-2.4 Modules needed 
-~~~~~~~~~~~~~~~~~~
-  For all joystick drivers to function, you'll need the userland interface
-module in kernel, either loaded or compiled in:
-
-	modprobe joydev
-
-  For gameport joysticks, you'll have to load the gameport driver as well;
-
-	modprove ns558
-
-  And for serial port joysticks, you'll need the serial input line
-discipline module loaded and the inputattach utility started:
-
-	modprobe serport
-	inputattach -xxx /dev/tts/X &
-
-  In addition to that, you'll need the joystick driver module itself, most
-usually you'll have an analog joystick:
-
-	modprobe analog
-	
-  For automatic module loading, something like this might work:
-
-	alias tty-ldisc-2 serport
-	alias char-major-13 joydev ns558 analog
-
-2.5 Verifying that it works
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  For testing the joystick driver functionality, there is the jstest
-program in the utilities package. You run it by typing:
-
-	jstest /dev/js0
-
-  And it should show a line with the joystick values, which update as you
-move the stick, and press its buttons. The axes should all be zero when the
-joystick is in the center position. They should not jitter by themselves to
-other close values, and they also should be steady in any other position of
-the stick. They should have the full range from -32767 to 32767. If all this
-is met, then it's all fine, and you can play the games. :)
-
-  If it's not, then there might be a problem. Try to calibrate the joystick,
-and if it still doesn't work, read the drivers section of this file, the
-troubleshooting section, and the FAQ.
-
-2.6. Calibration
-~~~~~~~~~~~~~~~~
-  For most joysticks you won't need any manual calibration, since the
-joystick should be autocalibrated by the driver automagically. However, with
-some analog joysticks, that either do not use linear resistors, or if you
-want better precision, you can use the jscal program
-
-	jscal -c /dev/js0
-
- included in the joystick package to set better correction coefficients than
-what the driver would choose itself.
-
-  After calibrating the joystick you can verify if you like the new
-calibration using the jstest command, and if you do, you then can save the
-correction coefficients into a file
-
-	jscal -p /dev/js0 > /etc/joystick.cal
-
-  And add a line to your rc script executing that file
-
-	source /etc/joystick.cal
-
-  This way, after the next reboot your joystick will remain calibrated. You
-can also add the jscal -p line to your shutdown script.
-
-
-3. HW specific driver information
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-In this section each of the separate hardware specific drivers is described.
-
-3.1 Analog joysticks
-~~~~~~~~~~~~~~~~~~~~
-  The analog.c uses the standard analog inputs of the gameport, and thus
-supports all standard joysticks and gamepads. It uses a very advanced
-routine for this, allowing for data precision that can't be found on any
-other system.
-
-  It also supports extensions like additional hats and buttons compatible
-with CH Flightstick Pro, ThrustMaster FCS or 6 and 8 button gamepads. Saitek
-Cyborg 'digital' joysticks are also supported by this driver, because
-they're basically souped up CHF sticks.
-
-  However the only types that can be autodetected are:
-
-* 2-axis, 4-button joystick
-* 3-axis, 4-button joystick
-* 4-axis, 4-button joystick
-* Saitek Cyborg 'digital' joysticks
-
-  For other joystick types (more/less axes, hats, and buttons) support
-you'll need to specify the types either on the kernel command line or on the
-module command line, when inserting analog.o into the kernel. The
-parameters are:
-
-	js=type,type,type,....
-
-  'type' is type of the joystick from the table below, defining joysticks
-present on gameports in the system, starting with gameport0, second 'type'
-entry defining joystick on gameport1 and so on.
-
-	Type     | Meaning
-	-----------------------------------
-	none     | No analog joystick on that port
-	auto     | Autodetect joystick
-	2btn     | 2-button n-axis joystick
-	y-joy    | Two 2-button 2-axis joysticks on an Y-cable
-	y-pad    | Two 2-button 2-axis gamepads on an Y-cable
-	fcs      | Thrustmaster FCS compatible joystick
-	chf      | Joystick with a CH Flightstick compatible hat
-	fullchf  | CH Flightstick compatible with two hats and 6 buttons
-	gamepad  | 4/6-button n-axis gamepad
-	gamepad8 | 8-button 2-axis gamepad
-
-  In case your joystick doesn't fit in any of the above categories, you can
-specify the type as a number by combining the bits in the table below. This
-is not recommended unless you really know what are you doing. It's not
-dangerous, but not simple either.
-
-	Bit | Meaning
-	--------------------------
-	 0  | Axis X1
-	 1  | Axis Y1
-	 2  | Axis X2
-	 3  | Axis Y2
-	 4  | Button A
-	 5  | Button B
-	 6  | Button C
-	 7  | Button D
-	 8  | CHF Buttons X and Y
-	 9  | CHF Hat 1
-	10  | CHF Hat 2
-	11  | FCS Hat
-	12  | Pad Button X
-	13  | Pad Button Y
-	14  | Pad Button U
-	15  | Pad Button V
-	16  | Saitek F1-F4 Buttons
-	17  | Saitek Digital Mode
-	19  | GamePad
-	20  | Joy2 Axis X1
-	21  | Joy2 Axis Y1
-	22  | Joy2 Axis X2
-	23  | Joy2 Axis Y2
-	24  | Joy2 Button A
-	25  | Joy2 Button B
-	26  | Joy2 Button C
-	27  | Joy2 Button D
-	31  | Joy2 GamePad
-
-3.2 Microsoft SideWinder joysticks
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  Microsoft 'Digital Overdrive' protocol is supported by the sidewinder.c
-module. All currently supported joysticks:
-
-* Microsoft SideWinder 3D Pro
-* Microsoft SideWinder Force Feedback Pro
-* Microsoft SideWinder Force Feedback Wheel
-* Microsoft SideWinder FreeStyle Pro 
-* Microsoft SideWinder GamePad (up to four, chained)
-* Microsoft SideWinder Precision Pro 
-* Microsoft SideWinder Precision Pro USB 
-
-  are autodetected, and thus no module parameters are needed.
-
-  There is one caveat with the 3D Pro. There are 9 buttons reported,
-although the joystick has only 8. The 9th button is the mode switch on the
-rear side of the joystick. However, moving it, you'll reset the joystick,
-and make it unresponsive for about a one third of a second. Furthermore, the
-joystick will also re-center itself, taking the position it was in during
-this time as a new center position. Use it if you want, but think first.
-
-  The SideWinder Standard is not a digital joystick, and thus is supported
-by the analog driver described above. 
-
-3.3 Logitech ADI devices
-~~~~~~~~~~~~~~~~~~~~~~~~
-  Logitech ADI protocol is supported by the adi.c module. It should support
-any Logitech device using this protocol. This includes, but is not limited
-to:
-
-* Logitech CyberMan 2
-* Logitech ThunderPad Digital
-* Logitech WingMan Extreme Digital
-* Logitech WingMan Formula
-* Logitech WingMan Interceptor
-* Logitech WingMan GamePad
-* Logitech WingMan GamePad USB
-* Logitech WingMan GamePad Extreme
-* Logitech WingMan Extreme Digital 3D
-
-  ADI devices are autodetected, and the driver supports up to two (any
-combination of) devices on a single gameport, using an Y-cable or chained
-together.
-
-  Logitech WingMan Joystick, Logitech WingMan Attack, Logitech WingMan
-Extreme and Logitech WingMan ThunderPad are not digital joysticks and are
-handled by the analog driver described above. Logitech WingMan Warrior and
-Logitech Magellan are supported by serial drivers described below.  Logitech
-WingMan Force and Logitech WingMan Formula Force are supported by the
-I-Force driver described below. Logitech CyberMan is not supported yet.
-
-3.4 Gravis GrIP
-~~~~~~~~~~~~~~~
-  Gravis GrIP protocol is supported by the grip.c module. It currently
-supports:
-
-* Gravis GamePad Pro
-* Gravis BlackHawk Digital
-* Gravis Xterminator
-* Gravis Xterminator DualControl
-
-  All these devices are autodetected, and you can even use any combination
-of up to two of these pads either chained together or using an Y-cable on a
-single gameport.
-
-GrIP MultiPort isn't supported yet. Gravis Stinger is a serial device and
-hopefully will be supported soon. Other Gravis joysticks are supported by
-the analog driver.
-
-3.5 FPGaming A3D and MadCatz A3D
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  The Assassin 3D protocol created by FPGaming, is used both by FPGaming
-themselves and is licensed to MadCatz. A3D devices are supported by the
-a3d.c module. It currently supports:
-
-* FPGaming Assassin 3D
-* MadCatz Panther
-* MadCatz Panther XL
-
-  All these devices are autodetected. Because the Assassin 3D and the Panther
-allow connecting analog joysticks to them, you'll need to load the analog
-driver as well to handle the attached joysticks.
-
-  The trackball should work with USB mousedev module as a normal mouse. See
-the USB documentation for how to setup an USB mouse.
-
-3.6 ThrustMaster DirectConnect (BSP)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  The TM DirectConnect (BSP) protocol is supported by the tmdc.c
-module. This includes, but is not limited to:
-
-* ThrustMaster Millenium 3D Inceptor
-* ThrustMaster 3D Rage Pad
-* ThrustMaster Fusion Digital Game Pad
-
-  Devices not directly supported, but hopefully working are:
-
-* ThrustMaster FragMaster
-* ThrustMaster Attack Throttle
-
-  If you have one of these, contact me.
-
-  BSP devices are autodetected, and thus no parameters to the module
-are needed. Up to two TMDC devices can be connected to one gameport, using
-an Y-cable.
-
-3.7 Creative Labs Blaster
-~~~~~~~~~~~~~~~~~~~~~~~~~
-  The Blaster protocol is supported by the cobra.c module. It supports only
-the:
-
-* Creative Blaster GamePad Cobra
-
-  Up to two of these can be used on a single gameport, using an Y-cable.
-
-3.8 Genius Digital joysticks 
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  The Genius digitally communicating joysticks are supported by the gf2k.c
-module. This includes:
-
-* Genius Flight2000 F-23 joystick 
-* Genius Flight2000 F-31 joystick 
-* Genius G-09D gamepad
-
-  Other Genius digital joysticks are not supported yet, but support can be
-added fairly easily.
-
-3.9 InterAct Digital joysticks
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  The InterAct digitally communicating joysticks are supported by the
-interact.c module. This includes:
-
-* InterAct HammerHead/FX gamepad
-* InterAct ProPad8 gamepad 
-
-  Other InterAct digital joysticks are not supported yet, but support can be 
-added fairly easily.
-
-3.10 PDPI Lightning 4 gamecards
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  PDPI Lightning 4 gamecards are supported by the lightning.c module.
-Once the module is loaded, the analog driver can be used to handle the
-joysticks. Digitally communicating joystick will work only on port 0, while
-using Y-cables, you can connect up to 8 analog joysticks to a single L4
-card, 16 in case you have two in your system.
-
-3.11 Trident 4DWave / Aureal Vortex
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  Soundcards with a Trident 4DWave DX/NX or Aureal Vortex/Vortex2 chipsets
-provide an "Enhanced Game Port" mode where the soundcard handles polling the
-joystick.  This mode is supported by the pcigame.c module. Once loaded the
-analog driver can use the enhanced features of these gameports..
-
-3.12 Amiga
-~~~~~~~~~~
-  Amiga joysticks, connected to an Amiga, are supported by the amijoy.c
-driver. Since they can't be autodetected, the driver has a command line.
-
-	amijoy=a,b
-
-  a and b define the joysticks connected to the JOY0DAT and JOY1DAT ports of
-the Amiga.
-
-	Value | Joystick type
-	---------------------
-	  0   | None
-	  1   | 1-button digital joystick
-
-  No more joystick types are supported now, but that should change in the
-future if I get an Amiga in the reach of my fingers.
-
-3.13 Game console and 8-bit pads and joysticks
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-See joystick-parport.txt for more info.
-
-3.14 SpaceTec/LabTec devices
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  SpaceTec serial devices communicate using the SpaceWare protocol. It is
-supported by the spaceorb.c and spaceball.c drivers. The devices currently
-supported by spaceorb.c are:
-
-* SpaceTec SpaceBall Avenger
-* SpaceTec SpaceOrb 360
-
-Devices currently supported by spaceball.c are:
-
-* SpaceTec SpaceBall 4000 FLX
-
-  In addition to having the spaceorb/spaceball and serport modules in the
-kernel, you also need to attach a serial port to it. to do that, run the
-jsattach program:
-
-	inputattach --spaceorb /dev/tts/x &
-or
-	jsattach --spaceball /dev/tts/x &
-
-where /dev/tts/x is the serial port which the device is connected to. After
-doing this, the device will be reported and will start working.
-
-  There is one caveat with the SpaceOrb. The button #6, the on the bottom
-side of the orb, although reported as an ordinary button, causes internal
-recentering of the spaceorb, moving the zero point to the position in which
-the ball is at the moment of pressing the button. So, think first before
-you bind it to some other function.
-
-SpaceTec SpaceBall 2003 FLX and 3003 FLX are not supported yet. 
-
-3.15 Logitech SWIFT devices
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  The SWIFT serial protocol is supported by the warrior.c module. It
-currently supports only the:
-
-* Logitech WingMan Warrior
-
-but in the future, Logitech CyberMan (the original one, not CM2) could be
-supported as well. To use the module, you need to run jsattach after you
-insert/compile the module into your kernel:
-
-	inputattach --warrior /dev/tts/x &
-
-/dev/tts/x is the serial port your Warrior is attached to.
-
-3.16 Magellan / Space Mouse
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  The Magellan (or Space Mouse), manufactured by LogiCad3d (formerly Space
-Systems), for many other companies (Logitech, HP, ...) is supported by the
-joy-magellan module. It currently supports only the:
-
-* Magellan 3D
-* Space Mouse
-
-models, the additional buttons on the 'Plus' versions are not supported yet.
-
-  To use it, you need to attach the serial port to the driver using the
-
-	inputattach --magellan /dev/tts/x &
-
-command. After that the Magellan will be detected, initialized, will beep,
-and the /dev/input/jsX device should become usable.
-
-3.17 I-Force devices 
-~~~~~~~~~~~~~~~~~~~~
-  All I-Force devices ale supported by the iforce.c module. This includes,
-but is not limited to:
-
-* Logitech WingMan Force
-* Logitech WingMan Force Wheel 
-* Guillemot Race Leader wheel 
-
-  To use it, you need to attach the serial port to the driver using the
-
-	inputattach --iforce /dev/tts/x &
-
-command. After that the I-Force device will be detected, and the
-/dev/input/jsX device should become usable.
-
-  In case you're using the device via the USB port, the inputattach command
-isn't needed.
-
-4. Troubleshooting
-~~~~~~~~~~~~~~~~~~
-  There is quite a high probability that you run into some problems. For
-testing whether the driver works, if in doubt, use the jstest utility in
-some of its modes. The most useful modes are "normal" - for the 1.x
-interface, and "old" for the "0.x" interface. You run it by typing:
-
-	jstest --normal /dev/input/js0
-	jstest --old    /dev/input/js0
-
-  Additionally you can do a test with the evtest utility:
-
-	evtest /dev/input/event0
-
-  Oh, and read the FAQ! :)
-
-5. FAQ
-~~~~~~
-Q: Running 'jstest /dev/js0' results in "File not found" error. What's the
-   cause?
-A: The device files don't exist. Create them (see section 2.2).
-
-Q: Is it possible to connect my old Atari/Commodore/Amiga/console joystick
-   or pad that uses a 9-pin D-type cannon connector to the serial port of my
-   PC?
-A: Yes, it is possible, but it'll burn your serial port or the pad. It
-   won't work, of course.
-
-Q: My joystick doesn't work with Quake / Quake 2. What's the cause?
-A: Quake / Quake 2 don't support joystick. Use joy2key to simulate keypresses
-   for them.
-
-6. Programming Interface
-~~~~~~~~~~~~~~~~~~~~~~~~
-  The 1.0 driver uses a new, event based approach to the joystick driver.
-Instead of the user program polling for the joystick values, the joystick
-driver now reports only any changes of its state. See joystick-api.txt,
-joystick.h and jstest.c included in the joystick package for more
-information. The joystick device can be used in either blocking or
-nonblocking mode and supports select() calls.
-
-  For backward compatibility the old (v0.x) interface is still included.
-Any call to the joystick driver using the old interface will return values
-that are compatible to the old interface.  This interface is still limited
-to 2 axes, and applications using it usually decode only 2 buttons, although
-the driver provides up to 32.
-
-7. Credits
-~~~~~~~~~~
-  Thanks to the following people who contributed code, ideas or specifications
-to the joystick driver development:
-
-	Arthur C. Smith		<asmith@cbnewsd.att.com>
-	Eyal Lebedinsky		<eyal@eyal.emu.id.au>
-	Jeff Tranter		<tranter@software.mitel.com>
-	Carlos Puchol		<cpg@cs.utexas.edu>
-	Matt Rhoten		<mrhoten@oz.net>
-	Dan Fandrich		<dan@fch.wimsey.bc.ca>
-	Sverker Wilberg		<sverkerw@manila.docs.uu.se>
-	Hal Maney		<maney@norden.com>
-	Bernd Schmidt		<crux@pool.informatik.rwth-aachen.de>
-	Alan Cox		<alan@lxorguk.ukuu.org.uk>
-	John Markus Bjorndalen	<johnm@cs.uit.no>
-	Boris Muehmer		<mhs@cybernet-ag.de>
-	Robert W. Grubbs	<rwgrubbs@vt.edu>
-	Pete Chown		<pete.chown@skygate.co.uk>
-	Benji York		<benji@cookeville.com>
-	Leslie F. Donaldson	<donaldlf@cs.rose-hulman.edu>
-	Eng-Jon Ong		<ongej@dcs.qmw.ac.uk>
-	Ragnar Hojland Espinosa	<ragnar@macula.net>
-	Brian Gerst		<bgerst@quark.vpplus.com>
-	Andree Borrmann		<a.borrmann@tu-bs.de>
-	Martin Giguere		<zefrench@hotmail.com>
-	David Thompson		<dcthomp@mail.utexas.edu>
-	Justin Wake		<spectre@telefragged.com>
-	Benoit Triquet		<benoit@adsl-216-100-248-201.dsl.pacbell.net>
-	John Dahlstrom		<jodaman@bradley.edu>
-	Dan Gohman		<gohmandj@mrs.umn.edu>
-	Joe Krahn		<krahn@niehs.nih.gov>
-	David Kuder		<alphagod@penguinpowered.com>
-	Raymond Ingles		<sorceror@tir.com>
-
-  If you think you should be in this list and are not, it's possible that
-I forgot to include you - contact me and I'll correct the error. :)
diff -u --recursive --new-file v2.4.9/linux/Documentation/kernel-doc-nano-HOWTO.txt linux/Documentation/kernel-doc-nano-HOWTO.txt
--- v2.4.9/linux/Documentation/kernel-doc-nano-HOWTO.txt	Fri Mar  2 18:43:11 2001
+++ linux/Documentation/kernel-doc-nano-HOWTO.txt	Fri Sep  7 18:15:17 2001
@@ -35,9 +35,9 @@
 
 - Makefile
 
-  The targets 'sgmldocs', 'psdocs', and 'pdfdocs' are used to build
-  DocBook files, PostScript files, and PDF files in
-  Documentation/DocBook.
+  The targets 'sgmldocs', 'psdocs', 'pdfdocs', and 'htmldocs' are used
+  to build DocBook files, PostScript files, PDF files, and html files
+  in Documentation/DocBook.
 
 - Documentation/DocBook/Makefile
 
@@ -49,10 +49,11 @@
 
 If you just want to read the ready-made books on the various
 subsystems (see Documentation/DocBook/*.tmpl), just type 'make
-psdocs', or 'make pdfdocs', depending on your preference.  If you
-would rather read a different format, you can type 'make sgmldocs' and
-then use DocBook tools to convert Documentation/DocBook/*.sgml to a
-format of your choice (for example, 'db2html ...').
+psdocs', or 'make pdfdocs', or 'make htmldocs', depending on your 
+preference.  If you would rather read a different format, you can type 
+'make sgmldocs' and then use DocBook tools to convert 
+Documentation/DocBook/*.sgml to a format of your choice (for example, 
+'db2html ...' if 'make htmldocs' was not defined).
 
 If you want to see man pages instead, you can do this:
 
@@ -111,7 +112,9 @@
 (*)?*/
 
 The short function description cannot be multiline, but the other
-descriptions can be.
+descriptions can be (and they can contain blank lines). Avoid putting a
+spurious blank line after the function name, or else the description will
+be repeated!
 
 All descriptive text is further processed, scanning for the following special
 patterns, which are highlighted appropriately.
diff -u --recursive --new-file v2.4.9/linux/Documentation/mips/pci/pci.README linux/Documentation/mips/pci/pci.README
--- v2.4.9/linux/Documentation/mips/pci/pci.README	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/mips/pci/pci.README	Mon Aug 27 08:56:31 2001
@@ -0,0 +1,67 @@
+
+Pete Popov, ppopov@pacbell.net
+07/11/2001
+
+This README briefly explains how to use the pci and pci_auto
+code in arch/mips/kernel.  The code was ported from PowerPC and
+modified slightly. It has been tested pretty well on PPC on some
+rather complex systems with multiple bridges and devices behind
+each bridge. However, at the time this README was written, the
+mips port was tested only on boards with a single pci bus and
+no P2P bridges.  It's very possible that on boards with P2P
+bridges some modifications have to be made. The code will 
+evolve, no doubt, but currently every single mips board
+is doing its own pcibios thing and it has become a big
+mess.  This generic pci code is meant to clean up the mips
+pci mess and make it easier to add pci support to new boards.
+
+arch/mips/kernel/pci_auto.c has the pci bus enumeration code.
+This code scans the pci bus(es) and assigns all of the resources.
+Thus, you don't need the boot code to that, and many boot codes
+don't do it correctly anyway.  To enable the pci_auto code, add
+
+define_bool CONFIG_PCI_AUTO y 
+
+inside the define for your board in arch/mips/config.in. 
+For example, the Galileo EV96100 board  looks like this:
+
+if [ "$CONFIG_MIPS_EV96100" = "y" ]; then
+	define_bool CONFIG_PCI y
+	define_bool CONFIG_MIPS_GT96100 y
+	define_bool CONFIG_NEW_PCI y
+	define_bool CONFIG_PCI_AUTO y
+	define_bool CONFIG_SWAP_IO_SPACE y
+fi 
+
+
+Next, if you want to use the arch/mips/kernel/pci code, which has the
+pcibios_init() function, add
+
+define_bool CONFIG_NEW_PCI y
+ 
+inside the define for your board. Again, the EV96100 example above
+show NEW_PCI turned on.
+
+Note that you can enable CONFIG_NEW_PCI code without enabling 
+CONFIG_PCI_AUTO. But you can't do the opposite because the pci_auto
+routines are called from pcibios_init(), which is part of the 
+CONFIG_NEW_PCI code.
+
+
+Now you need to add your files to hook in your pci configuration
+cycles.  Usually you'll need only a couple of files named something
+like pci_fixups.c and pci_ops.c.  You can copy the templates
+provided and fill in the code.
+
+The file pci_ops.c should contain the pci configuration cycles routines.
+It also has the mips_pci_channels[] array which contains the descriptors
+of each pci controller.
+
+The file pci_fixups.c contains a few routines to do interrupt fixups,
+resources fixups, and, if needed, pci bios fixups.
+
+Usually you'll put your pci_fixups.c file in your board specific directory, 
+since the functions in that file are board specific.  The functions in
+pci_ops.c, on the other hand, are usually pci controller specific so that
+file could be shared among a few different boards using the same
+pci controller.
diff -u --recursive --new-file v2.4.9/linux/Documentation/networking/dl2k.txt linux/Documentation/networking/dl2k.txt
--- v2.4.9/linux/Documentation/networking/dl2k.txt	Wed Jul 25 17:10:17 2001
+++ linux/Documentation/networking/dl2k.txt	Thu Sep 20 20:56:31 2001
@@ -187,15 +187,11 @@
 				  10mbps_fd	10Mbps full duplex.
 				  100mbps_hd	100Mbps half duplex.
 				  100mbps_fd	100Mbps full duplex.
-				  1000mbps_fd	1000Mbps full duplex.
-				  1000mbps_hd	1000Mbps half duplex.
 				  0		Autosensing active media.
 				  1		10Mbps half duplex.
 				  2		10Mbps full duplex.
 				  3		100Mbps half duplex.
 				  4		100Mbps full duplex.
-				  5		1000Mbps full duplex.
-				  6		1000Mbps half duplex.
 				  By default, the NIC operates at autosense.
 
 vlan=x				- Specifies the VLAN ID. If vlan=0, the
@@ -205,7 +201,16 @@
 jumbo=x				- Specifies the jumbo frame support. If jumbo=1,
 				  the NIC accept jumbo frames. By default, this
 				  function is disabled.
-
+				  Jumbo frame usually improve the performance
+				  int gigabit.
+				  
+int_count			- Rx frame count each interrupt.
+int_timeout			- Rx DMA wait time for an interrupt. Proper 
+				  values of int_count and int_timeout bring 
+				  a conspicuous performance in the fast machine. 
+				  For P4 1.5GHz systems, a setting of 
+				  int_count=5 and int_timeout=750 is
+				  recommendable.
 Configuration Script Sample
 ===========================
 Here is a sample of a simple configuration script:
@@ -222,7 +227,7 @@
 
 Troubleshooting
 ===============
-Q1. Source files contain behind every line.
+Q1. Source files contain ^ M behind every line.
 	Make sure all files are Unix file format (no LF). Try the following
     shell command to convert files.
 
diff -u --recursive --new-file v2.4.9/linux/Documentation/nmi_watchdog.txt linux/Documentation/nmi_watchdog.txt
--- v2.4.9/linux/Documentation/nmi_watchdog.txt	Mon Aug 21 08:57:35 2000
+++ linux/Documentation/nmi_watchdog.txt	Mon Sep 17 23:03:09 2001
@@ -1,19 +1,27 @@
 
-Is your SMP system locking up unpredictably? No keyboard activity, just
+Is your ix86 system locking up unpredictably? No keyboard activity, just
 a frustrating complete hard lockup? Do you want to help us debugging
 such lockups? If all yes then this document is definitely for you.
 
-on Intel SMP hardware there is a feature that enables us to generate
-'watchdog NMI interrupts'. (NMI: Non Maskable Interrupt - these get
-executed even if the system is otherwise locked up hard) This can be
-used to debug hard kernel lockups. By executing periodic NMI interrupts,
-the kernel can monitor whether any CPU has locked up, and print out
-debugging messages if so.  You can enable/disable the NMI watchdog at boot
-time with the 'nmi_watchdog=1' boot parameter. Eg. the relevant
-lilo.conf entry:
+On Intel and similar ix86 type hardware there is a feature that enables
+us to generate 'watchdog NMI interrupts'.  (NMI: Non Maskable Interrupt
+which get executed even if the system is otherwise locked up hard).
+This can be used to debug hard kernel lockups.  By executing periodic
+NMI interrupts, the kernel can monitor whether any CPU has locked up,
+and print out debugging messages if so.  You must enable the NMI
+watchdog at boot time with the 'nmi_watchdog=n' boot parameter.  Eg.
+the relevant lilo.conf entry:
 
         append="nmi_watchdog=1"
 
+For SMP machines and UP machines with an IO-APIC use nmi_watchdog=1.
+For UP machines without an IO-APIC use nmi_watchdog=2, this only works
+for some processor types.  If in doubt, boot with nmi_watchdog=1 and
+check the NMI count in /proc/interrupts; if the count is zero then
+reboot with nmi_watchdog=2 and check the NMI count.  If it is still
+zero then log a problem, you probably have a processor that needs to be
+added to the nmi code.
+
 A 'lockup' is the following scenario: if any CPU in the system does not
 execute the period local timer interrupt for more than 5 seconds, then
 the NMI handler generates an oops and kills the process. This
@@ -24,8 +32,9 @@
 cannot even accept NMI interrupts, or the crash has made the kernel
 unable to print messages.
 
-NOTE: currently the NMI-oopser is enabled unconditionally on x86 SMP
-boxes.
+NOTE: starting with 2.4.2-ac18 the NMI-oopser is disabled by default,
+you have to enable it with a boot time parameter.  Prior to 2.4.2-ac18
+the NMI-oopser is enabled unconditionally on x86 SMP boxes.
 
 [ feel free to send bug reports, suggestions and patches to
   Ingo Molnar <mingo@redhat.com> or the Linux SMP mailing
diff -u --recursive --new-file v2.4.9/linux/Documentation/parisc/registers linux/Documentation/parisc/registers
--- v2.4.9/linux/Documentation/parisc/registers	Tue Dec  5 12:29:38 2000
+++ linux/Documentation/parisc/registers	Fri Sep 14 14:04:06 2001
@@ -16,17 +16,17 @@
 CR11				as specified by ABI
 CR14 (interruption vector)	initialized to fault_vector
 CR15 (EIEM)			initialized to all ones*
-CR16 (Interval Timer)		timer interrupt
+CR16 (Interval Timer)		read for cycle count/write starts Interval Tmr
 CR17-CR22			interruption parameters
-CR23 (EIRR)			read for pending interrupts
+CR23 (EIRR)			read for pending interrupts/write clears bits
 CR24 (TR 0)			Kernel Space Page Directory Pointer
 CR25 (TR 1)			User   Space Page Directory Pointer
-CR26 (TR 2)
-CR27 (TR 3)
-CR28 (TR 4)			used by interruption handlers
-CR29 (TR 5)			used by interruption handlers
+CR26 (TR 2)			not used
+CR27 (TR 3)			Thread descriptor pointer
+CR28 (TR 4)			not used
+CR29 (TR 5)			not used
 CR30 (TR 6)			current / 0
-CR31 (TR 7)			used by interruption handlers
+CR31 (TR 7)			Temporary register, used in various places
 
 	Space Registers (kernel mode)
 
diff -u --recursive --new-file v2.4.9/linux/Documentation/s390/3270.txt linux/Documentation/s390/3270.txt
--- v2.4.9/linux/Documentation/s390/3270.txt	Thu May 24 15:14:08 2001
+++ linux/Documentation/s390/3270.txt	Fri Sep  7 09:28:38 2001
@@ -34,17 +34,6 @@
 dialed-in x3270.
 
 
-HELP !!!
-
-The device name of e.g. /dev/3270/tty620 noted below is at variance
-with "standard" Linux device names.  What should it be?  The portion
-"/dev/3270" was recommended by H. Peter Anvin, maintainer of the
-official Linux major-numbers list; the portion "tty620" was recommended
-by me.  Please send your thoughts on this issue at least to me at
-rbh00@utsglobal.com.  Even if you think it's okay as is, please let me
-know.  Thanks.
-
-
 INSTALLATION.
 
 You install the driver by installing a patch, doing a kernel build, and
@@ -60,9 +49,14 @@
 
 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
-can use DEF GRAF to define virtual 3270 devices.  If you generate 3270
-console support, the driver automatically converts your console at boot
-time to a 3270 if it is a 3215.
+can use DEF GRAF to define virtual 3270 devices.
+
+You may generate both 3270 and 3215 console support, or one or the
+other, or neither.  If you generate both, the console type under VM is
+not changed.  Use #CP Q TERM to see what the current console type is.
+Use #CP TERM CONMODE 3270 to change it to 3270.  If you generate only
+3270 console support, then the driver automatically converts your console
+at boot time to a 3270 if it is a 3215.
 
 In brief, these are the steps:
 	1. Install the tub3270 patch
@@ -78,21 +72,17 @@
 
 Here are the installation steps in detail:
 
-	0.  Retrieve the patch file via anonymous ftp from
-	ftp://ftp.utsglobal.com/pub/tub3270.  The patch is designed
-	to apply smoothly to an IBM 2.4.0 system with no other
-	UTS-Global patches applied.  We know of some easily resolvable
-	conflicts between this and other of our patches.
-
-	1. Apply the patch.  Then do
+	1.  The 3270 driver is a part of the official Linux kernel
+	source.  Build a tree with the kernel source and any necessary
+	patches.  Then do
 		make oldconfig
-			(Reply "y" or "m" for CONFIG_3270; if "y",
-			reply "y" or "n" for CONFIG_3270_CONSOLE)
+		(If you wish to disable 3215 console support, edit
+		.config; change CONFIG_TN3215's value to "n";
+		and rerun "make oldconfig".)
 		make dep
 		make image
 		make modules
 		make modules_install
-		<run silo in the usual way>
 
 	2. (Perform this step only if you have configured tub3270 as a
 	module.)  Add a line to /etc/modules.conf to automatically
@@ -122,12 +112,17 @@
 	config3270.sh.	Inspect the output script it produces,
 	/tmp/mkdev3270, and then run that script.  This will create the
 	necessary character special device files and make the necessary
-	changes to /etc/inittab.  Then notify /sbin/init that /etc/inittab
-	has changed, by issuing the telinit command with the q operand:
+	changes to /etc/inittab.  If you have selected DEVFS, the driver
+	itself creates the device files, and /tmp/mkdev3270 only changes
+	/etc/inittab.
+
+	Then notify /sbin/init that /etc/inittab has changed, by issuing
+	the telinit command with the q operand:
 		cd /usr/src/linux/Documentation/s390
 		sh config3270.sh
 		sh /tmp/mkdev3270
 		telinit q
+
 	This should be sufficient for your first time.	If your 3270
 	configuration has changed and you're reusing config3270, you
 	should follow these steps:
diff -u --recursive --new-file v2.4.9/linux/Documentation/s390/config3270.sh linux/Documentation/s390/config3270.sh
--- v2.4.9/linux/Documentation/s390/config3270.sh	Wed Apr 11 19:02:27 2001
+++ linux/Documentation/s390/config3270.sh	Fri Sep  7 09:28:38 2001
@@ -37,10 +37,14 @@
 echo "#!/bin/sh" > $SCR || exit 1
 echo " " >> $SCR
 echo "# Script built by /sbin/config3270" >> $SCR
-echo rm -rf "$D/$SUBD/*" >> $SCR
+if [ ! -d /dev/dasd ]; then
+	echo rm -rf "$D/$SUBD/*" >> $SCR
+fi
 echo "grep -v $TTY $INITTAB > $NINITTAB" > $SCRTMP || exit 1
 echo "echo $ADDNOTE >> $NINITTAB" >> $SCRTMP
-echo mkdir -p $D/$SUBD >> $SCR
+if [ ! -d /dev/dasd ]; then
+	echo mkdir -p $D/$SUBD >> $SCR
+fi
 
 # Now query the tub3270 driver for 3270 device information
 # and add appropriate mknod and mingetty lines to our files
@@ -48,13 +52,19 @@
 while read devno maj min;do
 	if [ $min = 0 ]; then
 		fsmaj=$maj
-		echo mknod $D/$TUB c $fsmaj 0 >> $SCR
-		echo chmod 666 $D/$TUB >> $SCR
+		if [ ! -d /dev/dasd ]; then
+			echo mknod $D/$TUB c $fsmaj 0 >> $SCR
+			echo chmod 666 $D/$TUB >> $SCR
+		fi
 	elif [ $maj = CONSOLE ]; then
-		echo mknod $D/$TUB$devno c $fsmaj $min >> $SCR
+		if [ ! -d /dev/dasd ]; then
+			echo mknod $D/$TUB$devno c $fsmaj $min >> $SCR
+		fi
 	else
-		echo mknod $D/$TTY$devno c $maj $min >>$SCR
-		echo mknod $D/$TUB$devno c $fsmaj $min >> $SCR
+		if [ ! -d /dev/dasd ]; then
+			echo mknod $D/$TTY$devno c $maj $min >>$SCR
+			echo mknod $D/$TUB$devno c $fsmaj $min >> $SCR
+		fi
 		echo "echo t$min$GETTYLINE $TTY$devno >> $NINITTAB" >> $SCRTMP
 	fi
 done < $P
diff -u --recursive --new-file v2.4.9/linux/Documentation/sound/CMI8338 linux/Documentation/sound/CMI8338
--- v2.4.9/linux/Documentation/sound/CMI8338	Wed Jul 25 17:10:17 2001
+++ linux/Documentation/sound/CMI8338	Fri Sep  7 09:28:38 2001
@@ -69,8 +69,8 @@
   Some functions for the cm8738 can be configured in Kernel Configuration
   or modules parameters. Set these parameters to 1 to enable.
 
-  mpu_io:	I/O ports base for MPU-401, 0 if disabled.
-  fm_io:	I/O ports base for OPL-3, 0 if disabled.
+  mpuio:	I/O ports base for MPU-401, 0 if disabled.
+  fmio:		I/O ports base for OPL-3, 0 if disabled.
   spdif_inverse:Inverse the S/PDIF-in signal, this depends on your
 		CD-ROM or DVD-ROM.
   spdif_loop:   Enable S/PDIF loop, this route S/PDIF-in to S/PDIF-out
@@ -80,8 +80,6 @@
                 rear-out.
   use_line_as_bass:Enable this if you want to use line-in as
                 bass-out.
-  modem:	You will need to set this parameter if you want to use
-		the HSP modem. You need install the pctel.o, the modem
-		driver itself.
   joystick:	Enable joystick. You will need to install Linux joystick
 		driver.
+
diff -u --recursive --new-file v2.4.9/linux/Documentation/sound/WaveArtist linux/Documentation/sound/WaveArtist
--- v2.4.9/linux/Documentation/sound/WaveArtist	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/sound/WaveArtist	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,170 @@
+
+ (the following is from the armlinux CVS)
+
+ WaveArtist mixer and volume levels can be accessed via these commands:
+
+  nn30	read registers nn, where nn = 00 - 09 for mixer settings
+		                              0a - 13 for channel volumes
+  mm31	write the volume setting in pairs, where mm = (nn - 10) / 2
+  rr32	write the mixer settings in pairs, where rr = nn/2
+  xx33	reset all settings to default
+  0y34	select mono source, y=0 = left, y=1 = right
+
+                                           bits
+ nn  15  14 13 12 11   10    9     8     7    6     5     4     3     2     1     0
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 00 | 0 | 0  0  1  1 | left line mixer gain       | left aux1 mixer gain        |lmute|
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 01 | 0 | 0  1  0  1 | left aux2 mixer gain       | right 2 left mic gain       |mmute|
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 02 | 0 | 0  1  1  1 | left mic mixer gain        | left mic  | left mixer gain |dith |
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 03 | 0 | 1  0  0  1 | left mixer input select                |lrfg | left ADC gain   |
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 04 | 0 | 1  0  1  1 | right line mixer gain      | right aux1 mixer gain       |rmute|
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 05 | 0 | 1  1  0  1 | right aux2 mixer gain      | left 2 right mic gain       |test |
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 06 | 0 | 1  1  1  1 | right mic mixer gain       | right mic |right mixer gain |rbyps|
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 07 | 1 | 0  0  0  1 | right mixer select                     |rrfg | right ADC gain  |
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 08 | 1 | 0  0  1  1 | mono mixer gain            |right ADC mux sel|left ADC mux sel |
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 09 | 1 | 0  1  0  1 |loopb|left linout|loop|ADCch|TxFch|OffCD|test |loopb|loopb|osamp|
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 0a | 0 | left PCM channel volume                                                     |
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 0b | 0 | right PCM channel volume                                                    |
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 0c | 0 | left FM channel volume                                                      |
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 0d | 0 | right FM channel volume                                                     |
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 0e | 0 | left wavetable channel volume                                               |
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 0f | 0 | right wavetable channel volume                                              |
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 10 | 0 | left PCM expansion channel volume                                           |
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 11 | 0 | right PCM expansion channel volume                                          |
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 12 | 0 | left FM expansion channel volume                                            |
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+ 13 | 0 | right FM expansion channel volume                                           |
+----+---+------------+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+-----+
+
+ lmute: left mute
+ mmute: mono mute
+ dith: dithds
+ lrfg:
+ rmute: right mute
+ rbyps: right bypass
+ rrfg:
+ ADCch:
+ TxFch:
+ OffCD:
+ osamp:
+
+ And the following diagram is derived from the description in the CVS archive:
+
+ MIC L (mouthpiece)
+   +------+
+ -->PreAmp>-\
+   +--^---+ |
+      |     |
+    r2b4-5  |                                +--------+
+       /----*-------------------------------->5       |
+       |                                     |        |
+       | /----------------------------------->4       |
+       | |                                   |        |
+       | | /--------------------------------->3 1of5  |  +---+
+       | | |                                 |  mux   >-->AMP>--> ADC L
+       | | | /------------------------------->2       |  +-^-+
+       | | | |                               |        |    |
+ Line  | | | | +----+  +------+  +---+  /---->1       |  r3b3-0
+ ------------*->mute>--> Gain >-->   |  |    |        |
+  L    | | |   +----+  +------+  |   |  |  *->0       |
+       | | |                     |   |  |    +---^----+
+ Aux2  | | |   +----+  +------+  |   |  |        |
+ ----------*--->mute>--> Gain >--> M |  |     r8b0-2
+  L    | |     +----+  +------+  |   |  |
+       | |                       |   |  \------\
+ Aux1  | |     +----+  +------+  |   |         |
+ --------*----->mute>--> Gain >--> I |         |
+  L    |       +----+  +------+  |   |         |
+       |                         |   |         |
+       |       +----+  +------+  |   |  +---+  |
+       *------->mute>--> Gain >--> X >-->AMP>--*
+       |       +----+  +------+  |   |  +-^-+  |
+       |                         |   |    |    |
+       |       +----+  +------+  |   |  r2b1-3 |  
+       | /----->mute>--> Gain >--> E |         |
+       | |     +----+  +------+  |   |         |
+       | |                       |   |         |
+       | |     +----+  +------+  |   |         |
+       | | /--->mute>--> Gain >--> R |         |
+       | | |   +----+  +------+  |   |         |
+       | | |                     |   |         |   r9b8-9
+       | | |   +----+  +------+  |   |         |     |
+       | | | /->mute>--> Gain >-->   |         | +---v---+
+       | | | | +----+  +------+  +---+       /-*->0      |
+ DAC   | | | |                               |   |       |
+ ------------*----------------------------------->?      |  +----+
+  L    | | |                                 |   |  Mux  >-->mute>--> L output
+       | | |                                 | /->?      |  +--^-+
+       | | |                                 | | |       |     |
+       | | |                           /--------->?      |   r0b0
+       | | |                           |     | | +-------+
+       | | |                           |     | |
+ Mono  | | |                           |     | | +-------+
+ ----------*                           |     \--->       |  +----+
+       | | |                           |       | |  Mix  >-->mute>--> Mono output
+       | | |                           |       *->       |  +--^-+
+       | | |                           |       | +-------+     |
+       | | |                           |       |             r1b0
+ DAC   | | |                           |       | +-------+
+ ------------*-------------------------*--------->1      |  +----+
+  R    | | | |                                 | |  Mux  >-->mute>--> R output
+       | | | | +----+  +------+  +---+         *->0      |  +--^-+
+       | | | \->mute>--> Gain >-->   |         | +---^---+     |
+       | | |   +----+  +------+  |   |         |     |       r5b0
+       | | |                     |   |         |   r6b0
+       | | |   +----+  +------+  |   |         |
+       | | \--->mute>--> Gain >--> M |         |
+       | |     +----+  +------+  |   |         |
+       | |                       |   |         |
+       | |     +----+  +------+  |   |         |
+       | *----->mute>--> Gain >--> I |         |
+       | |     +----+  +------+  |   |         |
+       | |                       |   |         |
+       | |     +----+  +------+  |   |  +---+  |
+       \------->mute>--> Gain >--> X >-->AMP>--*
+         |     +----+  +------+  |   |  +-^-+  |
+      /--/                       |   |    |    |
+ Aux1 |        +----+  +------+  |   |  r6b1-3 |
+ -------*------>mute>--> Gain >--> E |         |
+  R   | |      +----+  +------+  |   |         |
+      | |                        |   |         |
+ Aux2 | |      +----+  +------+  |   |  /------/
+ ---------*---->mute>--> Gain >--> R |  |
+  R   | | |    +----+  +------+  |   |  |
+      | | |                      |   |  |    +--------+
+ Line | | |    +----+  +------+  |   |  |  *->0       |
+ -----------*-->mute>--> Gain >-->   |  |    |        |
+  R   | | | |  +----+  +------+  +---+  \---->1       |
+      | | | |                                |        |
+      | | | \-------------------------------->2       |  +---+
+      | | |                                  |  Mux   >-->AMP>--> ADC R
+      | | \---------------------------------->3       |  +-^-+
+      | |                                    |        |    |
+      | \------------------------------------>4       |  r7b3-0
+      |                                      |        |
+      \-----*-------------------------------->5       |
+            |                                +---^----+
+    r6b4-5  |                                    |
+      |     |                                  r8b3-5
+   +--v---+ |
+ -->PreAmp>-/
+   +------+
+ MIC R (electret mic)
diff -u --recursive --new-file v2.4.9/linux/Documentation/sound/btaudio linux/Documentation/sound/btaudio
--- v2.4.9/linux/Documentation/sound/btaudio	Sun Aug 12 13:27:58 2001
+++ linux/Documentation/sound/btaudio	Tue Sep 18 14:25:27 2001
@@ -31,23 +31,28 @@
 should'nt crash your box.  It might not work as expected, have bugs,
 not being fully OSS API compilant, ...
 
+Latest versions are available from http://bytesex.org/bttv/, the
+driver is in the bttv tarball.  Kernel patches might be available too,
+have a look at http://bytesex.org/bttv/listing.html.
+
+The chip knows two different modes.  btaudio registers two dsp
+devices, one for each mode.  They can not be used at the same time.
+
 
 Digital audio mode
 ==================
 
-The chip knows different modes.  Right now you have to pick the one you
-want to use at insmod time.  Digital audio mode is the default.  The
-chip gives you 16 bit stereo sound with ~32 kHz sample rate.  According
-to the specs it should be possible to get up to 48 kHz, but I havn't
-figured out yet how this works.  The specs are not very verbose :-(
-
-Lower sample rates are possible too, but the code isn't written yet.
-For now you are limited to the fixed 32 kHz.  Mono works throuth, the
-driver will do that in software for you.
-
-With my Hauppauge I get clear sound, but I got also reports saying that
-digital audio mode does'nt work.  Guess Hauppauge connected the msp34xx
-output to the bt878's I2S digital audio input port.
+The chip gives you 16 bit stereo sound.  The sample rate depends on
+the external source which feeds the bt878 with digital sound via I2S
+interface.  There is a insmod option (rate) to tell the driver which
+sample rate the hardware uses (32000 is the default).
+
+One possible source for digital sound is the msp34xx audio processor
+chip which provides digital sound via I2S with 32 kHz sample rate.  My
+Hauppauge board works this way.
+
+The Osprey-200 reportly gives you digital sound with 44100 Hz sample
+rate.  It is also possible that you get no sound at all.
 
 
 analog mode (A/D)
@@ -67,11 +72,17 @@
 by the mixer device).  Others get a useable signal on line1.
 
 
-more hints
-==========
+some examples
+=============
+
+* read audio data from btaudio (dsp2), send to es1730 (dsp,dsp1):
+  $ sox -w -r 32000 -t ossdsp /dev/dsp2 -t ossdsp /dev/dsp
+
+* read audio data from btaudio, send to esound daemon (which might be
+  running on another host):
+  $ sox -c 2 -w -r 32000 -t ossdsp /dev/dsp2 -t sw - | esdcat -r 32000
+  $ sox -c 1 -w -r 32000 -t ossdsp /dev/dsp2 -t sw - | esdcat -m -r 32000
 
-/me uses "sox -w -r 32000 -t ossdsp /dev/dsp2 -t ossdsp /dev/dsp"
-to dump audio data from btaudio (dsp2) to es1730 (dsp,dsp1).
 
 Have fun,
 
diff -u --recursive --new-file v2.4.9/linux/Documentation/sysctl/vm.txt linux/Documentation/sysctl/vm.txt
--- v2.4.9/linux/Documentation/sysctl/vm.txt	Wed Mar 14 14:39:07 2001
+++ linux/Documentation/sysctl/vm.txt	Mon Sep 10 14:36:25 2001
@@ -33,32 +33,29 @@
 This file controls the operation of the bdflush kernel
 daemon. The source code to this struct can be found in
 linux/fs/buffer.c. It currently contains 9 integer values,
-of which 6 are actually used by the kernel.
+of which 4 are actually used by the kernel.
 
 From linux/fs/buffer.c:
 --------------------------------------------------------------
-union bdflush_param{
-    struct {
-        int nfract;      /* Percentage of buffer cache dirty to
-                            activate bdflush */
-        int ndirty;      /* Maximum number of dirty blocks to
-                            write out per wake-cycle */
-        int nrefill;     /* Number of clean buffers to try to
-                            obtain each time we call refill */
-        int nref_dirt;   /* Dirty buffer threshold for activating
-                            bdflush when trying to refill buffers. */
-        int dummy1;      /* unused */
-        int age_buffer;  /* Time for normal buffer to age before
-                            we flush it */
-        int age_super;   /* Time for superblock to age before we
-                            flush it */
-        int dummy2;      /* unused */
-        int dummy3;      /* unused */
-    } b_un;
-    unsigned int data[N_PARAM];
-} bdf_prm = {{40, 500, 64, 256, 15, 30*HZ, 5*HZ, 1884, 2}};
+union bdflush_param {
+	struct {
+		int nfract;	/* Percentage of buffer cache dirty to 
+				   activate bdflush */
+		int dummy1;	/* old "ndirty" */
+		int dummy2;	/* old "nrefill" */
+		int dummy3;	/* unused */
+		int interval;	/* jiffies delay between kupdate flushes */
+		int age_buffer;	/* Time for normal buffer to age */
+		int nfract_sync;/* Percentage of buffer cache dirty to 
+				   activate bdflush synchronously */
+		int dummy4;	/* unused */
+		int dummy5;	/* unused */
+	} b_un;
+	unsigned int data[N_PARAM];
+} bdf_prm = {{30, 64, 64, 256, 5*HZ, 30*HZ, 60, 0, 0}};
 --------------------------------------------------------------
 
+int nfract:
 The first parameter governs the maximum number of dirty
 buffers in the buffer cache. Dirty means that the contents
 of the buffer still have to be written to disk (as opposed
@@ -66,32 +63,31 @@
 Setting this to a high value means that Linux can delay disk
 writes for a long time, but it also means that it will have
 to do a lot of I/O at once when memory becomes short. A low
-value will spread out disk I/O more evenly.
-
-The second parameter (ndirty) gives the maximum number of
-dirty buffers that bdflush can write to the disk in one time.
-A high value will mean delayed, bursty I/O, while a small
-value can lead to memory shortage when bdflush isn't woken
-up often enough...
-
-The third parameter (nrefill) is the number of buffers that
-bdflush will add to the list of free buffers when
-refill_freelist() is called. It is necessary to allocate free
-buffers beforehand, since the buffers often are of a different
-size than memory pages and some bookkeeping needs to be done
-beforehand. The higher the number, the more memory will be
-wasted and the less often refill_freelist() will need to run.
-
-When refill_freelist() comes across more than nref_dirt dirty
-buffers, it will wake up bdflush.
-
-Finally, the age_buffer and age_super parameters govern the
-maximum time Linux waits before writing out a dirty buffer
-to disk. The value is expressed in jiffies (clockticks), the
-number of jiffies per second is 100, except on Alpha machines
-(1024). Age_buffer is the maximum age for data blocks, while
-age_super is for filesystem metadata.
-
+value will spread out disk I/O more evenly, at the cost of
+more frequent I/O operations.  The default value is 30%,
+the minimum is 0%, and the maximum is 100%.
+
+int interval:
+The fifth parameter, interval, is the minimum rate at
+which kupdate will wake and flush.  The value is expressed in
+jiffies (clockticks), the number of jiffies per second is
+normally 100 (Alpha is 1024). Thus, x*HZ is x seconds.  The
+default value is 5 seconds, the minimum is 0 seconds, and the
+maximum is 600 seconds.
+
+int age_buffer:
+The sixth parameter, age_buffer, governs the maximum time
+Linux waits before writing out a dirty buffer to disk.  The
+value is in jiffies.  The default value is 30 seconds,
+the minimum is 1 second, and the maximum 6,000 seconds.
+
+int nfract_sync:
+The seventh parameter, nfract_sync, governs the percentage
+of buffer cache that is dirty before bdflush activates
+synchronously.  This can be viewed as the hard limit before
+bdflush forces buffers to disk.  The default is 60%, the
+minimum is 0%, and the maximum is 100%.
+ 
 ==============================================================
 buffermem:
 
diff -u --recursive --new-file v2.4.9/linux/Documentation/sysrq.txt linux/Documentation/sysrq.txt
--- v2.4.9/linux/Documentation/sysrq.txt	Thu May 24 15:03:06 2001
+++ linux/Documentation/sysrq.txt	Mon Sep 17 22:52:35 2001
@@ -1,26 +1,27 @@
+Linux Magic System Request Key Hacks
+Documentation for sysrq.c version 1.15
+Last update: $Date: 2001/01/28 10:15:59 $
 
-                      MAGIC SYSRQ KEY DOCUMENTATION v1.32
-                     ------------------------------------
-                        [Sat Apr  8 22:15:03 CEST 2000]
-
-*  What is the magic SysRQ key?
+*  What is the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-It is a 'magical' key combo you can hit which kernel will respond to
+It is a 'magical' key combo you can hit which the kernel will respond to
 regardless of whatever else it is doing, unless it is completely locked up.
 
-*  How do I enable the magic SysRQ key?
+*  How do I enable the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 You need to say "yes" to 'Magic SysRq key (CONFIG_MAGIC_SYSRQ)' when
-configuring the kernel. This option is only available in 2.1.x or later
-kernels. Once you boot the new kernel, you need to enable it manually 
-using following command:
+configuring the kernel. When running on a kernel with SysRq compiled in, it
+may be DISABLED at run-time using following command:
+
+        echo "0" > /proc/sys/kernel/sysrq
 
-	 echo "1" > /proc/sys/kernel/sysrq
+Note that previous versions disabled sysrq by default, and you were required
+to specifically enable it at run-time. That is not the case any longer.
 
-*  How do I use the magic SysRQ key?
+*  How do I use the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-On x86   - You press the key combo 'ALT-SysRQ-<command key>'. Note - Some
-           (older?) may not have a key labeled 'SysRQ'. The 'SysRQ' key is
+On x86   - You press the key combo 'ALT-SysRq-<command key>'. Note - Some
+           keyboards may not have a key labeled 'SysRq'. The 'SysRq' key is
            also known as the 'Print Screen' key.
 
 On SPARC - You press 'ALT-STOP-<command key>', I believe.
@@ -33,14 +34,14 @@
              Print Screen (or F13) - <command key> may suffice.
 
 On other - If you know of the key combos for other architectures, please
-           let me know so I can add them to this section. 
+           let me know so I can add them to this section.
 
 *  What are the 'command' keys?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 'r'     - Turns off keyboard raw mode and sets it to XLATE.
 
-'k'     - Secure Access Key (SAK) Kills all programs on the current virtual 
-	  console. NOTE: See important comments below in SAK section.
+'k'     - Secure Access Key (SAK) Kills all programs on the current virtual
+          console. NOTE: See important comments below in SAK section.
 
 'b'     - Will immediately reboot the system without syncing or unmounting
           your disks.
@@ -70,8 +71,8 @@
 'l'     - Send a SIGKILL to all processes, INCLUDING init. (Your system
           will be non-functional after this.)
 
-'h'	- Will display help ( actually any other key than those listed
-	  above will display help. but 'h' is easy to remember :-)
+'h'     - Will display help ( actually any other key than those listed
+          above will display help. but 'h' is easy to remember :-)
 
 *  Okay, so what can I use them for?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -83,8 +84,8 @@
 and thus letting you make sure that the login prompt you see is actually
 the one from init, not some trojan program.
 IMPORTANT:In its true form it is not a true SAK like the one in   :IMPORTANT
-IMPORTATN:c2 compliant systems, and it should be mistook as such. :IMPORTANT
-	It seems other find it useful as (System Attention Key) which is
+IMPORTANT:c2 compliant systems, and it should be mistook as such. :IMPORTANT
+       It seems other find it useful as (System Attention Key) which is
 useful when you want to exit a program that will not let you switch consoles.
 (For example, X or a svgalib program.)
 
@@ -93,7 +94,7 @@
 
 'S'ync is great when your system is locked up, it allows you to sync your
 disks and will certainly lessen the chance of data loss and fscking. Note
-that the sync hasn't taken place until you see the "OK" and "Done" appear 
+that the sync hasn't taken place until you see the "OK" and "Done" appear
 on the screen. (If the kernel is really in strife, you may not ever get the
 OK or Done message...)
 
@@ -111,30 +112,72 @@
 are unable to kill any other way, especially if it's spawning other
 processes.
 
-*  Sometimes SysRQ seems to get 'stuck' after using it, what can I do?
+*  Sometimes SysRq seems to get 'stuck' after using it, what can I do?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 That happens to me, also. I've found that tapping shift, alt, and control
 on both sides of the keyboard, and hitting an invalid sysrq sequence again
 will fix the problem. (ie, something like alt-sysrq-z). Switching to another
 virtual console (ALT+Fn) and then back again should also help.
 
-*  I hit SysRQ, but nothing seems to happen, what's wrong?
+*  I hit SysRq, but nothing seems to happen, what's wrong?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-There are some keyboards that send different scancodes for SysRQ than the
-pre-defined 0x54. So if SysRQ doesn't work out of the box for a certain 
-keyboard, run 'showkey -s' to find out the proper scancode sequence. Then 
-use 'setkeycodes <sequence> 84' to define this sequence to the usual SysRQ 
+There are some keyboards that send different scancodes for SysRq than the
+pre-defined 0x54. So if SysRq doesn't work out of the box for a certain
+keyboard, run 'showkey -s' to find out the proper scancode sequence. Then
+use 'setkeycodes <sequence> 84' to define this sequence to the usual SysRq
 code (84 is decimal for 0x54). It's probably best to put this command in a
-boot script. Oh, and by the way, you exit 'showkey' by not typing anything 
+boot script. Oh, and by the way, you exit 'showkey' by not typing anything
 for ten seconds.
 
+*  I want to add SysRQ key events to a module, how does it work?
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+In order to register a basic function with the table, you must first include
+the header 'include/linux/sysrq.h', this will define everything else you need.
+Next, you must create a sysrq_key_op struct, and populate it with A) the key
+handler function you will use, B) a help_msg string, that will print when SysRQ
+prints help, and C) an action_msg string, that will print right before your
+handler is called. Your handler must conform to the protoype in 'sysrq.h'.
+
+After the sysrq_key_op is created, you can call the macro 
+register_sysrq_key(int key, struct sysrq_key_op *op_p) that is defined in
+sysrq.h, this will register the operation pointed to by 'op_p' at table
+key 'key', if that slot in the table is blank. At module unload time, you must
+call the macro unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which
+will remove the key op pointed to by 'op_p' from the key 'key', if and only if
+it is currently registered in that slot. This is in case the slot has been
+overwritten since you registered it.
+
+The Magic SysRQ system works by registering key operations against a key op
+lookup table, which is defined in 'drivers/char/sysrq.c'. This key table has
+a number of operations registered into it at compile time, but is mutable,
+and 4 functions are exported for interface to it: __sysrq_lock_table,
+__sysrq_unlock_table, __sysrq_get_key_op, and __sysrq_put_key_op. The
+functions __sysrq_swap_key_ops and __sysrq_swap_key_ops_nolock are defined
+in the header itself, and the REGISTER and UNREGISTER macros are built fromi
+these. More complex (and dangerous!) manipulations of the table are possible
+using these functions, but you must be careful to always lock the table before
+you read or write from it, and to unlock it again when you are done. (And of
+course, to never ever leave an invalid pointer in the table). Null pointers in
+the table are always safe :)
+
+If for some reason you feel the need to call the handle_sysrq function from
+within a function called by handle_sysrq, you must be aware that you are in
+a lock (you are also in an interupt handler, which means don't sleep!), so
+you must call __handle_sysrq_nolock instead.
+
 *  I have more questions, who can I ask?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 You may feel free to send email to myrdraal@deathsdoor.com, and I will
-respond as soon as possible. 
+respond as soon as possible.
  -Myrdraal
 
+And I'll answer any questions about the registration system you got, also
+responding as soon as possible.
+ -Crutcher
+
 *  Credits
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Written by Mydraal <myrdraal@deathsdoor.com>
 Updated by Adam Sulmicki <adam@cfar.umd.edu>
+Updated by Jeremy M. Dolan <jmd@turbogeek.org> 2001/01/28 10:15:59
+Added to by Crutcher Dunnavant <crutcher+kernel@datastacks.com>
diff -u --recursive --new-file v2.4.9/linux/Documentation/usb/hiddev.txt linux/Documentation/usb/hiddev.txt
--- v2.4.9/linux/Documentation/usb/hiddev.txt	Wed Dec 31 16:00:00 1969
+++ linux/Documentation/usb/hiddev.txt	Wed Sep 12 15:34:06 2001
@@ -0,0 +1,162 @@
+Care and feeding of your Human Interface Devices
+
+INTRODUCTION
+
+In addition to the normal input type HID devices, USB also uses the
+human interface device protocols for things that are not really human
+interfaces, but have similar sorts of communication needs. The two big
+examples for this are power devices (especially uninterruptable power
+supplies) and monitor control on higher end monitors.
+
+To support these disparite requirements, the Linux USB system provides
+HID events to two seperate interfaces:
+* the input subsystem, which converts HID events into normal input
+device interfaces (such as keyboard, mouse and joystick) and a
+normalised event interface - see Documentation/input/input.txt
+* the hiddev interface, which provides fairly raw HID events
+
+The data flow for a HID event produced by a device is something like
+the following :
+
+ usb.c ---> hid.c  ----> input.c ----> [keyboard/mouse/joystick/event]
+                    |
+                    |
+                    --> hiddev.c ----> POWER / MONITOR CONTROL 
+
+In addition, other subsystems (apart from USB) can potentially feed
+events into the input subsystem, but these have no effect on the hid
+device interface.
+
+USING THE HID DEVICE INTERFACE
+
+The hiddev interface is a char interface using the normal USB major,
+with the minor numbers starting at 96 and finishing at 111. Therefore,
+you need the following commands:
+mknod /dev/usb/hiddev0 c 180 96
+mknod /dev/usb/hiddev1 c 180 97
+mknod /dev/usb/hiddev2 c 180 98
+mknod /dev/usb/hiddev3 c 180 99
+mknod /dev/usb/hiddev4 c 180 100
+mknod /dev/usb/hiddev5 c 180 101
+mknod /dev/usb/hiddev6 c 180 102
+mknod /dev/usb/hiddev7 c 180 103
+mknod /dev/usb/hiddev8 c 180 104
+mknod /dev/usb/hiddev9 c 180 105
+mknod /dev/usb/hiddev10 c 180 106
+mknod /dev/usb/hiddev11 c 180 107
+mknod /dev/usb/hiddev12 c 180 108
+mknod /dev/usb/hiddev13 c 180 109
+mknod /dev/usb/hiddev14 c 180 110
+mknod /dev/usb/hiddev15 c 180 111
+
+So you point your hiddev compliant user-space program at the correct
+interface for your device, and it all just works.
+
+Assuming that you have a hiddev compliant user-space program, of
+course. If you need to write one, read on.
+
+
+THE HIDDEV API
+This description should be read in conjunction with the HID
+specification, freely available from http://www.usb.org, and
+conveniently linked of http://www.linux-usb.org.
+
+The hiddev API uses a read() interface, and a set of ioctl() calls.
+
+
+read():
+This is the event interface. When the HID device performs an
+interrupt transfer, indicating a change of state, data will be made
+available at the associated hiddev device with the content of a struct
+hiddev_event: 
+
+       struct hiddev_event {
+           unsigned hid;
+           signed int value;
+       };
+
+containing the HID usage identifier for the status that changed, and
+the value that it was changed to. Note that the structure is defined
+within <linux/hiddev.h>, along with some other useful #defines and
+structures. 
+
+
+ioctl(): 
+This is the control interface. There are a number of controls: 
+
+HIDIOCGVERSION - int (read)
+Gets the version code out of the hiddev driver.
+
+HIDIOCAPPLICATION - (none)
+This ioctl call returns the HID application usage associated with the
+hid device. The third argument to ioctl() specifies which application
+index to get. This is useful when the device has more than one
+application collection. If the index is invalid (greater or equal to
+the number of application collections this device has) the ioctl
+returns -1. You can find out beforehand how many application
+collections the device has from the num_applications field from the
+hiddev_devinfo structure. 
+
+HIDIOCGDEVINFO - struct hiddev_devinfo (read)
+Gets a hiddev_devinfo structure which describes the device.
+
+HIDIOCGSTRING - struct struct hiddev_string_descriptor (read/write)
+Gets a string descriptor from the device. The caller must fill in the
+"index" field to indicate which descriptor should be returned.
+
+HIDIOCINITREPORT - (none)
+Instructs the kernel to retrieve all input and feature report values
+from the device. At this point, all the usage structures will contain
+current values for the device, and will maintain it as the device
+changes.
+
+HIDIOCGNAME - string (variable length)
+Gets the device name
+
+HIDIOCGREPORT - struct hiddev_report_info (write)
+Instructs the kernel to get a feature or input report from the device,
+in order to selectively update the usage structures (in contrast to
+INITREPORT). 
+
+HIDIOCSREPORT - struct hiddev_report_info (write)
+Instructs the kernel to send a report to the device. This report can
+be filled in by the user through HIDIOCSUSAGE calls (below) to fill in
+individual usage values in the report beforesending the report in full
+to the device. 
+
+HIDIOCGREPORTINFO - struct hiddev_report_info (read/write)
+Fills in a hiddev_report_info structure for the user. The report is
+looked up by type (input, output or feature) and id, so these fields
+must be filled in by the user. The ID can be absolute -- the actual
+report id as reported by the device -- or relative --
+HID_REPORT_ID_FIRST for the first report, and (HID_REPORT_ID_NEXT |
+report_id) for the next report after report_id. Without a-priori
+information about report ids, the right way to use this ioctl is to
+use the relative IDs above to enumerate the valid IDs. The ioctl
+returns non-zero when there is no more next ID. The real report ID is
+filled into the returned hiddev_report_info structure. 
+
+HIDIOCGFIELDINFO - struct hiddev_field_info (read/write)
+Returns the field information associated with a report in a
+hiddev_field_info structure. The user must fill in report_id and
+report_type in this structure, as above. The field_index should also
+be filled in, which should be a number from 0 and maxfield-1, as
+returned from a previous HIDIOCGREPORTINFO call. 
+
+HIDIOCGUCODE - struct hiddev_usage_ref (read/write)
+Returns the usage_code in a hiddev_usage_ref structure, given that
+given its report type, report id, field index, and index within the
+field have already been filled into the structure.
+
+HIDIOCGUSAGE - struct hiddev_usage_ref (read/write)
+Returns the value of a usage in a hiddev_usage_ref structure. The
+usage to be retrieved can be specified as above, or the user can
+choose to fill in the report_type field and specify the report_id as
+HID_REPORT_ID_UNKNOWN. In this case, the hiddev_usage_ref will be
+filled in with the report and field infomation associated with this
+usage if it is found. 
+
+HIDIOCSUSAGE - struct hiddev_usage_ref (write)
+Sets the value of a usage in an output report.
+
+
diff -u --recursive --new-file v2.4.9/linux/Documentation/usb/input.txt linux/Documentation/usb/input.txt
--- v2.4.9/linux/Documentation/usb/input.txt	Fri Jul 28 12:50:52 2000
+++ linux/Documentation/usb/input.txt	Wed Dec 31 16:00:00 1969
@@ -1,306 +0,0 @@
-			  Linux Input drivers v1.0
-	       (c) 1999-2000 Vojtech Pavlik <vojtech@suse.cz>
-			     Sponsored by SuSE
-	    $Id: input.txt,v 1.4 2000/05/28 17:57:22 vojtech Exp $
-----------------------------------------------------------------------------
-
-0. Disclaimer
-~~~~~~~~~~~~~
-  This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your option)
-any later version.
-
-  This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-more details.
-
-  You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc., 59
-Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-  Should you need to contact me, the author, you can do so either by e-mail
-- mail your message to <vojtech@suse.cz>, or by paper mail: Vojtech Pavlik,
-Ucitelska 1576, Prague 8, 182 00 Czech Republic
-
-  For your convenience, the GNU General Public License version 2 is included
-in the package: See the file COPYING.
-
-1. Introduction
-~~~~~~~~~~~~~~~
-  This is a collection of drivers that is designed to support all input
-devices under Linux. However, in the current kernels, although it's
-possibilities are much bigger, it's limited to USB devices only. This is
-also why it resides in the drivers/usb subdirectory.
-
-  The center of the input drivers is the input.o module, which must be
-loaded before any other of the input modules - it serves as a way of
-communication between two groups of modules:
-
-1.1 Device drivers
-~~~~~~~~~~~~~~~~~~
-  These modules talk to the hardware (for example via USB), and provide
-events (keystrokes, mouse movements) to the input.o module.
-
-1.2 Event handlers
-~~~~~~~~~~~~~~~~~~
-  These modules get events from input.o and pass them where needed via
-various interfaces - keystrokes to the kernel, mouse movements via a
-simulated PS/2 interface to GPM and X and so on.
-
-2. Simple Usage
-~~~~~~~~~~~~~~~
-  For the most usual configuration, with one USB mouse and one USB keyboard,
-you'll have to load the following modules (or have them built in to the
-kernel):
-
-	input.o
-	mousedev.o
-	keybdev.o
-	usbcore.o
-	usb-[uo]hci.o
-	hid.o
-
-  After this, the USB keyboard will work straight away, and the USB mouse
-will be available as a character device on major 13, minor 63:
-
-	crw-r--r--   1 root     root      13,  63 Mar 28 22:45 mice
-
-  This device, has to be created, unless you use devfs, in which case it's
-created automatically. The commands to do that are:
-
-	cd /dev
-	mkdir input
-	mknod input/mice c 13 63
-
-  After that you have to point GPM (the textmode mouse cut&paste tool) and
-XFree to this device to use it - GPM should be called like:
-
-	gpm -t ps2 -m /dev/input/mice
-
-  And in X:
-
-	Section "Pointer"
-	    Protocol    "ImPS/2"
-	    Device      "/dev/input/mice"
-	    ZAxisMapping 4 5
-	EndSection
-
-  When you do all of the above, you can use your USB mouse and keyboard.
-
-3. Detailed Description
-~~~~~~~~~~~~~~~~~~~~~~~
-3.1 Device drivers
-~~~~~~~~~~~~~~~~~~
-  Device drivers are the modules that generate events. The events are
-however not useful without being handled, so you also will need to use some
-of the modules from section 3.2.
-
-3.1.1 hid.c
-~~~~~~~~~~~
-  Hid.c is the largest and most complex driver of the whole suite. It
-handles all HID devices, and because there is a very wide variety of them,
-and because the USB HID specification isn't simple, it needs to be this big.
-
-  Currently, it handles USB mice, joysticks, gamepads, steering wheels
-keyboards, trackballs and digitizers.
-
- However, USB uses HID also for monitor controls, speaker controls, UPSs,
-LCDs and many other purposes.
-
- The monitor and speaker controls should be easy to add to the hid/input
-interface, but for the UPSs and LCDs it doesn't make much sense. The driver
-doesn't support these yet, and a new, non-event interface should be designed
-for them. If you have any of these devices (I don't), feel free to design
-something and if it's good, it'll get into the driver.
-
-  The usage of the hid.o module is very simple, it takes no parameters,
-detects everything automatically and when a HID device is inserted, it
-detects it appropriately.
-
-  However, because the devices vary wildly, you might happen to have a
-device that doesn't work well. In that case #define DEBUG at the beginning
-of hid.c and send me the syslog traces.
-
-3.1.2 usbmouse.c
-~~~~~~~~~~~~~~~~
-  For embedded systems, for mice with broken HID descriptors and just any
-other use when the big hid.c wouldn't be a good choice, there is the
-usbmouse.c driver. It handles USB mice only. It uses a simpler HIDBP
-protocol. This also means the mice must support this simpler protocol. Not
-all do. If you don't have any strong reason to use this module, use hid.c
-instead.
-
-3.1.3 usbkbd.c
-~~~~~~~~~~~~~~
-  Much like usbmouse.c, this module talks to keyboards with a simplified
-HIDBP protocol. It's smaller, but doesn't support any extra special keys.
-Use hid.c instead if there isn't any special reason to use this.
-
-3.1.4 wacom.c
-~~~~~~~~~~~~~
-  This is a driver for Wacom Graphire and Intuos tablets. Not for Wacom
-PenPartner, that one is handled by the HID driver. Although the Intuos and
-Graphire tablets claim that they are HID tablets as well, they are not and
-thus need this specific driver.
-
-3.1.5 wmforce.c
-~~~~~~~~~~~~~~~
-  A driver for the Logitech WingMan Force joysticks, when connected via the
-USB port. It works quite well, but there is no force feedback support yet,
-because the interface to do that is a trade secret of Immersion Corp, and
-even Logitech can't disclose it.
-
-  Support for Logitech WingMan Force Wheel isn't present in this driver, but
-if someone has the device, and is willing to cooperate, it should be a
-matter of a couple days to add it.
-
-3.2 Event handlers
-~~~~~~~~~~~~~~~~~~
-  Event handlers distribute the events from the devices to userland and
-kernel, as needed.
-
-3.2.1 keybdev.c
-~~~~~~~~~~~~~~~
-  Keybdev is currently a rather ugly hack that translates the input events
-into architecture-specific keyboard raw mode (Xlated AT Set2 on x86), and
-passes them into the handle_scancode function of the keyboard.c module. This
-works well enough on all architectures that keybdev can generate rawmode on,
-other architectures can be added to it.
-
-  The right way would be to pass the events to keyboard.c directly, best if
-keyboard.c would itself be an event handler. This is done in the input
-patch, available on the webpage mentioned below.
-
-3.2.2 mousedev.c
-~~~~~~~~~~~~~~~~
-  Mousedev is also a hack to make programs that use mouse input work. It
-takes events from either mice or digitizers/tablets and makes a PS/2-style
-(a la /dev/psaux) mouse device available to the userland. Ideally, the
-programs could use a more reasonable interface, for example evdev.c
-
-  Mousedev devices in /dev/input (as shown above) are:
-
-	crw-r--r--   1 root     root      13,  32 Mar 28 22:45 mouse0
-	crw-r--r--   1 root     root      13,  33 Mar 29 00:41 mouse1
-	crw-r--r--   1 root     root      13,  34 Mar 29 00:41 mouse2
-	crw-r--r--   1 root     root      13,  35 Apr  1 10:50 mouse3
-	...
-	...
-	crw-r--r--   1 root     root      13,  62 Apr  1 10:50 mouse30
-	crw-r--r--   1 root     root      13,  63 Apr  1 10:50 mice
-
-Each 'mouse' device is assigned to a single mouse or digitizer, except the last
-one - 'mice'. This single character device is shared by all mice and
-digitizers, and even if none are connected, the device is present.  This is
-useful for hotplugging USB mice, so that programs can open the device even when
-no mice are present.
-
-  CONFIG_INPUT_MOUSEDEV_SCREEN_[XY] in the kernel configuration are the size
-of your screen (in pixels) in XFree86. This is needed if you want to use
-your digitizer in X, because it's movement is sent to X via a virtual PS/2
-mouse and thus needs to be scaled accordingly. These values won't be used if
-you use a mouse only.
-
-  Mousedev will generate either PS/2, ImPS/2 (Microsoft IntelliMouse) or
-GenPS/2 (Genius NetMouse/NetScroll) protocols, depending on what the program
-reading the data wishes. You can set GPM and X to any of these. You'll need
-ImPS/2 if you want to make use of a wheel on a USB mouse and GenPS/2 if you
-want to use extra (up to 5) buttons. I'm not sure how much is GenPS/2 supported
-in X, though.
-
-3.2.3 joydev.c
-~~~~~~~~~~~~~~
-  Joydev implements v0.x and v1.x Linux joystick api, much like
-drivers/char/joystick/joystick.c. See joystick-api.txt in the Documentation
-subdirectory for details. Joydev does it on top of the input subsystem,
-though. As soon as any USB joystick is connected, it can be accessed in
-/dev/input on:
-
-	crw-r--r--   1 root     root      13,   0 Apr  1 10:50 js0
-	crw-r--r--   1 root     root      13,   1 Apr  1 10:50 js1
-	crw-r--r--   1 root     root      13,   2 Apr  1 10:50 js2
-	crw-r--r--   1 root     root      13,   3 Apr  1 10:50 js3
-	...
-
-And so on up to js31.
-
-3.2.4 evdev.c
-~~~~~~~~~~~~~
-  Evdev is the generic input event interface. It passes the events generated
-in the kernel straight to the program, with timestamps. The API is still
-evolving, but should be usable now. It's described in section 5.
-
-  This should be the way for GPM and X to get keyboard and mouse mouse
-events. It allows for multihead in X without any specific multihead kernel
-support. The event codes are the same on all architectures and are hardware
-independent.
-
-  The devices are in /dev/input:
-
-	crw-r--r--   1 root     root      13,  64 Apr  1 10:49 event0
-	crw-r--r--   1 root     root      13,  65 Apr  1 10:50 event1
-	crw-r--r--   1 root     root      13,  66 Apr  1 10:50 event2
-	crw-r--r--   1 root     root      13,  67 Apr  1 10:50 event3
-	...
-
-3. Contacts
-~~~~~~~~~~~
-  This effort has it's home page at:
-
-	http://www.suse.cz/development/input/
-
-You'll find both the latest HID driver and the complete Input driver there
-as well as information how to access the CVS repository for latest revisions
-of the drivers.
-
-
-  There is also a mailing list for this:
-
-	majordomo@atrey.karlin.mff.cuni.cz
-
-Send "subscribe linux-input" to subscribe to it.
-
-4. Verifying if it works
-~~~~~~~~~~~~~~~~~~~~~~~~
-  Typing a couple keys on the keyboard should be enough to check that a USB
-keyboard works and is correctly connected to the kernel keyboard driver.
-
-  Doing a cat /dev/input/mouse0 (c, 13, 32) will verify that a mouse is also
-emulated, characters should appear if you move it.
-
-  You can test the joystick emulation with the 'jstest' utility, available
-in the joystick package (see Documentation/joystick.txt).
-
-  You can test the event devics with the 'evtest' utility available on the
-input driver homepage (see the URL above).
-
-5. Event interface
-~~~~~~~~~~~~~~~~~~
-  Should you want to add event device support into any application (X, gpm,
-svgalib ...) I <vojtech@suse.cz> will be happy to provide you any help I
-can. Here goes a description of the current state of things, which is going
-to be extended, but not changed incompatibly as time goes:
-
-  You can use blocking and nonblocking reads, also select() on the
-/dev/input/eventX devices, and you'll always get a whole number of input
-events on a read. Their layout is:
-
-struct input_event {
-	struct timeval time;
-	unsigned short type;
-	unsigned short code;
-	unsigned int value;
-};
-
-  'time' is the timestamp, it returns the time at which the event happened.
-Type is for example EV_REL for relative movement, REL_KEY for a keypress or
-release. More types are defined in include/linux/input.h.
-
-  'code' is event code, for example REL_X or KEY_BACKSPACE, again a complete
-list is in include/linux/input.h.
-
-  'value' is the value the event carries. Either a relative change for
-EV_REL, absolute new value for EV_ABS (joysticks ...), or 0 for EV_KEY for
-release, 1 for keypress and 2 for autorepeat.
diff -u --recursive --new-file v2.4.9/linux/Documentation/watchdog.txt linux/Documentation/watchdog.txt
--- v2.4.9/linux/Documentation/watchdog.txt	Fri Aug 11 15:57:57 2000
+++ linux/Documentation/watchdog.txt	Fri Sep  7 09:28:38 2001
@@ -11,6 +11,7 @@
 	ICS	WDT501-P (no fan tachometer)
 	ICS	WDT500-P
 	Software Only
+	SA1100 Internal Watchdog
 	Berkshire Products PC Watchdog Revision A & C (by Ken Hollis)
 
 
@@ -35,6 +36,9 @@
 The wdt card cannot be safely probed for. Instead you need to pass
 wdt=ioaddr,irq as a boot parameter - eg "wdt=0x240,11".
 
+The SA1100 watchdog module can be configured with the "sa1100_margin"
+commandline argument which specifies timeout value in seconds.
+
 The i810 TCO watchdog modules can be configured with the "i810_margin"
 commandline argument which specifies the counter initial value. The counter
 is decremented every 0.6 seconds and default to 50 (30 seconds). Values can
@@ -47,15 +51,15 @@
 
 Features
 --------
-		WDT501P		WDT500P		Software	Berkshire	i810 TCO
-Reboot Timer	   X               X                X		    X               X
-External Reboot	   X	           X                o		    o               o
-I/O Port Monitor   o		   o		    o		    X               o
-Temperature	   X		   o		    o               X               o
-Fan Speed          X		   o		    o               o               o
-Power Under	   X               o                o               o               o
-Power Over         X               o                o               o               o
-Overheat           X               o                o               o               o
+		WDT501P		WDT500P		Software	Berkshire	i810 TCO	SA1100WD
+Reboot Timer	   X               X                X		    X               X               X
+External Reboot	   X	           X                o		    o               o               X
+I/O Port Monitor   o		   o		    o		    X               o               o
+Temperature	   X		   o		    o               X               o               o
+Fan Speed          X		   o		    o               o               o               o
+Power Under	   X               o                o               o               o               o
+Power Over         X               o                o               o               o               o
+Overheat           X               o                o               o               o               o
 
 The external event interfaces on the WDT boards are not currently supported.
 Minor numbers are however allocated for it.
diff -u --recursive --new-file v2.4.9/linux/MAINTAINERS linux/MAINTAINERS
--- v2.4.9/linux/MAINTAINERS	Mon Aug 27 12:41:37 2001
+++ linux/MAINTAINERS	Fri Sep 14 14:26:36 2001
@@ -81,6 +81,12 @@
 L:	linux-net@vger.kernel.org
 S:	Maintained
 
+53C700 AND 53C700-66 SCSI DRIVER
+P:	James E.J. Bottomley
+M:	James.Bottomley@HansenPartnership.com
+L:	linux-scsi@vger.kernel.org
+S:	Maintained
+
 6PACK NETWORK DRIVER FOR AX.25
 P:	Andreas Koensgen
 M:	ajk@iehk.rwth-aachen.de
@@ -182,9 +188,9 @@
 M:	linux@treblig.org
 S:	Maintained
 
-ARM PORT
+ARM/STRONGARM110 PORT
 P:	Russell King
-M:	linux@arm.linux.org.uk
+M:	rmk@arm.linux.org.uk
 L:	linux-arm-kernel@lists.arm.linux.org.uk
 W:	http://www.arm.linux.org.uk/
 S:	Maintained
@@ -337,7 +343,7 @@
 
 CYBERPRO FB DRIVER
 P:	Russell King
-M:	linux@arm.linux.org.uk
+M:	rmk@arm.linux.org.uk
 W:	http://www.arm.linux.org.uk/
 S:	Maintained
 
@@ -689,8 +695,8 @@
 S:	Orphan
 
 IEEE 1394 OHCI DRIVER
-P:	Sebastien Rougeaux
-M:	sebastien.rougeaux@anu.edu.au
+P:	Ben Collins
+M:	bcollins@debian.org
 L:	linux1394-devel@lists.sourceforge.net
 S:	Maintained
 
@@ -774,6 +780,13 @@
 W:	http://www.developer.axis.com/software/jffs/
 S:	Maintained
 
+JOURNALLING FLASH FILE SYSTEM V2 (JFFS2)
+P:	David Woodhouse
+M:	dwmw2@infradead.org
+L:	jffs-dev@axis.com
+W:	http://sources.redhat.com/jffs2/
+S:	Maintained
+
 JOYSTICK DRIVER
 P:	Vojtech Pavlik
 M:	vojtech@suse.cz
@@ -823,6 +836,12 @@
 L:	linux-x25@vger.kernel.org
 S:	Maintained
 
+LASI 53c700 driver for PARISC
+P:	James E.J. Bottomley
+M:	James.Bottomley@HansenPartnership.com
+L:	linux-scsi@vger.kernel.org
+S:	Maintained
+
 LINUX FOR IBM pSERIES (RS/6000)
 P:	Paul Mackerras
 M:	paulus@au.ibm.com
@@ -902,9 +921,9 @@
 
 MIPS
 P:	Ralf Baechle
-M:	ralf@gnu.ai.mit.edu
-W:	http://lena.fnet.fr/
-L:	linux-mips@fnet.fr
+M:	ralf@gnu.org
+W:	http://oss.sgi.com/mips/mips-howto.html
+L:	linux-mips@oss.sgi.com
 S:	Maintained
 
 MISCELLANEOUS MCA-SUPPORT
@@ -948,6 +967,12 @@
 L:	linware@sh.cvut.cz
 S:	Maintained
 
+NCR DUAL 700 SCSI DRIVER (MICROCHANNEL)
+P:	James E.J. Bottomley
+M:	James.Bottomley@HansenPartnership.com
+L:	linux-scsi@vger.kernel.org
+S:	Maintained
+
 NETFILTER
 P:	Rusty Russell
 M:	rusty@rustcorp.com.au
@@ -1250,6 +1275,9 @@
 SOFTWARE RAID (Multiple Disks) SUPPORT
 P:	Ingo Molnar
 M:	mingo@redhat.com
+P:	Neil Brown
+M:	neilb@cse.unsw.edu.au
+L:	linux-raid@vger.kernel.org
 S:	Maintained
 
 SONIC NETWORK DRIVER
@@ -1413,15 +1441,6 @@
 W:	http://www.kernel.dk
 S:	Maintained
 
-USB SUBSYSTEM
-P:	Johannes Erdfelt
-M:	jerdfelt@valinux.com
-M:	johannes@erdfelt.com
-L:	linux-usb-users@lists.sourceforge.net
-L:	linux-usb-devel@lists.sourceforge.net
-W:	http://www.linux-usb.org
-S:	Supported
-
 USB ACM DRIVER
 P:	Vojtech Pavlik
 M:	vojtech@suse.cz
@@ -1437,6 +1456,13 @@
 S:	Maintained
 W:	http://www.kroah.com/linux-usb/
 
+USB CDC ETHERNET DRIVER
+P:	Brad Hards
+M:	bhards@bigpond.net.au
+L:	linux-usb-users@lists.sourceforge.net
+L:	linux-usb-devel@lists.sourceforge.net
+S:	Maintained
+
 USB HID/HIDBP/INPUT DRIVERS
 P:	Vojtech Pavlik
 M:	vojtech@suse.cz
@@ -1453,6 +1479,21 @@
 L:	linux-usb-devel@lists.sourceforge.net
 S:	Maintained
 
+USB KAWASAKI LSI DRIVER
+P:	Brad Hards
+M:	bhards@bigpond.net.au
+L:	linux-usb-users@lists.sourceforge.net
+L:	linux-usb-devel@lists.sourceforge.net
+S:	Maintained
+
+USB MASS STORAGE DRIVER
+P:	Matthew Dharm
+M:	mdharm-usb@one-eyed-alien.net
+L:	linux-usb-users@lists.sourceforge.net
+L:	linux-usb-devel@lists.sourceforge.net
+S:	Maintained
+W:	http://www.one-eyed-alien.net/~mdharm/linux-usb/
+
 USB OHCI DRIVER
 P:	Roman Weissgaerber
 M:	weissg@vienna.at
@@ -1482,21 +1523,21 @@
 L:	linux-usb-devel@lists.sourceforge.net
 S:	Supported
 
-USB SERIAL DIGI ACCELEPORT DRIVER
-P:	Peter Berger and Al Borchers
-M:	pberger@brimson.com
-M:	alborchers@steinerpoint.com
+USB SE401 DRIVER
+P:	Jeroen Vreeken
+M:	pe1rxq@amsat.org
 L:	linux-usb-users@lists.sourceforge.net
 L:	linux-usb-devel@lists.sourceforge.net
+W:	http://www.chello.nl/~j.vreeken/se401/
 S:	Maintained
 
-USB SERIAL KEYSPAN DRIVER
-P:	Hugh Blemings
-M:	hugh@misc.nu
+USB SERIAL DIGI ACCELEPORT DRIVER
+P:	Peter Berger and Al Borchers
+M:	pberger@brimson.com
+M:	alborchers@steinerpoint.com
 L:	linux-usb-users@lists.sourceforge.net
 L:	linux-usb-devel@lists.sourceforge.net
 S:	Maintained
-W:	http://misc.nu/hugh/keyspan/
 
 USB SERIAL DRIVER
 P:	Greg Kroah-Hartman
@@ -1514,6 +1555,12 @@
 L:	linux-usb-devel@lists.sourceforge.net
 S:	Maintained
 
+USB SERIAL CYBERJACK PINPAD/E-COM DRIVER
+M:	linux-usb@sii.li
+L:	linux-usb-users@lists.sourceforge.net
+L:	linux-usb-devel@lists.sourceforge.net
+S:	Supported
+
 USB SERIAL EMPEG EMPEG-CAR MARK I/II DRIVER
 P:	Gary Brubaker
 M:	xavyer@ix.netcom.com
@@ -1521,19 +1568,22 @@
 L:	linux-usb-devel@lists.sourceforge.net
 S:	Maintained
 
-USB SERIAL CYBERJACK PINPAD/E-COM DRIVER
-M:  linux-usb@sii.li
-L:  linux-usb-users@lists.sourceforge.net
-L:  linux-usb-devel@lists.sourceforge.net
-S:  Supported
-
-USB MASS STORAGE DRIVER
-P:	Matthew Dharm
-M:	mdharm-usb@one-eyed-alien.net
+USB SERIAL KEYSPAN DRIVER
+P:	Hugh Blemings
+M:	hugh@misc.nu
 L:	linux-usb-users@lists.sourceforge.net
 L:	linux-usb-devel@lists.sourceforge.net
 S:	Maintained
-W:	http://www.one-eyed-alien.net/~mdharm/linux-usb/
+W:	http://misc.nu/hugh/keyspan/
+
+USB SUBSYSTEM
+P:	Johannes Erdfelt
+M:	jerdfelt@valinux.com
+M:	johannes@erdfelt.com
+L:	linux-usb-users@lists.sourceforge.net
+L:	linux-usb-devel@lists.sourceforge.net
+W:	http://www.linux-usb.org
+S:	Supported
 
 USB UHCI DRIVER
 P:	Georg Acher
diff -u --recursive --new-file v2.4.9/linux/Makefile linux/Makefile
--- v2.4.9/linux/Makefile	Mon Aug 27 12:41:37 2001
+++ linux/Makefile	Fri Sep 21 11:00:39 2001
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
-SUBLEVEL = 9
-EXTRAVERSION =
+SUBLEVEL = 10
+EXTRAVERSION =-pre14
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
@@ -146,6 +146,7 @@
 DRIVERS-$(CONFIG_ARCNET) += drivers/net/arcnet/arcnetdrv.o
 DRIVERS-$(CONFIG_ATM) += drivers/atm/atm.o
 DRIVERS-$(CONFIG_IDE) += drivers/ide/idedriver.o
+DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a
 DRIVERS-$(CONFIG_SCSI) += drivers/scsi/scsidrv.o
 DRIVERS-$(CONFIG_FUSION_BOOT) += drivers/message/fusion/fusion.o
 DRIVERS-$(CONFIG_IEEE1394) += drivers/ieee1394/ieee1394drv.o
@@ -197,6 +198,11 @@
 	drivers/zorro/devlist.h drivers/zorro/gen-devlist \
 	drivers/sound/bin2hex drivers/sound/hex2hex \
 	drivers/atm/fore200e_mkfirm drivers/atm/{pca,sba}*{.bin,.bin1,.bin2} \
+	drivers/scsi/aic7xxx/aicasm/aicasm_gram.c \
+	drivers/scsi/aic7xxx/aicasm/aicasm_scan.c \
+	drivers/scsi/aic7xxx/aicasm/y.tab.h \
+	drivers/scsi/aic7xxx/aicasm/aicasm \
+	drivers/scsi/53c700-mem.c \
 	net/khttpd/make_times_h \
 	net/khttpd/times.h \
 	submenu*
@@ -223,7 +229,9 @@
 	.menuconfig.log \
 	include/asm \
 	.hdepend scripts/mkdep scripts/split-include scripts/docproc \
-	$(TOPDIR)/include/linux/modversions.h
+	$(TOPDIR)/include/linux/modversions.h \
+	kernel.spec
+
 # directories removed with 'make mrproper'
 MRPROPER_DIRS = \
 	include/config \
@@ -247,7 +255,7 @@
 boot: vmlinux
 	@$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C arch/$(ARCH)/boot
 
-vmlinux: $(CONFIGURATION) init/main.o init/version.o linuxsubdirs
+vmlinux: include/linux/version.h $(CONFIGURATION) init/main.o init/version.o linuxsubdirs
 	$(LD) $(LINKFLAGS) $(HEAD) init/main.o init/version.o \
 		--start-group \
 		$(CORE_FILES) \
@@ -292,11 +300,7 @@
 $(TOPDIR)/include/linux/compile.h: include/linux/compile.h
 
 newversion:
-	@if [ ! -f .version ]; then \
-		echo 1 > .version; \
-	else \
-		expr 0`cat .version` + 1 > .version; \
-	fi
+	. scripts/mkversion > .version
 
 include/linux/compile.h: $(CONFIGURATION) include/linux/version.h newversion
 	@echo -n \#define UTS_VERSION \"\#`cat .version` > .ver
@@ -418,7 +422,8 @@
 	$(MAKE) -C Documentation/DocBook mrproper
 
 distclean: mrproper
-	rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
+	rm -f core `find . \( -not -type d \) -and \
+		\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
 		-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
 		-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags
 
@@ -501,3 +506,30 @@
 
 scripts/split-include: scripts/split-include.c
 	$(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
+
+#
+# RPM target
+#
+#	If you do a make spec before packing the tarball you can rpm -ta it
+#
+spec:
+	. scripts/mkspec >kernel.spec
+
+#
+#	Build a tar ball, generate an rpm from it and pack the result
+#	There arw two bits of magic here
+#	1) The use of /. to avoid tar packing just the symlink
+#	2) Removing the .dep files as they have source paths in them that
+#	   will become invalid
+#
+rpm:	clean spec
+	find . \( -size 0 -o -name .depend -o -name .hdepend \) -type f -print | xargs rm -f
+	set -e; \
+	cd $(TOPDIR)/.. ; \
+	ln -sf $(TOPDIR) $(KERNELPATH) ; \
+	tar -cvz --exclude CVS -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \
+	rm $(KERNELPATH) ; \
+	cd $(TOPDIR) ; \
+	. scripts/mkversion > .version ; \
+	rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
+	rm $(TOPDIR)/../$(KERNELPATH).tar.gz
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/kernel/alpha_ksyms.c linux/arch/alpha/kernel/alpha_ksyms.c
--- v2.4.9/linux/arch/alpha/kernel/alpha_ksyms.c	Mon Aug 27 12:41:37 2001
+++ linux/arch/alpha/kernel/alpha_ksyms.c	Thu Sep 13 15:21:32 2001
@@ -77,6 +77,14 @@
 EXPORT_SYMBOL(_writeb);
 EXPORT_SYMBOL(_writew);
 EXPORT_SYMBOL(_writel);
+EXPORT_SYMBOL(___raw_readb); 
+EXPORT_SYMBOL(___raw_readw); 
+EXPORT_SYMBOL(___raw_readl); 
+EXPORT_SYMBOL(___raw_readq); 
+EXPORT_SYMBOL(___raw_writeb); 
+EXPORT_SYMBOL(___raw_writew); 
+EXPORT_SYMBOL(___raw_writel); 
+EXPORT_SYMBOL(___raw_writeq); 
 EXPORT_SYMBOL(_memcpy_fromio);
 EXPORT_SYMBOL(_memcpy_toio);
 EXPORT_SYMBOL(_memset_c_io);
@@ -200,6 +208,8 @@
 EXPORT_SYMBOL(cpu_data);
 EXPORT_SYMBOL(__cpu_number_map);
 EXPORT_SYMBOL(smp_num_cpus);
+EXPORT_SYMBOL(smp_call_function);
+EXPORT_SYMBOL(smp_call_function_on_cpu);
 EXPORT_SYMBOL(global_irq_holder);
 EXPORT_SYMBOL(__global_cli);
 EXPORT_SYMBOL(__global_sti);
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/kernel/core_cia.c linux/arch/alpha/kernel/core_cia.c
--- v2.4.9/linux/arch/alpha/kernel/core_cia.c	Tue May 22 16:29:57 2001
+++ linux/arch/alpha/kernel/core_cia.c	Thu Sep 13 15:21:32 2001
@@ -352,13 +352,15 @@
 	   so use them and read at window 3 base exactly 4 times. Reading
 	   more sometimes makes the chip crazy.  -ink */
 
-	bus_addr = cia_ioremap(CIA_BROKEN_TBIA_BASE);
+	bus_addr = cia_ioremap(CIA_BROKEN_TBIA_BASE, 32768 * 4);
 
 	cia_readl(bus_addr + 0x00000);
 	cia_readl(bus_addr + 0x08000);
 	cia_readl(bus_addr + 0x10000);
 	cia_readl(bus_addr + 0x18000);
 
+	cia_iounmap(bus_addr);
+
 	/* Restore normal PCI operation.  */
 	mb();
 	*(vip)CIA_IOC_CIA_CTRL = ctrl;
@@ -396,6 +398,7 @@
 	struct pci_iommu_arena *arena = pci_isa_hose->sg_isa;
 	int ctrl, addr0, tag0, pte0, data0;
 	int temp, use_tbia_try2 = 0;
+	unsigned long bus_addr;
 
 	/* pyxis -- tbia is broken */
 	if (pci_isa_hose->dense_io_base)
@@ -429,6 +432,9 @@
 	*(vip)CIA_IOC_TBn_PAGEm(0,3) = 0;
 	mb();
 
+	/* Get a usable bus address */
+	bus_addr = cia_ioremap(addr0, 8*PAGE_SIZE);
+
 	/* First, verify we can read back what we've written.  If
 	   this fails, we can't be sure of any of the other testing
 	   we're going to do, so bail.  */
@@ -464,7 +470,7 @@
 	mcheck_expected(0) = 1;
 	mcheck_taken(0) = 0;
 	mb();
-	temp = cia_readl(cia_ioremap(addr0));
+	temp = cia_readl(bus_addr);
 	mb();
 	mcheck_expected(0) = 0;
 	mb();
@@ -501,7 +507,7 @@
 	mcheck_expected(0) = 1;
 	mcheck_taken(0) = 0;
 	mb();
-	temp = cia_readl(cia_ioremap(addr0 + 4*PAGE_SIZE));
+	temp = cia_readl(bus_addr + 4*PAGE_SIZE);
 	mb();
 	mcheck_expected(0) = 0;
 	mb();
@@ -525,7 +531,7 @@
 	mcheck_expected(0) = 1;
 	mcheck_taken(0) = 0;
 	mb();
-	temp = cia_readl(cia_ioremap(addr0 + 5*PAGE_SIZE));
+	temp = cia_readl(bus_addr + 5*PAGE_SIZE);
 	mb();
 	mcheck_expected(0) = 0;
 	mb();
@@ -549,7 +555,7 @@
 	mcheck_expected(0) = 1;
 	mcheck_taken(0) = 0;
 	mb();
-	temp = cia_readl(cia_ioremap(addr0 + 6*PAGE_SIZE));
+	temp = cia_readl(bus_addr + 6*PAGE_SIZE);
 	mb();
 	mcheck_expected(0) = 0;
 	mb();
@@ -575,6 +581,9 @@
 	alpha_mv.mv_pci_tbi(arena->hose, 0, -1);
 
 exit:
+	/* unmap the bus addr */
+	cia_iounmap(bus_addr);
+
 	/* Restore normal PCI operation.  */
 	mb();
 	*(vip)CIA_IOC_CIA_CTRL = ctrl;
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/kernel/core_irongate.c linux/arch/alpha/kernel/core_irongate.c
--- v2.4.9/linux/arch/alpha/kernel/core_irongate.c	Fri Mar  2 11:12:07 2001
+++ linux/arch/alpha/kernel/core_irongate.c	Thu Sep 13 15:21:32 2001
@@ -30,6 +30,8 @@
 
 #undef DEBUG_IRONGATE 		/* define to enable verbose Irongate debug */
 
+#define IRONGATE_DEFAULT_AGP_APER_SIZE	(256*1024*1024) /* 256MB */
+
 /*
  * BIOS32-style PCI interface:
  */
@@ -374,6 +376,14 @@
 	irongate_register_dump(__FUNCTION__);
 
 	/*
+	 * HACK: set AGP aperture size to 256MB.
+	 * This should really be changed during PCI probe, when the
+	 * size of the aperture the AGP card wants is known.
+	 */
+	printk("irongate_init_arch: AGPVA was 0x%x\n", IRONGATE0->agpva);
+	IRONGATE0->agpva = (IRONGATE0->agpva & ~0x0000000f) | 0x00000007;
+
+	/*
 	 * Create our single hose.
 	 */
 
@@ -396,4 +406,202 @@
 	hose->sg_isa = hose->sg_pci = NULL;
 	__direct_map_base = 0;
 	__direct_map_size = 0xffffffff;
+}
+
+/*
+ * IO map and AGP support
+ */
+#include <linux/vmalloc.h>
+#include <asm/pgalloc.h>
+
+static inline void 
+irongate_remap_area_pte(pte_t * pte, unsigned long address, unsigned long size, 
+		     unsigned long phys_addr, unsigned long flags)
+{
+	unsigned long end;
+
+	address &= ~PMD_MASK;
+	end = address + size;
+	if (end > PMD_SIZE)
+		end = PMD_SIZE;
+	if (address >= end)
+		BUG();
+	do {
+		if (!pte_none(*pte)) {
+			printk("irongate_remap_area_pte: page already exists\n");
+			BUG();
+		}
+		set_pte(pte, 
+			mk_pte_phys(phys_addr, 
+				    __pgprot(_PAGE_VALID | _PAGE_ASM | 
+					     _PAGE_KRE | _PAGE_KWE | flags)));
+		address += PAGE_SIZE;
+		phys_addr += PAGE_SIZE;
+		pte++;
+	} while (address && (address < end));
+}
+
+static inline int 
+irongate_remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size, 
+		     unsigned long phys_addr, unsigned long flags)
+{
+	unsigned long end;
+
+	address &= ~PGDIR_MASK;
+	end = address + size;
+	if (end > PGDIR_SIZE)
+		end = PGDIR_SIZE;
+	phys_addr -= address;
+	if (address >= end)
+		BUG();
+	do {
+		pte_t * pte = pte_alloc(&init_mm, pmd, address);
+		if (!pte)
+			return -ENOMEM;
+		irongate_remap_area_pte(pte, address, end - address, 
+				     address + phys_addr, flags);
+		address = (address + PMD_SIZE) & PMD_MASK;
+		pmd++;
+	} while (address && (address < end));
+	return 0;
+}
+
+static int
+irongate_remap_area_pages(unsigned long address, unsigned long phys_addr,
+		       unsigned long size, unsigned long flags)
+{
+	pgd_t * dir;
+	unsigned long end = address + size;
+
+	phys_addr -= address;
+	dir = pgd_offset(&init_mm, address);
+	flush_cache_all();
+	if (address >= end)
+		BUG();
+	do {
+		pmd_t *pmd;
+		pmd = pmd_alloc(&init_mm, dir, address);
+		if (!pmd)
+			return -ENOMEM;
+		if (irongate_remap_area_pmd(pmd, address, end - address,
+					 phys_addr + address, flags))
+			return -ENOMEM;
+		address = (address + PGDIR_SIZE) & PGDIR_MASK;
+		dir++;
+	} while (address && (address < end));
+	return 0;
+}
+
+#include <linux/agp_backend.h>
+#include <linux/agpgart.h>
+
+#define GET_PAGE_DIR_OFF(addr) (addr >> 22)
+#define GET_PAGE_DIR_IDX(addr) (GET_PAGE_DIR_OFF(addr))
+
+#define GET_GATT_OFF(addr) ((addr & 0x003ff000) >> 12) 
+#define GET_GATT(addr) (gatt_pages[GET_PAGE_DIR_IDX(addr)])
+
+unsigned long
+irongate_ioremap(unsigned long addr, unsigned long size)
+{
+	struct vm_struct *area;
+	unsigned long vaddr;
+	unsigned long baddr, last;
+	u32 *mmio_regs, *gatt_pages, *cur_gatt, pte;
+	unsigned long gart_bus_addr, gart_aper_size;
+
+	gart_bus_addr = (unsigned long)IRONGATE0->bar0 &
+			PCI_BASE_ADDRESS_MEM_MASK; 
+
+	if (!gart_bus_addr) /* FIXME - there must be a better way!!! */
+		return addr + IRONGATE_MEM;
+
+	gart_aper_size = IRONGATE_DEFAULT_AGP_APER_SIZE; /* FIXME */
+
+	/* 
+	 * Check for within the AGP aperture...
+	 */
+	do {
+		/*
+		 * Check the AGP area
+		 */
+		if (addr >= gart_bus_addr && addr + size - 1 < 
+		    gart_bus_addr + gart_aper_size)
+			break;
+
+		/*
+		 * Not found - assume legacy ioremap
+		 */
+		return addr + IRONGATE_MEM;
+	} while(0);
+
+	mmio_regs = (u32 *)(((unsigned long)IRONGATE0->bar1 &
+			PCI_BASE_ADDRESS_MEM_MASK) + IRONGATE_MEM);
+
+	gatt_pages = (u32 *)(phys_to_virt(mmio_regs[1])); /* FIXME */
+
+	/*
+	 * Adjust the limits (mappings must be page aligned)
+	 */
+	if (addr & ~PAGE_MASK) {
+		printk("AGP ioremap failed... addr not page aligned (0x%lx)\n",
+		       addr);
+		return addr + IRONGATE_MEM;
+	}
+	last = addr + size - 1;
+	size = PAGE_ALIGN(last) - addr;
+
+#if 0
+	printk("irongate_ioremap(0x%lx, 0x%lx)\n", addr, size);
+	printk("irongate_ioremap:  gart_bus_addr  0x%lx\n", gart_bus_addr);
+	printk("irongate_ioremap:  gart_aper_size 0x%lx\n", gart_aper_size);
+	printk("irongate_ioremap:  mmio_regs      %p\n", mmio_regs);
+	printk("irongate_ioremap:  gatt_pages     %p\n", gatt_pages);
+	
+	for(baddr = addr; baddr <= last; baddr += PAGE_SIZE)
+	{
+		cur_gatt = phys_to_virt(GET_GATT(baddr) & ~1);
+		pte = cur_gatt[GET_GATT_OFF(baddr)] & ~1;
+		printk("irongate_ioremap:  cur_gatt %p pte 0x%x\n",
+		       cur_gatt, pte);
+	}
+#endif
+
+	/*
+	 * Map it
+	 */
+	area = get_vm_area(size, VM_IOREMAP);
+	if (!area) return (unsigned long)NULL;
+
+	for(baddr = addr, vaddr = (unsigned long)area->addr; 
+	    baddr <= last; 
+	    baddr += PAGE_SIZE, vaddr += PAGE_SIZE)
+	{
+		cur_gatt = phys_to_virt(GET_GATT(baddr) & ~1);
+		pte = cur_gatt[GET_GATT_OFF(baddr)] & ~1;
+
+		if (irongate_remap_area_pages(VMALLOC_VMADDR(vaddr), 
+					   pte, PAGE_SIZE, 0)) {
+			printk("AGP ioremap: FAILED to map...\n");
+			vfree(area->addr);
+			return (unsigned long)NULL;
+		}
+	}
+
+	flush_tlb_all();
+
+	vaddr = (unsigned long)area->addr + (addr & ~PAGE_MASK);
+#if 0
+	printk("irongate_ioremap(0x%lx, 0x%lx) returning 0x%lx\n",
+	       addr, size, vaddr);
+#endif
+	return vaddr;
+}
+
+void
+irongate_iounmap(unsigned long addr)
+{
+	if (((long)addr >> 41) == -2)
+		return;	/* kseg map, nothing to do */
+	if (addr) return vfree((void *)(PAGE_MASK & addr)); 
 }
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/kernel/irq.c linux/arch/alpha/kernel/irq.c
--- v2.4.9/linux/arch/alpha/kernel/irq.c	Mon Aug 27 12:41:37 2001
+++ linux/arch/alpha/kernel/irq.c	Mon Sep 17 13:16:30 2001
@@ -38,7 +38,7 @@
 
 static void register_irq_proc(unsigned int irq);
 
-unsigned long irq_err_count;
+volatile unsigned long irq_err_count;
 
 /*
  * Special irq handlers.
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/kernel/irq_alpha.c linux/arch/alpha/kernel/irq_alpha.c
--- v2.4.9/linux/arch/alpha/kernel/irq_alpha.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/alpha/kernel/irq_alpha.c	Mon Sep 17 13:16:30 2001
@@ -18,8 +18,6 @@
 unsigned long __irq_attempt[NR_IRQS];
 #endif
 
-extern unsigned long irq_err_count;
-
 /* Hack minimum IPL during interrupt processing for broken hardware.  */
 #ifdef CONFIG_ALPHA_BROKEN_IRQ_MASK
 int __min_ipl;
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/kernel/machvec_impl.h linux/arch/alpha/kernel/machvec_impl.h
--- v2.4.9/linux/arch/alpha/kernel/machvec_impl.h	Wed Jun 21 22:30:59 2000
+++ linux/arch/alpha/kernel/machvec_impl.h	Thu Sep 13 15:21:32 2001
@@ -80,7 +80,8 @@
 	mv_writew:		CAT(low,_writew),			\
 	mv_writel:		CAT(low,_writel),			\
 	mv_writeq:		CAT(low,_writeq),			\
-	mv_ioremap:		CAT(low,_ioremap)			\
+	mv_ioremap:		CAT(low,_ioremap),			\
+	mv_iounmap:		CAT(low,_iounmap)			\
 
 #define IO(UP,low)							\
 	IO_LITE(UP,low),						\
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/kernel/pci-noop.c linux/arch/alpha/kernel/pci-noop.c
--- v2.4.9/linux/arch/alpha/kernel/pci-noop.c	Fri Mar  2 11:12:07 2001
+++ linux/arch/alpha/kernel/pci-noop.c	Thu Sep 13 15:21:32 2001
@@ -102,3 +102,38 @@
 	else
 		return -ENODEV;
 }
+/* stubs for the routines in pci_iommu.c */
+void *
+pci_alloc_consistent(struct pci_dev *pdev, long size, dma_addr_t *dma_addrp)
+{
+}
+void
+pci_free_consistent(struct pci_dev *pdev, long size, void *cpu_addr,
+		    dma_addr_t dma_addr)
+{
+}
+dma_addr_t
+pci_map_single(struct pci_dev *pdev, void *cpu_addr, long size,
+	       int direction)
+{
+}
+void
+pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, long size,
+		 int direction)
+{
+}
+int
+pci_map_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
+	   int direction)
+{
+}
+void
+pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
+	     int direction)
+{
+}
+int
+pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask)
+{
+	return 0;
+}
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/kernel/pci.c linux/arch/alpha/kernel/pci.c
--- v2.4.9/linux/arch/alpha/kernel/pci.c	Mon May 21 13:38:41 2001
+++ linux/arch/alpha/kernel/pci.c	Thu Sep 13 15:21:32 2001
@@ -76,6 +76,9 @@
 		dev->resource[3].end = dev->resource[3].start + 7;
 }
 
+static void __init
+quirk_cypress(struct pci_dev *dev)
+{
 /*
  * Notorious Cy82C693 chip. One of its numerous bugs: although
  * Cypress IDE controller doesn't support native mode, it has
@@ -85,31 +88,27 @@
  * and floppy controller. Ugh.
  * Fix that.
  */
-static void __init
-quirk_cypress_ide_ports(struct pci_dev *dev)
-{
-	if (dev->class >> 8 != PCI_CLASS_STORAGE_IDE)
+	if (dev->class >> 8 == PCI_CLASS_STORAGE_IDE) {
+		dev->resource[0].flags = 0;
+		dev->resource[1].flags = 0;
 		return;
-	dev->resource[0].flags = 0;
-	dev->resource[1].flags = 0;
-}
-
-static void __init
-quirk_vga_enable_rom(struct pci_dev *dev)
-{
-	/* If it's a VGA, enable its BIOS ROM at C0000.
-	   But if its a Cirrus 543x/544x DISABLE it, since
-	   enabling ROM disables the memory... */
-	if ((dev->class >> 8) == PCI_CLASS_DISPLAY_VGA &&
-	    (dev->vendor != PCI_VENDOR_ID_CIRRUS ||
-	     (dev->device < 0x00a0) || (dev->device > 0x00ac)))
-	{
-		u32 reg;
-
-		pci_read_config_dword(dev, dev->rom_base_reg, &reg);
-		reg |= PCI_ROM_ADDRESS_ENABLE;
-		pci_write_config_dword(dev, dev->rom_base_reg, reg);
-		dev->resource[PCI_ROM_RESOURCE].flags |= PCI_ROM_ADDRESS_ENABLE;
+	}
+/*
+ * Another "feature": Cypress bridge responds on the PCI bus
+ * in the address range 0xffff0000-0xffffffff (conventional
+ * x86 BIOS ROM). No way to turn this off, so if we use
+ * large SG window, we must avoid these addresses.
+ */
+	if (dev->class >> 8 == PCI_CLASS_BRIDGE_ISA) {
+		struct pci_controller *hose = dev->sysdata;
+		long overlap;
+
+		if (hose->sg_pci) {
+			overlap = hose->sg_pci->dma_base + hose->sg_pci->size;
+			overlap -= 0xffff0000;
+			if (overlap > 0)
+				hose->sg_pci->size -= overlap;
+		}
 	}
 }
 
@@ -121,8 +120,7 @@
 	{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5229,
 	  quirk_ali_ide_ports },
 	{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693,
-	  quirk_cypress_ide_ports },
-	{ PCI_FIXUP_FINAL, PCI_ANY_ID, PCI_ANY_ID, quirk_vga_enable_rom },
+	  quirk_cypress },
 	{ 0 }
 };
 
@@ -148,10 +146,8 @@
 		/*
 		 * Put everything into 0x00-0xff region modulo 0x400
 		 */
-		if (start & 0x300) {
+		if (start & 0x300)
 			start = (start + 0x3ff) & ~0x3ff;
-			res->start = start;
-		}
 	}
 	else if	(res->flags & IORESOURCE_MEM) {
 		/* Make sure we start at our min on all hoses */
@@ -177,13 +173,13 @@
 		/* Align to multiple of size of minimum base.  */
 		alignto = MAX(0x1000, size);
 		start = ALIGN(start, alignto);
-		if (size <= 7 * 16*MB) {
+		if (hose->sparse_mem_base && size <= 7 * 16*MB) {
 			if (((start / (16*MB)) & 0x7) == 0) {
 				start &= ~(128*MB - 1);
 				start += 16*MB;
 				start  = ALIGN(start, alignto);
 			}
-			if (start/(128*MB) != (start + size)/(128*MB)) {
+			if (start/(128*MB) != (start + size - 1)/(128*MB)) {
 				start &= ~(128*MB - 1);
 				start += (128 + 16)*MB;
 				start  = ALIGN(start, alignto);
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/kernel/pci_impl.h linux/arch/alpha/kernel/pci_impl.h
--- v2.4.9/linux/arch/alpha/kernel/pci_impl.h	Fri May 25 09:54:50 2001
+++ linux/arch/alpha/kernel/pci_impl.h	Thu Sep 13 15:21:32 2001
@@ -49,7 +49,7 @@
  * APECS and LCA have only 34 bits for physical addresses, thus limiting PCI
  * bus memory addresses for SPARSE access to be less than 128Mb.
  */
-#define APECS_AND_LCA_DEFAULT_MEM_BASE ((32+2)*1024*1024)
+#define APECS_AND_LCA_DEFAULT_MEM_BASE ((16+2)*1024*1024)
 
 /*
  * Because the MCPCIA core logic supports more bits for physical addresses,
@@ -136,6 +136,7 @@
 	spinlock_t lock;
 	struct pci_controller *hose;
 #define IOMMU_INVALID_PTE 0x2 /* 32:63 bits MBZ */
+#define IOMMU_RESERVED_PTE 0xface
 	unsigned long *ptes;
 	dma_addr_t dma_base;
 	unsigned int size;
@@ -161,3 +162,10 @@
 extern const char *const pci_io_names[];
 extern const char *const pci_mem_names[];
 extern const char pci_hae0_name[];
+
+extern int iommu_reserve(struct pci_iommu_arena *, long, long);
+extern int iommu_release(struct pci_iommu_arena *, long, long);
+extern int iommu_bind(struct pci_iommu_arena *, long, long, unsigned long *);
+extern int iommu_unbind(struct pci_iommu_arena *, long, long);
+
+
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/kernel/pci_iommu.c linux/arch/alpha/kernel/pci_iommu.c
--- v2.4.9/linux/arch/alpha/kernel/pci_iommu.c	Mon Aug 27 12:41:37 2001
+++ linux/arch/alpha/kernel/pci_iommu.c	Thu Sep 13 15:21:32 2001
@@ -42,24 +42,6 @@
 	return (bytes + PAGE_SIZE - 1) >> PAGE_SHIFT;
 }
 
-static void __init
-iommu_arena_fixup(struct pci_iommu_arena * arena)
-{
-	unsigned long base, size;
-
-	/*
-	 * The Cypress chip has a quirk, it get confused by addresses
-	 * above -1M so reserve the pagetables that maps pci addresses
-	 * above -1M.
-	 */
-	base = arena->dma_base;
-	size = arena->size;
-	if (base + size > 0xfff00000) {
-		int i, fixup_start = (0xfff00000 - base) >> PAGE_SHIFT;
-		for (i= 0; i < (0x100000 >> PAGE_SHIFT); i++)
-			arena->ptes[fixup_start+i] = IOMMU_INVALID_PTE;
-	}
-}
 
 struct pci_iommu_arena *
 iommu_arena_new(struct pci_controller *hose, dma_addr_t base,
@@ -90,24 +72,19 @@
 	   unless there are chip bugs.  */
 	arena->align_entry = 1;
 
-	iommu_arena_fixup(arena);
-
 	return arena;
 }
 
-long
-iommu_arena_alloc(struct pci_iommu_arena *arena, long n)
+/* Must be called with the arena lock held */
+static long
+iommu_arena_find_pages(struct pci_iommu_arena *arena, long n, long mask)
 {
-	unsigned long flags;
 	unsigned long *ptes;
-	long i, p, nent, mask;
+	long i, p, nent;
 
-	spin_lock_irqsave(&arena->lock, flags);
-
-	/* Search forward for the first sequence of N empty ptes.  */
+	/* Search forward for the first mask-aligned sequence of N free ptes */
 	ptes = arena->ptes;
 	nent = arena->size >> PAGE_SHIFT;
-	mask = arena->align_entry - 1;
 	p = (arena->next_entry + mask) & ~mask;
 	i = 0;
 	while (i < n && p+i < nent) {
@@ -130,10 +107,31 @@
 				i = i + 1;
 		}
 
-		if (i < n) {
-			spin_unlock_irqrestore(&arena->lock, flags);
+		if (i < n)
 			return -1;
-		}
+	}
+
+	/* Success. It's the responsibility of the caller to mark them
+	   in use before releasing the lock */
+	return p;
+}
+
+long
+iommu_arena_alloc(struct pci_iommu_arena *arena, long n)
+{
+	unsigned long flags;
+	unsigned long *ptes;
+	long i, p, mask;
+
+	spin_lock_irqsave(&arena->lock, flags);
+
+	/* Search for N empty ptes */
+	ptes = arena->ptes;
+	mask = arena->align_entry - 1;
+	p = iommu_arena_find_pages(arena, n, mask);
+	if (p < 0) {
+		spin_unlock_irqrestore(&arena->lock, flags);
+		return -1;
 	}
 
 	/* Success.  Mark them all in use, ie not zero and invalid
@@ -660,6 +658,104 @@
 	arena = hose->sg_pci;
 	if (arena && arena->dma_base + arena->size - 1 <= mask)
 		return 1;
+
+	return 0;
+}
+
+
+/*
+ * AGP GART extensions to the IOMMU
+ */
+int
+iommu_reserve(struct pci_iommu_arena *arena, long pg_count, long align_mask) 
+{
+	unsigned long flags;
+	unsigned long *ptes;
+	long i, p;
+
+	if (!arena) return -EINVAL;
+
+	spin_lock_irqsave(&arena->lock, flags);
+
+	/* Search for N empty ptes.  */
+	ptes = arena->ptes;
+	p = iommu_arena_find_pages(arena, pg_count, align_mask);
+	if (p < 0) {
+		spin_unlock_irqrestore(&arena->lock, flags);
+		return -1;
+	}
+
+	/* Success.  Mark them all reserved (ie not zero and invalid)
+	   for the iommu tlb that could load them from under us.
+	   They will be filled in with valid bits by _bind() */
+	for (i = 0; i < pg_count; ++i)
+		ptes[p+i] = IOMMU_RESERVED_PTE;
+
+	arena->next_entry = p + pg_count;
+	spin_unlock_irqrestore(&arena->lock, flags);
+
+	return p;
+}
+
+int 
+iommu_release(struct pci_iommu_arena *arena, long pg_start, long pg_count)
+{
+	unsigned long *ptes;
+	long i;
+
+	if (!arena) return -EINVAL;
+
+	ptes = arena->ptes;
+
+	/* Make sure they're all reserved first... */
+	for(i = pg_start; i < pg_start + pg_count; i++)
+		if (ptes[i] != IOMMU_RESERVED_PTE)
+			return -EBUSY;
+
+	iommu_arena_free(arena, pg_start, pg_count);
+	return 0;
+}
+
+int
+iommu_bind(struct pci_iommu_arena *arena, long pg_start, long pg_count, 
+	   unsigned long *physaddrs)
+{
+	unsigned long flags;
+	unsigned long *ptes;
+	long i, j;
+
+	if (!arena) return -EINVAL;
+	
+	spin_lock_irqsave(&arena->lock, flags);
+
+	ptes = arena->ptes;
+
+	for(j = pg_start; j < pg_start + pg_count; j++) {
+		if (ptes[j] != IOMMU_RESERVED_PTE) {
+			spin_unlock_irqrestore(&arena->lock, flags);
+			return -EBUSY;
+		}
+	}
+		
+	for(i = 0, j = pg_start; i < pg_count; i++, j++)
+		ptes[j] = mk_iommu_pte(physaddrs[i]);
+
+	spin_unlock_irqrestore(&arena->lock, flags);
+
+	return 0;
+}
+
+int
+iommu_unbind(struct pci_iommu_arena *arena, long pg_start, long pg_count)
+{
+	unsigned long *p;
+	long i;
+
+	if (!arena) return -EINVAL;
+
+	p = arena->ptes + pg_start;
+	for(i = 0; i < pg_count; i++)
+		p[i] = IOMMU_RESERVED_PTE;
 
 	return 0;
 }
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/kernel/process.c linux/arch/alpha/kernel/process.c
--- v2.4.9/linux/arch/alpha/kernel/process.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/alpha/kernel/process.c	Mon Sep 17 15:29:09 2001
@@ -50,7 +50,6 @@
  */
 
 unsigned long init_user_stack[1024] = { STACK_MAGIC, };
-static struct vm_area_struct init_mmap = INIT_MMAP;
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
 static struct signal_struct init_signals = INIT_SIGNALS;
@@ -213,7 +212,9 @@
 void
 show_regs(struct pt_regs * regs)
 {
-	printk("\nps: %04lx pc: [<%016lx>]\n", regs->ps, regs->pc);
+	printk("\n");
+	printk("Pid: %d, comm: %20s\n", current->pid, current->comm);
+	printk("ps: %04lx pc: [<%016lx>] CPU %d\n", regs->ps, regs->pc, smp_processor_id());
 	printk("rp: [<%016lx>] sp: %p\n", regs->r26, regs+1);
 	printk(" r0: %016lx  r1: %016lx  r2: %016lx  r3: %016lx\n",
 	       regs->r0, regs->r1, regs->r2, regs->r3);
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/kernel/ptrace.c linux/arch/alpha/kernel/ptrace.c
--- v2.4.9/linux/arch/alpha/kernel/ptrace.c	Wed Jul 25 17:10:17 2001
+++ linux/arch/alpha/kernel/ptrace.c	Tue Sep 18 17:03:51 2001
@@ -233,6 +233,16 @@
 	return (nsaved != 0);
 }
 
+/*
+ * Called by kernel/ptrace.c when detaching..
+ *
+ * Make sure the single step bit is not set.
+ */
+void ptrace_disable(struct task_struct *child)
+{ 
+	ptrace_cancel_bpt(child);
+}
+
 asmlinkage long
 sys_ptrace(long request, long pid, long addr, long data,
 	   int a4, int a5, struct pt_regs regs)
@@ -362,21 +372,8 @@
 		ret = 0;
 		goto out;
 
-	case PTRACE_DETACH: /* detach a process that was attached. */
-		ret = -EIO;
-		if ((unsigned long) data > _NSIG)
-			goto out;
-		child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
-		wake_up_process(child);
-		child->exit_code = data;
-		write_lock_irq(&tasklist_lock);
-		REMOVE_LINKS(child);
-		child->p_pptr = child->p_opptr;
-		SET_LINKS(child);
-		write_unlock_irq(&tasklist_lock);
-		/* make sure single-step breakpoint is gone. */
-		ptrace_cancel_bpt(child);
-		ret = 0;
+	case PTRACE_DETACH:	 /* detach a process that was attached. */
+		ret = ptrace_detach(child, data);
 		goto out;
 
 	default:
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/kernel/smp.c linux/arch/alpha/kernel/smp.c
--- v2.4.9/linux/arch/alpha/kernel/smp.c	Mon Aug 27 12:41:38 2001
+++ linux/arch/alpha/kernel/smp.c	Thu Sep 13 15:21:32 2001
@@ -1,5 +1,13 @@
 /*
  *	linux/arch/alpha/kernel/smp.c
+ *
+ *      2001-07-09 Phil Ezolt (Phillip.Ezolt@compaq.com)
+ *            Renamed modified smp_call_function to smp_call_function_on_cpu()
+ *            Created an function that conforms to the old calling convention
+ *            of smp_call_function().
+ *
+ *            This is helpful for DCPI.
+ *
  */
 
 #include <linux/errno.h>
@@ -867,23 +875,31 @@
  */
 
 int
-smp_call_function (void (*func) (void *info), void *info, int retry, int wait)
+smp_call_function_on_cpu (void (*func) (void *info), void *info, int retry,
+			  int wait, unsigned long to_whom)
 {
-	unsigned long to_whom = cpu_present_mask ^ (1UL << smp_processor_id());
 	struct smp_call_struct data;
 	long timeout;
+	int num_cpus_to_call;
+	long i,j;
 	
 	data.func = func;
 	data.info = info;
 	data.wait = wait;
-	atomic_set(&data.unstarted_count, smp_num_cpus - 1);
-	atomic_set(&data.unfinished_count, smp_num_cpus - 1);
+
+	to_whom &= ~(1L << smp_processor_id());
+	for (i = 0, j = 1, num_cpus_to_call = 0; i < NR_CPUS; ++i, j <<= 1)
+		if (to_whom & j)
+			num_cpus_to_call++;
+
+	atomic_set(&data.unstarted_count, num_cpus_to_call);
+	atomic_set(&data.unfinished_count, num_cpus_to_call);
 
 	/* Acquire the smp_call_function_data mutex.  */
 	if (pointer_lock(&smp_call_function_data, &data, retry))
 		return -EBUSY;
 
-	/* Send a message to all other CPUs.  */
+	/* Send a message to the requested CPUs.  */
 	send_ipi_message(to_whom, IPI_CALL_FUNC);
 
 	/* Wait for a minimal response.  */
@@ -905,6 +921,13 @@
 	}
 
 	return 0;
+}
+
+int
+smp_call_function (void (*func) (void *info), void *info, int retry, int wait)
+{
+	return smp_call_function_on_cpu (func, info, retry, wait,
+					 cpu_present_mask);
 }
 
 static void
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/kernel/sys_jensen.c linux/arch/alpha/kernel/sys_jensen.c
--- v2.4.9/linux/arch/alpha/kernel/sys_jensen.c	Fri Mar  2 11:12:07 2001
+++ linux/arch/alpha/kernel/sys_jensen.c	Thu Sep 13 15:21:32 2001
@@ -35,14 +35,16 @@
 
 /*
  * Jensen is special: the vector is 0x8X0 for EISA interrupt X, and
- * 0x9X0 for the local motherboard interrupts..
+ * 0x9X0 for the local motherboard interrupts.
+ *
+ * Note especially that those local interrupts CANNOT be masked,
+ * which causes much of the pain below...
  *
  *	0x660 - NMI
  *
  *	0x800 - IRQ0  interval timer (not used, as we use the RTC timer)
  *	0x810 - IRQ1  line printer (duh..)
  *	0x860 - IRQ6  floppy disk
- *	0x8E0 - IRQ14 SCSI controller
  *
  *	0x900 - COM1
  *	0x920 - COM2
@@ -52,27 +54,77 @@
  * PCI-based systems are more sane: they don't have the local
  * interrupts at all, and have only normal PCI interrupts from
  * devices.  Happily it's easy enough to do a sane mapping from the
- * Jensen..  Note that this means that we may have to do a hardware
- * "ack" to a different interrupt than we report to the rest of the
+ * Jensen.
+ * 
+ * Note that this means that we may have to do a hardware
+ * "local_op" to a different interrupt than we report to the rest of the
  * world.
  */
 
+static unsigned int
+jensen_local_startup(unsigned int irq)
+{
+	/* the parport is really hw IRQ 1, silly Jensen.  */
+	if (irq == 7)
+		i8259a_startup_irq(1);
+	else
+		/*
+		 * For all true local interrupts, set the flag that prevents
+		 * the IPL from being dropped during handler processing.
+		 */
+		if (irq_desc[irq].action)
+			irq_desc[irq].action->flags |= SA_INTERRUPT;
+	return 0;
+}
+
+static void
+jensen_local_shutdown(unsigned int irq)
+{
+	/* the parport is really hw IRQ 1, silly Jensen.  */
+	if (irq == 7)
+		i8259a_disable_irq(1);
+}
+
+static void
+jensen_local_enable(unsigned int irq)
+{
+	/* the parport is really hw IRQ 1, silly Jensen.  */
+	if (irq == 7)
+		i8259a_enable_irq(1);
+}
+
+static void
+jensen_local_disable(unsigned int irq)
+{
+	/* the parport is really hw IRQ 1, silly Jensen.  */
+	if (irq == 7)
+		i8259a_disable_irq(1);
+}
+
 static void
 jensen_local_ack(unsigned int irq)
 {
-	/* irq1 is supposed to be the keyboard, silly Jensen.  */
+	/* the parport is really hw IRQ 1, silly Jensen.  */
 	if (irq == 7)
 		i8259a_mask_and_ack_irq(1);
 }
 
+static void
+jensen_local_end(unsigned int irq)
+{
+	/* the parport is really hw IRQ 1, silly Jensen.  */
+	if (irq == 7)
+		i8259a_end_irq(1);
+}
+
 static struct hw_interrupt_type jensen_local_irq_type = {
 	typename:	"LOCAL",
-	startup:	i8259a_startup_irq,
-	shutdown:	i8259a_disable_irq,
-	enable:		i8259a_enable_irq,
-	disable:	i8259a_disable_irq,
+	startup:	jensen_local_startup,
+	shutdown:	jensen_local_shutdown,
+	enable:		jensen_local_enable,
+	disable:	jensen_local_disable,
 	ack:		jensen_local_ack,
-	end:		i8259a_end_irq,
+	end:		jensen_local_end,
 };
 
 static void 
@@ -104,6 +156,47 @@
 		break;
 	}
 
+	/* If there is no handler yet... */
+	if (irq_desc[irq].action == NULL) {
+	    /* If it is a local interrupt that cannot be masked... */
+	    if (vector >= 0x900)
+	    {
+	        /* Clear keyboard/mouse state */
+	    	inb(0x64);
+		inb(0x60);
+		/* Reset serial ports */
+		inb(0x3fa);
+		inb(0x2fa);
+		outb(0x0c, 0x3fc);
+		outb(0x0c, 0x2fc);
+		/* Clear NMI */
+		outb(0,0x61);
+		outb(0,0x461);
+	    }
+	}
+
+#if 0
+        /* A useful bit of code to find out if an interrupt is going wild.  */
+        {
+          static unsigned int last_msg = 0, last_cc = 0;
+          static int last_irq = -1, count = 0;
+          unsigned int cc;
+
+          __asm __volatile("rpcc %0" : "=r"(cc));
+          ++count;
+#define JENSEN_CYCLES_PER_SEC	(150000000)
+          if (cc - last_msg > ((JENSEN_CYCLES_PER_SEC) * 3) ||
+	      irq != last_irq) {
+                printk(KERN_CRIT " irq %d count %d cc %u @ %lx\n",
+                       irq, count, cc-last_cc, regs->pc);
+                count = 0;
+                last_msg = cc;
+                last_irq = irq;
+          }
+          last_cc = cc;
+        }
+#endif
+
 	handle_irq(irq, regs);
 }
 
@@ -164,7 +257,7 @@
 	BUS(jensen),
 	machine_check:		jensen_machine_check,
 	max_dma_address:	ALPHA_MAX_DMA_ADDRESS,
-	rtc_port: 0x170,
+	rtc_port:		0x170,
 
 	nr_irqs:		16,
 	device_interrupt:	jensen_device_interrupt,
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/kernel/traps.c linux/arch/alpha/kernel/traps.c
--- v2.4.9/linux/arch/alpha/kernel/traps.c	Mon Aug 27 12:41:38 2001
+++ linux/arch/alpha/kernel/traps.c	Mon Sep 17 13:16:30 2001
@@ -19,9 +19,37 @@
 #include <asm/uaccess.h>
 #include <asm/unaligned.h>
 #include <asm/sysinfo.h>
+#include <asm/hwrpb.h>
 
 #include "proto.h"
 
+/* data/code implementing a work-around for some SRMs which
+   mishandle opDEC faults
+*/
+static int opDEC_testing = 0;
+static int opDEC_fix = 0;
+static unsigned long opDEC_test_pc = 0;
+
+static void
+opDEC_check(void)
+{
+	unsigned long test_pc;
+
+	lock_kernel();
+	opDEC_testing = 1;
+
+	__asm__ __volatile__(
+		"       br      %0,1f\n"
+		"1:     addq    %0,8,%0\n"
+		"       stq     %0,%1\n"
+		"       cvttq/svm $f31,$f31\n"
+		: "=&r"(test_pc), "=m"(opDEC_test_pc)
+		: );
+
+	opDEC_testing = 0;
+	unlock_kernel();
+}
+
 void
 dik_show_regs(struct pt_regs *regs, unsigned long *r9_15)
 {
@@ -56,10 +84,12 @@
 #endif
 }
 
+#if 0
 static char * ireg_name[] = {"v0", "t0", "t1", "t2", "t3", "t4", "t5", "t6",
 			   "t7", "s0", "s1", "s2", "s3", "s4", "s5", "s6",
 			   "a0", "a1", "a2", "a3", "a4", "a5", "t8", "t9",
 			   "t10", "t11", "ra", "pv", "at", "gp", "sp", "zero"};
+#endif
 
 static void
 dik_show_code(unsigned int *pc)
@@ -98,6 +128,18 @@
 	printk("\n");
 }
 
+void show_trace_task(struct task_struct * tsk)
+{
+	struct thread_struct * thread = &tsk->thread;
+	unsigned long fp, sp = thread->ksp, base = (unsigned long) thread;
+ 
+	if (sp > base && sp+6*8 < base + 16*1024) {
+		fp = ((unsigned long*)sp)[6];
+		if (fp > sp && fp < base + 16*1024)
+			dik_show_trace((unsigned long *)fp);
+	}
+}
+
 int kstack_depth_to_print = 24;
 
 void show_stack(unsigned long *sp)
@@ -188,8 +230,10 @@
 	 unsigned long a2, unsigned long a3, unsigned long a4,
 	 unsigned long a5, struct pt_regs regs)
 {
-	die_if_kernel((type == 1 ? "Kernel Bug" : "Instruction fault"),
+	if (!opDEC_testing || type != 4) {
+		die_if_kernel((type == 1 ? "Kernel Bug" : "Instruction fault"),
 		      &regs, type, 0);
+	}
 
 	switch (type) {
 	      case 0: /* breakpoint */
@@ -242,6 +286,21 @@
 
 	      case 4: /* opDEC */
 		if (implver() == IMPLVER_EV4) {
+			/* The some versions of SRM do not handle
+			   the opDEC properly - they return the PC of the
+			   opDEC fault, not the instruction after as the
+			   Alpha architecture requires.  Here we fix it up.
+			   We do this by intentionally causing an opDEC
+			   fault during the boot sequence and testing if
+			   we get the correct PC.  If not, we set a flag
+			   to correct it every time through.
+			*/
+			if (opDEC_testing && regs.pc == opDEC_test_pc) {
+				opDEC_fix = 4;
+				printk("opDEC fixup enabled.\n");
+			}
+			regs.pc += opDEC_fix; 
+			
 			/* EV4 does not implement anything except normal
 			   rounding.  Everything else will come here as
 			   an illegal instruction.  Emulate them.  */
@@ -252,12 +311,13 @@
 	      case 3: /* FEN fault */
 	      case 5: /* illoc */
 	      default: /* unexpected instruction-fault type */
+		      ;
 	}
 	send_sig(SIGILL, current, 1);
 }
 
 /* There is an ifdef in the PALcode in MILO that enables a 
-   "kernel debugging entry point" as an unprivilaged call_pal.
+   "kernel debugging entry point" as an unpriviledged call_pal.
 
    We don't want to have anything to do with it, but unfortunately
    several versions of MILO included in distributions have it enabled,
@@ -933,4 +993,11 @@
 	wrent(entUna, 4);
 	wrent(entSys, 5);
 	wrent(entDbg, 6);
+
+	/* Hack for Multia (UDB) and JENSEN: some of their SRMs have
+	 * a bug in the handling of the opDEC fault.  Fix it up if so.
+	 */
+	if (implver() == IMPLVER_EV4) {
+		opDEC_check();
+	}
 }
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/mm/fault.c linux/arch/alpha/mm/fault.c
--- v2.4.9/linux/arch/alpha/mm/fault.c	Mon Mar 19 12:35:09 2001
+++ linux/arch/alpha/mm/fault.c	Mon Sep 17 16:15:02 2001
@@ -140,6 +140,7 @@
 			goto bad_area;
 	}
 
+ survive:
 	/*
 	 * If for any reason at all we couldn't handle the fault,
 	 * make sure we exit gracefully rather than endlessly redo
@@ -194,6 +195,12 @@
  * us unable to handle the page fault gracefully.
  */
 out_of_memory:
+	if (current->pid == 1) {
+		current->policy |= SCHED_YIELD;
+		schedule();
+		down_read(&mm->mmap_sem);
+		goto survive;
+	}
 	printk(KERN_ALERT "VM: killing process %s(%d)\n",
 	       current->comm, current->pid);
 	if (!user_mode(regs))
diff -u --recursive --new-file v2.4.9/linux/arch/alpha/mm/init.c linux/arch/alpha/mm/init.c
--- v2.4.9/linux/arch/alpha/mm/init.c	Thu May 24 15:20:18 2001
+++ linux/arch/alpha/mm/init.c	Thu Sep 20 20:02:03 2001
@@ -32,6 +32,9 @@
 #include <asm/dma.h>
 #include <asm/mmu_context.h>
 #include <asm/console.h>
+#include <asm/tlb.h>
+
+mmu_gather_t mmu_gathers[NR_CPUS];
 
 unsigned long totalram_pages;
 
diff -u --recursive --new-file v2.4.9/linux/arch/arm/kernel/arthur.c linux/arch/arm/kernel/arthur.c
--- v2.4.9/linux/arch/arm/kernel/arthur.c	Thu Apr 12 12:20:31 2001
+++ linux/arch/arm/kernel/arthur.c	Mon Sep 10 13:04:33 2001
@@ -1,7 +1,7 @@
 /*
  *  linux/arch/arm/kernel/arthur.c
  *
- *  Copyright (C) 1998, 1999, 2000 Philip Blundell
+ *  Copyright (C) 1998, 1999, 2000, 2001 Philip Blundell
  *
  * Arthur personality
  */
@@ -58,14 +58,14 @@
 {
 	struct siginfo info;
 	info.si_signo = SIGSWI;
-	info.si_code = nr;
+	info.si_errno = nr;
 	/* Bounce it to the emulator */
 	send_sig_info(SIGSWI, &info, current);
 }
 
 static struct exec_domain arthur_exec_domain = {
 	"Arthur",	/* name */
-	(lcall7_func)arthur_lcall7,
+	arthur_lcall7,
 	PER_RISCOS, PER_RISCOS,
 	arthur_to_linux_signals,
 	linux_to_arthur_signals,
diff -u --recursive --new-file v2.4.9/linux/arch/arm/kernel/init_task.c linux/arch/arm/kernel/init_task.c
--- v2.4.9/linux/arch/arm/kernel/init_task.c	Mon Sep 18 15:15:25 2000
+++ linux/arch/arm/kernel/init_task.c	Mon Sep 17 15:29:09 2001
@@ -9,7 +9,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct vm_area_struct init_mmap = INIT_MMAP;
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
 static struct signal_struct init_signals = INIT_SIGNALS;
diff -u --recursive --new-file v2.4.9/linux/arch/arm/kernel/process.c linux/arch/arm/kernel/process.c
--- v2.4.9/linux/arch/arm/kernel/process.c	Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/kernel/process.c	Fri Sep  7 09:28:38 2001
@@ -124,7 +124,7 @@
 		pm_power_off();
 }
 
-void machine_restart(void * __unused)
+void machine_restart(char * __unused)
 {
 	/*
 	 * Clean and disable cache, and turn off interrupts
diff -u --recursive --new-file v2.4.9/linux/arch/arm/kernel/ptrace.c linux/arch/arm/kernel/ptrace.c
--- v2.4.9/linux/arch/arm/kernel/ptrace.c	Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/kernel/ptrace.c	Tue Sep 18 17:03:51 2001
@@ -386,6 +386,16 @@
 	}
 }
 
+/*
+ * Called by kernel/ptrace.c when detaching..
+ *
+ * Make sure the single step bit is not set.
+ */
+void ptrace_disable(struct task_struct *child)
+{
+	__ptrace_cancel_bpt(child);
+}
+
 static int do_ptrace(int request, struct task_struct *child, long addr, long data)
 {
 	unsigned long tmp;
@@ -491,20 +501,7 @@
 		 * detach a process that was attached.
 		 */
 		case PTRACE_DETACH:
-			ret = -EIO;
-			if ((unsigned long) data > _NSIG)
-				break;
-			child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
-			child->exit_code = data;
-			write_lock_irq(&tasklist_lock);
-			REMOVE_LINKS(child);
-			child->p_pptr = child->p_opptr;
-			SET_LINKS(child);
-			write_unlock_irq(&tasklist_lock);
-			/* make sure single-step breakpoint is gone. */
-			__ptrace_cancel_bpt(child);
-			wake_up_process (child);
-			ret = 0;
+			ret = ptrace_detach(child, data);
 			break;
 
 		/*
diff -u --recursive --new-file v2.4.9/linux/arch/arm/kernel/traps.c linux/arch/arm/kernel/traps.c
--- v2.4.9/linux/arch/arm/kernel/traps.c	Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/kernel/traps.c	Mon Sep 10 13:04:33 2001
@@ -19,6 +19,7 @@
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/spinlock.h>
+#include <linux/personality.h>
 #include <linux/ptrace.h>
 #include <linux/elf.h>
 #include <linux/init.h>
diff -u --recursive --new-file v2.4.9/linux/arch/arm/lib/io-readsl-armv4.S linux/arch/arm/lib/io-readsl-armv4.S
--- v2.4.9/linux/arch/arm/lib/io-readsl-armv4.S	Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/lib/io-readsl-armv4.S	Fri Sep  7 09:28:38 2001
@@ -63,8 +63,8 @@
 		strne	ip, [r1], #4
 		movne	ip, r3, lsr #8
 		bne	7b
-		strb	ip, [r1], #1
-		mov	ip, ip, lsr #8
 		strh	ip, [r1], #2
+		mov	ip, ip, lsr #16
+		strb	ip, [r1]
 		mov	pc, lr
 
diff -u --recursive --new-file v2.4.9/linux/arch/arm/lib/io-writesl.S linux/arch/arm/lib/io-writesl.S
--- v2.4.9/linux/arch/arm/lib/io-writesl.S	Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/lib/io-writesl.S	Fri Sep  7 09:28:38 2001
@@ -25,31 +25,30 @@
 
 2:		bic	r1, r1, #3
 		cmp	ip, #2
-		ldr	ip, [r1], #4
-		mov	ip, ip, lsr #16
-		blt	4f
-		bgt	5f
+		ldr	r3, [r1], #4
+		bgt	4f
+		blt	5f
 
-3:		ldr	r3, [r1], #4
+3:		mov	ip, r3, lsr #16
+		ldr	r3, [r1], #4
 		orr	ip, ip, r3, lsl #16
 		str	ip, [r0]
-		mov	ip, r3, lsr #16
 		subs	r2, r2, #1
 		bne	3b
 		mov	pc, lr
 
-4:		ldr	r3, [r1], #4
+4:		mov	ip, r3, lsr #24
+		ldr	r3, [r1], #4
 		orr	ip, ip, r3, lsl #8
 		str	ip, [r0]
-		mov	ip, r3, lsr #24
 		subs	r2, r2, #1
 		bne	4b
 		mov	pc, lr
 
-5:		ldr	r3, [r1], #4
+5:		mov	ip, r3, lsr #8
+		ldr	r3, [r1], #4
 		orr	ip, ip, r3, lsl #24
 		str	ip, [r0]
-		mov	ip, r3, lsr #8
 		subs	r2, r2, #1
 		bne	5b
 		mov	pc, lr
diff -u --recursive --new-file v2.4.9/linux/arch/arm/mm/fault-armv.c linux/arch/arm/mm/fault-armv.c
--- v2.4.9/linux/arch/arm/mm/fault-armv.c	Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/mm/fault-armv.c	Fri Sep  7 09:28:38 2001
@@ -20,6 +20,7 @@
 #include <linux/mm.h>
 #include <linux/interrupt.h>
 #include <linux/proc_fs.h>
+#include <linux/bitops.h>
 #include <linux/init.h>
 
 #include <asm/system.h>
@@ -366,8 +367,7 @@
 	ai_multi += 1;
 
 	/* count the number of registers in the mask to be transferred */
-	for (regbits = REGMASK_BITS(instr), nr_regs = 0; regbits; regbits >>= 1)
-		nr_regs += 4;
+	nr_regs = hweight16(REGMASK_BITS(instr)) * 4;
 
 	rn = RN_BITS(instr);
 	newaddr = eaddr = regs->uregs[rn];
@@ -385,10 +385,12 @@
 	 * This is a "hint" - we already have eaddr worked out by the
 	 * processor for us.
 	 */
-	if (addr != eaddr)
+	if (addr != eaddr) {
 		printk(KERN_ERR "LDMSTM: PC = %08lx, instr = %08lx, "
 			"addr = %08lx, eaddr = %08lx\n",
 			 instruction_pointer(regs), instr, addr, eaddr);
+		show_regs(regs);
+	}
 
 	for (regbits = REGMASK_BITS(instr), rd = 0; regbits; regbits >>= 1, rd += 1)
 		if (regbits & 1) {
diff -u --recursive --new-file v2.4.9/linux/arch/arm/tools/Makefile linux/arch/arm/tools/Makefile
--- v2.4.9/linux/arch/arm/tools/Makefile	Tue Jul  3 17:08:18 2001
+++ linux/arch/arm/tools/Makefile	Fri Sep  7 09:28:38 2001
@@ -26,7 +26,8 @@
 # directories
 
 dep:
-	$(TOPDIR)/scripts/mkdep getconstants.c | sed s,getconstants.o,$(TOPDIR)/include/asm-arm/constants.h, > .depend
+	$(TOPDIR)/scripts/mkdep $(CFLAGS) $(EXTRA_CFLAGS) -- getconstants.c |\
+	 sed s,getconstants.o,$(TOPDIR)/include/asm-arm/constants.h, > .depend
 	$(MAKE) all
 
 .PHONY:	all dep
diff -u --recursive --new-file v2.4.9/linux/arch/arm/tools/mach-types linux/arch/arm/tools/mach-types
--- v2.4.9/linux/arch/arm/tools/mach-types	Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/tools/mach-types	Fri Sep  7 09:28:38 2001
@@ -6,7 +6,7 @@
 # To add an entry into this database, please see Documentation/arm/README,
 # or contact rmk@arm.linux.org.uk
 #
-# Last update: Thu Aug 9 22:46:02 2001
+# Last update: Thu Aug 23 12:38:13 2001
 #
 # machine_is_xxx	CONFIG_xxxx		MACH_TYPE_xxx		number
 #
@@ -31,7 +31,7 @@
 l7200			ARCH_L7200		L7200			19
 pleb			SA1100_PLEB		PLEB			20
 integrator		ARCH_INTEGRATOR		INTEGRATOR		21
-bitsy			SA1100_BITSY		BITSY			22
+h3600			SA1100_H3600		H3600			22
 ixp1200			ARCH_IXP1200		IXP1200			23
 p720t			ARCH_P720T		P720T			24
 assabet			SA1100_ASSABET		ASSABET			25
@@ -89,7 +89,7 @@
 tardis			ARCH_TARDIS		TARDIS			77
 mercury			ARCH_MERCURY		MERCURY			78
 empeg			SA1100_EMPEG		EMPEG			79
-adi_eb			ARCH_I80200FCC		I80200FCC		80
+adi_evb			ARCH_I80200FCC		I80200FCC		80
 itt_cpb			SA1100_ITT_CPB		ITT_CPB			81
 svc			SA1100_SVC		SVC			82
 alpha2			SA1100_ALPHA2		ALPHA2			84
@@ -115,3 +115,10 @@
 granite			ARCH_GRANITE		GRANITE			104
 consus			SA1100_CONSUS		CONSUS			105
 aaec2000_aaed20		ARCH_AAEC2000_AAED2000	AAEC2000_AAED2000	106
+cdb89712		ARCH_CDB89712		CDB89712		107
+graphicsmaster		SA1100_GRAPHICSMASTER	GRAPHICSMASTER		108
+adsbitsy		SA1100_ADSBITSY		ADSBITSY		109
+cotulla_idp		ARCH_COTULLA_IDP	COTULLA_IDP		110
+plce			ARCH_PLCE		PLCE			111
+pt_system3		SA1100_PT_SYSTEM3	PT_SYSTEM3		112
+medalb			ARCH_MEDALB		MEDALB			113
diff -u --recursive --new-file v2.4.9/linux/arch/cris/drivers/parport.c linux/arch/cris/drivers/parport.c
--- v2.4.9/linux/arch/cris/drivers/parport.c	Sun Aug 12 13:27:58 2001
+++ linux/arch/cris/drivers/parport.c	Fri Sep 14 14:04:06 2001
@@ -23,7 +23,7 @@
 #include <linux/major.h>
 #include <linux/sched.h>
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 
 #include <asm/setup.h>
diff -u --recursive --new-file v2.4.9/linux/arch/cris/drivers/usb-host.c linux/arch/cris/drivers/usb-host.c
--- v2.4.9/linux/arch/cris/drivers/usb-host.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/cris/drivers/usb-host.c	Mon Sep 10 09:04:53 2001
@@ -2258,11 +2258,11 @@
 	case RH_GET_DESCRIPTOR:
 		switch ((wValue & 0xff00) >> 8) {
 		case (0x01):	/* device descriptor */
-			len = min(unsigned int, leni, min(unsigned int, sizeof (root_hub_dev_des), wLength));
+			len = min_t(unsigned int, leni, min_t(unsigned int, sizeof (root_hub_dev_des), wLength));
 			memcpy (data, root_hub_dev_des, len);
 			OK (len);
 		case (0x02):	/* configuration descriptor */
-			len = min(unsigned int, leni, min(unsigned int, sizeof (root_hub_config_des), wLength));
+			len = min_t(unsigned int, leni, min_t(unsigned int, sizeof (root_hub_config_des), wLength));
 			memcpy (data, root_hub_config_des, len);
 			OK (len);
 		case (0x03):	/* string descriptors */
@@ -2270,7 +2270,7 @@
 						   0xff, "ETRAX 100LX",
 						   data, wLength);
 			if (len > 0) {
-				OK(min(int, leni, len));
+				OK(min_t(int, leni, len));
 			} else 
 				stat = -EPIPE;
 		}
@@ -2278,7 +2278,7 @@
 		
 	case RH_GET_DESCRIPTOR | RH_CLASS:
 		root_hub_hub_des[2] = hc->rh.numports;
-		len = min(unsigned int, leni, min(unsigned int, sizeof (root_hub_hub_des), wLength));
+		len = min_t(unsigned int, leni, min_t(unsigned int, sizeof (root_hub_hub_des), wLength));
 		memcpy (data, root_hub_hub_des, len);
 		OK (len);
 		
diff -u --recursive --new-file v2.4.9/linux/arch/cris/kernel/process.c linux/arch/cris/kernel/process.c
--- v2.4.9/linux/arch/cris/kernel/process.c	Sun Aug 12 13:27:58 2001
+++ linux/arch/cris/kernel/process.c	Mon Sep 17 15:29:09 2001
@@ -65,7 +65,6 @@
  * setup.
  */
 
-static struct vm_area_struct init_mmap = INIT_MMAP;
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
 static struct signal_struct init_signals = INIT_SIGNALS;
diff -u --recursive --new-file v2.4.9/linux/arch/cris/kernel/ptrace.c linux/arch/cris/kernel/ptrace.c
--- v2.4.9/linux/arch/cris/kernel/ptrace.c	Sun Aug 12 13:27:58 2001
+++ linux/arch/cris/kernel/ptrace.c	Tue Sep 18 17:03:51 2001
@@ -82,6 +82,16 @@
 	return 0;
 }
 
+/*
+ * Called by kernel/ptrace.c when detaching..
+ *
+ * Make sure the single step bit is not set.
+ */
+void ptrace_disable(struct task_struct *child)
+{
+	/* Todo - pending singlesteps? */
+}
+
 /* Note that this implementation of ptrace behaves differently from vanilla
  * ptrace.  Contrary to what the man page says, in the PTRACE_PEEKTEXT,
  * PTRACE_PEEKDATA, and PTRACE_PEEKUSER requests the data variable is not
@@ -245,24 +255,9 @@
 			break;
 		}
 
-		case PTRACE_DETACH: { /* detach a process that was attached. */
-			long tmp;
-
-			ret = -EIO;
-			if ((unsigned long) data > _NSIG)
-				break;
-			child->ptrace &= ~(PT_PTRACED | PT_TRACESYS);
-			child->exit_code = data;
-			write_lock_irq(&tasklist_lock);
-			REMOVE_LINKS(child);
-			child->p_pptr = child->p_opptr;
-			SET_LINKS(child);
-			write_unlock_irq(&tasklist_lock);
-			/* TODO: make sure any pending breakpoint is killed */
-			wake_up_process(child);
-			ret = 0;
+		case PTRACE_DETACH:
+			ret = ptrace_detach(child, data);
 			break;
-		}
 
 		case PTRACE_GETREGS: { /* Get all gp regs from the child. */
 		  	int i;
diff -u --recursive --new-file v2.4.9/linux/arch/i386/boot/bootsect.S linux/arch/i386/boot/bootsect.S
--- v2.4.9/linux/arch/i386/boot/bootsect.S	Mon Jan 29 16:19:41 2001
+++ linux/arch/i386/boot/bootsect.S	Fri Sep 14 14:04:08 2001
@@ -5,8 +5,12 @@
  *	modified by Bruce Evans (bde)
  *	modified by Chris Noe (May 1999) (as86 -> gas)
  *
- * bootsect is loaded at 0x7c00 by the bios-startup routines, and moves
- * itself out of the way to address 0x90000, and jumps there.
+ * 360k/720k disk support: Andrzej Krzysztofowicz <ankry@green.mif.pg.gda.pl>
+ *
+ * BIG FAT NOTE: We're in real mode using 64k segments.  Therefore segment
+ * addresses must be multiplied by 16 to obtain their respective linear
+ * addresses. To avoid confusion, linear addresses are written using leading
+ * hex while segment addresses are written as segment:offset.
  *
  * bde - should not jump blindly, there may be systems with only 512K low
  * memory.  Use int 0x12 to get the top of memory, etc.
@@ -43,7 +47,7 @@
 
 #ifndef RAMDISK
 #define RAMDISK 0
-#endif 
+#endif
 
 #ifndef ROOT_RDONLY
 #define ROOT_RDONLY 1
@@ -55,14 +59,12 @@
 .global _start
 _start:
 
-#if 0 /* hook for debugger, harmless unless BIOS is fussy (old HP) */
-	int	$0x3
-#endif
+# First things first. Move ourself from 0x7C00 -> 0x90000 and jump there.
 
 	movw	$BOOTSEG, %ax
-	movw	%ax, %ds
+	movw	%ax, %ds		# %ds = BOOTSEG
 	movw	$INITSEG, %ax
-	movw	%ax, %es
+	movw	%ax, %es		# %ax = %es = INITSEG
 	movw	$256, %cx
 	subw	%si, %si
 	subw	%di, %di
@@ -81,7 +83,7 @@
 					# length of bootsect + length of
 					# setup + room for stack;
 					# 12 is disk parm size.
-	movw	%ax, %ds		# ax and es already contain INITSEG
+	movw	%ax, %ds		# %ax and %es already contain INITSEG
 	movw	%ax, %ss
 	movw	%di, %sp		# put stack at INITSEG:0x4000-12.
 
@@ -97,52 +99,29 @@
 #
 # High doesn't hurt.  Low does.
 #
-# Segments are as follows: ds = es = ss = cs - INITSEG, fs = 0,
-# and gs is unused.
+# Segments are as follows: %cs = %ds = %es = %ss = INITSEG, %fs = 0,
+# and %gs is unused.
 
-	movw	%cx, %fs		# set fs to 0
-	movw	$0x78, %bx		# fs:bx is parameter table address
+	movw	%cx, %fs		# %fs = 0
+	movw	$0x78, %bx		# %fs:%bx is parameter table address
 	pushw	%ds
-	ldsw	%fs:(%bx), %si		# ds:si is source
+	ldsw	%fs:(%bx), %si		# %ds:%si is source
 	movb	$6, %cl			# copy 12 bytes
-	pushw	%di			# di = 0x4000-12.
-	rep				# don't need cld -> done on line 66
-	movsw
+	pushw	%di			# %di = 0x4000-12.
+	rep				# don't worry about cld
+	movsw				# already done above
 	popw	%di
 	popw	%ds
 	movb	$36, 0x4(%di)		# patch sector count
 	movw	%di, %fs:(%bx)
 	movw	%es, %fs:2(%bx)
 
-# Load the setup-sectors directly after the bootblock.
-# Note that 'es' is already set up.
-# Also, cx = 0 from rep movsw above.
-
-load_setup:
-	xorb	%ah, %ah		# reset FDC 
-	xorb	%dl, %dl
-	int 	$0x13	
-	xorw	%dx, %dx		# drive 0, head 0
-	movb	$0x02, %cl		# sector 2, track 0
-	movw	$0x0200, %bx		# address = 512, in INITSEG
-	movb	$0x02, %ah		# service 2, "read sector(s)"
-	movb	setup_sects, %al	# (assume all on head 0, track 0)
-	int	$0x13			# read it
-	jnc	ok_load_setup		# ok - continue
-
-	pushw	%ax			# dump error code
-	call	print_nl
-	movw	%sp, %bp
-	call	print_hex
-	popw	%ax	
-	jmp	load_setup
-
-ok_load_setup:
 # Get disk drive parameters, specifically number of sectors/track.
 
 # It seems that there is no BIOS call to get the number of sectors.
 # Guess 36 sectors if sector 36 can be read, 18 sectors if sector 18
 # can be read, 15 if sector 15 can be read.  Otherwise guess 9.
+# Note that %cx = 0 from rep movsw above.
 
 	movw	$disksizes, %si		# table of sizes to try
 probe_loop:
@@ -151,30 +130,56 @@
 	movw	%ax, sectors
 	cmpw	$disksizes+4, %si
 	jae	got_sectors		# If all else fails, try 9
-	
-	xchgw	%cx, %ax		# cx = track and sector
+
+	xchgw	%cx, %ax		# %cx = track and sector
 	xorw	%dx, %dx		# drive 0, head 0
-	xorb	%bl, %bl
-	movb	setup_sects, %bh
-	incb	%bh
-	shlb	%bh			# address after setup (es = cs) 
+	movw	$0x0200, %bx		# address = 512, in INITSEG (%es = %cs)
 	movw	$0x0201, %ax		# service 2, 1 sector
 	int	$0x13
 	jc	probe_loop		# try next value
 
 got_sectors:
-	movw	$INITSEG, %ax
-	movw	%ax, %es		# set up es
 	movb	$0x03, %ah		# read cursor pos
 	xorb	%bh, %bh
 	int	$0x10
 	movw	$9, %cx
-	movw	$0x0007, %bx		# page 0, attribute 7 (normal)
-	movw    $msg1, %bp
-	movw    $0x1301, %ax		# write string, move cursor
+	movb	$0x07, %bl		# page 0, attribute 7 (normal)
+					# %bh is set above; int10 doesn't
+					# modify it
+	movw	$msg1, %bp
+	movw	$0x1301, %ax		# write string, move cursor
 	int	$0x10			# tell the user we're loading..
-	movw	$SYSSEG, %ax		# ok, we've written the message, now
-	movw	%ax, %es		# we want to load system (at 0x10000)
+
+# Load the setup-sectors directly after the moved bootblock (at 0x90200).
+# We should know the drive geometry to do it, as setup may exceed first
+# cylinder (for 9-sector 360K and 720K floppies).
+
+	movw	$0x0001, %ax		# set sread (sector-to-read) to 1 as
+	movw	$sread, %si		# the boot sector has already been read
+	movw	%ax, (%si)
+
+	xorw	%ax, %ax		# reset FDC
+	xorb	%dl, %dl
+	int	$0x13
+	movw	$0x0200, %bx		# address = 512, in INITSEG
+next_step:
+	movb	setup_sects, %al
+	movw	sectors, %cx
+	subw	(%si), %cx		# (%si) = sread
+	cmpb	%cl, %al
+	jbe	no_cyl_crossing
+	movw	sectors, %ax
+	subw	(%si), %ax		# (%si) = sread
+no_cyl_crossing:
+	call	read_track
+	pushw	%ax			# save it
+	call	set_next		# set %bx properly; it uses %ax,%cx,%dx
+	popw	%ax			# restore
+	subb	%al, setup_sects	# rest - for next step
+	jnz	next_step
+
+	pushw	$SYSSEG
+	popw	%es			# %es = SYSSEG
 	call	read_it
 	call	kill_motor
 	call	print_nl
@@ -184,23 +189,26 @@
 # Otherwise, one of /dev/fd0H2880 (2,32) or /dev/PS0 (2,28) or /dev/at0 (2,8)
 # depending on the number of sectors we pretend to know we have.
 
+# Segments are as follows: %cs = %ds = %ss = INITSEG,
+#	%es = SYSSEG, %fs = 0, %gs is unused.
+
 	movw	root_dev, %ax
 	orw	%ax, %ax
 	jne	root_defined
-	
+
 	movw	sectors, %bx
 	movw	$0x0208, %ax		# /dev/ps0 - 1.2Mb
 	cmpw	$15, %bx
 	je	root_defined
-	
+
 	movb	$0x1c, %al		# /dev/PS0 - 1.44Mb
 	cmpw	$18, %bx
 	je	root_defined
-	
+
 	movb	$0x20, %al		# /dev/fd0H2880 - 2.88Mb
 	cmpw	$36, %bx
 	je	root_defined
-	
+
 	movb	$0, %al			# /dev/fd0 - autodetect
 root_defined:
 	movw	%ax, root_dev
@@ -210,46 +218,45 @@
 
 	ljmp	$SETUPSEG, $0
 
-# This routine loads the system at address 0x10000, making sure
-# no 64kB boundaries are crossed. We try to load it as fast as
-# possible, loading whole tracks whenever we can.
-
-# es = starting address segment (normally 0x1000)
+# These variables are addressed via %si register as it gives shorter code.
 
 sread:	.word 0				# sectors read of current track
 head:	.word 0				# current head
 track:	.word 0				# current track
 
+# This routine loads the system at address SYSSEG, making sure
+# no 64kB boundaries are crossed. We try to load it as fast as
+# possible, loading whole tracks whenever we can.
+
 read_it:
-	movb	setup_sects, %al
-	incb	%al
-	movb	%al, sread
-	movw	%es, %ax
+	movw	%es, %ax		# %es = SYSSEG when called
 	testw	$0x0fff, %ax
-die:	jne	die			# es must be at 64kB boundary
-
-	xorw	%bx, %bx		# bx is starting address within segment
+die:	jne	die			# %es must be at 64kB boundary
+	xorw	%bx, %bx		# %bx is starting address within segment
 rp_read:
-#ifdef __BIG_KERNEL__
-	bootsect_kludge = 0x220		# 0x200 (size of bootsector) + 0x20 (offset
-	lcall	bootsect_kludge		# of bootsect_kludge in setup.S)
+#ifdef __BIG_KERNEL__			# look in setup.S for bootsect_kludge
+	bootsect_kludge = 0x220		# 0x200 + 0x20 which is the size of the
+	lcall	bootsect_kludge		# bootsector + bootsect_kludge offset
 #else
 	movw	%es, %ax
 	subw	$SYSSEG, %ax
+	movw	%bx, %cx
+	shr	$4, %cx
+	add	%cx, %ax		# check offset
 #endif
-	cmpw	syssize, %ax		# have we loaded all yet?
+	cmpw	syssize, %ax		# have we loaded everything yet?
 	jbe	ok1_read
 
 	ret
 
 ok1_read:
 	movw	sectors, %ax
-	subw	sread, %ax
+	subw	(%si), %ax		# (%si) = sread
 	movw	%ax, %cx
 	shlw	$9, %cx
 	addw	%bx, %cx
 	jnc	ok2_read
-	
+
 	je	ok2_read
 
 	xorw	%ax, %ax
@@ -257,60 +264,64 @@
 	shrw	$9, %ax
 ok2_read:
 	call	read_track
-	movw	%ax, %cx
-	addw	sread, %ax
-	cmpw	sectors, %ax
-	jne	ok3_read
-	
-	movw	$1, %ax
-	subw	head, %ax
-	jne	ok4_read
-	
-	incw	track
-ok4_read:
-	movw	%ax, head
-	xorw	%ax, %ax
-ok3_read:
-	movw	%ax, sread
-	shlw	$9, %cx
-	addw	%cx, %bx
-	jnc	rp_read
-	
-	movw	%es, %ax
-	addb	$0x10, %ah
-	movw	%ax, %es
-	xorw	%bx, %bx
+	call	set_next
 	jmp	rp_read
 
 read_track:
 	pusha
 	pusha	
-	movw	$0xe2e, %ax 			# loading... message 2e = .
+	movw	$0xe2e, %ax 		# loading... message 2e = .
 	movw	$7, %bx
  	int	$0x10
 	popa		
-	movw	track, %dx
-	movw	sread, %cx
+
+# Accessing head, track, sread via %si gives shorter code.
+
+	movw	4(%si), %dx		# 4(%si) = track
+	movw	(%si), %cx		# (%si)  = sread
 	incw	%cx
 	movb	%dl, %ch
-	movw	head, %dx
+	movw	2(%si), %dx		# 2(%si) = head
 	movb	%dl, %dh
 	andw	$0x0100, %dx
 	movb	$2, %ah
-	pushw	%dx				# save for error dump
+	pushw	%dx			# save for error dump
 	pushw	%cx
 	pushw	%bx
 	pushw	%ax
 	int	$0x13
 	jc	bad_rt
-	
+
 	addw	$8, %sp
 	popa
 	ret
 
+set_next:
+	movw	%ax, %cx
+	addw	(%si), %ax		# (%si) = sread
+	cmp	sectors, %ax
+	jne	ok3_set
+	movw	$0x0001, %ax
+	xorw	%ax, 2(%si)		# change head
+	jne	ok4_set
+	incw	4(%si)			# next track
+ok4_set:
+	xorw	%ax, %ax
+ok3_set:
+	movw	%ax, (%si)		# set sread
+	shlw	$9, %cx
+	addw	%cx, %bx
+	jnc	set_next_fin
+	movw	%es, %ax
+	addb	$0x10, %ah
+	movw	%ax, %es
+	xorw	%bx, %bx
+set_next_fin:
+	ret
+
 bad_rt:
-	pushw	%ax				# save error code
-	call	print_all			# ah = error, al = read
+	pushw	%ax			# save error code
+	call	print_all		# %ah = error, %al = read
 	xorb	%ah, %ah
 	xorb	%dl, %dl
 	int	$0x13
@@ -331,13 +342,13 @@
 #	ret <- %sp
  
 print_all:
-	movw	$5, %cx				# error code + 4 registers
+	movw	$5, %cx			# error code + 4 registers
 	movw	%sp, %bp
 print_loop:
-	pushw	%cx				# save count left
-	call	print_nl			# nl for readability
+	pushw	%cx			# save count remaining
+	call	print_nl		# <-- for readability
 	cmpb	$5, %cl
-	jae	no_reg				# see if register name is needed
+	jae	no_reg			# see if register name is needed
 	
 	movw	$0xe05 + 'A' - 1, %ax
 	subb	%cl, %al
@@ -347,31 +358,31 @@
 	movb	$':', %al
 	int	$0x10
 no_reg:
-	addw	$2, %bp				# next register
-	call	print_hex			# print it
+	addw	$2, %bp			# next register
+	call	print_hex		# print it
 	popw	%cx
 	loop	print_loop
 	ret
 
 print_nl:
-	movw	$0xe0d, %ax			# CR
+	movw	$0xe0d, %ax		# CR
 	int	$0x10
-	movb	$0xa, %al			# LF
+	movb	$0xa, %al		# LF
 	int 	$0x10
 	ret
 
 # print_hex is for debugging purposes, and prints the word
-# pointed to by ss:bp in hexadecimal.
+# pointed to by %ss:%bp in hexadecimal.
 
 print_hex:
-	movw	$4, %cx				# 4 hex digits
-	movw	(%bp), %dx			# load word into dx
+	movw	$4, %cx			# 4 hex digits
+	movw	(%bp), %dx		# load word into %dx
 print_digit:
-	rolw	$4, %dx				# rotate to use low 4 bits
-	movw	$0xe0f, %ax			# ah = request
-	andb	%dl, %al			# al = mask for nybble
-	addb	$0x90, %al			# convert al to ascii hex
-	daa					# in only four instructions!
+	rolw	$4, %dx			# rotate to use low 4 bits
+	movw	$0xe0f, %ax		# %ah = request
+	andb	%dl, %al		# %al = mask for nybble
+	addb	$0x90, %al		# convert %al to ascii hex
+	daa				# in only four instructions!
 	adc	$0x40, %al
 	daa
 	int	$0x10
@@ -381,6 +392,7 @@
 # This procedure turns off the floppy drive motor, so
 # that we enter the kernel in a known state, and
 # don't have to worry about it later.
+# NOTE: Doesn't save %ax or %dx; do it yourself if you need to.
 
 kill_motor:
 	movw	$0x3f2, %dx
diff -u --recursive --new-file v2.4.9/linux/arch/i386/boot/compressed/Makefile linux/arch/i386/boot/compressed/Makefile
--- v2.4.9/linux/arch/i386/boot/compressed/Makefile	Tue Mar  7 11:04:12 2000
+++ linux/arch/i386/boot/compressed/Makefile	Tue Sep 11 23:08:12 2001
@@ -9,7 +9,6 @@
 
 OBJECTS = $(HEAD) misc.o
 
-CFLAGS = $(CPPFLAGS) -O2 -DSTDC_HEADERS
 ZLDFLAGS = -e startup_32
 
 #
diff -u --recursive --new-file v2.4.9/linux/arch/i386/boot/compressed/misc.c linux/arch/i386/boot/compressed/misc.c
--- v2.4.9/linux/arch/i386/boot/compressed/misc.c	Tue Feb 13 13:15:04 2001
+++ linux/arch/i386/boot/compressed/misc.c	Tue Sep 11 23:02:02 2001
@@ -12,6 +12,7 @@
 #include <linux/vmalloc.h>
 #include <linux/tty.h>
 #include <asm/io.h>
+
 /*
  * gzip declarations
  */
@@ -21,6 +22,14 @@
 
 #undef memset
 #undef memcpy
+
+/*
+ * Why do we do this? Don't ask me..
+ *
+ * Incomprehensible are the ways of bootloaders.
+ */
+static void* memset(void *, int, size_t);
+static void* memcpy(void *, __const void *, size_t);
 #define memzero(s, n)     memset ((s), 0, (n))
 
 typedef unsigned char  uch;
@@ -194,7 +203,7 @@
 	outb_p(0xff & (pos >> 1), vidport+1);
 }
 
-void* memset(void* s, int c, size_t n)
+static void* memset(void* s, int c, size_t n)
 {
 	int i;
 	char *ss = (char*)s;
@@ -203,7 +212,7 @@
 	return s;
 }
 
-void* memcpy(void* __dest, __const void* __src,
+static void* memcpy(void* __dest, __const void* __src,
 			    size_t __n)
 {
 	int i;
diff -u --recursive --new-file v2.4.9/linux/arch/i386/boot/install.sh linux/arch/i386/boot/install.sh
--- v2.4.9/linux/arch/i386/boot/install.sh	Tue Jan  3 03:57:26 1995
+++ linux/arch/i386/boot/install.sh	Fri Sep 14 14:04:06 2001
@@ -21,6 +21,7 @@
 
 # User may have a custom install script
 
+if [ -x ~/bin/installkernel ]; then exec ~/bin/installkernel "$@"; fi
 if [ -x /sbin/installkernel ]; then exec /sbin/installkernel "$@"; fi
 
 # Default install - same as make zlilo
diff -u --recursive --new-file v2.4.9/linux/arch/i386/config.in linux/arch/i386/config.in
--- v2.4.9/linux/arch/i386/config.in	Wed Jul 25 17:10:17 2001
+++ linux/arch/i386/config.in	Mon Sep 17 22:52:35 2001
@@ -186,7 +186,10 @@
 comment 'General setup'
 
 bool 'Networking support' CONFIG_NET
-bool 'SGI Visual Workstation support' CONFIG_VISWS
+
+# Visual Workstation support is utterly broken.
+# If you want to see it working mail an VW540 to hch@infradead.org 8)
+#bool 'SGI Visual Workstation support' CONFIG_VISWS
 if [ "$CONFIG_VISWS" = "y" ]; then
    define_bool CONFIG_X86_VISWS_APIC y
    define_bool CONFIG_X86_LOCAL_APIC y
@@ -388,6 +391,13 @@
 mainmenu_option next_comment
 comment 'Kernel hacking'
 
-#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC
-bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
+bool 'Kernel debugging' CONFIG_DEBUG_KERNEL
+if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; then
+   bool '  Debug memory allocations' CONFIG_DEBUG_SLAB
+   bool '  Memory mapped I/O debugging' CONFIG_DEBUG_IOVIRT
+   bool '  Magic SysRq key' CONFIG_MAGIC_SYSRQ
+   bool '  Spinlock debugging' CONFIG_DEBUG_SPINLOCK
+   bool '  Verbose BUG() reporting (adds 70K)' CONFIG_DEBUG_BUGVERBOSE
+fi
+
 endmenu
diff -u --recursive --new-file v2.4.9/linux/arch/i386/defconfig linux/arch/i386/defconfig
--- v2.4.9/linux/arch/i386/defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/i386/defconfig	Tue Sep 18 11:15:11 2001
@@ -65,7 +65,6 @@
 # General setup
 #
 CONFIG_NET=y
-# CONFIG_VISWS is not set
 CONFIG_X86_IO_APIC=y
 CONFIG_X86_LOCAL_APIC=y
 CONFIG_PCI=y
@@ -136,6 +135,7 @@
 # CONFIG_MD_RAID0 is not set
 # CONFIG_MD_RAID1 is not set
 # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
 # CONFIG_BLK_DEV_LVM is not set
 
 #
@@ -175,6 +175,7 @@
 #
 # CONFIG_PHONE is not set
 # CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
 
 #
 # ATA/IDE/MFM/RLL support
@@ -253,6 +254,9 @@
 # CONFIG_IDEDMA_IVB is not set
 # CONFIG_DMA_NONPCI is not set
 CONFIG_BLK_DEV_IDE_MODES=y
+# CONFIG_BLK_DEV_ATARAID is not set
+# CONFIG_BLK_DEV_ATARAID_PDC is not set
+# CONFIG_BLK_DEV_ATARAID_HPT is not set
 
 #
 # SCSI support
@@ -288,6 +292,7 @@
 # CONFIG_SCSI_AHA1740 is not set
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_IN2000 is not set
 # CONFIG_SCSI_AM53C974 is not set
@@ -306,6 +311,7 @@
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_NCR_D700 is not set
 # CONFIG_SCSI_NCR53C7xx is not set
 # CONFIG_SCSI_NCR53C8XX is not set
 CONFIG_SCSI_SYM53C8XX=y
@@ -374,7 +380,6 @@
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
-# CONFIG_ARM_AM79C961A is not set
 # CONFIG_SUNLANCE is not set
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNBMAC is not set
@@ -396,8 +401,6 @@
 # CONFIG_APRICOT is not set
 # CONFIG_CS89x0 is not set
 # CONFIG_TULIP is not set
-# CONFIG_TULIP_MWI is not set
-# CONFIG_TULIP_MMIO is not set
 # CONFIG_DE4X5 is not set
 # CONFIG_DGRS is not set
 # CONFIG_DM9102 is not set
@@ -424,9 +427,9 @@
 # Ethernet (1000 Mbit)
 #
 # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
 # CONFIG_DL2K is not set
 # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
@@ -464,6 +467,7 @@
 # CONFIG_PCMCIA_XIRC2PS is not set
 # CONFIG_ARCNET_COM20020_CS is not set
 # CONFIG_PCMCIA_IBMTR is not set
+# CONFIG_PCMCIA_XIRCOM is not set
 # CONFIG_PCMCIA_XIRTULIP is not set
 CONFIG_NET_PCMCIA_RADIO=y
 CONFIG_PCMCIA_RAYCS=y
@@ -495,6 +499,10 @@
 # Input core support
 #
 # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
 
 #
 # Character devices
@@ -525,7 +533,11 @@
 #
 # Joysticks
 #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
 
 #
 # Input core support is needed for joysticks
@@ -705,6 +717,7 @@
 CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_DEBUG is not set
 # CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
 # CONFIG_USB_STORAGE_DPCM is not set
 # CONFIG_USB_ACM is not set
 # CONFIG_USB_PRINTER is not set
@@ -738,10 +751,10 @@
 #
 # USB Network adaptors
 #
-# CONFIG_USB_PLUSB is not set
 # CONFIG_USB_PEGASUS is not set
 # CONFIG_USB_CATC is not set
-# CONFIG_USB_NET1080 is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_USBNET is not set
 
 #
 # USB port drivers
@@ -761,4 +774,4 @@
 #
 # Kernel hacking
 #
-# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_DEBUG_KERNEL is not set
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/Makefile linux/arch/i386/kernel/Makefile
--- v2.4.9/linux/arch/i386/kernel/Makefile	Fri Dec 29 14:35:47 2000
+++ linux/arch/i386/kernel/Makefile	Mon Sep 17 23:03:09 2001
@@ -30,15 +30,15 @@
 endif
 endif
 
-obj-$(CONFIG_MCA)	+= mca.o
-obj-$(CONFIG_MTRR)	+= mtrr.o
-obj-$(CONFIG_X86_MSR)	+= msr.o
-obj-$(CONFIG_X86_CPUID)	+= cpuid.o
-obj-$(CONFIG_MICROCODE)	+= microcode.o
-obj-$(CONFIG_APM)	+= apm.o
-obj-$(CONFIG_SMP)	+= smp.o smpboot.o trampoline.o
-obj-$(CONFIG_X86_LOCAL_APIC)	+= apic.o
-obj-$(CONFIG_X86_IO_APIC)	+= io_apic.o mpparse.o
+obj-$(CONFIG_MCA)		+= mca.o
+obj-$(CONFIG_MTRR)		+= mtrr.o
+obj-$(CONFIG_X86_MSR)		+= msr.o
+obj-$(CONFIG_X86_CPUID)		+= cpuid.o
+obj-$(CONFIG_MICROCODE)		+= microcode.o
+obj-$(CONFIG_APM)		+= apm.o
+obj-$(CONFIG_SMP)		+= smp.o smpboot.o trampoline.o
+obj-$(CONFIG_X86_LOCAL_APIC)	+= mpparse.o apic.o nmi.o
+obj-$(CONFIG_X86_IO_APIC)	+= io_apic.o
 obj-$(CONFIG_X86_VISWS_APIC)	+= visws_apic.o
 
 include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/apic.c linux/arch/i386/kernel/apic.c
--- v2.4.9/linux/arch/i386/kernel/apic.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/i386/kernel/apic.c	Mon Sep 17 23:03:09 2001
@@ -9,6 +9,7 @@
  *					and Rolf G. Tews
  *					for testing these extensively.
  *	Maciej W. Rozycki	:	Various updates and fixes.
+ *	Mikael Pettersson	:	Power Management for UP-APIC.
  */
 
 #include <linux/config.h>
@@ -29,6 +30,9 @@
 #include <asm/mpspec.h>
 #include <asm/pgalloc.h>
 
+/* Using APIC to generate smp_local_timer_interrupt? */
+int using_apic_timer = 0;
+
 int prof_multiplier[NR_CPUS] = { 1, };
 int prof_old_multiplier[NR_CPUS] = { 1, };
 int prof_counter[NR_CPUS] = { 1, };
@@ -90,10 +94,10 @@
 		 */
 		clear_local_APIC();
 		/*
-		 * PIC mode, enable symmetric IO mode in the IMCR,
-		 * i.e. connect BSP's local APIC to INT and NMI lines.
+		 * PIC mode, enable APIC mode in the IMCR, i.e.
+		 * connect BSP's local APIC to INT and NMI lines.
 		 */
-		printk("leaving PIC mode, enabling symmetric IO mode.\n");
+		printk("leaving PIC mode, enabling APIC mode.\n");
 		outb(0x70, 0x22);
 		outb(0x01, 0x23);
 	}
@@ -108,7 +112,7 @@
 		 * interrupts, including IPIs, won't work beyond
 		 * this point!  The only exception are INIT IPIs.
 		 */
-		printk("disabling symmetric IO mode, entering PIC mode.\n");
+		printk("disabling APIC mode, entering PIC mode.\n");
 		outb(0x70, 0x22);
 		outb(0x00, 0x23);
 	}
@@ -125,7 +129,7 @@
 	 * for 82489DX!).
 	 */
 	value = apic_read(APIC_SPIV);
-	value &= ~(1<<8);
+	value &= ~APIC_SPIV_APIC_ENABLED;
 	apic_write_around(APIC_SPIV, value);
 }
 
@@ -204,6 +208,48 @@
 
 extern void __error_in_apic_c (void);
 
+/*
+ * An initial setup of the virtual wire mode.
+ */
+void __init init_bsp_APIC(void)
+{
+	unsigned long value, ver;
+
+	/*
+	 * Don't do the setup now if we have a SMP BIOS as the
+	 * through-I/O-APIC virtual wire mode might be active.
+	 */
+	if (smp_found_config || !cpu_has_apic)
+		return;
+
+	value = apic_read(APIC_LVR);
+	ver = GET_APIC_VERSION(value);
+
+	/*
+	 * Do not trust the local APIC being empty at bootup.
+	 */
+	clear_local_APIC();
+
+	/*
+	 * Enable APIC.
+	 */
+	value = apic_read(APIC_SPIV);
+	value &= ~APIC_VECTOR_MASK;
+	value |= APIC_SPIV_APIC_ENABLED;
+	value |= APIC_SPIV_FOCUS_DISABLED;
+	value |= SPURIOUS_APIC_VECTOR;
+	apic_write_around(APIC_SPIV, value);
+
+	/*
+	 * Set up the virtual wire mode.
+	 */
+	apic_write_around(APIC_LVT0, APIC_DM_EXTINT);
+	value = APIC_DM_NMI;
+	if (!APIC_INTEGRATED(ver))		/* 82489DX */
+		value |= APIC_LVT_LEVEL_TRIGGER;
+	apic_write_around(APIC_LVT1, value);
+}
+
 void __init setup_local_APIC (void)
 {
 	unsigned long value, ver, maxlvt;
@@ -256,7 +302,7 @@
 	/*
 	 * Enable APIC
 	 */
-	value |= (1<<8);
+	value |= APIC_SPIV_APIC_ENABLED;
 
 	/*
 	 * Some unknown Intel IO/APIC (or APIC) errata is biting us with
@@ -279,10 +325,10 @@
 	 */
 #if 1
 	/* Enable focus processor (bit==0) */
-	value &= ~(1<<9);
+	value &= ~APIC_SPIV_FOCUS_DISABLED;
 #else
 	/* Disable focus processor (bit==1) */
-	value |= (1<<9);
+	value |= APIC_SPIV_FOCUS_DISABLED;
 #endif
 	/*
 	 * Set spurious IRQ vector
@@ -339,24 +385,250 @@
 		printk("ESR value after enabling vector: %08lx\n", value);
 	} else
 		printk("No ESR for 82489DX.\n");
+
+	if (nmi_watchdog == NMI_LOCAL_APIC)
+		setup_apic_nmi_watchdog();
 }
 
-void __init init_apic_mappings(void)
+#ifdef CONFIG_PM
+
+#include <linux/slab.h>
+#include <linux/pm.h>
+
+static struct {
+	/* 'active' is true if the local APIC was enabled by us and
+	   not the BIOS; this signifies that we are also responsible
+	   for disabling it before entering apm/acpi suspend */
+	int active;
+	/* 'perfctr_pmdev' is here because the current (2.4.1) PM
+	   callback system doesn't handle hierarchical dependencies */
+	struct pm_dev *perfctr_pmdev;
+	/* r/w apic fields */
+	unsigned int apic_id;
+	unsigned int apic_taskpri;
+	unsigned int apic_ldr;
+	unsigned int apic_dfr;
+	unsigned int apic_spiv;
+	unsigned int apic_lvtt;
+	unsigned int apic_lvtpc;
+	unsigned int apic_lvt0;
+	unsigned int apic_lvt1;
+	unsigned int apic_lvterr;
+	unsigned int apic_tmict;
+	unsigned int apic_tdcr;
+} apic_pm_state;
+
+static void apic_pm_suspend(void *data)
 {
-	unsigned long apic_phys;
+	unsigned int l, h;
+	unsigned long flags;
 
-	if (smp_found_config) {
-		apic_phys = mp_lapic_addr;
-	} else {
+	if (apic_pm_state.perfctr_pmdev)
+		pm_send(apic_pm_state.perfctr_pmdev, PM_SUSPEND, data);
+	apic_pm_state.apic_id = apic_read(APIC_ID);
+	apic_pm_state.apic_taskpri = apic_read(APIC_TASKPRI);
+	apic_pm_state.apic_ldr = apic_read(APIC_LDR);
+	apic_pm_state.apic_dfr = apic_read(APIC_DFR);
+	apic_pm_state.apic_spiv = apic_read(APIC_SPIV);
+	apic_pm_state.apic_lvtt = apic_read(APIC_LVTT);
+	apic_pm_state.apic_lvtpc = apic_read(APIC_LVTPC);
+	apic_pm_state.apic_lvt0 = apic_read(APIC_LVT0);
+	apic_pm_state.apic_lvt1 = apic_read(APIC_LVT1);
+	apic_pm_state.apic_lvterr = apic_read(APIC_LVTERR);
+	apic_pm_state.apic_tmict = apic_read(APIC_TMICT);
+	apic_pm_state.apic_tdcr = apic_read(APIC_TDCR);
+	__save_flags(flags);
+	__cli();
+	disable_local_APIC();
+	rdmsr(MSR_IA32_APICBASE, l, h);
+	l &= ~MSR_IA32_APICBASE_ENABLE;
+	wrmsr(MSR_IA32_APICBASE, l, h);
+	__restore_flags(flags);
+}
+
+static void apic_pm_resume(void *data)
+{
+	unsigned int l, h;
+	unsigned long flags;
+
+	__save_flags(flags);
+	__cli();
+	rdmsr(MSR_IA32_APICBASE, l, h);
+	l &= ~MSR_IA32_APICBASE_BASE;
+	l |= MSR_IA32_APICBASE_ENABLE | APIC_DEFAULT_PHYS_BASE;
+	wrmsr(MSR_IA32_APICBASE, l, h);
+	apic_write(APIC_ID, apic_pm_state.apic_id);
+	apic_write(APIC_DFR, apic_pm_state.apic_dfr);
+	apic_write(APIC_LDR, apic_pm_state.apic_ldr);
+	apic_write(APIC_TASKPRI, apic_pm_state.apic_taskpri);
+	apic_write(APIC_SPIV, apic_pm_state.apic_spiv);
+	apic_write(APIC_LVT0, apic_pm_state.apic_lvt0);
+	apic_write(APIC_LVT1, apic_pm_state.apic_lvt1);
+	apic_write(APIC_ESR, 0);
+	apic_read(APIC_ESR);
+	apic_write(APIC_LVTERR, apic_pm_state.apic_lvterr);
+	apic_write(APIC_ESR, 0);
+	apic_read(APIC_ESR);
+	apic_write(APIC_LVTPC, apic_pm_state.apic_lvtpc);
+	apic_write(APIC_LVTT, apic_pm_state.apic_lvtt);
+	apic_write(APIC_TDCR, apic_pm_state.apic_tdcr);
+	apic_write(APIC_TMICT, apic_pm_state.apic_tmict);
+	__restore_flags(flags);
+	if (apic_pm_state.perfctr_pmdev)
+		pm_send(apic_pm_state.perfctr_pmdev, PM_RESUME, data);
+}
+
+static int apic_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
+{
+	switch (rqst) {
+	case PM_SUSPEND:
+		apic_pm_suspend(data);
+		break;
+	case PM_RESUME:
+		apic_pm_resume(data);
+		break;
+	}
+	return 0;
+}
+
+/* perfctr driver should call this instead of pm_register() */
+struct pm_dev *apic_pm_register(pm_dev_t type,
+				unsigned long id,
+				pm_callback callback)
+{
+	struct pm_dev *dev;
+
+	if (!apic_pm_state.active)
+		return pm_register(type, id, callback);
+	if (apic_pm_state.perfctr_pmdev)
+		return NULL;	/* we're busy */
+	dev = kmalloc(sizeof(struct pm_dev), GFP_KERNEL);
+	if (dev) {
+		memset(dev, 0, sizeof(*dev));
+		dev->type = type;
+		dev->id = id;
+		dev->callback = callback;
+		apic_pm_state.perfctr_pmdev = dev;
+	}
+	return dev;
+}
+
+/* perfctr driver should call this instead of pm_unregister() */
+void apic_pm_unregister(struct pm_dev *dev)
+{
+	if (!apic_pm_state.active) {
+		pm_unregister(dev);
+	} else if (dev == apic_pm_state.perfctr_pmdev) {
+		apic_pm_state.perfctr_pmdev = NULL;
+		kfree(dev);
+	}
+}
+
+static void __init apic_pm_init1(void)
+{
+	/* can't pm_register() at this early stage in the boot process
+	   (causes an immediate reboot), so just set the flag */
+	apic_pm_state.active = 1;
+}
+
+static void __init apic_pm_init2(void)
+{
+	if (apic_pm_state.active)
+		pm_register(PM_SYS_DEV, 0, apic_pm_callback);
+}
+
+#else	/* CONFIG_PM */
+
+static inline void apic_pm_init1(void) { }
+static inline void apic_pm_init2(void) { }
+
+#endif	/* CONFIG_PM */
+
+/*
+ * Detect and enable local APICs on non-SMP boards.
+ * Original code written by Keir Fraser.
+ */
+
+static int __init detect_init_APIC (void)
+{
+	u32 h, l, features;
+	int needs_pm = 0;
+	extern void get_cpu_vendor(struct cpuinfo_x86*);
+
+	/* Workaround for us being called before identify_cpu(). */
+	get_cpu_vendor(&boot_cpu_data);
+
+	switch (boot_cpu_data.x86_vendor) {
+	case X86_VENDOR_AMD:
+		if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1)
+			break;
+		goto no_apic;
+	case X86_VENDOR_INTEL:
+		if (boot_cpu_data.x86 == 6 ||
+		    (boot_cpu_data.x86 == 5 && cpu_has_apic))
+			break;
+		goto no_apic;
+	default:
+		goto no_apic;
+	}
+
+	if (!cpu_has_apic) {
 		/*
-		 * set up a fake all zeroes page to simulate the
-		 * local APIC and another one for the IO-APIC. We
-		 * could use the real zero-page, but it's safer
-		 * this way if some buggy code writes to this page ...
+		 * Some BIOSes disable the local APIC in the
+		 * APIC_BASE MSR. This can only be done in
+		 * software for Intel P6 and AMD K7 (Model > 1).
 		 */
+		rdmsr(MSR_IA32_APICBASE, l, h);
+		if (!(l & MSR_IA32_APICBASE_ENABLE)) {
+			printk("Local APIC disabled by BIOS -- reenabling.\n");
+			l &= ~MSR_IA32_APICBASE_BASE;
+			l |= MSR_IA32_APICBASE_ENABLE | APIC_DEFAULT_PHYS_BASE;
+			wrmsr(MSR_IA32_APICBASE, l, h);
+			needs_pm = 1;
+		}
+	}
+	/*
+	 * The APIC feature bit should now be enabled
+	 * in `cpuid'
+	 */
+	features = cpuid_edx(1);
+	if (!(features & (1 << X86_FEATURE_APIC))) {
+		printk("Could not enable APIC!\n");
+		return -1;
+	}
+	set_bit(X86_FEATURE_APIC, &boot_cpu_data.x86_capability);
+	mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
+	boot_cpu_id = 0;
+	if (nmi_watchdog != NMI_NONE)
+		nmi_watchdog = NMI_LOCAL_APIC;
+
+	printk("Found and enabled local APIC!\n");
+
+	if (needs_pm)
+		apic_pm_init1();
+
+	return 0;
+
+no_apic:
+	printk("No local APIC present or hardware disabled\n");
+	return -1;
+}
+
+void __init init_apic_mappings(void)
+{
+	unsigned long apic_phys;
+
+	/*
+	 * If no local APIC can be found then set up a fake all
+	 * zeroes page to simulate the local APIC and another
+	 * one for the IO-APIC.
+	 */
+	if (!smp_found_config && detect_init_APIC()) {
 		apic_phys = (unsigned long) alloc_bootmem_pages(PAGE_SIZE);
 		apic_phys = __pa(apic_phys);
-	}
+	} else
+		apic_phys = mp_lapic_addr;
+
 	set_fixmap_nocache(FIX_APIC_BASE, apic_phys);
 	Dprintk("mapped APIC to %08lx (%08lx)\n", APIC_BASE, apic_phys);
 
@@ -603,6 +875,9 @@
 
 void __init setup_APIC_clocks (void)
 {
+	printk("Using local APIC timer interrupts.\n");
+	using_apic_timer = 1;
+
 	__cli();
 
 	calibration_result = calibrate_APIC_clock();
@@ -790,3 +1065,43 @@
 	        smp_processor_id(), v , v1);
 }
 
+/*
+ * This initializes the IO-APIC and APIC hardware if this is
+ * a UP kernel.
+ */
+int __init APIC_init_uniprocessor (void)
+{
+	if (!smp_found_config && !cpu_has_apic)
+		return -1;
+
+	/*
+	 * Complain if the BIOS pretends there is one.
+	 */
+	if (!cpu_has_apic && APIC_INTEGRATED(apic_version[boot_cpu_id])) {
+		printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
+			boot_cpu_id);
+		return -1;
+	}
+
+	verify_local_APIC();
+
+	connect_bsp_APIC();
+
+	phys_cpu_present_map = 1;
+	apic_write_around(APIC_ID, boot_cpu_id);
+
+	apic_pm_init2();
+
+	setup_local_APIC();
+
+	if (nmi_watchdog == NMI_LOCAL_APIC)
+		check_nmi_watchdog();
+#ifdef CONFIG_X86_IO_APIC
+	if (smp_found_config)
+		if (!skip_ioapic_setup && nr_ioapics)
+			setup_IO_APIC();
+#endif
+	setup_APIC_clocks();
+
+	return 0;
+}
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/apm.c linux/arch/i386/kernel/apm.c
--- v2.4.9/linux/arch/i386/kernel/apm.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/i386/kernel/apm.c	Mon Sep 17 22:52:35 2001
@@ -148,6 +148,10 @@
  *   1.14: Make connection version persist across module unload/load.
  *         Enable and engage power management earlier.
  *         Disengage power management on module unload.
+ *         Changed to use the sysrq-register hack for registering the
+ *         power off function called by magic sysrq based upon discussions
+ *         in irc://irc.openprojects.net/#kernelnewbies
+ *         (Crutcher Dunnavant <crutcher+kernel@datastacks.com>).
  *         Make CONFIG_APM_REAL_MODE_POWER_OFF run time configurable.
  *         (Arjan van de Ven <arjanv@redhat.com>) modified by sfr.
  *         Work around byte swap bug in one of the Vaio's BIOS's
@@ -197,12 +201,11 @@
 #include <asm/uaccess.h>
 #include <asm/desc.h>
 
+#include <linux/sysrq.h>
+
 extern unsigned long get_cmos_time(void);
 extern void machine_real_restart(unsigned char *, int);
 
-#ifdef CONFIG_MAGIC_SYSRQ
-extern void (*sysrq_power_off)(void);
-#endif
 #if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT)
 extern int (*console_blank_hook)(int);
 #endif
@@ -686,6 +689,23 @@
 		(void) apm_set_power_state(APM_STATE_OFF);
 }
 
+#ifdef CONFIG_MAGIC_SYSRQ
+/*
+ * Magic sysrq key and handler for the power off function
+ */
+
+void handle_poweroff (int key, struct pt_regs *pt_regs,
+		                        struct kbd_struct *kbd, struct tty_struct *tty) {
+	        apm_power_off();
+}
+struct sysrq_key_op sysrq_poweroff_op = {
+	handler:        handle_poweroff,
+	help_msg:       "Off",
+	action_msg:     "Power Off\n"
+};
+#endif
+
+
 #ifdef CONFIG_APM_DO_ENABLE
 static int apm_enable_power_management(int enable)
 {
@@ -1544,9 +1564,8 @@
 	/* Install our power off handler.. */
 	if (power_off)
 		pm_power_off = apm_power_off;
-#ifdef CONFIG_MAGIC_SYSRQ
-	sysrq_power_off = apm_power_off;
-#endif
+	register_sysrq_key('o',&sysrq_poweroff_op);
+
 	if (smp_num_cpus == 1) {
 #if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT)
 		console_blank_hook = apm_console_blank;
@@ -1761,9 +1780,7 @@
 	}
 	misc_deregister(&apm_device);
 	remove_proc_entry("apm", NULL);
-#ifdef CONFIG_MAGIC_SYSRQ
-	sysrq_power_off = NULL;
-#endif
+	unregister_sysrq_key('o',&sysrq_poweroff_op);
 	if (power_off)
 		pm_power_off = NULL;
 	exit_kapmd = 1;
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/bluesmoke.c linux/arch/i386/kernel/bluesmoke.c
--- v2.4.9/linux/arch/i386/kernel/bluesmoke.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/i386/kernel/bluesmoke.c	Sat Sep  8 12:23:14 2001
@@ -19,7 +19,7 @@
 	u32 mcgstl, mcgsth;
 	int i;
 	
-	rdmsr(0x17a, mcgstl, mcgsth);
+	rdmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth);
 	if(mcgstl&(1<<0))	/* Recoverable ? */
 		recover=0;
 
@@ -27,7 +27,7 @@
 	
 	for(i=0;i<banks;i++)
 	{
-		rdmsr(0x401+i*4,low, high);
+		rdmsr(MSR_IA32_MC0_STATUS+i*4,low, high);
 		if(high&(1<<31))
 		{
 			if(high&(1<<29))
@@ -38,18 +38,18 @@
 			high&=~(1<<31);
 			if(high&(1<<27))
 			{
-				rdmsr(0x402+i*4, alow, ahigh);
+				rdmsr(MSR_IA32_MC0_MISC+i*4, alow, ahigh);
 				printk("[%08x%08x]", alow, ahigh);
 			}
 			if(high&(1<<26))
 			{
-				rdmsr(0x402+i*4, alow, ahigh);
+				rdmsr(MSR_IA32_MC0_ADDR+i*4, alow, ahigh);
 				printk(" at %08x%08x", 
 					high, low);
 			}
 			printk("\n");
 			/* Clear it */
-			wrmsr(0x401+i*4, 0UL, 0UL);
+			wrmsr(MSR_IA32_MC0_STATUS+i*4, 0UL, 0UL);
 			/* Serialize */
 			wmb();
 		}
@@ -61,7 +61,7 @@
 		panic("Unable to continue");
 	printk(KERN_EMERG "Attempting to continue.\n");
 	mcgstl&=~(1<<2);
-	wrmsr(0x17a,mcgstl, mcgsth);
+	wrmsr(MSR_IA32_MCG_STATUS,mcgstl, mcgsth);
 }
 
 /*
@@ -71,8 +71,8 @@
 static void pentium_machine_check(struct pt_regs * regs, long error_code)
 {
 	u32 loaddr, hi, lotype;
-	rdmsr(0x0, loaddr, hi);
-	rdmsr(0x1, lotype, hi);
+	rdmsr(MSR_IA32_P5_MC_ADDR, loaddr, hi);
+	rdmsr(MSR_IA32_P5_MC_TYPE, lotype, hi);
 	printk(KERN_EMERG "CPU#%d: Machine Check Exception:  0x%8X (type 0x%8X).\n", smp_processor_id(), loaddr, lotype);
 	if(lotype&(1<<5))
 		printk(KERN_EMERG "CPU#%d: Possible thermal failure (CPU on fire ?).\n", smp_processor_id());
@@ -133,8 +133,8 @@
 		machine_check_vector = pentium_machine_check;
 		wmb();
 		/* Read registers before enabling */
-		rdmsr(0x0, l, h);
-		rdmsr(0x1, l, h);
+		rdmsr(MSR_IA32_P5_MC_ADDR, l, h);
+		rdmsr(MSR_IA32_P5_MC_TYPE, l, h);
 		if(done==0)
 			printk(KERN_INFO "Intel old style machine check architecture supported.\n");
 		/* Enable MCE */		
@@ -161,17 +161,17 @@
 	
 	if(done==0)
 		printk(KERN_INFO "Intel machine check architecture supported.\n");
-	rdmsr(0x179, l, h);
+	rdmsr(MSR_IA32_MCG_CAP, l, h);
 	if(l&(1<<8))
-		wrmsr(0x17b, 0xffffffff, 0xffffffff);
+		wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff);
 	banks = l&0xff;
 	for(i=1;i<banks;i++)
 	{
-		wrmsr(0x400+4*i, 0xffffffff, 0xffffffff); 
+		wrmsr(MSR_IA32_MC0_CTL+4*i, 0xffffffff, 0xffffffff);
 	}
 	for(i=0;i<banks;i++)
 	{
-		wrmsr(0x401+4*i, 0x0, 0x0); 
+		wrmsr(MSR_IA32_MC0_STATUS+4*i, 0x0, 0x0);
 	}
 	set_in_cr4(X86_CR4_MCE);
 	printk(KERN_INFO "Intel machine check reporting enabled on CPU#%d.\n", smp_processor_id());
@@ -191,10 +191,10 @@
 	/* Winchip C6 */
 	machine_check_vector = winchip_machine_check;
 	wmb();
-	rdmsr(0x107, lo, hi);
+	rdmsr(MSR_IDT_FCR1, lo, hi);
 	lo|= (1<<2);	/* Enable EIERRINT (int 18 MCE) */
 	lo&= ~(1<<4);	/* Enable MCE */
-	wrmsr(0x107, lo, hi);
+	wrmsr(MSR_IDT_FCR1, lo, hi);
 	__asm__ __volatile__ (
 		"movl %%cr4, %%eax\n\t"
 		"orl $0x40, %%eax\n\t"
@@ -236,6 +236,6 @@
 static int __init mcheck_disable(char *str)
 {
 	mce_disabled = 1;
-	return 1;
+	return 0;
 }
 __setup("nomce", mcheck_disable);
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/dmi_scan.c linux/arch/i386/kernel/dmi_scan.c
--- v2.4.9/linux/arch/i386/kernel/dmi_scan.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/i386/kernel/dmi_scan.c	Mon Sep 17 22:52:35 2001
@@ -6,6 +6,9 @@
 #include <linux/apm_bios.h>
 #include <linux/slab.h>
 #include <asm/io.h>
+#include <linux/pm.h>
+#include <linux/keyboard.h>
+#include <asm/keyboard.h>
 
 struct dmi_header
 {
@@ -87,7 +90,15 @@
 	unsigned char buf[20];
 	long fp=0xE0000L;
 	fp -= 16;
-	
+
+#ifdef CONFIG_SIMNOW
+	/*
+ 	 *	Skip on x86/64 with simnow. Will eventually go away
+ 	 *	If you see this ifdef in 2.6pre mail me !
+ 	 */
+	return;
+#endif
+ 	
 	while( fp < 0xFFFFF)
 	{
 		fp+=16;
@@ -191,6 +202,11 @@
 }
 
 /* 
+ * Reboot options and system auto-detection code provided by
+ * Dell Computer Corporation so their systems "just work". :-)
+ */
+
+/* 
  * Some machines require the "reboot=b"  commandline option, this quirk makes that automatic.
  */
 static __init int set_bios_reboot(struct dmi_blacklist *d)
@@ -205,6 +221,32 @@
 }
 
 /*
+ * Some machines require the "reboot=s"  commandline option, this quirk makes that automatic.
+ */
+static __init int set_smp_reboot(struct dmi_blacklist *d)
+{
+#ifdef CONFIG_SMP
+	extern int reboot_smp;
+	if (reboot_smp == 0)
+	{
+		reboot_smp = 1;
+		printk(KERN_INFO "%s series board detected. Selecting SMP-method for reboots.\n", d->ident);
+	}
+#endif
+	return 0;
+}
+
+/*
+ * Some machines require the "reboot=b,s"  commandline option, this quirk makes that automatic.
+ */
+static __init int set_smp_bios_reboot(struct dmi_blacklist *d)
+{
+	set_smp_reboot(d);
+	set_bios_reboot(d);
+	return 0;
+}
+
+/*
  * Some bioses have a broken protected mode poweroff and need to use realmode
  */
 
@@ -271,6 +313,27 @@
 	return 0;
 }		
 
+#if defined(CONFIG_SONYPI) || defined(CONFIG_SONYPI_MODULE)
+/*
+ * Check for a Sony Vaio system in order to enable the use of
+ * the sonypi driver (we don't want this driver to be used on
+ * other systems, even if they have the good PCI IDs).
+ *
+ * This one isn't a bug detect for those who asked, we simply want to
+ * activate Sony specific goodies like the camera and jogdial..
+ */
+int is_sony_vaio_laptop;
+
+static __init int sony_vaio_laptop(struct dmi_blacklist *d)
+{
+	if (is_sony_vaio_laptop == 0)
+	{
+		is_sony_vaio_laptop = 1;
+		printk(KERN_INFO "%s laptop detected.\n", d->ident);
+	}
+	return 0;
+}
+#endif
 
 /*
  * This bios swaps the APM minute reporting bytes over (Many sony laptops
@@ -283,6 +346,46 @@
 	printk(KERN_WARNING "BIOS strings suggest APM reports battery life in minutes and wrong byte order.\n");
 	return 0;
 }
+
+/*
+ * The Intel 440GX hall of shame. 
+ *
+ * On many (all we have checked) of these boxes the $PIRQ table is wrong.
+ * The MP1.4 table is right however and so SMP kernels tend to work. 
+ */
+ 
+static __init int broken_pirq(struct dmi_blacklist *d)
+{
+	printk(KERN_INFO " *** Possibly defective BIOS detected (irqtable)\n");
+	printk(KERN_INFO " *** Many BIOSes matching this signature have incorrect IRQ routing tables.\n");
+	printk(KERN_INFO " *** If you see IRQ problems, in paticular SCSI resets and hangs at boot\n");
+	printk(KERN_INFO " *** contact your vendor and ask about updates.\n");
+	printk(KERN_INFO " *** Building an SMP kernel may evade the bug some of the time.\n");
+	return 0;
+}
+
+/*
+ * Some Bioses enable the PS/2 mouse (touchpad) at resume, even if it
+ * was disabled before the suspend. Linux gets terribly confused by that.
+ */
+
+typedef void (pm_kbd_func) (void);
+extern pm_kbd_func *pm_kbd_request_override;
+
+static __init int broken_ps2_resume(struct dmi_blacklist *d)
+{
+#ifdef CONFIG_VT
+	if (pm_kbd_request_override == NULL)
+	{
+		pm_kbd_request_override = pckbd_pm_resume;
+		printk(KERN_INFO "%s machine detected. Mousepad Resume Bug workaround enabled.\n", d->ident);
+	}
+#endif	
+	return 0;
+}
+
+
+
 /*
  *	Process the DMI blacklists
  */
@@ -300,6 +403,11 @@
 			NO_MATCH, NO_MATCH, NO_MATCH
 			} },
 #endif			
+	{ broken_ps2_resume, "Dell Latitude C600", {	/* Handle problems with APM on the C600 */
+		        MATCH(DMI_SYS_VENDOR, "Dell"),
+			MATCH(DMI_PRODUCT_NAME, "Latitude C600"),
+			NO_MATCH, NO_MATCH
+	                } },
 	{ broken_apm_power, "Dell Inspiron 5000e", {	/* Handle problems with APM on Inspiron 5000e */
 			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
 			MATCH(DMI_BIOS_VERSION, "A04"),
@@ -310,14 +418,14 @@
 			MATCH(DMI_BIOS_VERSION, "4.60 PGMA"),
 			MATCH(DMI_BIOS_DATE, "134526184"), NO_MATCH
 			} },
-	{ set_bios_reboot, "PowerEdge 1300/500", {	/* Handle problems with rebooting on Dell 1300's */
+	{ set_smp_bios_reboot, "Dell PowerEdge 1300", {	/* Handle problems with rebooting on Dell 1300's */
 			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/500"),
+			MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
 			NO_MATCH, NO_MATCH
 			} },
-	{ set_bios_reboot, "PowerEdge 1300/550", {	/* Handle problems with rebooting on Dell 1300's */
+	{ set_bios_reboot, "Dell PowerEdge 300", {	/* Handle problems with rebooting on Dell 1300's */
 			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/550"),
+			MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
 			NO_MATCH, NO_MATCH
 			} },
 	{ set_apm_ints, "IBM", {	/* Allow interrupts during suspend on IBM laptops */
@@ -329,6 +437,12 @@
 			MATCH(DMI_PRODUCT_NAME, "Inspiron 4000"),
 			NO_MATCH, NO_MATCH
 			} },
+	{ set_apm_ints, "Compaq 12XL125", {	/* Allow interrupts during suspend on Compaq Laptops*/
+			MATCH(DMI_SYS_VENDOR, "Compaq"),
+			MATCH(DMI_PRODUCT_NAME, "Compaq PC"),
+			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			MATCH(DMI_BIOS_VERSION,"4.06")
+			} },
 	{ set_apm_ints, "ASUSTeK", {   /* Allow interrupts during APM or the clock goes slow */
 			MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
 			MATCH(DMI_PRODUCT_NAME, "L8400K series Notebook PC"),
@@ -339,21 +453,97 @@
 			MATCH(DMI_PRODUCT_NAME, "Delhi3"),
 			NO_MATCH, NO_MATCH,
 			} },
-	{ swab_apm_power_in_minutes, "Sony VAIO", {	/* Handle problems with APM on Sony Vaio PCG-Z505LS */
+	{ apm_is_horked, "Sharp PC-PJ/AX", { /* APM crashes */
+			MATCH(DMI_SYS_VENDOR, "SHARP"),
+			MATCH(DMI_PRODUCT_NAME, "PC-PJ/AX"),
+			MATCH(DMI_BIOS_VENDOR,"SystemSoft"),
+			MATCH(DMI_BIOS_VERSION,"Version R2.08")
+			} },
+#if defined(CONFIG_SONYPI) || defined(CONFIG_SONYPI_MODULE)
+	{ sony_vaio_laptop, "Sony Vaio", { /* This is a Sony Vaio laptop */
+			MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+			MATCH(DMI_PRODUCT_NAME, "PCG-"),
+			NO_MATCH, NO_MATCH,
+			} },
+#endif
+	{ swab_apm_power_in_minutes, "Sony VAIO", { /* Handle problems with APM on Sony Vaio PCG-N505X(DE) */
 			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			MATCH(DMI_BIOS_VERSION, "R0203Z3"),
-			MATCH(DMI_BIOS_DATE, "08/25/00"), NO_MATCH
+			MATCH(DMI_BIOS_VERSION, "R0206H"),
+			MATCH(DMI_BIOS_DATE, "08/23/99"), NO_MATCH
+	} },
+
+	{ swab_apm_power_in_minutes, "Sony VAIO", { /* Handle problems with APM on Sony Vaio PCG-N505VX */
+			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			MATCH(DMI_BIOS_VERSION, "W2K06H0"),
+			MATCH(DMI_BIOS_DATE, "02/03/00"), NO_MATCH
 			} },
-	{ swab_apm_power_in_minutes, "Sony VAIO", {	/* Handle problems with APM on Sony Vaio PCG-Z505LS */
+			
+	{ swab_apm_power_in_minutes, "Sony VAIO", {	/* Handle problems with APM on Sony Vaio PCG-XG29 */
 			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			MATCH(DMI_BIOS_VERSION, "R0203D0"),
-			MATCH(DMI_BIOS_DATE, "05/12/00"), NO_MATCH
+			MATCH(DMI_BIOS_VERSION, "R0117A0"),
+			MATCH(DMI_BIOS_DATE, "04/25/00"), NO_MATCH
 			} },
+
 	{ swab_apm_power_in_minutes, "Sony VAIO", {	/* Handle problems with APM on Sony Vaio PCG-Z600NE */
 			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
 			MATCH(DMI_BIOS_VERSION, "R0121Z1"),
 			MATCH(DMI_BIOS_DATE, "05/11/00"), NO_MATCH
 			} },
+
+	{ swab_apm_power_in_minutes, "Sony VAIO", {	/* Handle problems with APM on Sony Vaio PCG-Z505LS */
+			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			MATCH(DMI_BIOS_VERSION, "R0203D0"),
+			MATCH(DMI_BIOS_DATE, "05/12/00"), NO_MATCH
+			} },
+
+	{ swab_apm_power_in_minutes, "Sony VAIO", {	/* Handle problems with APM on Sony Vaio PCG-Z505LS */
+			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			MATCH(DMI_BIOS_VERSION, "R0203Z3"),
+			MATCH(DMI_BIOS_DATE, "08/25/00"), NO_MATCH
+			} },
+	
+	{ swab_apm_power_in_minutes, "Sony VAIO", {	/* Handle problems with APM on Sony Vaio PCG-F104K */
+			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			MATCH(DMI_BIOS_VERSION, "R0204K2"),
+			MATCH(DMI_BIOS_DATE, "08/28/00"), NO_MATCH
+			} },
+	
+	{ swab_apm_power_in_minutes, "Sony VAIO", {	/* Handle problems with APM on Sony Vaio PCG-C1VN/C1VE */
+			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			MATCH(DMI_BIOS_VERSION, "R0208P1"),
+			MATCH(DMI_BIOS_DATE, "11/09/00"), NO_MATCH
+			} },
+	{ swab_apm_power_in_minutes, "Sony VAIO", {	/* Handle problems with APM on Sony Vaio PCG-C1VE */
+			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			MATCH(DMI_BIOS_VERSION, "R0204P1"),
+			MATCH(DMI_BIOS_DATE, "09/12/00"), NO_MATCH
+			} },
+
+	/* Problem Intel 440GX bioses */
+
+	{ broken_pirq, "SABR1 Bios", {			/* Bad $PIR */
+			MATCH(DMI_BIOS_VENDOR, "Intel Corporation"),
+			MATCH(DMI_BIOS_VERSION,"SABR1"),
+			NO_MATCH, NO_MATCH
+			} },
+	{ broken_pirq, "l44GX Bios", {        		/* Bad $PIR */
+			MATCH(DMI_BIOS_VENDOR, "Intel Corporation"),
+			MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0094.P10"),
+			NO_MATCH, NO_MATCH
+                        } },
+	{ broken_pirq, "l44GX Bios", {		/* Bad $PIR */
+			MATCH(DMI_BIOS_VENDOR, "Intel Corporation"),
+			MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0125.P13"),
+			NO_MATCH, NO_MATCH
+			} },
+                        
+	/* Intel in disgiuse - In this case they can't hide and they don't run
+	   too well either... */
+	{ broken_pirq, "Dell PowerEdge 8450", {		/* Bad $PIR */
+			MATCH(DMI_PRODUCT_NAME, "Dell PowerEdge 8450"),
+			NO_MATCH, NO_MATCH, NO_MATCH
+			} },
+
 	{ NULL, }
 };
 	
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/entry.S linux/arch/i386/kernel/entry.S
--- v2.4.9/linux/arch/i386/kernel/entry.S	Tue Jul  3 17:08:18 2001
+++ linux/arch/i386/kernel/entry.S	Sat Sep  8 12:02:32 2001
@@ -621,12 +621,6 @@
 	.long SYMBOL_NAME(sys_fcntl64)
 	.long SYMBOL_NAME(sys_ni_syscall)	/* reserved for TUX */
 
-	/*
-	 * NOTE!! This doesn't have to be exact - we just have
-	 * to make sure we have _enough_ of the "sys_ni_syscall"
-	 * entries. Don't panic if you notice that this hasn't
-	 * been shrunk every time we add a new system call.
-	 */
-	.rept NR_syscalls-221
+	.rept NR_syscalls-(.-sys_call_table)/4
 		.long SYMBOL_NAME(sys_ni_syscall)
 	.endr
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/i386_ksyms.c linux/arch/i386/kernel/i386_ksyms.c
--- v2.4.9/linux/arch/i386/kernel/i386_ksyms.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/i386/kernel/i386_ksyms.c	Mon Sep 17 22:52:35 2001
@@ -72,7 +72,7 @@
 EXPORT_SYMBOL(apm_info);
 EXPORT_SYMBOL(gdt);
 
-#ifdef CONFIG_IO_DEBUG
+#ifdef CONFIG_DEBUG_IOVIRT
 EXPORT_SYMBOL(__io_virt_debug);
 #endif
 
@@ -165,3 +165,13 @@
 #ifdef CONFIG_HAVE_DEC_LOCK
 EXPORT_SYMBOL(atomic_dec_and_lock);
 #endif
+
+#ifdef CONFIG_DEBUG_BUGVERBOSE
+EXPORT_SYMBOL(do_BUG);
+#endif
+
+#if defined(CONFIG_SONYPI) || defined(CONFIG_SONYPI_MODULE)
+extern int is_sony_vaio_laptop;
+EXPORT_SYMBOL(is_sony_vaio_laptop);
+#endif
+
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/i8259.c linux/arch/i386/kernel/i8259.c
--- v2.4.9/linux/arch/i386/kernel/i8259.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/i386/kernel/i8259.c	Mon Sep 17 23:03:09 2001
@@ -20,6 +20,7 @@
 #include <asm/pgtable.h>
 #include <asm/delay.h>
 #include <asm/desc.h>
+#include <asm/apic.h>
 
 #include <linux/irq.h>
 
@@ -415,6 +416,9 @@
 {
 	int i;
 
+#ifdef CONFIG_X86_LOCAL_APIC
+	init_bsp_APIC();
+#endif
 	init_8259A(0);
 
 	for (i = 0; i < NR_IRQS; i++) {
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/init_task.c linux/arch/i386/kernel/init_task.c
--- v2.4.9/linux/arch/i386/kernel/init_task.c	Tue Aug  3 10:32:57 1999
+++ linux/arch/i386/kernel/init_task.c	Mon Sep 17 15:29:09 2001
@@ -6,7 +6,6 @@
 #include <asm/pgtable.h>
 #include <asm/desc.h>
 
-static struct vm_area_struct init_mmap = INIT_MMAP;
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
 static struct signal_struct init_signals = INIT_SIGNALS;
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/io_apic.c linux/arch/i386/kernel/io_apic.c
--- v2.4.9/linux/arch/i386/kernel/io_apic.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/i386/kernel/io_apic.c	Mon Sep 17 23:03:09 2001
@@ -33,25 +33,17 @@
 #include <asm/smp.h>
 #include <asm/desc.h>
 
+#undef APIC_LOCKUP_DEBUG
+
 #define APIC_LOCKUP_DEBUG
 
 static spinlock_t ioapic_lock = SPIN_LOCK_UNLOCKED;
 
 /*
- * # of IO-APICs and # of IRQ routing registers
+ * # of IRQ routing registers
  */
-int nr_ioapics;
 int nr_ioapic_registers[MAX_IO_APICS];
 
-/* I/O APIC entries */
-struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS];
-
-/* # of MP IRQ source entries */
-struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
-
-/* MP IRQ source entries */
-int mp_irq_entries;
-
 #if CONFIG_SMP
 # define TARGET_CPUS cpu_online_map
 #else
@@ -154,14 +146,17 @@
 void clear_IO_APIC_pin(unsigned int apic, unsigned int pin)
 {
 	struct IO_APIC_route_entry entry;
+	unsigned long flags;
 
 	/*
 	 * Disable it in the IO-APIC irq-routing table:
 	 */
 	memset(&entry, 0, sizeof(entry));
 	entry.mask = 1;
+	spin_lock_irqsave(&ioapic_lock, flags);
 	io_apic_write(apic, 0x10 + 2 * pin, *(((int *)&entry) + 0));
 	io_apic_write(apic, 0x11 + 2 * pin, *(((int *)&entry) + 1));
+	spin_unlock_irqrestore(&ioapic_lock, flags);
 }
 
 static void clear_IO_APIC (void)
@@ -595,6 +590,7 @@
 {
 	struct IO_APIC_route_entry entry;
 	int apic, pin, idx, irq, first_notcon = 1, vector;
+	unsigned long flags;
 
 	printk(KERN_DEBUG "init IO_APIC IRQs\n");
 
@@ -650,8 +646,10 @@
 			if (!apic && (irq < 16))
 				disable_8259A_irq(irq);
 		}
+		spin_lock_irqsave(&ioapic_lock, flags);
 		io_apic_write(apic, 0x11+2*pin, *(((int *)&entry)+1));
 		io_apic_write(apic, 0x10+2*pin, *(((int *)&entry)+0));
+		spin_unlock_irqrestore(&ioapic_lock, flags);
 	}
 	}
 
@@ -666,6 +664,7 @@
 void __init setup_ExtINT_IRQ0_pin(unsigned int pin, int vector)
 {
 	struct IO_APIC_route_entry entry;
+	unsigned long flags;
 
 	memset(&entry,0,sizeof(entry));
 
@@ -695,8 +694,10 @@
 	/*
 	 * Add it to the IO-APIC irq-routing table:
 	 */
+	spin_lock_irqsave(&ioapic_lock, flags);
 	io_apic_write(0, 0x11+2*pin, *(((int *)&entry)+1));
 	io_apic_write(0, 0x10+2*pin, *(((int *)&entry)+0));
+	spin_unlock_irqrestore(&ioapic_lock, flags);
 
 	enable_8259A_irq(0);
 }
@@ -713,6 +714,7 @@
 	struct IO_APIC_reg_00 reg_00;
 	struct IO_APIC_reg_01 reg_01;
 	struct IO_APIC_reg_02 reg_02;
+	unsigned long flags;
 
  	printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries);
 	for (i = 0; i < nr_ioapics; i++)
@@ -727,10 +729,12 @@
 
 	for (apic = 0; apic < nr_ioapics; apic++) {
 
+	spin_lock_irqsave(&ioapic_lock, flags);
 	*(int *)&reg_00 = io_apic_read(apic, 0);
 	*(int *)&reg_01 = io_apic_read(apic, 1);
 	if (reg_01.version >= 0x10)
 		*(int *)&reg_02 = io_apic_read(apic, 2);
+	spin_unlock_irqrestore(&ioapic_lock, flags);
 
 	printk("\n");
 	printk(KERN_DEBUG "IO APIC #%d......\n", mp_ioapics[apic].mpc_apicid);
@@ -742,11 +746,9 @@
 	printk(KERN_DEBUG ".... register #01: %08X\n", *(int *)&reg_01);
 	printk(KERN_DEBUG ".......     : max redirection entries: %04X\n", reg_01.entries);
 	if (	(reg_01.entries != 0x0f) && /* older (Neptune) boards */
-		(reg_01.entries != 0x11) &&
 		(reg_01.entries != 0x17) && /* typical ISA+PCI boards */
 		(reg_01.entries != 0x1b) && /* Compaq Proliant boards */
 		(reg_01.entries != 0x1f) && /* dual Xeon boards */
-		(reg_01.entries != 0x20) &&
 		(reg_01.entries != 0x22) && /* bigger Xeon boards */
 		(reg_01.entries != 0x2E) &&
 		(reg_01.entries != 0x3F)
@@ -757,7 +759,8 @@
 	if (	(reg_01.version != 0x01) && /* 82489DX IO-APICs */
 		(reg_01.version != 0x10) && /* oldest IO-APICs */
 		(reg_01.version != 0x11) && /* Pentium/Pro IO-APICs */
-		(reg_01.version != 0x13)    /* Xeon IO-APICs */
+		(reg_01.version != 0x13) && /* Xeon IO-APICs */
+		(reg_01.entries != 0x20)    /* Intel P64H (82806 AA) */
 	)
 		UNEXPECTED_IO_APIC();
 	if (reg_01.__reserved_1 || reg_01.__reserved_2)
@@ -778,8 +781,10 @@
 	for (i = 0; i <= reg_01.entries; i++) {
 		struct IO_APIC_route_entry entry;
 
+		spin_lock_irqsave(&ioapic_lock, flags);
 		*(((int *)&entry)+0) = io_apic_read(apic, 0x10+i*2);
 		*(((int *)&entry)+1) = io_apic_read(apic, 0x11+i*2);
+		spin_unlock_irqrestore(&ioapic_lock, flags);
 
 		printk(KERN_DEBUG " %02x %03X %02X  ",
 			i,
@@ -806,7 +811,7 @@
 			continue;
 		printk(KERN_DEBUG "IRQ%d ", i);
 		for (;;) {
-			printk("-> %d", entry->pin);
+			printk("-> %d:%d", entry->apic, entry->pin);
 			if (!entry->next)
 				break;
 			entry = irq_2_pin + entry->next;
@@ -956,6 +961,7 @@
 {
 	struct IO_APIC_reg_01 reg_01;
 	int i;
+	unsigned long flags;
 
 	for (i = 0; i < PIN_MAP_SIZE; i++) {
 		irq_2_pin[i].pin = -1;
@@ -969,7 +975,9 @@
 	 * The number of IO-APIC IRQ registers (== #pins):
 	 */
 	for (i = 0; i < nr_ioapics; i++) {
+		spin_lock_irqsave(&ioapic_lock, flags);
 		*(int *)&reg_01 = io_apic_read(i, 1);
+		spin_unlock_irqrestore(&ioapic_lock, flags);
 		nr_ioapic_registers[i] = reg_01.entries+1;
 	}
 
@@ -1006,6 +1014,7 @@
 	int apic;
 	int i;
 	unsigned char old_id;
+	unsigned long flags;
 
 	/*
 	 * Set the IOAPIC ID to the value stored in the MPC table.
@@ -1013,7 +1022,9 @@
 	for (apic = 0; apic < nr_ioapics; apic++) {
 
 		/* Read the register 0 value */
+		spin_lock_irqsave(&ioapic_lock, flags);
 		*(int *)&reg_00 = io_apic_read(apic, 0);
+		spin_unlock_irqrestore(&ioapic_lock, flags);
 		
 		old_id = mp_ioapics[apic].mpc_apicid;
 
@@ -1062,12 +1073,16 @@
 					mp_ioapics[apic].mpc_apicid);
 
 		reg_00.ID = mp_ioapics[apic].mpc_apicid;
+		spin_lock_irqsave(&ioapic_lock, flags);
 		io_apic_write(apic, 0, *(int *)&reg_00);
+		spin_unlock_irqrestore(&ioapic_lock, flags);
 
 		/*
 		 * Sanity check
 		 */
+		spin_lock_irqsave(&ioapic_lock, flags);
 		*(int *)&reg_00 = io_apic_read(apic, 0);
+		spin_unlock_irqrestore(&ioapic_lock, flags);
 		if (reg_00.ID != mp_ioapics[apic].mpc_apicid)
 			panic("could not set ID!\n");
 		else
@@ -1104,25 +1119,6 @@
 	return 0;
 }
 
-static int __init nmi_irq_works(void)
-{
-	irq_cpustat_t tmp[NR_CPUS];
-	int j, cpu;
-
-	memcpy(tmp, irq_stat, sizeof(tmp));
-	sti();
-	mdelay(50);
-
-	for (j = 0; j < smp_num_cpus; j++) {
-		cpu = cpu_logical_map(j);
-		if (nmi_count(cpu) - tmp[cpu].__nmi_count <= 3) {
-			printk(KERN_WARNING "CPU#%d NMI appears to be stuck.\n", cpu);
-			return 0;
-		}
-	}
-	return 1;
-}
-
 /*
  * In the SMP+IOAPIC case it might happen that there are an unspecified
  * number of pending IRQ events unhandled. These cases are very rare,
@@ -1212,6 +1208,7 @@
 static void end_level_ioapic_irq (unsigned int irq)
 {
 	unsigned long v;
+	int i;
 
 /*
  * It appears there is an erratum which affects at least version 0x11
@@ -1232,11 +1229,12 @@
  * operation to prevent an edge-triggered interrupt escaping meanwhile.
  * The idea is from Manfred Spraul.  --macro
  */
-	v = apic_read(APIC_TMR + ((IO_APIC_VECTOR(irq) & ~0x1f) >> 1));
+	i = IO_APIC_VECTOR(irq);
+	v = apic_read(APIC_TMR + ((i & ~0x1f) >> 1));
 
 	ack_APIC_irq();
 
-	if (!(v & (1 << (IO_APIC_VECTOR(irq) & 0x1f)))) {
+	if (!(v & (1 << (i & 0x1f)))) {
 #ifdef APIC_MISMATCH_DEBUG
 		atomic_inc(&irq_mis_count);
 #endif
@@ -1416,13 +1414,16 @@
 	int pin, i;
 	struct IO_APIC_route_entry entry0, entry1;
 	unsigned char save_control, save_freq_select;
+	unsigned long flags;
 
 	pin = find_isa_irq_pin(8, mp_INT);
 	if (pin == -1)
 		return;
 
+	spin_lock_irqsave(&ioapic_lock, flags);
 	*(((int *)&entry0) + 1) = io_apic_read(0, 0x11 + 2 * pin);
 	*(((int *)&entry0) + 0) = io_apic_read(0, 0x10 + 2 * pin);
+	spin_unlock_irqrestore(&ioapic_lock, flags);
 	clear_IO_APIC_pin(0, pin);
 
 	memset(&entry1, 0, sizeof(entry1));
@@ -1435,8 +1436,10 @@
 	entry1.trigger = 0;
 	entry1.vector = 0;
 
+	spin_lock_irqsave(&ioapic_lock, flags);
 	io_apic_write(0, 0x11 + 2 * pin, *(((int *)&entry1) + 1));
 	io_apic_write(0, 0x10 + 2 * pin, *(((int *)&entry1) + 0));
+	spin_unlock_irqrestore(&ioapic_lock, flags);
 
 	save_control = CMOS_READ(RTC_CONTROL);
 	save_freq_select = CMOS_READ(RTC_FREQ_SELECT);
@@ -1455,8 +1458,10 @@
 	CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
 	clear_IO_APIC_pin(0, pin);
 
+	spin_lock_irqsave(&ioapic_lock, flags);
 	io_apic_write(0, 0x11 + 2 * pin, *(((int *)&entry0) + 1));
 	io_apic_write(0, 0x10 + 2 * pin, *(((int *)&entry0) + 0));
+	spin_unlock_irqrestore(&ioapic_lock, flags);
 }
 
 /*
@@ -1493,7 +1498,7 @@
 	pin1 = find_isa_irq_pin(0, mp_INT);
 	pin2 = find_isa_irq_pin(0, mp_ExtINT);
 
-	printk(KERN_INFO "..TIMER: vector=%02X pin1=%d pin2=%d\n", vector, pin1, pin2);
+	printk(KERN_INFO "..TIMER: vector=0x%02X pin1=%d pin2=%d\n", vector, pin1, pin2);
 
 	if (pin1 != -1) {
 		/*
@@ -1501,11 +1506,11 @@
 		 */
 		unmask_IO_APIC_irq(0);
 		if (timer_irq_works()) {
-			if (nmi_watchdog) {
+			if (nmi_watchdog == NMI_IO_APIC) {
 				disable_8259A_irq(0);
 				setup_nmi();
 				enable_8259A_irq(0);
-				nmi_irq_works();
+				check_nmi_watchdog();
 			}
 			return;
 		}
@@ -1522,9 +1527,9 @@
 		setup_ExtINT_IRQ0_pin(pin2, vector);
 		if (timer_irq_works()) {
 			printk("works.\n");
-			if (nmi_watchdog) {
+			if (nmi_watchdog == NMI_IO_APIC) {
 				setup_nmi();
-				nmi_irq_works();
+				check_nmi_watchdog();
 			}
 			return;
 		}
@@ -1605,19 +1610,3 @@
 	check_timer();
 	print_IO_APIC();
 }
-
-#ifndef CONFIG_SMP
-/*
- * This initializes the IO-APIC and APIC hardware if this is
- * a UP kernel.
- */
-void IO_APIC_init_uniprocessor (void)
-{
-	if (!smp_found_config)
-		return;
-	connect_bsp_APIC();
-	setup_local_APIC();
-	setup_IO_APIC();
-	setup_APIC_clocks();
-}
-#endif
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/irq.c linux/arch/i386/kernel/irq.c
--- v2.4.9/linux/arch/i386/kernel/irq.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/i386/kernel/irq.c	Mon Sep 17 23:03:09 2001
@@ -166,7 +166,7 @@
 		p += sprintf(p, "%10u ",
 			nmi_count(cpu_logical_map(j)));
 	p += sprintf(p, "\n");
-#if CONFIG_SMP
+#if CONFIG_X86_LOCAL_APIC
 	p += sprintf(p, "LOC: ");
 	for (j = 0; j < smp_num_cpus; j++)
 		p += sprintf(p, "%10u ",
@@ -471,14 +471,15 @@
  *	disable_irq_nosync - disable an irq without waiting
  *	@irq: Interrupt to disable
  *
- *	Disable the selected interrupt line. Disables of an interrupt
- *	stack. Unlike disable_irq(), this function does not ensure existing
+ *	Disable the selected interrupt line.  Disables and Enables are
+ *	nested.
+ *	Unlike disable_irq(), this function does not ensure existing
  *	instances of the IRQ handler have completed before returning.
  *
  *	This function may be called from IRQ context.
  */
  
-void inline disable_irq_nosync(unsigned int irq)
+inline void disable_irq_nosync(unsigned int irq)
 {
 	irq_desc_t *desc = irq_desc + irq;
 	unsigned long flags;
@@ -495,9 +496,9 @@
  *	disable_irq - disable an irq and wait for completion
  *	@irq: Interrupt to disable
  *
- *	Disable the selected interrupt line. Disables of an interrupt
- *	stack. That is for two disables you need two enables. This
- *	function waits for any pending IRQ handlers for this interrupt
+ *	Disable the selected interrupt line.  Enables and Disables are
+ *	nested.
+ *	This function waits for any pending IRQ handlers for this interrupt
  *	to complete before returning. If you use this function while
  *	holding a resource the IRQ handler may need you will deadlock.
  *
@@ -516,11 +517,12 @@
 }
 
 /**
- *	enable_irq - enable interrupt handling on an irq
+ *	enable_irq - enable handling of an irq
  *	@irq: Interrupt to enable
  *
- *	Re-enables the processing of interrupts on this IRQ line
- *	providing no disable_irq calls are now in effect.
+ *	Undoes the effect of one call to disable_irq().  If this
+ *	matches the last disable, processing of interrupts on this
+ *	IRQ line is re-enabled.
  *
  *	This function may be called from IRQ context.
  */
@@ -1027,20 +1029,9 @@
 
 static struct proc_dir_entry * root_irq_dir;
 static struct proc_dir_entry * irq_dir [NR_IRQS];
-static struct proc_dir_entry * smp_affinity_entry [NR_IRQS];
-
-static unsigned long irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL };
 
 #define HEX_DIGITS 8
 
-static int irq_affinity_read_proc (char *page, char **start, off_t off,
-			int count, int *eof, void *data)
-{
-	if (count < HEX_DIGITS+1)
-		return -EINVAL;
-	return sprintf (page, "%08lx\n", irq_affinity[(long)data]);
-}
-
 static unsigned int parse_hex_value (const char *buffer,
 		unsigned long count, unsigned long *ret)
 {
@@ -1078,6 +1069,19 @@
 	return 0;
 }
 
+#if CONFIG_SMP
+
+static struct proc_dir_entry * smp_affinity_entry [NR_IRQS];
+
+static unsigned long irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL };
+static int irq_affinity_read_proc (char *page, char **start, off_t off,
+			int count, int *eof, void *data)
+{
+	if (count < HEX_DIGITS+1)
+		return -EINVAL;
+	return sprintf (page, "%08lx\n", irq_affinity[(long)data]);
+}
+
 static int irq_affinity_write_proc (struct file *file, const char *buffer,
 					unsigned long count, void *data)
 {
@@ -1089,7 +1093,6 @@
 
 	err = parse_hex_value(buffer, count, &new_value);
 
-#if CONFIG_SMP
 	/*
 	 * Do not allow disabling IRQs completely - it's a too easy
 	 * way to make the system unusable accidentally :-) At least
@@ -1097,7 +1100,6 @@
 	 */
 	if (!(new_value & cpu_online_map))
 		return -EINVAL;
-#endif
 
 	irq_affinity[irq] = new_value;
 	irq_desc[irq].handler->set_affinity(irq, new_value);
@@ -1105,6 +1107,8 @@
 	return full_count;
 }
 
+#endif
+
 static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
 			int count, int *eof, void *data)
 {
@@ -1132,7 +1136,6 @@
 
 static void register_irq_proc (unsigned int irq)
 {
-	struct proc_dir_entry *entry;
 	char name [MAX_NAMELEN];
 
 	if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) ||
@@ -1145,15 +1148,23 @@
 	/* create /proc/irq/1234 */
 	irq_dir[irq] = proc_mkdir(name, root_irq_dir);
 
-	/* create /proc/irq/1234/smp_affinity */
-	entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
+#if CONFIG_SMP
+	{
+		struct proc_dir_entry *entry;
 
-	entry->nlink = 1;
-	entry->data = (void *)(long)irq;
-	entry->read_proc = irq_affinity_read_proc;
-	entry->write_proc = irq_affinity_write_proc;
+		/* create /proc/irq/1234/smp_affinity */
+		entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
 
-	smp_affinity_entry[irq] = entry;
+		if (entry) {
+			entry->nlink = 1;
+			entry->data = (void *)(long)irq;
+			entry->read_proc = irq_affinity_read_proc;
+			entry->write_proc = irq_affinity_write_proc;
+		}
+
+		smp_affinity_entry[irq] = entry;
+	}
+#endif
 }
 
 unsigned long prof_cpu_mask = -1;
@@ -1168,6 +1179,9 @@
 
 	/* create /proc/irq/prof_cpu_mask */
 	entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
+
+	if (!entry)
+	    return;
 
 	entry->nlink = 1;
 	entry->data = (void *)&prof_cpu_mask;
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/microcode.c linux/arch/i386/kernel/microcode.c
--- v2.4.9/linux/arch/i386/kernel/microcode.c	Fri Feb  9 11:29:44 2001
+++ linux/arch/i386/kernel/microcode.c	Fri Sep 14 14:04:08 2001
@@ -126,6 +126,7 @@
 		printk(KERN_ERR "microcode: failed to devfs_register()\n");
 		goto out;
 	}
+	error = 0;
 	printk(KERN_INFO 
 		"IA-32 Microcode Update Driver: v%s <tigran@veritas.com>\n", 
 		MICROCODE_VERSION);
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/mpparse.c linux/arch/i386/kernel/mpparse.c
--- v2.4.9/linux/arch/i386/kernel/mpparse.c	Sun Aug 12 13:27:58 2001
+++ linux/arch/i386/kernel/mpparse.c	Mon Sep 17 23:03:09 2001
@@ -38,6 +38,18 @@
 int mp_bus_id_to_type [MAX_MP_BUSSES];
 int mp_bus_id_to_pci_bus [MAX_MP_BUSSES] = { [0 ... MAX_MP_BUSSES-1] = -1 };
 int mp_current_pci_id;
+
+/* I/O APIC entries */
+struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS];
+
+/* # of MP IRQ source entries */
+struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
+
+/* MP IRQ source entries */
+int mp_irq_entries;
+
+int nr_ioapics;
+
 int pic_mode;
 unsigned long mp_lapic_addr;
 
@@ -225,6 +237,11 @@
 			MAX_IO_APICS, nr_ioapics);
 		panic("Recompile kernel with bigger MAX_IO_APICS!.\n");
 	}
+	if (!m->mpc_apicaddr) {
+		printk(KERN_ERR "WARNING: bogus zero I/O APIC address"
+			" found in MP table, skipping!\n");
+		return;
+	}
 	mp_ioapics[nr_ioapics] = *m;
 	nr_ioapics++;
 }
@@ -365,10 +382,19 @@
 	return num_processors;
 }
 
+static int __init ELCR_trigger(unsigned int irq)
+{
+	unsigned int port;
+
+	port = 0x4d0 + (irq >> 3);
+	return (inb(port) >> (irq & 7)) & 1;
+}
+
 static void __init construct_default_ioirq_mptable(int mpc_default_type)
 {
 	struct mpc_config_intsrc intsrc;
 	int i;
+	int ELCR_fallback = 0;
 
 	intsrc.mpc_type = MP_INTSRC;
 	intsrc.mpc_irqflag = 0;			/* conforming */
@@ -376,6 +402,26 @@
 	intsrc.mpc_dstapic = mp_ioapics[0].mpc_apicid;
 
 	intsrc.mpc_irqtype = mp_INT;
+
+	/*
+	 *  If true, we have an ISA/PCI system with no IRQ entries
+	 *  in the MP table. To prevent the PCI interrupts from being set up
+	 *  incorrectly, we try to use the ELCR. The sanity check to see if
+	 *  there is good ELCR data is very simple - IRQ0, 1, 2 and 13 can
+	 *  never be level sensitive, so we simply see if the ELCR agrees.
+	 *  If it does, we assume it's valid.
+	 */
+	if (mpc_default_type == 5) {
+		printk("ISA/PCI bus type with no IRQ information... falling back to ELCR\n");
+
+		if (ELCR_trigger(0) || ELCR_trigger(1) || ELCR_trigger(2) || ELCR_trigger(13))
+			printk("ELCR contains invalid data... not using ELCR\n");
+		else {
+			printk("Using ELCR to identify PCI interrupts\n");
+			ELCR_fallback = 1;
+		}
+	}
+
 	for (i = 0; i < 16; i++) {
 		switch (mpc_default_type) {
 		case 2:
@@ -387,6 +433,18 @@
 				continue;	/* IRQ2 is never connected */
 		}
 
+		if (ELCR_fallback) {
+			/*
+			 *  If the ELCR indicates a level-sensitive interrupt, we
+			 *  copy that information over to the MP table in the
+			 *  irqflag field (level sensitive, active high polarity).
+			 */
+			if (ELCR_trigger(i))
+				intsrc.mpc_irqflag = 13;
+			else
+				intsrc.mpc_irqflag = 0;
+		}
+
 		intsrc.mpc_srcbusirq = i;
 		intsrc.mpc_dstirq = i ? i : 2;		/* IRQ0 to INTIN2 */
 		MP_intsrc_info(&intsrc);
@@ -641,7 +699,7 @@
  */
 void __init find_smp_config (void)
 {
-#ifdef CONFIG_X86_IO_APIC
+#ifdef CONFIG_X86_LOCAL_APIC
 	find_intel_smp();
 #endif
 #ifdef CONFIG_VISWS
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/mtrr.c linux/arch/i386/kernel/mtrr.c
--- v2.4.9/linux/arch/i386/kernel/mtrr.c	Thu May 24 15:14:08 2001
+++ linux/arch/i386/kernel/mtrr.c	Fri Sep 21 10:55:22 2001
@@ -389,21 +389,19 @@
 	 return;
 
     /*  Save value of CR4 and clear Page Global Enable (bit 7)  */
-    if ( test_bit(X86_FEATURE_PGE, &boot_cpu_data.x86_capability) )
-	asm volatile ("movl  %%cr4, %0\n\t"
-		      "movl  %0, %1\n\t"
-		      "andb  $0x7f, %b1\n\t"
-		      "movl  %1, %%cr4\n\t"
-		      : "=r" (ctxt->cr4val), "=q" (tmp) : : "memory");
+    if ( test_bit(X86_FEATURE_PGE, &boot_cpu_data.x86_capability) ) {
+	ctxt->cr4val = read_cr4();
+	write_cr4(ctxt->cr4val & (unsigned char) ~(1<<7));
+    }
 
     /*  Disable and flush caches. Note that wbinvd flushes the TLBs as
 	a side-effect  */
-    asm volatile ("movl  %%cr0, %0\n\t"
-		  "orl   $0x40000000, %0\n\t"
-		  "wbinvd\n\t"
-		  "movl  %0, %%cr0\n\t"
-		  "wbinvd\n\t"
-		  : "=r" (tmp) : : "memory");
+    {
+	unsigned int cr0 = read_cr0() | 0x40000000;
+	wbinvd();
+	write_cr0( cr0 );
+	wbinvd();
+    }
 
     if ( mtrr_if == MTRR_IF_INTEL ) {
 	/*  Disable MTRRs, and set the default type to uncached  */
@@ -420,15 +418,13 @@
 /*  Restore the processor after a set_mtrr_prepare  */
 static void set_mtrr_done (struct set_mtrr_context *ctxt)
 {
-    unsigned long tmp;
-
     if ( mtrr_if != MTRR_IF_INTEL && mtrr_if != MTRR_IF_CYRIX_ARR ) {
 	 __restore_flags (ctxt->flags);
 	 return;
     }
 
     /*  Flush caches and TLBs  */
-    asm volatile ("wbinvd" : : : "memory" );
+    wbinvd();
 
     /*  Restore MTRRdefType  */
     if ( mtrr_if == MTRR_IF_INTEL ) {
@@ -440,15 +436,11 @@
     }
 
     /*  Enable caches  */
-    asm volatile ("movl  %%cr0, %0\n\t"
-		  "andl  $0xbfffffff, %0\n\t"
-		  "movl  %0, %%cr0\n\t"
-		  : "=r" (tmp) : : "memory");
+    write_cr0( read_cr0() & 0xbfffffff );
 
     /*  Restore value of CR4  */
     if ( test_bit(X86_FEATURE_PGE, &boot_cpu_data.x86_capability) )
-	asm volatile ("movl  %0, %%cr4"
-		      : : "r" (ctxt->cr4val) : "memory");
+	write_cr4(ctxt->cr4val);
 
     /*  Re-enable interrupts locally (if enabled previously)  */
     __restore_flags (ctxt->flags);
@@ -607,7 +599,7 @@
 {
     unsigned long low, high;
 
-    rdmsr (0xC0000085, low, high);
+    rdmsr (MSR_K6_UWCCR, low, high);
     /*  Upper dword is region 1, lower is region 0  */
     if (reg == 1) low = high;
     /*  The base masks off on the right alignment  */
@@ -771,7 +763,7 @@
     /*
      *	Low is MTRR0 , High MTRR 1
      */
-    rdmsr (0xC0000085, regs[0], regs[1]);
+    rdmsr (MSR_K6_UWCCR, regs[0], regs[1]);
     /*
      *	Blank to disable
      */
@@ -792,8 +784,8 @@
      *	The writeback rule is quite specific. See the manual. Its
      *	disable local interrupts, write back the cache, set the mtrr
      */
-    __asm__ __volatile__ ("wbinvd" : : : "memory");
-    wrmsr (0xC0000085, regs[0], regs[1]);
+	wbinvd();
+	wrmsr (MSR_K6_UWCCR, regs[0], regs[1]);
     if (do_safe) set_mtrr_done (&ctxt);
 }   /*  End Function amd_set_mtrr_up  */
 
@@ -826,7 +818,7 @@
     }
     centaur_mcr[reg].high = high;
     centaur_mcr[reg].low = low;
-    wrmsr (0x110 + reg, low, high);
+    wrmsr (MSR_IDT_MCR0 + reg, low, high);
     if (do_safe) set_mtrr_done( &ctxt );
 }   /*  End Function centaur_set_mtrr_up  */
 
@@ -2012,12 +2004,12 @@
      * find out what the bios might have done.
      */
      
-    rdmsr(0x120, lo, hi);
+    rdmsr(MSR_IDT_MCR_CTRL, lo, hi);
     if(((lo>>17)&7)==1)		/* Type 1 Winchip2 MCR */
     {
     	lo&= ~0x1C0;		/* clear key */
     	lo|= 0x040;		/* set key to 1 */
-	wrmsr(0x120, lo, hi);	/* unlock MCR */
+	wrmsr(MSR_IDT_MCR_CTRL, lo, hi);	/* unlock MCR */
     }    
     
     centaur_mcr_type = 1;
@@ -2031,7 +2023,7 @@
     	if(centaur_mcr[i]. high == 0 && centaur_mcr[i].low == 0)
     	{
     		if(!(lo & (1<<(9+i))))
-			wrmsr (0x110 + i , 0, 0);
+			wrmsr (MSR_IDT_MCR0 + i , 0, 0);
 		else
 			/*
 			 *	If the BIOS set up an MCR we cannot see it
@@ -2047,7 +2039,7 @@
      */
 
     lo |= 15;			/* Write combine enables */
-    wrmsr(0x120, lo, hi);
+    wrmsr(MSR_IDT_MCR_CTRL, lo, hi);
 }   /*  End Function centaur_mcr1_init  */
 
 /*
@@ -2071,10 +2063,10 @@
     for (i = 0; i < 8; ++i)
     {
     	if(centaur_mcr[i]. high == 0 && centaur_mcr[i].low == 0)
-		wrmsr (0x110 + i , 0, 0);
+		wrmsr (MSR_IDT_MCR0 + i , 0, 0);
     }
 
-    wrmsr(0x120, 0x01F0001F, 0);	/* Write only */
+    wrmsr(MSR_IDT_MCR_CTRL, 0x01F0001F, 0);	/* Write only */
 }   /*  End Function centaur_mcr0_init  */
 
 /*
@@ -2231,6 +2223,8 @@
 	 */
 	cyrix_arr_init_secondary ();
 	break;
+    case MTRR_IF_NONE:
+	break;
     default:
 	/* I see no MTRRs I can support in SMP mode... */
 	printk ("mtrr: SMP support incomplete for this vendor\n");
@@ -2259,11 +2253,9 @@
 	proc_root_mtrr->proc_fops = &mtrr_fops;
     }
 #endif
-#ifdef CONFIG_DEVFS_FS
     devfs_handle = devfs_register (NULL, "cpu/mtrr", DEVFS_FL_DEFAULT, 0, 0,
 				   S_IFREG | S_IRUGO | S_IWUSR,
 				   &mtrr_fops, NULL);
-#endif
     init_table ();
     return 0;
 }   /*  End Function mtrr_init  */
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/nmi.c linux/arch/i386/kernel/nmi.c
--- v2.4.9/linux/arch/i386/kernel/nmi.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/i386/kernel/nmi.c	Thu Sep 20 20:55:24 2001
@@ -0,0 +1,300 @@
+/*
+ *  linux/arch/i386/nmi.c
+ *
+ *  NMI watchdog support on APIC systems
+ *
+ *  Started by Ingo Molnar <mingo@redhat.com>
+ *
+ *  Fixes:
+ *  Mikael Pettersson	: AMD K7 support for local APIC NMI watchdog.
+ *  Mikael Pettersson	: Power Management for local APIC NMI watchdog.
+ */
+
+#include <linux/config.h>
+#include <linux/mm.h>
+#include <linux/irq.h>
+#include <linux/delay.h>
+#include <linux/bootmem.h>
+#include <linux/smp_lock.h>
+#include <linux/interrupt.h>
+#include <linux/mc146818rtc.h>
+#include <linux/kernel_stat.h>
+
+#include <asm/smp.h>
+#include <asm/mtrr.h>
+#include <asm/mpspec.h>
+
+unsigned int nmi_watchdog = NMI_NONE;
+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);
+
+#define K7_EVNTSEL_ENABLE	(1 << 22)
+#define K7_EVNTSEL_INT		(1 << 20)
+#define K7_EVNTSEL_OS		(1 << 17)
+#define K7_EVNTSEL_USR		(1 << 16)
+#define K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING	0x76
+#define K7_NMI_EVENT		K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING
+
+#define P6_EVNTSEL0_ENABLE	(1 << 22)
+#define P6_EVNTSEL_INT		(1 << 20)
+#define P6_EVNTSEL_OS		(1 << 17)
+#define P6_EVNTSEL_USR		(1 << 16)
+#define P6_EVENT_CPU_CLOCKS_NOT_HALTED	0x79
+#define P6_NMI_EVENT		P6_EVENT_CPU_CLOCKS_NOT_HALTED
+
+int __init check_nmi_watchdog (void)
+{
+	irq_cpustat_t tmp[NR_CPUS];
+	int j, cpu;
+
+	printk(KERN_INFO "testing NMI watchdog ... ");
+
+	memcpy(tmp, irq_stat, sizeof(tmp));
+	sti();
+	mdelay((10*1000)/nmi_hz); // wait 10 ticks
+
+	for (j = 0; j < smp_num_cpus; j++) {
+		cpu = cpu_logical_map(j);
+		if (nmi_count(cpu) - tmp[cpu].__nmi_count <= 5) {
+			printk("CPU#%d: NMI appears to be stuck!\n", cpu);
+			return -1;
+		}
+	}
+	printk("OK.\n");
+
+	/* now that we know it works we can reduce NMI frequency to
+	   something more reasonable; makes a difference in some configs */
+	if (nmi_watchdog == NMI_LOCAL_APIC)
+		nmi_hz = 1;
+
+	return 0;
+}
+
+static int __init setup_nmi_watchdog(char *str)
+{
+	int nmi;
+
+	get_option(&str, &nmi);
+
+	if (nmi >= NMI_INVALID)
+		return 0;
+	if (nmi == NMI_NONE)
+		nmi_watchdog = nmi;
+	/*
+	 * If any other x86 CPU has a local APIC, then
+	 * please test the NMI stuff there and send me the
+	 * missing bits. Right now Intel P6 and AMD K7 only.
+	 */
+	if ((nmi == NMI_LOCAL_APIC) &&
+			(boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) &&
+			(boot_cpu_data.x86 == 6))
+		nmi_watchdog = nmi;
+	if ((nmi == NMI_LOCAL_APIC) &&
+			(boot_cpu_data.x86_vendor == X86_VENDOR_AMD) &&
+			(boot_cpu_data.x86 == 6))
+		nmi_watchdog = nmi;
+	/*
+	 * We can enable the IO-APIC watchdog
+	 * unconditionally.
+	 */
+	if (nmi == NMI_IO_APIC)
+		nmi_watchdog = nmi;
+	return 1;
+}
+
+__setup("nmi_watchdog=", setup_nmi_watchdog);
+
+#ifdef CONFIG_PM
+
+#include <linux/pm.h>
+
+struct pm_dev *nmi_pmdev;
+
+static void disable_apic_nmi_watchdog(void)
+{
+	switch (boot_cpu_data.x86_vendor) {
+	case X86_VENDOR_AMD:
+		wrmsr(MSR_K7_EVNTSEL0, 0, 0);
+		break;
+	case X86_VENDOR_INTEL:
+		wrmsr(MSR_IA32_EVNTSEL0, 0, 0);
+		break;
+	}
+}
+
+static int nmi_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
+{
+	switch (rqst) {
+	case PM_SUSPEND:
+		disable_apic_nmi_watchdog();
+		break;
+	case PM_RESUME:
+		setup_apic_nmi_watchdog();
+		break;
+	}
+	return 0;
+}
+
+static void nmi_pm_init(void)
+{
+	if (!nmi_pmdev)
+		nmi_pmdev = apic_pm_register(PM_SYS_DEV, 0, nmi_pm_callback);
+}
+
+#define __pminit	/*empty*/
+
+#else	/* CONFIG_PM */
+
+static inline void nmi_pm_init(void) { }
+
+#define __pminit	__init
+
+#endif	/* CONFIG_PM */
+
+/*
+ * Activate the NMI watchdog via the local APIC.
+ * Original code written by Keith Owens.
+ */
+
+static void __pminit setup_k7_watchdog(void)
+{
+	int i;
+	unsigned int evntsel;
+
+	nmi_perfctr_msr = MSR_K7_PERFCTR0;
+
+	for(i = 0; i < 4; ++i) {
+		wrmsr(MSR_K7_EVNTSEL0+i, 0, 0);
+		wrmsr(MSR_K7_PERFCTR0+i, 0, 0);
+	}
+
+	evntsel = K7_EVNTSEL_INT
+		| K7_EVNTSEL_OS
+		| K7_EVNTSEL_USR
+		| K7_NMI_EVENT;
+
+	wrmsr(MSR_K7_EVNTSEL0, evntsel, 0);
+	Dprintk("setting K7_PERFCTR0 to %08lx\n", -(cpu_khz/nmi_hz*1000));
+	wrmsr(MSR_K7_PERFCTR0, -(cpu_khz/nmi_hz*1000), -1);
+	apic_write(APIC_LVTPC, APIC_DM_NMI);
+	evntsel |= K7_EVNTSEL_ENABLE;
+	wrmsr(MSR_K7_EVNTSEL0, evntsel, 0);
+}
+
+static void __pminit setup_p6_watchdog(void)
+{
+	int i;
+	unsigned int evntsel;
+
+	nmi_perfctr_msr = MSR_IA32_PERFCTR0;
+
+	for(i = 0; i < 2; ++i) {
+		wrmsr(MSR_IA32_EVNTSEL0+i, 0, 0);
+		wrmsr(MSR_IA32_PERFCTR0+i, 0, 0);
+	}
+
+	evntsel = P6_EVNTSEL_INT
+		| P6_EVNTSEL_OS
+		| P6_EVNTSEL_USR
+		| P6_NMI_EVENT;
+
+	wrmsr(MSR_IA32_EVNTSEL0, evntsel, 0);
+	Dprintk("setting IA32_PERFCTR0 to %08lx\n", -(cpu_khz/nmi_hz*1000));
+	wrmsr(MSR_IA32_PERFCTR0, -(cpu_khz/nmi_hz*1000), 0);
+	apic_write(APIC_LVTPC, APIC_DM_NMI);
+	evntsel |= P6_EVNTSEL0_ENABLE;
+	wrmsr(MSR_IA32_EVNTSEL0, evntsel, 0);
+}
+
+void __pminit setup_apic_nmi_watchdog (void)
+{
+	switch (boot_cpu_data.x86_vendor) {
+	case X86_VENDOR_AMD:
+		if (boot_cpu_data.x86 != 6)
+			return;
+		setup_k7_watchdog();
+		break;
+	case X86_VENDOR_INTEL:
+		if (boot_cpu_data.x86 != 6)
+			return;
+		setup_p6_watchdog();
+		break;
+	default:
+		return;
+	}
+	nmi_pm_init();
+}
+
+static spinlock_t nmi_print_lock = SPIN_LOCK_UNLOCKED;
+
+/*
+ * the best way to detect whether a CPU has a 'hard lockup' problem
+ * is to check it's local APIC timer IRQ counts. If they are not
+ * changing then that CPU has some problem.
+ *
+ * as these watchdog NMI IRQs are generated on every CPU, we only
+ * have to check the current processor.
+ *
+ * since NMIs dont listen to _any_ locks, we have to be extremely
+ * careful not to rely on unsafe variables. The printk might lock
+ * up though, so we have to break up any console locks first ...
+ * [when there will be more tty-related locks, break them up
+ *  here too!]
+ */
+
+static unsigned int
+	last_irq_sums [NR_CPUS],
+	alert_counter [NR_CPUS];
+
+void touch_nmi_watchdog (void)
+{
+	int i;
+
+	/*
+	 * Just reset the alert counters, (other CPUs might be
+	 * spinning on locks we hold):
+	 */
+	for (i = 0; i < smp_num_cpus; i++)
+		alert_counter[i] = 0;
+}
+
+void nmi_watchdog_tick (struct pt_regs * regs)
+{
+
+	/*
+	 * Since current-> is always on the stack, and we always switch
+	 * the stack NMI-atomically, it's safe to use smp_processor_id().
+	 */
+	int sum, cpu = smp_processor_id();
+
+	sum = apic_timer_irqs[cpu];
+
+	if (last_irq_sums[cpu] == sum) {
+		/*
+		 * Ayiee, looks like this CPU is stuck ...
+		 * wait a few IRQs (5 seconds) before doing the oops ...
+		 */
+		alert_counter[cpu]++;
+		if (alert_counter[cpu] == 5*nmi_hz) {
+			spin_lock(&nmi_print_lock);
+			/*
+			 * We are in trouble anyway, lets at least try
+			 * to get a message out.
+			 */
+			bust_spinlocks(1);
+			printk("NMI Watchdog detected LOCKUP on CPU%d, registers:\n", cpu);
+			show_registers(regs);
+			printk("console shuts up ...\n");
+			console_silent();
+			spin_unlock(&nmi_print_lock);
+			bust_spinlocks(0);
+			do_exit(SIGSEGV);
+		}
+	} else {
+		last_irq_sums[cpu] = sum;
+		alert_counter[cpu] = 0;
+	}
+	if (nmi_perfctr_msr)
+		wrmsr(nmi_perfctr_msr, -(cpu_khz/nmi_hz*1000), -1);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/pci-pc.c linux/arch/i386/kernel/pci-pc.c
--- v2.4.9/linux/arch/i386/kernel/pci-pc.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/i386/kernel/pci-pc.c	Sat Sep  1 11:01:28 2001
@@ -20,65 +20,145 @@
 unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2;
 
 int pcibios_last_bus = -1;
-struct pci_bus *pci_root_bus;
-struct pci_ops *pci_root_ops;
+struct pci_bus *pci_root_bus = NULL;
+struct pci_ops *pci_root_ops = NULL;
+
+int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value) = NULL;
+int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value) = NULL;
 
 /*
- * Direct access to PCI hardware...
+ * This interrupt-safe spinlock protects all accesses to PCI
+ * configuration space.
  */
+spinlock_t pci_config_lock = SPIN_LOCK_UNLOCKED;
 
-#ifdef CONFIG_PCI_DIRECT
 
 /*
  * Functions for accessing PCI configuration space with type 1 accesses
  */
 
-#define CONFIG_CMD(dev, where)   (0x80000000 | (dev->bus->number << 16) | (dev->devfn << 8) | (where & ~3))
+#ifdef CONFIG_PCI_DIRECT
+
+#define PCI_CONF1_ADDRESS(bus, dev, fn, reg) \
+	(0x80000000 | (bus << 16) | (dev << 11) | (fn << 8) | (reg & ~3))
+
+static int pci_conf1_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
+{
+	unsigned long flags;
+
+	if (!value || (bus > 255) || (dev > 31) || (fn > 7) || (reg > 255))
+		return -EINVAL;
+
+	spin_lock_irqsave(&pci_config_lock, flags);
+
+	outl(PCI_CONF1_ADDRESS(bus, dev, fn, reg), 0xCF8);
+
+	switch (len) {
+	case 1:
+		*value = inb(0xCFC + (reg & 3));
+		break;
+	case 2:
+		*value = inw(0xCFC + (reg & 2));
+		break;
+	case 4:
+		*value = inl(0xCFC);
+		break;
+	}
+
+	spin_unlock_irqrestore(&pci_config_lock, flags);
+
+	return 0;
+}
+
+static int pci_conf1_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+{
+	unsigned long flags;
+
+	if ((bus > 255) || (dev > 31) || (fn > 7) || (reg > 255)) 
+		return -EINVAL;
+
+	spin_lock_irqsave(&pci_config_lock, flags);
+
+	outl(PCI_CONF1_ADDRESS(bus, dev, fn, reg), 0xCF8);
+
+	switch (len) {
+	case 1:
+		outb((u8)value, 0xCFC + (reg & 3));
+		break;
+	case 2:
+		outw((u16)value, 0xCFC + (reg & 2));
+		break;
+	case 4:
+		outl((u32)value, 0xCFC);
+		break;
+	}
+
+	spin_unlock_irqrestore(&pci_config_lock, flags);
+
+	return 0;
+}
+
+#undef PCI_CONF1_ADDRESS
 
 static int pci_conf1_read_config_byte(struct pci_dev *dev, int where, u8 *value)
 {
-	outl(CONFIG_CMD(dev,where), 0xCF8);
-	*value = inb(0xCFC + (where&3));
-	return PCIBIOS_SUCCESSFUL;
+	int result; 
+	u32 data;
+
+	if (!value) 
+		return -EINVAL;
+
+	result = pci_conf1_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 1, &data);
+
+	*value = (u8)data;
+
+	return result;
 }
 
 static int pci_conf1_read_config_word(struct pci_dev *dev, int where, u16 *value)
 {
-	outl(CONFIG_CMD(dev,where), 0xCF8);    
-	*value = inw(0xCFC + (where&2));
-	return PCIBIOS_SUCCESSFUL;    
+	int result; 
+	u32 data;
+
+	if (!value) 
+		return -EINVAL;
+
+	result = pci_conf1_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 2, &data);
+
+	*value = (u16)data;
+
+	return result;
 }
 
 static int pci_conf1_read_config_dword(struct pci_dev *dev, int where, u32 *value)
 {
-	outl(CONFIG_CMD(dev,where), 0xCF8);
-	*value = inl(0xCFC);
-	return PCIBIOS_SUCCESSFUL;    
+	if (!value) 
+		return -EINVAL;
+
+	return pci_conf1_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 4, value);
 }
 
 static int pci_conf1_write_config_byte(struct pci_dev *dev, int where, u8 value)
 {
-	outl(CONFIG_CMD(dev,where), 0xCF8);    
-	outb(value, 0xCFC + (where&3));
-	return PCIBIOS_SUCCESSFUL;
+	return pci_conf1_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 1, value);
 }
 
 static int pci_conf1_write_config_word(struct pci_dev *dev, int where, u16 value)
 {
-	outl(CONFIG_CMD(dev,where), 0xCF8);
-	outw(value, 0xCFC + (where&2));
-	return PCIBIOS_SUCCESSFUL;
+	return pci_conf1_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 2, value);
 }
 
 static int pci_conf1_write_config_dword(struct pci_dev *dev, int where, u32 value)
 {
-	outl(CONFIG_CMD(dev,where), 0xCF8);
-	outl(value, 0xCFC);
-	return PCIBIOS_SUCCESSFUL;
+	return pci_conf1_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 4, value);
 }
 
-#undef CONFIG_CMD
-
 static struct pci_ops pci_direct_conf1 = {
 	pci_conf1_read_config_byte,
 	pci_conf1_read_config_word,
@@ -88,68 +168,131 @@
 	pci_conf1_write_config_dword
 };
 
+
 /*
  * Functions for accessing PCI configuration space with type 2 accesses
  */
 
-#define IOADDR(devfn, where)	((0xC000 | ((devfn & 0x78) << 5)) + where)
-#define FUNC(devfn)		(((devfn & 7) << 1) | 0xf0)
-#define SET(dev)		if (dev->devfn & 0x80) return PCIBIOS_DEVICE_NOT_FOUND;		\
-				outb(FUNC(dev->devfn), 0xCF8);					\
-				outb(dev->bus->number, 0xCFA);
+#define PCI_CONF2_ADDRESS(dev, reg)	(u16)(0xC000 | (dev << 8) | reg)
 
-static int pci_conf2_read_config_byte(struct pci_dev *dev, int where, u8 *value)
+static int pci_conf2_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
 {
-	SET(dev);
-	*value = inb(IOADDR(dev->devfn,where));
+	unsigned long flags;
+
+	if (!value || (bus > 255) || (dev > 31) || (fn > 7) || (reg > 255))
+		return -EINVAL;
+
+	if (dev & 0x10) 
+		return PCIBIOS_DEVICE_NOT_FOUND;
+
+	spin_lock_irqsave(&pci_config_lock, flags);
+
+	outb((u8)(0xF0 | (fn << 1)), 0xCF8);
+	outb((u8)bus, 0xCFA);
+
+	switch (len) {
+	case 1:
+		*value = inb(PCI_CONF2_ADDRESS(dev, reg));
+		break;
+	case 2:
+		*value = inw(PCI_CONF2_ADDRESS(dev, reg));
+		break;
+	case 4:
+		*value = inl(PCI_CONF2_ADDRESS(dev, reg));
+		break;
+	}
+
 	outb (0, 0xCF8);
-	return PCIBIOS_SUCCESSFUL;
+
+	spin_unlock_irqrestore(&pci_config_lock, flags);
+
+	return 0;
+}
+
+static int pci_conf2_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+{
+	unsigned long flags;
+
+	if ((bus > 255) || (dev > 31) || (fn > 7) || (reg > 255)) 
+		return -EINVAL;
+
+	if (dev & 0x10) 
+		return PCIBIOS_DEVICE_NOT_FOUND;
+
+	spin_lock_irqsave(&pci_config_lock, flags);
+
+	outb((u8)(0xF0 | (fn << 1)), 0xCF8);
+	outb((u8)bus, 0xCFA);
+
+	switch (len) {
+	case 1:
+		outb ((u8)value, PCI_CONF2_ADDRESS(dev, reg));
+		break;
+	case 2:
+		outw ((u16)value, PCI_CONF2_ADDRESS(dev, reg));
+		break;
+	case 4:
+		outl ((u32)value, PCI_CONF2_ADDRESS(dev, reg));
+		break;
+	}
+
+	outb (0, 0xCF8);    
+
+	spin_unlock_irqrestore(&pci_config_lock, flags);
+
+	return 0;
+}
+
+#undef PCI_CONF2_ADDRESS
+
+static int pci_conf2_read_config_byte(struct pci_dev *dev, int where, u8 *value)
+{
+	int result; 
+	u32 data;
+	result = pci_conf2_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 1, &data);
+	*value = (u8)data;
+	return result;
 }
 
 static int pci_conf2_read_config_word(struct pci_dev *dev, int where, u16 *value)
 {
-	SET(dev);
-	*value = inw(IOADDR(dev->devfn,where));
-	outb (0, 0xCF8);
-	return PCIBIOS_SUCCESSFUL;
+	int result; 
+	u32 data;
+	result = pci_conf2_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 2, &data);
+	*value = (u8)data;
+	return result;
 }
 
 static int pci_conf2_read_config_dword(struct pci_dev *dev, int where, u32 *value)
 {
-	SET(dev);
-	*value = inl (IOADDR(dev->devfn,where));    
-	outb (0, 0xCF8);    
-	return PCIBIOS_SUCCESSFUL;
+	int result; 
+	u32 data;
+	result = pci_conf2_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 4, &data);
+	*value = (u8)data;
+	return result;
 }
 
 static int pci_conf2_write_config_byte(struct pci_dev *dev, int where, u8 value)
 {
-	SET(dev);
-	outb (value, IOADDR(dev->devfn,where));
-	outb (0, 0xCF8);    
-	return PCIBIOS_SUCCESSFUL;
+	return pci_conf2_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 1, value);
 }
 
 static int pci_conf2_write_config_word(struct pci_dev *dev, int where, u16 value)
 {
-	SET(dev);
-	outw (value, IOADDR(dev->devfn,where));
-	outb (0, 0xCF8);    
-	return PCIBIOS_SUCCESSFUL;
+	return pci_conf2_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 2, value);
 }
 
 static int pci_conf2_write_config_dword(struct pci_dev *dev, int where, u32 value)
 {
-	SET(dev);
-	outl (value, IOADDR(dev->devfn,where));    
-	outb (0, 0xCF8);    
-	return PCIBIOS_SUCCESSFUL;
+	return pci_conf2_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 4, value);
 }
 
-#undef SET
-#undef IOADDR
-#undef FUNC
-
 static struct pci_ops pci_direct_conf2 = {
 	pci_conf2_read_config_byte,
 	pci_conf2_read_config_word,
@@ -159,6 +302,7 @@
 	pci_conf2_write_config_dword
 };
 
+
 /*
  * Before we decide to use direct hardware access mechanisms, we try to do some
  * trivial checks to ensure it at least _seems_ to be working -- we just test
@@ -420,114 +564,176 @@
 	return (int) (ret & 0xff00) >> 8;
 }
 
+static int pci_bios_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
+{
+	unsigned long result = 0;
+	unsigned long flags;
+	unsigned long bx = ((bus << 8) | (dev << 3) | fn);
+
+	if (!value || (bus > 255) || (dev > 31) || (fn > 7) || (reg > 255))
+		return -EINVAL;
+
+	spin_lock_irqsave(&pci_config_lock, flags);
+
+	switch (len) {
+	case 1:
+		__asm__("lcall (%%esi); cld\n\t"
+			"jc 1f\n\t"
+			"xor %%ah, %%ah\n"
+			"1:"
+			: "=c" (*value),
+			  "=a" (result)
+			: "1" (PCIBIOS_READ_CONFIG_BYTE),
+			  "b" (bx),
+			  "D" ((long)reg),
+			  "S" (&pci_indirect));
+		break;
+	case 2:
+		__asm__("lcall (%%esi); cld\n\t"
+			"jc 1f\n\t"
+			"xor %%ah, %%ah\n"
+			"1:"
+			: "=c" (*value),
+			  "=a" (result)
+			: "1" (PCIBIOS_READ_CONFIG_WORD),
+			  "b" (bx),
+			  "D" ((long)reg),
+			  "S" (&pci_indirect));
+		break;
+	case 4:
+		__asm__("lcall (%%esi); cld\n\t"
+			"jc 1f\n\t"
+			"xor %%ah, %%ah\n"
+			"1:"
+			: "=c" (*value),
+			  "=a" (result)
+			: "1" (PCIBIOS_READ_CONFIG_DWORD),
+			  "b" (bx),
+			  "D" ((long)reg),
+			  "S" (&pci_indirect));
+		break;
+	}
+
+	spin_unlock_irqrestore(&pci_config_lock, flags);
+
+	return (int)((result & 0xff00) >> 8);
+}
+
+static int pci_bios_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+{
+	unsigned long result = 0;
+	unsigned long flags;
+	unsigned long bx = ((bus << 8) | (dev << 3) | fn);
+
+	if ((bus > 255) || (dev > 31) || (fn > 7) || (reg > 255)) 
+		return -EINVAL;
+
+	spin_lock_irqsave(&pci_config_lock, flags);
+
+	switch (len) {
+	case 1:
+		__asm__("lcall (%%esi); cld\n\t"
+			"jc 1f\n\t"
+			"xor %%ah, %%ah\n"
+			"1:"
+			: "=a" (result)
+			: "0" (PCIBIOS_WRITE_CONFIG_BYTE),
+			  "c" (value),
+			  "b" (bx),
+			  "D" ((long)reg),
+			  "S" (&pci_indirect));
+		break;
+	case 2:
+		__asm__("lcall (%%esi); cld\n\t"
+			"jc 1f\n\t"
+			"xor %%ah, %%ah\n"
+			"1:"
+			: "=a" (result)
+			: "0" (PCIBIOS_WRITE_CONFIG_WORD),
+			  "c" (value),
+			  "b" (bx),
+			  "D" ((long)reg),
+			  "S" (&pci_indirect));
+		break;
+	case 4:
+		__asm__("lcall (%%esi); cld\n\t"
+			"jc 1f\n\t"
+			"xor %%ah, %%ah\n"
+			"1:"
+			: "=a" (result)
+			: "0" (PCIBIOS_WRITE_CONFIG_DWORD),
+			  "c" (value),
+			  "b" (bx),
+			  "D" ((long)reg),
+			  "S" (&pci_indirect));
+		break;
+	}
+
+	spin_unlock_irqrestore(&pci_config_lock, flags);
+
+	return (int)((result & 0xff00) >> 8);
+}
+
 static int pci_bios_read_config_byte(struct pci_dev *dev, int where, u8 *value)
 {
-	unsigned long ret;
-	unsigned long bx = (dev->bus->number << 8) | dev->devfn;
+	int result; 
+	u32 data;
 
-	__asm__("lcall (%%esi); cld\n\t"
-		"jc 1f\n\t"
-		"xor %%ah, %%ah\n"
-		"1:"
-		: "=c" (*value),
-		  "=a" (ret)
-		: "1" (PCIBIOS_READ_CONFIG_BYTE),
-		  "b" (bx),
-		  "D" ((long) where),
-		  "S" (&pci_indirect));
-	return (int) (ret & 0xff00) >> 8;
+	if (!value) 
+		return -EINVAL;
+
+	result = pci_bios_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 1, &data);
+
+	*value = (u8)data;
+
+	return result;
 }
 
 static int pci_bios_read_config_word(struct pci_dev *dev, int where, u16 *value)
 {
-	unsigned long ret;
-	unsigned long bx = (dev->bus->number << 8) | dev->devfn;
+	int result; 
+	u32 data;
 
-	__asm__("lcall (%%esi); cld\n\t"
-		"jc 1f\n\t"
-		"xor %%ah, %%ah\n"
-		"1:"
-		: "=c" (*value),
-		  "=a" (ret)
-		: "1" (PCIBIOS_READ_CONFIG_WORD),
-		  "b" (bx),
-		  "D" ((long) where),
-		  "S" (&pci_indirect));
-	return (int) (ret & 0xff00) >> 8;
+	if (!value) 
+		return -EINVAL;
+
+	result = pci_bios_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 2, &data);
+
+	*value = (u16)data;
+
+	return result;
 }
 
 static int pci_bios_read_config_dword(struct pci_dev *dev, int where, u32 *value)
 {
-	unsigned long ret;
-	unsigned long bx = (dev->bus->number << 8) | dev->devfn;
-
-	__asm__("lcall (%%esi); cld\n\t"
-		"jc 1f\n\t"
-		"xor %%ah, %%ah\n"
-		"1:"
-		: "=c" (*value),
-		  "=a" (ret)
-		: "1" (PCIBIOS_READ_CONFIG_DWORD),
-		  "b" (bx),
-		  "D" ((long) where),
-		  "S" (&pci_indirect));
-	return (int) (ret & 0xff00) >> 8;
+	if (!value) 
+		return -EINVAL;
+	
+	return pci_bios_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 4, value);
 }
 
 static int pci_bios_write_config_byte(struct pci_dev *dev, int where, u8 value)
 {
-	unsigned long ret;
-	unsigned long bx = (dev->bus->number << 8) | dev->devfn;
-
-	__asm__("lcall (%%esi); cld\n\t"
-		"jc 1f\n\t"
-		"xor %%ah, %%ah\n"
-		"1:"
-		: "=a" (ret)
-		: "0" (PCIBIOS_WRITE_CONFIG_BYTE),
-		  "c" (value),
-		  "b" (bx),
-		  "D" ((long) where),
-		  "S" (&pci_indirect));
-	return (int) (ret & 0xff00) >> 8;
+	return pci_bios_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 1, value);
 }
 
 static int pci_bios_write_config_word(struct pci_dev *dev, int where, u16 value)
 {
-	unsigned long ret;
-	unsigned long bx = (dev->bus->number << 8) | dev->devfn;
-
-	__asm__("lcall (%%esi); cld\n\t"
-		"jc 1f\n\t"
-		"xor %%ah, %%ah\n"
-		"1:"
-		: "=a" (ret)
-		: "0" (PCIBIOS_WRITE_CONFIG_WORD),
-		  "c" (value),
-		  "b" (bx),
-		  "D" ((long) where),
-		  "S" (&pci_indirect));
-	return (int) (ret & 0xff00) >> 8;
+	return pci_bios_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 2, value);
 }
 
 static int pci_bios_write_config_dword(struct pci_dev *dev, int where, u32 value)
 {
-	unsigned long ret;
-	unsigned long bx = (dev->bus->number << 8) | dev->devfn;
-
-	__asm__("lcall (%%esi); cld\n\t"
-		"jc 1f\n\t"
-		"xor %%ah, %%ah\n"
-		"1:"
-		: "=a" (ret)
-		: "0" (PCIBIOS_WRITE_CONFIG_DWORD),
-		  "c" (value),
-		  "b" (bx),
-		  "D" ((long) where),
-		  "S" (&pci_indirect));
-	return (int) (ret & 0xff00) >> 8;
+	return pci_bios_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, 4, value);
 }
 
+
 /*
  * Function table for BIOS32 access
  */
@@ -981,34 +1187,47 @@
 	pci_read_bridge_bases(b);
 }
 
-/*
- * Initialization. Try all known PCI access methods. Note that we support
- * using both PCI BIOS and direct access: in such cases, we use I/O ports
- * to access config space, but we still keep BIOS order of cards to be
- * compatible with 2.0.X. This should go away some day.
- */
 
-void __init pcibios_init(void)
+void __init pcibios_config_init(void)
 {
-	struct pci_ops *bios = NULL;
-	struct pci_ops *dir = NULL;
+	/*
+	 * Try all known PCI access methods. Note that we support using 
+	 * both PCI BIOS and direct access, with a preference for direct.
+	 */
 
 #ifdef CONFIG_PCI_BIOS
-	if ((pci_probe & PCI_PROBE_BIOS) && ((bios = pci_find_bios()))) {
+	if ((pci_probe & PCI_PROBE_BIOS) 
+		&& ((pci_root_ops = pci_find_bios()))) {
 		pci_probe |= PCI_BIOS_SORT;
 		pci_bios_present = 1;
+		pci_config_read = pci_bios_read;
+		pci_config_write = pci_bios_write;
 	}
 #endif
+
 #ifdef CONFIG_PCI_DIRECT
-	if (pci_probe & (PCI_PROBE_CONF1 | PCI_PROBE_CONF2))
-		dir = pci_check_direct();
+	if ((pci_probe & (PCI_PROBE_CONF1 | PCI_PROBE_CONF2)) 
+		&& (pci_root_ops = pci_check_direct())) {
+		if (pci_root_ops == &pci_direct_conf1) {
+			pci_config_read = pci_conf1_read;
+			pci_config_write = pci_conf1_write;
+		}
+		else {
+			pci_config_read = pci_conf2_read;
+			pci_config_write = pci_conf2_write;
+		}
+	}
 #endif
-	if (dir)
-		pci_root_ops = dir;
-	else if (bios)
-		pci_root_ops = bios;
-	else {
-		printk("PCI: No PCI bus detected\n");
+
+	return;
+}
+
+void __init pcibios_init(void)
+{
+	if (!pci_root_ops)
+		pcibios_config_init();
+	if (!pci_root_ops) {
+		printk("PCI: System does not support PCI\n");
 		return;
 	}
 
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
--- v2.4.9/linux/arch/i386/kernel/process.c	Sun Aug 12 13:27:58 2001
+++ linux/arch/i386/kernel/process.c	Mon Sep 17 22:52:35 2001
@@ -154,6 +154,12 @@
 static int reboot_mode;
 int reboot_thru_bios;
 
+#ifdef CONFIG_SMP
+int reboot_smp = 0;
+static int reboot_cpu = -1;
+/* shamelessly grabbed from lib/vsprintf.c for readability */
+#define is_digit(c)	((c) >= '0' && (c) <= '9')
+#endif
 static int __init reboot_setup(char *str)
 {
 	while(1) {
@@ -170,6 +176,19 @@
 		case 'h': /* "hard" reboot by toggling RESET and/or crashing the CPU */
 			reboot_thru_bios = 0;
 			break;
+#ifdef CONFIG_SMP
+		case 's': /* "smp" reboot by executing reset on BSP or other CPU*/
+			reboot_smp = 1;
+			if (is_digit(*(str+1))) {
+				reboot_cpu = (int) (*(str+1) - '0');
+				if (is_digit(*(str+2))) 
+					reboot_cpu = reboot_cpu*10 + (int)(*(str+2) - '0');
+			}
+				/* we will leave sorting out the final value 
+				when we are ready to reboot, since we might not
+ 				have set up boot_cpu_id or smp_num_cpu */
+			break;
+#endif
 		}
 		if((str = strchr(str,',')) != NULL)
 			str++;
@@ -346,6 +365,34 @@
 void machine_restart(char * __unused)
 {
 #if CONFIG_SMP
+	int cpuid;
+	
+	cpuid = GET_APIC_ID(apic_read(APIC_ID));
+
+	if (reboot_smp) {
+
+		/* check to see if reboot_cpu is valid 
+		   if its not, default to the BSP */
+		if ((reboot_cpu == -1) ||  
+		      (reboot_cpu > (NR_CPUS -1))  || 
+		      !(phys_cpu_present_map & (1<<cpuid))) 
+			reboot_cpu = boot_cpu_id;
+
+		reboot_smp = 0;  /* use this as a flag to only go through this once*/
+		/* re-run this function on the other CPUs
+		   it will fall though this section since we have 
+		   cleared reboot_smp, and do the reboot if it is the
+		   correct CPU, otherwise it halts. */
+		if (reboot_cpu != cpuid)
+			smp_call_function((void *)machine_restart , NULL, 1, 0);
+	}
+
+	/* if reboot_cpu is still -1, then we want a tradional reboot, 
+	   and if we are not running on the reboot_cpu,, halt */
+	if ((reboot_cpu != -1) && (cpuid != reboot_cpu)) {
+		for (;;)
+		__asm__ __volatile__ ("hlt");
+	}
 	/*
 	 * Stop all CPUs and turn off local APICs and the IO-APIC, so
 	 * other OSs see a clean IRQ state.
@@ -391,6 +438,7 @@
 	unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;
 
 	printk("\n");
+	printk("Pid: %d, comm: %20s\n", current->pid, current->comm);
 	printk("EIP: %04x:[<%08lx>] CPU: %d",0xffff & regs->xcs,regs->eip, smp_processor_id());
 	if (regs->xcs & 3)
 		printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp);
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/ptrace.c linux/arch/i386/kernel/ptrace.c
--- v2.4.9/linux/arch/i386/kernel/ptrace.c	Wed Jul 25 17:10:17 2001
+++ linux/arch/i386/kernel/ptrace.c	Tue Sep 18 17:04:23 2001
@@ -134,6 +134,19 @@
 	return retval;
 }
 
+/*
+ * Called by kernel/ptrace.c when detaching..
+ *
+ * Make sure the single step bit is not set.
+ */
+void ptrace_disable(struct task_struct *child)
+{ 
+	long tmp;
+
+	tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG;
+	put_stack_long(child, EFL_OFFSET, tmp);
+}
+
 asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 {
 	struct task_struct *child;
@@ -202,7 +215,7 @@
 			break;
 
 		tmp = 0;  /* Default return condition */
-		if(addr < 17*sizeof(long))
+		if(addr < FRAME_SIZE*sizeof(long))
 			tmp = getreg(child, addr);
 		if(addr >= (long) &dummy->u_debugreg[0] &&
 		   addr <= (long) &dummy->u_debugreg[7]){
@@ -229,7 +242,7 @@
 		    addr > sizeof(struct user) - 3)
 			break;
 
-		if (addr < 17*sizeof(long)) {
+		if (addr < FRAME_SIZE*sizeof(long)) {
 			ret = putreg(child, addr, data);
 			break;
 		}
@@ -320,33 +333,17 @@
 		break;
 	}
 
-	case PTRACE_DETACH: { /* detach a process that was attached. */
-		long tmp;
-
-		ret = -EIO;
-		if ((unsigned long) data > _NSIG)
-			break;
-		child->ptrace = 0;
-		child->exit_code = data;
-		write_lock_irq(&tasklist_lock);
-		REMOVE_LINKS(child);
-		child->p_pptr = child->p_opptr;
-		SET_LINKS(child);
-		write_unlock_irq(&tasklist_lock);
-		/* make sure the single step bit is not set. */
-		tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG;
-		put_stack_long(child, EFL_OFFSET, tmp);
-		wake_up_process(child);
-		ret = 0;
+	case PTRACE_DETACH:
+		/* detach a process that was attached. */
+		ret = ptrace_detach(child, data);
 		break;
-	}
 
 	case PTRACE_GETREGS: { /* Get all gp regs from the child. */
-	  	if (!access_ok(VERIFY_WRITE, (unsigned *)data, 17*sizeof(long))) {
+	  	if (!access_ok(VERIFY_WRITE, (unsigned *)data, FRAME_SIZE*sizeof(long))) {
 			ret = -EIO;
 			break;
 		}
-		for ( i = 0; i < 17*sizeof(long); i += sizeof(long) ) {
+		for ( i = 0; i < FRAME_SIZE*sizeof(long); i += sizeof(long) ) {
 			__put_user(getreg(child, i),(unsigned long *) data);
 			data += sizeof(long);
 		}
@@ -356,11 +353,11 @@
 
 	case PTRACE_SETREGS: { /* Set all gp regs in the child. */
 		unsigned long tmp;
-	  	if (!access_ok(VERIFY_READ, (unsigned *)data, 17*sizeof(long))) {
+	  	if (!access_ok(VERIFY_READ, (unsigned *)data, FRAME_SIZE*sizeof(long))) {
 			ret = -EIO;
 			break;
 		}
-		for ( i = 0; i < 17*sizeof(long); i += sizeof(long) ) {
+		for ( i = 0; i < FRAME_SIZE*sizeof(long); i += sizeof(long) ) {
 			__get_user(tmp, (unsigned long *) data);
 			putreg(child, i, tmp);
 			data += sizeof(long);
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
--- v2.4.9/linux/arch/i386/kernel/setup.c	Wed Jul 25 17:10:17 2001
+++ linux/arch/i386/kernel/setup.c	Mon Sep 17 23:03:09 2001
@@ -64,6 +64,9 @@
  *
  *  VIA C3 Support.
  *  Dave Jones <davej@suse.de>, March 2001
+ *
+ *  AMD Athlon/Duron/Thunderbird bluesmoke support.
+ *  Dave Jones <davej@suse.de>, April 2001.
  */
 
 /*
@@ -93,6 +96,7 @@
 #include <linux/bootmem.h>
 #include <asm/processor.h>
 #include <linux/console.h>
+#include <asm/mtrr.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/io.h>
@@ -145,9 +149,9 @@
 
 unsigned char aux_device_present;
 
+extern void mcheck_init(struct cpuinfo_x86 *c);
 extern int root_mountflags;
 extern char _text, _etext, _edata, _end;
-extern unsigned long cpu_khz;
 
 static int disable_x86_serial_nr __initdata = 1;
 static int disable_x86_fxsr __initdata = 0;
@@ -937,27 +941,14 @@
 	 * trampoline before removing it. (see the GDT stuff)
 	 */
 	reserve_bootmem(PAGE_SIZE, PAGE_SIZE);
-	smp_alloc_memory(); /* AP processor realmode stacks in low memory*/
 #endif
 
-#ifdef CONFIG_X86_IO_APIC
+#ifdef CONFIG_X86_LOCAL_APIC
 	/*
 	 * Find and reserve possible boot-time SMP configuration:
 	 */
 	find_smp_config();
 #endif
-	paging_init();
-#ifdef CONFIG_X86_IO_APIC
-	/*
-	 * get boot-time SMP configuration:
-	 */
-	if (smp_found_config)
-		get_smp_config();
-#endif
-#ifdef CONFIG_X86_LOCAL_APIC
-	init_apic_mappings();
-#endif
-
 #ifdef CONFIG_BLK_DEV_INITRD
 	if (LOADER_TYPE && INITRD_START) {
 		if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) {
@@ -977,6 +968,25 @@
 #endif
 
 	/*
+	 * NOTE: before this point _nobody_ is allowed to allocate
+	 * any memory using the bootmem allocator.
+	 */
+
+#ifdef CONFIG_SMP
+	smp_alloc_memory(); /* AP processor realmode stacks in low memory*/
+#endif
+	paging_init();
+#ifdef CONFIG_X86_LOCAL_APIC
+	/*
+	 * get boot-time SMP configuration:
+	 */
+	if (smp_found_config)
+		get_smp_config();
+	init_apic_mappings();
+#endif
+
+
+	/*
 	 * Request address space for all standard RAM and ROM resources
 	 * and also for regions reported as reserved by the e820.
 	 */
@@ -1088,11 +1098,18 @@
 	l2size = ecx >> 16;
 
 	/* AMD errata T13 (order #21922) */
-	if (c->x86_vendor == X86_VENDOR_AMD &&
-	    c->x86 == 6 &&
-	    c->x86_model == 3 &&
-	    c->x86_mask == 0) {
-		l2size = 64;
+	if ((c->x86_vendor == X86_VENDOR_AMD) && (c->x86 == 6)) {
+		if (c->x86_model == 3 && c->x86_mask == 0)	/* Duron Rev A0 */
+			l2size = 64;
+		if (c->x86_model == 4 &&
+			(c->x86_mask==0 || c->x86_mask==1))	/* Tbird rev A1/A2 */
+			l2size = 256;
+	}
+
+	/* VIA C3 CPUs (670-68F) need further shifting. */
+	if (c->x86_vendor == X86_VENDOR_CENTAUR && (c->x86 == 6) &&
+		((c->x86_model == 7) || (c->x86_model == 8))) {
+		l2size = l2size >> 8;
 	}
 
 	if ( l2size == 0 )
@@ -1109,7 +1126,7 @@
  *	misexecution of code under Linux. Owners of such processors should
  *	contact AMD for precise details and a CPU swap.
  *
- *	See	http://www.mygale.com/~poulot/k6bug.html
+ *	See	http://www.multimania.com/poulot/k6bug.html
  *		http://www.amd.com/K6/k6docs/revgd.html
  *
  *	The following test is erm.. interesting. AMD neglected to up
@@ -1126,6 +1143,12 @@
 	int mbytes = max_mapnr >> (20-PAGE_SHIFT);
 	int r;
 
+	/*
+	 *	FIXME: We should handle the K5 here. Set up the write
+	 *	range and also turn on MSR 83 bits 4 and 31 (write alloc,
+	 *	no bus pipeline)
+	 */
+
 	/* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
 	   3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
 	clear_bit(0*32+31, &c->x86_capability);
@@ -1185,13 +1208,13 @@
 				if(mbytes>508)
 					mbytes=508;
 					
-				rdmsr(0xC0000082, l, h);
+				rdmsr(MSR_K6_WHCR, l, h);
 				if ((l&0x0000FFFF)==0) {
 					unsigned long flags;
 					l=(1<<0)|((mbytes/4)<<1);
 					local_irq_save(flags);
-					__asm__ __volatile__ ("wbinvd": : :"memory");
-					wrmsr(0xC0000082, l, h);
+					wbinvd();
+					wrmsr(MSR_K6_WHCR, l, h);
 					local_irq_restore(flags);
 					printk(KERN_INFO "Enabling old style K6 write allocation for %d Mb\n",
 						mbytes);
@@ -1206,13 +1229,13 @@
 				if(mbytes>4092)
 					mbytes=4092;
 
-				rdmsr(0xC0000082, l, h);
+				rdmsr(MSR_K6_WHCR, l, h);
 				if ((l&0xFFFF0000)==0) {
 					unsigned long flags;
 					l=((mbytes>>2)<<22)|(1<<16);
 					local_irq_save(flags);
-					__asm__ __volatile__ ("wbinvd": : :"memory");
-					wrmsr(0xC0000082, l, h);
+					wbinvd();
+					wrmsr(MSR_K6_WHCR, l, h);
 					local_irq_restore(flags);
 					printk(KERN_INFO "Enabling new style K6 write allocation for %d Mb\n",
 						mbytes);
@@ -1226,10 +1249,10 @@
 					set_bit(X86_FEATURE_K6_MTRR, &c->x86_capability);
 				break;
 			}
-
 			break;
 
 		case 6:	/* An Athlon/Duron. We can trust the BIOS probably */
+			mcheck_init(c);
 			break;		
 	}
 
@@ -1312,9 +1335,10 @@
 
 static void __init check_cx686_slop(struct cpuinfo_x86 *c)
 {
+	unsigned long flags;
+
 	if (Cx86_dir0_msb == 3) {
 		unsigned char ccr3, ccr5;
-		unsigned long flags;
 
 		local_irq_save(flags);
 		ccr3 = getCx86(CX86_CCR3);
@@ -1551,14 +1575,12 @@
 				name="??";
 			}
 
-			/* get FCR  */
-			rdmsr(0x107, lo, hi);
-
+			rdmsr(MSR_IDT_FCR1, lo, hi);
 			newlo=(lo|fcr_set) & (~fcr_clr);
 
 			if (newlo!=lo) {
 				printk(KERN_INFO "Centaur FCR was 0x%X now 0x%X\n", lo, newlo );
-				wrmsr(0x107, newlo, hi );
+				wrmsr(MSR_IDT_FCR1, newlo, hi );
 			} else {
 				printk(KERN_INFO "Centaur FCR is 0x%X\n",lo);
 			}
@@ -1577,14 +1599,15 @@
 				c->x86_cache_size = (cc>>24)+(dd>>24);
 			}
 			sprintf( c->x86_model_id, "WinChip %s", name );
+			mcheck_init(c);
 			break;
 
 		case 6:
 			switch (c->x86_model) {
 				case 6 ... 7:		/* Cyrix III or C3 */
-					rdmsr (0x1107, lo, hi);
+					rdmsr (MSR_VIA_FCR, lo, hi);
 					lo |= (1<<1 | 1<<7);	/* Report CX8 & enable PGE */
-					wrmsr (0x1107, lo, hi);
+					wrmsr (MSR_VIA_FCR, lo, hi);
 
 					set_bit(X86_FEATURE_CX8, &c->x86_capability);
 					set_bit(X86_FEATURE_3DNOW, &c->x86_capability);
@@ -1595,7 +1618,6 @@
 			}
 			break;
 	}
-
 }
 
 
@@ -1668,7 +1690,6 @@
 	if (c->x86_model > 2)
 		printk(" II");
 	printk("\n");
-	printk("If you have one of these please email davej@suse.de\n");
 
 	/* Unhide possibly hidden capability flags
 	   The mp6 iDragon family don't have MSRs.
@@ -1694,7 +1715,6 @@
 #ifndef CONFIG_M686
 	static int f00f_workaround_enabled = 0;
 #endif
-	extern void mcheck_init(struct cpuinfo_x86 *c);
 	char *p = NULL;
 	unsigned int l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
 
@@ -1989,9 +2009,9 @@
 	    disable_x86_serial_nr ) {
 		/* Disable processor serial number */
 		unsigned long lo,hi;
-		rdmsr(0x119,lo,hi);
+		rdmsr(MSR_IA32_BBL_CR_CTL,lo,hi);
 		lo |= 0x200000;
-		wrmsr(0x119,lo,hi);
+		wrmsr(MSR_IA32_BBL_CR_CTL,lo,hi);
 		printk(KERN_NOTICE "CPU serial number disabled.\n");
 		clear_bit(X86_FEATURE_PN, &c->x86_capability);
 
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/signal.c linux/arch/i386/kernel/signal.c
--- v2.4.9/linux/arch/i386/kernel/signal.c	Wed Jul 25 17:10:17 2001
+++ linux/arch/i386/kernel/signal.c	Fri Sep 14 14:15:40 2001
@@ -19,6 +19,7 @@
 #include <linux/unistd.h>
 #include <linux/stddef.h>
 #include <linux/tty.h>
+#include <linux/personality.h>
 #include <asm/ucontext.h>
 #include <asm/uaccess.h>
 #include <asm/i387.h>
@@ -665,13 +666,16 @@
 					continue;
 				/* FALLTHRU */
 
-			case SIGSTOP:
+			case SIGSTOP: {
+				struct signal_struct *sig;
 				current->state = TASK_STOPPED;
 				current->exit_code = signr;
-				if (!(current->p_pptr->sig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP))
+				sig = current->p_pptr->sig;
+				if (sig && !(sig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP))
 					notify_parent(current, SIGCHLD);
 				schedule();
 				continue;
+			}
 
 			case SIGQUIT: case SIGILL: case SIGTRAP:
 			case SIGABRT: case SIGFPE: case SIGSEGV:
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/smp.c linux/arch/i386/kernel/smp.c
--- v2.4.9/linux/arch/i386/kernel/smp.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/i386/kernel/smp.c	Mon Sep 17 23:03:09 2001
@@ -429,9 +429,10 @@
 	atomic_t started;
 	atomic_t finished;
 	int wait;
-};
+} __attribute__ ((__aligned__(SMP_CACHE_BYTES)));
 
 static struct call_data_struct * call_data;
+static struct call_data_struct call_data_array[NR_CPUS];
 
 /*
  * this function sends a 'generic call function' IPI to all other CPUs
@@ -453,32 +454,45 @@
  * hardware interrupt handler, you may call it from a bottom half handler.
  */
 {
-	struct call_data_struct data;
-	int cpus = smp_num_cpus-1;
+	struct call_data_struct *data;
+	int cpus = (cpu_online_map & ~(1 << smp_processor_id()));
 
 	if (!cpus)
 		return 0;
 
-	data.func = func;
-	data.info = info;
-	atomic_set(&data.started, 0);
-	data.wait = wait;
+	data = &call_data_array[smp_processor_id()];
+	
+	data->func = func;
+	data->info = info;
+	data->wait = wait;
 	if (wait)
-		atomic_set(&data.finished, 0);
-
-	spin_lock_bh(&call_lock);
-	call_data = &data;
+		atomic_set(&data->finished, 0);
+	/* We have do to this one last to make sure that the IPI service
+	 * code desn't get confused if it gets an unexpected repeat
+	 * trigger of an old IPI while we're still setting up the new
+	 * one. */
+	atomic_set(&data->started, 0);
+
+	local_bh_disable();
+	spin_lock(&call_lock);
+	call_data = data;
 	/* Send a message to all other CPUs and wait for them to respond */
 	send_IPI_allbutself(CALL_FUNCTION_VECTOR);
 
 	/* Wait for response */
-	while (atomic_read(&data.started) != cpus)
+	while (atomic_read(&data->started) != cpus)
 		barrier();
 
+	/* It is now safe to reuse the "call_data" global, but we need
+	 * to keep local bottom-halves disabled until after waiters have
+	 * been acknowledged to prevent reuse of the per-cpu call data
+	 * entry. */
+	spin_unlock(&call_lock);
+
 	if (wait)
-		while (atomic_read(&data.finished) != cpus)
+		while (atomic_read(&data->finished) != cpus)
 			barrier();
-	spin_unlock_bh(&call_lock);
+	local_bh_enable();
 
 	return 0;
 }
@@ -528,15 +542,17 @@
 
 	ack_APIC_irq();
 	/*
-	 * Notify initiating CPU that I've grabbed the data and am
-	 * about to execute the function
+	 * Notify initiating CPU that I've grabbed the data and am about
+	 * to execute the function (and avoid servicing any single IPI
+	 * twice)
 	 */
-	atomic_inc(&call_data->started);
+	if (test_and_set_bit(smp_processor_id(), &call_data->started))
+		return;
 	/*
 	 * At this point the info structure may be out of scope unless wait==1
 	 */
 	(*func)(info);
 	if (wait)
-		atomic_inc(&call_data->finished);
+		set_bit(smp_processor_id(), &call_data->finished);
 }
 
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/smpboot.c linux/arch/i386/kernel/smpboot.c
--- v2.4.9/linux/arch/i386/kernel/smpboot.c	Tue Feb 13 14:13:43 2001
+++ linux/arch/i386/kernel/smpboot.c	Mon Sep 17 23:03:09 2001
@@ -66,7 +66,7 @@
 static volatile unsigned long cpu_callout_map;
 
 /* Per CPU bogomips and other parameters */
-struct cpuinfo_x86 cpu_data[NR_CPUS];
+struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned;
 
 /* Set when the idlers are all forked */
 int smp_threads_ready;
@@ -780,7 +780,6 @@
 }
 
 cycles_t cacheflush_time;
-extern unsigned long cpu_khz;
 
 static void smp_tune_scheduling (void)
 {
@@ -870,12 +869,15 @@
 	 * get out of here now!
 	 */
 	if (!smp_found_config) {
-		printk(KERN_NOTICE "SMP motherboard not detected. Using dummy APIC emulation.\n");
+		printk(KERN_NOTICE "SMP motherboard not detected.\n");
 #ifndef CONFIG_VISWS
 		io_apic_irqs = 0;
 #endif
 		cpu_online_map = phys_cpu_present_map = 1;
 		smp_num_cpus = 1;
+		if (APIC_init_uniprocessor())
+			printk(KERN_NOTICE "Local APIC not detected."
+					   " Using dummy APIC emulation.\n");
 		goto smp_done;
 	}
 
@@ -1003,7 +1005,7 @@
 	 * Here we can be sure that there is an IO-APIC in the system. Let's
 	 * go and set it up:
 	 */
-	if (!skip_ioapic_setup)
+	if (!skip_ioapic_setup && nr_ioapics)
 		setup_IO_APIC();
 #endif
 
@@ -1021,4 +1023,3 @@
 smp_done:
 	zap_low_mappings();
 }
-
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/time.c linux/arch/i386/kernel/time.c
--- v2.4.9/linux/arch/i386/kernel/time.c	Fri Dec 29 14:07:57 2000
+++ linux/arch/i386/kernel/time.c	Mon Sep 17 23:03:09 2001
@@ -178,6 +178,15 @@
  	jiffies_t = jiffies;
 
 	count |= inb_p(0x40) << 8;
+	
+        /* VIA686a test code... reset the latch if count > max + 1 */
+        if (count > LATCH) {
+                outb_p(0x34, 0x43);
+                outb_p(LATCH & 0xff, 0x40);
+                outb(LATCH >> 8, 0x40);
+                count = LATCH - 1;
+        }
+	
 	spin_unlock(&i8253_lock);
 
 	/*
@@ -413,7 +422,7 @@
 	if (!user_mode(regs))
 		x86_do_profile(regs->eip);
 #else
-	if (!smp_found_config)
+	if (!using_apic_timer)
 		smp_local_timer_interrupt(regs);
 #endif
 
diff -u --recursive --new-file v2.4.9/linux/arch/i386/kernel/traps.c linux/arch/i386/kernel/traps.c
--- v2.4.9/linux/arch/i386/kernel/traps.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/i386/kernel/traps.c	Tue Sep 18 13:39:51 2001
@@ -64,8 +64,6 @@
  */
 struct desc_struct idt_table[256] __attribute__((__section__(".data.idt"))) = { {0, 0}, };
 
-extern void bust_spinlocks(void);
-
 asmlinkage void divide_error(void);
 asmlinkage void debug(void);
 asmlinkage void nmi(void);
@@ -188,7 +186,7 @@
 	show_trace(esp);
 }
 
-static void show_registers(struct pt_regs *regs)
+void show_registers(struct pt_regs *regs)
 {
 	int i;
 	int in_kernel = 1;
@@ -245,9 +243,10 @@
 {
 	console_verbose();
 	spin_lock_irq(&die_lock);
+	bust_spinlocks(1);
 	printk("%s: %04lx\n", str, err & 0xffff);
 	show_registers(regs);
-
+	bust_spinlocks(0);
 	spin_unlock_irq(&die_lock);
 	do_exit(SIGSEGV);
 }
@@ -419,83 +418,14 @@
 	printk("Do you have a strange power saving mode enabled?\n");
 }
 
-#if CONFIG_X86_IO_APIC
-
-int nmi_watchdog = 0;
-
-static int __init setup_nmi_watchdog(char *str)
-{
-        get_option(&str, &nmi_watchdog);
-        return 1;
-}
-
-__setup("nmi_watchdog=", setup_nmi_watchdog);
-
-static spinlock_t nmi_print_lock = SPIN_LOCK_UNLOCKED;
-
-inline void nmi_watchdog_tick(struct pt_regs * regs)
-{
-	/*
-	 * the best way to detect wether a CPU has a 'hard lockup' problem
-	 * is to check it's local APIC timer IRQ counts. If they are not
-	 * changing then that CPU has some problem.
-	 *
-	 * as these watchdog NMI IRQs are broadcasted to every CPU, here
-	 * we only have to check the current processor.
-	 *
-	 * since NMIs dont listen to _any_ locks, we have to be extremely
-	 * careful not to rely on unsafe variables. The printk might lock
-	 * up though, so we have to break up console_lock first ...
-	 * [when there will be more tty-related locks, break them up
-	 *  here too!]
-	 */
-
-	static unsigned int last_irq_sums [NR_CPUS],
-				alert_counter [NR_CPUS];
-
-	/*
-	 * Since current-> is always on the stack, and we always switch
-	 * the stack NMI-atomically, it's safe to use smp_processor_id().
-	 */
-	int sum, cpu = smp_processor_id();
-
-	sum = apic_timer_irqs[cpu];
-
-	if (last_irq_sums[cpu] == sum) {
-		/*
-		 * Ayiee, looks like this CPU is stuck ...
-		 * wait a few IRQs (5 seconds) before doing the oops ...
-		 */
-		alert_counter[cpu]++;
-		if (alert_counter[cpu] == 5*HZ) {
-			spin_lock(&nmi_print_lock);
-			/*
-			 * We are in trouble anyway, lets at least try
-			 * to get a message out.
-			 */
-			bust_spinlocks();
-			printk("NMI Watchdog detected LOCKUP on CPU%d, registers:\n", cpu);
-			show_registers(regs);
-			printk("console shuts up ...\n");
-			console_silent();
-			spin_unlock(&nmi_print_lock);
-			do_exit(SIGSEGV);
-		}
-	} else {
-		last_irq_sums[cpu] = sum;
-		alert_counter[cpu] = 0;
-	}
-}
-#endif
-
 asmlinkage void do_nmi(struct pt_regs * regs, long error_code)
 {
 	unsigned char reason = inb(0x61);
 
-
 	++nmi_count(smp_processor_id());
+
 	if (!(reason & 0xc0)) {
-#if CONFIG_X86_IO_APIC
+#if CONFIG_X86_LOCAL_APIC
 		/*
 		 * Ok, so this is none of the documented NMI sources,
 		 * so it must be the NMI watchdog.
@@ -503,11 +433,9 @@
 		if (nmi_watchdog) {
 			nmi_watchdog_tick(regs);
 			return;
-		} else
-			unknown_nmi_error(reason, regs);
-#else
-		unknown_nmi_error(reason, regs);
+		}
 #endif
+		unknown_nmi_error(reason, regs);
 		return;
 	}
 	if (reason & 0x80)
diff -u --recursive --new-file v2.4.9/linux/arch/i386/lib/Makefile linux/arch/i386/lib/Makefile
--- v2.4.9/linux/arch/i386/lib/Makefile	Tue Jul  3 17:08:18 2001
+++ linux/arch/i386/lib/Makefile	Mon Sep 10 07:31:30 2001
@@ -13,5 +13,6 @@
 
 obj-$(CONFIG_X86_USE_3DNOW) += mmx.o
 obj-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
+obj-$(CONFIG_DEBUG_IOVIRT)  += iodebug.o
 
 include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/i386/lib/usercopy.c linux/arch/i386/lib/usercopy.c
--- v2.4.9/linux/arch/i386/lib/usercopy.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/i386/lib/usercopy.c	Tue Sep 18 14:10:43 2001
@@ -44,6 +44,7 @@
 unsigned long
 __generic_copy_to_user(void *to, const void *from, unsigned long n)
 {
+	prefetch(from);
 	if (access_ok(VERIFY_WRITE, to, n))
 		__copy_user(to,from,n);
 	return n;
@@ -52,6 +53,7 @@
 unsigned long
 __generic_copy_from_user(void *to, const void *from, unsigned long n)
 {
+	prefetchw(to);
 	if (access_ok(VERIFY_READ, from, n))
 		__copy_user_zeroing(to,from,n);
 	else
diff -u --recursive --new-file v2.4.9/linux/arch/i386/mm/extable.c linux/arch/i386/mm/extable.c
--- v2.4.9/linux/arch/i386/mm/extable.c	Fri Mar  2 11:12:07 2001
+++ linux/arch/i386/mm/extable.c	Mon Sep 17 13:16:30 2001
@@ -37,13 +37,13 @@
 search_exception_table(unsigned long addr)
 {
 	unsigned long ret = 0;
-	unsigned long flags;
 	
 #ifndef CONFIG_MODULES
 	/* There is only the kernel to search.  */
 	ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr);
 	return ret;
 #else
+	unsigned long flags;
 	/* The kernel is the last "module" -- no need to treat it special.  */
 	struct module *mp;
 
diff -u --recursive --new-file v2.4.9/linux/arch/i386/mm/fault.c linux/arch/i386/mm/fault.c
--- v2.4.9/linux/arch/i386/mm/fault.c	Tue May 15 00:16:51 2001
+++ linux/arch/i386/mm/fault.c	Mon Sep 17 22:52:35 2001
@@ -17,6 +17,7 @@
 #include <linux/smp_lock.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
+#include <linux/vt_kern.h>		/* For unblank_screen() */
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -25,6 +26,8 @@
 
 extern void die(const char *,struct pt_regs *,long);
 
+extern int console_loglevel;
+
 /*
  * Ugly, ugly, but the goto's result in better assembly..
  */
@@ -51,8 +54,14 @@
 	start &= PAGE_MASK;
 
 	for (;;) {
-		if (handle_mm_fault(current->mm, vma, start, 1) <= 0)
-			goto bad_area;
+	survive:
+		{
+			int fault = handle_mm_fault(current->mm, vma, start, 1);
+			if (!fault)
+				goto bad_area;
+			if (fault < 0)
+				goto out_of_memory;
+		}
 		if (!size)
 			break;
 		size--;
@@ -75,19 +84,52 @@
 
 bad_area:
 	return 0;
+
+out_of_memory:
+	if (current->pid == 1) {
+		current->policy |= SCHED_YIELD;
+		schedule();
+		goto survive;
+	}
+	goto bad_area;
 }
 
-extern spinlock_t console_lock, timerlist_lock;
+extern spinlock_t timerlist_lock;
 
 /*
  * Unlock any spinlocks which will prevent us from getting the
  * message out (timerlist_lock is acquired through the
  * console unblank code)
  */
-void bust_spinlocks(void)
+void bust_spinlocks(int yes)
 {
-	spin_lock_init(&console_lock);
 	spin_lock_init(&timerlist_lock);
+	if (yes) {
+		oops_in_progress = 1;
+#ifdef CONFIG_SMP
+		global_irq_lock = 0;	/* Many serial drivers do __global_cli() */
+#endif
+	} else {
+		int loglevel_save = console_loglevel;
+#ifdef CONFIG_VT
+		unblank_screen();
+#endif
+		oops_in_progress = 0;
+		/*
+		 * OK, the message is on the console.  Now we call printk()
+		 * without oops_in_progress set so that printk will give klogd
+		 * a poke.  Hold onto your hats...
+		 */
+		console_loglevel = 15;		/* NMI oopser may have shut the console up */
+		printk(" ");
+		console_loglevel = loglevel_save;
+	}
+}
+
+void do_BUG(const char *file, int line)
+{
+	bust_spinlocks(1);
+	printk("kernel BUG at %s:%d!\n", file, line);
 }
 
 asmlinkage void do_invalid_op(struct pt_regs *, unsigned long);
@@ -196,6 +238,7 @@
 				goto bad_area;
 	}
 
+ survive:
 	/*
 	 * If for any reason at all we couldn't handle the fault,
 	 * make sure we exit gracefully rather than endlessly redo
@@ -271,7 +314,7 @@
  * terminate things with extreme prejudice.
  */
 
-	bust_spinlocks();
+	bust_spinlocks(1);
 
 	if (address < PAGE_SIZE)
 		printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
@@ -290,6 +333,7 @@
 		printk(KERN_ALERT "*pte = %08lx\n", page);
 	}
 	die("Oops", regs, error_code);
+	bust_spinlocks(0);
 	do_exit(SIGKILL);
 
 /*
@@ -298,6 +342,12 @@
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
+	if (tsk->pid == 1) {
+		tsk->policy |= SCHED_YIELD;
+		schedule();
+		down_read(&mm->mmap_sem);
+		goto survive;
+	}
 	printk("VM: killing process %s\n", tsk->comm);
 	if (error_code & 4)
 		do_exit(SIGKILL);
@@ -313,7 +363,7 @@
 	tsk->thread.cr2 = address;
 	tsk->thread.error_code = error_code;
 	tsk->thread.trap_no = 14;
-	info.si_code = SIGBUS;
+	info.si_signo = SIGBUS;
 	info.si_errno = 0;
 	info.si_code = BUS_ADRERR;
 	info.si_addr = (void *)address;
diff -u --recursive --new-file v2.4.9/linux/arch/i386/mm/init.c linux/arch/i386/mm/init.c
--- v2.4.9/linux/arch/i386/mm/init.c	Fri Apr 20 16:15:20 2001
+++ linux/arch/i386/mm/init.c	Thu Sep 20 19:59:20 2001
@@ -35,7 +35,9 @@
 #include <asm/fixmap.h>
 #include <asm/e820.h>
 #include <asm/apic.h>
+#include <asm/tlb.h>
 
+mmu_gather_t mmu_gathers[NR_CPUS];
 unsigned long highstart_pfn, highend_pfn;
 static unsigned long totalram_pages;
 static unsigned long totalhigh_pages;
diff -u --recursive --new-file v2.4.9/linux/arch/ia64/kernel/init_task.c linux/arch/ia64/kernel/init_task.c
--- v2.4.9/linux/arch/ia64/kernel/init_task.c	Sun Feb  6 18:42:40 2000
+++ linux/arch/ia64/kernel/init_task.c	Mon Sep 17 15:29:09 2001
@@ -13,7 +13,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct vm_area_struct init_mmap = INIT_MMAP;
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
 static struct signal_struct init_signals = INIT_SIGNALS;
diff -u --recursive --new-file v2.4.9/linux/arch/ia64/kernel/ptrace.c linux/arch/ia64/kernel/ptrace.c
--- v2.4.9/linux/arch/ia64/kernel/ptrace.c	Sun Aug 12 13:27:58 2001
+++ linux/arch/ia64/kernel/ptrace.c	Tue Sep 18 17:03:51 2001
@@ -789,6 +789,21 @@
 	return 0;
 }
 
+/*
+ * Called by kernel/ptrace.c when detaching..
+ *
+ * Make sure the single step bit is not set.
+ */
+void ptrace_disable(struct task_struct *child)
+{
+	/* make sure the single step/take-branch tra bits are not set: */
+	ia64_psr(pt)->ss = 0;
+	ia64_psr(pt)->tb = 0;
+
+	/* Turn off flag indicating that the KRBS is sync'd with child's VM: */
+	child->thread.flags &= ~IA64_THREAD_KRBS_SYNCED;
+}
+
 asmlinkage long
 sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data,
 	    long arg4, long arg5, long arg6, long arg7, long stack)
@@ -965,27 +980,7 @@
 		goto out_tsk;
 
 	      case PTRACE_DETACH:		/* detach a process that was attached. */
-		ret = -EIO;
-		if (data > _NSIG)
-			goto out_tsk;
-
-		child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
-		child->exit_code = data;
-		write_lock_irqsave(&tasklist_lock, flags);
-		REMOVE_LINKS(child);
-		child->p_pptr = child->p_opptr;
-		SET_LINKS(child);
-		write_unlock_irqrestore(&tasklist_lock, flags);
-
-		/* make sure the single step/take-branch tra bits are not set: */
-		ia64_psr(pt)->ss = 0;
-		ia64_psr(pt)->tb = 0;
-
-		/* Turn off flag indicating that the KRBS is sync'd with child's VM: */
-		child->thread.flags &= ~IA64_THREAD_KRBS_SYNCED;
-
-		wake_up_process(child);
-		ret = 0;
+		ret = ptrace_detach(child, data);
 		goto out_tsk;
 
 	      default:
diff -u --recursive --new-file v2.4.9/linux/arch/ia64/mm/init.c linux/arch/ia64/mm/init.c
--- v2.4.9/linux/arch/ia64/mm/init.c	Sun Aug 12 13:27:58 2001
+++ linux/arch/ia64/mm/init.c	Thu Sep 20 20:02:03 2001
@@ -24,6 +24,9 @@
 #include <asm/sal.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
+#include <asm/tlb.h>
+
+mmu_gather_t mmu_gathers[NR_CPUS];
 
 /* References to section boundaries: */
 extern char _stext, _etext, _edata, __init_begin, __init_end;
diff -u --recursive --new-file v2.4.9/linux/arch/m68k/amiga/config.c linux/arch/m68k/amiga/config.c
--- v2.4.9/linux/arch/m68k/amiga/config.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/m68k/amiga/config.c	Thu Sep 13 15:21:32 2001
@@ -44,22 +44,22 @@
 unsigned char amiga_psfreq;
 struct amiga_hw_present amiga_hw_present;
 
-static const char s_a500[] __initdata = "A500";
-static const char s_a500p[] __initdata = "A500+";
-static const char s_a600[] __initdata = "A600";
-static const char s_a1000[] __initdata = "A1000";
-static const char s_a1200[] __initdata = "A1200";
-static const char s_a2000[] __initdata = "A2000";
-static const char s_a2500[] __initdata = "A2500";
-static const char s_a3000[] __initdata = "A3000";
-static const char s_a3000t[] __initdata = "A3000T";
-static const char s_a3000p[] __initdata = "A3000+";
-static const char s_a4000[] __initdata = "A4000";
-static const char s_a4000t[] __initdata = "A4000T";
-static const char s_cdtv[] __initdata = "CDTV";
-static const char s_cd32[] __initdata = "CD32";
-static const char s_draco[] __initdata = "Draco";
-static const char *amiga_models[] __initdata = {
+static char s_a500[] __initdata = "A500";
+static char s_a500p[] __initdata = "A500+";
+static char s_a600[] __initdata = "A600";
+static char s_a1000[] __initdata = "A1000";
+static char s_a1200[] __initdata = "A1200";
+static char s_a2000[] __initdata = "A2000";
+static char s_a2500[] __initdata = "A2500";
+static char s_a3000[] __initdata = "A3000";
+static char s_a3000t[] __initdata = "A3000T";
+static char s_a3000p[] __initdata = "A3000+";
+static char s_a4000[] __initdata = "A4000";
+static char s_a4000t[] __initdata = "A4000T";
+static char s_cdtv[] __initdata = "CDTV";
+static char s_cd32[] __initdata = "CD32";
+static char s_draco[] __initdata = "Draco";
+static char *amiga_models[] __initdata = {
     s_a500, s_a500p, s_a600, s_a1000, s_a1200, s_a2000, s_a2500, s_a3000,
     s_a3000t, s_a3000p, s_a4000, s_a4000t, s_cdtv, s_cd32, s_draco,
 };
diff -u --recursive --new-file v2.4.9/linux/arch/m68k/kernel/process.c linux/arch/m68k/kernel/process.c
--- v2.4.9/linux/arch/m68k/kernel/process.c	Fri Feb  9 11:29:44 2001
+++ linux/arch/m68k/kernel/process.c	Mon Sep 17 15:29:09 2001
@@ -38,7 +38,6 @@
  * alignment requirements and potentially different initial
  * setup.
  */
-static struct vm_area_struct init_mmap = INIT_MMAP;
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
 static struct signal_struct init_signals = INIT_SIGNALS;
diff -u --recursive --new-file v2.4.9/linux/arch/m68k/kernel/ptrace.c linux/arch/m68k/kernel/ptrace.c
--- v2.4.9/linux/arch/m68k/kernel/ptrace.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/m68k/kernel/ptrace.c	Tue Sep 18 17:03:51 2001
@@ -87,6 +87,19 @@
 	return 0;
 }
 
+/*
+ * Called by kernel/ptrace.c when detaching..
+ *
+ * Make sure the single step bit is not set.
+ */
+void ptrace_disable(struct task_struct *child)
+{
+	unsigned long tmp;
+	/* make sure the single step bit is not set. */
+	tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
+	put_reg(child, PT_SR, tmp);
+}
+
 asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 {
 	struct task_struct *child;
@@ -279,26 +292,9 @@
 			break;
 		}
 
-		case PTRACE_DETACH: { /* detach a process that was attached. */
-			long tmp;
-
-			ret = -EIO;
-			if ((unsigned long) data > _NSIG)
-				break;
-			child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
-			child->exit_code = data;
-			write_lock_irqsave(&tasklist_lock, flags);
-			REMOVE_LINKS(child);
-			child->p_pptr = child->p_opptr;
-			SET_LINKS(child);
-			write_unlock_irqrestore(&tasklist_lock, flags);
-			/* make sure the single step bit is not set. */
-			tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
-			put_reg(child, PT_SR, tmp);
-			wake_up_process(child);
-			ret = 0;
+		case PTRACE_DETACH:	/* detach a process that was attached. */
+			ret = ptrace_detach(child, data);
 			break;
-		}
 
 		case PTRACE_GETREGS: { /* Get all gp regs from the child. */
 		  	int i;
diff -u --recursive --new-file v2.4.9/linux/arch/m68k/mm/init.c linux/arch/m68k/mm/init.c
--- v2.4.9/linux/arch/m68k/mm/init.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/m68k/mm/init.c	Thu Sep 20 20:02:03 2001
@@ -31,6 +31,9 @@
 #ifdef CONFIG_ATARI
 #include <asm/atari_stram.h>
 #endif
+#include <asm/tlb.h>
+
+mmu_gather_t mmu_gathers[NR_CPUS];
 
 unsigned long totalram_pages = 0;
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/Makefile linux/arch/mips/Makefile
--- v2.4.9/linux/arch/mips/Makefile	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/Makefile	Sun Sep  9 10:43:02 2001
@@ -36,8 +36,9 @@
 # crossformat linking we rely on the elf2ecoff tool for format conversion.
 #
 GCCFLAGS	:= -G 0 -mno-abicalls -fno-pic
-LINKFLAGS	+= -static -G 0
+LINKFLAGS	+= -static
 MODFLAGS	+= -mlong-calls
+LD		:= $(LD) -G 0
 
 ifdef CONFIG_REMOTE_DEBUG
 CFLAGS		:= $(CFLAGS) -g
@@ -55,12 +56,18 @@
 ifdef CONFIG_CPU_R4300
 GCCFLAGS	+= -mcpu=r4300 -mips2 -Wa,--trap
 endif
+ifdef CONFIG_CPU_VR41XX
+GCCFLAGS	+= -mcpu=r4600 -mips2 -Wa,--trap
+endif
 ifdef CONFIG_CPU_R4X00
 GCCFLAGS	+= -mcpu=r4600 -mips2 -Wa,--trap
 endif
 ifdef CONFIG_CPU_MIPS32
 GCCFLAGS	+= -mcpu=r4600 -mips2 -Wa,--trap
 endif
+ifdef CONFIG_CPU_MIPS64
+GCCFLAGS	+= -mcpu=r4600 -mips2 -Wa,--trap
+endif
 ifdef CONFIG_CPU_R5000
 GCCFLAGS	+= -mcpu=r5000 -mips2 -Wa,--trap
 endif
@@ -68,7 +75,8 @@
 GCCFLAGS        += -mcpu=r5000 -mips2 -Wa,--trap
 endif
 ifdef CONFIG_CPU_NEVADA
-GCCFLAGS	+= -mcpu=r5000 -mips2 -Wa,--trap -mmad
+# Cannot use -mmad with currently recommended tools
+GCCFLAGS	+= -mcpu=r5000 -mips2 -Wa,--trap
 endif
 ifdef CONFIG_CPU_RM7000
 GCCFLAGS	+= -mcpu=r5000 -mips2 -Wa,--trap
@@ -77,11 +85,6 @@
 GCCFLAGS	+= -mcpu=sb1 -mips2 -Wa,--trap
 endif
 
-ifdef CONFIG_MIPS_FPU_EMULATOR
-CORE_FILES	+=arch/mips/math-emu/fpu_emulator.o
-SUBDIRS		+=arch/mips/math-emu
-endif
-
 GCCFLAGS	+= -pipe
 
 CFLAGS		:= -I $(TOPDIR)/include/asm/gcc $(CFLAGS) $(GCCFLAGS)
@@ -89,6 +92,12 @@
 ASFLAGS		+= $(GCCFLAGS)
 
 #
+# We unconditionally build the math emulator
+#
+CORE_FILES	+=arch/mips/math-emu/fpu_emulator.o
+SUBDIRS		+=arch/mips/math-emu
+
+#
 # Board-dependent options and extra files
 #
 ifdef CONFIG_ALGOR_P4032
@@ -229,11 +238,27 @@
 # ITE 8172 eval board with QED 5231 CPU
 #
 ifdef CONFIG_MIPS_ITE8172
-LIBS		+= arch/mips/ite-boards/qed-4n-s01b/ite.o		     \
-		   arch/mips/ite-boards/generic/it8172.o
-SUBDIRS		+= arch/mips/ite-boards/generic				     \
-		   arch/mips/ite-boards/qed-4n-s01b
-LOADADDR	+= 0x80100000
+LIBS          += arch/mips/ite-boards/qed-4n-s01b/ite.o arch/mips/ite-boards/generic/it8172.o
+SUBDIRS       += arch/mips/ite-boards/generic arch/mips/ite-boards/qed-4n-s01b
+LOADADDR      += 0x80100000
+endif
+
+#
+# Globespan IVR eval board with QED 5231 CPU
+#
+ifdef CONFIG_MIPS_IVR
+LIBS          += arch/mips/ite-boards/ivr/ivr.o arch/mips/ite-boards/generic/it8172.o
+SUBDIRS       += arch/mips/ite-boards/generic arch/mips/ite-boards/ivr
+LOADADDR      += 0x80100000
+endif
+
+#
+# Au1000 eval board
+#
+ifdef CONFIG_MIPS_PB1000
+LIBS          += arch/mips/au1000/pb1000/pb1000.o arch/mips/au1000/common/au1000.o
+SUBDIRS       += arch/mips/au1000/pb1000 arch/mips/au1000/common
+LOADADDR      += 0x80100000
 endif
 
 #
@@ -273,14 +298,6 @@
 
 vmlinux.ecoff: vmlinux
 	@$(MAKEBOOT) $@
-
-zImage: vmlinux
-	@$(MAKEBOOT) zImage
-
-compressed: zImage
-
-zdisk: vmlinux
-	@$(MAKEBOOT) zdisk
 
 archclean:
 	@$(MAKEBOOT) clean
diff -u --recursive --new-file v2.4.9/linux/arch/mips/au1000/common/Makefile linux/arch/mips/au1000/common/Makefile
--- v2.4.9/linux/arch/mips/au1000/common/Makefile	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/au1000/common/Makefile	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,31 @@
+#
+#  Copyright 2000 MontaVista Software Inc.
+#  Author: MontaVista Software, Inc.
+#     	ppopov@mvista.com or source@mvista.com
+#
+# Makefile for the Alchemy Au1000 CPU, generic files.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+
+.S.s:
+	$(CPP) $(CFLAGS) $< -o $*.s
+.S.o:
+	$(CC) $(CFLAGS) -c $< -o $*.o
+
+all: au1000.o
+
+O_TARGET := au1000.o
+
+obj-y := prom.o dbg_io.o int-handler.o irq.o puts.o time.o reset.o
+
+obj-$(CONFIG_AU1000_UART) += serial.o             
+obj-$(CONFIG_REMOTE_DEBUG) += dbg_io.o             
+obj-$(CONFIG_BLK_DEV_INITRD) += ramdisk.o
+
+ramdisk.o: 
+	mkramobj ramdisk ramdisk.o
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/mips/au1000/common/dbg_io.c linux/arch/mips/au1000/common/dbg_io.c
--- v2.4.9/linux/arch/mips/au1000/common/dbg_io.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/au1000/common/dbg_io.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,118 @@
+
+#include <linux/config.h>
+#include <asm/io.h>
+#include <asm/au1000.h>
+
+#ifdef CONFIG_REMOTE_DEBUG
+
+/*
+ * FIXME the user should be able to select the
+ * uart to be used for debugging.
+ */
+#define	DEBUG_BASE  UART2_ADDR
+/**/
+
+/* we need uint32 uint8 */
+/* #include "types.h" */
+typedef         unsigned char uint8;
+typedef         unsigned int  uint32;
+
+#define         UART16550_BAUD_2400             2400
+#define         UART16550_BAUD_4800             4800
+#define         UART16550_BAUD_9600             9600
+#define         UART16550_BAUD_19200            19200
+#define         UART16550_BAUD_38400            38400
+#define         UART16550_BAUD_57600            57600
+#define         UART16550_BAUD_115200           115200
+
+#define         UART16550_PARITY_NONE           0
+#define         UART16550_PARITY_ODD            0x08
+#define         UART16550_PARITY_EVEN           0x18
+#define         UART16550_PARITY_MARK           0x28
+#define         UART16550_PARITY_SPACE          0x38
+
+#define         UART16550_DATA_5BIT             0x0
+#define         UART16550_DATA_6BIT             0x1
+#define         UART16550_DATA_7BIT             0x2
+#define         UART16550_DATA_8BIT             0x3
+
+#define         UART16550_STOP_1BIT             0x0
+#define         UART16550_STOP_2BIT             0x4
+
+
+#define UART_RX		0	/* Receive buffer */
+#define UART_TX		4	/* Transmit buffer */
+#define UART_IER	8	/* Interrupt Enable Register */
+#define UART_IIR	0xC	/* Interrupt ID Register */
+#define UART_FCR	0x10	/* FIFO Control Register */
+#define UART_LCR	0x14	/* Line Control Register */
+#define UART_MCR	0x18	/* Modem Control Register */
+#define UART_LSR	0x1C	/* Line Status Register */
+#define UART_MSR	0x20	/* Modem Status Register */
+#define UART_CLK	0x28	/* Baud Rat4e Clock Divider */
+#define UART_MOD_CNTRL	0x100	/* Module Control */
+
+/* memory-mapped read/write of the port */
+#define UART16550_READ(y)    (inl(DEBUG_BASE + y) & 0xff)
+#define UART16550_WRITE(y,z) (outl(z&0xff, DEBUG_BASE + y))
+
+void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
+{
+
+	if (UART16550_READ(UART_MOD_CNTRL) != 0x3) {
+		UART16550_WRITE(UART_MOD_CNTRL, 3);
+	}
+	cal_r4koff();
+
+	/* disable interrupts */
+	UART16550_WRITE(UART_IER, 0);
+
+	/* set up baud rate */
+	{ 
+		uint32 divisor;
+
+		/* set divisor */
+		divisor = get_au1000_uart_baud() / baud;
+		UART16550_WRITE(UART_CLK, divisor & 0xffff);
+	}
+
+	/* set data format */
+	UART16550_WRITE(UART_LCR, data | parity | stop);
+}
+
+static int remoteDebugInitialized = 0;
+
+uint8 getDebugChar(void)
+{
+	if (!remoteDebugInitialized) {
+		remoteDebugInitialized = 1;
+		debugInit(UART16550_BAUD_115200,
+			  UART16550_DATA_8BIT,
+			  UART16550_PARITY_NONE,
+			  UART16550_STOP_1BIT);
+	}
+
+	while((UART16550_READ(UART_LSR) & 0x1) == 0);
+	return UART16550_READ(UART_RX);
+}
+
+
+int putDebugChar(uint8 byte)
+{
+	int i;
+	if (!remoteDebugInitialized) {
+		remoteDebugInitialized = 1;
+		debugInit(UART16550_BAUD_115200,
+			  UART16550_DATA_8BIT,
+			  UART16550_PARITY_NONE,
+			  UART16550_STOP_1BIT);
+	}
+
+	while ((UART16550_READ(UART_LSR)&0x40) == 0);
+	UART16550_WRITE(UART_TX, byte);
+	//for (i=0;i<0xfff;i++);
+
+	return 1;
+}
+
+#endif
diff -u --recursive --new-file v2.4.9/linux/arch/mips/au1000/common/int-handler.S linux/arch/mips/au1000/common/int-handler.S
--- v2.4.9/linux/arch/mips/au1000/common/int-handler.S	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/au1000/common/int-handler.S	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: ppopov@mvista.com
+ *
+ * Interrupt dispatcher for Au1000 boards.
+ *
+ * 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/asm.h>
+#include <asm/mipsregs.h>
+#include <asm/addrspace.h>
+#include <asm/regdef.h>
+#include <asm/stackframe.h>
+
+	.text
+	.set	macro
+	.set	noat
+	.align	5
+
+NESTED(au1000_IRQ, PT_SIZE, sp)
+	SAVE_ALL
+	CLI				# Important: mark KERNEL mode !
+
+	mfc0	t0,CP0_CAUSE		# get pending interrupts
+	mfc0	t1,CP0_STATUS		# get enabled interrupts
+	and	t0,t1			# isolate allowed ones
+
+	andi	t0,0xff00		# isolate pending bits
+	beqz	t0, 3f			# spurious interrupt
+
+	andi	a0, t0, CAUSEF_IP7
+	beq	a0, zero, 1f
+	move	a0, sp
+	jal	mips_timer_interrupt
+	j	ret_from_irq
+
+1:
+	andi	a0, t0, CAUSEF_IP2	# Interrupt Controller 0, Request 0
+	beq	a0, zero, 2f	        
+	move	a0,sp  
+	jal	intc0_req0_irqdispatch
+	j	ret_from_irq
+2:
+	andi	a0, t0, CAUSEF_IP3	# Interrupt Controller 0, Request 1
+	beq	a0, zero, 3f	       
+	move	a0,sp  
+	jal	intc0_req1_irqdispatch
+	j	ret_from_irq
+3:
+	andi	a0, t0, CAUSEF_IP4	# Interrupt Controller 1, Request 0
+	beq	a0, zero, 4f	       
+	move	a0,sp  
+	jal	intc1_req0_irqdispatch
+	j	ret_from_irq
+4:
+	andi	a0, t0, CAUSEF_IP5	# Interrupt Controller 1, Request 1
+	beq	a0, zero, 5f	       
+	move	a0, sp  
+	jal	intc1_req1_irqdispatch
+	j	ret_from_irq
+
+5:	
+	move	a0, sp
+	jal	mips_spurious_interrupt
+done:
+	j	ret_from_irq
+END(au1000_IRQ)
diff -u --recursive --new-file v2.4.9/linux/arch/mips/au1000/common/irq.c linux/arch/mips/au1000/common/irq.c
--- v2.4.9/linux/arch/mips/au1000/common/irq.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/au1000/common/irq.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,471 @@
+/*
+ * BRIEF MODULE DESCRIPTION
+ *	Au1000 interrupt routines.
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc.
+ *		ppopov@mvista.com or source@mvista.com
+ *
+ *  This program is free software; you can redistribute	 it and/or modify it
+ *  under  the terms of	 the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the	License, or (at your
+ *  option) any later version.
+ *
+ *  THIS  SOFTWARE  IS PROVIDED	  ``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.
+ *
+ *  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/errno.h>
+#include <linux/init.h>
+#include <linux/kernel_stat.h>
+#include <linux/module.h>
+#include <linux/signal.h>
+#include <linux/sched.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/timex.h>
+#include <linux/slab.h>
+#include <linux/random.h>
+#include <linux/delay.h>
+
+#include <asm/bitops.h>
+#include <asm/bootinfo.h>
+#include <asm/io.h>
+#include <asm/mipsregs.h>
+#include <asm/system.h>
+#include <asm/au1000.h>
+
+#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
+
+#undef DEBUG_IRQ
+#ifdef DEBUG_IRQ
+/* note: prints function name for you */
+#define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args)
+#else
+#define DPRINTK(fmt, args...)
+#endif
+
+#define EXT_INTC0_REQ0 2 /* IP 2 */
+#define EXT_INTC0_REQ1 3 /* IP 3 */
+#define EXT_INTC1_REQ0 4 /* IP 4 */
+#define EXT_INTC1_REQ1 5 /* IP 5 */
+#define MIPS_TIMER_IP  7 /* IP 7 */
+
+#ifdef CONFIG_REMOTE_DEBUG
+extern void breakpoint(void);
+#endif
+
+extern asmlinkage void au1000_IRQ(void);
+
+extern void set_debug_traps(void);
+extern irq_cpustat_t irq_stat [];
+extern irq_desc_t irq_desc[NR_IRQS];
+
+unsigned int local_bh_count[NR_CPUS];
+unsigned int local_irq_count[NR_CPUS];
+
+static void setup_local_irq(unsigned int irq, int type, int int_req);
+static unsigned int startup_irq(unsigned int irq);
+static void end_irq(unsigned int irq_nr);
+static inline void mask_and_ack_level_irq(unsigned int irq_nr);
+static inline void mask_and_ack_rise_edge_irq(unsigned int irq_nr);
+static inline void mask_and_ack_fall_edge_irq(unsigned int irq_nr);
+static inline void local_enable_irq(unsigned int irq_nr);
+static inline void local_disable_irq(unsigned int irq_nr);
+
+unsigned long spurious_interrupts;
+extern unsigned int do_IRQ(int irq, struct pt_regs *regs);
+extern void __init init_generic_irq(void);
+
+static inline void sync(void)
+{
+	__asm volatile ("sync");
+}
+
+
+/* Function for careful CP0 interrupt mask access */
+static inline void modify_cp0_intmask(unsigned clr_mask, unsigned set_mask)
+{
+	unsigned long status = read_32bit_cp0_register(CP0_STATUS);
+	status &= ~((clr_mask & 0xFF) << 8);
+	status |=   (set_mask & 0xFF) << 8;
+	write_32bit_cp0_register(CP0_STATUS, status);
+}
+
+
+static inline void mask_cpu_irq_input(unsigned int irq_nr)
+{
+	modify_cp0_intmask(irq_nr, 0);
+}
+
+
+static inline void unmask_cpu_irq_input(unsigned int irq_nr)
+{
+	modify_cp0_intmask(0, irq_nr);
+}
+
+
+static void disable_cpu_irq_input(unsigned int irq_nr)
+{
+	unsigned long flags;
+
+	save_and_cli(flags);
+	mask_cpu_irq_input(irq_nr);
+	restore_flags(flags);
+}
+
+
+static void enable_cpu_irq_input(unsigned int irq_nr)
+{
+	unsigned long flags;
+
+	save_and_cli(flags);
+	unmask_cpu_irq_input(irq_nr);
+	restore_flags(flags);
+}
+
+
+static void setup_local_irq(unsigned int irq_nr, int type, int int_req)
+{
+	/* Config2[n], Config1[n], Config0[n] */
+	if (irq_nr > AU1000_LAST_INTC0_INT) {
+		switch (type) {
+			case INTC_INT_RISE_EDGE: /* 0:0:1 */
+				outl(1<<irq_nr,INTC1_CONFIG2_CLEAR);
+				outl(1<<irq_nr, INTC1_CONFIG1_CLEAR);
+				outl(1<<irq_nr, INTC1_CONFIG0_SET);
+				break;
+			case INTC_INT_FALL_EDGE: /* 0:1:0 */
+				outl(1<<irq_nr, INTC1_CONFIG2_CLEAR);
+				outl(1<<irq_nr, INTC1_CONFIG1_SET);
+				outl(1<<irq_nr, INTC1_CONFIG0_CLEAR);
+				break;
+			case INTC_INT_HIGH_LEVEL: /* 1:0:1 */
+				outl(1<<irq_nr, INTC1_CONFIG2_SET);
+				outl(1<<irq_nr, INTC1_CONFIG1_CLEAR);
+				outl(1<<irq_nr, INTC1_CONFIG0_SET);
+				break;
+			case INTC_INT_LOW_LEVEL: /* 1:1:0 */
+				outl(1<<irq_nr, INTC1_CONFIG2_SET);
+				outl(1<<irq_nr, INTC1_CONFIG1_SET);
+				outl(1<<irq_nr, INTC1_CONFIG0_CLEAR);
+				break;
+			case INTC_INT_DISABLED: /* 0:0:0 */
+				outl(1<<irq_nr, INTC1_CONFIG0_CLEAR);
+				outl(1<<irq_nr, INTC1_CONFIG1_CLEAR);
+				outl(1<<irq_nr, INTC1_CONFIG2_CLEAR);
+				break;
+			default: /* disable the interrupt */
+				printk("unexpected int type %d (irq %d)\n", type, irq_nr);
+				outl(1<<irq_nr, INTC1_CONFIG0_CLEAR);
+				outl(1<<irq_nr, INTC1_CONFIG1_CLEAR);
+				outl(1<<irq_nr, INTC1_CONFIG2_CLEAR);
+				return;
+		}
+		if (int_req) /* assign to interrupt request 1 */
+			outl(1<<irq_nr, INTC1_ASSIGN_REQ_CLEAR);
+		else	     /* assign to interrupt request 0 */
+			outl(1<<irq_nr, INTC1_ASSIGN_REQ_SET);
+		outl(1<<irq_nr, INTC1_SOURCE_SET);
+		outl(1<<irq_nr, INTC1_MASK_CLEAR);
+	}
+	else {
+		switch (type) {
+			case INTC_INT_RISE_EDGE: /* 0:0:1 */
+				outl(1<<irq_nr,INTC0_CONFIG2_CLEAR);
+				outl(1<<irq_nr, INTC0_CONFIG1_CLEAR);
+				outl(1<<irq_nr, INTC0_CONFIG0_SET);
+				break;
+			case INTC_INT_FALL_EDGE: /* 0:1:0 */
+				outl(1<<irq_nr, INTC0_CONFIG2_CLEAR);
+				outl(1<<irq_nr, INTC0_CONFIG1_SET);
+				outl(1<<irq_nr, INTC0_CONFIG0_CLEAR);
+				break;
+			case INTC_INT_HIGH_LEVEL: /* 1:0:1 */
+				outl(1<<irq_nr, INTC0_CONFIG2_SET);
+				outl(1<<irq_nr, INTC0_CONFIG1_CLEAR);
+				outl(1<<irq_nr, INTC0_CONFIG0_SET);
+				break;
+			case INTC_INT_LOW_LEVEL: /* 1:1:0 */
+				outl(1<<irq_nr, INTC0_CONFIG2_SET);
+				outl(1<<irq_nr, INTC0_CONFIG1_SET);
+				outl(1<<irq_nr, INTC0_CONFIG0_CLEAR);
+				break;
+			case INTC_INT_DISABLED: /* 0:0:0 */
+				outl(1<<irq_nr, INTC0_CONFIG0_CLEAR);
+				outl(1<<irq_nr, INTC0_CONFIG1_CLEAR);
+				outl(1<<irq_nr, INTC0_CONFIG2_CLEAR);
+				break;
+			default: /* disable the interrupt */
+				printk("unexpected int type %d (irq %d)\n", type, irq_nr);
+				outl(1<<irq_nr, INTC0_CONFIG0_CLEAR);
+				outl(1<<irq_nr, INTC0_CONFIG1_CLEAR);
+				outl(1<<irq_nr, INTC0_CONFIG2_CLEAR);
+				return;
+		}
+		if (int_req) /* assign to interrupt request 1 */
+			outl(1<<irq_nr, INTC0_ASSIGN_REQ_CLEAR);
+		else	     /* assign to interrupt request 0 */
+			outl(1<<irq_nr, INTC0_ASSIGN_REQ_SET);
+		outl(1<<irq_nr, INTC0_SOURCE_SET);
+		outl(1<<irq_nr, INTC0_MASK_CLEAR);
+	}
+	sync();
+}
+
+
+static unsigned int startup_irq(unsigned int irq_nr)
+{
+	local_enable_irq(irq_nr);
+	return 0; 
+}
+
+
+static void shutdown_irq(unsigned int irq_nr)
+{
+	local_disable_irq(irq_nr);
+	return;
+}
+
+
+static inline void local_enable_irq(unsigned int irq_nr)
+{
+	if (irq_nr > AU1000_LAST_INTC0_INT) {
+		outl(1<<irq_nr, INTC1_MASK_SET);
+	}
+	else {
+		outl(1<<irq_nr, INTC0_MASK_SET);
+	}
+	sync();
+}
+
+
+static inline void local_disable_irq(unsigned int irq_nr)
+{
+	if (irq_nr > AU1000_LAST_INTC0_INT) {
+		outl(1<<irq_nr, INTC1_MASK_CLEAR);
+	}
+	else {
+		outl(1<<irq_nr, INTC0_MASK_CLEAR);
+	}
+	sync();
+}
+
+
+static inline void mask_and_ack_rise_edge_irq(unsigned int irq_nr)
+{
+	if (irq_nr > AU1000_LAST_INTC0_INT) {
+		outl(1<<irq_nr, INTC1_R_EDGE_DETECT_CLEAR);
+		outl(1<<irq_nr, INTC1_MASK_CLEAR);
+	}
+	else {
+		outl(1<<irq_nr, INTC0_R_EDGE_DETECT_CLEAR);
+		outl(1<<irq_nr, INTC0_MASK_CLEAR);
+	}
+	sync();
+}
+
+
+static inline void mask_and_ack_fall_edge_irq(unsigned int irq_nr)
+{
+	if (irq_nr > AU1000_LAST_INTC0_INT) {
+		outl(1<<irq_nr, INTC1_F_EDGE_DETECT_CLEAR);
+		outl(1<<irq_nr, INTC1_MASK_CLEAR);
+	}
+	else {
+		outl(1<<irq_nr, INTC0_F_EDGE_DETECT_CLEAR);
+		outl(1<<irq_nr, INTC0_MASK_CLEAR);
+	}
+}
+
+
+static inline void mask_and_ack_level_irq(unsigned int irq_nr)
+{
+	local_disable_irq(irq_nr);
+	sync();
+	return;
+}
+
+
+static void end_irq(unsigned int irq_nr)
+{
+	if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		local_enable_irq(irq_nr);
+	else
+		printk("warning: end_irq %d did not enable\n", irq_nr);
+}
+
+
+static struct hw_interrupt_type rise_edge_irq_type = {
+	"Au1000 Rise Edge",
+	startup_irq,
+	shutdown_irq,
+	local_enable_irq,
+	local_disable_irq,
+	mask_and_ack_rise_edge_irq,
+	end_irq,
+	NULL
+};
+
+
+static struct hw_interrupt_type fall_edge_irq_type = {
+	"Au1000 Fall Edge",
+	startup_irq,
+	shutdown_irq,
+	local_enable_irq,
+	local_disable_irq,
+	mask_and_ack_fall_edge_irq,
+	end_irq,
+	NULL
+};
+
+
+static struct hw_interrupt_type level_irq_type = {
+	"Au1000 Level",
+	startup_irq,
+	shutdown_irq,
+	local_enable_irq,
+	local_disable_irq,
+	mask_and_ack_level_irq,
+	end_irq,
+	NULL
+};
+
+
+void enable_cpu_timer(void)
+{
+	enable_cpu_irq_input(1<<MIPS_TIMER_IP); /* timer interrupt */
+}
+
+
+void __init init_IRQ(void)
+{
+	int i;
+	unsigned long cp0_status;
+
+	cp0_status = read_32bit_cp0_register(CP0_STATUS);
+	memset(irq_desc, 0, sizeof(irq_desc));
+	set_except_vector(0, au1000_IRQ);
+
+	init_generic_irq();
+	
+	/* 
+	 * Setup high priority interrupts on int_request0; low priority on
+	 * int_request1
+	 */
+	for (i = 0; i <= NR_IRQS; i++) {
+		switch (i) {
+			case AU1000_MAC0_DMA_INT:
+			case AU1000_MAC1_DMA_INT:
+				setup_local_irq(i, INTC_INT_HIGH_LEVEL, 0);
+				irq_desc[i].handler = &level_irq_type;
+				break;
+			default: /* active high, level interrupt */
+				setup_local_irq(i, INTC_INT_HIGH_LEVEL, 1);
+				irq_desc[i].handler = &level_irq_type;
+				break;
+		}
+	}
+
+	set_cp0_status(ALLINTS);
+#ifdef CONFIG_REMOTE_DEBUG
+	/* If local serial I/O used for debug port, enter kgdb at once */
+	puts("Waiting for kgdb to connect...");
+	set_debug_traps();
+	breakpoint(); 
+#endif
+}
+
+
+void mips_spurious_interrupt(struct pt_regs *regs)
+{
+	spurious_interrupts++;
+}
+
+
+void intc0_req0_irqdispatch(struct pt_regs *regs)
+{
+	int irq = 0, i;
+	unsigned long int_request;
+
+	int_request = inl(INTC0_REQ0_INT);
+
+	if (!int_request) return;
+
+	for (i=0; i<32; i++) {
+		if ((int_request & 0x1)) {
+			do_IRQ(irq, regs);
+		}
+		irq++;
+		int_request >>= 1;
+	}
+}
+
+
+void intc0_req1_irqdispatch(struct pt_regs *regs)
+{
+	int irq = 0, i;
+	unsigned long int_request;
+
+	int_request = inl(INTC0_REQ1_INT);
+
+	if (!int_request) return;
+
+	for (i=0; i<32; i++) {
+		if ((int_request & 0x1)) {
+			do_IRQ(irq, regs);
+		}
+		irq++;
+		int_request >>= 1;
+	}
+}
+
+
+void intc1_req0_irqdispatch(struct pt_regs *regs)
+{
+	int irq = 0, i;
+	unsigned long int_request;
+
+	int_request = inl(INTC1_REQ0_INT);
+
+	if (!int_request) return;
+
+	for (i=0; i<32; i++) {
+		if ((int_request & 0x1)) {
+			do_IRQ(irq, regs);
+		}
+		irq++;
+		int_request >>= 1;
+	}
+}
+
+
+void intc1_req1_irqdispatch(struct pt_regs *regs)
+{
+	int irq = 0, i;
+	unsigned long int_request;
+
+	int_request = inl(INTC1_REQ1_INT);
+
+	if (!int_request) return;
+
+	for (i=0; i<32; i++) {
+		if ((int_request & 0x1)) {
+			do_IRQ(irq, regs);
+		}
+		irq++;
+		int_request >>= 1;
+	}
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/au1000/common/prom.c linux/arch/mips/au1000/common/prom.c
--- v2.4.9/linux/arch/mips/au1000/common/prom.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/au1000/common/prom.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,120 @@
+/*
+ *
+ * BRIEF MODULE DESCRIPTION
+ *    PROM library initialisation code, assuming a version of
+ *    pmon is the boot code.
+ *
+ * Copyright 2000 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc.
+ *         	ppopov@mvista.com or source@mvista.com
+ *
+ * This file was derived from Carsten Langgaard's 
+ * arch/mips/mips-boards/xx files.
+ *
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 1999,2000 MIPS Technologies, Inc.  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  SOFTWARE  IS PROVIDED   ``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.
+ *
+ *  You should have received a copy of the  GNU General Public License along
+ *  with this program; if not, write  to the Free Software Foundation, Inc.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/string.h>
+
+#include <asm/bootinfo.h>
+
+/* #define DEBUG_CMDLINE */
+
+char arcs_cmdline[COMMAND_LINE_SIZE];
+int prom_argc;
+char **prom_argv, **prom_envp;
+
+typedef struct {
+	char *name;
+/*	char *val; */
+} t_env_var;
+
+
+char * __init prom_getcmdline(void)
+{
+	return &(arcs_cmdline[0]);
+}
+
+void  __init prom_init_cmdline(void)
+{
+	char *cp;
+	int actr;
+
+	actr = 1; /* Always ignore argv[0] */
+
+	cp = &(arcs_cmdline[0]);
+	while(actr < prom_argc) {
+	        strcpy(cp, prom_argv[actr]);
+		cp += strlen(prom_argv[actr]);
+		*cp++ = ' ';
+		actr++;
+	}
+	if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */
+		--cp;
+	*cp = '\0';
+
+}
+
+
+char *prom_getenv(char *envname)
+{
+	/*
+	 * Return a pointer to the given environment variable.
+	 * Environment variables are stored in the form of "memsize=64".
+	 */
+
+	t_env_var *env = (t_env_var *)prom_envp;
+	int i;
+
+	i = strlen(envname);
+
+	while(env->name) {
+		if(strncmp(envname, env->name, i) == 0) {
+			return(env->name + strlen(envname) + 1);
+		}
+		env++;
+	}
+	return(NULL);
+}
+
+static inline unsigned char str2hexnum(unsigned char c)
+{
+	if(c >= '0' && c <= '9')
+	return c - '0';
+	if(c >= 'a' && c <= 'f')
+	return c - 'a' + 10;
+	return 0; /* foo */
+}
+
+int __init page_is_ram(unsigned long pagenr)
+{
+	return 1;
+}
+
+void prom_free_prom_memory (void)
+{
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/au1000/common/puts.c linux/arch/mips/au1000/common/puts.c
--- v2.4.9/linux/arch/mips/au1000/common/puts.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/au1000/common/puts.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,144 @@
+/*
+ *
+ * BRIEF MODULE DESCRIPTION
+ *	Low level uart routines to directly access a 16550 uart.
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc.
+ *         	ppopov@mvista.com or source@mvista.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ *  THIS  SOFTWARE  IS PROVIDED   ``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.
+ *
+ *  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/types.h>
+
+#define SERIAL_BASE   0xB1100000 /* au1000, uart 0 */
+#define SER_CMD       0x7
+#define SER_DATA      0x1
+#define TX_BUSY       0x20
+
+#define TIMEOUT       0xffffff
+#define SLOW_DOWN
+
+static const char digits[16] = "0123456789abcdef";
+static volatile unsigned long * const com1 = (unsigned char *)SERIAL_BASE;
+
+
+#ifdef SLOW_DOWN
+static inline void slow_down()
+{
+    int k;
+    for (k=0; k<10000; k++);
+}
+#else
+#define slow_down()
+#endif
+
+void
+putch(const unsigned char c)
+{
+    unsigned char ch;
+    int i = 0;
+
+    do {
+        ch = com1[SER_CMD];
+        slow_down();
+        i++;
+        if (i>TIMEOUT) {
+            break;
+        }
+    } while (0 == (ch & TX_BUSY));
+    com1[SER_DATA] = c;
+}
+
+void
+puts(unsigned char *cp)
+{
+    unsigned char ch;
+    int i = 0;
+
+    while (*cp) {
+        do {
+             ch = com1[SER_CMD];
+            slow_down();
+            i++;
+            if (i>TIMEOUT) {
+                break;
+            }
+        } while (0 == (ch & TX_BUSY));
+        com1[SER_DATA] = *cp++;
+    }
+    putch('\r');
+    putch('\n');
+}
+
+void
+fputs(unsigned char *cp)
+{
+    unsigned char ch;
+    int i = 0;
+
+    while (*cp) {
+
+        do {
+             ch = com1[SER_CMD];
+             slow_down();
+            i++;
+            if (i>TIMEOUT) {
+                break;
+            }
+        } while (0 == (ch & TX_BUSY));
+        com1[SER_DATA] = *cp++;
+    }
+}
+
+
+void
+put64(uint64_t ul)
+{
+    int cnt;
+    unsigned ch;
+
+    cnt = 16;            /* 16 nibbles in a 64 bit long */
+    putch('0');
+    putch('x');
+    do {
+        cnt--;
+        ch = (unsigned char)(ul >> cnt * 4) & 0x0F;
+                putch(digits[ch]);
+    } while (cnt > 0);
+}
+
+void
+put32(unsigned u)
+{
+    int cnt;
+    unsigned ch;
+
+    cnt = 8;            /* 8 nibbles in a 32 bit long */
+    putch('0');
+    putch('x');
+    do {
+        cnt--;
+        ch = (unsigned char)(u >> cnt * 4) & 0x0F;
+                putch(digits[ch]);
+    } while (cnt > 0);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/au1000/common/reset.c linux/arch/mips/au1000/common/reset.c
--- v2.4.9/linux/arch/mips/au1000/common/reset.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/au1000/common/reset.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,60 @@
+/*
+ *
+ * BRIEF MODULE DESCRIPTION
+ *	Au1000 reset routines.
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc.
+ *         	ppopov@mvista.com or source@mvista.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ *  THIS  SOFTWARE  IS PROVIDED   ``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.
+ *
+ *  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/sched.h>
+#include <linux/mm.h>
+#include <asm/io.h>
+#include <asm/pgtable.h>
+#include <asm/processor.h>
+#include <asm/reboot.h>
+#include <asm/system.h>
+
+void au1000_restart(char *command)
+{
+	set_cp0_status(ST0_BEV | ST0_ERL);
+	set_cp0_config(CONF_CM_UNCACHED);
+	flush_cache_all();
+	write_32bit_cp0_register(CP0_WIRED, 0);
+	__asm__ __volatile__("jr\t%0"::"r"(0xbfc00000));
+}
+
+void au1000_halt(void)
+{
+	printk(KERN_NOTICE "\n** You can safely turn off the power\n");
+	while (1)
+		__asm__(".set\tmips3\n\t"
+	                "wait\n\t"
+			".set\tmips0");
+}
+
+void au1000_power_off(void)
+{
+	au1000_halt();
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/au1000/common/serial.c linux/arch/mips/au1000/common/serial.c
--- v2.4.9/linux/arch/mips/au1000/common/serial.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/au1000/common/serial.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,3100 @@
+/*
+ *
+ * BRIEF MODULE DESCRIPTION
+ *	Au1000 serial port driver.
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc.
+ *         	ppopov@mvista.com or source@mvista.com
+ *
+ *  Derived almost entirely from drivers/char/serial.c:
+ *
+ *  Copyright (C) 1991, 1992  Linus Torvalds
+ *  Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 
+ * 		1998, 1999  Theodore Ts'o
+ *
+ *  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  SOFTWARE  IS PROVIDED   ``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.
+ *
+ *  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.
+ */
+
+static char *serial_version = "1.01";
+static char *serial_revdate = "2001-02-08";
+
+
+#include <linux/config.h>
+#include <linux/version.h>
+
+#undef SERIAL_PARANOIA_CHECK
+#define CONFIG_SERIAL_NOPAUSE_IO
+#define SERIAL_DO_RESTART
+
+
+/* Set of debugging defines */
+
+#undef SERIAL_DEBUG_INTR
+#undef SERIAL_DEBUG_OPEN
+#undef SERIAL_DEBUG_FLOW
+#undef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
+#undef SERIAL_DEBUG_PCI
+#undef SERIAL_DEBUG_AUTOCONF
+
+#ifdef MODULE
+#undef CONFIG_AU1000_SERIAL_CONSOLE
+#endif
+
+#define CONFIG_SERIAL_RSA
+
+#define RS_STROBE_TIME (10*HZ)
+#define RS_ISR_PASS_LIMIT 256
+  
+/*
+ * End of serial driver configuration section.
+ */
+
+#ifdef MODVERSIONS
+#include <linux/modversions.h>
+#endif
+#include <linux/module.h>
+
+#include <linux/types.h>
+#ifdef LOCAL_HEADERS
+#include "serial_local.h"
+#else
+#include <linux/serial.h>
+#include <linux/serialP.h>
+#include <asm/au1000.h>
+#include <asm/serial.h>
+#define LOCAL_VERSTRING ""
+#endif
+
+#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/major.h>
+#include <linux/string.h>
+#include <linux/fcntl.h>
+#include <linux/ptrace.h>
+#include <linux/ioport.h>
+#include <linux/mm.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <asm/uaccess.h>
+#include <linux/delay.h>
+#ifdef CONFIG_AU1000_SERIAL_CONSOLE
+#include <linux/console.h>
+#endif
+#ifdef CONFIG_MAGIC_SYSRQ
+#include <linux/sysrq.h>
+#endif
+
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/bitops.h>
+
+#ifdef CONFIG_MAC_SERIAL
+#define SERIAL_DEV_OFFSET	2
+#else
+#define SERIAL_DEV_OFFSET	0
+#endif
+
+#ifdef SERIAL_INLINE
+#define _INLINE_ inline
+#else
+#define _INLINE_
+#endif
+
+static char *serial_name = "Serial driver";
+
+static DECLARE_TASK_QUEUE(tq_serial);
+
+static struct tty_driver serial_driver, callout_driver;
+static int serial_refcount;
+
+static struct timer_list serial_timer;
+
+extern unsigned long get_au1000_uart_baud(void);
+
+/* serial subtype definitions */
+#ifndef SERIAL_TYPE_NORMAL
+#define SERIAL_TYPE_NORMAL	1
+#define SERIAL_TYPE_CALLOUT	2
+#endif
+
+/* number of characters left in xmit buffer before we ask for more */
+#define WAKEUP_CHARS 256
+
+/*
+ * IRQ_timeout		- How long the timeout should be for each IRQ
+ * 				should be after the IRQ has been active.
+ */
+
+static struct async_struct *IRQ_ports[NR_IRQS];
+static int IRQ_timeout[NR_IRQS];
+#ifdef CONFIG_AU1000_SERIAL_CONSOLE
+static struct console sercons;
+static int lsr_break_flag;
+#endif
+#if defined(CONFIG_AU1000_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+static unsigned long break_pressed; /* break, really ... */
+#endif
+
+static void autoconfig(struct serial_state * state);
+static void change_speed(struct async_struct *info, struct termios *old);
+static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
+
+/*
+ * Here we define the default xmit fifo size used for each type of
+ * UART
+ */
+static struct serial_uart_config uart_config[] = {
+	{ "unknown", 1, 0 }, 
+	{ "8250", 1, 0 }, 
+	{ "16450", 1, 0 }, 
+	{ "16550", 1, 0 }, 
+	{ 0, 0}
+};
+
+
+static struct serial_state rs_table[RS_TABLE_SIZE] = {
+	SERIAL_PORT_DFNS	/* Defined in serial.h */
+};
+
+#define NR_PORTS	(sizeof(rs_table)/sizeof(struct serial_state))
+
+#ifndef PREPARE_FUNC
+#define PREPARE_FUNC(dev)  (dev->prepare)
+#define ACTIVATE_FUNC(dev)  (dev->activate)
+#define DEACTIVATE_FUNC(dev)  (dev->deactivate)
+#endif
+
+#define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8)
+
+static struct tty_struct *serial_table[NR_PORTS];
+static struct termios *serial_termios[NR_PORTS];
+static struct termios *serial_termios_locked[NR_PORTS];
+
+
+#if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT)
+#define DBG_CNT(s) printk("(%s): [%x] refc=%d, serc=%d, ttyc=%d -> %s\n", \
+ kdevname(tty->device), (info->flags), serial_refcount,info->count,tty->count,s)
+#else
+#define DBG_CNT(s)
+#endif
+
+/*
+ * tmp_buf is used as a temporary buffer by serial_write.  We need to
+ * lock it in case the copy_from_user blocks while swapping in a page,
+ * and some other program tries to do a serial write at the same time.
+ * Since the lock will only come under contention when the system is
+ * swapping and available memory is low, it makes sense to share one
+ * buffer across all the serial ports, since it significantly saves
+ * memory if large numbers of serial ports are open.
+ */
+static unsigned char *tmp_buf;
+#ifdef DECLARE_MUTEX
+static DECLARE_MUTEX(tmp_buf_sem);
+#else
+static struct semaphore tmp_buf_sem = MUTEX;
+#endif
+
+
+static inline int serial_paranoia_check(struct async_struct *info,
+					kdev_t device, const char *routine)
+{
+#ifdef SERIAL_PARANOIA_CHECK
+	static const char *badmagic =
+		"Warning: bad magic number for serial struct (%s) in %s\n";
+	static const char *badinfo =
+		"Warning: null async_struct for (%s) in %s\n";
+
+	if (!info) {
+		printk(badinfo, kdevname(device), routine);
+		return 1;
+	}
+	if (info->magic != SERIAL_MAGIC) {
+		printk(badmagic, kdevname(device), routine);
+		return 1;
+	}
+#endif
+	return 0;
+}
+
+
+static _INLINE_ unsigned int serial_in(struct async_struct *info, int offset)
+{
+	return (inl(info->port+offset) & 0xff);
+}
+
+static _INLINE_ void serial_out(struct async_struct *info, int offset, int value)
+{
+	outl(value & 0xff, info->port+offset);
+}
+
+
+/*
+ * We used to support using pause I/O for certain machines.  We
+ * haven't supported this for a while, but just in case it's badly
+ * needed for certain old 386 machines, I've left these #define's
+ * in....
+ */
+#define serial_inp(info, offset)		serial_in(info, offset)
+#define serial_outp(info, offset, value)	serial_out(info, offset, value)
+
+
+/*
+ * ------------------------------------------------------------
+ * rs_stop() and rs_start()
+ *
+ * This routines are called before setting or resetting tty->stopped.
+ * They enable or disable transmitter interrupts, as necessary.
+ * ------------------------------------------------------------
+ */
+static void rs_stop(struct tty_struct *tty)
+{
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
+	unsigned long flags;
+
+	if (serial_paranoia_check(info, tty->device, "rs_stop"))
+		return;
+	
+	save_flags(flags); cli();
+	if (info->IER & UART_IER_THRI) {
+		info->IER &= ~UART_IER_THRI;
+		serial_out(info, UART_IER, info->IER);
+	}
+	restore_flags(flags);
+}
+
+static void rs_start(struct tty_struct *tty)
+{
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
+	unsigned long flags;
+	
+	if (serial_paranoia_check(info, tty->device, "rs_start"))
+		return;
+	
+	save_flags(flags); cli();
+	if (info->xmit.head != info->xmit.tail
+	    && info->xmit.buf
+	    && !(info->IER & UART_IER_THRI)) {
+		info->IER |= UART_IER_THRI;
+		serial_out(info, UART_IER, info->IER);
+	}
+	restore_flags(flags);
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * Here starts the interrupt handling routines.  All of the following
+ * subroutines are declared as inline and are folded into
+ * rs_interrupt().  They were separated out for readability's sake.
+ *
+ * Note: rs_interrupt() is a "fast" interrupt, which means that it
+ * runs with interrupts turned off.  People who may want to modify
+ * rs_interrupt() should try to keep the interrupt handler as fast as
+ * possible.  After you are done making modifications, it is not a bad
+ * idea to do:
+ * 
+ * gcc -S -DKERNEL -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer serial.c
+ *
+ * and look at the resulting assemble code in serial.s.
+ *
+ * 				- Ted Ts'o (tytso@mit.edu), 7-Mar-93
+ * -----------------------------------------------------------------------
+ */
+
+/*
+ * This routine is used by the interrupt handler to schedule
+ * processing in the software interrupt portion of the driver.
+ */
+static _INLINE_ void rs_sched_event(struct async_struct *info,
+				  int event)
+{
+	info->event |= 1 << event;
+	queue_task(&info->tqueue, &tq_serial);
+	mark_bh(SERIAL_BH);
+}
+
+static _INLINE_ void receive_chars(struct async_struct *info,
+				 int *status, struct pt_regs * regs)
+{
+	struct tty_struct *tty = info->tty;
+	unsigned char ch;
+	int ignored = 0;
+	struct	async_icount *icount;
+
+	icount = &info->state->icount;
+	do {
+		ch = serial_inp(info, UART_RX);
+		if (tty->flip.count >= TTY_FLIPBUF_SIZE)
+			goto ignore_char;
+		*tty->flip.char_buf_ptr = ch;
+		icount->rx++;
+		
+#ifdef SERIAL_DEBUG_INTR
+		printk("DR%02x:%02x...", ch, *status);
+#endif
+		*tty->flip.flag_buf_ptr = 0;
+		if (*status & (UART_LSR_BI | UART_LSR_PE |
+			       UART_LSR_FE | UART_LSR_OE)) {
+			/*
+			 * For statistics only
+			 */
+			if (*status & UART_LSR_BI) {
+				*status &= ~(UART_LSR_FE | UART_LSR_PE);
+				icount->brk++;
+				/*
+				 * We do the SysRQ and SAK checking
+				 * here because otherwise the break
+				 * may get masked by ignore_status_mask
+				 * or read_status_mask.
+				 */
+#if defined(CONFIG_AU1000_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+				if (info->line == sercons.index) {
+					if (!break_pressed) {
+						break_pressed = jiffies;
+						goto ignore_char;
+					}
+					break_pressed = 0;
+				}
+#endif
+				if (info->flags & ASYNC_SAK)
+					do_SAK(tty);
+			} else if (*status & UART_LSR_PE)
+				icount->parity++;
+			else if (*status & UART_LSR_FE)
+				icount->frame++;
+			if (*status & UART_LSR_OE)
+				icount->overrun++;
+
+			/*
+			 * Now check to see if character should be
+			 * ignored, and mask off conditions which
+			 * should be ignored.
+			 */
+			if (*status & info->ignore_status_mask) {
+				if (++ignored > 100)
+					break;
+				goto ignore_char;
+			}
+			*status &= info->read_status_mask;
+
+#ifdef CONFIG_AU1000_SERIAL_CONSOLE
+			if (info->line == sercons.index) {
+				/* Recover the break flag from console xmit */
+				*status |= lsr_break_flag;
+				lsr_break_flag = 0;
+			}
+#endif
+			if (*status & (UART_LSR_BI)) {
+#ifdef SERIAL_DEBUG_INTR
+				printk("handling break....");
+#endif
+				*tty->flip.flag_buf_ptr = TTY_BREAK;
+			} else if (*status & UART_LSR_PE)
+				*tty->flip.flag_buf_ptr = TTY_PARITY;
+			else if (*status & UART_LSR_FE)
+				*tty->flip.flag_buf_ptr = TTY_FRAME;
+			if (*status & UART_LSR_OE) {
+				/*
+				 * Overrun is special, since it's
+				 * reported immediately, and doesn't
+				 * affect the current character
+				 */
+				tty->flip.count++;
+				tty->flip.flag_buf_ptr++;
+				tty->flip.char_buf_ptr++;
+				*tty->flip.flag_buf_ptr = TTY_OVERRUN;
+				if (tty->flip.count >= TTY_FLIPBUF_SIZE)
+					goto ignore_char;
+			}
+		}
+#if defined(CONFIG_AU1000_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+		if (break_pressed && info->line == sercons.index) {
+			if (ch != 0 &&
+			    time_before(jiffies, break_pressed + HZ*5)) {
+				handle_sysrq(ch, regs, NULL, NULL);
+				break_pressed = 0;
+				goto ignore_char;
+			}
+			break_pressed = 0;
+		}
+#endif
+		tty->flip.flag_buf_ptr++;
+		tty->flip.char_buf_ptr++;
+		tty->flip.count++;
+	ignore_char:
+		*status = serial_inp(info, UART_LSR);
+	} while (*status & UART_LSR_DR);
+	tty_flip_buffer_push(tty);
+}
+
+static _INLINE_ void transmit_chars(struct async_struct *info, int *intr_done)
+{
+	int count;
+
+	if (info->x_char) {
+		serial_outp(info, UART_TX, info->x_char);
+		info->state->icount.tx++;
+		info->x_char = 0;
+		if (intr_done)
+			*intr_done = 0;
+		return;
+	}
+	if (info->xmit.head == info->xmit.tail
+	    || info->tty->stopped
+	    || info->tty->hw_stopped) {
+		info->IER &= ~UART_IER_THRI;
+		serial_out(info, UART_IER, info->IER);
+		return;
+	}
+	
+	count = info->xmit_fifo_size;
+	do {
+		serial_out(info, UART_TX, info->xmit.buf[info->xmit.tail]);
+		info->xmit.tail = (info->xmit.tail + 1) & (SERIAL_XMIT_SIZE-1);
+		info->state->icount.tx++;
+		if (info->xmit.head == info->xmit.tail)
+			break;
+	} while (--count > 0);
+	
+	if (CIRC_CNT(info->xmit.head,
+		     info->xmit.tail,
+		     SERIAL_XMIT_SIZE) < WAKEUP_CHARS)
+		rs_sched_event(info, RS_EVENT_WRITE_WAKEUP);
+
+#ifdef SERIAL_DEBUG_INTR
+	printk("THRE...");
+#endif
+	if (intr_done)
+		*intr_done = 0;
+
+	if (info->xmit.head == info->xmit.tail) {
+		info->IER &= ~UART_IER_THRI;
+		serial_out(info, UART_IER, info->IER);
+	}
+}
+
+static _INLINE_ void check_modem_status(struct async_struct *info)
+{
+	int	status;
+	struct	async_icount *icount;
+	
+	status = serial_in(info, UART_MSR);
+
+	if (status & UART_MSR_ANY_DELTA) {
+		icount = &info->state->icount;
+		/* update input line counters */
+		if (status & UART_MSR_TERI)
+			icount->rng++;
+		if (status & UART_MSR_DDSR)
+			icount->dsr++;
+		if (status & UART_MSR_DDCD) {
+			icount->dcd++;
+#ifdef CONFIG_HARD_PPS
+			if ((info->flags & ASYNC_HARDPPS_CD) &&
+			    (status & UART_MSR_DCD))
+				hardpps();
+#endif
+		}
+		if (status & UART_MSR_DCTS)
+			icount->cts++;
+		wake_up_interruptible(&info->delta_msr_wait);
+	}
+
+	if ((info->flags & ASYNC_CHECK_CD) && (status & UART_MSR_DDCD)) {
+#if (defined(SERIAL_DEBUG_OPEN) || defined(SERIAL_DEBUG_INTR))
+		printk("ttys%d CD now %s...", info->line,
+		       (status & UART_MSR_DCD) ? "on" : "off");
+#endif		
+		if (status & UART_MSR_DCD)
+			wake_up_interruptible(&info->open_wait);
+		else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) &&
+			   (info->flags & ASYNC_CALLOUT_NOHUP))) {
+#ifdef SERIAL_DEBUG_OPEN
+			printk("doing serial hangup...");
+#endif
+			if (info->tty)
+				tty_hangup(info->tty);
+		}
+	}
+	if (info->flags & ASYNC_CTS_FLOW) {
+		if (info->tty->hw_stopped) {
+			if (status & UART_MSR_CTS) {
+#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
+				printk("CTS tx start...");
+#endif
+				info->tty->hw_stopped = 0;
+				info->IER |= UART_IER_THRI;
+				serial_out(info, UART_IER, info->IER);
+				rs_sched_event(info, RS_EVENT_WRITE_WAKEUP);
+				return;
+			}
+		} else {
+			if (!(status & UART_MSR_CTS)) {
+#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
+				printk("CTS tx stop...");
+#endif
+				info->tty->hw_stopped = 1;
+				info->IER &= ~UART_IER_THRI;
+				serial_out(info, UART_IER, info->IER);
+			}
+		}
+	}
+}
+
+
+
+/*
+ * This is the serial driver's interrupt routine for a single port
+ */
+static void rs_interrupt_single(int irq, void *dev_id, struct pt_regs * regs)
+{
+	int status;
+	int pass_counter = 0;
+	struct async_struct * info;
+	
+#ifdef SERIAL_DEBUG_INTR
+	printk("rs_interrupt_single(%d)...", irq);
+#endif
+
+	info = IRQ_ports[irq];
+	if (!info || !info->tty)
+		return;
+
+	do {
+		status = serial_inp(info, UART_LSR);
+#ifdef SERIAL_DEBUG_INTR
+		printk("status = %x...", status);
+#endif
+		if (status & UART_LSR_DR)
+			receive_chars(info, &status, regs);
+		check_modem_status(info);
+		if (status & UART_LSR_THRE)
+			transmit_chars(info, 0);
+		if (pass_counter++ > RS_ISR_PASS_LIMIT) {
+#if 0
+			printk("rs_single loop break.\n");
+#endif
+			break;
+		}
+	} while (!(serial_in(info, UART_IIR) & UART_IIR_NO_INT));
+	info->last_active = jiffies;
+#ifdef SERIAL_DEBUG_INTR
+	printk("end.\n");
+#endif
+}
+
+
+/*
+ * -------------------------------------------------------------------
+ * Here ends the serial interrupt routines.
+ * -------------------------------------------------------------------
+ */
+
+/*
+ * This routine is used to handle the "bottom half" processing for the
+ * serial driver, known also the "software interrupt" processing.
+ * This processing is done at the kernel interrupt level, after the
+ * rs_interrupt() has returned, BUT WITH INTERRUPTS TURNED ON.  This
+ * is where time-consuming activities which can not be done in the
+ * interrupt driver proper are done; the interrupt driver schedules
+ * them using rs_sched_event(), and they get done here.
+ */
+static void do_serial_bh(void)
+{
+	run_task_queue(&tq_serial);
+}
+
+static void do_softint(void *private_)
+{
+	struct async_struct	*info = (struct async_struct *) private_;
+	struct tty_struct	*tty;
+	
+	tty = info->tty;
+	if (!tty)
+		return;
+
+	if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event)) {
+		if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
+		    tty->ldisc.write_wakeup)
+			(tty->ldisc.write_wakeup)(tty);
+		wake_up_interruptible(&tty->write_wait);
+#ifdef SERIAL_HAVE_POLL_WAIT
+		wake_up_interruptible(&tty->poll_wait);
+#endif
+	}
+}
+
+/*
+ * This subroutine is called when the RS_TIMER goes off.  It is used
+ * by the serial driver to handle ports that do not have an interrupt
+ * (irq=0).  This doesn't work very well for 16450's, but gives barely
+ * passable results for a 16550A.  (Although at the expense of much
+ * CPU overhead).
+ */
+static void rs_timer(unsigned long dummy)
+{
+	static unsigned long last_strobe;
+	struct async_struct *info;
+	unsigned int	i;
+	unsigned long flags;
+
+	if ((jiffies - last_strobe) >= RS_STROBE_TIME) {
+		for (i=0; i < NR_IRQS; i++) {
+			info = IRQ_ports[i];
+			if (!info)
+				continue;
+			save_flags(flags); cli();
+				rs_interrupt_single(i, NULL, NULL);
+			restore_flags(flags);
+		}
+	}
+	last_strobe = jiffies;
+	mod_timer(&serial_timer, jiffies + RS_STROBE_TIME);
+
+#if 0
+	if (IRQ_ports[0]) {
+		save_flags(flags); cli();
+		rs_interrupt_single(0, NULL, NULL);
+		restore_flags(flags);
+
+		mod_timer(&serial_timer, jiffies + IRQ_timeout[0]);
+	}
+#endif
+}
+
+/*
+ * ---------------------------------------------------------------
+ * Low level utility subroutines for the serial driver:  routines to
+ * figure out the appropriate timeout for an interrupt chain, routines
+ * to initialize and startup a serial port, and routines to shutdown a
+ * serial port.  Useful stuff like that.
+ * ---------------------------------------------------------------
+ */
+
+/*
+ * This routine figures out the correct timeout for a particular IRQ.
+ * It uses the smallest timeout of all of the serial ports in a
+ * particular interrupt chain.  Now only used for IRQ 0....
+ */
+static void figure_IRQ_timeout(int irq)
+{
+	struct	async_struct	*info;
+	int	timeout = 60*HZ;	/* 60 seconds === a long time :-) */
+
+	info = IRQ_ports[irq];
+	if (!info) {
+		IRQ_timeout[irq] = 60*HZ;
+		return;
+	}
+	while (info) {
+		if (info->timeout < timeout)
+			timeout = info->timeout;
+		info = info->next_port;
+	}
+	if (!irq)
+		timeout = timeout / 2;
+	IRQ_timeout[irq] = (timeout > 3) ? timeout-2 : 1;
+}
+
+
+static int startup(struct async_struct * info)
+{
+	unsigned long flags;
+	int	retval=0;
+	void (*handler)(int, void *, struct pt_regs *);
+	struct serial_state *state= info->state;
+	unsigned long page;
+
+	page = get_zeroed_page(GFP_KERNEL);
+	if (!page)
+		return -ENOMEM;
+
+	save_flags(flags); cli();
+
+	if (info->flags & ASYNC_INITIALIZED) {
+		free_page(page);
+		goto errout;
+	}
+
+	if (!CONFIGURED_SERIAL_PORT(state) || !state->type) {
+		if (info->tty)
+			set_bit(TTY_IO_ERROR, &info->tty->flags);
+		free_page(page);
+		goto errout;
+	}
+	if (info->xmit.buf)
+		free_page(page);
+	else
+		info->xmit.buf = (unsigned char *) page;
+
+
+	if (inl(UART_MOD_CNTRL + state->port) != 0x3) {
+		outl(3, UART_MOD_CNTRL + state->port);
+	}
+#ifdef SERIAL_DEBUG_OPEN
+	printk("starting up ttys%d (irq %d)...", info->line, state->irq);
+#endif
+
+
+	/*
+	 * Clear the FIFO buffers and disable them
+	 * (they will be reenabled in change_speed())
+	 */
+	if (uart_config[state->type].flags & UART_CLEAR_FIFO) {
+		serial_outp(info, UART_FCR, UART_FCR_ENABLE_FIFO);
+		serial_outp(info, UART_FCR, (UART_FCR_ENABLE_FIFO |
+					     UART_FCR_CLEAR_RCVR |
+					     UART_FCR_CLEAR_XMIT));
+		serial_outp(info, UART_FCR, 0);
+	}
+
+	/*
+	 * Clear the interrupt registers.
+	 */
+	(void) serial_inp(info, UART_LSR);
+	(void) serial_inp(info, UART_RX);
+	(void) serial_inp(info, UART_IIR);
+	(void) serial_inp(info, UART_MSR);
+
+	/*
+	 * At this point there's no way the LSR could still be 0xFF;
+	 * if it is, then bail out, because there's likely no UART
+	 * here.
+	 */
+	if (!(info->flags & ASYNC_BUGGY_UART) &&
+	    (serial_inp(info, UART_LSR) == 0xff)) {
+		printk("LSR safety check engaged!\n");
+		if (capable(CAP_SYS_ADMIN)) {
+			if (info->tty)
+				set_bit(TTY_IO_ERROR, &info->tty->flags);
+		} else
+			retval = -ENODEV;
+		goto errout;
+	}
+	
+	/*
+	 * Allocate the IRQ if necessary
+	 */
+#if 0
+	/* au1000, uart0 irq is 0 */
+	if (state->irq && (!IRQ_ports[state->irq] || !IRQ_ports[state->irq]->next_port)) {
+#endif
+	if ((!IRQ_ports[state->irq] || !IRQ_ports[state->irq]->next_port)) {
+		if (IRQ_ports[state->irq]) {
+			retval = -EBUSY;
+			goto errout;
+		} else 
+			handler = rs_interrupt_single;
+
+		retval = request_irq(state->irq, handler, SA_SHIRQ,
+				     "serial", &IRQ_ports[state->irq]);
+		if (retval) {
+			if (capable(CAP_SYS_ADMIN)) {
+				if (info->tty)
+					set_bit(TTY_IO_ERROR,
+						&info->tty->flags);
+				retval = 0;
+			}
+			goto errout;
+		}
+	}
+
+	/*
+	 * Insert serial port into IRQ chain.
+	 */
+	info->prev_port = 0;
+	info->next_port = IRQ_ports[state->irq];
+	if (info->next_port)
+		info->next_port->prev_port = info;
+	IRQ_ports[state->irq] = info;
+	figure_IRQ_timeout(state->irq);
+
+	/*
+	 * Now, initialize the UART 
+	 */
+	serial_outp(info, UART_LCR, UART_LCR_WLEN8);
+
+	info->MCR = 0;
+	if (info->tty->termios->c_cflag & CBAUD)
+		info->MCR = UART_MCR_DTR | UART_MCR_RTS;
+	{
+		if (state->irq != 0)
+			info->MCR |= UART_MCR_OUT2;
+	}
+	info->MCR |= ALPHA_KLUDGE_MCR; 		/* Don't ask */
+	serial_outp(info, UART_MCR, info->MCR);
+	
+	/*
+	 * Finally, enable interrupts
+	 */
+	info->IER = UART_IER_MSI | UART_IER_RLSI | UART_IER_RDI;
+	serial_outp(info, UART_IER, info->IER);	/* enable interrupts */
+	
+
+	/*
+	 * And clear the interrupt registers again for luck.
+	 */
+	(void)serial_inp(info, UART_LSR);
+	(void)serial_inp(info, UART_RX);
+	(void)serial_inp(info, UART_IIR);
+	(void)serial_inp(info, UART_MSR);
+
+	if (info->tty)
+		clear_bit(TTY_IO_ERROR, &info->tty->flags);
+	info->xmit.head = info->xmit.tail = 0;
+
+	/*
+	 * Set up serial timers...
+	 */
+	mod_timer(&serial_timer, jiffies + 2*HZ/100);
+
+	/*
+	 * Set up the tty->alt_speed kludge
+	 */
+	if (info->tty) {
+		if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
+			info->tty->alt_speed = 57600;
+		if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
+			info->tty->alt_speed = 115200;
+		if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
+			info->tty->alt_speed = 230400;
+		if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
+			info->tty->alt_speed = 460800;
+	}
+	
+	/*
+	 * and set the speed of the serial port
+	 */
+	change_speed(info, 0);
+
+	info->flags |= ASYNC_INITIALIZED;
+	restore_flags(flags);
+	return 0;
+	
+errout:
+	restore_flags(flags);
+	return retval;
+}
+
+/*
+ * This routine will shutdown a serial port; interrupts are disabled, and
+ * DTR is dropped if the hangup on close termio flag is on.
+ */
+static void shutdown(struct async_struct * info)
+{
+	unsigned long	flags;
+	struct serial_state *state;
+	int		retval;
+
+	if (!(info->flags & ASYNC_INITIALIZED))
+		return;
+
+	state = info->state;
+
+#ifdef SERIAL_DEBUG_OPEN
+	printk("Shutting down serial port %d (irq %d)....", info->line,
+	       state->irq);
+#endif
+	
+	save_flags(flags); cli(); /* Disable interrupts */
+
+	/*
+	 * clear delta_msr_wait queue to avoid mem leaks: we may free the irq
+	 * here so the queue might never be waken up
+	 */
+	wake_up_interruptible(&info->delta_msr_wait);
+	
+	/*
+	 * First unlink the serial port from the IRQ chain...
+	 */
+	if (info->next_port)
+		info->next_port->prev_port = info->prev_port;
+	if (info->prev_port)
+		info->prev_port->next_port = info->next_port;
+	else
+		IRQ_ports[state->irq] = info->next_port;
+	figure_IRQ_timeout(state->irq);
+	
+	/*
+	 * Free the IRQ, if necessary
+	 */
+//	if (state->irq && (!IRQ_ports[state->irq] ||
+	if ((!IRQ_ports[state->irq] ||
+			  !IRQ_ports[state->irq]->next_port)) {
+		if (IRQ_ports[state->irq]) {
+			free_irq(state->irq, &IRQ_ports[state->irq]);
+			retval = request_irq(state->irq, rs_interrupt_single,
+					     SA_SHIRQ, "serial",
+					     &IRQ_ports[state->irq]);
+			
+			if (retval)
+				printk("serial shutdown: request_irq: error %d"
+				       "  Couldn't reacquire IRQ.\n", retval);
+		} else
+			free_irq(state->irq, &IRQ_ports[state->irq]);
+	}
+
+	if (info->xmit.buf) {
+		unsigned long pg = (unsigned long) info->xmit.buf;
+		info->xmit.buf = 0;
+		free_page(pg);
+	}
+
+	info->IER = 0;
+	serial_outp(info, UART_IER, 0x00);	/* disable all intrs */
+		info->MCR &= ~UART_MCR_OUT2;
+	info->MCR |= ALPHA_KLUDGE_MCR; 		/* Don't ask */
+	
+	/* disable break condition */
+	serial_out(info, UART_LCR, serial_inp(info, UART_LCR) & ~UART_LCR_SBC);
+	
+	if (!info->tty || (info->tty->termios->c_cflag & HUPCL))
+		info->MCR &= ~(UART_MCR_DTR|UART_MCR_RTS);
+	serial_outp(info, UART_MCR, info->MCR);
+
+	/* disable FIFO's */	
+	serial_outp(info, UART_FCR, (UART_FCR_ENABLE_FIFO |
+				     UART_FCR_CLEAR_RCVR |
+				     UART_FCR_CLEAR_XMIT));
+	serial_outp(info, UART_FCR, 0);
+
+	(void)serial_in(info, UART_RX);    /* read data port to reset things */
+	
+	if (info->tty)
+		set_bit(TTY_IO_ERROR, &info->tty->flags);
+
+	info->flags &= ~ASYNC_INITIALIZED;
+	restore_flags(flags);
+}
+
+
+/*
+ * This routine is called to set the UART divisor registers to match
+ * the specified baud rate for a serial port.
+ */
+static void change_speed(struct async_struct *info,
+			 struct termios *old_termios)
+{
+	int	quot = 0, baud_base, baud;
+	unsigned cflag, cval, fcr = 0;
+	int	bits;
+	unsigned long	flags;
+
+	if (!info->tty || !info->tty->termios)
+		return;
+	cflag = info->tty->termios->c_cflag;
+	if (!CONFIGURED_SERIAL_PORT(info))
+		return;
+
+	/* byte size and parity */
+	switch (cflag & CSIZE) {
+	      case CS5: cval = 0x00; bits = 7; break;
+	      case CS6: cval = 0x01; bits = 8; break;
+	      case CS7: cval = 0x02; bits = 9; break;
+	      case CS8: cval = 0x03; bits = 10; break;
+	      /* Never happens, but GCC is too dumb to figure it out */
+	      default:  cval = 0x00; bits = 7; break;
+	      }
+	if (cflag & CSTOPB) {
+		cval |= 0x04;
+		bits++;
+	}
+	if (cflag & PARENB) {
+		cval |= UART_LCR_PARITY;
+		bits++;
+	}
+	if (!(cflag & PARODD))
+		cval |= UART_LCR_EPAR;
+#ifdef CMSPAR
+	if (cflag & CMSPAR)
+		cval |= UART_LCR_SPAR;
+#endif
+
+	/* Determine divisor based on baud rate */
+	baud = tty_get_baud_rate(info->tty);
+	if (!baud) {
+		baud = 9600;	/* B0 transition handled in rs_set_termios */
+	}
+	baud_base = info->state->baud_base;
+	//if (baud == 38400 &&
+	if (((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) {
+		quot = info->state->custom_divisor;
+	}
+	else {
+		if (baud == 134)
+			/* Special case since 134 is really 134.5 */
+			quot = (2*baud_base / 269);
+		else if (baud)
+			quot = baud_base / baud;
+	}
+	/* If the quotient is zero refuse the change */
+	if (!quot && old_termios) {
+		info->tty->termios->c_cflag &= ~CBAUD;
+		info->tty->termios->c_cflag |= (old_termios->c_cflag & CBAUD);
+		baud = tty_get_baud_rate(info->tty);
+		if (!baud)
+			baud = 9600;
+		if (baud == 38400 &&
+		    ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST))
+			quot = info->state->custom_divisor;
+		else {
+			if (baud == 134)
+				/* Special case since 134 is really 134.5 */
+				quot = (2*baud_base / 269);
+			else if (baud)
+				quot = baud_base / baud;
+		}
+	}
+	/* As a last resort, if the quotient is zero, default to 9600 bps */
+	if (!quot)
+		quot = baud_base / 9600;
+	
+	info->quot = quot;
+	info->timeout = ((info->xmit_fifo_size*HZ*bits*quot) / baud_base);
+	info->timeout += HZ/50;		/* Add .02 seconds of slop */
+
+	/* Set up FIFO's */
+	if (uart_config[info->state->type].flags & UART_USE_FIFO) {
+		if ((info->state->baud_base / quot) < 2400)
+			fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIGGER_1;
+		else
+			fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIGGER_8;
+	}
+	
+	/* CTS flow control flag and modem status interrupts */
+	info->IER &= ~UART_IER_MSI;
+	if (info->flags & ASYNC_HARDPPS_CD)
+		info->IER |= UART_IER_MSI;
+	if (cflag & CRTSCTS) {
+		info->flags |= ASYNC_CTS_FLOW;
+		info->IER |= UART_IER_MSI;
+	} else
+		info->flags &= ~ASYNC_CTS_FLOW;
+	if (cflag & CLOCAL)
+		info->flags &= ~ASYNC_CHECK_CD;
+	else {
+		info->flags |= ASYNC_CHECK_CD;
+		info->IER |= UART_IER_MSI;
+	}
+	serial_out(info, UART_IER, info->IER);
+
+	/*
+	 * Set up parity check flag
+	 */
+#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
+
+	info->read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
+	if (I_INPCK(info->tty))
+		info->read_status_mask |= UART_LSR_FE | UART_LSR_PE;
+	if (I_BRKINT(info->tty) || I_PARMRK(info->tty))
+		info->read_status_mask |= UART_LSR_BI;
+	
+	/*
+	 * Characters to ignore
+	 */
+	info->ignore_status_mask = 0;
+	if (I_IGNPAR(info->tty))
+		info->ignore_status_mask |= UART_LSR_PE | UART_LSR_FE;
+	if (I_IGNBRK(info->tty)) {
+		info->ignore_status_mask |= UART_LSR_BI;
+		/*
+		 * If we're ignore parity and break indicators, ignore 
+		 * overruns too.  (For real raw support).
+		 */
+		if (I_IGNPAR(info->tty))
+			info->ignore_status_mask |= UART_LSR_OE;
+	}
+	/*
+	 * !!! ignore all characters if CREAD is not set
+	 */
+	if ((cflag & CREAD) == 0)
+		info->ignore_status_mask |= UART_LSR_DR;
+	save_flags(flags); cli();
+
+	serial_outp(info, UART_CLK, quot & 0xffff);
+	serial_outp(info, UART_LCR, cval);
+	info->LCR = cval;				/* Save LCR */
+	restore_flags(flags);
+}
+
+static void rs_put_char(struct tty_struct *tty, unsigned char ch)
+{
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
+	unsigned long flags;
+
+	if (serial_paranoia_check(info, tty->device, "rs_put_char"))
+		return;
+
+	if (!tty || !info->xmit.buf)
+		return;
+
+	save_flags(flags); cli();
+	if (CIRC_SPACE(info->xmit.head,
+		       info->xmit.tail,
+		       SERIAL_XMIT_SIZE) == 0) {
+		restore_flags(flags);
+		return;
+	}
+
+	info->xmit.buf[info->xmit.head] = ch;
+	info->xmit.head = (info->xmit.head + 1) & (SERIAL_XMIT_SIZE-1);
+	restore_flags(flags);
+}
+
+static void rs_flush_chars(struct tty_struct *tty)
+{
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
+	unsigned long flags;
+				
+	if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+		return;
+
+	if (info->xmit.head == info->xmit.tail
+	    || tty->stopped
+	    || tty->hw_stopped
+	    || !info->xmit.buf)
+		return;
+
+	save_flags(flags); cli();
+	info->IER |= UART_IER_THRI;
+	serial_out(info, UART_IER, info->IER);
+	restore_flags(flags);
+}
+
+static int rs_write(struct tty_struct * tty, int from_user,
+		    const unsigned char *buf, int count)
+{
+	int	c, ret = 0;
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
+	unsigned long flags;
+				
+	if (serial_paranoia_check(info, tty->device, "rs_write"))
+		return 0;
+
+	if (!tty || !info->xmit.buf || !tmp_buf)
+		return 0;
+
+	save_flags(flags);
+	if (from_user) {
+		down(&tmp_buf_sem);
+		while (1) {
+			int c1;
+			c = CIRC_SPACE_TO_END(info->xmit.head,
+					      info->xmit.tail,
+					      SERIAL_XMIT_SIZE);
+			if (count < c)
+				c = count;
+			if (c <= 0)
+				break;
+
+			c -= copy_from_user(tmp_buf, buf, c);
+			if (!c) {
+				if (!ret)
+					ret = -EFAULT;
+				break;
+			}
+			cli();
+			c1 = CIRC_SPACE_TO_END(info->xmit.head,
+					       info->xmit.tail,
+					       SERIAL_XMIT_SIZE);
+			if (c1 < c)
+				c = c1;
+			memcpy(info->xmit.buf + info->xmit.head, tmp_buf, c);
+			info->xmit.head = ((info->xmit.head + c) &
+					   (SERIAL_XMIT_SIZE-1));
+			restore_flags(flags);
+			buf += c;
+			count -= c;
+			ret += c;
+		}
+		up(&tmp_buf_sem);
+	} else {
+		cli();
+		while (1) {
+			c = CIRC_SPACE_TO_END(info->xmit.head,
+					      info->xmit.tail,
+					      SERIAL_XMIT_SIZE);
+			if (count < c)
+				c = count;
+			if (c <= 0) {
+				break;
+			}
+			memcpy(info->xmit.buf + info->xmit.head, buf, c);
+			info->xmit.head = ((info->xmit.head + c) &
+					   (SERIAL_XMIT_SIZE-1));
+			buf += c;
+			count -= c;
+			ret += c;
+		}
+		restore_flags(flags);
+	}
+	if (info->xmit.head != info->xmit.tail
+	    && !tty->stopped
+	    && !tty->hw_stopped
+	    && !(info->IER & UART_IER_THRI)) {
+		info->IER |= UART_IER_THRI;
+		serial_out(info, UART_IER, info->IER);
+	}
+	return ret;
+}
+
+static int rs_write_room(struct tty_struct *tty)
+{
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
+
+	if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+		return 0;
+	return CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
+}
+
+static int rs_chars_in_buffer(struct tty_struct *tty)
+{
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
+				
+	if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+		return 0;
+	return CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
+}
+
+static void rs_flush_buffer(struct tty_struct *tty)
+{
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
+	unsigned long flags;
+	
+	if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+		return;
+	save_flags(flags); cli();
+	info->xmit.head = info->xmit.tail = 0;
+	restore_flags(flags);
+	wake_up_interruptible(&tty->write_wait);
+#ifdef SERIAL_HAVE_POLL_WAIT
+	wake_up_interruptible(&tty->poll_wait);
+#endif
+	if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
+	    tty->ldisc.write_wakeup)
+		(tty->ldisc.write_wakeup)(tty);
+}
+
+/*
+ * This function is used to send a high-priority XON/XOFF character to
+ * the device
+ */
+static void rs_send_xchar(struct tty_struct *tty, char ch)
+{
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
+
+	if (serial_paranoia_check(info, tty->device, "rs_send_char"))
+		return;
+
+	info->x_char = ch;
+	if (ch) {
+		/* Make sure transmit interrupts are on */
+		info->IER |= UART_IER_THRI;
+		serial_out(info, UART_IER, info->IER);
+	}
+}
+
+/*
+ * ------------------------------------------------------------
+ * rs_throttle()
+ * 
+ * This routine is called by the upper-layer tty layer to signal that
+ * incoming characters should be throttled.
+ * ------------------------------------------------------------
+ */
+static void rs_throttle(struct tty_struct * tty)
+{
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
+	unsigned long flags;
+#ifdef SERIAL_DEBUG_THROTTLE
+	char	buf[64];
+	
+	printk("throttle %s: %d....\n", tty_name(tty, buf),
+	       tty->ldisc.chars_in_buffer(tty));
+#endif
+
+	if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+		return;
+	
+	if (I_IXOFF(tty))
+		rs_send_xchar(tty, STOP_CHAR(tty));
+
+	if (tty->termios->c_cflag & CRTSCTS)
+		info->MCR &= ~UART_MCR_RTS;
+
+	save_flags(flags); cli();
+	serial_out(info, UART_MCR, info->MCR);
+	restore_flags(flags);
+}
+
+static void rs_unthrottle(struct tty_struct * tty)
+{
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
+	unsigned long flags;
+#ifdef SERIAL_DEBUG_THROTTLE
+	char	buf[64];
+	
+	printk("unthrottle %s: %d....\n", tty_name(tty, buf),
+	       tty->ldisc.chars_in_buffer(tty));
+#endif
+
+	if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+		return;
+	
+	if (I_IXOFF(tty)) {
+		if (info->x_char)
+			info->x_char = 0;
+		else
+			rs_send_xchar(tty, START_CHAR(tty));
+	}
+	if (tty->termios->c_cflag & CRTSCTS)
+		info->MCR |= UART_MCR_RTS;
+	save_flags(flags); cli();
+	serial_out(info, UART_MCR, info->MCR);
+	restore_flags(flags);
+}
+
+/*
+ * ------------------------------------------------------------
+ * rs_ioctl() and friends
+ * ------------------------------------------------------------
+ */
+
+static int get_serial_info(struct async_struct * info,
+			   struct serial_struct * retinfo)
+{
+	struct serial_struct tmp;
+	struct serial_state *state = info->state;
+   
+	if (!retinfo)
+		return -EFAULT;
+	memset(&tmp, 0, sizeof(tmp));
+	tmp.type = state->type;
+	tmp.line = state->line;
+	tmp.port = state->port;
+	if (HIGH_BITS_OFFSET)
+		tmp.port_high = state->port >> HIGH_BITS_OFFSET;
+	else
+		tmp.port_high = 0;
+	tmp.irq = state->irq;
+	tmp.flags = state->flags;
+	tmp.xmit_fifo_size = state->xmit_fifo_size;
+	tmp.baud_base = state->baud_base;
+	tmp.close_delay = state->close_delay;
+	tmp.closing_wait = state->closing_wait;
+	tmp.custom_divisor = state->custom_divisor;
+	tmp.hub6 = state->hub6;
+	tmp.io_type = state->io_type;
+	if (copy_to_user(retinfo,&tmp,sizeof(*retinfo)))
+		return -EFAULT;
+	return 0;
+}
+
+static int set_serial_info(struct async_struct * info,
+			   struct serial_struct * new_info)
+{
+	struct serial_struct new_serial;
+ 	struct serial_state old_state, *state;
+	unsigned int		i,change_irq,change_port;
+	int 			retval = 0;
+	unsigned long		new_port;
+
+	if (copy_from_user(&new_serial,new_info,sizeof(new_serial)))
+		return -EFAULT;
+	state = info->state;
+	old_state = *state;
+
+	new_port = new_serial.port;
+	if (HIGH_BITS_OFFSET)
+		new_port += (unsigned long) new_serial.port_high << HIGH_BITS_OFFSET;
+
+	change_irq = new_serial.irq != state->irq;
+	change_port = (new_port != ((int) state->port)) ||
+		(new_serial.hub6 != state->hub6);
+  
+	if (!capable(CAP_SYS_ADMIN)) {
+		if (change_irq || change_port ||
+		    (new_serial.baud_base != state->baud_base) ||
+		    (new_serial.type != state->type) ||
+		    (new_serial.close_delay != state->close_delay) ||
+		    (new_serial.xmit_fifo_size != state->xmit_fifo_size) ||
+		    ((new_serial.flags & ~ASYNC_USR_MASK) !=
+		     (state->flags & ~ASYNC_USR_MASK)))
+			return -EPERM;
+		state->flags = ((state->flags & ~ASYNC_USR_MASK) |
+			       (new_serial.flags & ASYNC_USR_MASK));
+		info->flags = ((info->flags & ~ASYNC_USR_MASK) |
+			       (new_serial.flags & ASYNC_USR_MASK));
+		state->custom_divisor = new_serial.custom_divisor;
+		goto check_and_exit;
+	}
+
+	new_serial.irq = irq_cannonicalize(new_serial.irq);
+
+	if ((new_serial.irq >= NR_IRQS) || (new_serial.irq < 0) || 
+	    (new_serial.baud_base < 9600)|| (new_serial.type < PORT_UNKNOWN) ||
+	    (new_serial.type > PORT_MAX) || (new_serial.type == PORT_CIRRUS) ||
+	    (new_serial.type == PORT_STARTECH)) {
+		return -EINVAL;
+	}
+
+	if ((new_serial.type != state->type) ||
+	    (new_serial.xmit_fifo_size <= 0))
+		new_serial.xmit_fifo_size =
+			uart_config[new_serial.type].dfl_xmit_fifo_size;
+
+	/* Make sure address is not already in use */
+	if (new_serial.type) {
+		for (i = 0 ; i < NR_PORTS; i++)
+			if ((state != &rs_table[i]) &&
+			    (rs_table[i].port == new_port) &&
+			    rs_table[i].type)
+				return -EADDRINUSE;
+	}
+
+	if ((change_port || change_irq) && (state->count > 1))
+		return -EBUSY;
+
+	/*
+	 * OK, past this point, all the error checking has been done.
+	 * At this point, we start making changes.....
+	 */
+
+	state->baud_base = new_serial.baud_base;
+	state->flags = ((state->flags & ~ASYNC_FLAGS) |
+			(new_serial.flags & ASYNC_FLAGS));
+	info->flags = ((state->flags & ~ASYNC_INTERNAL_FLAGS) |
+		       (info->flags & ASYNC_INTERNAL_FLAGS));
+	state->custom_divisor = new_serial.custom_divisor;
+	state->close_delay = new_serial.close_delay * HZ/100;
+	state->closing_wait = new_serial.closing_wait * HZ/100;
+	info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
+	info->xmit_fifo_size = state->xmit_fifo_size =
+		new_serial.xmit_fifo_size;
+
+	if ((state->type != PORT_UNKNOWN) && state->port) {
+		release_region(state->port,8);
+	}
+	state->type = new_serial.type;
+	if (change_port || change_irq) {
+		/*
+		 * We need to shutdown the serial port at the old
+		 * port/irq combination.
+		 */
+		shutdown(info);
+		state->irq = new_serial.irq;
+		info->port = state->port = new_port;
+		info->hub6 = state->hub6 = new_serial.hub6;
+		if (info->hub6)
+			info->io_type = state->io_type = SERIAL_IO_HUB6;
+		else if (info->io_type == SERIAL_IO_HUB6)
+			info->io_type = state->io_type = SERIAL_IO_PORT;
+	}
+	if ((state->type != PORT_UNKNOWN) && state->port) {
+			request_region(state->port,8,"serial(set)");
+	}
+
+	
+check_and_exit:
+	if (!state->port || !state->type)
+		return 0;
+	if (info->flags & ASYNC_INITIALIZED) {
+		if (((old_state.flags & ASYNC_SPD_MASK) !=
+		     (state->flags & ASYNC_SPD_MASK)) ||
+		    (old_state.custom_divisor != state->custom_divisor)) {
+			if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
+				info->tty->alt_speed = 57600;
+			if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
+				info->tty->alt_speed = 115200;
+			if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
+				info->tty->alt_speed = 230400;
+			if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
+				info->tty->alt_speed = 460800;
+			change_speed(info, 0);
+		}
+	} else {
+		retval = startup(info);
+	}
+	return retval;
+}
+
+
+/*
+ * get_lsr_info - get line status register info
+ *
+ * Purpose: Let user call ioctl() to get info when the UART physically
+ * 	    is emptied.  On bus types like RS485, the transmitter must
+ * 	    release the bus after transmitting. This must be done when
+ * 	    the transmit shift register is empty, not be done when the
+ * 	    transmit holding register is empty.  This functionality
+ * 	    allows an RS485 driver to be written in user space. 
+ */
+static int get_lsr_info(struct async_struct * info, unsigned int *value)
+{
+	unsigned char status;
+	unsigned int result;
+	unsigned long flags;
+
+	save_flags(flags); cli();
+	status = serial_in(info, UART_LSR);
+	restore_flags(flags);
+	result = ((status & UART_LSR_TEMT) ? TIOCSER_TEMT : 0);
+
+	/*
+	 * If we're about to load something into the transmit
+	 * register, we'll pretend the transmitter isn't empty to
+	 * avoid a race condition (depending on when the transmit
+	 * interrupt happens).
+	 */
+	if (info->x_char || 
+	    ((CIRC_CNT(info->xmit.head, info->xmit.tail,
+		       SERIAL_XMIT_SIZE) > 0) &&
+	     !info->tty->stopped && !info->tty->hw_stopped))
+		result &= TIOCSER_TEMT;
+
+	if (copy_to_user(value, &result, sizeof(int)))
+		return -EFAULT;
+	return 0;
+}
+
+
+static int get_modem_info(struct async_struct * info, unsigned int *value)
+{
+	unsigned char control, status;
+	unsigned int result;
+	unsigned long flags;
+
+	control = info->MCR;
+	save_flags(flags); cli();
+	status = serial_in(info, UART_MSR);
+	restore_flags(flags);
+	result =  ((control & UART_MCR_RTS) ? TIOCM_RTS : 0)
+		| ((control & UART_MCR_DTR) ? TIOCM_DTR : 0)
+#ifdef TIOCM_OUT1
+		| ((control & UART_MCR_OUT1) ? TIOCM_OUT1 : 0)
+		| ((control & UART_MCR_OUT2) ? TIOCM_OUT2 : 0)
+#endif
+		| ((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);
+
+	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)
+{
+	unsigned int arg;
+	unsigned long flags;
+
+	if (copy_from_user(&arg, value, sizeof(int)))
+		return -EFAULT;
+
+	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
+		if (arg & TIOCM_LOOP)
+			info->MCR |= UART_MCR_LOOP;
+		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
+		if (arg & TIOCM_LOOP)
+			info->MCR &= ~UART_MCR_LOOP;
+		break;
+	case TIOCMSET:
+		info->MCR = ((info->MCR & ~(UART_MCR_RTS |
+#ifdef TIOCM_OUT1
+					    UART_MCR_OUT1 |
+					    UART_MCR_OUT2 |
+#endif
+					    UART_MCR_LOOP |
+					    UART_MCR_DTR))
+			     | ((arg & TIOCM_RTS) ? UART_MCR_RTS : 0)
+#ifdef TIOCM_OUT1
+			     | ((arg & TIOCM_OUT1) ? UART_MCR_OUT1 : 0)
+			     | ((arg & TIOCM_OUT2) ? UART_MCR_OUT2 : 0)
+#endif
+			     | ((arg & TIOCM_LOOP) ? UART_MCR_LOOP : 0)
+			     | ((arg & TIOCM_DTR) ? UART_MCR_DTR : 0));
+		break;
+	default:
+		return -EINVAL;
+	}
+	save_flags(flags); cli();
+	info->MCR |= ALPHA_KLUDGE_MCR; 		/* Don't ask */
+	serial_out(info, UART_MCR, info->MCR);
+	restore_flags(flags);
+	return 0;
+}
+
+static int do_autoconfig(struct async_struct * info)
+{
+	int retval;
+	
+	if (!capable(CAP_SYS_ADMIN))
+		return -EPERM;
+	
+	if (info->state->count > 1)
+		return -EBUSY;
+	
+	shutdown(info);
+
+	autoconfig(info->state);
+	retval = startup(info);
+	if (retval)
+		return retval;
+	return 0;
+}
+
+/*
+ * rs_break() --- routine which turns the break handling on or off
+ */
+static void rs_break(struct tty_struct *tty, int break_state)
+{
+	struct async_struct * info = (struct async_struct *)tty->driver_data;
+	unsigned long flags;
+	
+	if (serial_paranoia_check(info, tty->device, "rs_break"))
+		return;
+
+	if (!CONFIGURED_SERIAL_PORT(info))
+		return;
+	save_flags(flags); cli();
+	if (break_state == -1)
+		info->LCR |= UART_LCR_SBC;
+	else
+		info->LCR &= ~UART_LCR_SBC;
+	serial_out(info, UART_LCR, info->LCR);
+	restore_flags(flags);
+}
+
+
+static int rs_ioctl(struct tty_struct *tty, struct file * file,
+		    unsigned int cmd, unsigned long arg)
+{
+	struct async_struct * info = (struct async_struct *)tty->driver_data;
+	struct async_icount cprev, cnow;	/* kernel counter temps */
+	struct serial_icounter_struct icount;
+	unsigned long flags;
+	
+	if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+		return -ENODEV;
+
+	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
+	    (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
+	    (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
+		if (tty->flags & (1 << TTY_IO_ERROR))
+		    return -EIO;
+	}
+	
+	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);
+		case TIOCSSERIAL:
+			return set_serial_info(info,
+					       (struct serial_struct *) arg);
+		case TIOCSERCONFIG:
+			return do_autoconfig(info);
+
+		case TIOCSERGETLSR: /* Get line status register */
+			return get_lsr_info(info, (unsigned int *) arg);
+
+		case TIOCSERGSTRUCT:
+			if (copy_to_user((struct async_struct *) arg,
+					 info, sizeof(struct async_struct)))
+				return -EFAULT;
+			return 0;
+				
+			
+		/*
+		 * 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 for masking)
+		 * Caller should use TIOCGICOUNT to see which one it was
+		 */
+		case TIOCMIWAIT:
+			save_flags(flags); cli();
+			/* note the counters on entry */
+			cprev = info->state->icount;
+			restore_flags(flags);
+			/* Force modem status interrupts on */
+			info->IER |= UART_IER_MSI;
+			serial_out(info, UART_IER, info->IER);
+			while (1) {
+				interruptible_sleep_on(&info->delta_msr_wait);
+				/* see if a signal did it */
+				if (signal_pending(current))
+					return -ERESTARTSYS;
+				save_flags(flags); cli();
+				cnow = info->state->icount; /* atomic copy */
+				restore_flags(flags);
+				if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && 
+				    cnow.dcd == cprev.dcd && cnow.cts == cprev.cts)
+					return -EIO; /* no change => error */
+				if ( ((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) ||
+				     ((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) ||
+				     ((arg & TIOCM_CD)  && (cnow.dcd != cprev.dcd)) ||
+				     ((arg & TIOCM_CTS) && (cnow.cts != cprev.cts)) ) {
+					return 0;
+				}
+				cprev = cnow;
+			}
+			/* NOTREACHED */
+
+		/* 
+		 * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
+		 * Return: write counters to the user passed counter struct
+		 * NB: both 1->0 and 0->1 transitions are counted except for
+		 *     RI where only 0->1 is counted.
+		 */
+		case TIOCGICOUNT:
+			save_flags(flags); cli();
+			cnow = info->state->icount;
+			restore_flags(flags);
+			icount.cts = cnow.cts;
+			icount.dsr = cnow.dsr;
+			icount.rng = cnow.rng;
+			icount.dcd = cnow.dcd;
+			icount.rx = cnow.rx;
+			icount.tx = cnow.tx;
+			icount.frame = cnow.frame;
+			icount.overrun = cnow.overrun;
+			icount.parity = cnow.parity;
+			icount.brk = cnow.brk;
+			icount.buf_overrun = cnow.buf_overrun;
+			
+			if (copy_to_user((void *)arg, &icount, sizeof(icount)))
+				return -EFAULT;
+			return 0;
+		case TIOCSERGWILD:
+		case TIOCSERSWILD:
+			/* "setserial -W" is called in Debian boot */
+			printk ("TIOCSER?WILD ioctl obsolete, ignored.\n");
+			return 0;
+
+		default:
+			return -ENOIOCTLCMD;
+		}
+	return 0;
+}
+
+static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios)
+{
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
+	unsigned long flags;
+	unsigned int cflag = tty->termios->c_cflag;
+	
+	if (   (cflag == old_termios->c_cflag)
+	    && (   RELEVANT_IFLAG(tty->termios->c_iflag) 
+		== RELEVANT_IFLAG(old_termios->c_iflag)))
+	  return;
+
+	change_speed(info, old_termios);
+
+	/* Handle transition to B0 status */
+	if ((old_termios->c_cflag & CBAUD) &&
+	    !(cflag & CBAUD)) {
+		info->MCR &= ~(UART_MCR_DTR|UART_MCR_RTS);
+		save_flags(flags); cli();
+		serial_out(info, UART_MCR, info->MCR);
+		restore_flags(flags);
+	}
+	
+	/* Handle transition away from B0 status */
+	if (!(old_termios->c_cflag & CBAUD) &&
+	    (cflag & CBAUD)) {
+		info->MCR |= UART_MCR_DTR;
+		if (!(tty->termios->c_cflag & CRTSCTS) || 
+		    !test_bit(TTY_THROTTLED, &tty->flags)) {
+			info->MCR |= UART_MCR_RTS;
+		}
+		save_flags(flags); cli();
+		serial_out(info, UART_MCR, info->MCR);
+		restore_flags(flags);
+	}
+	
+	/* Handle turning off CRTSCTS */
+	if ((old_termios->c_cflag & CRTSCTS) &&
+	    !(tty->termios->c_cflag & CRTSCTS)) {
+		tty->hw_stopped = 0;
+		rs_start(tty);
+	}
+}
+
+/*
+ * ------------------------------------------------------------
+ * rs_close()
+ * 
+ * This routine is called when the serial port gets closed.  First, we
+ * wait for the last remaining data to be sent.  Then, we unlink its
+ * async structure from the interrupt chain if necessary, and we free
+ * that IRQ if nothing is left in the chain.
+ * ------------------------------------------------------------
+ */
+static void rs_close(struct tty_struct *tty, struct file * filp)
+{
+	struct async_struct * info = (struct async_struct *)tty->driver_data;
+	struct serial_state *state;
+	unsigned long flags;
+
+	if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+		return;
+
+	state = info->state;
+	
+	save_flags(flags); cli();
+	
+	if (tty_hung_up_p(filp)) {
+		DBG_CNT("before DEC-hung");
+		MOD_DEC_USE_COUNT;
+		restore_flags(flags);
+		return;
+	}
+	
+#ifdef SERIAL_DEBUG_OPEN
+	printk("rs_close ttys%d, count = %d\n", info->line, state->count);
+#endif
+	if ((tty->count == 1) && (state->count != 1)) {
+		/*
+		 * Uh, oh.  tty->count is 1, which means that the tty
+		 * structure will be freed.  state->count should always
+		 * be one in these conditions.  If it's greater than
+		 * one, we've got real problems, since it means the
+		 * serial port won't be shutdown.
+		 */
+		printk("rs_close: bad serial port count; tty->count is 1, "
+		       "state->count is %d\n", state->count);
+		state->count = 1;
+	}
+	if (--state->count < 0) {
+		printk("rs_close: bad serial port count for ttys%d: %d\n",
+		       info->line, state->count);
+		state->count = 0;
+	}
+	if (state->count) {
+		DBG_CNT("before DEC-2");
+		MOD_DEC_USE_COUNT;
+		restore_flags(flags);
+		return;
+	}
+	info->flags |= ASYNC_CLOSING;
+	restore_flags(flags);
+	/*
+	 * Save the termios structure, since this port may have
+	 * separate termios for callout and dialin.
+	 */
+	if (info->flags & ASYNC_NORMAL_ACTIVE)
+		info->state->normal_termios = *tty->termios;
+	if (info->flags & ASYNC_CALLOUT_ACTIVE)
+		info->state->callout_termios = *tty->termios;
+	/*
+	 * Now we wait for the transmit buffer to clear; and we notify 
+	 * the line discipline to only process XON/XOFF characters.
+	 */
+	tty->closing = 1;
+	if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE)
+		tty_wait_until_sent(tty, info->closing_wait);
+	/*
+	 * At this point we stop accepting input.  To do this, we
+	 * disable the receive line status interrupts, and tell the
+	 * interrupt driver to stop checking the data ready bit in the
+	 * line status register.
+	 */
+	info->IER &= ~UART_IER_RLSI;
+	info->read_status_mask &= ~UART_LSR_DR;
+	if (info->flags & ASYNC_INITIALIZED) {
+		serial_out(info, UART_IER, info->IER);
+		/*
+		 * Before we drop DTR, make sure the UART transmitter
+		 * has completely drained; this is especially
+		 * important if there is a transmit FIFO!
+		 */
+		rs_wait_until_sent(tty, info->timeout);
+	}
+	shutdown(info);
+	if (tty->driver.flush_buffer)
+		tty->driver.flush_buffer(tty);
+	if (tty->ldisc.flush_buffer)
+		tty->ldisc.flush_buffer(tty);
+	tty->closing = 0;
+	info->event = 0;
+	info->tty = 0;
+	if (info->blocked_open) {
+		if (info->close_delay) {
+			set_current_state(TASK_INTERRUPTIBLE);
+			schedule_timeout(info->close_delay);
+		}
+		wake_up_interruptible(&info->open_wait);
+	}
+	info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE|
+			 ASYNC_CLOSING);
+	wake_up_interruptible(&info->close_wait);
+	MOD_DEC_USE_COUNT;
+}
+
+/*
+ * rs_wait_until_sent() --- wait until the transmitter is empty
+ */
+static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
+{
+	struct async_struct * info = (struct async_struct *)tty->driver_data;
+	unsigned long orig_jiffies, char_time;
+	int lsr;
+	
+	if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+		return;
+
+	if (info->state->type == PORT_UNKNOWN)
+		return;
+
+	if (info->xmit_fifo_size == 0)
+		return; /* Just in case.... */
+
+	orig_jiffies = jiffies;
+	/*
+	 * Set the check interval to be 1/5 of the estimated time to
+	 * send a single character, and make it at least 1.  The check
+	 * interval should also be less than the timeout.
+	 * 
+	 * Note: we have to use pretty tight timings here to satisfy
+	 * the NIST-PCTS.
+	 */
+	char_time = (info->timeout - HZ/50) / info->xmit_fifo_size;
+	char_time = char_time / 5;
+	if (char_time == 0)
+		char_time = 1;
+	if (timeout && timeout < char_time)
+		char_time = timeout;
+	/*
+	 * If the transmitter hasn't cleared in twice the approximate
+	 * amount of time to send the entire FIFO, it probably won't
+	 * ever clear.  This assumes the UART isn't doing flow
+	 * control, which is currently the case.  Hence, if it ever
+	 * takes longer than info->timeout, this is probably due to a
+	 * UART bug of some kind.  So, we clamp the timeout parameter at
+	 * 2*info->timeout.
+	 */
+	if (!timeout || timeout > 2*info->timeout)
+		timeout = 2*info->timeout;
+#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
+	printk("In rs_wait_until_sent(%d) check=%lu...", timeout, char_time);
+	printk("jiff=%lu...", jiffies);
+#endif
+	while (!((lsr = serial_inp(info, UART_LSR)) & UART_LSR_TEMT)) {
+#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
+		printk("lsr = %d (jiff=%lu)...", lsr, jiffies);
+#endif
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(char_time);
+		if (signal_pending(current))
+			break;
+		if (timeout && time_after(jiffies, orig_jiffies + timeout))
+			break;
+	}
+	set_current_state(TASK_RUNNING);
+#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
+	printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies);
+#endif
+}
+
+/*
+ * rs_hangup() --- called by tty_hangup() when a hangup is signaled.
+ */
+static void rs_hangup(struct tty_struct *tty)
+{
+	struct async_struct * info = (struct async_struct *)tty->driver_data;
+	struct serial_state *state = info->state;
+	
+	if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+		return;
+
+	state = info->state;
+	
+	rs_flush_buffer(tty);
+	if (info->flags & ASYNC_CLOSING)
+		return;
+	shutdown(info);
+	info->event = 0;
+	state->count = 0;
+	info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE);
+	info->tty = 0;
+	wake_up_interruptible(&info->open_wait);
+}
+
+/*
+ * ------------------------------------------------------------
+ * rs_open() and friends
+ * ------------------------------------------------------------
+ */
+static int block_til_ready(struct tty_struct *tty, struct file * filp,
+			   struct async_struct *info)
+{
+	DECLARE_WAITQUEUE(wait, current);
+	struct serial_state *state = info->state;
+	int		retval;
+	int		do_clocal = 0, extra_count = 0;
+	unsigned long	flags;
+
+	/*
+	 * If the device is in the middle of being closed, then block
+	 * until it's done, and then try again.
+	 */
+	if (tty_hung_up_p(filp) ||
+	    (info->flags & ASYNC_CLOSING)) {
+		if (info->flags & ASYNC_CLOSING)
+			interruptible_sleep_on(&info->close_wait);
+#ifdef SERIAL_DO_RESTART
+		return ((info->flags & ASYNC_HUP_NOTIFY) ?
+			-EAGAIN : -ERESTARTSYS);
+#else
+		return -EAGAIN;
+#endif
+	}
+
+	/*
+	 * If this is a callout device, then just make sure the normal
+	 * device isn't being used.
+	 */
+	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+		if (info->flags & ASYNC_NORMAL_ACTIVE)
+			return -EBUSY;
+		if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
+		    (info->flags & ASYNC_SESSION_LOCKOUT) &&
+		    (info->session != current->session))
+		    return -EBUSY;
+		if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
+		    (info->flags & ASYNC_PGRP_LOCKOUT) &&
+		    (info->pgrp != current->pgrp))
+		    return -EBUSY;
+		info->flags |= ASYNC_CALLOUT_ACTIVE;
+		return 0;
+	}
+	
+	/*
+	 * If non-blocking mode is set, or the port is not enabled,
+	 * then make the check up front and then exit.
+	 */
+	if ((filp->f_flags & O_NONBLOCK) ||
+	    (tty->flags & (1 << TTY_IO_ERROR))) {
+		if (info->flags & ASYNC_CALLOUT_ACTIVE)
+			return -EBUSY;
+		info->flags |= ASYNC_NORMAL_ACTIVE;
+		return 0;
+	}
+
+	if (info->flags & ASYNC_CALLOUT_ACTIVE) {
+		if (state->normal_termios.c_cflag & CLOCAL)
+			do_clocal = 1;
+	} else {
+		if (tty->termios->c_cflag & CLOCAL)
+			do_clocal = 1;
+	}
+	
+	/*
+	 * Block waiting for the carrier detect and the line to become
+	 * free (i.e., not in use by the callout).  While we are in
+	 * this loop, state->count is dropped by one, so that
+	 * rs_close() knows when to free things.  We restore it upon
+	 * exit, either normal or abnormal.
+	 */
+	retval = 0;
+	add_wait_queue(&info->open_wait, &wait);
+#ifdef SERIAL_DEBUG_OPEN
+	printk("block_til_ready before block: ttys%d, count = %d\n",
+	       state->line, state->count);
+#endif
+	save_flags(flags); cli();
+	if (!tty_hung_up_p(filp)) {
+		extra_count = 1;
+		state->count--;
+	}
+	restore_flags(flags);
+	info->blocked_open++;
+	while (1) {
+		save_flags(flags); cli();
+		if (!(info->flags & ASYNC_CALLOUT_ACTIVE) &&
+		    (tty->termios->c_cflag & CBAUD))
+			serial_out(info, UART_MCR,
+				   serial_inp(info, UART_MCR) |
+				   (UART_MCR_DTR | UART_MCR_RTS));
+		restore_flags(flags);
+		set_current_state(TASK_INTERRUPTIBLE);
+		if (tty_hung_up_p(filp) ||
+		    !(info->flags & ASYNC_INITIALIZED)) {
+#ifdef SERIAL_DO_RESTART
+			if (info->flags & ASYNC_HUP_NOTIFY)
+				retval = -EAGAIN;
+			else
+				retval = -ERESTARTSYS;	
+#else
+			retval = -EAGAIN;
+#endif
+			break;
+		}
+		if (!(info->flags & ASYNC_CALLOUT_ACTIVE) &&
+		    !(info->flags & ASYNC_CLOSING) &&
+		    (do_clocal || (serial_in(info, UART_MSR) &
+				   UART_MSR_DCD)))
+			break;
+		if (signal_pending(current)) {
+			retval = -ERESTARTSYS;
+			break;
+		}
+#ifdef SERIAL_DEBUG_OPEN
+		printk("block_til_ready blocking: ttys%d, count = %d\n",
+		       info->line, state->count);
+#endif
+		schedule();
+	}
+	set_current_state(TASK_RUNNING);
+	remove_wait_queue(&info->open_wait, &wait);
+	if (extra_count)
+		state->count++;
+	info->blocked_open--;
+#ifdef SERIAL_DEBUG_OPEN
+	printk("block_til_ready after blocking: ttys%d, count = %d\n",
+	       info->line, state->count);
+#endif
+	if (retval)
+		return retval;
+	info->flags |= ASYNC_NORMAL_ACTIVE;
+	return 0;
+}
+
+static int get_async_struct(int line, struct async_struct **ret_info)
+{
+	struct async_struct *info;
+	struct serial_state *sstate;
+
+	sstate = rs_table + line;
+	sstate->count++;
+	if (sstate->info) {
+		*ret_info = sstate->info;
+		return 0;
+	}
+	info = kmalloc(sizeof(struct async_struct), GFP_KERNEL);
+	if (!info) {
+		sstate->count--;
+		return -ENOMEM;
+	}
+	memset(info, 0, sizeof(struct async_struct));
+	init_waitqueue_head(&info->open_wait);
+	init_waitqueue_head(&info->close_wait);
+	init_waitqueue_head(&info->delta_msr_wait);
+	info->magic = SERIAL_MAGIC;
+	info->port = sstate->port;
+	info->flags = sstate->flags;
+	info->io_type = sstate->io_type;
+	info->iomem_base = sstate->iomem_base;
+	info->iomem_reg_shift = sstate->iomem_reg_shift;
+	info->xmit_fifo_size = sstate->xmit_fifo_size;
+	info->line = line;
+	info->tqueue.routine = do_softint;
+	info->tqueue.data = info;
+	info->state = sstate;
+	if (sstate->info) {
+		kfree(info);
+		*ret_info = sstate->info;
+		return 0;
+	}
+	*ret_info = sstate->info = info;
+	return 0;
+}
+
+/*
+ * This routine is called whenever a serial port is opened.  It
+ * enables interrupts for a serial port, linking in its async structure into
+ * the IRQ chain.   It also performs the serial-specific
+ * initialization for the tty structure.
+ */
+static int rs_open(struct tty_struct *tty, struct file * filp)
+{
+	struct async_struct	*info;
+	int 			retval, line;
+	unsigned long		page;
+
+	MOD_INC_USE_COUNT;
+	line = MINOR(tty->device) - tty->driver.minor_start;
+	if ((line < 0) || (line >= NR_PORTS)) {
+		MOD_DEC_USE_COUNT;
+		return -ENODEV;
+	}
+	retval = get_async_struct(line, &info);
+	if (retval) {
+		MOD_DEC_USE_COUNT;
+		return retval;
+	}
+	tty->driver_data = info;
+	info->tty = tty;
+	if (serial_paranoia_check(info, tty->device, "rs_open")) {
+		MOD_DEC_USE_COUNT;		
+		return -ENODEV;
+	}
+
+#ifdef SERIAL_DEBUG_OPEN
+	printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line,
+	       info->state->count);
+#endif
+	info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
+
+	if (!tmp_buf) {
+		page = get_zeroed_page(GFP_KERNEL);
+		if (!page) {
+			MOD_DEC_USE_COUNT;
+			return -ENOMEM;
+		}
+		if (tmp_buf)
+			free_page(page);
+		else
+			tmp_buf = (unsigned char *) page;
+	}
+
+	/*
+	 * If the port is the middle of closing, bail out now
+	 */
+	if (tty_hung_up_p(filp) ||
+	    (info->flags & ASYNC_CLOSING)) {
+		if (info->flags & ASYNC_CLOSING)
+			interruptible_sleep_on(&info->close_wait);
+		MOD_DEC_USE_COUNT;
+#ifdef SERIAL_DO_RESTART
+		return ((info->flags & ASYNC_HUP_NOTIFY) ?
+			-EAGAIN : -ERESTARTSYS);
+#else
+		return -EAGAIN;
+#endif
+	}
+
+	/*
+	 * Start up serial port
+	 */
+	retval = startup(info);
+	if (retval) {
+		MOD_DEC_USE_COUNT;
+		return retval;
+	}
+
+	retval = block_til_ready(tty, filp, info);
+	if (retval) {
+#ifdef SERIAL_DEBUG_OPEN
+		printk("rs_open returning after block_til_ready with %d\n",
+		       retval);
+#endif
+		MOD_DEC_USE_COUNT;
+		return retval;
+	}
+
+	if ((info->state->count == 1) &&
+	    (info->flags & ASYNC_SPLIT_TERMIOS)) {
+		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+			*tty->termios = info->state->normal_termios;
+		else 
+			*tty->termios = info->state->callout_termios;
+		change_speed(info, 0);
+	}
+#ifdef CONFIG_AU1000_SERIAL_CONSOLE
+	if (sercons.cflag && sercons.index == line) {
+		tty->termios->c_cflag = sercons.cflag;
+		sercons.cflag = 0;
+		change_speed(info, 0);
+	}
+#endif
+	info->session = current->session;
+	info->pgrp = current->pgrp;
+
+#ifdef SERIAL_DEBUG_OPEN
+	printk("rs_open ttys%d successful...", info->line);
+#endif
+	return 0;
+}
+
+/*
+ * /proc fs routines....
+ */
+
+static inline int line_info(char *buf, struct serial_state *state)
+{
+	struct async_struct *info = state->info, scr_info;
+	char	stat_buf[30], control, status;
+	int	ret;
+	unsigned long flags;
+
+	ret = sprintf(buf, "%d: uart:%s port:%lX irq:%d",
+		      state->line, uart_config[state->type].name, 
+		      state->port, state->irq);
+
+	if (!state->port || (state->type == PORT_UNKNOWN)) {
+		ret += sprintf(buf+ret, "\n");
+		return ret;
+	}
+
+	/*
+	 * Figure out the current RS-232 lines
+	 */
+	if (!info) {
+		info = &scr_info;	/* This is just for serial_{in,out} */
+
+		info->magic = SERIAL_MAGIC;
+		info->port = state->port;
+		info->flags = state->flags;
+		info->quot = 0;
+		info->tty = 0;
+	}
+	save_flags(flags); cli();
+	status = serial_in(info, UART_MSR);
+	control = info != &scr_info ? info->MCR : serial_in(info, UART_MCR);
+	restore_flags(flags); 
+
+	stat_buf[0] = 0;
+	stat_buf[1] = 0;
+	if (control & UART_MCR_RTS)
+		strcat(stat_buf, "|RTS");
+	if (status & UART_MSR_CTS)
+		strcat(stat_buf, "|CTS");
+	if (control & UART_MCR_DTR)
+		strcat(stat_buf, "|DTR");
+	if (status & UART_MSR_DSR)
+		strcat(stat_buf, "|DSR");
+	if (status & UART_MSR_DCD)
+		strcat(stat_buf, "|CD");
+	if (status & UART_MSR_RI)
+		strcat(stat_buf, "|RI");
+
+	if (info->quot) {
+		ret += sprintf(buf+ret, " baud:%d",
+			       state->baud_base / info->quot);
+	}
+
+	ret += sprintf(buf+ret, " tx:%d rx:%d",
+		      state->icount.tx, state->icount.rx);
+
+	if (state->icount.frame)
+		ret += sprintf(buf+ret, " fe:%d", state->icount.frame);
+	
+	if (state->icount.parity)
+		ret += sprintf(buf+ret, " pe:%d", state->icount.parity);
+	
+	if (state->icount.brk)
+		ret += sprintf(buf+ret, " brk:%d", state->icount.brk);	
+
+	if (state->icount.overrun)
+		ret += sprintf(buf+ret, " oe:%d", state->icount.overrun);
+
+	/*
+	 * Last thing is the RS-232 status lines
+	 */
+	ret += sprintf(buf+ret, " %s\n", stat_buf+1);
+	return ret;
+}
+
+int rs_read_proc(char *page, char **start, off_t off, int count,
+		 int *eof, void *data)
+{
+	int i, len = 0, l;
+	off_t	begin = 0;
+
+	len += sprintf(page, "serinfo:1.0 driver:%s%s revision:%s\n",
+		       serial_version, LOCAL_VERSTRING, serial_revdate);
+	for (i = 0; i < NR_PORTS && len < 4000; i++) {
+		l = line_info(page + len, &rs_table[i]);
+		len += l;
+		if (len+begin > off+count)
+			goto done;
+		if (len+begin < off) {
+			begin += len;
+			len = 0;
+		}
+	}
+	*eof = 1;
+done:
+	if (off >= len+begin)
+		return 0;
+	*start = page + (off-begin);
+	return ((count < begin+len-off) ? count : begin+len-off);
+}
+
+/*
+ * ---------------------------------------------------------------------
+ * rs_init() and friends
+ *
+ * rs_init() is called at boot-time to initialize the serial driver.
+ * ---------------------------------------------------------------------
+ */
+
+/*
+ * This routine prints out the appropriate serial driver version
+ * number, and identifies which options were configured into this
+ * driver.
+ */
+static char serial_options[] __initdata =
+       " no serial options enabled\n";
+#undef SERIAL_OPT
+
+static _INLINE_ void show_serial_version(void)
+{
+ 	printk(KERN_INFO "%s version %s%s (%s) with%s", serial_name,
+	       serial_version, LOCAL_VERSTRING, serial_revdate,
+	       serial_options);
+}
+
+
+/*
+ * This routine is called by rs_init() to initialize a specific serial
+ * port.  It determines what type of UART chip this serial port is
+ * using: 8250, 16450, 16550, 16550A.  The important question is
+ * whether or not this UART is a 16550A or not, since this will
+ * determine whether or not we can use its FIFO features or not.
+ */
+static void autoconfig(struct serial_state * state)
+{
+	struct async_struct *info, scr_info;
+	unsigned long flags;
+
+
+#ifdef SERIAL_DEBUG_AUTOCONF
+	printk("Testing ttyS%d (0x%04lx, 0x%04x)...\n", state->line,
+	       state->port, (unsigned) state->iomem_base);
+#endif
+	
+	if (!CONFIGURED_SERIAL_PORT(state))
+		return;
+
+	if (inl(UART_MOD_CNTRL + state->port) != 0x3) {
+		outl(3, UART_MOD_CNTRL + state->port);
+	}
+		
+	state->type = PORT_16550;
+	info = &scr_info;	/* This is just for serial_{in,out} */
+
+	info->magic = SERIAL_MAGIC;
+	info->state = state;
+	info->port = state->port;
+	info->flags = state->flags;
+	info->io_type = state->io_type;
+	info->iomem_base = state->iomem_base;
+	info->iomem_reg_shift = state->iomem_reg_shift;
+
+
+	save_flags(flags); cli();
+	state->xmit_fifo_size =	uart_config[state->type].dfl_xmit_fifo_size;
+
+	if (info->port) {
+			request_region(info->port,8,"serial(auto)");
+	}
+
+	/*
+	 * Reset the UART.
+	 */
+	serial_outp(info, UART_FCR, (UART_FCR_ENABLE_FIFO |
+				     UART_FCR_CLEAR_RCVR |
+				     UART_FCR_CLEAR_XMIT));
+	serial_outp(info, UART_FCR, 0);
+	(void)serial_in(info, UART_RX);
+	serial_outp(info, UART_IER, 0);
+	
+	restore_flags(flags);
+}
+
+int register_serial(struct serial_struct *req);
+void unregister_serial(int line);
+
+EXPORT_SYMBOL(register_serial);
+EXPORT_SYMBOL(unregister_serial);
+
+
+/*
+ * The serial driver boot-time initialization code!
+ */
+static int __init rs_init(void)
+{
+	int i;
+	struct serial_state * state;
+
+	init_bh(SERIAL_BH, do_serial_bh);
+	init_timer(&serial_timer);
+	serial_timer.function = rs_timer;
+	mod_timer(&serial_timer, jiffies + RS_STROBE_TIME);
+
+	for (i = 0; i < NR_IRQS; i++) {
+		IRQ_ports[i] = 0;
+		IRQ_timeout[i] = 0;
+	}
+#ifdef CONFIG_AU1000_SERIAL_CONSOLE
+	/*
+	 *	The interrupt of the serial console port
+	 *	can't be shared.
+	 */
+	if (sercons.flags & CON_CONSDEV) {
+		for(i = 0; i < NR_PORTS; i++)
+			if (i != sercons.index &&
+			    rs_table[i].irq == rs_table[sercons.index].irq)
+				rs_table[i].irq = 0;
+	}
+#endif
+	show_serial_version();
+
+	/* Initialize the tty_driver structure */
+	
+	memset(&serial_driver, 0, sizeof(struct tty_driver));
+	serial_driver.magic = TTY_DRIVER_MAGIC;
+	serial_driver.driver_name = "serial";
+#if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
+	serial_driver.name = "tts/%d";
+#else
+	serial_driver.name = "ttyS";
+#endif
+	serial_driver.major = TTY_MAJOR;
+	serial_driver.minor_start = 64 + SERIAL_DEV_OFFSET;
+	serial_driver.num = NR_PORTS;
+	serial_driver.type = TTY_DRIVER_TYPE_SERIAL;
+	serial_driver.subtype = SERIAL_TYPE_NORMAL;
+	serial_driver.init_termios = tty_std_termios;
+	serial_driver.init_termios.c_cflag =
+		B9600 | CS8 | CREAD | HUPCL | CLOCAL;
+	serial_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
+	serial_driver.refcount = &serial_refcount;
+	serial_driver.table = serial_table;
+	serial_driver.termios = serial_termios;
+	serial_driver.termios_locked = serial_termios_locked;
+
+	serial_driver.open = rs_open;
+	serial_driver.close = rs_close;
+	serial_driver.write = rs_write;
+	serial_driver.put_char = rs_put_char;
+	serial_driver.flush_chars = rs_flush_chars;
+	serial_driver.write_room = rs_write_room;
+	serial_driver.chars_in_buffer = rs_chars_in_buffer;
+	serial_driver.flush_buffer = rs_flush_buffer;
+	serial_driver.ioctl = rs_ioctl;
+	serial_driver.throttle = rs_throttle;
+	serial_driver.unthrottle = rs_unthrottle;
+	serial_driver.set_termios = rs_set_termios;
+	serial_driver.stop = rs_stop;
+	serial_driver.start = rs_start;
+	serial_driver.hangup = rs_hangup;
+	serial_driver.break_ctl = rs_break;
+	serial_driver.send_xchar = rs_send_xchar;
+	serial_driver.wait_until_sent = rs_wait_until_sent;
+	serial_driver.read_proc = rs_read_proc;
+	
+	/*
+	 * The callout device is just like normal device except for
+	 * major number and the subtype code.
+	 */
+	callout_driver = serial_driver;
+#if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
+	callout_driver.name = "cua/%d";
+#else
+	callout_driver.name = "cua";
+#endif
+	callout_driver.major = TTYAUX_MAJOR;
+	callout_driver.subtype = SERIAL_TYPE_CALLOUT;
+	callout_driver.read_proc = 0;
+	callout_driver.proc_entry = 0;
+
+	if (tty_register_driver(&serial_driver))
+		panic("Couldn't register serial driver\n");
+	if (tty_register_driver(&callout_driver))
+		panic("Couldn't register callout driver\n");
+	
+	for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) {
+		state->baud_base = get_au1000_uart_baud();
+		state->magic = SSTATE_MAGIC;
+		state->line = i;
+		state->type = PORT_UNKNOWN;
+		state->custom_divisor = 0;
+		state->close_delay = 5*HZ/10;
+		state->closing_wait = 30*HZ;
+		state->callout_termios = callout_driver.init_termios;
+		state->normal_termios = serial_driver.init_termios;
+		state->icount.cts = state->icount.dsr = 
+			state->icount.rng = state->icount.dcd = 0;
+		state->icount.rx = state->icount.tx = 0;
+		state->icount.frame = state->icount.parity = 0;
+		state->icount.overrun = state->icount.brk = 0;
+		state->irq = irq_cannonicalize(state->irq);
+		if (state->hub6)
+			state->io_type = SERIAL_IO_HUB6;
+		if (state->port && check_region(state->port,8)) {
+			continue;
+		}
+
+		if (state->flags & ASYNC_BOOT_AUTOCONF) {
+			autoconfig(state);
+		}
+	}
+	for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) {
+		if (state->type == PORT_UNKNOWN) {
+			continue;
+		}
+		printk(KERN_INFO "ttyS%02d%s at 0x%04lx (irq = %d) is a %s\n",
+		       state->line + SERIAL_DEV_OFFSET,
+		       (state->flags & ASYNC_FOURPORT) ? " FourPort" : "",
+		       state->port, state->irq,
+		       uart_config[state->type].name);
+		tty_register_devfs(&serial_driver, 0,
+				   serial_driver.minor_start + state->line);
+		tty_register_devfs(&callout_driver, 0,
+				   callout_driver.minor_start + state->line);
+	}
+	return 0;
+}
+
+/*
+ * register_serial and unregister_serial allows for 16x50 serial ports to be
+ * configured at run-time, to support PCMCIA modems.
+ */
+ 
+/**
+ *	register_serial - configure a 16x50 serial port at runtime
+ *	@req: request structure
+ *
+ *	Configure the serial port specified by the request. If the
+ *	port exists and is in use an error is returned. If the port
+ *	is not currently in the table it is added.
+ *
+ *	The port is then probed and if neccessary the IRQ is autodetected
+ *	If this fails an error is returned.
+ *
+ *	On success the port is ready to use and the line number is returned.
+ */
+ 
+int register_serial(struct serial_struct *req)
+{
+	int i;
+	unsigned long flags;
+	struct serial_state *state;
+	struct async_struct *info;
+	unsigned long port;
+
+	port = req->port;
+	if (HIGH_BITS_OFFSET)
+		port += (unsigned long) req->port_high << HIGH_BITS_OFFSET;
+
+	save_flags(flags); cli();
+	for (i = 0; i < NR_PORTS; i++) {
+		if ((rs_table[i].port == port) &&
+		    (rs_table[i].iomem_base == req->iomem_base))
+			break;
+	}
+	if (i == NR_PORTS) {
+		for (i = 0; i < NR_PORTS; i++)
+			if ((rs_table[i].type == PORT_UNKNOWN) &&
+			    (rs_table[i].count == 0))
+				break;
+	}
+	if (i == NR_PORTS) {
+		restore_flags(flags);
+		return -1;
+	}
+	state = &rs_table[i];
+	if (rs_table[i].count) {
+		restore_flags(flags);
+		printk("Couldn't configure serial #%d (port=%ld,irq=%d): "
+		       "device already open\n", i, port, req->irq);
+		return -1;
+	}
+	state->irq = req->irq;
+	state->port = port;
+	state->flags = req->flags;
+	state->io_type = req->io_type;
+	state->iomem_base = req->iomem_base;
+	state->iomem_reg_shift = req->iomem_reg_shift;
+	if (req->baud_base)
+		state->baud_base = req->baud_base;
+	if ((info = state->info) != NULL) {
+		info->port = port;
+		info->flags = req->flags;
+		info->io_type = req->io_type;
+		info->iomem_base = req->iomem_base;
+		info->iomem_reg_shift = req->iomem_reg_shift;
+	}
+	autoconfig(state);
+	if (state->type == PORT_UNKNOWN) {
+		restore_flags(flags);
+		printk("register_serial(): autoconfig failed\n");
+		return -1;
+	}
+	restore_flags(flags);
+
+       printk(KERN_INFO "ttyS%02d at %s 0x%04lx (irq = %d) is a %s\n",
+	      state->line + SERIAL_DEV_OFFSET,
+	      state->iomem_base ? "iomem" : "port",
+	      state->iomem_base ? (unsigned long)state->iomem_base :
+	      state->port, state->irq, uart_config[state->type].name);
+	tty_register_devfs(&serial_driver, 0,
+			   serial_driver.minor_start + state->line); 
+	tty_register_devfs(&callout_driver, 0,
+			   callout_driver.minor_start + state->line);
+	return state->line + SERIAL_DEV_OFFSET;
+}
+
+/**
+ *	unregister_serial - deconfigure a 16x50 serial port
+ *	@line: line to deconfigure
+ *
+ *	The port specified is deconfigured and its resources are freed. Any
+ *	user of the port is disconnected as if carrier was dropped. Line is
+ *	the port number returned by register_serial().
+ */
+
+void unregister_serial(int line)
+{
+	unsigned long flags;
+	struct serial_state *state = &rs_table[line];
+
+	save_flags(flags); cli();
+	if (state->info && state->info->tty)
+		tty_hangup(state->info->tty);
+	state->type = PORT_UNKNOWN;
+	printk(KERN_INFO "tty%02d unloaded\n", state->line);
+	/* These will be hidden, because they are devices that will no longer
+	 * be available to the system. (ie, PCMCIA modems, once ejected)
+	 */
+	tty_unregister_devfs(&serial_driver,
+			     serial_driver.minor_start + state->line);
+	tty_unregister_devfs(&callout_driver,
+			     callout_driver.minor_start + state->line);
+	restore_flags(flags);
+}
+
+static void __exit rs_fini(void) 
+{
+	unsigned long flags;
+	int e1, e2;
+	int i;
+	struct async_struct *info;
+
+	/* printk("Unloading %s: version %s\n", serial_name, serial_version); */
+	del_timer_sync(&serial_timer);
+	save_flags(flags); cli();
+        remove_bh(SERIAL_BH);
+	if ((e1 = tty_unregister_driver(&serial_driver)))
+		printk("serial: failed to unregister serial driver (%d)\n",
+		       e1);
+	if ((e2 = tty_unregister_driver(&callout_driver)))
+		printk("serial: failed to unregister callout driver (%d)\n", 
+		       e2);
+	restore_flags(flags);
+
+	for (i = 0; i < NR_PORTS; i++) {
+		if ((info = rs_table[i].info)) {
+			rs_table[i].info = NULL;
+			kfree(info);
+		}
+		if ((rs_table[i].type != PORT_UNKNOWN) && rs_table[i].port) {
+				release_region(rs_table[i].port, 8);
+		}
+	}
+	if (tmp_buf) {
+		unsigned long pg = (unsigned long) tmp_buf;
+		tmp_buf = NULL;
+		free_page(pg);
+	}
+}
+
+module_init(rs_init);
+module_exit(rs_fini);
+MODULE_DESCRIPTION("Au1000 serial driver");
+
+
+/*
+ * ------------------------------------------------------------
+ * Serial console driver
+ * ------------------------------------------------------------
+ */
+#ifdef CONFIG_AU1000_SERIAL_CONSOLE
+
+#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
+
+static struct async_struct async_sercons;
+
+/*
+ *	Wait for transmitter & holding register to empty
+ */
+static inline void wait_for_xmitr(struct async_struct *info)
+{
+	unsigned int status, tmout = 0xffffff;
+
+	do {
+		status = serial_in(info, UART_LSR);
+
+		if (status & UART_LSR_BI)
+			lsr_break_flag = UART_LSR_BI;
+		
+		if (--tmout == 0)
+			break;
+	} while((status & BOTH_EMPTY) != BOTH_EMPTY);
+}
+
+
+/*
+ *	Print a string to the serial port trying not to disturb
+ *	any possible real use of the port...
+ *
+ *	The console_lock must be held when we get here.
+ */
+static void serial_console_write(struct console *co, const char *s,
+				unsigned count)
+{
+	static struct async_struct *info = &async_sercons;
+	int ier;
+	unsigned i;
+
+	/*
+	 *	First save the IER then disable the interrupts
+	 */
+	ier = serial_in(info, UART_IER);
+	serial_out(info, UART_IER, 0x00);
+
+	/*
+	 *	Now, do each character
+	 */
+	for (i = 0; i < count; i++, s++) {
+		wait_for_xmitr(info);
+
+		/*
+		 *	Send the character out.
+		 *	If a LF, also do CR...
+		 */
+		serial_out(info, UART_TX, *s);
+		if (*s == 10) {
+			wait_for_xmitr(info);
+			serial_out(info, UART_TX, 13);
+		}
+	}
+
+	/*
+	 *	Finally, Wait for transmitter & holding register to empty
+	 * 	and restore the IER
+	 */
+	wait_for_xmitr(info);
+	serial_out(info, UART_IER, ier);
+}
+
+/*
+ *	Receive character from the serial port
+ */
+static int serial_console_wait_key(struct console *co)
+{
+	static struct async_struct *info;
+	int ier, c;
+
+	info = &async_sercons;
+
+	/*
+	 *	First save the IER then disable the interrupts so
+	 *	that the real driver for the port does not get the
+	 *	character.
+	 */
+	ier = serial_in(info, UART_IER);
+	serial_out(info, UART_IER, 0x00);
+ 
+	while ((serial_in(info, UART_LSR) & UART_LSR_DR) == 0);
+	c = serial_in(info, UART_RX);
+
+	/*
+	 *	Restore the interrupts
+	 */
+	serial_out(info, UART_IER, ier);
+
+	return c;
+}
+
+static kdev_t serial_console_device(struct console *c)
+{
+	return MKDEV(TTY_MAJOR, 64 + c->index);
+}
+
+/*
+ *	Setup initial baud/bits/parity. We do two things here:
+ *	- construct a cflag setting for the first rs_open()
+ *	- initialize the serial port
+ *	Return non-zero if we didn't find a serial port.
+ */
+static int __init serial_console_setup(struct console *co, char *options)
+{
+	static struct async_struct *info;
+	struct serial_state *state;
+	unsigned cval;
+	int	baud = 9600;
+	int	bits = 8;
+	int	parity = 'n';
+	int	cflag = CREAD | HUPCL | CLOCAL;
+	int	quot = 0;
+	char	*s;
+
+	if (options) {
+		baud = simple_strtoul(options, NULL, 10);
+		s = options;
+		while(*s >= '0' && *s <= '9')
+			s++;
+		if (*s) parity = *s++;
+		if (*s) bits   = *s - '0';
+	}
+
+	/*
+	 *	Now construct a cflag setting.
+	 */
+	switch(baud) {
+		case 1200:
+			cflag |= B1200;
+			break;
+		case 2400:
+			cflag |= B2400;
+			break;
+		case 4800:
+			cflag |= B4800;
+			break;
+		case 19200:
+			cflag |= B19200;
+			break;
+		case 38400:
+			cflag |= B38400;
+			break;
+		case 57600:
+			cflag |= B57600;
+			break;
+		case 115200:
+			cflag |= B115200;
+			break;
+		case 9600:
+		default:
+			cflag |= B9600;
+			break;
+	}
+	switch(bits) {
+		case 7:
+			cflag |= CS7;
+			break;
+		default:
+		case 8:
+			cflag |= CS8;
+			break;
+	}
+	switch(parity) {
+		case 'o': case 'O':
+			cflag |= PARODD;
+			break;
+		case 'e': case 'E':
+			cflag |= PARENB;
+			break;
+	}
+	co->cflag = cflag;
+
+	/*
+	 *	Divisor, bytesize and parity
+	 */
+	state = rs_table + co->index;
+	info = &async_sercons;
+	info->magic = SERIAL_MAGIC;
+	info->state = state;
+	info->port = state->port;
+	info->flags = state->flags;
+	info->io_type = state->io_type;
+	info->iomem_base = state->iomem_base;
+	info->iomem_reg_shift = state->iomem_reg_shift;
+	state->baud_base = get_au1000_uart_baud();
+	quot = state->baud_base / baud;
+
+	cval = cflag & (CSIZE | CSTOPB);
+	cval >>= 4;
+	if (cflag & PARENB)
+		cval |= UART_LCR_PARITY;
+	if (!(cflag & PARODD))
+		cval |= UART_LCR_EPAR;
+
+	/*
+	 *	Disable UART interrupts, set DTR and RTS high
+	 *	and set speed.
+	 */
+	serial_out(info, UART_CLK, quot & 0xffff);
+	serial_out(info, UART_IER, 0);
+	serial_out(info, UART_MCR, UART_MCR_DTR | UART_MCR_RTS);
+
+	/*
+	 *	If we read 0xff from the LSR, there is no UART here.
+	 */
+	if (serial_in(info, UART_LSR) == 0xff)
+		return -1;
+
+	return 0;
+}
+
+static struct console sercons = {
+	name:		"ttyS",
+	write:		serial_console_write,
+	device:		serial_console_device,
+	wait_key:	serial_console_wait_key,
+	setup:		serial_console_setup,
+	flags:		CON_PRINTBUFFER,
+	index:		-1,
+};
+
+/*
+ *	Register console.
+ */
+void __init au1000_serial_console_init(void)
+{
+	register_console(&sercons);
+}
+#endif
+
+/*
+  Local variables:
+  compile-command: "gcc -D__KERNEL__ -I../../include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -march=i586 -DMODULE -DMODVERSIONS -include ../../include/linux/modversions.h   -DEXPORT_SYMTAB -c serial.c"
+  End:
+*/
diff -u --recursive --new-file v2.4.9/linux/arch/mips/au1000/common/time.c linux/arch/mips/au1000/common/time.c
--- v2.4.9/linux/arch/mips/au1000/common/time.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/au1000/common/time.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,286 @@
+/*
+ * Copyright (C) 2001 MontaVista Software, ppopov@mvista.com
+ * Copied and modified Carsten Langgaard's time.c
+ *
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 1999,2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * Setting up the clock on the MIPS boards.
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/kernel_stat.h>
+#include <linux/sched.h>
+#include <linux/spinlock.h>
+
+#include <asm/mipsregs.h>
+#include <asm/ptrace.h>
+#include <asm/div64.h>
+#include <asm/au1000.h>
+
+#include <linux/mc146818rtc.h>
+#include <linux/timex.h>
+
+extern volatile unsigned long wall_jiffies;
+unsigned long missed_heart_beats = 0;
+unsigned long uart_baud_base;
+
+static unsigned long r4k_offset; /* Amount to increment compare reg each time */
+static unsigned long r4k_cur;    /* What counter should be at next timer irq */
+extern rwlock_t xtime_lock;
+
+#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
+
+static inline void ack_r4ktimer(unsigned long newval)
+{
+	write_32bit_cp0_register(CP0_COMPARE, newval);
+}
+
+
+/*
+ * There are a lot of conceptually broken versions of the MIPS timer interrupt
+ * handler floating around.  This one is rather different, but the algorithm
+ * is provably more robust.
+ */
+unsigned long wtimer;
+void mips_timer_interrupt(struct pt_regs *regs)
+{
+	int irq = 7;
+
+	if (r4k_offset == 0)
+		goto null;
+
+	do {
+		kstat.irqs[0][irq]++;
+		do_timer(regs);
+		r4k_cur += r4k_offset;
+		ack_r4ktimer(r4k_cur);
+
+	} while (((unsigned long)read_32bit_cp0_register(CP0_COUNT)
+	         - r4k_cur) < 0x7fffffff);
+
+	return;
+
+null:
+	ack_r4ktimer(0);
+}
+
+/* 
+ * Figure out the r4k offset, the amount to increment the compare
+ * register for each time tick. 
+ * Use the Programmable Counter 1 to do this.
+ */
+unsigned long cal_r4koff(void)
+{
+	unsigned long count;
+	unsigned long cpu_pll;
+	unsigned long cpu_speed;
+	unsigned long start, end;
+	unsigned long counter;
+	int i;
+	int trim_divide = 16;
+
+	counter = inl(PC_COUNTER_CNTRL);
+	outl(counter | PC_CNTRL_EN1, PC_COUNTER_CNTRL);
+
+	while (inl(PC_COUNTER_CNTRL) & PC_CNTRL_T1S);
+	outl(trim_divide-1, PC1_TRIM);    /* RTC now ticks at 32.768/16 kHz */
+	while (inl(PC_COUNTER_CNTRL) & PC_CNTRL_T1S);
+
+	while (inl(PC_COUNTER_CNTRL) & PC_CNTRL_C1S);
+	outl (0, PC1_COUNTER_WRITE);
+	while (inl(PC_COUNTER_CNTRL) & PC_CNTRL_C1S);
+
+	start = inl(PC1_COUNTER_READ);
+	start += 2;
+	/* wait for the beginning of a new tick */
+	while (inl(PC1_COUNTER_READ) < start);
+
+	/* Start r4k counter. */
+	write_32bit_cp0_register(CP0_COUNT, 0);
+	end = start + (32768 / trim_divide)/2; /* wait 0.5 seconds */
+
+	while (end > inl(PC1_COUNTER_READ));
+
+	count = read_32bit_cp0_register(CP0_COUNT);
+	cpu_speed = count * 2;
+	uart_baud_base = (((cpu_speed) / 4) / 16);
+	return (cpu_speed / HZ);
+}
+
+static unsigned long __init get_mips_time(void)
+{
+	return inl(PC0_COUNTER_READ);
+}
+
+void __init time_init(void)
+{
+        unsigned int est_freq, flags;
+
+	printk("calculating r4koff... ");
+	r4k_offset = cal_r4koff();
+	printk("%08lx(%d)\n", r4k_offset, (int) r4k_offset);
+
+	//est_freq = 2*r4k_offset*HZ;	
+	est_freq = r4k_offset*HZ;	
+	est_freq += 5000;    /* round */
+	est_freq -= est_freq%10000;
+	printk("CPU frequency %d.%02d MHz\n", est_freq/1000000, 
+	       (est_freq%1000000)*100/1000000);
+	r4k_cur = (read_32bit_cp0_register(CP0_COUNT) + r4k_offset);
+
+	write_32bit_cp0_register(CP0_COMPARE, r4k_cur);
+	set_cp0_status(ALLINTS);
+
+	/* Read time from the RTC chipset. */
+	write_lock_irqsave (&xtime_lock, flags);
+	xtime.tv_sec = get_mips_time();
+	xtime.tv_usec = 0;
+	write_unlock_irqrestore(&xtime_lock, flags);
+}
+
+/* This is for machines which generate the exact clock. */
+#define USECS_PER_JIFFY (1000000/HZ)
+#define USECS_PER_JIFFY_FRAC ((1000000ULL << 32) / HZ & 0xffffffff)
+
+/* Cycle counter value at the previous timer interrupt.. */
+
+static unsigned int timerhi = 0, timerlo = 0;
+
+static unsigned long
+div64_32(unsigned long v1, unsigned long v2, unsigned long v3)
+{
+	unsigned long r0;
+	do_div64_32(r0, v1, v2, v3);
+	return r0;
+}
+
+
+/*
+ * FIXME: Does playing with the RP bit in c0_status interfere with this code?
+ */
+static unsigned long do_fast_gettimeoffset(void)
+{
+	u32 count;
+	unsigned long res, tmp;
+	unsigned long r0;
+
+	/* Last jiffy when do_fast_gettimeoffset() was called. */
+	static unsigned long last_jiffies=0;
+	unsigned long quotient;
+
+	/*
+	 * Cached "1/(clocks per usec)*2^32" value.
+	 * It has to be recalculated once each jiffy.
+	 */
+	static unsigned long cached_quotient=0;
+
+	tmp = jiffies;
+
+	quotient = cached_quotient;
+
+	if (tmp && last_jiffies != tmp) {
+		last_jiffies = tmp;
+		if (last_jiffies != 0) {
+			r0 = div64_32(timerhi, timerlo, tmp);
+			quotient = div64_32(USECS_PER_JIFFY, USECS_PER_JIFFY_FRAC, r0);
+			cached_quotient = quotient;
+		}
+	}
+
+	/* Get last timer tick in absolute kernel time */
+	count = read_32bit_cp0_register(CP0_COUNT);
+
+	/* .. relative to previous jiffy (32 bits is enough) */
+	count -= timerlo;
+
+	__asm__("multu\t%1,%2\n\t"
+		"mfhi\t%0"
+		:"=r" (res)
+		:"r" (count),
+		 "r" (quotient));
+
+	/*
+ 	 * Due to possible jiffies inconsistencies, we need to check 
+	 * the result so that we'll get a timer that is monotonic.
+	 */
+	if (res >= USECS_PER_JIFFY)
+		res = USECS_PER_JIFFY-1;
+
+	return res;
+}
+
+void do_gettimeofday(struct timeval *tv)
+{
+	unsigned int flags;
+
+	read_lock_irqsave (&xtime_lock, flags);
+	*tv = xtime;
+	tv->tv_usec += do_fast_gettimeoffset();
+
+	/*
+	 * xtime is atomically updated in timer_bh. jiffies - wall_jiffies
+	 * is nonzero if the timer bottom half hasnt executed yet.
+	 */
+	if (jiffies - wall_jiffies)
+		tv->tv_usec += USECS_PER_JIFFY;
+
+	read_unlock_irqrestore (&xtime_lock, flags);
+
+	if (tv->tv_usec >= 1000000) {
+		tv->tv_usec -= 1000000;
+		tv->tv_sec++;
+	}
+}
+
+void do_settimeofday(struct timeval *tv)
+{
+	write_lock_irq (&xtime_lock);
+
+	/* This is revolting. We need to set the xtime.tv_usec correctly.
+	 * However, the value in this location is is value at the last tick.
+	 * Discover what correction gettimeofday would have done, and then
+	 * undo it!
+	 */
+	tv->tv_usec -= do_fast_gettimeoffset();
+
+	if (tv->tv_usec < 0) {
+		tv->tv_usec += 1000000;
+		tv->tv_sec--;
+	}
+
+	xtime = *tv;
+	time_adjust = 0;		/* stop active adjtime() */
+	time_status |= STA_UNSYNC;
+	time_maxerror = NTP_PHASE_LIMIT;
+	time_esterror = NTP_PHASE_LIMIT;
+
+	write_unlock_irq (&xtime_lock);
+}
+
+/*
+ * The UART baud base is not known at compile time ... if
+ * we want to be able to use the same code on different
+ * speed CPUs.
+ */
+unsigned long get_au1000_uart_baud()
+{
+	return uart_baud_base;
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/au1000/pb1000/Makefile linux/arch/mips/au1000/pb1000/Makefile
--- v2.4.9/linux/arch/mips/au1000/pb1000/Makefile	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/au1000/pb1000/Makefile	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,24 @@
+#
+#  Copyright 2000 MontaVista Software Inc.
+#  Author: MontaVista Software, Inc.
+#     	ppopov@mvista.com or source@mvista.com
+#
+# Makefile for the Alchemy Semiconductor PB1000 board.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+
+.S.s:
+	$(CPP) $(CFLAGS) $< -o $*.s
+.S.o:
+	$(CC) $(CFLAGS) -c $< -o $*.o
+
+all: pb1000.o
+
+O_TARGET := pb1000.o
+
+obj-y := init.o setup.o
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/mips/au1000/pb1000/init.c linux/arch/mips/au1000/pb1000/init.c
--- v2.4.9/linux/arch/mips/au1000/pb1000/init.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/au1000/pb1000/init.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,59 @@
+/*
+ *
+ * BRIEF MODULE DESCRIPTION
+ *	PB1000 board setup
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc.
+ *         	ppopov@mvista.com or source@mvista.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ *  THIS  SOFTWARE  IS PROVIDED   ``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.
+ *
+ *  You should have received a copy of the  GNU General Public License along
+ *  with this program; if not, write  to the Free Software Foundation, Inc.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/bootmem.h>
+#include <asm/addrspace.h>
+#include <asm/bootinfo.h>
+#include <linux/config.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+
+extern int prom_argc;
+extern char **prom_argv, **prom_envp;
+extern void  __init prom_init_cmdline(void);
+
+int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
+{
+	prom_argc = argc;
+	prom_argv = argv;
+	prom_envp = envp;
+
+	mips_machgroup = MACH_GROUP_ALCHEMY;
+	mips_machtype = MACH_PB1000;  
+
+	prom_init_cmdline();
+
+	add_memory_region(1, 64 << 20, BOOT_MEM_RAM);
+
+	return 0;
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/au1000/pb1000/setup.c linux/arch/mips/au1000/pb1000/setup.c
--- v2.4.9/linux/arch/mips/au1000/pb1000/setup.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/au1000/pb1000/setup.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,117 @@
+/*
+ *
+ * BRIEF MODULE DESCRIPTION
+ *	Au1000-based board setup.
+ *
+ * Copyright 2000 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc.
+ *         	ppopov@mvista.com or source@mvista.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ *  THIS  SOFTWARE  IS PROVIDED   ``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.
+ *
+ *  You should have received a copy of the  GNU General Public License along
+ *  with this program; if not, write  to the Free Software Foundation, Inc.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/ioport.h>
+#include <linux/console.h>
+#include <linux/mc146818rtc.h>
+
+#include <asm/cpu.h>
+#include <asm/bootinfo.h>
+#include <asm/irq.h>
+#include <asm/mipsregs.h>
+#include <asm/reboot.h>
+#include <asm/au1000.h>
+
+#if defined(CONFIG_AU1000_SERIAL_CONSOLE)
+extern void console_setup(char *, int *);
+char serial_console[20];
+#endif
+
+void (*__wbflush) (void);
+extern struct rtc_ops no_rtc_ops;
+extern char * __init prom_getcmdline(void);
+extern void au1000_restart(void);
+extern void au1000_halt(void);
+extern void au1000_power_off(void);
+
+struct {
+    struct resource ram;
+    struct resource io;
+    struct resource sram;
+    struct resource flash;
+    struct resource boot;
+    struct resource pcmcia;
+    struct resource lcd;
+} au1000_resources = {
+    { "RAM",           0,          0x3FFFFFF,  IORESOURCE_MEM },
+    { "I/O",           0x10000000, 0x119FFFFF                 },
+    { "SRAM",          0x1e000000, 0x1E03FFFF                 },
+    { "System Flash",  0x1F800000, 0x1FBFFFFF                 },
+    { "Boot ROM",      0x1FC00000, 0x1FFFFFFF                 },
+    { "PCMCIA",        0x20000000, 0x27FFFFFF                 },
+    { "LCD",           0x60000000, 0x603FFFFF                 },
+};
+
+void au1000_wbflush(void)
+{
+	__asm__ volatile ("sync");
+}
+
+void __init au1000_setup(void)
+{
+	char *argptr;
+
+	argptr = prom_getcmdline();
+
+#ifdef CONFIG_AU1000_SERIAL_CONSOLE
+	if ((argptr = strstr(argptr, "console=ttyS0")) == NULL) {
+		argptr = prom_getcmdline();
+		strcat(argptr, " console=ttyS0,115200");
+	}
+#endif	  
+
+	//set_cp0_status(ST0_FR,0);
+	rtc_ops = &no_rtc_ops;
+        __wbflush = au1000_wbflush;
+	_machine_restart = au1000_restart;
+	_machine_halt = au1000_halt;
+	_machine_power_off = au1000_power_off;
+
+	/*
+	 * IO/MEM resources. 
+	 */
+	mips_io_port_base = KSEG1;
+	ioport_resource.start = au1000_resources.io.start;
+	ioport_resource.end = au1000_resources.lcd.end;
+
+#ifdef CONFIG_BLK_DEV_INITRD
+	ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
+#endif
+
+	outl(PC_CNTRL_E0 | PC_CNTRL_EN0 | PC_CNTRL_EN0, PC_COUNTER_CNTRL);
+	while (inl(PC_COUNTER_CNTRL) & PC_CNTRL_T0S);
+	outl(0x8000-1, PC0_TRIM);
+
+	printk("Alchemy Semi PB1000 Board\n");
+	printk("Au1000/PB1000 port (C) 2001 MontaVista Software, Inc. (source@mvista.com)\n");
+}
+
diff -u --recursive --new-file v2.4.9/linux/arch/mips/baget/irq.c linux/arch/mips/baget/irq.c
--- v2.4.9/linux/arch/mips/baget/irq.c	Tue Mar  6 19:44:36 2001
+++ linux/arch/mips/baget/irq.c	Sun Sep  9 10:43:01 2001
@@ -4,8 +4,6 @@
  * Copyright (C) 1998 Vladimir Roganov & Gleb Raiko
  *      Code (mostly sleleton and comments) derived from DECstation IRQ
  *      handling.
- *
- * $Id: irq.c,v 1.6 2000/02/04 07:40:23 ralf Exp $
  */
 #include <linux/errno.h>
 #include <linux/init.h>
@@ -180,7 +178,7 @@
 	int do_random, cpu;
 
 	cpu = smp_processor_id();
-	irq_enter(cpu);
+	irq_enter(cpu, irq);
 	kstat.irqs[cpu][irq]++;
 
 	mask_irq(irq);  
@@ -202,7 +200,7 @@
 		printk("do_IRQ: Unregistered IRQ (0x%X) occurred\n", irq);
 	}
 	unmask_irq(irq);
-	irq_exit(cpu);
+	irq_exit(cpu, irq);
 
 	/* unmasking and bottom half handling is done magically for us. */
 }
@@ -358,13 +356,6 @@
 	}
 	printk("Trying to free free IRQ%d\n",irq);
 }
-
-static int baget_irq_canonicalize(int irq) 
-{
-	return irq;
-}
-
-int (*irq_cannonicalize)(int irq) = baget_irq_canonicalize; 
 
 unsigned long probe_irq_on (void)
 {
diff -u --recursive --new-file v2.4.9/linux/arch/mips/baget/prom/init.c linux/arch/mips/baget/prom/init.c
--- v2.4.9/linux/arch/mips/baget/prom/init.c	Mon Feb 28 07:18:20 2000
+++ linux/arch/mips/baget/prom/init.c	Sun Sep  9 10:43:01 2001
@@ -2,25 +2,24 @@
  * init.c: PROM library initialisation code.
  *
  * Copyright (C) 1998 Gleb Raiko & Vladimir Roganov 
- *
- * $Id: init.c,v 1.3 1999/10/09 00:00:57 ralf Exp $
  */
 #include <linux/init.h>
+#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
-char arcs_cmdline[CL_SIZE];
+char arcs_cmdline[COMMAND_LINE_SIZE];
 
-int __init prom_init(unsigned int mem_upper)
+void __init prom_init(unsigned int mem_upper)
 {
-	mips_memory_upper = mem_upper;
+	mem_upper = PHYSADDR(mem_upper);
+
 	mips_machgroup  = MACH_GROUP_UNKNOWN;
 	mips_machtype   = MACH_UNKNOWN;
 	arcs_cmdline[0] = 0;
-	return 0;
-}
 
-void __init prom_fixup_mem_map(unsigned long start, unsigned long end)
-{
+	vac_memory_upper = mem_upper;
+
+	add_memory_region(0, mem_upper, BOOT_MEM_RAM);
 }
 
 void prom_free_prom_memory (void)
diff -u --recursive --new-file v2.4.9/linux/arch/mips/baget/setup.c linux/arch/mips/baget/setup.c
--- v2.4.9/linux/arch/mips/baget/setup.c	Mon Feb 28 07:18:20 2000
+++ linux/arch/mips/baget/setup.c	Sun Sep  9 10:43:01 2001
@@ -14,7 +14,7 @@
 
 #include <asm/baget/baget.h>
 
-extern long mips_memory_upper;
+long int vac_memory_upper;
 
 #define CACHEABLE_STR(val) ((val) ? "not cached" : "cached")
 #define MIN(a,b)           (((a)<(b)) ? (a):(b)) 
@@ -172,7 +172,7 @@
 
 static void __init vac_init(void)
 {
-	unsigned short mem_limit = ((mips_memory_upper-KSEG0) >> 16);
+	unsigned short mem_limit = (vac_memory_upper >> 16);
 
 	switch(vac_inw(VAC_ID)) {
 	case 0x1AC0:
diff -u --recursive --new-file v2.4.9/linux/arch/mips/baget/time.c linux/arch/mips/baget/time.c
--- v2.4.9/linux/arch/mips/baget/time.c	Sat May 13 08:29:14 2000
+++ linux/arch/mips/baget/time.c	Sun Sep  9 10:43:01 2001
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.3 1999/08/17 22:18:37 ralf Exp $
+/*
  * time.c: Baget/MIPS specific time handling details
  *
  * Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
@@ -13,7 +13,7 @@
 #include <linux/mm.h>
 #include <linux/interrupt.h>
 #include <linux/timex.h>
-#include <linux/kernel_stat.h>
+#include <linux/spinlock.h>
 
 #include <asm/bootinfo.h>
 #include <asm/io.h>
@@ -23,11 +23,14 @@
 
 #include <asm/baget/baget.h>
 
+extern rwlock_t xtime_lock;
+
 /* 
  *  To have precision clock, we need to fix available clock frequency
  */
 #define FREQ_NOM  79125  /* Baget frequency ratio */
 #define FREQ_DEN  10000
+
 static inline int timer_intr_valid(void) 
 {
 	static unsigned long long ticks, valid_ticks;
@@ -47,8 +50,8 @@
 void static timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
 	if (timer_intr_valid()) {
-	sti();
-	do_timer(regs);
+		sti();
+		do_timer(regs);
 	}
 }
 
@@ -76,21 +79,20 @@
 
 void do_gettimeofday(struct timeval *tv)
 {
-        unsigned long flags;
+	unsigned long flags;
 
-        save_and_cli(flags);
-        *tv = xtime;
-        restore_flags(flags);
+	read_lock_irqsave (&xtime_lock, flags);
+	*tv = xtime;
+	read_unlock_irqrestore (&xtime_lock, flags);
 }
 
 void do_settimeofday(struct timeval *tv)
 {
-        unsigned long flags;
-  
-        save_and_cli(flags);
-        xtime = *tv;
-        time_state = TIME_BAD;
-        time_maxerror = MAXPHASE;
-        time_esterror = MAXPHASE;
-        restore_flags(flags);
-} 
+	write_lock_irq (&xtime_lock);
+	xtime = *tv;
+	time_adjust = 0;		/* stop active adjtime() */
+	time_status |= STA_UNSYNC;
+	time_maxerror = NTP_PHASE_LIMIT;
+	time_esterror = NTP_PHASE_LIMIT;
+	write_unlock_irq (&xtime_lock);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/baget/vacserial.c linux/arch/mips/baget/vacserial.c
--- v2.4.9/linux/arch/mips/baget/vacserial.c	Fri Feb  9 11:29:44 2001
+++ linux/arch/mips/baget/vacserial.c	Sun Sep  9 10:43:01 2001
@@ -1,4 +1,4 @@
-/* $Id: vacserial.c,v 1.3 1999/08/17 22:18:37 ralf Exp $
+/*
  * vacserial.c: VAC UART serial driver
  *              This code stealed and adopted from linux/drivers/char/serial.c
  *              See that for author info
@@ -1300,7 +1300,7 @@
 		goto check_and_exit;
 	}
 
-	new_serial.irq = irq_cannonicalize(new_serial.irq);
+	new_serial.irq = new_serial.irq;
 
 	if ((new_serial.irq >= NR_IRQS) || (new_serial.port > 0xffff) ||
 	    (new_serial.baud_base == 0) || (new_serial.type < PORT_UNKNOWN) ||
@@ -1417,12 +1417,10 @@
 static int set_modem_info(struct async_struct * info, unsigned int cmd,
 			  unsigned int *value)
 {
-	int error;
 	unsigned int arg;
 
-	error = get_user(arg, value);
-	if (error)
-		return error;
+	if (get_user(arg, value))
+		return -EFAULT;
 	switch (cmd) {
 	default:
 		return -EINVAL;
@@ -2426,7 +2424,7 @@
 		state->icount.rx = state->icount.tx = 0;
 		state->icount.frame = state->icount.parity = 0;
 		state->icount.overrun = state->icount.brk = 0;
-		state->irq = irq_cannonicalize(state->irq);
+		state->irq = state->irq;
 		if (check_region(state->port,8))
 			continue;
 	        if (state->flags & ASYNC_BOOT_AUTOCONF)
diff -u --recursive --new-file v2.4.9/linux/arch/mips/boot/Makefile linux/arch/mips/boot/Makefile
--- v2.4.9/linux/arch/mips/boot/Makefile	Sun Jul  9 22:18:15 2000
+++ linux/arch/mips/boot/Makefile	Sun Sep  9 10:43:01 2001
@@ -1,10 +1,9 @@
-# $Id: Makefile,v 1.9 1999/04/07 18:45:23 harald Exp $
 #
 # This file is subject to the terms and conditions of the GNU General Public
 # License.  See the file "COPYING" in the main directory of this archive
 # for more details.
 #
-# Copyright (C) 1995, 1998 by Ralf Baechle
+# Copyright (C) 1995, 1998, 2001 by Ralf Baechle
 #
 
 .S.s:
@@ -46,25 +45,12 @@
 
 clean:
 	rm -f vmlinux.ecoff
-	rm -f zImage zImage.tmp mkboot
+	rm -f zImage zImage.tmp
 
 mrproper:
 	rm -f vmlinux.ecoff
 	rm -f addinitrd
 	rm -f elf2ecoff
-
-zImage:	$(CONFIGURE) mkboot $(TOPDIR)/vmlinux
-	$(OBJCOPY) $(strip-flags) $(TOPDIR)/vmlinux zImage.tmp
-	./mkboot zImage.tmp zImage
-	rm -f zImage.tmp
-
-mkboot: mkboot.c
-	$(HOSTCC) -o $@ $^
-
-zdisk: 	zImage
-	cp $(TOPDIR)/vmlinux $(TOPDIR)/vm
-	$(STRIP) $(TOPDIR)/vm
-	gzip -9f $(TOPDIR)/vm
 
 dummy:
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/boot/mkboot.c linux/arch/mips/boot/mkboot.c
--- v2.4.9/linux/arch/mips/boot/mkboot.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/boot/mkboot.c	Wed Dec 31 16:00:00 1969
@@ -1,658 +0,0 @@
-/*
- * Make a bootable image from a Linux/MIPS kernel.
- *
- * 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) 1996, 2001 by Ralf Baechle
- *
- * This file is written in plain Kernighan & Ritchie C as it has to run
- * on all crosscompile hosts no matter how braindead.  This code might
- * also become part of Milo.  It's therefore important that we don't use
- * seek because the Seek() call of the Magnum 4000 ARC BIOS is broken.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-/*
- * Define this for verbose debugging output.
- */
-#undef VERBOSE
-
-/*
- * Don't use the host's elf.h - it might be using incompatible defines
- */
-
-#define EI_NIDENT 16
-
-/*
- * Basic ELF types.
- */
-typedef unsigned short Elf32_Half;
-typedef unsigned short Elf32_Section;
-typedef unsigned int Elf32_Word;
-typedef unsigned int Elf32_Addr;
-typedef unsigned int Elf32_Off;
-
-typedef struct
-{
-  unsigned char e_ident[EI_NIDENT];     /* Magic number and other info */
-  Elf32_Half    e_type;                 /* Object file type */
-  Elf32_Half    e_machine;              /* Architecture */
-  Elf32_Word    e_version;              /* Object file version */
-  Elf32_Addr    e_entry;                /* Entry point virtual address */
-  Elf32_Off     e_phoff;                /* Program header table file offset */
-  Elf32_Off     e_shoff;                /* Section header table file offset */
-  Elf32_Word    e_flags;                /* Processor-specific flags */
-  Elf32_Half    e_ehsize;               /* ELF header size in bytes */
-  Elf32_Half    e_phentsize;            /* Program header table entry size */
-  Elf32_Half    e_phnum;                /* Program header table entry count */
-  Elf32_Half    e_shentsize;            /* Section header table entry size */
-  Elf32_Half    e_shnum;                /* Section header table entry count */
-  Elf32_Half    e_shstrndx;             /* Section header string table index */
-} Elf32_Ehdr;
-
-/*
- * ELF magic number
- */
-#define ELFMAG          "\177ELF"
-#define SELFMAG         4
-
-#define EI_CLASS        4               /* File class byte index */
-#define ELFCLASSNONE    0               /* Invalid class */
-#define ELFCLASS32      1               /* 32-bit objects */
-#define ELFCLASS64      2               /* 64-bit objects */
-
-#define EI_DATA         5               /* Data encoding byte index */
-#define ELFDATA2LSB     1               /* 2's complement, little endian */
-#define ELFDATA2MSB     2               /* 2's complement, big endian */
-
-#define EI_VERSION      6               /* File version byte index */
-#define EV_CURRENT      1               /* Current version */
-
-/*
- * Acceptable machine type in e_machine.
- */
-#define EM_MIPS         8               /* MIPS R3000 big-endian */
-
-/*
- * The type of ELF file we accept.
- */
-#define ET_EXEC         2               /* Executable file */
-
-/*
- * Definition of a single program header structure
- */
-typedef struct
-{
-  Elf32_Word    p_type;                 /* Segment type */
-  Elf32_Off     p_offset;               /* Segment file offset */
-  Elf32_Addr    p_vaddr;                /* Segment virtual address */
-  Elf32_Addr    p_paddr;                /* Segment physical address */
-  Elf32_Word    p_filesz;               /* Segment size in file */
-  Elf32_Word    p_memsz;                /* Segment size in memory */
-  Elf32_Word    p_flags;                /* Segment flags */
-  Elf32_Word    p_align;                /* Segment alignment */
-} Elf32_Phdr;
-
-/*
- * Legal values for p_type
- */
-#define PT_NULL         0               /* Program header table entry unused */
-#define PT_LOAD         1               /* Loadable program segment */
-#define PT_DYNAMIC      2               /* Dynamic linking information */
-#define PT_INTERP       3               /* Program interpreter */
-#define PT_NOTE         4               /* Auxiliary information */
-#define PT_SHLIB        5               /* Reserved */
-#define PT_PHDR         6               /* Entry for header table itself */
-#define PT_NUM          7               /* Number of defined types.  */
-#define PT_LOPROC       0x70000000      /* Start of processor-specific */
-#define PT_HIPROC       0x7fffffff      /* End of processor-specific */
-
-typedef struct
-{
-  Elf32_Word    sh_name;                /* Section name (string tbl index) */
-  Elf32_Word    sh_type;                /* Section type */
-  Elf32_Word    sh_flags;               /* Section flags */
-  Elf32_Addr    sh_addr;                /* Section virtual addr at execution */
-  Elf32_Off     sh_offset;              /* Section file offset */
-  Elf32_Word    sh_size;                /* Section size in bytes */
-  Elf32_Word    sh_link;                /* Link to another section */
-  Elf32_Word    sh_info;                /* Additional section information */
-  Elf32_Word    sh_addralign;           /* Section alignment */
-  Elf32_Word    sh_entsize;             /* Entry size if section holds table */
-} Elf32_Shdr;
-
-typedef struct
-{
-  Elf32_Word    st_name;                /* Symbol name (string tbl index) */
-  Elf32_Addr    st_value;               /* Symbol value */
-  Elf32_Word    st_size;                /* Symbol size */
-  unsigned char st_info;                /* Symbol type and binding */
-  unsigned char st_other;               /* No defined meaning, 0 */
-  Elf32_Section st_shndx;               /* Section index */
-} Elf32_Sym;
-
-/* How to extract and insert information held in the st_info field.  */
-#define ELF32_ST_BIND(val)              (((unsigned char) (val)) >> 4)
-#define ELF32_ST_TYPE(val)              ((val) & 0xf)
-
-/* Legal values for ST_BIND subfield of st_info (symbol binding).  */
-#define STB_GLOBAL      1               /* Global symbol */
-
-/* Legal values for ST_TYPE subfield of st_info (symbol type).  */
-#define STT_NOTYPE      0               /* Symbol type is unspecified */
-#define STT_OBJECT      1               /* Symbol is a data object */
-#define STT_FUNC        2               /* Symbol is a code object */
-
-static unsigned int
-get_Elf32_Half(unsigned char *p)
-{
-	return p[0] | (p[1] << 8);
-}
-#define get_Elf32_Section(p) get_Elf32_Half(p)
-
-static unsigned int
-get_Elf32_Word(unsigned char *p)
-{
-	return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
-}
-#define get_Elf32_Addr(p) get_Elf32_Word(p)
-#define get_Elf32_Off(p) get_Elf32_Word(p)
-
-static void
-put_byte(p, x)
-	unsigned char *p;
-	unsigned char x;
-{
-	p[0] = x;
-}
-
-static void
-put_half(p, x)
-	unsigned char *p;
-	unsigned short x;
-{
-	p[0] = x & 0xff;
-	p[1] = (x >> 8) & 0xff;
-}
-
-static void
-put_word(p, x)
-	unsigned char *p;
-	unsigned long x;
-{
-	p[0] = x & 0xff;
-	p[1] = (x >> 8) & 0xff;
-	p[2] = (x >> 16) & 0xff;
-	p[3] = (x >> 24) & 0xff;
-}
-
-/*
- * Swap a program header in.
- */
-static void
-get_elfph(p, ph)
-	unsigned char *p;
-	Elf32_Phdr *ph;
-{
-	ph->p_type   = get_Elf32_Word(p);
-	ph->p_offset = get_Elf32_Off(p + 4);
-	ph->p_vaddr  = get_Elf32_Addr(p + 8);
-	ph->p_paddr  = get_Elf32_Addr(p + 12);
-	ph->p_filesz = get_Elf32_Word(p + 16);
-	ph->p_memsz  = get_Elf32_Word(p + 20);
-	ph->p_flags  = get_Elf32_Word(p + 24);
-	ph->p_align  = get_Elf32_Word(p + 28);
-}
-
-/*
- * Swap a section header in.
- */
-static void
-get_elfsh(p, sh)
-	unsigned char *p;
-	Elf32_Shdr *sh;
-{
-	sh->sh_name      = get_Elf32_Word(p);
-	sh->sh_type      = get_Elf32_Word(p + 4);
-	sh->sh_flags     = get_Elf32_Word(p + 8);
-	sh->sh_addr      = get_Elf32_Addr(p + 12);
-	sh->sh_offset    = get_Elf32_Off(p + 16);
-	sh->sh_size      = get_Elf32_Word(p + 20);
-	sh->sh_link      = get_Elf32_Word(p + 24);
-	sh->sh_info      = get_Elf32_Word(p + 28);
-	sh->sh_addralign = get_Elf32_Word(p + 32);
-	sh->sh_entsize   = get_Elf32_Word(p + 36);
-}
-
-/*
- * Swap a section header in.
- */
-static void
-get_elfsym(p, sym)
-	unsigned char *p;
-	Elf32_Sym *sym;
-{
-	sym->st_name      = get_Elf32_Word(p);
-	sym->st_value     = get_Elf32_Addr(p + 4);
-	sym->st_size      = get_Elf32_Word(p + 8);
-	sym->st_info      = *(p + 12);
-	sym->st_other     = *(p + 13);
-	sym->st_shndx     = get_Elf32_Section(p + 14);
-}
-
-/*
- * The a.out magic number
- */
-#define OMAGIC 0407	/* Code indicating object file or impure executable. */
-#define M_MIPS1 151	/* MIPS R3000/R3000 binary */
-#define M_MIPS2 152	/* MIPS R6000/R4000 binary */
-
-/*
- * Compute and return an a.out magic number.
- */
-#define AOUT_INFO(magic, type, flags) \
-        (((magic) & 0xffff) | \
-         (((int)(type) & 0xff) << 16) | \
-         (((flags) & 0xff) << 24))
-
-/*
- * a.out symbols
- */
-#define N_UNDF 0
-#define N_ABS 2
-#define N_TEXT 4
-#define N_DATA 6
-#define N_BSS 8
-#define N_FN 15
-#define N_EXT 1
-
-#define min(x,y) (((x)<(y))?(x):(y))
-
-static void
-do_read(fd, buf, size)
-	int fd;
-	char *buf;
-	ssize_t size;
-{
-	ssize_t rd;
-
-	while(size != 0) {
-		rd = read(fd, buf, size);
-		if (rd == -1) {
-			perror("Can't read from file.");
-			exit(1);
-		}
-		size -= rd;
-	}
-}
-
-static void
-writepad(fd, size)
-	int fd;
-	size_t size;
-{
-	static void *zeropage = NULL;
-	ssize_t written;
-
-	if (zeropage == NULL) {
-		zeropage = malloc(4096);
-		if (zeropage == NULL) {
-			fprintf(stderr, "Couldn't allocate zero buffer.\n");
-			exit(1);
-		}
-		memset(zeropage, '\0', 4096);
-	}
-	while(size != 0) {
-		written = write(fd, zeropage, min(4096, size));
-		if (written == -1) {
-			perror("Can't write to boot image");
-			exit(1);
-		}
-		size -= written;
-	}
-}
-
-static void
-do_write(fd, buf, size)
-	int fd;
-	char *buf;
-	ssize_t size;
-{
-	ssize_t written;
-
-	while(size != 0) {
-		written = write(fd, buf, size);
-		if (written == -1) {
-			perror("Can't write to boot image");
-			exit(1);
-		}
-		size -= written;
-	}
-}
-
-static int
-usage(program_name)
-	char *program_name;
-{
-	fprintf(stderr, "Usage: %s infile outfile\n", program_name);
-	exit(0);
-}
-
-int
-main(argc, argv)
-	int argc;
-	char *argv[];
-{
-	char *infile, *outfile;
-	struct stat ifstat;
-	off_t ifsize;
-	char *image;
-	int ifd, ofd, i, symtabix, strtabix;
-	Elf32_Ehdr eh;
-	Elf32_Phdr *ph;
-	Elf32_Shdr *sh;
-	unsigned long vaddr, entry, bss, kernel_entry, kernel_end;
-	unsigned char ahdr[32];
-	Elf32_Sym sym;
-	int	symnum;
-	char *symname;
-
-	/*
-	 * Verify some basic assuptions about type sizes made in this code
-	 */
-	if (sizeof(Elf32_Half) != 2) {
-		fprintf(stderr, "Fix mkboot: sizeof(Elf32_Half) != 2\n");
-		exit(1);
-	}
-	if (sizeof(Elf32_Word) != 4) {
-		fprintf(stderr, "Fix mkboot: sizeof(Elf32_Word) != 4\n");
-		exit(1);
-	}
-	if (sizeof(Elf32_Addr) != 4) {
-		fprintf(stderr, "Fix mkboot: sizeof(Elf32_Addr) != 4\n");
-		exit(1);
-	}
-
-	if (argc != 3)
-		usage(argv[0]);
-
-	infile = argv[1];
-	outfile = argv[2];
-
-	if (stat(infile, &ifstat) < 0) {
-		perror("Can't stat kernel image.");
-		exit(1);
-	}
-
-	if (!S_ISREG(ifstat.st_mode)) {
-		fprintf(stderr, "Input file isn't a regular file.\n");
-		exit(1);
-	}
-	ifsize = ifstat.st_size;
-
-	image = malloc((size_t)ifsize);
-	if (image == NULL) {
-		fprintf(stderr, "Can't allocate memory to read file\n");
-		exit(1);
-	}
-
-	/*
-	 * Read the entire input file in.
-	 */
-	ifd = open(infile, O_RDONLY);
-	if(ifd == 0) {
-		fprintf(stderr, "Can't open input file\n");
-		exit(1);
-	}
-	do_read(ifd, image, ifsize);
-	close(ifd);
-
-	/*
-	 * Now swap the ELF header in.  This is ugly but we the file
-	 * we're reading might have different type sizes, byteorder
-	 * or alignment than the host.
-	 */
-	memcpy(eh.e_ident, (void *)image, sizeof(eh.e_ident));
-	if(memcmp(eh.e_ident, ELFMAG, SELFMAG)) {
-		fprintf(stderr, "Input file isn't a ELF file\n");
-		exit(1);
-	}
-	if(eh.e_ident[EI_CLASS] != ELFCLASS32) {
-		fprintf(stderr, "Input file isn't a 32 bit ELF file\n");
-		exit(1);
-	}
-	if(eh.e_ident[EI_DATA] != ELFDATA2LSB) {
-		fprintf(stderr, "Input file isn't a little endian ELF file\n");
-		exit(1);
-	}
-	if(eh.e_ident[EI_VERSION] != EV_CURRENT) {
-		fprintf(stderr, "Input file isn't a version %d ELF file\n",
-		        EV_CURRENT);
-		exit(1);
-	}
-
-	/*
-	 * Ok, so far the file looks ok.  Now swap the rest of the header in
-	 * and do some more paranoia checks.
-	 */
-	eh.e_type      = get_Elf32_Half(image + 16);
-	eh.e_machine   = get_Elf32_Half(image + 18);
-	eh.e_version   = get_Elf32_Word(image + 20);
-	eh.e_entry     = get_Elf32_Addr(image + 24);
-	eh.e_phoff     = get_Elf32_Off(image + 28);
-	eh.e_shoff     = get_Elf32_Off(image + 32);
-	eh.e_flags     = get_Elf32_Word(image + 36);
-	eh.e_ehsize    = get_Elf32_Half(image + 40);
-	eh.e_phentsize = get_Elf32_Half(image + 42);
-	eh.e_phnum     = get_Elf32_Half(image + 44);
-	eh.e_shentsize = get_Elf32_Half(image + 46);
-	eh.e_shnum     = get_Elf32_Half(image + 48);
-	eh.e_shstrndx  = get_Elf32_Half(image + 50);
-
-	if(eh.e_type != ET_EXEC) {
-		fprintf(stderr, "Input file isn't a executable.\n");
-		exit(1);
-	}
-	if(eh.e_machine != EM_MIPS) {
-		fprintf(stderr, "Input file isn't a MIPS executable.\n");
-		exit(1);
-	}
-
-	/*
-	 * Now read the program headers ...
-	 */
-	ph = malloc(sizeof(Elf32_Phdr) * eh.e_phnum);
-	if (ph == NULL) {
-		fprintf(stderr, "No memory for program header table.\n");
-		exit(1);
-	}
-	for(i = 0;i < eh.e_phnum; i++)
-		get_elfph((void *)(image + eh.e_phoff + i * 32), ph + i);
-
-	/*
-	 * ... and then the section headers.
-	 */
-	sh = malloc(sizeof(Elf32_Shdr) * eh.e_shnum);
-	if (sh == NULL) {
-		fprintf(stderr, "No memory for section header table.\n");
-		exit(1);
-	}
-	for(i = 0;i < eh.e_shnum; i++)
-		get_elfsh((void *)(image + eh.e_shoff + (i * 40)), sh + i);
-
-	/*
-	 * Find the symboltable and the stringtable in the file.
-	 */
-	for(i = 0;i < eh.e_shnum; i++) {
-		if (!strcmp (image + sh [eh.e_shstrndx].sh_offset + sh[i].sh_name,
-		             ".symtab")) {
-			symtabix = i;
-			continue;
-		}
-		if (!strcmp (image + sh [eh.e_shstrndx].sh_offset + sh[i].sh_name,
-		             ".strtab")) {
-			strtabix = i;
-			continue;
-		}
-	}
-
-	if (symtabix == -1) {
-		fprintf(stderr, "The executable doesn't have a symbol table\n");
-		exit(1);
-	}
-	if (strtabix == -1) {
-		fprintf(stderr, "The executable doesn't have a string table\n");
-		exit(1);
-	}
-
-	/*
-	 * Dig for the two required symbols in the symbol table.
-	 */
-	symnum = sh[symtabix].sh_size / 16;
-	for(i = 0;i < symnum;i++) {
-		get_elfsym(image + sh[symtabix].sh_offset + (i * 16), &sym);
-		symname = image + sh[strtabix].sh_offset + sym.st_name;
-		if (ELF32_ST_BIND(sym.st_info) != STB_GLOBAL)
-			continue;
-		if (ELF32_ST_TYPE(sym.st_info) != STT_NOTYPE &&
-		    ELF32_ST_TYPE(sym.st_info) != STT_OBJECT &&
-		    ELF32_ST_TYPE(sym.st_info) != STT_FUNC)
-			continue;
-		if (strcmp("kernel_entry", symname) == 0) {
-			kernel_entry = sym.st_value;
-			continue;
-		}
-		if (strcmp("_end", symname) == 0) {
-			kernel_end = sym.st_value;
-			continue;
-		}
-	}
-
-#ifdef VERBOSE
-	/*
-	 * And print what we will be loaded into memory.
-	 */
-	for(i = 0;i < eh.e_phnum; i++) {
-		if (ph[i].p_type != PT_LOAD) {
-			continue;
-		}
-		printf("  Offset: %08lx\n", ph[i].p_offset);
-		printf("  file size: %08lx\n", ph[i].p_filesz);
-		printf("  mem size: %08lx\n", ph[i].p_memsz);
-		printf("    Loading: %08lx - %08lx\n",
-		       ph[i].p_vaddr, ph[i].p_vaddr + ph[i].p_filesz);
-		printf("    Zero mapping: %08lx - %08lx\n",
-		       ph[i].p_vaddr + ph[i].p_filesz,
-		       ph[i].p_vaddr + ph[i].p_memsz);
-	}
-#endif
-
-	/*
-	 * Time to open the outputfile.
-	 */
-	ofd = open(outfile, O_WRONLY|O_CREAT|O_TRUNC, 0666);
-	if (ofd == -1) {
-		perror("Can't open boot image for output.");
-		exit(1);
-	}
-
-	/*
-	 * First compute the layout of the file.  We need to do this
-	 * first because we can't seek back to the beginning due to the
-	 * broken Seek() call in the Magnum firmware.
-	 */
-	entry = vaddr = 0xffffffff;
-	bss = 0;
-	for(i = 0;i < eh.e_phnum; i++) {
-		if (ph[i].p_type != PT_LOAD)
-			continue;
-		if (vaddr == 0xffffffff)
-			entry = vaddr = ph[i].p_vaddr;
-		vaddr = ph[i].p_vaddr + ph[i].p_filesz;
-		bss = ph[i].p_memsz - ph[i].p_filesz;
-	}
-
-	/*
-	 * In the next step we construct the boot image.  The boot file
-	 * looks essentially like a dump of the loaded kernel with a
-	 * minimal header.  Because Milo supports already a.out image
-	 * we simply dump the image in an a.out image ...  First let's
-	 * write the header.
-	 */
-
-	/*
-	 * Create and write the a.out header.
-	 */
-	put_word(ahdr, AOUT_INFO(OMAGIC, M_MIPS1, 0));
-	put_word(ahdr + 4, vaddr - entry);	/* text size */
-	put_word(ahdr + 8, 0);			/* data size */
-	put_word(ahdr + 12, bss);		/* bss size */
-	put_word(ahdr + 16, 2 * 12);		/* size of symbol table */
-	put_word(ahdr + 20, entry);		/* base address */
-	put_word(ahdr + 24, 0);			/* size of text relocations */
-	put_word(ahdr + 28, 0);			/* size of data relocations */
-	do_write(ofd, ahdr, 32);
-
-	/*
-	 * Write text and data segment combined into the a.out text segment
-	 * and a zero length data segment into the file.
-	 */
-	vaddr = 0xffffffff;
-	bss = 0;
-	for(i = 0;i < eh.e_phnum; i++) {
-		if (ph[i].p_type != PT_LOAD)
-			continue;
-		if (vaddr == 0xffffffff)
-			vaddr = ph[i].p_vaddr;
-		writepad(ofd, ph[i].p_vaddr - vaddr);	/* Write zero pad */
-		do_write(ofd, image + ph[i].p_offset, ph[i].p_filesz);
-		vaddr = ph[i].p_vaddr + ph[i].p_filesz;
-		bss = ph[i].p_memsz - ph[i].p_filesz;
-	}
-
-	/*
-	 * Now write the symbol table.  It has only two symbols,
-	 * kernel_entry and _end which we need for booting.
-	 */
-	put_word(ahdr    , 4);			/* n_un.n_strx */
-	put_byte(ahdr + 4, N_TEXT | N_EXT);	/* n_type */
-	put_byte(ahdr + 5, 0);			/* n_other */
-	put_half(ahdr + 6, 0);			/* n_desc */
-	put_word(ahdr + 8, kernel_entry);	/* n_value */
-	do_write(ofd, ahdr, 12);
-
-	put_word(ahdr    , 4 + 13);		/* n_un.n_strx */
-	put_byte(ahdr + 4, N_ABS | N_EXT);	/* n_type */
-	put_byte(ahdr + 5, 0);			/* n_other */
-	put_half(ahdr + 6, 0);			/* n_desc */
-	put_word(ahdr + 8, kernel_end);		/* n_value */
-	do_write(ofd, ahdr, 12);
-
-	/*
-	 * Now write stringtable size and the strings.
-	 */
-	put_word(ahdr, 4 + 20);
-	do_write(ofd, ahdr, 4);
-	do_write(ofd, "kernel_entry\0_end\0\0", 20);
-
-	/*
-	 * That's is all ...
-	 */
-	close(ofd);
-
-#ifdef VERBOSE
-	printf("Entry: %08lx\n", entry);
-	printf("Dumped image %08lx - %08lx\n", 0x80000000, vaddr);
-	printf("Extra bss at end: %08lx\n", bss);
-#endif
-
-	return 0;
-}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/config.in linux/arch/mips/config.in
--- v2.4.9/linux/arch/mips/config.in	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/config.in	Sun Sep  9 10:43:02 2001
@@ -76,6 +76,7 @@
 #
 unset CONFIG_ARC32
 unset CONFIG_BOARD_SCACHE
+unset CONFIG_COHERENT_IO
 unset CONFIG_HAVE_STD_PC_SERIAL_PORT
 unset CONFIG_I8259
 unset CONFIG_ISA
@@ -92,6 +93,8 @@
    define_bool CONFIG_PCI y
    define_bool CONFIG_MIPS_GT96100 y
    define_bool CONFIG_SWAP_IO_SPACE y
+   define_bool CONFIG_NEW_PCI y
+   define_bool CONFIG_PCI_AUTO y
 fi
 if [ "$CONFIG_MIPS_EV64120" = "y" ]; then
    define_bool CONFIG_PCI y
@@ -132,6 +135,7 @@
    define_bool CONFIG_I8259 y
    define_bool CONFIG_PCI y
    define_bool CONFIG_HAVE_STD_PC_SERIAL_PORT y
+   define_bool CONFIG_NEW_IRQ y
    define_bool CONFIG_SWAP_IO_SPACE y
 fi
 if [ "$CONFIG_MOMENCO_OCELOT" = "y" ]; then
@@ -158,7 +162,7 @@
    define_bool CONFIG_ROTTEN_IRQ y
    define_bool CONFIG_OLD_TIME_C y
 fi
-if [ "$CONFIG_DDB5074" = "y"]; then
+if [ "$CONFIG_DDB5074" = "y" ]; then
    define_bool CONFIG_I8259 y
    define_bool CONFIG_ISA y
    define_bool CONFIG_PCI y
@@ -168,7 +172,6 @@
    define_bool CONFIG_OLD_TIME_C y
 fi
 if [ "$CONFIG_DDB5476"  = "y" ]; then
-   define_bool CONFIG_I8259 y
    define_bool CONFIG_ISA y
    define_bool CONFIG_PCI y
    define_bool CONFIG_PC_KEYB y
@@ -186,6 +189,8 @@
    define_bool CONFIG_PCI y
    define_bool CONFIG_IT8712 y
    define_bool CONFIG_PC_KEYB y
+   define_bool CONFIG_NEW_PCI y
+   define_bool CONFIG_PCI_AUTO y
 fi
 if [ "$CONFIG_MIPS_IVR" = "y" ]; then
    define_bool CONFIG_PCI y
@@ -229,33 +234,45 @@
 choice 'CPU type' \
 	"R3000 CONFIG_CPU_R3000	\
 	 R6000 CONFIG_CPU_R6000	\
+	 R41xx CONFIG_CPU_VR41XX \
 	 R4300 CONFIG_CPU_R4300	\
 	 R4x00 CONFIG_CPU_R4X00	\
 	 R5000 CONFIG_CPU_R5000	\
-         R5432 CONFIG_CPU_R5432 \
+	 R5432 CONFIG_CPU_R5432 \
 	 RM7000 CONFIG_CPU_RM7000 \
 	 R52xx CONFIG_CPU_NEVADA \
 	 R10000 CONFIG_CPU_R10000 \
 	 SB1    CONFIG_CPU_SB1    \
-	 MIPS32 CONFIG_CPU_MIPS32" R4x00
+	 MIPS32 CONFIG_CPU_MIPS32 \
+	 MIPS64 CONFIG_CPU_MIPS64" R4x00
 
 bool 'Override CPU Options' CONFIG_CPU_ADVANCED
 
 if [ "$CONFIG_CPU_ADVANCED" = "y" ]; then
    bool '  ll/sc Instructions available' CONFIG_CPU_HAS_LLSC
+   bool '  lld/scd Instructions available' CONFIG_CPU_HAS_LLDSCD
    bool '  Writeback Buffer available' CONFIG_CPU_HAS_WB
 else
-   if [ "$CONFIG_CPU_R3000" = "y" ]; then
-      if [ "$CONFIG_DECSTATION" = "y" ]; then
+   if [ "$CONFIG_CPU_R3000" = "y" -o "$CONFIG_CPU_VR41XX" = "y" ]; then
+      if [ "CONFIG_DECSTATION" = "y" ]; then
 	 define_bool CONFIG_CPU_HAS_LLSC n
+	 define_bool CONFIG_CPU_HAS_LLDSCD n
 	 define_bool CONFIG_CPU_HAS_WB y
       else
 	 define_bool CONFIG_CPU_HAS_LLSC n
+	 define_bool CONFIG_CPU_HAS_LLDSCD n
 	 define_bool CONFIG_CPU_HAS_WB n
       fi
    else
+      if [ "$CONFIG_CPU_MIPS32" = "y" ]; then
+	 define_bool CONFIG_CPU_HAS_LLSC y
+	 define_bool CONFIG_CPU_HAS_LLDSCD n
+	 define_bool CONFIG_CPU_HAS_WB n
+      else
 	 define_bool CONFIG_CPU_HAS_LLSC y
+	 define_bool CONFIG_CPU_HAS_LLDSCD y
 	 define_bool CONFIG_CPU_HAS_WB n
+      fi
    fi
 fi
 endmenu
@@ -270,7 +287,6 @@
 else
    bool 'Generate little endian code' CONFIG_CPU_LITTLE_ENDIAN
 fi
-bool 'Kernel floating-point emulation' CONFIG_MIPS_FPU_EMULATOR
 
 if [ "$CONFIG_PROC_FS" = "y" ]; then
    define_bool CONFIG_KCORE_ELF y
@@ -361,7 +377,7 @@
 
 if [ "$CONFIG_DECSTATION" != "y" -a \
      "$CONFIG_SGI_IP22" != "y" ]; then
-   source drivers/message/i2o/Config.in
+   source drivers/i2o/Config.in
 fi
 
 if [ "$CONFIG_NET" = "y" ]; then
@@ -492,9 +508,6 @@
 comment 'Kernel hacking'
 
 bool 'Are you using a crosscompiler' CONFIG_CROSSCOMPILE
-if [ "$CONFIG_MODULES" = "y" ]; then
-   bool ' Build fp execption handler module' CONFIG_MIPS_FPE_MODULE
-fi
 if [ "$CONFIG_SERIAL" = "y" -o "$CONFIG_AU1000_UART" = "y" ]; then
   bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG
   dep_bool 'Console output to GDB' CONFIG_GDB_CONSOLE $CONFIG_REMOTE_DEBUG
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5074/pci.c linux/arch/mips/ddb5074/pci.c
--- v2.4.9/linux/arch/mips/ddb5074/pci.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ddb5074/pci.c	Sun Sep  9 10:43:01 2001
@@ -417,5 +417,9 @@
 	}
 }
 
+unsigned __init int pcibios_assign_all_busses(void)
+{
+	return 1;
+}
 
 struct pci_fixup pcibios_fixups[] = { };
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5476/int-handler.S linux/arch/mips/ddb5476/int-handler.S
--- v2.4.9/linux/arch/mips/ddb5476/int-handler.S	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ddb5476/int-handler.S	Sun Sep  9 10:43:01 2001
@@ -68,6 +68,8 @@
 	and	s0, s1, t2		# isolate allowed ones
 #endif
 	/* First we check for r4k counter/timer IRQ. */
+	andi	a0, s0, CAUSEF_IP7	# cpu timer */
+	bnez	a0, cpu_timer_irq
 	andi	a0, s0, CAUSEF_IP2	# delay slot, check local level zero
 	beq	a0, zero, 1f
 	 andi	a0, s0, CAUSEF_IP3	# delay slot, check local level one
@@ -119,6 +121,15 @@
 	/* phamtom interrupt */
 	move 	a0, s1
 	jal	ddb_phantom_irq
+	nop
+	j	ret_from_irq
+	nop
+
+cpu_timer_irq:
+	li	a0, 0
+	move	a1, sp
+	jal	do_IRQ 
+	/* jal	ll_timer_interrupt */
 	nop
 	j	ret_from_irq
 	nop
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5476/pci.c linux/arch/mips/ddb5476/pci.c
--- v2.4.9/linux/arch/mips/ddb5476/pci.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ddb5476/pci.c	Sun Sep  9 10:43:01 2001
@@ -14,7 +14,6 @@
 
 #include <asm-mips/nile4.h>
 
-
 static u32 nile4_pre_pci_access0(int slot_num)
 {
 	u32 pci_addr = 0;
@@ -490,6 +489,11 @@
 		start = (start + 1024 - 1) & ~(1024 - 1);
 		res->start = start;
 	}
+}
+
+unsigned __init int pcibios_assign_all_busses(void)
+{
+	return 1;
 }
 
 struct pci_fixup pcibios_fixups[] = { {0} };
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5476/setup.c linux/arch/mips/ddb5476/setup.c
--- v2.4.9/linux/arch/mips/ddb5476/setup.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ddb5476/setup.c	Sun Sep  9 10:43:01 2001
@@ -24,6 +24,7 @@
 #include <asm/reboot.h>
 #include <asm/gdb-stub.h>
 #include <asm/nile4.h>
+#include <asm/time.h>
 
 
 #ifdef CONFIG_REMOTE_DEBUG
@@ -71,13 +72,27 @@
 
 extern void ddb_irq_setup(void);
 
-void (*board_time_init) (struct irqaction * irq);
-
-
 static void __init ddb_time_init(struct irqaction *irq)
 {
-	/* set the clock to 1 Hz */
-	nile4_out32(NILE4_T2CTRL, 1000000);
+	printk("ddb_time_init invoked.\n");
+	mips_counter_frequency = 83000000;
+}
+
+static void __init ddb_timer_setup(struct irqaction *irq)
+{
+	unsigned int count;
+
+	/* we are using the cpu counter for timer interrupts */
+	i8259_setup_irq(0, irq);
+	set_cp0_status(IE_IRQ5);
+
+	/* to generate the first timer interrupt */
+	count = read_32bit_cp0_register(CP0_COUNT);
+	write_32bit_cp0_register(CP0_COMPARE, count + 1000);
+
+#if 0		/* the old way to do timer interrupt */
+	/* set the clock to 100 Hz */
+	nile4_out32(NILE4_T2CTRL, 830000);
 	/* enable the General-Purpose Timer */
 	nile4_out32(NILE4_T2CTRL + 4, 0x00000001);
 	/* reset timer */
@@ -85,6 +100,7 @@
 	/* enable interrupt */
 	nile4_enable_irq(NILE4_INT_GPT);
 	i8259_setup_irq(nile4_to_irq(NILE4_INT_GPT), irq);
+#endif
 }
 
 static struct {
@@ -119,7 +135,9 @@
 	irq_setup = ddb_irq_setup;
 	mips_io_port_base = NILE4_PCI_IO_BASE;
 	isa_slot_offset = NILE4_PCI_MEM_BASE;
+
 	board_time_init = ddb_time_init;
+	board_timer_setup = ddb_timer_setup;
 
 	_machine_restart = ddb_machine_restart;
 	_machine_halt = ddb_machine_halt;
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/common/Makefile linux/arch/mips/ddb5xxx/common/Makefile
--- v2.4.9/linux/arch/mips/ddb5xxx/common/Makefile	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/common/Makefile	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,18 @@
+#
+# Makefile for the common code of NEC DDB-Vrc5xxx board
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+
+.S.s:
+	$(CPP) $(CFLAGS) $< -o $*.s
+.S.o:
+	$(CC) $(CFLAGS) -c $< -o $*.o
+
+O_TARGET:= ddb5xxx.o
+
+obj-y	 += irq.o irq_cpu.o nile4.o prom.o pci.o pci_auto.o rtc_ds1386.o
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/common/irq.c linux/arch/mips/ddb5xxx/common/irq.c
--- v2.4.9/linux/arch/mips/ddb5xxx/common/irq.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/common/irq.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: jsun@mvista.com or jsun@junsun.net
+ *
+ * arch/mips/ddb5xxx/common/irq.c
+ *     Common irq code for DDB boards.  This really should belong
+ *	arch/mips/kernel/irq.c.  Need to talk to Ralf.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+
+void (*irq_setup)(void);
+
+void __init init_IRQ(void)
+{
+#ifdef CONFIG_REMOTE_DEBUG
+	extern void breakpoint(void);
+	extern void set_debug_traps(void);
+
+	printk("Wait for gdb client connection ...\n");
+	set_debug_traps();
+	breakpoint();
+#endif
+
+	/* invoke board-specific irq setup */
+	irq_setup();
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/common/irq_cpu.c linux/arch/mips/ddb5xxx/common/irq_cpu.c
--- v2.4.9/linux/arch/mips/ddb5xxx/common/irq_cpu.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/common/irq_cpu.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,115 @@
+/***********************************************************************
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
+ *
+ *  arch/mips/ddb5xxx/common/irq_cpu.c
+ *     This file define the irq handler for MIPS CPU interrupts.
+ *
+ * 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.
+ ***********************************************************************
+ */
+
+/*
+ * Almost all MIPS CPUs define 8 interrupt sources.  They are typically
+ * level triggered (i.e., cannot be cleared from CPU; must be cleared from
+ * device).  The first two are software interrupts.  The last one is 
+ * usually cpu timer interrupt if coutner register is present.
+ *
+ * This file exports one global function:
+ *	mips_cpu_irq_init(u32 irq_base);
+ */
+
+#include <linux/irq.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+
+#include <asm/mipsregs.h>
+
+/* [jsun] sooner or later we should move this debug stuff to MIPS common */
+#include <asm/ddb5xxx/debug.h>
+
+static int mips_cpu_irq_base=-1;
+
+static void 
+mips_cpu_irq_enable(unsigned int irq)
+{
+	MIPS_ASSERT(mips_cpu_irq_base != -1);
+	MIPS_ASSERT(irq >= mips_cpu_irq_base);
+	MIPS_ASSERT(irq < mips_cpu_irq_base+8);
+
+	clear_cp0_cause( 1 << (irq - mips_cpu_irq_base + 8));
+	set_cp0_status(1 << (irq - mips_cpu_irq_base + 8));
+}
+
+static void 
+mips_cpu_irq_disable(unsigned int irq)
+{
+	MIPS_ASSERT(mips_cpu_irq_base != -1);
+	MIPS_ASSERT(irq >= mips_cpu_irq_base);
+	MIPS_ASSERT(irq < mips_cpu_irq_base+8);
+
+	clear_cp0_status(1 << (irq - mips_cpu_irq_base + 8));
+}
+
+static unsigned int mips_cpu_irq_startup(unsigned int irq)
+{
+	mips_cpu_irq_enable(irq);
+	return 0;
+}
+
+#define	mips_cpu_irq_shutdown	mips_cpu_irq_disable
+
+static void
+mips_cpu_irq_ack(unsigned int irq)
+{
+	MIPS_ASSERT(mips_cpu_irq_base != -1);
+	MIPS_ASSERT(irq >= mips_cpu_irq_base);
+	MIPS_ASSERT(irq < mips_cpu_irq_base+8);
+
+	/* although we attemp to clear the IP bit in cause reigster, I think
+	 * usually it is cleared by device (irq source)
+	 */
+	clear_cp0_cause( 1 << (irq - mips_cpu_irq_base + 8));
+
+	/* I am not fully convinced that I should disable irq here */
+}
+
+static void
+mips_cpu_irq_end(unsigned int irq)
+{
+	MIPS_ASSERT(mips_cpu_irq_base != -1);
+	MIPS_ASSERT(irq >= mips_cpu_irq_base);
+	MIPS_ASSERT(irq < mips_cpu_irq_base+8);
+	/* I am not fully convinced that I should enable irq here */
+}
+
+static hw_irq_controller mips_cpu_irq_controller = {
+	"CPU_irq",
+	mips_cpu_irq_startup,
+	mips_cpu_irq_shutdown,
+	mips_cpu_irq_enable,
+	mips_cpu_irq_disable,
+	mips_cpu_irq_ack,
+	mips_cpu_irq_end,
+	NULL			/* no affinity stuff for UP */
+};
+
+
+void 
+mips_cpu_irq_init(u32 irq_base)
+{
+	extern irq_desc_t irq_desc[];
+	u32 i;
+
+	for (i= irq_base; i< irq_base+8; i++) {
+		irq_desc[i].status = IRQ_DISABLED;
+		irq_desc[i].action = NULL;
+		irq_desc[i].depth = 1;
+		irq_desc[i].handler = &mips_cpu_irq_controller;
+	}
+
+	mips_cpu_irq_base = irq_base;
+} 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/common/nile4.c linux/arch/mips/ddb5xxx/common/nile4.c
--- v2.4.9/linux/arch/mips/ddb5xxx/common/nile4.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/common/nile4.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,135 @@
+/***********************************************************************
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: jsun@mvista.com or jsun@junsun.net
+ *
+ * arch/mips/ddb5xxx/common/nile4.c
+ *     misc low-level routines for vrc-5xxx controllers.
+ *
+ * derived from original code by Geert Uytterhoeven <geert@sonycom.com>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ ***********************************************************************
+ */
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+
+#include <asm/ddb5xxx/ddb5xxx.h>
+#include <asm/ddb5xxx/debug.h>
+
+u32
+ddb_calc_pdar(u32 phys, u32 size, int width, 
+	      int on_memory_bus, int pci_visible)
+{
+        u32 maskbits;
+        u32 widthbits;
+
+        switch (size) {
+#if 0                           /* We don't support 4 GB yet */
+        case 0x100000000:       /* 4 GB */
+                maskbits = 4;
+                break;
+#endif
+        case 0x80000000:        /* 2 GB */
+                maskbits = 5;
+                break;
+        case 0x40000000:        /* 1 GB */
+                maskbits = 6;
+                break;
+        case 0x20000000:        /* 512 MB */
+                maskbits = 7;
+                break;
+        case 0x10000000:        /* 256 MB */
+                maskbits = 8;
+                break;
+        case 0x08000000:        /* 128 MB */
+                maskbits = 9;
+                break;
+        case 0x04000000:        /* 64 MB */
+                maskbits = 10;
+                break;
+        case 0x02000000:        /* 32 MB */
+                maskbits = 11;
+                break;
+        case 0x01000000:        /* 16 MB */
+                maskbits = 12;
+                break;
+        case 0x00800000:        /* 8 MB */
+                maskbits = 13;
+                break;
+        case 0x00400000:        /* 4 MB */
+                maskbits = 14;
+                break;
+        case 0x00200000:        /* 2 MB */
+                maskbits = 15;
+                break;
+        case 0:         /* OFF */
+                maskbits = 0;
+                break;
+        default:
+                panic("nile4_set_pdar: unsupported size %p\n", (void *) size);
+        }
+        switch (width) {
+        case 8:
+                widthbits = 0;
+                break;
+        case 16:
+                widthbits = 1;
+                break;
+        case 32:
+                widthbits = 2;
+                break;
+        case 64:
+                widthbits = 3;
+                break;
+        default:
+                panic("nile4_set_pdar: unsupported width %d\n", width);
+        }
+
+	return maskbits | (on_memory_bus ? 0x10 : 0) |
+		(pci_visible ? 0x20 : 0) | (widthbits << 6) |
+		(phys & 0xffe00000);
+}
+
+void
+ddb_set_pdar(u32 pdar, u32 phys, u32 size, int width,
+	     int on_memory_bus, int pci_visible)
+{
+	u32 temp= ddb_calc_pdar(phys, size, width, on_memory_bus, pci_visible);
+	ddb_out32(pdar, temp);
+	ddb_out32(pdar + 4, 0);
+
+        /*
+         * When programming a PDAR, the register should be read immediately
+         * after writing it. This ensures that address decoders are properly
+         * configured.
+	 * [jsun] is this really necesary?
+         */
+        ddb_in32(pdar);
+        ddb_in32(pdar + 4);
+}
+
+/*
+ * routines that mess with PCIINITx registers
+ */
+
+void ddb_set_pmr(u32 pmr, u32 type, u32 addr, u32 options)
+{
+        switch (type) {
+        case DDB_PCICMD_IACK: /* PCI Interrupt Acknowledge */
+        case DDB_PCICMD_IO:   /* PCI I/O Space */
+        case DDB_PCICMD_MEM:  /* PCI Memory Space */
+        case DDB_PCICMD_CFG:  /* PCI Configuration Space */
+                break;
+        default:
+                panic("nile4_set_pmr: invalid type %d\n", type);
+        }
+        ddb_out32(pmr, (type << 1) | (addr & 0xffe00000) | options );
+        ddb_out32(pmr + 4, 0);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/common/pci.c linux/arch/mips/ddb5xxx/common/pci.c
--- v2.4.9/linux/arch/mips/ddb5xxx/common/pci.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/common/pci.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,179 @@
+/***********************************************************************
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
+ *
+ * arch/mips/ddb5xxx/common/pci.c
+ *     Common PCI routines for DDB5xxx - as a matter of fact, meant for all 
+ *	MIPS machines.
+ *
+ * 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 common PCI routines meant to be shared for
+ * all MIPS machines.
+ *
+ * Strategies:
+ *
+ * . We rely on pci_auto.c file to assign PCI resources (MEM and IO)
+ *   TODO: this shold be optional for some machines where they do have
+ *   a real "pcibios" that does resource assignment.
+ *
+ * . We then use pci_scan_bus() to "discover" all the resources for
+ *   later use by Linux.
+ *
+ * . We finally reply on a board supplied function, pcibios_fixup_irq(), to 
+ *   to assign the interrupts.  We may use setup-irq.c under drivers/pci
+ *   later.
+ *
+ * . Specifically, we will *NOT* use pci_assign_unassigned_resources(),
+ *   because we assume all PCI devices should have the resources correctly
+ *   assigned and recorded.
+ *
+ * Limitations:
+ *
+ * . We "collapse" all IO and MEM spaces in sub-buses under a top-level bus 
+ *   into a contiguous range.  
+ * 
+ * . In the case of Memory space, the rnage is 1:1 mapping with CPU physical
+ *   address space.
+ *
+ * . In the case of IO space, it starts from 0, and the beginning address
+ *   is mapped to KSEG0ADDR(mips_io_port) in the CPU physical address.
+ *
+ * . These are the current MIPS limitations (by ioremap, etc).  In the
+ *   future, we may remove them.
+ *
+ * Credits:
+ *	Most of the code are derived from the pci routines from PPC and Alpha,
+ *	which were mostly writtne by
+ *		Cort Dougan, cort@fsmlabs.com
+ *		Matt Porter, mporter@mvista.com
+ *		Dave Rusling david.rusling@reo.mts.dec.com
+ *		David Mosberger davidm@cs.arizona.edu
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+
+#include <asm/ddb5xxx/pci.h>
+#include <asm/ddb5xxx/debug.h>
+
+
+struct pci_fixup pcibios_fixups[] = { {0} };
+
+
+extern int pciauto_assign_resources(int busno, struct pci_channel * hose);
+void __init pcibios_init(void)
+{
+	struct pci_channel *p;
+	struct pci_bus *bus;
+	int busno;
+
+	/* assign resources */
+	busno=0;
+	for (p= mips_pci_channels; p->pci_ops != NULL; p++) {
+		busno = pciauto_assign_resources(busno, p) + 1;
+	}
+
+	/* scan the buses */
+	busno = 0;
+	for (p= mips_pci_channels; p->pci_ops != NULL; p++) {
+		bus = pci_scan_bus(busno, p->pci_ops, p);
+		busno = bus->subordinate+1;
+	}
+
+	/* fixup irqs (board specific routines) */
+	pcibios_fixup_irqs();
+
+	/* 
+	 * should we do a fixup of ioport_resource and iomem_resource
+	 * based on mips_pci_channels?  
+	 * Let us wait and see if this is a common need and whether there
+	 * are exceptions.  Until then, each board should adjust them
+	 * perhaps in their setup() function.
+	 */
+}
+
+int pcibios_enable_device(struct pci_dev *dev)
+{
+	/* pciauto_assign_resources() will enable all devices found */
+	return 0;
+}
+
+unsigned long __init
+pci_bridge_check_io(struct pci_dev *bridge)
+{
+        u16 io;
+
+        pci_read_config_word(bridge, PCI_IO_BASE, &io);
+        if (!io) {
+                pci_write_config_word(bridge, PCI_IO_BASE, 0xf0f0);
+                pci_read_config_word(bridge, PCI_IO_BASE, &io);
+                pci_write_config_word(bridge, PCI_IO_BASE, 0x0);
+        }
+        if (io)
+                return IORESOURCE_IO;
+        printk(KERN_WARNING "PCI: bridge %s does not support I/O forwarding!\n",
+                                bridge->name);
+        return 0;
+}
+
+void __init pcibios_fixup_bus(struct pci_bus *bus)
+{
+        /* Propogate hose info into the subordinate devices.  */
+
+        struct pci_channel *hose = bus->sysdata;
+        struct pci_dev *dev = bus->self;
+
+        if (!dev) {
+                /* Root bus */
+                bus->resource[0] = hose->io_resource;
+                bus->resource[1] = hose->mem_resource;
+        } else {
+                /* This is a bridge. Do not care how it's initialized,
+                   just link its resources to the bus ones */
+                int i;
+
+                for(i=0; i<3; i++) {
+                        bus->resource[i] =
+                                &dev->resource[PCI_BRIDGE_RESOURCES+i];
+                        bus->resource[i]->name = bus->name;
+                }
+                bus->resource[0]->flags |= pci_bridge_check_io(dev);
+                bus->resource[1]->flags |= IORESOURCE_MEM;
+                /* For now, propogate hose limits to the bus;
+                   we'll adjust them later. */
+                bus->resource[0]->end = hose->io_resource->end;
+                bus->resource[1]->end = hose->mem_resource->end;
+                /* Turn off downstream PF memory address range by default */
+                bus->resource[2]->start = 1024*1024;
+                bus->resource[2]->end = bus->resource[2]->start - 1;
+        }
+}
+
+char *pcibios_setup(char *str)
+{
+	return str;
+}
+
+void
+pcibios_align_resource(void *data, struct resource *res, unsigned long size)
+{
+	/* this should not be called */
+	MIPS_ASSERT(1 == 0);
+}
+
+void
+pcibios_update_resource(struct pci_dev *dev, struct resource *root,
+                             struct resource *res, int resource)
+{
+	/* this should not be called */
+	MIPS_ASSERT(1 == 0);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/common/pci_auto.c linux/arch/mips/ddb5xxx/common/pci_auto.c
--- v2.4.9/linux/arch/mips/ddb5xxx/common/pci_auto.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/common/pci_auto.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,396 @@
+/*
+ * arch/ppc/kernel/pci_auto.c
+ * 
+ * PCI autoconfiguration library
+ *
+ * Author: Matt Porter <mporter@mvista.com>
+ *
+ * Copyright 2000, 2001 MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/*
+ * Modified for MIPS by Jun Sun, jsun@mvista.com
+ *
+ * . Simplify the interface between pci_auto and the rest: a single function.
+ * . Assign resources from low address to upper address.
+ * . change most int to u32.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+
+#include <asm/ddb5xxx/pci.h>
+#include <asm/ddb5xxx/debug.h>
+
+#define	DEBUG
+#ifdef 	DEBUG
+#define	DBG(x...)	printk(x)
+#else
+#define	DBG(x...)	
+#endif
+
+/* These are used for config access before all the PCI probing
+   has been done. */
+int early_read_config_byte(struct pci_channel *hose, int bus, int dev_fn, int where, u8 *val);
+int early_read_config_word(struct pci_channel *hose, int bus, int dev_fn, int where, u16 *val);
+int early_read_config_dword(struct pci_channel *hose, int bus, int dev_fn, int where, u32 *val);
+int early_write_config_byte(struct pci_channel *hose, int bus, int dev_fn, int where, u8 val);
+int early_write_config_word(struct pci_channel *hose, int bus, int dev_fn, int where, u16 val);
+int early_write_config_dword(struct pci_channel *hose, int bus, int dev_fn, int where, u32 val);
+
+static u32 pciauto_lower_iospc;
+static u32 pciauto_upper_iospc;
+
+static u32 pciauto_lower_memspc;
+static u32 pciauto_upper_memspc;
+
+void __init 
+pciauto_setup_bars(struct pci_channel *hose,
+		   int current_bus,
+		   int pci_devfn)
+{
+	u32 bar_response, bar_size, bar_value;
+	u32 bar, addr_mask, bar_nr = 0;
+	u32 * upper_limit;
+	u32 * lower_limit;
+	int found_mem64 = 0;
+
+	DBG("PCI Autoconfig: Found Bus %d, Device %d, Function %d\n",
+	    current_bus, PCI_SLOT(pci_devfn), PCI_FUNC(pci_devfn) );
+
+	for (bar = PCI_BASE_ADDRESS_0; bar <= PCI_BASE_ADDRESS_5; bar+=4)
+	{
+		/* Tickle the BAR and get the response */
+		early_write_config_dword(hose,
+					 current_bus,
+					 pci_devfn,
+					 bar,
+					 0xffffffff);
+		early_read_config_dword(hose,
+					current_bus,
+					pci_devfn,
+					bar,
+					&bar_response);
+
+		/* If BAR is not implemented go to the next BAR */
+		if (!bar_response)
+			continue;
+
+		/* Check the BAR type and set our address mask */
+		if (bar_response & PCI_BASE_ADDRESS_SPACE)
+		{
+			addr_mask = PCI_BASE_ADDRESS_IO_MASK;
+			upper_limit = &pciauto_upper_iospc;
+			lower_limit = &pciauto_lower_iospc;
+			DBG("PCI Autoconfig: BAR %d, I/O, ", bar_nr);
+		}
+		else
+		{
+			if ( (bar_response & PCI_BASE_ADDRESS_MEM_TYPE_MASK) ==
+			     PCI_BASE_ADDRESS_MEM_TYPE_64)
+				found_mem64 = 1;
+
+			addr_mask = PCI_BASE_ADDRESS_MEM_MASK;		
+			upper_limit = &pciauto_upper_memspc;
+			lower_limit = &pciauto_lower_memspc;
+			DBG("PCI Autoconfig: BAR %d, Mem, ", bar_nr);
+		}
+
+		/* Calculate requested size */
+		bar_size = ~(bar_response & addr_mask) + 1;
+
+		/* Allocate a base address */
+		bar_value = ((*lower_limit - 1) & ~(bar_size - 1)) + bar_size;
+		MIPS_ASSERT(bar_value + bar_size <= *upper_limit);
+
+		/* Write it out and update our limit */
+		early_write_config_dword(hose,
+					 current_bus,
+					 pci_devfn,
+					 bar,
+					 bar_value);
+
+		*lower_limit = bar_value + bar_size;
+
+		/*
+		 * If we are a 64-bit decoder then increment to the
+		 * upper 32 bits of the bar and force it to locate
+		 * in the lower 4GB of memory.
+		 */ 
+		if (found_mem64)
+		{
+			bar += 4;
+			early_write_config_dword(hose,
+						 current_bus,
+						 pci_devfn,
+						 bar,
+						 0x00000000);
+		}
+
+		bar_nr++;
+
+		DBG("size=0x%x, address=0x%x\n",
+		    bar_size, bar_value);
+	}
+
+}
+
+void __init
+pciauto_prescan_setup_bridge(struct pci_channel *hose,
+			     int current_bus,
+			     int pci_devfn,
+			     int sub_bus)
+{
+	int cmdstat;
+
+	/* Configure bus number registers */
+	early_write_config_byte(hose,
+				current_bus,
+				pci_devfn,
+				PCI_PRIMARY_BUS,
+				current_bus);
+	early_write_config_byte(hose,
+				current_bus,
+				pci_devfn,
+				PCI_SECONDARY_BUS,
+				sub_bus + 1);
+	early_write_config_byte(hose,
+				current_bus,
+				pci_devfn,
+				PCI_SUBORDINATE_BUS,
+				0xff);
+
+	/* Round memory allocator to 1MB boundary */
+	pciauto_upper_memspc &= ~(0x100000 - 1);
+
+	/* Round I/O allocator to 4KB boundary */
+	pciauto_upper_iospc &= ~(0x1000 - 1);
+
+	/* Set up memory and I/O filter limits, assume 32-bit I/O space */
+	early_write_config_word(hose,
+				current_bus,
+				pci_devfn,
+				PCI_MEMORY_LIMIT,
+				((pciauto_upper_memspc - 1) & 0xfff00000) >> 16);
+	early_write_config_byte(hose,
+				current_bus,
+				pci_devfn,
+				PCI_IO_LIMIT,
+				((pciauto_upper_iospc - 1) & 0x0000f000) >> 8);
+	early_write_config_word(hose,
+				current_bus,
+				pci_devfn,
+				PCI_IO_LIMIT_UPPER16,
+				((pciauto_upper_iospc - 1) & 0xffff0000) >> 16);
+			
+	/* We don't support prefetchable memory for now, so disable */
+	early_write_config_word(hose,
+				current_bus,
+				pci_devfn,
+				PCI_PREF_MEMORY_BASE,
+				0x1000);
+	early_write_config_word(hose,
+				current_bus,
+				pci_devfn,
+				PCI_PREF_MEMORY_LIMIT,
+				0x1000);
+
+	/* Enable memory and I/O accesses, enable bus master */
+	early_read_config_dword(hose,
+				current_bus,
+				pci_devfn,
+				PCI_COMMAND,
+				&cmdstat);
+	early_write_config_dword(hose,
+				 current_bus,
+				 pci_devfn,
+				 PCI_COMMAND,
+				 cmdstat |
+				 PCI_COMMAND_IO |
+				 PCI_COMMAND_MEMORY |
+				 PCI_COMMAND_MASTER);
+}
+
+void __init
+pciauto_postscan_setup_bridge(struct pci_channel *hose,
+			      int current_bus,
+			      int pci_devfn,
+			      int sub_bus)
+{
+	/* Configure bus number registers */
+	early_write_config_byte(hose,
+				current_bus,
+				pci_devfn,
+				PCI_SUBORDINATE_BUS,
+				sub_bus);
+
+	/* Round memory allocator to 1MB boundary */
+	pciauto_upper_memspc &= ~(0x100000 - 1);
+	early_write_config_word(hose,
+				current_bus,
+				pci_devfn,
+				PCI_MEMORY_BASE,
+				pciauto_upper_memspc >> 16);
+
+	/* Round I/O allocator to 4KB boundary */
+	pciauto_upper_iospc &= ~(0x1000 - 1);
+	early_write_config_byte(hose,
+				current_bus,
+				pci_devfn,
+				PCI_IO_BASE,
+				(pciauto_upper_iospc & 0x0000f000) >> 8);
+	early_write_config_word(hose,
+				current_bus,
+				pci_devfn,
+				PCI_IO_BASE_UPPER16,
+				pciauto_upper_iospc >> 16);
+}
+
+#define      PCIAUTO_IDE_MODE_MASK           0x05
+
+int __init
+pciauto_bus_scan(struct pci_channel *hose, int current_bus)
+{
+	int sub_bus;
+	u32 pci_devfn, pci_class, cmdstat, found_multi=0;
+	unsigned short vid;
+	unsigned char header_type;
+
+	sub_bus = current_bus;
+	
+	for (pci_devfn=0; pci_devfn<0xff; pci_devfn++) {
+
+		if (PCI_FUNC(pci_devfn) && !found_multi)
+			continue;
+
+		early_read_config_byte(hose,
+				       current_bus,
+				       pci_devfn,
+				       PCI_HEADER_TYPE,
+				       &header_type);
+
+		if (!PCI_FUNC(pci_devfn))
+			found_multi = header_type & 0x80;
+
+		early_read_config_word(hose,
+				       current_bus,
+				       pci_devfn,
+				       PCI_VENDOR_ID,
+				       &vid);
+
+		if (vid == 0xffff) continue;
+
+		early_read_config_dword(hose,
+					current_bus,
+					pci_devfn,
+					PCI_CLASS_REVISION, &pci_class);
+		if ( (pci_class >> 16) == PCI_CLASS_BRIDGE_PCI ) {
+			DBG("PCI Autoconfig: Found P2P bridge, device %d\n", PCI_SLOT(pci_devfn));
+			pciauto_prescan_setup_bridge(hose,
+						     current_bus,
+						     pci_devfn,
+						     sub_bus);
+			sub_bus = pciauto_bus_scan(hose, sub_bus+1);
+			pciauto_postscan_setup_bridge(hose,
+						      current_bus,
+						      pci_devfn,
+						      sub_bus);
+
+		} else if ((pci_class >> 16) == PCI_CLASS_STORAGE_IDE) {
+
+			unsigned char prg_iface;
+
+			early_read_config_byte(hose,
+					       current_bus,
+					       pci_devfn,
+					       PCI_CLASS_PROG,
+					       &prg_iface);
+			if (!(prg_iface & PCIAUTO_IDE_MODE_MASK)) {
+				DBG("PCI Autoconfig: Skipping legacy mode IDE controller\n");
+				continue;
+			}
+		}
+
+		/*
+		 * Found a peripheral, enable some standard
+		 * settings
+		 */
+		early_read_config_dword(hose,
+					current_bus,
+					pci_devfn,
+					PCI_COMMAND,
+					&cmdstat);
+		early_write_config_dword(hose,
+					 current_bus,
+					 pci_devfn,
+					 PCI_COMMAND,
+					 cmdstat |
+					 PCI_COMMAND_IO |
+					 PCI_COMMAND_MEMORY |
+					 PCI_COMMAND_MASTER);
+		early_write_config_byte(hose,
+					current_bus,
+					pci_devfn,
+					PCI_LATENCY_TIMER,
+					0x80);
+
+                /* Allocate PCI I/O and/or memory space */
+		pciauto_setup_bars(hose,
+				   current_bus,
+				   pci_devfn);
+	}
+	return sub_bus;
+}
+
+int __init
+pciauto_assign_resources(int busno, struct pci_channel *hose)
+{
+	/* setup resource limits */
+	pciauto_lower_iospc = hose->io_resource->start;
+	pciauto_upper_iospc = hose->io_resource->end + 1;
+	pciauto_lower_memspc = hose->mem_resource->start;
+	pciauto_upper_memspc = hose->mem_resource->end + 1;
+
+	return pciauto_bus_scan(hose, busno);
+}
+
+
+/*
+ * These functions are used early on before PCI scanning is done
+ * and all of the pci_dev and pci_bus structures have been created.
+ */
+static struct pci_dev *
+fake_pci_dev(struct pci_channel *hose, int busnr, int devfn)
+{
+        static struct pci_dev dev;
+        static struct pci_bus bus;
+
+        dev.bus = &bus;
+        dev.sysdata = hose;
+        dev.devfn = devfn;
+        bus.number = busnr;
+        bus.ops = hose->pci_ops;
+        return &dev;
+}
+
+#define EARLY_PCI_OP(rw, size, type)                                    \
+int early_##rw##_config_##size(struct pci_channel *hose, int bus,    \
+                               int devfn, int offset, type value)       \
+{                                                                       \
+        return pci_##rw##_config_##size(fake_pci_dev(hose, bus, devfn), \
+                                        offset, value);                 \
+}
+
+EARLY_PCI_OP(read, byte, u8 *)
+EARLY_PCI_OP(read, word, u16 *)
+EARLY_PCI_OP(read, dword, u32 *)
+EARLY_PCI_OP(write, byte, u8)
+EARLY_PCI_OP(write, word, u16)
+EARLY_PCI_OP(write, dword, u32)
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/common/prom.c linux/arch/mips/ddb5xxx/common/prom.c
--- v2.4.9/linux/arch/mips/ddb5xxx/common/prom.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/common/prom.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,58 @@
+/***********************************************************************
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: jsun@mvista.com or jsun@junsun.net
+ *
+ * arch/mips/ddb5xxx/common/prom.c
+ *     prom.c file.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ ***********************************************************************
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/bootmem.h>
+
+#include <asm/addrspace.h>
+#include <asm/bootinfo.h>
+#include <asm/ddb5xxx/ddb5xxx.h>
+
+char arcs_cmdline[COMMAND_LINE_SIZE];
+
+/* [jsun@junsun.net] PMON passes arguments in C main() style */
+void __init prom_init(int argc, const char **arg)
+{
+	int i;
+
+	/* arg[0] is "g", the rest is boot parameters */
+	arcs_cmdline[0] = '\0';
+	for (i = 1; i < argc; i++) {
+		if (strlen(arcs_cmdline) + strlen(arg[i] + 1)
+		    >= sizeof(arcs_cmdline))
+			break;
+		strcat(arcs_cmdline, arg[i]);
+		strcat(arcs_cmdline, " ");
+	}
+
+	mips_machgroup = MACH_GROUP_NEC_DDB;
+
+#if defined(CONFIG_DDB5074)
+	mips_machtype = MACH_NEC_DDB5074;
+#elif defined(CONFIG_DDB5476)
+	mips_machtype = MACH_NEC_DDB5476;
+#elif defined(CONFIG_DDB5477)
+	mips_machtype = MACH_NEC_DDB5477;
+#endif
+
+	add_memory_region(0, DDB_SDRAM_SIZE, BOOT_MEM_RAM);
+}
+
+void __init prom_free_prom_memory(void)
+{
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/common/rtc_ds1386.c linux/arch/mips/ddb5xxx/common/rtc_ds1386.c
--- v2.4.9/linux/arch/mips/ddb5xxx/common/rtc_ds1386.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/common/rtc_ds1386.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,167 @@
+/*
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: jsun@mvista.com or jsun@junsun.net
+ *
+ * arch/mips/ddb5xxx/common/rtc_ds1386.c
+ *     low-level RTC hookups for s for Dallas 1396 chip.
+ *
+ * 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 exports a function, rtc_ds1386_init(), which expects an
+ * uncached base address as the argument.  It will set the two function
+ * pointers expected by the MIPS generic timer code.
+ */
+
+#include <linux/types.h>
+#include <linux/time.h>
+
+#include <asm/time.h>
+#include <asm/addrspace.h>
+
+#include <asm/ddb5xxx/debug.h>
+
+#define	EPOCH		2000
+
+#undef BCD_TO_BIN
+#define BCD_TO_BIN(val) (((val)&15) + ((val)>>4)*10)
+
+#undef BIN_TO_BCD
+#define BIN_TO_BCD(val) ((((val)/10)<<4) + (val)%10)
+
+#define	READ_RTC(x)	*(volatile unsigned char*)(rtc_base+x)
+#define	WRITE_RTC(x, y)	*(volatile unsigned char*)(rtc_base+x) = y
+
+static unsigned long rtc_base;
+
+static unsigned long
+rtc_ds1386_get_time(void)
+{	
+	u8 byte;
+	u8 temp;
+	unsigned int year, month, day, hour, minute, second;
+
+	/* let us freeze external registers */
+	byte = READ_RTC(0xB);
+	byte &= 0x3f;
+	WRITE_RTC(0xB, byte);
+
+	/* read time data */
+	year = BCD_TO_BIN(READ_RTC(0xA)) + EPOCH;
+	month = BCD_TO_BIN(READ_RTC(0x9) & 0x1f);
+	day = BCD_TO_BIN(READ_RTC(0x8));
+	minute = BCD_TO_BIN(READ_RTC(0x2));
+	second = BCD_TO_BIN(READ_RTC(0x1));
+
+	/* hour is special - deal with it later */
+	temp = READ_RTC(0x4);
+
+	/* enable time transfer */
+	byte |= 0x80;
+	WRITE_RTC(0xB, byte);
+
+	/* calc hour */
+	if (temp & 0x40) {
+		/* 12 hour format */
+		hour = BCD_TO_BIN(temp & 0x1f);
+		if (temp & 0x20) hour += 12; 		/* PM */
+	} else {
+		/* 24 hour format */
+		hour = BCD_TO_BIN(temp & 0x3f);
+	}
+
+	return mktime(year, month, day, hour, minute, second);
+}
+
+static int 
+rtc_ds1386_set_time(unsigned long t)
+{
+	struct rtc_time tm;
+	u8 byte;
+	u8 temp;
+	u8 year, month, day, hour, minute, second;
+
+	/* let us freeze external registers */
+	byte = READ_RTC(0xB);
+	byte &= 0x3f;
+	WRITE_RTC(0xB, byte);
+
+	/* convert */
+	to_tm(t, &tm);
+
+	/* check each field one by one */
+	year = BIN_TO_BCD(tm.tm_year - EPOCH);
+	if (year != READ_RTC(0xA)) {
+		WRITE_RTC(0xA, year);
+	}
+
+	temp = READ_RTC(0x9);
+	month = BIN_TO_BCD(tm.tm_mon);
+	if (month != (temp & 0x1f)) {
+		WRITE_RTC( 0x9,
+			   (month & 0x1f) | (temp & ~0x1f) );
+	}
+
+	day = BIN_TO_BCD(tm.tm_mday);
+	if (day != READ_RTC(0x8)) {
+		WRITE_RTC(0x8, day);
+	}
+
+	temp = READ_RTC(0x4);
+	if (temp & 0x40) {
+		/* 12 hour format */
+		hour = 0x40;
+		if (tm.tm_hour > 12) {
+			hour |= 0x20 | (BIN_TO_BCD(hour-12) & 0x1f);
+		} else {
+			hour |= BIN_TO_BCD(tm.tm_hour);
+		}
+	} else {
+		/* 24 hour format */
+		hour = BIN_TO_BCD(tm.tm_hour) & 0x3f;
+	}
+	if (hour != temp) WRITE_RTC(0x4, hour);
+
+	minute = BIN_TO_BCD(tm.tm_min);
+	if (minute != READ_RTC(0x2)) {
+		WRITE_RTC(0x2, minute);
+	}
+
+	second = BIN_TO_BCD(tm.tm_sec);
+	if (second != READ_RTC(0x1)) {
+		WRITE_RTC(0x1, second);
+	}
+	
+	return 0;
+}
+
+void
+rtc_ds1386_init(unsigned long base)
+{
+	unsigned char byte;
+	
+	/* remember the base */
+	rtc_base = base;
+	MIPS_ASSERT((rtc_base & 0xe0000000) == KSEG1);
+
+	/* turn on RTC if it is not on */
+	byte = READ_RTC(0x9);
+	if (byte & 0x80) {
+		byte &= 0x7f;
+		WRITE_RTC(0x9, byte);
+	}
+
+	/* enable time transfer */
+	byte = READ_RTC(0xB);
+	byte |= 0x80;
+	WRITE_RTC(0xB, byte);
+
+	/* set the function pointers */
+	rtc_get_time = rtc_ds1386_get_time;
+	rtc_set_time = rtc_ds1386_set_time;
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/Makefile linux/arch/mips/ddb5xxx/ddb5477/Makefile
--- v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/Makefile	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/ddb5477/Makefile	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,22 @@
+#
+# Makefile for NEC DDB-Vrc5477 board
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+
+.S.s:
+	$(CPP) $(CFLAGS) $< -o $*.s
+.S.o:
+	$(CC) $(CFLAGS) -c $< -o $*.o
+
+O_TARGET:= ddb5477.o
+
+obj-y	 += int-handler.o irq.o irq_5477.o setup.o pci.o pci_ops.o
+
+obj-$(CONFIG_LL_DEBUG) 		+= debug.o
+obj-$(CONFIG_REMOTE_DEBUG)	+= kgdb_io.o
+obj-$(CONFIG_BLK_DEV_INITRD)	+= ramdisk.o
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/debug.c linux/arch/mips/ddb5xxx/ddb5477/debug.c
--- v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/debug.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/ddb5477/debug.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,162 @@
+/***********************************************************************
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: jsun@mvista.com or jsun@junsun.net
+ *
+ * arch/mips/ddb5xxx/ddb5477/debug.c
+ *     vrc5477 specific debug routines.
+ *
+ * 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/kernel.h>
+#include <linux/interrupt.h>
+#include <linux/signal.h>		/* SA_INTERRUPT */
+
+#include <asm/mipsregs.h>
+#include <asm/ddb5xxx/ddb5xxx.h>
+
+typedef struct {
+       const char *regname;
+       unsigned regaddr;
+} Register;
+
+void jsun_show_regs(char *name, Register *regs)
+{
+	int i;
+
+	printk("\nshow regs: %s\n", name);
+	for(i=0;regs[i].regname!= NULL; i++) {
+		printk("%-16s= %08x\t\t(@%08x)\n", 
+		       regs[i].regname, 
+		       *(unsigned *)(regs[i].regaddr), 
+		       regs[i].regaddr);
+	}
+}
+
+static Register int_regs[] = {
+	{"DDB_INTCTRL0", DDB_BASE + DDB_INTCTRL0},
+	{"DDB_INTCTRL1", DDB_BASE + DDB_INTCTRL1},
+	{"DDB_INTCTRL2", DDB_BASE + DDB_INTCTRL2},
+	{"DDB_INTCTRL3", DDB_BASE + DDB_INTCTRL3},
+	{"DDB_INT0STAT", DDB_BASE + DDB_INT0STAT},
+	{"DDB_INT1STAT", DDB_BASE + DDB_INT1STAT},
+	{"DDB_INT2STAT", DDB_BASE + DDB_INT2STAT},
+	{"DDB_INT3STAT", DDB_BASE + DDB_INT3STAT},
+	{"DDB_INT4STAT", DDB_BASE + DDB_INT4STAT},
+	{"DDB_NMISTAT", DDB_BASE + DDB_NMISTAT},
+	{"DDB_INTPPES0", DDB_BASE + DDB_INTPPES0},
+	{"DDB_INTPPES1", DDB_BASE + DDB_INTPPES1},
+	{NULL, 0x0}
+};
+
+void vrc5477_show_int_regs()
+{
+	jsun_show_regs("interrupt registers", int_regs);
+	printk("CPU CAUSE = %08x\n", read_32bit_cp0_register(CP0_CAUSE));
+	printk("CPU STATUS = %08x\n", read_32bit_cp0_register(CP0_STATUS));
+}
+static Register pdar_regs[] = {
+        {"DDB_SDRAM0", DDB_BASE + DDB_SDRAM0},
+        {"DDB_SDRAM1", DDB_BASE + DDB_SDRAM1},
+        {"DDB_LDCS0", DDB_BASE + DDB_LDCS0},
+        {"DDB_LDCS1", DDB_BASE + DDB_LDCS1},
+        {"DDB_LDCS2", DDB_BASE + DDB_LDCS2},
+        {"DDB_INTCS", DDB_BASE + DDB_INTCS},
+        {"DDB_BOOTCS", DDB_BASE + DDB_BOOTCS},
+        {"DDB_PCIW0", DDB_BASE + DDB_PCIW0},
+        {"DDB_PCIW1", DDB_BASE + DDB_PCIW1},
+        {"DDB_IOPCIW0", DDB_BASE + DDB_IOPCIW0},
+        {"DDB_IOPCIW1", DDB_BASE + DDB_IOPCIW1},
+        {NULL, 0x0}
+};
+void vrc5477_show_pdar_regs(void)
+{
+        jsun_show_regs("PDAR regs", pdar_regs);
+}
+
+static Register bar_regs[] = {
+        {"DDB_BARC0", DDB_BASE + DDB_BARC0},
+        {"DDB_BARM010", DDB_BASE + DDB_BARM010},
+        {"DDB_BARM230", DDB_BASE + DDB_BARM230},
+        {"DDB_BAR00", DDB_BASE + DDB_BAR00},
+        {"DDB_BAR10", DDB_BASE + DDB_BAR10},
+        {"DDB_BAR20", DDB_BASE + DDB_BAR20},
+        {"DDB_BAR30", DDB_BASE + DDB_BAR30},
+        {"DDB_BAR40", DDB_BASE + DDB_BAR40},
+        {"DDB_BAR50", DDB_BASE + DDB_BAR50},
+        {"DDB_BARB0", DDB_BASE + DDB_BARB0},
+        {"DDB_BARC1", DDB_BASE + DDB_BARC1},
+        {"DDB_BARM011", DDB_BASE + DDB_BARM011},
+        {"DDB_BARM231", DDB_BASE + DDB_BARM231},
+        {"DDB_BAR01", DDB_BASE + DDB_BAR01},
+        {"DDB_BAR11", DDB_BASE + DDB_BAR11},
+        {"DDB_BAR21", DDB_BASE + DDB_BAR21},
+        {"DDB_BAR31", DDB_BASE + DDB_BAR31},
+        {"DDB_BAR41", DDB_BASE + DDB_BAR41},
+        {"DDB_BAR51", DDB_BASE + DDB_BAR51},
+        {"DDB_BARB1", DDB_BASE + DDB_BARB1},
+        {NULL, 0x0}
+};
+void vrc5477_show_bar_regs(void)
+{
+        jsun_show_regs("BAR regs", bar_regs);
+}
+
+static Register pci_regs[] = {
+        {"DDB_PCIW0", DDB_BASE + DDB_PCIW0},
+        {"DDB_PCIW1", DDB_BASE + DDB_PCIW1},
+        {"DDB_PCIINIT00", DDB_BASE + DDB_PCIINIT00},
+        {"DDB_PCIINIT10", DDB_BASE + DDB_PCIINIT10},
+        {"DDB_PCICTL0_L", DDB_BASE + DDB_PCICTL0_L},
+        {"DDB_PCICTL0_H", DDB_BASE + DDB_PCICTL0_H},
+        {"DDB_PCIARB0_L", DDB_BASE + DDB_PCIARB0_L},
+        {"DDB_PCIARB0_H", DDB_BASE + DDB_PCIARB0_H},
+        {"DDB_PCISWP0", DDB_BASE + DDB_PCISWP0},
+        {"DDB_PCIERR0", DDB_BASE + DDB_PCIERR0},
+        {"DDB_IOPCIW0", DDB_BASE + DDB_IOPCIW0},
+        {"DDB_IOPCIW1", DDB_BASE + DDB_IOPCIW1},
+        {"DDB_PCIINIT01", DDB_BASE + DDB_PCIINIT01},
+        {"DDB_PCIINIT11", DDB_BASE + DDB_PCIINIT11},
+        {"DDB_PCICTL1_L", DDB_BASE + DDB_PCICTL1_L},
+        {"DDB_PCICTL1_H", DDB_BASE + DDB_PCICTL1_H},
+        {"DDB_PCIARB1_L", DDB_BASE + DDB_PCIARB1_L},
+        {"DDB_PCIARB1_H", DDB_BASE + DDB_PCIARB1_H},
+        {"DDB_PCISWP1", DDB_BASE + DDB_PCISWP1},
+        {"DDB_PCIERR1", DDB_BASE + DDB_PCIERR1},
+        {NULL, 0x0}
+};
+void vrc5477_show_pci_regs(void)
+{
+        jsun_show_regs("PCI regs", pci_regs);
+}
+
+static Register lb_regs[] = {
+        {"DDB_LCNFG", DDB_BASE + DDB_LCNFG},
+        {"DDB_LCST0", DDB_BASE + DDB_LCST0},
+        {"DDB_LCST1", DDB_BASE + DDB_LCST1},
+        {"DDB_LCST2", DDB_BASE + DDB_LCST2},
+        {"DDB_ERRADR", DDB_BASE + DDB_ERRADR},
+        {"DDB_ERRCS", DDB_BASE + DDB_ERRCS},
+        {"DDB_BTM", DDB_BASE + DDB_BTM},
+        {"DDB_BCST", DDB_BASE + DDB_BCST},
+        {NULL, 0x0}
+};
+void vrc5477_show_lb_regs(void)
+{
+        jsun_show_regs("Local Bus regs", lb_regs);
+}
+
+void vrc5477_show_all_regs(void)
+{
+	vrc5477_show_pdar_regs();
+	vrc5477_show_pci_regs();
+	vrc5477_show_bar_regs();
+	vrc5477_show_int_regs();
+	vrc5477_show_lb_regs();
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/int-handler.S linux/arch/mips/ddb5xxx/ddb5477/int-handler.S
--- v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/int-handler.S	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/ddb5477/int-handler.S	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: jsun@mvista.com or jsun@junsun.net
+ *
+ * First-level interrupt dispatcher for ddb5477
+ *
+ * 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/asm.h>
+#include <asm/mipsregs.h>
+#include <asm/addrspace.h>
+#include <asm/regdef.h>
+#include <asm/stackframe.h>
+
+/*
+ * first level interrupt dispatcher for ocelot board -
+ * We check for the timer first, then check PCI ints A and D.
+ * Then check for serial IRQ and fall through.
+ */
+	.align	5
+	NESTED(ddb5477_handle_int, PT_SIZE, sp)
+	SAVE_ALL
+	CLI
+	.set	at
+	.set	noreorder
+	mfc0	t0, CP0_CAUSE  
+	mfc0	t2, CP0_STATUS
+
+	and	t0, t2
+       
+	andi	t1, t0, STATUSF_IP7	/* cpu timer */
+	bnez	t1, ll_cputimer_irq
+	andi	t1, t0, (STATUSF_IP2 | STATUSF_IP3 | STATUSF_IP4 | STATUSF_IP5 | STATUSF_IP6 ) 
+	bnez	t1, ll_vrc5477_irq
+	andi	t1, t0, STATUSF_IP0	/* software int 0 */
+	bnez	t1, ll_cpu_ip0
+	andi	t1, t0, STATUSF_IP1	/* software int 1 */
+	bnez	t1, ll_cpu_ip1
+	nop
+	.set	reorder
+
+	/* wrong alarm or masked ... */
+	j	spurious_interrupt
+	nop
+	END(ddb5477_handle_int)
+
+	.align	5
+
+ll_vrc5477_irq:	
+	move	a0, sp
+	jal	vrc5477_irq_dispatch
+	j	ret_from_irq
+
+ll_cputimer_irq:
+	li	a0, 7
+	move	a1, sp
+	jal	do_IRQ
+	j	ret_from_irq
+
+
+ll_cpu_ip0:	
+	li	a0, 0
+	move	a1, sp
+	jal	do_IRQ
+	j	ret_from_irq
+
+ll_cpu_ip1:	
+	li	a0, 1
+	move	a1, sp
+	jal	do_IRQ
+	j	ret_from_irq
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/irq.c linux/arch/mips/ddb5xxx/ddb5477/irq.c
--- v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/irq.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/ddb5477/irq.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
+ *
+ *  arch/mips/ddb5xxx/ddb5477/irq.c
+ *     The irq setup and misc routines for DDB5476.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/types.h>
+#include <linux/ptrace.h>
+
+#include <asm/system.h>
+#include <asm/mipsregs.h>
+#include <asm/ddb5xxx/ddb5xxx.h>
+
+/* [jsun] sooner or later we should move this debug stuff to MIPS common */
+#include <asm/ddb5xxx/debug.h>
+
+/*
+ * IRQ mapping
+ *
+ *  0-7: 8 CPU interrupts
+ *	0 -	software interrupt 0
+ *	1 - 	software interrupt 1
+ *	2 - 	most Vrc5477 interrupts are routed to this pin
+ *	3 - 	(optional) some other interrupts routed to this pin for debugg
+ *	4 - 	not used
+ *	5 - 	not used
+ *	6 - 	not used
+ *	7 - 	cpu timer (used by default)
+ *
+ *  8-39: 32 Vrc5477 interrupt sources
+ *	(refer to the Vrc5477 manual)	
+ */
+
+#define	PCI0			DDB_INTPPES0
+#define	PCI1			DDB_INTPPES1
+
+#define	ACTIVE_LOW		1
+#define	ACTIVE_HIGH		0
+
+#define	LEVEL_SENSE		2
+#define	EDGE_TRIGGER		0
+
+#define	INTA			0
+#define	INTB			1
+#define	INTC			2
+#define	INTD			3
+#define	INTE			4
+
+static inline void 
+set_pci_int_attr(u32 pci, u32 intn, u32 active, u32 trigger)
+{
+	u32 reg_value;
+	u32 reg_bitmask;
+
+	reg_value = ddb_in32(pci);
+	reg_bitmask = 0x3 << (intn * 2);
+	
+	reg_value &= ~reg_bitmask;
+	reg_value |= (active | trigger) << (intn * 2);
+	ddb_out32(pci, reg_value);
+}
+
+extern void vrc5477_irq_init(u32 base);
+extern void mips_cpu_irq_init(u32 base);
+extern asmlinkage void ddb5477_handle_int(void);
+
+void
+ddb5477_irq_setup(void)
+{
+	MIPS_DEBUG(printk("ddb5477_irq_setup invoked.\n"));
+
+	/* by default, we disable all interrupts and route all vrc5477 
+	 * interrupts to pin 0 (irq 2) */
+	ddb_out32(DDB_INTCTRL0, 0);
+	ddb_out32(DDB_INTCTRL1, 0);
+	ddb_out32(DDB_INTCTRL2, 0);
+	ddb_out32(DDB_INTCTRL3, 0);
+
+	clear_cp0_status(0xff00);
+	set_cp0_status(0x0400);
+
+	/* setup PCI interrupt attributes */
+	set_pci_int_attr(PCI0, INTA, ACTIVE_LOW, LEVEL_SENSE);
+	set_pci_int_attr(PCI0, INTB, ACTIVE_LOW, LEVEL_SENSE);
+	set_pci_int_attr(PCI0, INTC, ACTIVE_LOW, LEVEL_SENSE);
+	set_pci_int_attr(PCI0, INTD, ACTIVE_LOW, LEVEL_SENSE);
+	set_pci_int_attr(PCI0, INTE, ACTIVE_LOW, LEVEL_SENSE);
+
+	set_pci_int_attr(PCI1, INTA, ACTIVE_LOW, LEVEL_SENSE);
+	set_pci_int_attr(PCI1, INTB, ACTIVE_LOW, LEVEL_SENSE);
+	set_pci_int_attr(PCI1, INTC, ACTIVE_LOW, LEVEL_SENSE);
+	set_pci_int_attr(PCI1, INTD, ACTIVE_LOW, LEVEL_SENSE);
+	set_pci_int_attr(PCI1, INTE, ACTIVE_LOW, LEVEL_SENSE);
+
+	/* 
+	 * for debugging purpose, we enable several error interrupts
+	 * and route them to pin 1. (IP3) 
+	 */
+	/* cpu parity check - 0 */
+	ll_vrc5477_irq_route(0, 1); ll_vrc5477_irq_enable(0);
+	/* cpu no-target decode - 1 */
+	ll_vrc5477_irq_route(1, 1); ll_vrc5477_irq_enable(1);
+	/* local bus read time-out - 7 */
+	ll_vrc5477_irq_route(7, 1); ll_vrc5477_irq_enable(7);
+	/* PCI SERR# - 14 */
+	ll_vrc5477_irq_route(14, 1); ll_vrc5477_irq_enable(14);
+	/* PCI internal error - 15 */
+	ll_vrc5477_irq_route(15, 1); ll_vrc5477_irq_enable(15);
+	/* IOPCI SERR# - 30 */
+	ll_vrc5477_irq_route(30, 1); ll_vrc5477_irq_enable(30);
+	/* IOPCI internal error - 31 */
+	ll_vrc5477_irq_route(31, 1); ll_vrc5477_irq_enable(31);
+
+	/* init all controllers */
+	mips_cpu_irq_init(0);
+	vrc5477_irq_init(8);
+
+	/* hook up the first-level interrupt handler */
+	set_except_vector(0, ddb5477_handle_int);
+}
+
+/*
+ * the first level int-handler will jump here if it is a vrc5477 irq
+ */
+#define	NUM_5477_IRQS	32
+asmlinkage void
+vrc5477_irq_dispatch(struct pt_regs *regs)
+{
+	extern unsigned int do_IRQ(int irq, struct pt_regs *regs);
+
+	u32 intStatus;
+	u32 bitmask;
+	u32 i;
+
+	MIPS_ASSERT(ddb_in32(DDB_INT2STAT) == 0);
+	MIPS_ASSERT(ddb_in32(DDB_INT3STAT) == 0);
+	MIPS_ASSERT(ddb_in32(DDB_INT4STAT) == 0);
+	MIPS_ASSERT(ddb_in32(DDB_NMISTAT) == 0);
+
+	if (ddb_in32(DDB_INT1STAT) != 0) {
+#if defined(CONFIG_LL_DEBUG)
+		vrc5477_show_int_regs();
+#endif
+		panic("error interrupt has happened.\n");
+	}
+
+	intStatus = ddb_in32(DDB_INT0STAT);
+	for (i=0, bitmask=1; i<= NUM_5477_IRQS; bitmask <<=1, i++) {
+		/* do we need to "and" with the int mask? */
+		if (intStatus & bitmask) {
+			do_IRQ(8 + i, regs);
+		}
+	}
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/irq_5477.c linux/arch/mips/ddb5xxx/ddb5477/irq_5477.c
--- v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/irq_5477.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/ddb5477/irq_5477.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,179 @@
+/***********************************************************************
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
+ *
+ *  arch/mips/ddb5xxx/ddb5477/irq_5477.c
+ *     This file defines the irq handler for Vrc5477.
+ *
+ * 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.
+ ***********************************************************************
+ */
+
+/*
+ * Vrc5477 defines 32 IRQs.
+ *
+ * This file exports one function:
+ *	vrc5477_irq_init(u32 irq_base);
+ */
+
+#include <linux/irq.h>
+#include <linux/types.h>
+#include <linux/ptrace.h>
+
+#include <asm/ddb5xxx/ddb5xxx.h>
+
+/* [jsun] sooner or later we should move this debug stuff to MIPS common */
+#include <asm/ddb5xxx/debug.h>
+
+/* number of total irqs supported by Vrc5477 */
+#define	NUM_5477_IRQ		32
+
+static int vrc5477_irq_base=-1;
+
+
+static void 
+vrc5477_irq_enable(unsigned int irq)
+{
+	MIPS_ASSERT(vrc5477_irq_base != -1);
+	MIPS_ASSERT(irq >= vrc5477_irq_base);
+	MIPS_ASSERT(irq < vrc5477_irq_base+ NUM_5477_IRQ);
+
+	ll_vrc5477_irq_enable(irq - vrc5477_irq_base);
+}
+
+static void 
+vrc5477_irq_disable(unsigned int irq)
+{
+	MIPS_ASSERT(vrc5477_irq_base != -1);
+	MIPS_ASSERT(irq >= vrc5477_irq_base);
+	MIPS_ASSERT(irq < vrc5477_irq_base + NUM_5477_IRQ);
+
+	ll_vrc5477_irq_disable(irq - vrc5477_irq_base);
+}
+
+static unsigned int vrc5477_irq_startup(unsigned int irq)
+{
+	vrc5477_irq_enable(irq);
+	return 0;
+}
+
+#define	vrc5477_irq_shutdown	vrc5477_irq_disable
+
+static void
+vrc5477_irq_ack(unsigned int irq)
+{
+	MIPS_ASSERT(vrc5477_irq_base != -1);
+	MIPS_ASSERT(irq >= vrc5477_irq_base);
+	MIPS_ASSERT(irq < vrc5477_irq_base+ NUM_5477_IRQ);
+
+	/* clear the interrupt bit */
+	/* some irqs require the driver to clear the sources */
+	ddb_out32(DDB_INTCLR32, 1 << (irq - vrc5477_irq_base));
+
+	/* disable interrupt - some handler will re-enable the irq
+	 * and if the interrupt is leveled, we will have infinite loop
+	 */
+	ll_vrc5477_irq_disable(irq - vrc5477_irq_base);
+}
+
+static void
+vrc5477_irq_end(unsigned int irq)
+{
+	MIPS_ASSERT(vrc5477_irq_base != -1);
+	MIPS_ASSERT(irq >= vrc5477_irq_base);
+	MIPS_ASSERT(irq < vrc5477_irq_base + NUM_5477_IRQ);
+
+	ll_vrc5477_irq_enable( irq - vrc5477_irq_base);
+}
+
+hw_irq_controller vrc5477_irq_controller = {
+	"vrc5477_irq",
+	vrc5477_irq_startup,
+	vrc5477_irq_shutdown,
+	vrc5477_irq_enable,
+	vrc5477_irq_disable,
+	vrc5477_irq_ack,
+	vrc5477_irq_end,
+	NULL			/* no affinity stuff for UP */
+};
+
+void 
+vrc5477_irq_init(u32 irq_base)
+{
+	extern irq_desc_t irq_desc[];
+	u32 i;
+
+	for (i= irq_base; i< irq_base+ NUM_5477_IRQ; i++) {
+		irq_desc[i].status = IRQ_DISABLED;
+		irq_desc[i].action = NULL;
+		irq_desc[i].depth = 1;
+		irq_desc[i].handler = &vrc5477_irq_controller;
+	}
+	
+	vrc5477_irq_base = irq_base;
+}
+
+
+int vrc5477_irq_to_irq(int irq)
+{
+	MIPS_ASSERT(irq >= 0);
+	MIPS_ASSERT(irq < NUM_5477_IRQ);
+
+	return irq + vrc5477_irq_base;
+}
+
+void ll_vrc5477_irq_route(int vrc5477_irq, int ip)
+{
+	u32 reg_value;
+	u32 reg_bitmask;
+	u32 reg_index;
+
+	MIPS_ASSERT(vrc5477_irq >= 0);
+	MIPS_ASSERT(vrc5477_irq < NUM_5477_IRQ);
+	MIPS_ASSERT(ip >= 0);
+	MIPS_ASSERT((ip < 5) || (ip == 6));
+
+	reg_index = DDB_INTCTRL0 + vrc5477_irq/8*4;
+	reg_value = ddb_in32(reg_index);
+	reg_bitmask = 7 << (vrc5477_irq % 8 * 4);
+	reg_value &= ~reg_bitmask;
+	reg_value |= ip << (vrc5477_irq % 8 * 4);
+	ddb_out32(reg_index, reg_value);
+}
+
+void ll_vrc5477_irq_enable(int vrc5477_irq)
+{
+	u32 reg_value;
+	u32 reg_bitmask;
+	u32 reg_index;
+
+	MIPS_ASSERT(vrc5477_irq >= 0);
+	MIPS_ASSERT(vrc5477_irq < NUM_5477_IRQ);
+
+	reg_index = DDB_INTCTRL0 + vrc5477_irq/8*4;
+	reg_value = ddb_in32(reg_index);
+	reg_bitmask = 8 << (vrc5477_irq % 8 * 4);
+	MIPS_ASSERT((reg_value & reg_bitmask) == 0);
+	ddb_out32(reg_index, reg_value | reg_bitmask);
+}
+
+void ll_vrc5477_irq_disable(int vrc5477_irq)
+{
+	u32 reg_value;
+	u32 reg_bitmask;
+	u32 reg_index;
+
+	MIPS_ASSERT(vrc5477_irq >= 0);
+	MIPS_ASSERT(vrc5477_irq < NUM_5477_IRQ);
+
+	reg_index = DDB_INTCTRL0 + vrc5477_irq/8*4;
+	reg_value = ddb_in32(reg_index);
+	reg_bitmask = 8 << (vrc5477_irq % 8 * 4);
+
+	/* we assert that the interrupt is enabled (perhaps over-zealous) */
+	MIPS_ASSERT( (reg_value & reg_bitmask) != 0);
+	ddb_out32(reg_index, reg_value & ~reg_bitmask);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/kgdb_io.c linux/arch/mips/ddb5xxx/ddb5477/kgdb_io.c
--- v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/kgdb_io.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/ddb5477/kgdb_io.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,142 @@
+
+#include <linux/config.h>
+
+#if (defined(CONFIG_DDB5477) && defined(CONFIG_REMOTE_DEBUG))
+
+/* --- CONFIG --- */
+
+/* we need uint32 uint8 */
+/* #include "types.h" */
+typedef unsigned char uint8;
+typedef unsigned int uint32;
+
+/* --- END OF CONFIG --- */
+
+#define         UART16550_BAUD_2400             2400
+#define         UART16550_BAUD_4800             4800
+#define         UART16550_BAUD_9600             9600
+#define         UART16550_BAUD_19200            19200
+#define         UART16550_BAUD_38400            38400
+#define         UART16550_BAUD_57600            57600
+#define         UART16550_BAUD_115200           115200
+
+#define         UART16550_PARITY_NONE           0
+#define         UART16550_PARITY_ODD            0x08
+#define         UART16550_PARITY_EVEN           0x18
+#define         UART16550_PARITY_MARK           0x28
+#define         UART16550_PARITY_SPACE          0x38
+
+#define         UART16550_DATA_5BIT             0x0
+#define         UART16550_DATA_6BIT             0x1
+#define         UART16550_DATA_7BIT             0x2
+#define         UART16550_DATA_8BIT             0x3
+
+#define         UART16550_STOP_1BIT             0x0
+#define         UART16550_STOP_2BIT             0x4
+
+/* ----------------------------------------------------- */
+
+/* === CONFIG === */
+
+/* [jsun] we use the second serial port for kdb */
+#define         BASE                    0xbfa04240
+#define         MAX_BAUD                115200
+#define		REG_OFFSET		8
+
+/* === END OF CONFIG === */
+
+/* register offset */
+#define         OFS_RCV_BUFFER          (0*REG_OFFSET)
+#define         OFS_TRANS_HOLD          (0*REG_OFFSET)
+#define         OFS_SEND_BUFFER         (0*REG_OFFSET)
+#define         OFS_INTR_ENABLE         (1*REG_OFFSET)
+#define         OFS_INTR_ID             (2*REG_OFFSET)
+#define         OFS_DATA_FORMAT         (3*REG_OFFSET)
+#define         OFS_LINE_CONTROL        (3*REG_OFFSET)
+#define         OFS_MODEM_CONTROL       (4*REG_OFFSET)
+#define         OFS_RS232_OUTPUT        (4*REG_OFFSET)
+#define         OFS_LINE_STATUS         (5*REG_OFFSET)
+#define         OFS_MODEM_STATUS        (6*REG_OFFSET)
+#define         OFS_RS232_INPUT         (6*REG_OFFSET)
+#define         OFS_SCRATCH_PAD         (7*REG_OFFSET)
+
+#define         OFS_DIVISOR_LSB         (0*REG_OFFSET)
+#define         OFS_DIVISOR_MSB         (1*REG_OFFSET)
+
+
+/* memory-mapped read/write of the port */
+#define         UART16550_READ(y)    (*((volatile uint8*)(BASE + y)))
+#define         UART16550_WRITE(y, z)  ((*((volatile uint8*)(BASE + y))) = z)
+
+void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
+{
+	/* disable interrupts */
+	UART16550_WRITE(OFS_INTR_ENABLE, 0);
+
+	/* set up buad rate */
+	{
+		uint32 divisor;
+
+		/* set DIAB bit */
+		UART16550_WRITE(OFS_LINE_CONTROL, 0x80);
+
+		/* set divisor */
+		divisor = MAX_BAUD / baud;
+		UART16550_WRITE(OFS_DIVISOR_LSB, divisor & 0xff);
+		UART16550_WRITE(OFS_DIVISOR_MSB, (divisor & 0xff00) >> 8);
+
+		/* clear DIAB bit */
+		UART16550_WRITE(OFS_LINE_CONTROL, 0x0);
+	}
+
+	/* set data format */
+	UART16550_WRITE(OFS_DATA_FORMAT, data | parity | stop);
+}
+
+static int remoteDebugInitialized = 0;
+
+int debug_state = -1;
+
+uint8 getDebugChar(void)
+{
+	uint8 c;
+	if (!remoteDebugInitialized) {
+		remoteDebugInitialized = 1;
+		debugInit(UART16550_BAUD_38400,
+			  UART16550_DATA_8BIT,
+			  UART16550_PARITY_NONE, UART16550_STOP_1BIT);
+	}
+
+	while ((UART16550_READ(OFS_LINE_STATUS) & 0x1) == 0);
+	c= UART16550_READ(OFS_RCV_BUFFER);
+/*
+	if (state != 1) {
+		state = 1;
+		debug_out("\ngetDebugChar: ", 15);
+	}
+	debug_out(&c, 1);
+*/
+	return c;
+}
+
+
+int putDebugChar(uint8 byte)
+{
+	if (!remoteDebugInitialized) {
+		remoteDebugInitialized = 1;
+		debugInit(UART16550_BAUD_9600,
+			  UART16550_DATA_8BIT,
+			  UART16550_PARITY_NONE, UART16550_STOP_1BIT);
+	}
+
+	while ((UART16550_READ(OFS_LINE_STATUS) & 0x20) == 0);
+	UART16550_WRITE(OFS_SEND_BUFFER, byte);
+	if (debug_state != 2) {
+		debug_state = 2;
+		// debug_out("\nputDebugChar: ", 15);
+	}
+	// debug_out(&byte, 1);
+	return 1;
+}
+
+#endif
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/pci.c linux/arch/mips/ddb5xxx/ddb5477/pci.c
--- v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/pci.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/ddb5477/pci.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,147 @@
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+
+#include <asm/ddb5xxx/ddb5xxx.h>
+#include <asm/ddb5xxx/debug.h>
+#include <asm/ddb5xxx/pci.h>
+
+static struct resource extpci_io_resource = {
+	"ext pci IO space", 
+	DDB_PCI0_IO_BASE - DDB_PCI_IO_BASE,
+	DDB_PCI0_IO_BASE - DDB_PCI_IO_BASE + DDB_PCI0_IO_SIZE -1,
+	IORESOURCE_IO};
+
+static struct resource extpci_mem_resource = {
+	"ext pci memory space", 
+	DDB_PCI0_MEM_BASE,
+	DDB_PCI0_MEM_BASE + DDB_PCI0_MEM_SIZE -1,
+	IORESOURCE_MEM};
+
+static struct resource iopci_io_resource = {
+	"io pci IO space", 
+	DDB_PCI1_IO_BASE - DDB_PCI_IO_BASE,
+	DDB_PCI1_IO_BASE - DDB_PCI_IO_BASE + DDB_PCI1_IO_SIZE -1,
+	IORESOURCE_IO};
+
+static struct resource iopci_mem_resource = {
+	"ext pci memory space", 
+	DDB_PCI1_MEM_BASE,
+	DDB_PCI1_MEM_BASE + DDB_PCI1_MEM_SIZE -1,
+	IORESOURCE_MEM};
+
+extern struct pci_ops ddb5477_ext_pci_ops;
+extern struct pci_ops ddb5477_io_pci_ops;
+
+struct pci_channel mips_pci_channels[] = {
+	{ &ddb5477_ext_pci_ops, &extpci_io_resource, &extpci_mem_resource },
+	{ &ddb5477_io_pci_ops, &iopci_io_resource, &iopci_mem_resource },
+	{ NULL, NULL, NULL}
+};
+
+
+/*
+ * we fix up irqs based on the slot number.
+ * The first entry is at AD:11.
+ * Fortunately this works because, although we have two pci buses,
+ * they all have different slot numbers.
+ * 
+ * This does not work for devices on sub-buses.
+ *
+ * Note that the irq number in the array is relative number in vrc5477.
+ * We need to translate it to global irq number.
+ */
+
+/*
+ * irq mapping : PCI int # -> vrc5477 irq #
+ * based on vrc5477 manual page 46
+ */
+#define		PCI_EXT_INTA		8
+#define		PCI_EXT_INTB		9
+#define		PCI_EXT_INTC		10
+#define		PCI_EXT_INTD		11
+#define		PCI_EXT_INTE		12
+
+#define		PCI_IO_INTA		16
+#define		PCI_IO_INTB		17
+#define		PCI_IO_INTC		18
+#define		PCI_IO_INTD		19
+
+/* 
+ * irq mapping : device -> pci int #, 
+ * ddb5477 board manual page 4  and vrc5477 manual page 46
+ */
+#define		INT_ONBOARD_TULIP	PCI_EXT_INTA
+#define		INT_SLOT1		PCI_EXT_INTB
+#define		INT_SLOT2		PCI_EXT_INTC
+#define		INT_SLOT3		PCI_EXT_INTD
+#define		INT_SLOT4		PCI_EXT_INTE
+
+#define		INT_USB_HOST		PCI_IO_INTA
+#define		INT_USB_PERI		PCI_IO_INTB
+#define		INT_AC97		PCI_IO_INTC
+
+/*
+ * based on ddb5477 manual page 11
+ */
+#define		MAX_SLOT_NUM		21
+static unsigned char irq_map[MAX_SLOT_NUM] = {
+	/* AD:11 */ 0xff, 0xff, 0xff, 0xff, 
+	/* AD:15 */ INT_ONBOARD_TULIP, INT_SLOT1, INT_SLOT2, INT_SLOT3,
+	/* AD:19 */ INT_SLOT4, 0xff, 0xff, 0xff,
+	/* AD:23 */ 0xff, 0xff, 0xff, 0xff,
+	/* AD:27 */ 0xff, 0xff, INT_AC97, INT_USB_PERI, 
+	/* AD:31 */ INT_USB_HOST
+};
+
+extern int vrc5477_irq_to_irq(int irq);
+void __init pcibios_fixup_irqs(void)
+{
+        struct pci_dev *dev;
+        int slot_num;
+
+	pci_for_each_dev(dev) {
+		slot_num = PCI_SLOT(dev->devfn);
+		MIPS_ASSERT(slot_num < MAX_SLOT_NUM);
+		MIPS_ASSERT(irq_map[slot_num] != 0xff);
+
+		pci_write_config_byte(dev, 
+				      PCI_INTERRUPT_LINE,
+				      irq_map[slot_num]);
+		dev->irq = vrc5477_irq_to_irq(irq_map[slot_num]);
+	}
+}
+
+#if defined(CONFIG_LL_DEBUG)
+extern void jsun_scan_pci_bus(void);
+extern void jsun_assign_pci_resource(void);
+#endif
+void __init ddb_pci_reset_bus(void)
+{	
+	u32 temp;
+
+	/*
+	 * I am not sure about the "official" procedure, the following
+	 * steps work as far as I know:
+	 * We first set PCI cold reset bit (bit 31) in PCICTRL-H.
+	 * Then we clear the PCI warm reset bit (bit 30) to 0 in PCICTRL-H.
+	 * The same is true for both PCI channels.
+	 */
+	temp = ddb_in32(DDB_PCICTL0_H);
+	temp |= 0x80000000;
+	ddb_out32(DDB_PCICTL0_H, temp);
+	temp &= ~0xc0000000;
+	ddb_out32(DDB_PCICTL0_H, temp);
+
+	temp = ddb_in32(DDB_PCICTL1_H);
+	temp |= 0x80000000;
+	ddb_out32(DDB_PCICTL1_H, temp);
+	temp &= ~0xc0000000;
+	ddb_out32(DDB_PCICTL1_H, temp);
+}
+
+unsigned __init int pcibios_assign_all_busses(void)
+{
+	return 1;
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/pci_ops.c linux/arch/mips/ddb5xxx/ddb5477/pci_ops.c
--- v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/pci_ops.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/ddb5477/pci_ops.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,416 @@
+/***********************************************************************
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
+ *
+ * arch/mips/ddb5xxx/ddb5477/pci_ops.c
+ *     Define the pci_ops for DB5477.
+ *
+ * Much of the code is derived from the original DDB5074 port by 
+ * Geert Uytterhoeven <geert@sonycom.com>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ ***********************************************************************
+ */
+
+/*
+ * DDB5477 has two PCI channels, external PCI and IOPIC (internal)
+ * Therefore we provide two sets of pci_ops.
+ */
+
+#include <linux/config.h>
+#include <linux/pci.h>
+#include <linux/kernel.h>
+#include <linux/types.h>
+
+#include <asm/addrspace.h>
+#include <asm/ddb5xxx/debug.h>
+#include <asm/ddb5xxx/ddb5xxx.h>
+
+/*
+ * config_swap structure records what set of pdar/pmr are used
+ * to access pci config space.  It also provides a place hold the
+ * original values for future restoring.
+ */
+struct pci_config_swap {
+	u32 	pdar;
+	u32	pmr;
+	u32	config_base;
+	u32	config_size;
+	u32	pdar_backup;
+	u32	pmr_backup;
+};
+
+/*
+ * On DDB5477, we have two sets of swap registers, for ext PCI and IOPCI.
+ */
+struct pci_config_swap ext_pci_swap = {
+	DDB_PCIW0,  
+	DDB_PCIINIT00,
+	DDB_PCI0_CONFIG_BASE,
+	DDB_PCI0_CONFIG_SIZE
+};
+struct pci_config_swap io_pci_swap = {
+	DDB_IOPCIW0,  
+	DDB_PCIINIT01,
+	DDB_PCI1_CONFIG_BASE,
+	DDB_PCI1_CONFIG_SIZE
+};
+
+
+/*
+ * access config space
+ */	
+static inline u32 ddb_access_config_base(struct pci_config_swap *swap,
+					 u32 bus,/* 0 means top level bus */
+					 u32 slot_num)
+{
+	u32 pci_addr = 0;
+	u32 pciinit_offset = 0;
+        u32 virt_addr = swap->config_base;
+	u32 option;
+
+	/* [jsun] hack for testing */
+	// if (slot_num == 4) slot_num = 0;
+
+	/* minimum pdar (window) size is 2MB */
+	MIPS_ASSERT(swap->config_size >= (2 << 20));
+
+	MIPS_ASSERT(slot_num < (1 << 5));
+	MIPS_ASSERT(bus < (1 << 8));
+
+	/* backup registers */
+	swap->pdar_backup = ddb_in32(swap->pdar);
+	swap->pmr_backup = ddb_in32(swap->pmr);
+
+	/* set the pdar (pci window) register */
+	ddb_set_pdar(swap->pdar,
+		     swap->config_base,
+		     swap->config_size,
+		     32,	/* 32 bit wide */
+		     0,		/* not on local memory bus */
+		     0);	/* not visible from PCI bus (N/A) */
+
+	/* 
+	 * calcuate the absolute pci config addr; 
+	 * according to the spec, we start scanning from adr:11 (0x800)
+	 */ 
+	if (bus == 0) {
+		/* type 0 config */
+		pci_addr = 0x800 << slot_num;
+	} else {
+		/* type 1 config */
+		pci_addr = (bus << 16) | (slot_num << 11);
+		panic("ddb_access_config_base: we don't support type 1 config Yet");
+	}
+
+	/*
+	 * if pci_addr is less than pci config window size,  we set
+	 * pciinit_offset to 0 and adjust the virt_address.
+	 * Otherwise we will try to adjust pciinit_offset.
+	 */
+	if (pci_addr < swap->config_size) {
+		virt_addr = KSEG1ADDR(swap->config_base + pci_addr);
+		pciinit_offset = 0;
+	} else {
+		MIPS_ASSERT( (pci_addr & (swap->config_size - 1)) == 0);
+		virt_addr = KSEG1ADDR(swap->config_base);
+		pciinit_offset = pci_addr;
+	}
+
+	/* set the pmr register */
+	option = DDB_PCI_ACCESS_32;
+	if (bus != 0) option |= DDB_PCI_CFGTYPE1;
+	ddb_set_pmr(swap->pmr, DDB_PCICMD_CFG, pciinit_offset, option);
+
+	return virt_addr;
+}
+
+static inline void ddb_close_config_base(struct pci_config_swap *swap)
+{
+	ddb_out32(swap->pdar, swap->pdar_backup);
+	ddb_out32(swap->pmr, swap->pmr_backup);
+}
+
+static int read_config_dword(struct pci_config_swap *swap,
+			     struct pci_dev *dev,
+			     u32 where,
+			     u32 *val)
+{
+	u32 bus, slot_num, func_num;
+	u32 base;
+
+	MIPS_ASSERT((where & 3) == 0);
+	MIPS_ASSERT(where < (1 << 8));
+
+	/* check if the bus is top-level */
+	if (dev->bus->parent != NULL) {
+		bus = dev->bus->number;
+		MIPS_ASSERT(bus != 0);
+	} else {
+		bus = 0;
+	}
+
+	slot_num = PCI_SLOT(dev->devfn);
+	func_num = PCI_FUNC(dev->devfn);
+	base = ddb_access_config_base(swap, bus, slot_num);
+	*val = *(volatile u32*) (base + (func_num << 8) + where);
+	ddb_close_config_base(swap);
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int read_config_word(struct pci_config_swap *swap,
+			    struct pci_dev *dev,
+			    u32 where,
+			    u16 *val)
+{
+        int status;
+        u32 result;
+
+	MIPS_ASSERT((where & 1) == 0);
+
+        status = read_config_dword(swap, dev, where & ~3, &result);
+        if (where & 2) result >>= 16;
+        *val = result & 0xffff;
+        return status;
+}
+
+static int read_config_byte(struct pci_config_swap *swap,
+			    struct pci_dev *dev,
+			    u32 where,
+			    u8 *val)
+{
+        int status;
+        u32 result;
+
+        status = read_config_dword(swap, dev, where & ~3, &result);
+        if (where & 1) result >>= 8;
+        if (where & 2) result >>= 16;
+        *val = result & 0xff;
+        return status;
+}
+
+static int write_config_dword(struct pci_config_swap *swap,
+			      struct pci_dev *dev,
+			      u32 where,
+			      u32 val)
+{
+	u32 bus, slot_num, func_num;
+	u32 base;
+
+	MIPS_ASSERT((where & 3) == 0);
+	MIPS_ASSERT(where < (1 << 8));
+
+	/* check if the bus is top-level */
+	if (dev->bus->parent != NULL) {
+		bus = dev->bus->number;
+		MIPS_ASSERT(bus != 0);
+	} else {
+		bus = 0;
+	}
+
+	slot_num = PCI_SLOT(dev->devfn);
+	func_num = PCI_FUNC(dev->devfn);
+	base = ddb_access_config_base(swap, bus, slot_num);
+	*(volatile u32*) (base + (func_num << 8) + where) = val; 
+	ddb_close_config_base(swap);
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int write_config_word(struct pci_config_swap *swap,
+			     struct pci_dev *dev,
+			     u32 where,
+			     u16 val)
+{
+	int status, shift=0;
+	u32 result;
+
+	MIPS_ASSERT((where & 1) == 0);
+
+	status = read_config_dword(swap, dev, where & ~3, &result);
+	if (status != PCIBIOS_SUCCESSFUL) return status;
+
+        if (where & 2)
+                shift += 16;
+        result &= ~(0xffff << shift);
+        result |= val << shift;
+        return write_config_dword(swap, dev, where & ~3, result);
+}
+
+static int write_config_byte(struct pci_config_swap *swap,
+			     struct pci_dev *dev,
+			     u32 where,
+			     u8 val)
+{
+	int status, shift=0;
+	u32 result;
+
+	status = read_config_dword(swap, dev, where & ~3, &result);
+	if (status != PCIBIOS_SUCCESSFUL) return status;
+
+        if (where & 2)
+                shift += 16;
+        if (where & 1)
+                shift += 8;
+        result &= ~(0xff << shift);
+        result |= val << shift;
+        return write_config_dword(swap, dev, where & ~3, result);
+}
+
+#define	MAKE_PCI_OPS(prefix, rw, unitname, unittype, pciswap) \
+static int prefix##_##rw##_config_##unitname(struct pci_dev *dev, int where, unittype val) \
+{ \
+     return rw##_config_##unitname(pciswap, \
+                                   dev, \
+                                   where, \
+                                   val); \
+}
+
+MAKE_PCI_OPS(extpci, read, byte, u8 *, &ext_pci_swap)
+MAKE_PCI_OPS(extpci, read, word, u16 *, &ext_pci_swap)
+MAKE_PCI_OPS(extpci, read, dword, u32 *, &ext_pci_swap)
+
+MAKE_PCI_OPS(iopci, read, byte, u8 *, &io_pci_swap)
+MAKE_PCI_OPS(iopci, read, word, u16 *, &io_pci_swap)
+MAKE_PCI_OPS(iopci, read, dword, u32 *, &io_pci_swap)
+
+MAKE_PCI_OPS(extpci, write, byte, u8, &ext_pci_swap)
+MAKE_PCI_OPS(extpci, write, word, u16, &ext_pci_swap)
+MAKE_PCI_OPS(extpci, write, dword, u32, &ext_pci_swap)
+
+MAKE_PCI_OPS(iopci, write, byte, u8, &io_pci_swap)
+MAKE_PCI_OPS(iopci, write, word, u16, &io_pci_swap)
+MAKE_PCI_OPS(iopci, write, dword, u32, &io_pci_swap)
+
+struct pci_ops ddb5477_ext_pci_ops ={
+	extpci_read_config_byte,
+	extpci_read_config_word,
+	extpci_read_config_dword,
+	extpci_write_config_byte,
+	extpci_write_config_word,
+	extpci_write_config_dword
+};
+
+
+struct pci_ops ddb5477_io_pci_ops ={
+	iopci_read_config_byte,
+	iopci_read_config_word,
+	iopci_read_config_dword,
+	iopci_write_config_byte,
+	iopci_write_config_word,
+	iopci_write_config_dword
+};
+
+#if defined(CONFIG_LL_DEBUG)
+void jsun_scan_pci_bus(void)
+{
+	struct pci_bus bus;
+	struct pci_dev dev;
+	unsigned int devfn;
+	int j;
+
+	bus.parent = NULL;	/* we scan the top level only */
+	dev.bus = &bus;
+	dev.sysdata = NULL;
+
+	/* scan ext pci bus and io pci bus*/
+	for (j=0; j< 2; j++) {
+		if (j ==  0) {
+			printk("scan ddb5477 external PCI bus:\n");
+			bus.ops = &ddb5477_ext_pci_ops;
+		} else {
+			printk("scan ddb5477 IO PCI bus:\n");
+			bus.ops = &ddb5477_io_pci_ops;
+		}
+	
+		for (devfn = 0; devfn < 0x100; devfn += 8) {
+			u32 temp;
+			u16 temp16;
+			u8 temp8;
+			int i;
+
+			dev.devfn = devfn;
+			MIPS_VERIFY(pci_read_config_dword(&dev, 0, &temp),
+				    == PCIBIOS_SUCCESSFUL);
+			if (temp == 0xffffffff) continue;
+
+			printk("slot %d: (addr %d) \n", devfn/8, 11+devfn/8);
+
+			/* verify read word and byte */
+			MIPS_VERIFY(pci_read_config_word(&dev, 2, &temp16),
+				    == PCIBIOS_SUCCESSFUL);
+			MIPS_ASSERT(temp16 == (temp >> 16));
+			MIPS_VERIFY(pci_read_config_byte(&dev, 3, &temp8),
+				    == PCIBIOS_SUCCESSFUL);
+			MIPS_ASSERT(temp8 == (temp >> 24));
+			MIPS_VERIFY(pci_read_config_byte(&dev, 1, &temp8),
+				    == PCIBIOS_SUCCESSFUL);
+			MIPS_ASSERT(temp8 == ((temp >> 8) & 0xff));
+
+			for (i=0; i < 16; i++) {
+				MIPS_VERIFY(pci_read_config_dword(&dev, i*4, &temp),
+					    == PCIBIOS_SUCCESSFUL);
+				printk("\t%08X", temp);
+				if ((i%4) == 3) printk("\n");
+			}
+		}
+	}
+}
+
+
+static void jsun_hardcode_pci_resources_eepro(void)
+{
+	struct pci_bus bus;
+	struct pci_dev dev;
+	u32 temp;
+
+	bus.parent = NULL;	/* we scan the top level only */
+	bus.ops = &ddb5477_ext_pci_ops;
+	dev.bus = &bus;
+	dev.sysdata = NULL;
+
+	/* for slot 5 (ext pci 1) eepro card */
+	dev.devfn = 5*8;
+	pci_read_config_dword(&dev, 0, &temp);
+	MIPS_ASSERT(temp == 0x12298086);
+
+	pci_write_config_dword(&dev, PCI_BASE_ADDRESS_0, DDB_PCI0_MEM_BASE);
+	pci_write_config_dword(&dev, PCI_BASE_ADDRESS_1, 0);
+	pci_write_config_dword(&dev, PCI_BASE_ADDRESS_2, DDB_PCI0_MEM_BASE+0x100000);
+	pci_write_config_dword(&dev, PCI_INTERRUPT_LINE, 17);
+}
+
+static void jsun_hardcode_pci_resources_onboard_tulip(void)
+{
+	struct pci_bus bus;
+	struct pci_dev dev;
+	u32 temp;
+
+	bus.parent = NULL;	/* we scan the top level only */
+	bus.ops = &ddb5477_ext_pci_ops;
+	dev.bus = &bus;
+	dev.sysdata = NULL;
+
+	/* for slot 4 on board ether chip */
+	dev.devfn = 4*8;
+	pci_read_config_dword(&dev, 0, &temp);
+	MIPS_ASSERT(temp == 0x00191011);
+
+	pci_write_config_dword(&dev, PCI_BASE_ADDRESS_0, 0x1000);
+	pci_write_config_dword(&dev, PCI_BASE_ADDRESS_1, DDB_PCI0_MEM_BASE);
+	pci_write_config_dword(&dev, PCI_INTERRUPT_LINE, 16);
+}
+
+static void jsun_hardcode_pci_resources(void)
+{
+	jsun_hardcode_pci_resources_onboard_tulip();
+}
+
+void jsun_assign_pci_resource(void)
+{
+	jsun_hardcode_pci_resources();
+}
+
+#endif
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/setup.c linux/arch/mips/ddb5xxx/ddb5477/setup.c
--- v2.4.9/linux/arch/mips/ddb5xxx/ddb5477/setup.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5xxx/ddb5477/setup.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,251 @@
+/***********************************************************************
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: jsun@mvista.com or jsun@junsun.net
+ *
+ * arch/mips/ddb5xxx/ddb5477/setup.c
+ *     Setup file for DDB5477.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ ***********************************************************************
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/kdev_t.h>
+#include <linux/types.h>
+#include <linux/console.h>
+#include <linux/sched.h>
+#include <linux/pci.h>
+#include <linux/ide.h>
+#include <linux/fs.h>		/* for ROOT_DEV */
+#include <linux/ioport.h>
+#include <linux/param.h>	/* for HZ */
+
+#include <asm/addrspace.h>
+#include <asm/time.h>
+#include <asm/bcache.h>
+#include <asm/irq.h>
+#include <asm/reboot.h>
+#include <asm/gdb-stub.h>
+
+#include <asm/ddb5xxx/ddb5xxx.h>
+
+
+
+#define	USE_CPU_COUNTER_TIMER	/* whether we use cpu counter */
+
+#ifdef USE_CPU_COUNTER_TIMER
+#define	CPU_COUNTER_FREQUENCY		83000000
+#else
+/* otherwise we use special timer 1 */
+#define	SP_TIMER_FREQUENCY		83000000
+#define	SP_TIMER_BASE			DDB_SPT1CTRL_L
+#define	SP_TIMER_IRQ			(8 + 6)
+#endif
+
+static void ddb_machine_restart(char *command)
+{
+	static void (*back_to_prom) (void) = (void (*)(void)) 0xbfc00000;
+
+	u32 t;
+
+	/* PCI cold reset */
+	ddb_pci_reset_bus();
+
+	/* CPU cold reset */
+	t = ddb_in32(DDB_CPUSTAT);
+	MIPS_ASSERT((t&1));
+	ddb_out32(DDB_CPUSTAT, t);
+
+	/* Call the PROM */
+	back_to_prom();
+}
+
+static void ddb_machine_halt(void)
+{
+	printk("DDB Vrc-5477 halted.\n");
+	while (1);
+}
+
+static void ddb_machine_power_off(void)
+{
+	printk("DDB Vrc-5477 halted. Please turn off the power.\n");
+	while (1);
+}
+
+extern void rtc_ds1386_init(unsigned long base);
+static void __init ddb_time_init(void)
+{
+#if defined(USE_CPU_COUNTER_TIMER)
+	mips_counter_frequency = CPU_COUNTER_FREQUENCY;
+#endif
+
+	/* we have ds1396 RTC chip */
+	rtc_ds1386_init(KSEG1ADDR(DDB_LCS1_BASE));
+}
+
+#if defined(CONFIG_LL_DEBUG)
+int  board_init_done_flag = 0;
+#endif
+
+extern int setup_irq(unsigned int irq, struct irqaction *irqaction);
+static void __init ddb_timer_setup(struct irqaction *irq)
+{
+#if defined(USE_CPU_COUNTER_TIMER)
+	unsigned int count;
+
+        /* we are using the cpu counter for timer interrupts */
+	setup_irq(7, irq);
+
+        /* to generate the first timer interrupt */
+        count = read_32bit_cp0_register(CP0_COUNT);
+        write_32bit_cp0_register(CP0_COMPARE, count + 1000);
+
+#else
+
+	/* if we don't use Special purpose timer 1 */
+	ddb_out32(SP_TIMER_BASE, SP_TIMER_FREQUENCY/HZ);
+	ddb_out32(SP_TIMER_BASE+4, 0x1);
+	setup_irq(SP_TIMER_IRQ, irq);
+
+#endif
+	
+	/* this is the last board dependent code */
+	MIPS_DEBUG(board_init_done_flag = 1);
+}
+
+static void ddb5477_board_init(void);
+extern void ddb5477_irq_setup(void);
+
+#if defined(CONFIG_BLK_DEV_INITRD)
+extern unsigned long __rd_start, __rd_end, initrd_start, initrd_end;
+#endif 
+
+void __init ddb_setup(void)
+{
+	extern int panic_timeout;
+
+	irq_setup = ddb5477_irq_setup;
+	mips_io_port_base = KSEG1ADDR(DDB_PCI_IO_BASE);
+
+	board_time_init = ddb_time_init;
+	board_timer_setup = ddb_timer_setup;
+
+	_machine_restart = ddb_machine_restart;
+	_machine_halt = ddb_machine_halt;
+	_machine_power_off = ddb_machine_power_off;
+
+	/* setup resource limits */
+	ioport_resource.end = DDB_PCI0_IO_SIZE + DDB_PCI1_IO_SIZE - 1;
+	iomem_resource.end = 0xffffffff;
+	
+	/* Reboot on panic */
+	panic_timeout = 180;
+
+	/* initialize board - we don't trust the loader */
+	ddb5477_board_init();
+
+#if defined(CONFIG_BLK_DEV_INITRD)
+	ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
+	initrd_start = (unsigned long)&__rd_start;
+	initrd_end = (unsigned long)&__rd_end;
+#endif
+
+}
+
+static void __init ddb5477_board_init()
+{
+	/* ----------- setup PDARs ------------ */
+
+	/* SDRAM should have been set */
+	MIPS_ASSERT(ddb_in32(DDB_SDRAM0) == 
+		    ddb_calc_pdar(DDB_SDRAM_BASE, DDB_SDRAM_SIZE, 32, 0, 1));
+
+	/* SDRAM1 should be turned off.  What is this for anyway ? */
+	MIPS_ASSERT( (ddb_in32(DDB_SDRAM1) & 0xf) == 0);
+
+	/* Set LDCSs */
+	/* flash */
+	ddb_set_pdar(DDB_LCS0, DDB_LCS0_BASE, DDB_LCS0_SIZE, 16, 0, 0);
+	/* misc */
+	ddb_set_pdar(DDB_LCS1, DDB_LCS1_BASE, DDB_LCS1_SIZE, 8, 0, 0);
+	/* mezzanie (?) */
+	ddb_set_pdar(DDB_LCS2, DDB_LCS2_BASE, DDB_LCS2_SIZE, 16, 0, 0);
+
+	/* verify VRC5477 base addr */
+	MIPS_ASSERT(ddb_in32(DDB_VRC5477) == 
+		    ddb_calc_pdar(DDB_VRC5477_BASE, DDB_VRC5477_SIZE, 32, 0, 1));
+	
+	/* verify BOOT ROM addr */
+	MIPS_ASSERT(ddb_in32(DDB_BOOTCS) == 
+		    ddb_calc_pdar(DDB_BOOTCS_BASE, DDB_BOOTCS_SIZE, 8, 0, 0));
+
+	/* setup PCI windows - window0 for MEM/config, window1 for IO */
+	ddb_set_pdar(DDB_PCIW0, DDB_PCI0_MEM_BASE, DDB_PCI0_MEM_SIZE, 32, 0, 1);
+	ddb_set_pdar(DDB_PCIW1, DDB_PCI0_IO_BASE, DDB_PCI0_IO_SIZE, 32, 0, 1);
+	ddb_set_pdar(DDB_IOPCIW0, DDB_PCI1_MEM_BASE, DDB_PCI1_MEM_SIZE, 32, 0, 1);
+	ddb_set_pdar(DDB_IOPCIW1, DDB_PCI1_IO_BASE, DDB_PCI1_IO_SIZE, 32, 0, 1);
+
+	/* ------------ reset PCI bus and BARs ----------------- */
+	ddb_pci_reset_bus();
+
+	ddb_out32(DDB_BARM010, 0x00000008);
+	ddb_out32(DDB_BARM011, 0x00000008);
+
+	ddb_out32(DDB_BARC0, 0xffffffff);
+	ddb_out32(DDB_BARM230, 0xffffffff);
+	ddb_out32(DDB_BAR00, 0xffffffff);
+	ddb_out32(DDB_BAR10, 0xffffffff);
+	ddb_out32(DDB_BAR20, 0xffffffff);
+	ddb_out32(DDB_BAR30, 0xffffffff);
+	ddb_out32(DDB_BAR40, 0xffffffff);
+	ddb_out32(DDB_BAR50, 0xffffffff);
+	ddb_out32(DDB_BARB0, 0xffffffff);
+
+	ddb_out32(DDB_BARC1, 0xffffffff);
+	ddb_out32(DDB_BARM231, 0xffffffff);
+	ddb_out32(DDB_BAR01, 0xffffffff);
+	ddb_out32(DDB_BAR11, 0xffffffff);
+	ddb_out32(DDB_BAR21, 0xffffffff);
+	ddb_out32(DDB_BAR31, 0xffffffff);
+	ddb_out32(DDB_BAR41, 0xffffffff);
+	ddb_out32(DDB_BAR51, 0xffffffff);
+	ddb_out32(DDB_BARB1, 0xffffffff);
+
+	/* 
+	 * We use pci master register 0  for memory space / config space
+	 * And we use register 1 for IO space.
+	 * Note that for memory space, we bump up the pci base address
+	 * so that we have 1:1 mapping between PCI memory and cpu physical.
+	 * For PCI IO space, it starts from 0 in PCI IO space but with
+	 * DDB_xx_IO_BASE in CPU physical address space.
+	 */
+	ddb_set_pmr(DDB_PCIINIT00, DDB_PCICMD_MEM, DDB_PCI0_MEM_BASE, 
+		    DDB_PCI_ACCESS_32);
+	ddb_set_pmr(DDB_PCIINIT10, DDB_PCICMD_IO, 0, DDB_PCI_ACCESS_32);
+
+	ddb_set_pmr(DDB_PCIINIT01, DDB_PCICMD_MEM, DDB_PCI1_MEM_BASE, 
+		    DDB_PCI_ACCESS_32);
+	ddb_set_pmr(DDB_PCIINIT11, DDB_PCICMD_IO, DDB_PCI0_IO_SIZE, 
+                    DDB_PCI_ACCESS_32);
+
+	
+	/* PCI cross window should be set properly */
+	ddb_set_pdar(DDB_BARP00, DDB_PCI1_MEM_BASE, DDB_PCI1_MEM_SIZE, 32, 0, 1);
+	ddb_set_pdar(DDB_BARP10, DDB_PCI1_IO_BASE, DDB_PCI1_IO_SIZE, 32, 0, 1);
+	ddb_set_pdar(DDB_BARP01, DDB_PCI0_MEM_BASE, DDB_PCI0_MEM_SIZE, 32, 0, 1);
+	ddb_set_pdar(DDB_BARP11, DDB_PCI0_IO_BASE, DDB_PCI0_IO_SIZE, 32, 0, 1);
+
+	/* enable USB input buffers */
+	ddb_out32(DDB_PIBMISC, 0x00000007);
+
+	/* For dual-function pins, make them all non-GPIO */
+	ddb_out32(DDB_GIUFUNSEL, 0x0);
+	// ddb_out32(DDB_GIUFUNSEL, 0xfe0fcfff);  /* NEC recommanded value */
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/dec/Makefile linux/arch/mips/dec/Makefile
--- v2.4.9/linux/arch/mips/dec/Makefile	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/dec/Makefile	Sun Sep  9 10:43:01 2001
@@ -19,7 +19,6 @@
 obj-y	 := int-handler.o setup.o irq.o time.o reset.o rtc-dec.o wbflush.o
 
 obj-$(CONFIG_PROM_CONSOLE)	+= promcon.o
-obj-$(CONFIG_SERIAL)		+= serial.o
 
 int-handler.o:	int-handler.S
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/dec/int-handler.S linux/arch/mips/dec/int-handler.S
--- v2.4.9/linux/arch/mips/dec/int-handler.S	Fri Jun 25 17:40:12 1999
+++ linux/arch/mips/dec/int-handler.S	Sun Sep  9 10:43:01 2001
@@ -2,6 +2,7 @@
  * arch/mips/dec/int-handler.S
  *
  * Copyright (C) 1995, 1996, 1997 Paul M. Antoine and Harald Koerfgen
+ * Copyright (C) 2000  Maciej W. Rozycki
  *
  * Written by Ralf Baechle and Andreas Busse, modified for DECStation
  * support by Paul Antoine and Harald Koerfgen.
@@ -16,6 +17,11 @@
 #include <asm/stackframe.h>
 #include <asm/addrspace.h>
 
+#include <asm/dec/kn01.h>
+#include <asm/dec/kn02.h>
+#include <asm/dec/kn02xa.h>
+#include <asm/dec/kn03.h>
+#include <asm/dec/ioasic_addrs.h>
 #include <asm/dec/interrupts.h>
 
 
@@ -24,8 +30,6 @@
 /*
  * decstation_handle_int: Interrupt handler for DECStations
  *
- * FIXME: Detection of spurious interrupts not yet implemented!
- *
  * We follow the model in the Indy interrupt code by David Miller, where he
  * says: a lot of complication here is taken away because:
  *
@@ -139,12 +143,12 @@
 		la	t1,cpu_mask_tbl
 		and	t0,t2			# isolate allowed ones
 
-		/* insert detection of spurious interrupts here */
+		beqz	t0,spurious
 
 		/*
 		 * Find irq with highest priority
 		 */
-1:		lw	t2,(t1)
+1:		 lw	t2,(t1)
 		move	t3,t0
 		and	t3,t2
 		beq	t3,zero,1b
@@ -156,18 +160,18 @@
 		lw	a0,%lo(cpu_irq_nr-cpu_mask_tbl-PTRSIZE)(t1)
 		lw	t0,%lo(cpu_ivec_tbl-cpu_mask_tbl-PTRSIZE)(t1)
 		bgez	a0, handle_it		# irq_nr >= 0?
-						# irq_nr < 0: a0 contains an address
-		nop
+						# irq_nr < 0: t0 contains an address
+		 nop
 		jr	t0
 		 nop				# delay slot
 
 /*
  * Handle "IRQ Controller" Interrupts
  * Masked Interrupts are still visible and have to be masked "by hand".
- * %hi(KN02_CSR_ADDR) does not work so all addresses are hardcoded :-(.
  */
 		EXPORT(kn02_io_int)
-kn02_io_int:	lui	t0,0xbff0		# get interrupt status and mask
+kn02_io_int:					# 3max
+		lui	t0,KN02_CSR_ADDR>>16	# get interrupt status and mask
 		lw	t0,(t0)
 		la	t1,asic_mask_tbl
 		move	t3,t0
@@ -176,27 +180,32 @@
 		 and	t0,t3			# mask out allowed ones
 
 		EXPORT(kn03_io_int)
-kn03_io_int:	lui	t2,0xbf84		# upper part of IOASIC Address
-		lw	t0,0x0110(t2)		# get status: IOASIC isr
-		lw	t3,0x0120(t2)		# get mask:   IOASIC isrm
+kn03_io_int:					# 3max+
+		lui	t2,KN03_IOASIC_BASE>>16	# upper part of IOASIC Address
+		lw	t0,SIR(t2)		# get status: IOASIC isr
+		lw	t3,SIMR(t2)		# get mask:   IOASIC isrm
 		la	t1,asic_mask_tbl
 		b	find_int
 		 and	t0,t3			# mask out allowed ones
 
-		EXPORT(kn02ba_io_int)
-kn02ba_io_int:	lui	t2,0xbc04		
-		lw	t0,0x0110(t2)		# IOASIC isr, works for maxine also
-		lw	t3,0x0120(t2)		# IOASIC isrm
+		EXPORT(kn02xa_io_int)
+kn02xa_io_int:					# 3min/maxine
+		lui	t2,KN02XA_IOASIC_BASE>>16		
+						# upper part of IOASIC Address
+		lw	t0,SIR(t2)		# get status: IOASIC isr
+		lw	t3,SIMR(t2)		# get mask:   IOASIC isrm
 		la	t1,asic_mask_tbl
 		and	t0,t3
 
 		/*
 		 * Find irq with highest priority
 		 */
-find_int:	lw	t2,(t1)
+find_int:	beqz	t0,spurious
+
+1:		 lw	t2,(t1)
 		move	t3,t0
 		and	t3,t2
-		beq	zero,t3,find_int
+		beq	zero,t3,1b
 		 addu	t1,PTRSIZE		# delay slot
 
 		/*
@@ -209,7 +218,10 @@
 		 move	a1,sp
 		j	ret_from_irq
 		 nop
-		
+
+spurious:
+		j	spurious_interrupt
+		 nop
 		END(decstation_handle_int)
 /*
   * Interrupt routines common to all DECStations first.
@@ -218,14 +230,6 @@
 dec_intr_fpu:	PANIC("Unimplemented FPU interrupt handler")
 
 /*
- * Halt interrupt
- */
-		EXPORT(intr_halt)
-intr_halt:	la	k0,0xbc000000
-		jr	k0
-		 nop
-
-/*
  * Generic unimplemented interrupt routines - ivec_tbl is initialised to
  * point all interrupts here.  The table is then filled in by machine-specific
  * initialisation in dec_setup().
@@ -358,5 +362,3 @@
 		.word	0
 		.word	0
 		.word	0xffffffff		# EOL
-
-
diff -u --recursive --new-file v2.4.9/linux/arch/mips/dec/irq.c linux/arch/mips/dec/irq.c
--- v2.4.9/linux/arch/mips/dec/irq.c	Fri Feb  9 11:29:44 2001
+++ linux/arch/mips/dec/irq.c	Sun Sep  9 10:43:01 2001
@@ -2,9 +2,7 @@
  * Code to handle DECstation IRQs plus some generic interrupt stuff.
  *
  * Copyright (C) 1992 Linus Torvalds
- * Copyright (C) 1994, 1995, 1996, 1997 Ralf Baechle
- *
- * $Id: irq.c,v 1.6 2000/02/04 07:40:23 ralf Exp $
+ * Copyright (C) 1994, 1995, 1996, 1997, 2000 Ralf Baechle
  */
 #include <linux/errno.h>
 #include <linux/init.h>
@@ -27,9 +25,14 @@
 
 #include <asm/dec/interrupts.h>
 
-extern volatile unsigned int *isr;	/* address of the interrupt status register     */
-extern volatile unsigned int *imr;	/* address of the interrupt mask register       */
-extern decint_t dec_interrupt[NR_INTS];
+extern void dec_init_kn01(void);
+extern void dec_init_kn230(void);
+extern void dec_init_kn02(void);
+extern void dec_init_kn02ba(void);
+extern void dec_init_kn02ca(void);
+extern void dec_init_kn03(void);
+
+extern asmlinkage void decstation_handle_int(void);
 
 unsigned long spurious_count = 0;
 
@@ -42,7 +45,7 @@
 	dummy = *imr;
 	dummy = *imr;
     } else			/* This is a cpu interrupt        */
-	set_cp0_status(ST0_IM, read_32bit_cp0_register(CP0_STATUS) & ~dec_interrupt[irq_nr].cpu_mask);
+	change_cp0_status(ST0_IM, read_32bit_cp0_register(CP0_STATUS) & ~dec_interrupt[irq_nr].cpu_mask);
 }
 
 static inline void unmask_irq(unsigned int irq_nr)
@@ -54,7 +57,7 @@
 	dummy = *imr;
 	dummy = *imr;
     }
-    set_cp0_status(ST0_IM, read_32bit_cp0_register(CP0_STATUS) | dec_interrupt[irq_nr].cpu_mask);
+    change_cp0_status(ST0_IM, read_32bit_cp0_register(CP0_STATUS) | dec_interrupt[irq_nr].cpu_mask);
 }
 
 void disable_irq(unsigned int irq_nr)
@@ -125,7 +128,7 @@
     int do_random, cpu;
 
     cpu = smp_processor_id();
-    irq_enter(cpu);
+    irq_enter(cpu, irq);
     kstat.irqs[cpu][irq]++;
 
     mask_irq(irq);
@@ -142,10 +145,10 @@
 	} while (action);
 	if (do_random & SA_SAMPLE_RANDOM)
 	    add_interrupt_randomness(irq);
-	unmask_irq(irq);
 	__cli();
+	unmask_irq(irq);
     }
-    irq_exit(cpu);
+    irq_exit(cpu, irq);
 
     /* unmasking and bottom half handling is done magically for us. */
 }
@@ -261,5 +264,34 @@
 
 void __init init_IRQ(void)
 {
-    irq_setup();
+    switch (mips_machtype) {
+    case MACH_DS23100:
+	dec_init_kn01();
+	break;
+    case MACH_DS5100:		/*  DS5100 MIPSMATE */
+	dec_init_kn230();
+	break;
+    case MACH_DS5000_200:	/* DS5000 3max */
+	dec_init_kn02();
+	break;
+    case MACH_DS5000_1XX:	/* DS5000/100 3min */
+	dec_init_kn02ba();
+	break;
+    case MACH_DS5000_2X0:	/* DS5000/240 3max+ */
+	dec_init_kn03();
+	break;
+    case MACH_DS5000_XX:	/* Personal DS5000/2x */
+	dec_init_kn02ca();
+	break;
+    case MACH_DS5800:		/* DS5800 Isis */
+	panic("Don't know how to set this up!");
+	break;
+    case MACH_DS5400:		/* DS5400 MIPSfair */
+	panic("Don't know how to set this up!");
+	break;
+    case MACH_DS5500:		/* DS5500 MIPSfair-2 */
+	panic("Don't know how to set this up!");
+	break;
+    }
+    set_except_vector(0, decstation_handle_int);
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/dec/prom/cmdline.c linux/arch/mips/dec/prom/cmdline.c
--- v2.4.9/linux/arch/mips/dec/prom/cmdline.c	Mon Feb 28 07:18:20 2000
+++ linux/arch/mips/dec/prom/cmdline.c	Sun Sep  9 10:43:01 2001
@@ -2,8 +2,6 @@
  * cmdline.c: read the command line passed to us by the PROM.
  *
  * Copyright (C) 1998 Harald Koerfgen
- *
- * $Id: cmdline.c,v 1.2 1999/10/09 00:00:57 ralf Exp $
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -19,7 +17,7 @@
 extern int (*prom_printf)(char *, ...);
 #endif
 
-char arcs_cmdline[CL_SIZE];
+char arcs_cmdline[COMMAND_LINE_SIZE];
 
 void __init prom_init_cmdline(int argc, char **argv, unsigned long magic)
 {
diff -u --recursive --new-file v2.4.9/linux/arch/mips/dec/prom/init.c linux/arch/mips/dec/prom/init.c
--- v2.4.9/linux/arch/mips/dec/prom/init.c	Sat May 13 08:29:14 2000
+++ linux/arch/mips/dec/prom/init.c	Sun Sep  9 10:43:01 2001
@@ -2,12 +2,11 @@
  * init.c: PROM library initialisation code.
  *
  * Copyright (C) 1998 Harald Koerfgen
- *
- * $Id: init.c,v 1.3 1999/08/09 19:43:13 harald Exp $
  */
 #include <linux/init.h>
 #include <linux/config.h>
 #include <asm/bootinfo.h>
+#include <asm/cpu.h>
 #include "prom.h"
 
 /*
@@ -93,15 +92,17 @@
 
 	/* Were we compiled with the right CPU option? */
 #if defined(CONFIG_CPU_R3000)
-	if ((mips_cputype == CPU_R4000SC) || (mips_cputype == CPU_R4400SC)) {
+	if ((mips_cpu.cputype == CPU_R4000SC) ||
+	    (mips_cpu.cputype == CPU_R4400SC)) {
 		prom_printf("Sorry, this kernel is compiled for the wrong CPU type!\n");
 		prom_printf("Please recompile with \"CONFIG_CPU_R4x00 = y\"\n");
 		dec_machine_halt();
 	}
 #endif
 
-#if defined(CONFIG_CPU_R4x00)
-	if ((mips_cputype == CPU_R3000) || (mips_cputype == CPU_R3000A)) {
+#if defined(CONFIG_CPU_R4X00)
+	if ((mips_cpu.cputype == CPU_R3000) ||
+	    (mips_cpu.cputype == CPU_R3000A)) {
 		prom_printf("Sorry, this kernel is compiled for the wrong CPU type!\n");
 		prom_printf("Please recompile with \"CONFIG_CPU_R3000 = y\"\n");
 		dec_machine_halt();
@@ -114,3 +115,4 @@
 
 	return 0;
 }
+
diff -u --recursive --new-file v2.4.9/linux/arch/mips/dec/prom/memory.c linux/arch/mips/dec/prom/memory.c
--- v2.4.9/linux/arch/mips/dec/prom/memory.c	Tue Mar  6 19:44:36 2001
+++ linux/arch/mips/dec/prom/memory.c	Sun Sep  9 10:43:01 2001
@@ -2,6 +2,7 @@
  * memory.c: memory initialisation code.
  *
  * Copyright (C) 1998 Harald Koerfgen, Frieder Streffer and Paul M. Antoine
+ * Copyright (C) 2000 Maciej W. Rozycki
  *
  * $Id: memory.c,v 1.3 1999/10/09 00:00:58 ralf Exp $
  */
@@ -14,6 +15,8 @@
 #include <asm/addrspace.h>
 #include <asm/page.h>
 
+#include <asm/bootinfo.h>
+
 #include <asm/dec/machtype.h>
 
 #include "prom.h"
@@ -33,11 +36,6 @@
 
 volatile unsigned long mem_err = 0;	/* So we know an error occurred */
 
-extern char _end;
-
-#define PFN_UP(x)	(((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
-#define PFN_ALIGN(x)	(((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
-
 /*
  * Probe memory in 4MB chunks, waiting for an error to tell us we've fallen
  * off the end of real memory.  Only suitable for the 2100/3100's (PMAX).
@@ -45,7 +43,7 @@
 
 #define CHUNK_SIZE 0x400000
 
-unsigned long __init pmax_get_memory_size(void)
+static void __init pmax_setup_memory_region(void)
 {
 	volatile unsigned char *memory_page, dummy;
 	char	old_handler[0x80];
@@ -66,17 +64,19 @@
 		dummy = *memory_page;
 	}
 	memcpy((void *)(KSEG0 + 0x80), &old_handler, 0x80);
-	return (unsigned long)memory_page - KSEG1 - CHUNK_SIZE;
+
+	add_memory_region(0, (unsigned long)memory_page - KSEG1 - CHUNK_SIZE,
+			  BOOT_MEM_RAM);
 }
 
 /*
  * Use the REX prom calls to get hold of the memory bitmap, and thence
  * determine memory size.
  */
-unsigned long __init rex_get_memory_size(void)
+static void __init rex_setup_memory_region(void)
 {
 	int i, bitmap_size;
-	unsigned long mem_size = 0;
+	unsigned long mem_start = 0, mem_size = 0;
 	memmap *bm;
 
 	/* some free 64k */
@@ -88,46 +88,30 @@
 		/* FIXME: very simplistically only add full sets of pages */
 		if (bm->bitmap[i] == 0xff)
 			mem_size += (8 * bm->pagesize);
+		else if (!mem_size)
+			mem_start += (8 * bm->pagesize);
+		else {
+			add_memory_region(mem_start, mem_size, BOOT_MEM_RAM);
+			mem_start += mem_size + (8 * bm->pagesize);
+			mem_size = 0;
+		}
 	}
-
-	return (mem_size);
+	if (mem_size)
+		add_memory_region(mem_start, mem_size, BOOT_MEM_RAM);
 }
 
 void __init prom_meminit(unsigned int magic)
 {
-	unsigned long free_start, free_end, start_pfn, bootmap_size;
-	unsigned long mem_size = 0;
-
 	if (magic != REX_PROM_MAGIC)
-		mem_size = pmax_get_memory_size();
+		pmax_setup_memory_region();
 	else
-		mem_size = rex_get_memory_size();
-
-	free_start = PHYSADDR(PFN_ALIGN(&_end));
-	free_end = mem_size;
-	start_pfn = PFN_UP((unsigned long)&_end);
-
-#ifdef PROM_DEBUG
-	prom_printf("free_start: 0x%08x\n", free_start);
-	prom_printf("free_end: 0x%08x\n", free_end);
-	prom_printf("start_pfn: 0x%08x\n", start_pfn);
-#endif
-
-	/* Register all the contiguous memory with the bootmem allocator
-	   and free it.  Be careful about the bootmem freemap.  */
-	bootmap_size = init_bootmem(start_pfn, mem_size >> PAGE_SHIFT);
-	free_bootmem(free_start + bootmap_size, free_end - free_start - bootmap_size);
-}
-
-int __init page_is_ram(unsigned long pagenr)
-{
-        return 1;
+		rex_setup_memory_region();
 }
 
-void prom_free_prom_memory (void)
+void __init prom_free_prom_memory (void)
 {
 	unsigned long addr, end;
-	extern	char _ftext;
+	extern char _ftext;
 
 	/*
 	 * Free everything below the kernel itself but leave
@@ -142,16 +126,16 @@
 	 * XXX: save this address for use in dec_lance.c?
 	 */
 	if (IOASIC)
-		end = PHYSADDR(&_ftext) - 0x00020000;
+		end = __pa(&_ftext) - 0x00020000;
 	else
 #endif
-		end = PHYSADDR(&_ftext);
+		end = __pa(&_ftext);
 
 	addr = PAGE_SIZE;
 	while (addr < end) {
-		ClearPageReserved(virt_to_page(addr));
-		set_page_count(virt_to_page(addr), 1);
-		free_page(addr);
+		ClearPageReserved(virt_to_page(__va(addr)));
+		set_page_count(virt_to_page(__va(addr)), 1);
+		free_page((unsigned long)__va(addr));
 		addr += PAGE_SIZE;
 	}
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/dec/reset.c linux/arch/mips/dec/reset.c
--- v2.4.9/linux/arch/mips/dec/reset.c	Sat May 13 08:29:14 2000
+++ linux/arch/mips/dec/reset.c	Sun Sep  9 10:43:01 2001
@@ -23,3 +23,7 @@
 	back_to_prom();
 }
 
+void dec_intr_halt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	dec_machine_halt();
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/dec/rtc-dec.c linux/arch/mips/dec/rtc-dec.c
--- v2.4.9/linux/arch/mips/dec/rtc-dec.c	Sat May 13 08:29:14 2000
+++ linux/arch/mips/dec/rtc-dec.c	Sun Sep  9 10:43:01 2001
@@ -1,13 +1,12 @@
-
-/* $Id: rtc-jazz.c,v 1.2 1998/06/25 20:19:14 ralf Exp $
-
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
  * RTC routines for DECstation style attached Dallas chip.
  *
- * Copyright (C) 1998 by Ralf Baechle, Harald Koerfgen
+ * Copyright (C) 1998, 2001 by Ralf Baechle
+ * Copyright (C) 1998 by Harald Koerfgen
  */
 #include <linux/mc146818rtc.h>
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/dec/serial.c linux/arch/mips/dec/serial.c
--- v2.4.9/linux/arch/mips/dec/serial.c	Sat May 13 08:29:14 2000
+++ linux/arch/mips/dec/serial.c	Wed Dec 31 16:00:00 1969
@@ -1,98 +0,0 @@
-/*
- * sercons.c
- *      choose the right serial device at boot time
- *
- * triemer 6-SEP-1998
- *      sercons.c is designed to allow the three different kinds 
- *      of serial devices under the decstation world to co-exist
- *      in the same kernel.  The idea here is to abstract 
- *      the pieces of the drivers that are common to this file
- *      so that they do not clash at compile time and runtime.
- *
- * HK 16-SEP-1998 v0.002
- *      removed the PROM console as this is not a real serial
- *      device. Added support for PROM console in drivers/char/tty_io.c
- *      instead. Although it may work to enable more than one 
- *      console device I strongly recommend to use only one.
- */
-
-#include <linux/config.h>
-#include <linux/init.h>
-#include <asm/dec/machtype.h>
-
-#ifdef CONFIG_ZS
-extern int zs_init(void);
-#endif
-
-#ifdef CONFIG_DZ
-extern int dz_init(void);
-#endif
-
-#ifdef CONFIG_SERIAL_CONSOLE
-
-#ifdef CONFIG_ZS
-extern void zs_serial_console_init(void);
-#endif
-
-#ifdef CONFIG_DZ
-extern void dz_serial_console_init(void);
-#endif
-
-#endif
-
-/* rs_init - starts up the serial interface -
-   handle normal case of starting up the serial interface */
-
-#ifdef CONFIG_SERIAL
-
-int __init rs_init(void)
-{
-
-#if defined(CONFIG_ZS) && defined(CONFIG_DZ)
-    if (IOASIC)
-	return zs_init();
-    else
-	return dz_init();
-#else
-
-#ifdef CONFIG_ZS
-    return zs_init();
-#endif
-
-#ifdef CONFIG_DZ
-    return dz_init();
-#endif
-
-#endif
-}
-
-__initcall(rs_init);
-
-#endif
-
-#ifdef CONFIG_SERIAL_CONSOLE
-
-/* serial_console_init handles the special case of starting
- *   up the console on the serial port
- */
-void __init serial_console_init(void)
-{
-#if defined(CONFIG_ZS) && defined(CONFIG_DZ)
-    if (IOASIC)
-	zs_serial_console_init();
-    else
-	dz_serial_console_init();
-#else
-
-#ifdef CONFIG_ZS
-    zs_serial_console_init();
-#endif
-
-#ifdef CONFIG_DZ
-    dz_serial_console_init();
-#endif
-
-#endif
-}
-
-#endif
diff -u --recursive --new-file v2.4.9/linux/arch/mips/dec/setup.c linux/arch/mips/dec/setup.c
--- v2.4.9/linux/arch/mips/dec/setup.c	Thu Aug 26 12:42:31 1999
+++ linux/arch/mips/dec/setup.c	Sun Sep  9 10:43:01 2001
@@ -6,11 +6,13 @@
  * for more details.
  *
  * Copyright (C) 1998 Harald Koerfgen
+ * Copyright (C) 2000 Maciej W. Rozycki
  */
 #include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/mc146818rtc.h>
 #include <linux/param.h>
+#include <linux/console.h>
 #include <asm/mipsregs.h>
 #include <asm/bootinfo.h>
 #include <linux/init.h>
@@ -22,25 +24,19 @@
 #include <asm/dec/kn02.h>
 #include <asm/dec/kn02xa.h>
 #include <asm/dec/kn03.h>
+#include <asm/dec/ioasic.h>
+#include <asm/dec/ioasic_addrs.h>
 #include <asm/dec/ioasic_ints.h>
 
-extern asmlinkage void decstation_handle_int(void);
 
-void dec_init_kn01(void);
-void dec_init_kn230(void);
-void dec_init_kn02(void);
-void dec_init_kn02ba(void);
-void dec_init_kn02ca(void);
-void dec_init_kn03(void);
+char *dec_rtc_base = (void *) KN01_RTC_BASE;	/* Assume DS2100/3100 initially */
 
-char *dec_rtc_base = (char *) KN01_RTC_BASE;	/* Assume DS2100/3100 initially */
+volatile unsigned int *ioasic_base;
 
 decint_t dec_interrupt[NR_INTS];
 
-/* 
+/*
  * Information regarding the IRQ Controller
- *
- * isr and imr are also hardcoded for different machines in int_handler.S
  */
 
 volatile unsigned int *isr = 0L;	/* address of the interrupt status register     */
@@ -49,50 +45,17 @@
 extern void dec_machine_restart(char *command);
 extern void dec_machine_halt(void);
 extern void dec_machine_power_off(void);
+extern void dec_intr_halt(int irq, void *dev_id, struct pt_regs *regs);
 
 extern void wbflush_setup(void);
 
 extern struct rtc_ops dec_rtc_ops;
 
-extern void intr_halt(void);
-
 extern int setup_dec_irq(int, struct irqaction *);
 
 void (*board_time_init) (struct irqaction * irq);
 
-static void __init dec_irq_setup(void)
-{
-    switch (mips_machtype) {
-    case MACH_DS23100:
-	dec_init_kn01();
-	break;
-    case MACH_DS5100:		/*  DS5100 MIPSMATE */
-	dec_init_kn230();
-	break;
-    case MACH_DS5000_200:	/* DS5000 3max */
-	dec_init_kn02();
-	break;
-    case MACH_DS5000_1XX:	/* DS5000/100 3min */
-	dec_init_kn02ba();
-	break;
-    case MACH_DS5000_2X0:	/* DS5000/240 3max+ */
-	dec_init_kn03();
-	break;
-    case MACH_DS5000_XX:	/* Personal DS5000/2x */
-	dec_init_kn02ca();
-	break;
-    case MACH_DS5800:		/* DS5800 Isis */
-	panic("Don't know how to set this up!");
-	break;
-    case MACH_DS5400:		/* DS5400 MIPSfair */
-	panic("Don't know how to set this up!");
-	break;
-    case MACH_DS5500:		/* DS5500 MIPSfair-2 */
-	panic("Don't know how to set this up!");
-	break;
-    }
-    set_except_vector(0, decstation_handle_int);
-}
+static struct irqaction irq10 = {dec_intr_halt, 0, 0, "halt", NULL, NULL};
 
 /*
  * enable the periodic interrupts
@@ -112,9 +75,16 @@
     setup_dec_irq(CLOCK, irq);
 }
 
+/*
+ * Enable the halt interrupt.
+ */
+static void __init dec_halt_init(struct irqaction *irq)
+{
+    setup_dec_irq(HALT, irq);
+}
+
 void __init decstation_setup(void)
 {
-    irq_setup = dec_irq_setup;
     board_time_init = dec_time_init;
 
     wbflush_setup();
@@ -123,6 +93,10 @@
     _machine_halt = dec_machine_halt;
     _machine_power_off = dec_machine_power_off;
 
+#ifdef CONFIG_FB
+    conswitchp = &dummy_con;
+#endif
+
     rtc_ops = &dec_rtc_ops;
 }
 
@@ -206,8 +180,8 @@
      * Setup some memory addresses. FIXME: probably incomplete!
      */
     dec_rtc_base = (char *) KN02_RTC_BASE;
-    isr = (volatile unsigned int *) KN02_CSR_ADDR;
-    imr = (volatile unsigned int *) KN02_CSR_ADDR;
+    isr = (void *) KN02_CSR_ADDR;
+    imr = (void *) KN02_CSR_ADDR;
 
     /*
      * Setup IOASIC interrupt
@@ -275,16 +249,17 @@
     /*
      * Setup some memory addresses.
      */
+    ioasic_base = (void *) KN02XA_IOASIC_BASE;
     dec_rtc_base = (char *) KN02XA_RTC_BASE;
-    isr = (volatile unsigned int *) KN02XA_SIR_ADDR;
-    imr = (volatile unsigned int *) KN02XA_SIRM_ADDR;
+    isr = (void *) KN02XA_IOASIC_REG(SIR);
+    imr = (void *) KN02XA_IOASIC_REG(SIMR);
 
     /*
      * Setup IOASIC interrupt
      */
     cpu_mask_tbl[0] = IE_IRQ3;
     cpu_irq_nr[0] = -1;
-    cpu_ivec_tbl[0] = kn02ba_io_int;
+    cpu_ivec_tbl[0] = kn02xa_io_int;
     *imr = 0;
 
     /*
@@ -345,6 +320,7 @@
     cpu_mask_tbl[5] = IE_IRQ5;
     cpu_irq_nr[5] = FPU;
 
+    dec_halt_init(&irq10);
 }				/* dec_init_kn02ba */
 
 /*
@@ -355,14 +331,15 @@
     /*
      * Setup some memory addresses. FIXME: probably incomplete!
      */
+    ioasic_base = (void *) KN02XA_IOASIC_BASE;
     dec_rtc_base = (char *) KN02XA_RTC_BASE;
-    isr = (volatile unsigned int *) KN02XA_SIR_ADDR;
-    imr = (volatile unsigned int *) KN02XA_SIRM_ADDR;
+    isr = (void *) KN02XA_IOASIC_REG(SIR);
+    imr = (void *) KN02XA_IOASIC_REG(SIMR);
 
     /*
      * Setup IOASIC interrupt
      */
-    cpu_ivec_tbl[1] = kn02ba_io_int;
+    cpu_ivec_tbl[1] = kn02xa_io_int;
     cpu_irq_nr[1] = -1;
     cpu_mask_tbl[1] = IE_IRQ3;
     *imr = 0;
@@ -420,6 +397,7 @@
     cpu_mask_tbl[4] = IE_IRQ5;
     cpu_irq_nr[4] = FPU;
 
+    dec_halt_init(&irq10);
 }				/* dec_init_kn02ca */
 
 /*
@@ -430,9 +408,10 @@
     /*
      * Setup some memory addresses. FIXME: probably incomplete!
      */
+    ioasic_base = (void *) KN03_IOASIC_BASE;
     dec_rtc_base = (char *) KN03_RTC_BASE;
-    isr = (volatile unsigned int *) KN03_SIR_ADDR;
-    imr = (volatile unsigned int *) KN03_SIRM_ADDR;
+    isr = (void *) KN03_IOASIC_REG(SIR);
+    imr = (void *) KN03_IOASIC_REG(SIMR);
 
     /*
      * Setup IOASIC interrupt
@@ -500,4 +479,5 @@
     cpu_mask_tbl[4] = IE_IRQ5;
     cpu_irq_nr[4] = FPU;
 
+    dec_halt_init(&irq10);
 }				/* dec_init_kn03 */
diff -u --recursive --new-file v2.4.9/linux/arch/mips/dec/time.c linux/arch/mips/dec/time.c
--- v2.4.9/linux/arch/mips/dec/time.c	Mon Oct 16 12:58:51 2000
+++ linux/arch/mips/dec/time.c	Sun Sep  9 10:43:01 2001
@@ -1,8 +1,8 @@
-
 /*
- *  linux/arch/mips/kernel/time.c
+ *  linux/arch/mips/dec/time.c
  *
  *  Copyright (C) 1991, 1992, 1995  Linus Torvalds
+ *  Copyright (C) 2000  Maciej W. Rozycki
  *
  * This file contains the time handling details for PC-style clocks as
  * found in some MIPS systems.
@@ -17,14 +17,22 @@
 #include <linux/mm.h>
 #include <linux/interrupt.h>
 
+#include <asm/cpu.h>
 #include <asm/bootinfo.h>
 #include <asm/mipsregs.h>
 #include <asm/io.h>
 #include <asm/irq.h>
+#include <asm/dec/machtype.h>
+#include <asm/dec/ioasic.h>
+#include <asm/dec/ioasic_addrs.h>
 
 #include <linux/mc146818rtc.h>
 #include <linux/timex.h>
 
+#include <asm/div64.h>
+
+extern void (*board_time_init)(struct irqaction *irq);
+
 extern volatile unsigned long wall_jiffies;
 extern rwlock_t xtime_lock;
 
@@ -36,12 +44,22 @@
 
 /* This is for machines which generate the exact clock. */
 #define USECS_PER_JIFFY (1000000/HZ)
+#define USECS_PER_JIFFY_FRAC ((1000000ULL << 32) / HZ & 0xffffffff)
 
 /* Cycle counter value at the previous timer interrupt.. */
 
 static unsigned int timerhi, timerlo;
 
 /*
+ * Cached "1/(clocks per usec)*2^32" value.
+ * It has to be recalculated once each jiffy.
+ */
+static unsigned long cached_quotient = 0;
+
+/* Last jiffy when do_fast_gettimeoffset() was called. */
+static unsigned long last_jiffies = 0;
+
+/*
  * On MIPS only R4000 and better have a cycle counter.
  *
  * FIXME: Does playing with the RP bit in c0_status interfere with this code?
@@ -50,45 +68,34 @@
 {
 	u32 count;
 	unsigned long res, tmp;
-
-	/* Last jiffy when do_fast_gettimeoffset() was called. */
-	static unsigned long last_jiffies = 0;
 	unsigned long quotient;
 
-	/*
-	 * Cached "1/(clocks per usec)*2^32" value.
-	 * It has to be recalculated once each jiffy.
-	 */
-	static unsigned long cached_quotient = 0;
-
 	tmp = jiffies;
 
 	quotient = cached_quotient;
 
-	if (tmp && last_jiffies != tmp) {
-		last_jiffies = tmp;
-		__asm__(".set\tnoreorder\n\t"
-			".set\tnoat\n\t"
-			".set\tmips3\n\t"
-			"lwu\t%0,%2\n\t"
-			"dsll32\t$1,%1,0\n\t"
-			"or\t$1,$1,%0\n\t"
-			"ddivu\t$0,$1,%3\n\t"
-			"mflo\t$1\n\t"
-			"dsll32\t%0,%4,0\n\t"
-			"nop\n\t"
-			"ddivu\t$0,%0,$1\n\t"
-			"mflo\t%0\n\t"
-			".set\tmips0\n\t"
-			".set\tat\n\t"
-			".set\treorder"
-			:"=&r"(quotient)
-			:"r"(timerhi),
-			"m"(timerlo),
-			"r"(tmp),
-			"r"(USECS_PER_JIFFY)
-			:"$1");
+	if (last_jiffies != tmp) {
+	    last_jiffies = tmp;
+	    if (last_jiffies != 0) {
+		unsigned long r0;
+		__asm__(".set	push\n\t"
+			".set	mips3\n\t"
+			"lwu	%0,%3\n\t"
+			"dsll32	%1,%2,0\n\t"
+			"or	%1,%1,%0\n\t"
+			"ddivu	$0,%1,%4\n\t"
+			"mflo	%1\n\t"
+			"dsll32	%0,%5,0\n\t"
+			"or	%0,%0,%6\n\t"
+			"ddivu	$0,%0,%1\n\t"
+			"mflo	%0\n\t"
+			".set	pop"
+			: "=&r" (quotient), "=&r" (r0)
+			: "r" (timerhi), "m" (timerlo),
+			  "r" (tmp), "r" (USECS_PER_JIFFY),
+			  "r" (USECS_PER_JIFFY_FRAC));
 		cached_quotient = quotient;
+	    }
 	}
 	/* Get last timer tick in absolute kernel time */
 	count = read_32bit_cp0_register(CP0_COUNT);
@@ -97,11 +104,9 @@
 	count -= timerlo;
 //printk("count: %08lx, %08lx:%08lx\n", count, timerhi, timerlo);
 
-	__asm__("multu\t%1,%2\n\t"
-		"mfhi\t%0"
-		:"=r"(res)
-		:"r"(count),
-		"r"(quotient));
+	__asm__("multu	%2,%3"
+		: "=l" (tmp), "=h" (res)
+		: "r" (count), "r" (quotient));
 
 	/*
 	 * Due to possible jiffies inconsistencies, we need to check 
@@ -113,6 +118,47 @@
 	return res;
 }
 
+static unsigned long do_ioasic_gettimeoffset(void)
+{
+	u32 count;
+	unsigned long res, tmp;
+	unsigned long quotient;
+
+	tmp = jiffies;
+
+	quotient = cached_quotient;
+
+	if (last_jiffies != tmp) {
+		last_jiffies = tmp;
+		if (last_jiffies != 0) {
+			unsigned long r0;
+			do_div64_32(r0, timerhi, timerlo, tmp);
+			do_div64_32(quotient, USECS_PER_JIFFY,
+				    USECS_PER_JIFFY_FRAC, r0);
+			cached_quotient = quotient;
+		}
+	}
+	/* Get last timer tick in absolute kernel time */
+	count = ioasic_read(FCTR);
+
+	/* .. relative to previous jiffy (32 bits is enough) */
+	count -= timerlo;
+//printk("count: %08x, %08x:%08x\n", count, timerhi, timerlo);
+
+	__asm__("multu	%2,%3"
+		: "=l" (tmp), "=h" (res)
+		: "r" (count), "r" (quotient));
+
+	/*
+	 * Due to possible jiffies inconsistencies, we need to check
+	 * the result so that we'll get a timer that is monotonic.
+	 */
+	if (res >= USECS_PER_JIFFY)
+        	res = USECS_PER_JIFFY - 1;
+
+	return res;
+}
+
 /* This function must be called with interrupts disabled 
  * It was inspired by Steve McCanne's microtime-i386 for BSD.  -- jrs
  * 
@@ -170,8 +216,8 @@
 	tv->tv_usec += do_gettimeoffset();
 
 	/*
-	 * xtime is atomically updated in timer_bh. lost_ticks is
-	 * nonzero if the timer bottom half hasnt executed yet.
+	 * xtime is atomically updated in timer_bh. jiffies - wall_jiffies
+	 * is nonzero if the timer bottom half hasnt executed yet.
 	 */
 	if (jiffies - wall_jiffies)
 		tv->tv_usec += USECS_PER_JIFFY;
@@ -187,6 +233,7 @@
 void do_settimeofday(struct timeval *tv)
 {
 	write_lock_irq(&xtime_lock);
+
 	/* This is revolting. We need to set the xtime.tv_usec
 	 * correctly. However, the value in this location is
 	 * is value at the last tick.
@@ -199,10 +246,13 @@
 		tv->tv_usec += 1000000;
 		tv->tv_sec--;
 	}
+
 	xtime = *tv;
-	time_state = TIME_BAD;
-	time_maxerror = MAXPHASE;
-	time_esterror = MAXPHASE;
+	time_adjust = 0;		/* stop active adjtime() */
+	time_status |= STA_UNSYNC;
+	time_maxerror = NTP_PHASE_LIMIT;
+	time_esterror = NTP_PHASE_LIMIT;
+
 	write_unlock_irq(&xtime_lock);
 }
 
@@ -307,13 +357,16 @@
 	 * called as close as possible to 500 ms before the new second starts.
 	 */
 	read_lock(&xtime_lock);
-	if (time_state != TIME_BAD && xtime.tv_sec > last_rtc_update + 660 &&
-	    xtime.tv_usec > 500000 - (tick >> 1) &&
-	    xtime.tv_usec < 500000 + (tick >> 1))
+	if ((time_status & STA_UNSYNC) == 0
+	    && xtime.tv_sec > last_rtc_update + 660
+	    && xtime.tv_usec >= 500000 - tick / 2
+	    && xtime.tv_usec <= 500000 + tick / 2) {
 		if (set_rtc_mmss(xtime.tv_sec) == 0)
 			last_rtc_update = xtime.tv_sec;
 		else
-			last_rtc_update = xtime.tv_sec - 600;	/* do it again in 60 s */
+			/* do it again in 60 s */
+			last_rtc_update = xtime.tv_sec - 600;
+	}
 	/* As we return to user mode fire off the other CPU schedulers.. this is
 	   basically because we don't yet share IRQ's around. This message is
 	   rigged to be safe on the 386 - basically it's a hack, so don't look
@@ -334,66 +387,50 @@
 	timerhi += (count < timerlo);	/* Wrap around */
 	timerlo = count;
 
-	timer_interrupt(irq, dev_id, regs);
-
-	if (!jiffies) {
+	if (jiffies == ~0) {
 		/*
-		 * If jiffies has overflowed in this timer_interrupt we must
+		 * If jiffies is to overflow in this timer_interrupt we must
 		 * update the timer[hi]/[lo] to make do_fast_gettimeoffset()
 		 * quotient calc still valid. -arca
 		 */
+		write_32bit_cp0_register(CP0_COUNT, 0);
 		timerhi = timerlo = 0;
 	}
-}
 
-char cyclecounter_available;
+	timer_interrupt(irq, dev_id, regs);
+}
 
-static inline void init_cycle_counter(void)
+static void ioasic_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	switch (mips_cputype) {
-	case CPU_UNKNOWN:
-	case CPU_R2000:
-	case CPU_R3000:
-	case CPU_R3000A:
-	case CPU_R3041:
-	case CPU_R3051:
-	case CPU_R3052:
-	case CPU_R3081:
-	case CPU_R3081E:
-	case CPU_R6000:
-	case CPU_R6000A:
-	case CPU_R8000:	/* Not shure about that one, play safe */
-		cyclecounter_available = 0;
-		break;
-	case CPU_R4000PC:
-	case CPU_R4000SC:
-	case CPU_R4000MC:
-	case CPU_R4200:
-	case CPU_R4400PC:
-	case CPU_R4400SC:
-	case CPU_R4400MC:
-	case CPU_R4600:
-	case CPU_R10000:
-	case CPU_R4300:
-	case CPU_R4650:
-	case CPU_R4700:
-	case CPU_R5000:
-	case CPU_R5000A:
-	case CPU_R4640:
-	case CPU_NEVADA:
-		cyclecounter_available = 1;
-		break;
+	unsigned int count;
+
+	/*
+	 * The free-running counter is 32 bit which is good for about
+	 * 2 minutes, 50 seconds at possible count rates of upto 25MHz.
+	 */
+	count = ioasic_read(FCTR);
+	timerhi += (count < timerlo);	/* Wrap around */
+	timerlo = count;
+
+	if (jiffies == ~0) {
+		/*
+		 * If jiffies is to overflow in this timer_interrupt we must
+		 * update the timer[hi]/[lo] to make do_fast_gettimeoffset()
+		 * quotient calc still valid. -arca
+		 */
+		ioasic_write(FCTR, 0);
+		timerhi = timerlo = 0;
 	}
+
+	timer_interrupt(irq, dev_id, regs);
 }
 
 struct irqaction irq0 = {timer_interrupt, SA_INTERRUPT, 0,
 			 "timer", NULL, NULL};
 
-void (*board_time_init) (struct irqaction * irq);
-
 void __init time_init(void)
 {
-	unsigned int year, mon, day, hour, min, sec;
+	unsigned int year, mon, day, hour, min, sec, real_year;
 	int i;
 
 	/* The Linux interpretation of the CMOS clock register contents:
@@ -425,23 +462,26 @@
 		BCD_TO_BIN(year);
 	}
 	/*
-	 * The DECstation RTC is used as a TOY (Time Of Year).
-	 * The PROM will reset the year to either '70, '71 or '72.
-	 * This hack will only work until Dec 31 2001.
+	 * The PROM will reset the year to either '72 or '73.
+	 * Therefore we store the real year separately, in one
+	 * of unused BBU RAM locations.
 	 */
-	year += 1928;
+	real_year = CMOS_READ(RTC_DEC_YEAR);
+	year += real_year - 72 + 2000;
 
 	write_lock_irq(&xtime_lock);
 	xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
 	xtime.tv_usec = 0;
 	write_unlock_irq(&xtime_lock);
 
-	init_cycle_counter();
-
-	if (cyclecounter_available) {
+	if (mips_cpu.options & MIPS_CPU_COUNTER) {
 		write_32bit_cp0_register(CP0_COUNT, 0);
 		do_gettimeoffset = do_fast_gettimeoffset;
 		irq0.handler = r4k_timer_interrupt;
-	}
+	} else if (IOASIC) {
+		ioasic_write(FCTR, 0);
+		do_gettimeoffset = do_ioasic_gettimeoffset;
+		irq0.handler = ioasic_timer_interrupt;
+        }
 	board_time_init(&irq0);
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/defconfig linux/arch/mips/defconfig
--- v2.4.9/linux/arch/mips/defconfig	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/defconfig	Sun Sep  9 10:43:02 2001
@@ -1,6 +1,8 @@
 #
 # Automatically generated make config: don't edit
 #
+CONFIG_MIPS=y
+# CONFIG_SMP is not set
 
 #
 # Code maturity level options
@@ -13,21 +15,37 @@
 # CONFIG_ACER_PICA_61 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
-# CONFIG_COBALT_MICRO_SERVER is not set
 # CONFIG_DECSTATION is not set
 # CONFIG_DDB5074 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_NINO is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
 # CONFIG_OLIVETTI_M700 is not set
 CONFIG_SGI_IP22=y
 # CONFIG_SNI_RM200_PCI is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_PB1000 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 # CONFIG_MCA is not set
 # CONFIG_SBUS is not set
 CONFIG_ARC32=y
+CONFIG_BOARD_SCACHE=y
 CONFIG_PC_KEYB=y
 CONFIG_SGI=y
+CONFIG_NEW_IRQ=y
+CONFIG_OLD_TIME_C=y
 # CONFIG_ISA is not set
 # CONFIG_EISA is not set
 # CONFIG_PCI is not set
+# CONFIG_I8259 is not set
 
 #
 # Loadable module support
@@ -41,14 +59,20 @@
 #
 # CONFIG_CPU_R3000 is not set
 # CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_VR41XX is not set
 # CONFIG_CPU_R4300 is not set
 # CONFIG_CPU_R4X00 is not set
 CONFIG_CPU_R5000=y
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_RM7000 is not set
 # CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R8000 is not set
 # CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_SB1 is not set
+# CONFIG_CPU_MIPS32 is not set
+# CONFIG_CPU_MIPS64 is not set
 # CONFIG_CPU_ADVANCED is not set
 CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_LLDSCD=y
 # CONFIG_CPU_HAS_WB is not set
 
 #
@@ -59,24 +83,26 @@
 CONFIG_ELF_KERNEL=y
 CONFIG_BINFMT_IRIX=y
 CONFIG_FORWARD_KEYBOARD=y
+# CONFIG_ARC_CONSOLE is not set
 # CONFIG_BINFMT_AOUT is not set
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 
 #
-# Parallel port support
+# Memory Technology Devices (MTD)
 #
-# CONFIG_PARPORT is not set
-# CONFIG_PCMCIA is not set
+# CONFIG_MTD is not set
 
 #
-# Memory Technology Devices (MTD)
+# Parallel port support
 #
-# CONFIG_MTD is not set
+# CONFIG_PARPORT is not set
 
 #
 # Block devices
@@ -107,19 +133,24 @@
 # Networking options
 #
 CONFIG_PACKET=y
-# CONFIG_PACKET_MMAP is not set
-# CONFIG_NETLINK is not set
+CONFIG_PACKET_MMAP=y
+CONFIG_NETLINK=y
+CONFIG_RTNETLINK=y
+CONFIG_NETLINK_DEV=y
 # CONFIG_NETFILTER is not set
 # CONFIG_FILTER is not set
 CONFIG_UNIX=y
 CONFIG_INET=y
-# CONFIG_IP_MULTICAST is not set
+CONFIG_IP_MULTICAST=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
 CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IP_PNP_RARP is not set
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
 # CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
 # CONFIG_IPV6 is not set
@@ -148,6 +179,13 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+# CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
+
+#
 # SCSI support
 #
 CONFIG_SCSI=y
@@ -175,7 +213,7 @@
 #
 # SCSI low-level drivers
 #
-CONFIG_SCSI_SGIWD93=y
+CONFIG_SGIWD93_SCSI=y
 # CONFIG_SCSI_7000FASST is not set
 # CONFIG_SCSI_ACARD is not set
 # CONFIG_SCSI_AHA152X is not set
@@ -183,6 +221,7 @@
 # CONFIG_SCSI_AHA1740 is not set
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_IN2000 is not set
 # CONFIG_SCSI_AM53C974 is not set
@@ -199,6 +238,7 @@
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_NCR_D700 is not set
 # CONFIG_SCSI_NCR53C7xx is not set
 # CONFIG_SCSI_PAS16 is not set
 # CONFIG_SCSI_PCI2000 is not set
@@ -215,20 +255,159 @@
 # Network device support
 #
 CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
-# CONFIG_SLIP is not set
-# CONFIG_PPP is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_ETHERTAP is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_NET_ISA is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_NET_POCKET is not set
 CONFIG_SGISEEQ=y
 
 #
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+# CONFIG_SERIAL is not set
+# CONFIG_SERIAL_EXTENDED is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
+
+#
+# Input core support is needed for joysticks
+#
+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
 # SGI Character devices
 #
 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_SGI_NEWPORT_CONSOLE=y
 CONFIG_FONT_8x16=y
-# CONFIG_SGI_PROM_CONSOLE is not set
-# CONFIG_UNIX98_PTYS is not set
+# CONFIG_PSMOUSE is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
 
 #
 # File systems
@@ -238,22 +417,30 @@
 CONFIG_AUTOFS4_FS=y
 # CONFIG_REISERFS_FS is not set
 # CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
 # CONFIG_ADFS_FS is not set
 # CONFIG_ADFS_FS_RW is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
 # CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
 # CONFIG_FAT_FS is not set
 # CONFIG_MSDOS_FS is not set
 # CONFIG_UMSDOS_FS is not set
 # CONFIG_VFAT_FS is not set
 # CONFIG_EFS_FS is not set
 # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
+# CONFIG_TMPFS is not set
 # CONFIG_RAMFS is not set
 CONFIG_ISO9660_FS=y
 # CONFIG_JOLIET is not set
 # CONFIG_MINIX_FS is not set
+# CONFIG_FREEVXFS_FS is not set
 # CONFIG_NTFS_FS is not set
 # CONFIG_NTFS_RW is not set
 # CONFIG_HPFS_FS is not set
@@ -261,13 +448,12 @@
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVFS_MOUNT is not set
 # CONFIG_DEVFS_DEBUG is not set
-# CONFIG_DEVPTS_FS is not set
+CONFIG_DEVPTS_FS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_QNX4FS_RW is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_EXT2_FS=y
 # CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set
 # CONFIG_UDF_FS is not set
 # CONFIG_UDF_RW is not set
 # CONFIG_UFS_FS is not set
@@ -277,6 +463,7 @@
 # Network File Systems
 #
 # CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
 CONFIG_NFS_FS=y
 # CONFIG_NFS_V3 is not set
 CONFIG_ROOT_NFS=y
@@ -309,6 +496,7 @@
 # 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_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
@@ -319,7 +507,7 @@
 # Console drivers
 #
 # CONFIG_VGA_CONSOLE is not set
-# CONFIG_FB is not set
+# CONFIG_MDA_CONSOLE is not set
 
 #
 # Frame-buffer support
@@ -345,13 +533,111 @@
 # CONFIG_USB is not set
 
 #
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+#   Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
 # Input core support
 #
 # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
 
 #
 # Kernel hacking
 #
 CONFIG_CROSSCOMPILE=y
-# CONFIG_MIPS_FPE_MODULE is not set
 # CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_MIPS_UNCACHED is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips/defconfig-atlas linux/arch/mips/defconfig-atlas
--- v2.4.9/linux/arch/mips/defconfig-atlas	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/defconfig-atlas	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,604 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_MIPS=y
+# CONFIG_SMP is not set
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+
+#
+# Machine selection
+#
+# CONFIG_ACER_PICA_61 is not set
+# CONFIG_ALGOR_P4032 is not set
+# CONFIG_BAGET_MIPS is not set
+# CONFIG_DECSTATION is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_EV64120 is not set
+CONFIG_MIPS_ATLAS=y
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_NINO is not set
+# CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_OLIVETTI_M700 is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_PB1000 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
+CONFIG_PCI=y
+CONFIG_SWAP_IO_SPACE=y
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_I8259 is not set
+
+#
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
+# CPU selection
+#
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+CONFIG_CPU_R5000=y
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_SB1 is not set
+# CONFIG_CPU_MIPS32 is not set
+# CONFIG_CPU_MIPS64 is not set
+# CONFIG_CPU_ADVANCED is not set
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_LLDSCD=y
+# CONFIG_CPU_HAS_WB is not set
+
+#
+# General setup
+#
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+CONFIG_KCORE_ELF=y
+CONFIG_ELF_KERNEL=y
+CONFIG_BINFMT_IRIX=y
+# CONFIG_FORWARD_KEYBOARD is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+CONFIG_NET=y
+# CONFIG_PCI_NAMES is not set
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_SYSCTL is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=4096
+# CONFIG_BLK_DEV_INITRD is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_MD_RAID1 is not set
+# CONFIG_MD_RAID5 is not set
+# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking options
+#
+# CONFIG_PACKET is not set
+# CONFIG_NETLINK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_FILTER is not set
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set
+
+#
+#  
+#
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_LLC is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+# CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#
+# CONFIG_IDE is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI support
+#
+CONFIG_SCSI=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+CONFIG_SD_EXTRA_DEVS=40
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_DEBUG_QUEUES is not set
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_7000FASST is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AHA152X is not set
+# CONFIG_SCSI_AHA1542 is not set
+# CONFIG_SCSI_AHA1740 is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_IN2000 is not set
+# CONFIG_SCSI_AM53C974 is not set
+# CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_CPQFCTS is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_EATA_DMA 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_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_NCR_D700 is not set
+# CONFIG_SCSI_NCR53C7xx is not set
+# CONFIG_SCSI_NCR53C8XX is not set
+# CONFIG_SCSI_SYM53C8XX is not set
+# CONFIG_SCSI_PAS16 is not set
+# CONFIG_SCSI_PCI2000 is not set
+# CONFIG_SCSI_PCI2220I is not set
+# CONFIG_SCSI_PSI240I is not set
+# CONFIG_SCSI_QLOGIC_FAS is not set
+# CONFIG_SCSI_QLOGIC_ISP is not set
+# CONFIG_SCSI_QLOGIC_FC is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_SIM710 is not set
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_ISA is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+CONFIG_SERIAL=y
+CONFIG_SERIAL_CONSOLE=y
+# CONFIG_SERIAL_EXTENDED is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
+
+#
+# Input core support is needed for joysticks
+#
+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+CONFIG_RTC=y
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+CONFIG_AUTOFS_FS=y
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
+# CONFIG_FAT_FS is not set
+# CONFIG_MSDOS_FS is not set
+# CONFIG_UMSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+CONFIG_EFS_FS=y
+# CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_TMPFS is not set
+# CONFIG_RAMFS is not set
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_FREEVXFS_FS is not set
+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y
+# CONFIG_SMB_FS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_SMB_NLS is not set
+# CONFIG_NLS is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+#   Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
+# Input core support
+#
+# CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+
+#
+# Kernel hacking
+#
+CONFIG_CROSSCOMPILE=y
+# CONFIG_REMOTE_DEBUG is not set
+# CONFIG_GDB_CONSOLE is not set
+# CONFIG_LL_DEBUG is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_MIPS_UNCACHED is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips/defconfig-cobalt linux/arch/mips/defconfig-cobalt
--- v2.4.9/linux/arch/mips/defconfig-cobalt	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/defconfig-cobalt	Wed Dec 31 16:00:00 1969
@@ -1,598 +0,0 @@
-#
-# Automatically generated make config: don't edit
-#
-
-#
-# Code maturity level options
-#
-CONFIG_EXPERIMENTAL=y
-
-#
-# Machine selection
-#
-# CONFIG_ACER_PICA_61 is not set
-# CONFIG_ALGOR_P4032 is not set
-# CONFIG_BAGET_MIPS is not set
-CONFIG_COBALT_MICRO_SERVER=y
-CONFIG_COBALT_28=y
-# CONFIG_DECSTATION is not set
-# CONFIG_DDB5074 is not set
-# CONFIG_MIPS_MAGNUM_4000 is not set
-# CONFIG_OLIVETTI_M700 is not set
-# CONFIG_SGI_IP22 is not set
-# CONFIG_SNI_RM200_PCI is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
-CONFIG_COBALT_27=y
-CONFIG_COBALT_LCD=y
-CONFIG_COBALT_SERIAL=y
-CONFIG_PCI=y
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-CONFIG_MODVERSIONS=y
-CONFIG_KMOD=y
-
-#
-# CPU selection
-#
-# CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_R6000 is not set
-# CONFIG_CPU_R4300 is not set
-# CONFIG_CPU_R4X00 is not set
-# CONFIG_CPU_R5000 is not set
-CONFIG_CPU_NEVADA=y
-# CONFIG_CPU_R8000 is not set
-# CONFIG_CPU_R10000 is not set
-# CONFIG_CPU_ADVANCED is not set
-CONFIG_CPU_HAS_LLSC=y
-# CONFIG_CPU_HAS_WB is not set
-
-#
-# General setup
-#
-CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-CONFIG_BINFMT_MISC=m
-CONFIG_NET=y
-CONFIG_PCI_NAMES=y
-CONFIG_SYSVIPC=y
-# CONFIG_BSD_PROCESS_ACCT is not set
-CONFIG_SYSCTL=y
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-# CONFIG_PCMCIA is not set
-
-#
-# Memory Technology Devices (MTD)
-#
-# CONFIG_MTD is not set
-
-#
-# Block devices
-#
-# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_XD is not set
-# CONFIG_PARIDE is not set
-# CONFIG_BLK_CPQ_DA is not set
-# CONFIG_BLK_CPQ_CISS_DA is not set
-# CONFIG_BLK_DEV_DAC960 is not set
-CONFIG_BLK_DEV_LOOP=m
-# CONFIG_BLK_DEV_NBD is not set
-CONFIG_BLK_DEV_RAM=m
-CONFIG_BLK_DEV_RAM_SIZE=4096
-# CONFIG_BLK_DEV_INITRD is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-# CONFIG_BLK_DEV_MD is not set
-# CONFIG_MD_LINEAR is not set
-# CONFIG_MD_RAID0 is not set
-# CONFIG_MD_RAID1 is not set
-# CONFIG_MD_RAID5 is not set
-# CONFIG_BLK_DEV_LVM is not set
-
-#
-# Networking options
-#
-# CONFIG_PACKET is not set
-# CONFIG_NETLINK is not set
-# CONFIG_NETFILTER is not set
-# CONFIG_FILTER is not set
-# CONFIG_UNIX is not set
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-# CONFIG_IP_ADVANCED_ROUTER is not set
-# CONFIG_IP_PNP is not set
-# CONFIG_NET_IPIP is not set
-# CONFIG_NET_IPGRE is not set
-CONFIG_IP_MROUTE=y
-# CONFIG_IP_PIMSM_V1 is not set
-# CONFIG_IP_PIMSM_V2 is not set
-# CONFIG_INET_ECN is not set
-CONFIG_SYN_COOKIES=y
-# CONFIG_IPV6 is not set
-# CONFIG_KHTTPD is not set
-# CONFIG_ATM is not set
-
-#
-#  
-#
-CONFIG_IPX=m
-# CONFIG_IPX_INTERN is not set
-CONFIG_ATALK=m
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_LLC is not set
-# CONFIG_NET_DIVERT is not set
-# CONFIG_ECONET is not set
-# CONFIG_WAN_ROUTER is not set
-# CONFIG_NET_FASTROUTE is not set
-# CONFIG_NET_HW_FLOWCONTROL is not set
-
-#
-# QoS and/or fair queueing
-#
-# CONFIG_NET_SCHED is not set
-
-#
-# Telephony Support
-#
-# CONFIG_PHONE is not set
-# CONFIG_PHONE_IXJ is not set
-
-#
-# ATA/IDE/MFM/RLL support
-#
-# CONFIG_IDE is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
-# CONFIG_BLK_DEV_HD is not set
-
-#
-# SCSI support
-#
-CONFIG_SCSI=y
-
-#
-# SCSI support type (disk, tape, CD-ROM)
-#
-CONFIG_BLK_DEV_SD=y
-CONFIG_SD_EXTRA_DEVS=40
-CONFIG_CHR_DEV_ST=m
-# CONFIG_CHR_DEV_OSST is not set
-CONFIG_BLK_DEV_SR=m
-# CONFIG_BLK_DEV_SR_VENDOR is not set
-CONFIG_SR_EXTRA_DEVS=2
-CONFIG_CHR_DEV_SG=m
-
-#
-# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
-#
-# CONFIG_SCSI_DEBUG_QUEUES is not set
-CONFIG_SCSI_MULTI_LUN=y
-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_7000FASST is not set
-# CONFIG_SCSI_ACARD is not set
-# CONFIG_SCSI_AHA152X is not set
-# CONFIG_SCSI_AHA1542 is not set
-# CONFIG_SCSI_AHA1740 is not set
-CONFIG_SCSI_AIC7XXX=y
-CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
-CONFIG_AIC7XXX_RESET_DELAY=5
-# CONFIG_SCSI_ADVANSYS is not set
-# CONFIG_SCSI_IN2000 is not set
-# CONFIG_SCSI_AM53C974 is not set
-# CONFIG_SCSI_MEGARAID is not set
-# CONFIG_SCSI_BUSLOGIC is not set
-# CONFIG_SCSI_CPQFCTS is not set
-# CONFIG_SCSI_DMX3191D is not set
-# CONFIG_SCSI_DTC3280 is not set
-# CONFIG_SCSI_EATA is not set
-# CONFIG_SCSI_EATA_DMA 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_GENERIC_NCR5380 is not set
-# CONFIG_SCSI_INITIO is not set
-# CONFIG_SCSI_INIA100 is not set
-# CONFIG_SCSI_NCR53C406A is not set
-# CONFIG_SCSI_NCR53C7xx is not set
-CONFIG_SCSI_NCR53C8XX=y
-# CONFIG_SCSI_SYM53C8XX is not set
-CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8
-CONFIG_SCSI_NCR53C8XX_MAX_TAGS=4
-CONFIG_SCSI_NCR53C8XX_SYNC=5
-# CONFIG_SCSI_NCR53C8XX_PROFILE is not set
-CONFIG_SCSI_NCR53C8XX_IOMAPPED=y
-# CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT is not set
-# CONFIG_SCSI_PAS16 is not set
-# CONFIG_SCSI_PCI2000 is not set
-# CONFIG_SCSI_PCI2220I is not set
-# CONFIG_SCSI_PSI240I is not set
-# CONFIG_SCSI_QLOGIC_FAS is not set
-# CONFIG_SCSI_QLOGIC_ISP is not set
-# CONFIG_SCSI_QLOGIC_FC is not set
-# CONFIG_SCSI_QLOGIC_1280 is not set
-# CONFIG_SCSI_SIM710 is not set
-# CONFIG_SCSI_SYM53C416 is not set
-# CONFIG_SCSI_DC390T is not set
-# CONFIG_SCSI_T128 is not set
-# CONFIG_SCSI_U14_34F is not set
-# CONFIG_SCSI_DEBUG is not set
-
-#
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_PCI is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
-# Network device support
-#
-CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
-
-#
-# Appletalk devices
-#
-# CONFIG_APPLETALK is not set
-CONFIG_DUMMY=m
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
-# CONFIG_NET_SB1000 is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
-CONFIG_NET_ETHERNET=y
-# CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_LANCE is not set
-# CONFIG_NET_VENDOR_SMC is not set
-# CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_AT1700 is not set
-# CONFIG_DEPCA is not set
-# CONFIG_HP100 is not set
-# CONFIG_NET_ISA is not set
-# CONFIG_NET_PCI is not set
-# CONFIG_NET_POCKET is not set
-
-#
-# Ethernet (1000 Mbit)
-#
-# CONFIG_ACENIC is not set
-# CONFIG_HAMACHI is not set
-# CONFIG_YELLOWFIN is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-CONFIG_PPP=m
-# 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=m
-CONFIG_SLIP_COMPRESSED=y
-CONFIG_SLIP_SMART=y
-# CONFIG_SLIP_MODE_SLIP6 is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# ISDN subsystem
-#
-CONFIG_ISDN=m
-CONFIG_ISDN_PPP=y
-CONFIG_ISDN_PPP_VJ=y
-CONFIG_ISDN_MPP=y
-# CONFIG_ISDN_PPP_BSDCOMP is not set
-CONFIG_ISDN_AUDIO=y
-# CONFIG_ISDN_TTY_FAX is not set
-
-#
-# ISDN feature submodules
-#
-# CONFIG_ISDN_DRV_LOOP is not set
-# CONFIG_ISDN_DIVERSION is not set
-
-#
-# low-level hardware drivers
-#
-
-#
-# Passive ISDN cards
-#
-CONFIG_ISDN_DRV_HISAX=m
-
-#
-#   D-channel protocol features
-#
-CONFIG_HISAX_EURO=y
-CONFIG_DE_AOC=y
-# CONFIG_HISAX_NO_SENDCOMPLETE is not set
-# CONFIG_HISAX_NO_LLC is not set
-# CONFIG_HISAX_NO_KEYPAD is not set
-CONFIG_HISAX_1TR6=y
-# CONFIG_HISAX_NI1 is not set
-
-#
-#   HiSax supported cards
-#
-# CONFIG_HISAX_16_0 is not set
-# CONFIG_HISAX_16_3 is not set
-# CONFIG_HISAX_TELESPCI is not set
-# CONFIG_HISAX_S0BOX is not set
-# CONFIG_HISAX_AVM_A1 is not set
-# CONFIG_HISAX_FRITZPCI is not set
-# CONFIG_HISAX_AVM_A1_PCMCIA is not set
-CONFIG_HISAX_ELSA=y
-# CONFIG_HISAX_IX1MICROR2 is not set
-# CONFIG_HISAX_DIEHLDIVA is not set
-# CONFIG_HISAX_ASUSCOM is not set
-# CONFIG_HISAX_TELEINT is not set
-# CONFIG_HISAX_HFCS is not set
-# CONFIG_HISAX_SEDLBAUER is not set
-# CONFIG_HISAX_SPORTSTER is not set
-# CONFIG_HISAX_MIC is not set
-# CONFIG_HISAX_NETJET is not set
-# CONFIG_HISAX_NETJET_U is not set
-# CONFIG_HISAX_NICCY is not set
-# CONFIG_HISAX_ISURF is not set
-# CONFIG_HISAX_HSTSAPHIR is not set
-# CONFIG_HISAX_BKM_A4T is not set
-# CONFIG_HISAX_SCT_QUADRO is not set
-# CONFIG_HISAX_GAZEL is not set
-# CONFIG_HISAX_HFC_PCI is not set
-# CONFIG_HISAX_W6692 is not set
-# CONFIG_HISAX_HFC_SX is not set
-# CONFIG_HISAX_SEDLBAUER_CS is not set
-
-#
-# Active ISDN cards
-#
-# CONFIG_ISDN_DRV_ICN is not set
-# CONFIG_ISDN_DRV_PCBIT is not set
-# CONFIG_ISDN_DRV_SC is not set
-# CONFIG_ISDN_DRV_ACT2000 is not set
-# CONFIG_ISDN_DRV_EICON is not set
-# CONFIG_ISDN_CAPI is not set
-# CONFIG_HYSDN is not set
-# CONFIG_HYSDN_CAPI is not set
-
-#
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
-# Character devices
-#
-# CONFIG_VT is not set
-# CONFIG_SERIAL is not set
-# CONFIG_SERIAL_EXTENDED is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
-# CONFIG_UNIX98_PTYS is not set
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
-# CONFIG_MOUSE is not set
-
-#
-# Joysticks
-#
-# CONFIG_JOYSTICK is not set
-
-#
-# Input core support is needed for joysticks
-#
-# CONFIG_QIC02_TAPE is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
-# CONFIG_NVRAM is not set
-CONFIG_RTC=y
-# 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
-
-#
-# Multimedia devices
-#
-# CONFIG_VIDEO_DEV is not set
-
-#
-# File systems
-#
-CONFIG_QUOTA=y
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_REISERFS_FS is not set
-# CONFIG_REISERFS_CHECK is not set
-# CONFIG_ADFS_FS is not set
-# CONFIG_ADFS_FS_RW is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_BFS_FS is not set
-CONFIG_FAT_FS=m
-CONFIG_MSDOS_FS=m
-# CONFIG_UMSDOS_FS is not set
-CONFIG_VFAT_FS=m
-# CONFIG_EFS_FS is not set
-# CONFIG_JFFS_FS is not set
-# CONFIG_CRAMFS is not set
-# CONFIG_RAMFS is not set
-CONFIG_ISO9660_FS=m
-# CONFIG_JOLIET is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_NTFS_FS is not set
-# CONFIG_NTFS_RW is not set
-# CONFIG_HPFS_FS is not set
-CONFIG_PROC_FS=y
-# CONFIG_DEVFS_FS is not set
-# CONFIG_DEVFS_MOUNT is not set
-# CONFIG_DEVFS_DEBUG is not set
-# CONFIG_DEVPTS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_QNX4FS_RW is not set
-# CONFIG_ROMFS_FS is not set
-CONFIG_EXT2_FS=y
-# CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set
-# CONFIG_UDF_FS is not set
-# CONFIG_UDF_RW is not set
-# CONFIG_UFS_FS is not set
-# CONFIG_UFS_FS_WRITE is not set
-
-#
-# Network File Systems
-#
-# CONFIG_CODA_FS is not set
-CONFIG_NFS_FS=y
-# CONFIG_NFS_V3 is not set
-# CONFIG_ROOT_NFS is not set
-# CONFIG_NFSD is not set
-# CONFIG_NFSD_V3 is not set
-CONFIG_SUNRPC=y
-CONFIG_LOCKD=y
-CONFIG_SMB_FS=m
-# CONFIG_SMB_NLS_DEFAULT is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_NCPFS_PACKET_SIGNING is not set
-# CONFIG_NCPFS_IOCTL_LOCKING is not set
-# CONFIG_NCPFS_STRONG is not set
-# CONFIG_NCPFS_NFS_NS is not set
-# CONFIG_NCPFS_OS2_NS is not set
-# CONFIG_NCPFS_SMALLDOS is not set
-# CONFIG_NCPFS_NLS is not set
-# CONFIG_NCPFS_EXTRAS is not set
-
-#
-# Partition Types
-#
-# CONFIG_PARTITION_ADVANCED is not set
-CONFIG_MSDOS_PARTITION=y
-CONFIG_SMB_NLS=y
-CONFIG_NLS=y
-
-#
-# Native Language Support
-#
-CONFIG_NLS_DEFAULT="iso8859-1"
-CONFIG_NLS_CODEPAGE_437=m
-CONFIG_NLS_CODEPAGE_737=m
-CONFIG_NLS_CODEPAGE_775=m
-CONFIG_NLS_CODEPAGE_850=m
-CONFIG_NLS_CODEPAGE_852=m
-CONFIG_NLS_CODEPAGE_855=m
-CONFIG_NLS_CODEPAGE_857=m
-CONFIG_NLS_CODEPAGE_860=m
-CONFIG_NLS_CODEPAGE_861=m
-CONFIG_NLS_CODEPAGE_862=m
-CONFIG_NLS_CODEPAGE_863=m
-CONFIG_NLS_CODEPAGE_864=m
-CONFIG_NLS_CODEPAGE_865=m
-CONFIG_NLS_CODEPAGE_866=m
-CONFIG_NLS_CODEPAGE_869=m
-CONFIG_NLS_CODEPAGE_874=m
-CONFIG_NLS_CODEPAGE_932=m
-CONFIG_NLS_CODEPAGE_936=m
-CONFIG_NLS_CODEPAGE_949=m
-CONFIG_NLS_CODEPAGE_950=m
-CONFIG_NLS_ISO8859_1=m
-CONFIG_NLS_ISO8859_2=m
-CONFIG_NLS_ISO8859_3=m
-CONFIG_NLS_ISO8859_4=m
-CONFIG_NLS_ISO8859_5=m
-CONFIG_NLS_ISO8859_6=m
-CONFIG_NLS_ISO8859_7=m
-CONFIG_NLS_ISO8859_8=m
-CONFIG_NLS_ISO8859_9=m
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-CONFIG_NLS_KOI8_R=m
-CONFIG_NLS_UTF8=m
-
-#
-# Sound
-#
-# CONFIG_SOUND is not set
-
-#
-# USB support
-#
-# CONFIG_USB is not set
-
-#
-# Input core support
-#
-# CONFIG_INPUT is not set
-
-#
-# Kernel hacking
-#
-# CONFIG_CROSSCOMPILE is not set
-# CONFIG_MIPS_FPE_MODULE is not set
-# CONFIG_MAGIC_SYSRQ is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips/defconfig-ddb5476 linux/arch/mips/defconfig-ddb5476
--- v2.4.9/linux/arch/mips/defconfig-ddb5476	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/defconfig-ddb5476	Sun Sep  9 10:43:01 2001
@@ -25,19 +25,25 @@
 # CONFIG_MIPS_MAGNUM_4000 is not set
 # CONFIG_MOMENCO_OCELOT is not set
 CONFIG_DDB5476=y
+# CONFIG_DDB5477 is not set
 # CONFIG_OLIVETTI_M700 is not set
 # CONFIG_SGI_IP22 is not set
 # CONFIG_SNI_RM200_PCI is not set
 # CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_PB1000 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 # CONFIG_MCA is not set
 # CONFIG_SBUS is not set
-CONFIG_I8259=y
 CONFIG_ISA=y
 CONFIG_PCI=y
 CONFIG_PC_KEYB=y
 CONFIG_ROTTEN_IRQ=y
+CONFIG_HAVE_STD_PC_SERIAL_PORT=y
+CONFIG_NEW_TIME_C=y
 CONFIG_EISA=y
+# CONFIG_I8259 is not set
 
 #
 # Loadable module support
@@ -48,26 +54,27 @@
 # CPU selection
 #
 # CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_R3912 is not set
 # CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_VR41XX is not set
 # CONFIG_CPU_R4300 is not set
 # CONFIG_CPU_R4X00 is not set
 # CONFIG_CPU_R5000 is not set
 CONFIG_CPU_R5432=y
 # CONFIG_CPU_RM7000 is not set
 # CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R8000 is not set
 # CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_SB1 is not set
 # CONFIG_CPU_MIPS32 is not set
+# CONFIG_CPU_MIPS64 is not set
 # CONFIG_CPU_ADVANCED is not set
 CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_LLDSCD=y
 # CONFIG_CPU_HAS_WB is not set
 
 #
 # General setup
 #
 CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_MIPS_FPU_EMULATOR=y
 CONFIG_KCORE_ELF=y
 CONFIG_ELF_KERNEL=y
 # CONFIG_BINFMT_AOUT is not set
@@ -75,21 +82,18 @@
 # CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
 # CONFIG_PCI_NAMES is not set
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 
 #
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
-#
 # Plug and Play configuration
 #
 # CONFIG_PNP is not set
 # CONFIG_ISAPNP is not set
-# CONFIG_PCMCIA is not set
+# CONFIG_PNPBIOS is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -97,6 +101,11 @@
 # CONFIG_MTD is not set
 
 #
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -134,6 +143,7 @@
 # CONFIG_IP_MULTICAST is not set
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
 CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IP_PNP_RARP is not set
 # CONFIG_NET_IPIP is not set
@@ -170,6 +180,7 @@
 #
 # CONFIG_PHONE is not set
 # CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
 
 #
 # ATA/IDE/MFM/RLL support
@@ -213,6 +224,7 @@
 CONFIG_BLK_DEV_IDEPCI=y
 # CONFIG_IDEPCI_SHARE_IRQ is not set
 # CONFIG_BLK_DEV_IDEDMA_PCI is not set
+# CONFIG_BLK_DEV_ADMA is not set
 # CONFIG_BLK_DEV_OFFBOARD is not set
 # CONFIG_IDEDMA_PCI_AUTO is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
@@ -222,8 +234,8 @@
 # CONFIG_AEC62XX_TUNING is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
 # CONFIG_WDC_ALI15X3 is not set
-# CONFIG_BLK_DEV_AMD7409 is not set
-# CONFIG_AMD7409_OVERRIDE is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_AMD74XX_OVERRIDE is not set
 # CONFIG_BLK_DEV_CMD64X is not set
 # CONFIG_BLK_DEV_CY82C693 is not set
 # CONFIG_BLK_DEV_CS5530 is not set
@@ -234,7 +246,8 @@
 # CONFIG_BLK_DEV_OPTI621 is not set
 # CONFIG_BLK_DEV_PDC202XX is not set
 # CONFIG_PDC202XX_BURST is not set
-# CONFIG_BLK_DEV_OSB4 is not set
+# CONFIG_PDC202XX_FORCE is not set
+# CONFIG_BLK_DEV_SVWKS is not set
 # CONFIG_BLK_DEV_SIS5513 is not set
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
@@ -243,6 +256,9 @@
 # CONFIG_IDEDMA_AUTO is not set
 # CONFIG_DMA_NONPCI is not set
 # CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_ATARAID is not set
+# CONFIG_BLK_DEV_ATARAID_PDC is not set
+# CONFIG_BLK_DEV_ATARAID_HPT is not set
 
 #
 # SCSI support
@@ -250,16 +266,6 @@
 # CONFIG_SCSI is not set
 
 #
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_PCI is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
 # Network device support
 #
 CONFIG_NETDEVICES=y
@@ -272,12 +278,17 @@
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-# CONFIG_NET_SB1000 is not set
 
 #
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_LANCE is not set
 # CONFIG_NET_VENDOR_SMC is not set
@@ -293,25 +304,28 @@
 # CONFIG_APRICOT is not set
 # CONFIG_CS89x0 is not set
 CONFIG_TULIP=y
+# CONFIG_TULIP_MWI is not set
+# CONFIG_TULIP_MMIO is not set
 # CONFIG_DE4X5 is not set
 # CONFIG_DGRS is not set
 # CONFIG_DM9102 is not set
 CONFIG_EEPRO100=y
-# CONFIG_EEPRO100_PM is not set
 # CONFIG_LNE390 is not set
+# CONFIG_FEALNX is not set
 # CONFIG_NATSEMI is not set
 CONFIG_NE2K_PCI=y
 # CONFIG_NE3210 is not set
 # CONFIG_ES3210 is not set
 # CONFIG_8139TOO is not set
-# CONFIG_RTL8129 is not set
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
 # CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
 # CONFIG_WINBOND_840 is not set
-# CONFIG_HAPPYMEAL is not set
 # CONFIG_LAN_SAA9730 is not set
 # CONFIG_NET_POCKET is not set
 
@@ -319,11 +333,15 @@
 # Ethernet (1000 Mbit)
 #
 # CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 
@@ -346,6 +364,16 @@
 # CONFIG_WAN is not set
 
 #
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
 # ISDN subsystem
 #
 # CONFIG_ISDN is not set
@@ -364,7 +392,8 @@
 CONFIG_SERIAL_CONSOLE=y
 # CONFIG_SERIAL_EXTENDED is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
-# CONFIG_UNIX98_PTYS is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
 
 #
 # I2C support
@@ -383,7 +412,11 @@
 #
 # Joysticks
 #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
 
 #
 # Input core support is needed for joysticks
@@ -400,6 +433,7 @@
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
 
 #
 # Ftape, the floppy tape device driver
@@ -421,22 +455,30 @@
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
 # CONFIG_ADFS_FS is not set
 # CONFIG_ADFS_FS_RW is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
 # CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
 # CONFIG_FAT_FS is not set
 # CONFIG_MSDOS_FS is not set
 # CONFIG_UMSDOS_FS is not set
 # CONFIG_VFAT_FS is not set
 # CONFIG_EFS_FS is not set
 # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
+# CONFIG_TMPFS is not set
 # CONFIG_RAMFS is not set
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_MINIX_FS is not set
+# CONFIG_FREEVXFS_FS is not set
 # CONFIG_NTFS_FS is not set
 # CONFIG_NTFS_RW is not set
 # CONFIG_HPFS_FS is not set
@@ -444,13 +486,12 @@
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVFS_MOUNT is not set
 # CONFIG_DEVFS_DEBUG is not set
-# CONFIG_DEVPTS_FS is not set
+CONFIG_DEVPTS_FS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_QNX4FS_RW is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_EXT2_FS=y
 # CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set
 # CONFIG_UDF_FS is not set
 # CONFIG_UDF_RW is not set
 # CONFIG_UFS_FS is not set
@@ -460,6 +501,7 @@
 # Network File Systems
 #
 # CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
 CONFIG_NFS_FS=y
 # CONFIG_NFS_V3 is not set
 CONFIG_ROOT_NFS=y
@@ -490,7 +532,7 @@
 # Console drivers
 #
 # CONFIG_VGA_CONSOLE is not set
-CONFIG_FB=y
+# CONFIG_MDA_CONSOLE is not set
 
 #
 # Frame-buffer support
@@ -501,11 +543,13 @@
 # CONFIG_FB_CLGEN is not set
 # CONFIG_FB_PM2 is not set
 # CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_E1355 is not set
 # CONFIG_FB_MATROX is not set
 # CONFIG_FB_ATY is not set
+# CONFIG_FB_RADEON is not set
 # CONFIG_FB_ATY128 is not set
-CONFIG_FB_3DFX=y
 # CONFIG_FB_SIS is not set
+CONFIG_FB_3DFX=y
 # CONFIG_FB_VIRTUAL is not set
 # CONFIG_FBCON_ADVANCED is not set
 CONFIG_FBCON_CFB8=y
@@ -527,15 +571,114 @@
 # CONFIG_USB is not set
 
 #
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+#   Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
 # Input core support
 #
 # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
 
 #
 # Kernel hacking
 #
 CONFIG_CROSSCOMPILE=y
 # CONFIG_REMOTE_DEBUG is not set
+# CONFIG_GDB_CONSOLE is not set
 # CONFIG_LL_DEBUG is not set
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_MIPS_UNCACHED is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips/defconfig-ddb5477 linux/arch/mips/defconfig-ddb5477
--- v2.4.9/linux/arch/mips/defconfig-ddb5477	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/defconfig-ddb5477	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,565 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_MIPS=y
+# CONFIG_SMP is not set
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+
+#
+# Machine selection
+#
+# CONFIG_ACER_PICA_61 is not set
+# CONFIG_ALGOR_P4032 is not set
+# CONFIG_BAGET_MIPS is not set
+# CONFIG_DECSTATION is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_NINO is not set
+# CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5476 is not set
+CONFIG_DDB5477=y
+# CONFIG_OLIVETTI_M700 is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_PB1000 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_PCI=y
+CONFIG_NEW_TIME_C=y
+CONFIG_NEW_IRQ=y
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_I8259 is not set
+
+#
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
+# CPU selection
+#
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_R5000 is not set
+CONFIG_CPU_R5432=y
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_SB1 is not set
+# CONFIG_CPU_MIPS32 is not set
+# CONFIG_CPU_MIPS64 is not set
+# CONFIG_CPU_ADVANCED is not set
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_LLDSCD=y
+# CONFIG_CPU_HAS_WB is not set
+
+#
+# General setup
+#
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_KCORE_ELF=y
+CONFIG_ELF_KERNEL=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+CONFIG_NET=y
+# CONFIG_PCI_NAMES is not set
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_BLK_DEV_INITRD is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_MD_RAID1 is not set
+# CONFIG_MD_RAID5 is not set
+# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+# CONFIG_NETLINK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_FILTER is not set
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set
+
+#
+#  
+#
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_LLC is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+# CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#
+# CONFIG_IDE is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI support
+#
+# CONFIG_SCSI is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_ISA is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_APRICOT is not set
+# CONFIG_CS89x0 is not set
+CONFIG_TULIP=y
+# CONFIG_TULIP_MWI is not set
+# CONFIG_TULIP_MMIO is not set
+# CONFIG_DE4X5 is not set
+# CONFIG_DGRS is not set
+# CONFIG_DM9102 is not set
+# CONFIG_EEPRO100 is not set
+# CONFIG_LNE390 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_NE3210 is not set
+# CONFIG_ES3210 is not set
+# CONFIG_8139TOO is not set
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+# CONFIG_WINBOND_840 is not set
+# CONFIG_LAN_SAA9730 is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+CONFIG_SERIAL=y
+CONFIG_SERIAL_CONSOLE=y
+# CONFIG_SERIAL_EXTENDED is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_UNIX98_PTYS is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
+
+#
+# Input core support is needed for joysticks
+#
+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+CONFIG_AUTOFS_FS=y
+CONFIG_AUTOFS4_FS=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
+# CONFIG_FAT_FS is not set
+# CONFIG_MSDOS_FS is not set
+# CONFIG_UMSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_TMPFS is not set
+# CONFIG_RAMFS is not set
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_FREEVXFS_FS is not set
+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+# CONFIG_DEVPTS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+CONFIG_ROOT_NFS=y
+CONFIG_NFSD=y
+# CONFIG_NFSD_V3 is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y
+# CONFIG_SMB_FS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_SMB_NLS is not set
+# CONFIG_NLS is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+#   Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
+# Input core support
+#
+# CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+
+#
+# Kernel hacking
+#
+CONFIG_CROSSCOMPILE=y
+# CONFIG_REMOTE_DEBUG is not set
+# CONFIG_GDB_CONSOLE is not set
+CONFIG_LL_DEBUG=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_MIPS_UNCACHED is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips/defconfig-decstation linux/arch/mips/defconfig-decstation
--- v2.4.9/linux/arch/mips/defconfig-decstation	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/defconfig-decstation	Sun Sep  9 10:43:01 2001
@@ -1,6 +1,8 @@
 #
 # Automatically generated make config: don't edit
 #
+CONFIG_MIPS=y
+# CONFIG_SMP is not set
 
 #
 # Code maturity level options
@@ -13,18 +15,31 @@
 # CONFIG_ACER_PICA_61 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
-# CONFIG_COBALT_MICRO_SERVER is not set
 CONFIG_DECSTATION=y
 # CONFIG_DDB5074 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_NINO is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
 # CONFIG_OLIVETTI_M700 is not set
 # CONFIG_SGI_IP22 is not set
 # CONFIG_SNI_RM200_PCI is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_PB1000 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 # CONFIG_MCA is not set
 # CONFIG_SBUS is not set
 # CONFIG_ISA is not set
 # CONFIG_EISA is not set
 # CONFIG_PCI is not set
+# CONFIG_I8259 is not set
 
 #
 # Loadable module support
@@ -38,15 +53,21 @@
 #
 CONFIG_CPU_R3000=y
 # CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_VR41XX is not set
 # CONFIG_CPU_R4300 is not set
 # CONFIG_CPU_R4X00 is not set
 # CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_RM7000 is not set
 # CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R8000 is not set
 # CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_SB1 is not set
+# CONFIG_CPU_MIPS32 is not set
+# CONFIG_CPU_MIPS64 is not set
 # CONFIG_CPU_ADVANCED is not set
 # CONFIG_CPU_HAS_LLSC is not set
-CONFIG_CPU_HAS_WB=y
+# CONFIG_CPU_HAS_LLDSCD is not set
+# CONFIG_CPU_HAS_WB is not set
 
 #
 # General setup
@@ -58,16 +79,12 @@
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
 CONFIG_TC=y
-# CONFIG_PCMCIA is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -75,6 +92,11 @@
 # CONFIG_MTD is not set
 
 #
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -112,6 +134,7 @@
 # CONFIG_IP_MULTICAST is not set
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
 CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IP_PNP_RARP is not set
 # CONFIG_NET_IPIP is not set
@@ -144,6 +167,13 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+# CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
+
+#
 # SCSI support
 #
 CONFIG_SCSI=y
@@ -178,6 +208,7 @@
 # CONFIG_SCSI_AHA1740 is not set
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_IN2000 is not set
 # CONFIG_SCSI_AM53C974 is not set
@@ -194,6 +225,7 @@
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_NCR_D700 is not set
 # CONFIG_SCSI_NCR53C7xx is not set
 # CONFIG_SCSI_PAS16 is not set
 # CONFIG_SCSI_PCI2000 is not set
@@ -210,12 +242,149 @@
 # Network device support
 #
 CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
-# CONFIG_SLIP is not set
-# CONFIG_PPP 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_SUNLANCE is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_NET_ISA is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_NET_POCKET is not set
 CONFIG_DECLANCE=y
 
 #
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+CONFIG_SERIAL=y
+CONFIG_SERIAL_CONSOLE=y
+# CONFIG_SERIAL_EXTENDED is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
+
+#
+# Input core support is needed for joysticks
+#
+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
 # DECStation Character devices
 #
 # CONFIG_VT is not set
@@ -223,7 +392,8 @@
 # CONFIG_DZ is not set
 CONFIG_ZS=y
 CONFIG_SERIAL_CONSOLE=y
-# CONFIG_UNIX98_PTYS is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
 # CONFIG_RTC is not set
 
 #
@@ -234,22 +404,30 @@
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
 # CONFIG_ADFS_FS is not set
 # CONFIG_ADFS_FS_RW is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
 # CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
 # CONFIG_FAT_FS is not set
 # CONFIG_MSDOS_FS is not set
 # CONFIG_UMSDOS_FS is not set
 # CONFIG_VFAT_FS is not set
 # CONFIG_EFS_FS is not set
 # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
+# CONFIG_TMPFS is not set
 # CONFIG_RAMFS is not set
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_MINIX_FS is not set
+# CONFIG_FREEVXFS_FS is not set
 # CONFIG_NTFS_FS is not set
 # CONFIG_NTFS_RW is not set
 # CONFIG_HPFS_FS is not set
@@ -257,13 +435,12 @@
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVFS_MOUNT is not set
 # CONFIG_DEVFS_DEBUG is not set
-# CONFIG_DEVPTS_FS is not set
+CONFIG_DEVPTS_FS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_QNX4FS_RW is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_EXT2_FS=y
 # CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set
 # CONFIG_UDF_FS is not set
 # CONFIG_UDF_RW is not set
 # CONFIG_UFS_FS is not set
@@ -273,6 +450,7 @@
 # Network File Systems
 #
 # CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_NFS_FS is not set
 # CONFIG_NFS_V3 is not set
 # CONFIG_ROOT_NFS is not set
@@ -305,6 +483,7 @@
 # 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_SGI_PARTITION is not set
 CONFIG_ULTRIX_PARTITION=y
 # CONFIG_SUN_PARTITION is not set
@@ -317,14 +496,114 @@
 # CONFIG_USB is not set
 
 #
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+#   Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
 # Input core support
 #
 # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
 
 #
 # Kernel hacking
 #
 CONFIG_CROSSCOMPILE=y
-# CONFIG_MIPS_FPE_MODULE is not set
 # CONFIG_REMOTE_DEBUG is not set
+# CONFIG_GDB_CONSOLE is not set
+# CONFIG_LL_DEBUG is not set
 # CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_MIPS_UNCACHED is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips/defconfig-ip22 linux/arch/mips/defconfig-ip22
--- v2.4.9/linux/arch/mips/defconfig-ip22	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/defconfig-ip22	Sun Sep  9 10:43:02 2001
@@ -1,6 +1,8 @@
 #
 # Automatically generated make config: don't edit
 #
+CONFIG_MIPS=y
+# CONFIG_SMP is not set
 
 #
 # Code maturity level options
@@ -13,21 +15,37 @@
 # CONFIG_ACER_PICA_61 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
-# CONFIG_COBALT_MICRO_SERVER is not set
 # CONFIG_DECSTATION is not set
 # CONFIG_DDB5074 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_NINO is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
 # CONFIG_OLIVETTI_M700 is not set
 CONFIG_SGI_IP22=y
 # CONFIG_SNI_RM200_PCI is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_PB1000 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 # CONFIG_MCA is not set
 # CONFIG_SBUS is not set
 CONFIG_ARC32=y
+CONFIG_BOARD_SCACHE=y
 CONFIG_PC_KEYB=y
 CONFIG_SGI=y
+CONFIG_NEW_IRQ=y
+CONFIG_OLD_TIME_C=y
 # CONFIG_ISA is not set
 # CONFIG_EISA is not set
 # CONFIG_PCI is not set
+# CONFIG_I8259 is not set
 
 #
 # Loadable module support
@@ -41,14 +59,20 @@
 #
 # CONFIG_CPU_R3000 is not set
 # CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_VR41XX is not set
 # CONFIG_CPU_R4300 is not set
 # CONFIG_CPU_R4X00 is not set
 CONFIG_CPU_R5000=y
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_RM7000 is not set
 # CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R8000 is not set
 # CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_SB1 is not set
+# CONFIG_CPU_MIPS32 is not set
+# CONFIG_CPU_MIPS64 is not set
 # CONFIG_CPU_ADVANCED is not set
 CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_LLDSCD=y
 # CONFIG_CPU_HAS_WB is not set
 
 #
@@ -59,24 +83,26 @@
 CONFIG_ELF_KERNEL=y
 CONFIG_BINFMT_IRIX=y
 CONFIG_FORWARD_KEYBOARD=y
+# CONFIG_ARC_CONSOLE is not set
 # CONFIG_BINFMT_AOUT is not set
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 
 #
-# Parallel port support
+# Memory Technology Devices (MTD)
 #
-# CONFIG_PARPORT is not set
-# CONFIG_PCMCIA is not set
+# CONFIG_MTD is not set
 
 #
-# Memory Technology Devices (MTD)
+# Parallel port support
 #
-# CONFIG_MTD is not set
+# CONFIG_PARPORT is not set
 
 #
 # Block devices
@@ -107,19 +133,24 @@
 # Networking options
 #
 CONFIG_PACKET=y
-# CONFIG_PACKET_MMAP is not set
-# CONFIG_NETLINK is not set
+CONFIG_PACKET_MMAP=y
+CONFIG_NETLINK=y
+CONFIG_RTNETLINK=y
+CONFIG_NETLINK_DEV=y
 # CONFIG_NETFILTER is not set
 # CONFIG_FILTER is not set
 CONFIG_UNIX=y
 CONFIG_INET=y
-# CONFIG_IP_MULTICAST is not set
+CONFIG_IP_MULTICAST=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
 CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IP_PNP_RARP is not set
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
 # CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
 # CONFIG_IPV6 is not set
@@ -148,6 +179,13 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+# CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
+
+#
 # SCSI support
 #
 CONFIG_SCSI=y
@@ -175,7 +213,7 @@
 #
 # SCSI low-level drivers
 #
-CONFIG_SCSI_SGIWD93=y
+CONFIG_SGIWD93_SCSI=y
 # CONFIG_SCSI_7000FASST is not set
 # CONFIG_SCSI_ACARD is not set
 # CONFIG_SCSI_AHA152X is not set
@@ -183,6 +221,7 @@
 # CONFIG_SCSI_AHA1740 is not set
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_IN2000 is not set
 # CONFIG_SCSI_AM53C974 is not set
@@ -199,6 +238,7 @@
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_NCR_D700 is not set
 # CONFIG_SCSI_NCR53C7xx is not set
 # CONFIG_SCSI_PAS16 is not set
 # CONFIG_SCSI_PCI2000 is not set
@@ -215,20 +255,159 @@
 # Network device support
 #
 CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
-# CONFIG_SLIP is not set
-# CONFIG_PPP is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_ETHERTAP is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_NET_ISA is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_NET_POCKET is not set
 CONFIG_SGISEEQ=y
 
 #
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+# CONFIG_SERIAL is not set
+# CONFIG_SERIAL_EXTENDED is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
+
+#
+# Input core support is needed for joysticks
+#
+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
 # SGI Character devices
 #
 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_SGI_NEWPORT_CONSOLE=y
 CONFIG_FONT_8x16=y
-# CONFIG_SGI_PROM_CONSOLE is not set
-# CONFIG_UNIX98_PTYS is not set
+# CONFIG_PSMOUSE is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
 
 #
 # File systems
@@ -238,22 +417,30 @@
 CONFIG_AUTOFS4_FS=y
 # CONFIG_REISERFS_FS is not set
 # CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
 # CONFIG_ADFS_FS is not set
 # CONFIG_ADFS_FS_RW is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
 # CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
 # CONFIG_FAT_FS is not set
 # CONFIG_MSDOS_FS is not set
 # CONFIG_UMSDOS_FS is not set
 # CONFIG_VFAT_FS is not set
 # CONFIG_EFS_FS is not set
 # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
+# CONFIG_TMPFS is not set
 # CONFIG_RAMFS is not set
 CONFIG_ISO9660_FS=y
 # CONFIG_JOLIET is not set
 # CONFIG_MINIX_FS is not set
+# CONFIG_FREEVXFS_FS is not set
 # CONFIG_NTFS_FS is not set
 # CONFIG_NTFS_RW is not set
 # CONFIG_HPFS_FS is not set
@@ -261,13 +448,12 @@
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVFS_MOUNT is not set
 # CONFIG_DEVFS_DEBUG is not set
-# CONFIG_DEVPTS_FS is not set
+CONFIG_DEVPTS_FS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_QNX4FS_RW is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_EXT2_FS=y
 # CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set
 # CONFIG_UDF_FS is not set
 # CONFIG_UDF_RW is not set
 # CONFIG_UFS_FS is not set
@@ -277,6 +463,7 @@
 # Network File Systems
 #
 # CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
 CONFIG_NFS_FS=y
 # CONFIG_NFS_V3 is not set
 CONFIG_ROOT_NFS=y
@@ -309,6 +496,7 @@
 # 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_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
@@ -319,7 +507,7 @@
 # Console drivers
 #
 # CONFIG_VGA_CONSOLE is not set
-# CONFIG_FB is not set
+# CONFIG_MDA_CONSOLE is not set
 
 #
 # Frame-buffer support
@@ -345,13 +533,111 @@
 # CONFIG_USB is not set
 
 #
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+#   Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
 # Input core support
 #
 # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
 
 #
 # Kernel hacking
 #
 CONFIG_CROSSCOMPILE=y
-# CONFIG_MIPS_FPE_MODULE is not set
 # CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_MIPS_UNCACHED is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips/defconfig-it8172 linux/arch/mips/defconfig-it8172
--- v2.4.9/linux/arch/mips/defconfig-it8172	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/defconfig-it8172	Sun Sep  9 10:43:02 2001
@@ -25,6 +25,7 @@
 # CONFIG_MIPS_MAGNUM_4000 is not set
 # CONFIG_MOMENCO_OCELOT is not set
 # CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
 # CONFIG_OLIVETTI_M700 is not set
 # CONFIG_SGI_IP22 is not set
 # CONFIG_SNI_RM200_PCI is not set
@@ -35,11 +36,16 @@
 # CONFIG_IT8172_SCR0 is not set
 # CONFIG_IT8172_SCR1 is not set
 # CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_PB1000 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 # CONFIG_MCA is not set
 # CONFIG_SBUS is not set
 CONFIG_PCI=y
 CONFIG_IT8712=y
 CONFIG_PC_KEYB=y
+CONFIG_NEW_PCI=y
+CONFIG_PCI_AUTO=y
 # CONFIG_ISA is not set
 # CONFIG_EISA is not set
 # CONFIG_I8259 is not set
@@ -55,26 +61,27 @@
 # CPU selection
 #
 # CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_R3912 is not set
 # CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_VR41XX is not set
 # CONFIG_CPU_R4300 is not set
 # CONFIG_CPU_R4X00 is not set
 # CONFIG_CPU_R5000 is not set
 # CONFIG_CPU_R5432 is not set
 # CONFIG_CPU_RM7000 is not set
 CONFIG_CPU_NEVADA=y
-# CONFIG_CPU_R8000 is not set
 # CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_SB1 is not set
 # CONFIG_CPU_MIPS32 is not set
+# CONFIG_CPU_MIPS64 is not set
 # CONFIG_CPU_ADVANCED is not set
 CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_LLDSCD=y
 # CONFIG_CPU_HAS_WB is not set
 
 #
 # General setup
 #
 CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_MIPS_FPU_EMULATOR=y
 CONFIG_KCORE_ELF=y
 CONFIG_ELF_KERNEL=y
 # CONFIG_BINFMT_AOUT is not set
@@ -82,68 +89,87 @@
 # CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
 CONFIG_PCI_NAMES=y
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
 CONFIG_SYSVIPC=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_SYSCTL=y
 
 #
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-# CONFIG_PCMCIA is not set
-
-#
 # Memory Technology Devices (MTD)
 #
 CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_PARTITIONS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_BOOTLDR_PARTS is not set
 
 #
-# Disk-On-Chip Device Drivers
-#
-# CONFIG_MTD_DOC1000 is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOCPROBE is not set
-
+# User Modules And Translation Layers
 #
-# RAM/ROM Device Drivers
-#
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_MTDRAM is not set
+CONFIG_MTD_CHAR=y
+# CONFIG_MTD_BLOCK is not set
+# CONFIG_MTD_BLOCK_RO is not set
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
 
 #
-# Linearly Mapped Flash Device Drivers
+# RAM/ROM/Flash chip drivers
 #
 CONFIG_MTD_CFI=y
+# CONFIG_MTD_CFI_VIRTUAL_ER is not set
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
 CONFIG_MTD_CFI_INTELEXT=y
 # CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_AMDSTD is not set
+# CONFIG_MTD_SHARP is not set
 # CONFIG_MTD_RAM is not set
 # CONFIG_MTD_ROM is not set
 # CONFIG_MTD_JEDEC is not set
+
+#
+# Mapping drivers for chip access
+#
 CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_PHYSMAP_START=8000000
 CONFIG_MTD_PHYSMAP_LEN=2000000
 CONFIG_MTD_PHYSMAP_BUSWIDTH=4
-
-#
-# Drivers for chip mappings
-#
-# CONFIG_MTD_MIXMEM is not set
-# CONFIG_MTD_NORA is not set
-# CONFIG_MTD_OCTAGON is not set
 # CONFIG_MTD_PNC2000 is not set
 # CONFIG_MTD_RPXLITE is not set
+# CONFIG_MTD_SBC_GXX is not set
+# CONFIG_MTD_ELAN_104NC is not set
+# CONFIG_MTD_DBOX2 is not set
+# CONFIG_MTD_CSTM_MIPS_IXX is not set
+# CONFIG_MTD_CFI_FLAGADM is not set
+# CONFIG_MTD_MIXMEM is not set
+# CONFIG_MTD_OCTAGON is not set
 # CONFIG_MTD_VMAX is not set
+# CONFIG_MTD_OCELOT is not set
 
 #
-# User modules and translation layers for MTD devices
+# Self-contained MTD device drivers
 #
-CONFIG_MTD_CHAR=y
-# CONFIG_MTD_BLOCK is not set
-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC1000 is not set
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOCPROBE is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
 
 #
 # Block devices
@@ -182,6 +208,7 @@
 # CONFIG_IP_MULTICAST is not set
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
 CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IP_PNP_RARP is not set
 # CONFIG_NET_IPIP is not set
@@ -218,6 +245,7 @@
 #
 # CONFIG_PHONE is not set
 # CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
 
 #
 # ATA/IDE/MFM/RLL support
@@ -261,6 +289,7 @@
 CONFIG_BLK_DEV_IDEPCI=y
 CONFIG_IDEPCI_SHARE_IRQ=y
 CONFIG_BLK_DEV_IDEDMA_PCI=y
+CONFIG_BLK_DEV_ADMA=y
 # CONFIG_BLK_DEV_OFFBOARD is not set
 CONFIG_IDEDMA_PCI_AUTO=y
 CONFIG_BLK_DEV_IDEDMA=y
@@ -270,8 +299,8 @@
 # CONFIG_AEC62XX_TUNING is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
 # CONFIG_WDC_ALI15X3 is not set
-# CONFIG_BLK_DEV_AMD7409 is not set
-# CONFIG_AMD7409_OVERRIDE is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_AMD74XX_OVERRIDE is not set
 # CONFIG_BLK_DEV_CMD64X is not set
 # CONFIG_BLK_DEV_CY82C693 is not set
 # CONFIG_BLK_DEV_CS5530 is not set
@@ -280,11 +309,14 @@
 # CONFIG_BLK_DEV_HPT366 is not set
 CONFIG_BLK_DEV_IT8172=y
 CONFIG_IT8172_TUNING=y
+CONFIG_BLK_DEV_IT8172=y
+CONFIG_IT8172_TUNING=y
 # CONFIG_BLK_DEV_NS87415 is not set
 # CONFIG_BLK_DEV_OPTI621 is not set
 # CONFIG_BLK_DEV_PDC202XX is not set
 # CONFIG_PDC202XX_BURST is not set
-# CONFIG_BLK_DEV_OSB4 is not set
+# CONFIG_PDC202XX_FORCE is not set
+# CONFIG_BLK_DEV_SVWKS is not set
 # CONFIG_BLK_DEV_SIS5513 is not set
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
@@ -299,12 +331,15 @@
 # CONFIG_BLK_DEV_DTC2278 is not set
 # CONFIG_BLK_DEV_HT6560B is not set
 # CONFIG_BLK_DEV_PDC4030 is not set
-# CONFIG_BLK_DEV_QD6580 is not set
+# CONFIG_BLK_DEV_QD65XX is not set
 # CONFIG_BLK_DEV_UMC8672 is not set
 CONFIG_IDEDMA_AUTO=y
 # CONFIG_IDEDMA_IVB is not set
 # CONFIG_DMA_NONPCI is not set
 CONFIG_BLK_DEV_IDE_MODES=y
+# CONFIG_BLK_DEV_ATARAID is not set
+# CONFIG_BLK_DEV_ATARAID_PDC is not set
+# CONFIG_BLK_DEV_ATARAID_HPT is not set
 
 #
 # SCSI support
@@ -312,16 +347,6 @@
 # CONFIG_SCSI is not set
 
 #
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_PCI is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
 # Network device support
 #
 CONFIG_NETDEVICES=y
@@ -334,18 +359,21 @@
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-# CONFIG_NET_SB1000 is not set
 
 #
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_LANCE is not set
 # CONFIG_NET_VENDOR_SMC is not set
 # CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_AT1700 is not set
-# CONFIG_DEPCA is not set
 # CONFIG_HP100 is not set
 # CONFIG_NET_ISA is not set
 CONFIG_NET_PCI=y
@@ -354,25 +382,28 @@
 # CONFIG_APRICOT is not set
 # CONFIG_CS89x0 is not set
 CONFIG_TULIP=y
+# CONFIG_TULIP_MWI is not set
+# CONFIG_TULIP_MMIO is not set
 # CONFIG_DE4X5 is not set
 # CONFIG_DGRS is not set
 # CONFIG_DM9102 is not set
 # CONFIG_EEPRO100 is not set
-# CONFIG_EEPRO100_PM is not set
 # CONFIG_LNE390 is not set
+# CONFIG_FEALNX is not set
 # CONFIG_NATSEMI is not set
 # CONFIG_NE2K_PCI is not set
 # CONFIG_NE3210 is not set
 # CONFIG_ES3210 is not set
 CONFIG_8139TOO=y
-# CONFIG_RTL8129 is not set
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
 # CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
 # CONFIG_WINBOND_840 is not set
-# CONFIG_HAPPYMEAL is not set
 # CONFIG_LAN_SAA9730 is not set
 # CONFIG_NET_POCKET is not set
 
@@ -380,11 +411,15 @@
 # Ethernet (1000 Mbit)
 #
 # CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 
@@ -407,6 +442,16 @@
 # CONFIG_WAN is not set
 
 #
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
 # ISDN subsystem
 #
 # CONFIG_ISDN is not set
@@ -424,7 +469,12 @@
 CONFIG_SERIAL_CONSOLE=y
 # CONFIG_SERIAL_EXTENDED is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
-# CONFIG_UNIX98_PTYS is not set
+CONFIG_QTRONIX_KEYBOARD=y
+CONFIG_IT8172_CIR=y
+# CONFIG_IT8172_SCR0 is not set
+# CONFIG_IT8172_SCR1 is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
 
 #
 # I2C support
@@ -440,7 +490,11 @@
 #
 # Joysticks
 #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
 
 #
 # Input core support is needed for joysticks
@@ -457,6 +511,7 @@
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
 
 #
 # Ftape, the floppy tape device driver
@@ -464,6 +519,7 @@
 # CONFIG_FTAPE is not set
 # CONFIG_AGP is not set
 # CONFIG_DRM is not set
+# CONFIG_ITE_GPIO is not set
 
 #
 # Multimedia devices
@@ -478,22 +534,30 @@
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
 # CONFIG_ADFS_FS is not set
 # CONFIG_ADFS_FS_RW is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
 # CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
 # CONFIG_FAT_FS is not set
 # CONFIG_MSDOS_FS is not set
 # CONFIG_UMSDOS_FS is not set
 # CONFIG_VFAT_FS is not set
 # CONFIG_EFS_FS is not set
 # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
+# CONFIG_TMPFS is not set
 # CONFIG_RAMFS is not set
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_MINIX_FS is not set
+# CONFIG_FREEVXFS_FS is not set
 # CONFIG_NTFS_FS is not set
 # CONFIG_NTFS_RW is not set
 # CONFIG_HPFS_FS is not set
@@ -501,13 +565,12 @@
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVFS_MOUNT is not set
 # CONFIG_DEVFS_DEBUG is not set
-# CONFIG_DEVPTS_FS is not set
+CONFIG_DEVPTS_FS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_QNX4FS_RW is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_EXT2_FS=y
 # CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set
 # CONFIG_UDF_FS is not set
 # CONFIG_UDF_RW is not set
 # CONFIG_UFS_FS is not set
@@ -517,6 +580,7 @@
 # Network File Systems
 #
 # CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
 CONFIG_NFS_FS=y
 # CONFIG_NFS_V3 is not set
 CONFIG_ROOT_NFS=y
@@ -554,16 +618,114 @@
 # CONFIG_USB is not set
 
 #
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+#   Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
 # Input core support
 #
 # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
 
 #
 # Kernel hacking
 #
 CONFIG_CROSSCOMPILE=y
-# CONFIG_MIPS_FPE_MODULE is not set
 # CONFIG_REMOTE_DEBUG is not set
+# CONFIG_GDB_CONSOLE is not set
 # CONFIG_LL_DEBUG is not set
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_MIPS_UNCACHED is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips/defconfig-malta linux/arch/mips/defconfig-malta
--- v2.4.9/linux/arch/mips/defconfig-malta	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/defconfig-malta	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,630 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_MIPS=y
+# CONFIG_SMP is not set
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+
+#
+# Machine selection
+#
+# CONFIG_ACER_PICA_61 is not set
+# CONFIG_ALGOR_P4032 is not set
+# CONFIG_BAGET_MIPS is not set
+# CONFIG_DECSTATION is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_ATLAS is not set
+CONFIG_MIPS_MALTA=y
+# CONFIG_NINO is not set
+# CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_OLIVETTI_M700 is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_PB1000 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
+CONFIG_I8259=y
+CONFIG_PCI=y
+CONFIG_HAVE_STD_PC_SERIAL_PORT=y
+CONFIG_NEW_IRQ=y
+CONFIG_SWAP_IO_SPACE=y
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+
+#
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
+# CPU selection
+#
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_CPU_MIPS32=y
+# CONFIG_CPU_MIPS64 is not set
+# CONFIG_CPU_ADVANCED is not set
+CONFIG_CPU_HAS_LLSC=y
+# CONFIG_CPU_HAS_LLDSCD is not set
+# CONFIG_CPU_HAS_WB is not set
+
+#
+# General setup
+#
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_KCORE_ELF=y
+CONFIG_ELF_KERNEL=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+CONFIG_NET=y
+# CONFIG_PCI_NAMES is not set
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_SYSCTL is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_FD=y
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=4096
+# CONFIG_BLK_DEV_INITRD is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_MD_RAID1 is not set
+# CONFIG_MD_RAID5 is not set
+# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking options
+#
+# CONFIG_PACKET is not set
+# CONFIG_NETLINK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_FILTER is not set
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set
+
+#
+#  
+#
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_LLC is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+# CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#
+# CONFIG_IDE is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI support
+#
+CONFIG_SCSI=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+CONFIG_SD_EXTRA_DEVS=40
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_DEBUG_QUEUES is not set
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_7000FASST is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AHA152X is not set
+# CONFIG_SCSI_AHA1542 is not set
+# CONFIG_SCSI_AHA1740 is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_IN2000 is not set
+# CONFIG_SCSI_AM53C974 is not set
+# CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_CPQFCTS is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_EATA_DMA 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_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_NCR_D700 is not set
+# CONFIG_SCSI_NCR53C7xx is not set
+# CONFIG_SCSI_NCR53C8XX is not set
+# CONFIG_SCSI_SYM53C8XX is not set
+# CONFIG_SCSI_PAS16 is not set
+# CONFIG_SCSI_PCI2000 is not set
+# CONFIG_SCSI_PCI2220I is not set
+# CONFIG_SCSI_PSI240I is not set
+# CONFIG_SCSI_QLOGIC_FAS is not set
+# CONFIG_SCSI_QLOGIC_ISP is not set
+# CONFIG_SCSI_QLOGIC_FC is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_SIM710 is not set
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_ISA is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=y
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_APRICOT is not set
+# CONFIG_CS89x0 is not set
+# CONFIG_TULIP is not set
+# CONFIG_DE4X5 is not set
+# CONFIG_DGRS is not set
+# CONFIG_DM9102 is not set
+# CONFIG_EEPRO100 is not set
+# CONFIG_LNE390 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_NE3210 is not set
+# CONFIG_ES3210 is not set
+# CONFIG_8139TOO is not set
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+# CONFIG_WINBOND_840 is not set
+# CONFIG_LAN_SAA9730 is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+CONFIG_SERIAL=y
+CONFIG_SERIAL_CONSOLE=y
+# CONFIG_SERIAL_EXTENDED is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
+
+#
+# Input core support is needed for joysticks
+#
+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+CONFIG_RTC=y
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+CONFIG_AUTOFS_FS=y
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
+# CONFIG_FAT_FS is not set
+# CONFIG_MSDOS_FS is not set
+# CONFIG_UMSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+CONFIG_EFS_FS=y
+# CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_TMPFS is not set
+# CONFIG_RAMFS is not set
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_FREEVXFS_FS is not set
+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y
+# CONFIG_SMB_FS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_SMB_NLS is not set
+# CONFIG_NLS is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+#   Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
+# Input core support
+#
+# CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+
+#
+# Kernel hacking
+#
+CONFIG_CROSSCOMPILE=y
+# CONFIG_REMOTE_DEBUG is not set
+# CONFIG_GDB_CONSOLE is not set
+# CONFIG_LL_DEBUG is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_MIPS_UNCACHED is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips/defconfig-nino linux/arch/mips/defconfig-nino
--- v2.4.9/linux/arch/mips/defconfig-nino	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/defconfig-nino	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,415 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_MIPS=y
+# CONFIG_SMP is not set
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+
+#
+# Machine selection
+#
+# CONFIG_ACER_PICA_61 is not set
+# CONFIG_ALGOR_P4032 is not set
+# CONFIG_BAGET_MIPS is not set
+# CONFIG_DECSTATION is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+CONFIG_NINO=y
+# CONFIG_NINO_4MB is not set
+CONFIG_NINO_8MB=y
+# CONFIG_NINO_16MB is not set
+# CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_OLIVETTI_M700 is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_PB1000 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
+CONFIG_PC_KEYB=y
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_PCI is not set
+# CONFIG_I8259 is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
+# CPU selection
+#
+CONFIG_CPU_R3000=y
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_SB1 is not set
+# CONFIG_CPU_MIPS32 is not set
+# CONFIG_CPU_MIPS64 is not set
+# CONFIG_CPU_ADVANCED is not set
+# CONFIG_CPU_HAS_LLSC is not set
+# CONFIG_CPU_HAS_LLDSCD is not set
+# CONFIG_CPU_HAS_WB is not set
+
+#
+# General setup
+#
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_KCORE_ELF=y
+CONFIG_ELF_KERNEL=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=y
+# CONFIG_NET is not set
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_SYSCTL is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=2048
+CONFIG_BLK_DEV_INITRD=y
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_MD_RAID1 is not set
+# CONFIG_MD_RAID5 is not set
+# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+# CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#
+# CONFIG_IDE is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI support
+#
+# CONFIG_SCSI is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# ISDN subsystem
+#
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL is not set
+# CONFIG_SERIAL_EXTENDED is not set
+CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_COMPUTONE is not set
+# CONFIG_ROCKETPORT is not set
+# CONFIG_CYCLADES is not set
+# CONFIG_DIGIEPCA is not set
+# CONFIG_DIGI is not set
+# CONFIG_ESPSERIAL is not set
+# CONFIG_MOXA_INTELLIO is not set
+# CONFIG_MOXA_SMARTIO is not set
+# CONFIG_ISI is not set
+# CONFIG_SYNCLINK is not set
+# CONFIG_N_HDLC is not set
+# CONFIG_RISCOM8 is not set
+# CONFIG_SPECIALIX is not set
+# CONFIG_SX is not set
+# CONFIG_RIO is not set
+# CONFIG_STALDRV is not set
+CONFIG_SERIAL_TX3912=y
+CONFIG_SERIAL_TX3912_CONSOLE=y
+# CONFIG_AU1000_UART is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
+
+#
+# Input core support is needed for joysticks
+#
+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
+# CONFIG_FAT_FS is not set
+# CONFIG_MSDOS_FS is not set
+# CONFIG_UMSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_TMPFS is not set
+# CONFIG_RAMFS is not set
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_FREEVXFS_FS is not set
+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_SMB_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_SMB_NLS is not set
+# CONFIG_NLS is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+#   Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# USB Network adaptors
+#
+
+#
+#   Networking support is needed for USB Networking device support
+#
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
+# Input core support
+#
+# CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+
+#
+# Kernel hacking
+#
+CONFIG_CROSSCOMPILE=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_MIPS_UNCACHED is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips/defconfig-ocelot linux/arch/mips/defconfig-ocelot
--- v2.4.9/linux/arch/mips/defconfig-ocelot	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/defconfig-ocelot	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,566 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_MIPS=y
+# CONFIG_SMP is not set
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+
+#
+# Machine selection
+#
+# CONFIG_ACER_PICA_61 is not set
+# CONFIG_ALGOR_P4032 is not set
+# CONFIG_BAGET_MIPS is not set
+# CONFIG_DECSTATION is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_NINO is not set
+# CONFIG_MIPS_MAGNUM_4000 is not set
+CONFIG_MOMENCO_OCELOT=y
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_OLIVETTI_M700 is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_PB1000 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
+CONFIG_PCI=y
+CONFIG_SYSCLK_100=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_NEW_IRQ=y
+CONFIG_OLD_TIME_C=y
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_I8259 is not set
+
+#
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
+# CPU selection
+#
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+CONFIG_CPU_RM7000=y
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_SB1 is not set
+# CONFIG_CPU_MIPS32 is not set
+# CONFIG_CPU_MIPS64 is not set
+# CONFIG_CPU_ADVANCED is not set
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_LLDSCD=y
+# CONFIG_CPU_HAS_WB is not set
+
+#
+# General setup
+#
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+CONFIG_KCORE_ELF=y
+CONFIG_ELF_KERNEL=y
+# CONFIG_BINFMT_IRIX is not set
+# CONFIG_FORWARD_KEYBOARD is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+CONFIG_NET=y
+CONFIG_PCI_NAMES=y
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_BLK_DEV_INITRD is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_MD_RAID1 is not set
+# CONFIG_MD_RAID5 is not set
+# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking options
+#
+# CONFIG_PACKET is not set
+# CONFIG_NETLINK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_FILTER is not set
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set
+
+#
+#  
+#
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_LLC is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+# CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#
+# CONFIG_IDE is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI support
+#
+# CONFIG_SCSI is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_ISA is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_APRICOT is not set
+# CONFIG_CS89x0 is not set
+# CONFIG_TULIP is not set
+# CONFIG_DE4X5 is not set
+# CONFIG_DGRS is not set
+# CONFIG_DM9102 is not set
+CONFIG_EEPRO100=y
+# CONFIG_LNE390 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_NE3210 is not set
+# CONFIG_ES3210 is not set
+# CONFIG_8139TOO is not set
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+# CONFIG_WINBOND_840 is not set
+# CONFIG_LAN_SAA9730 is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+CONFIG_SERIAL=y
+CONFIG_SERIAL_CONSOLE=y
+# CONFIG_SERIAL_EXTENDED is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
+
+#
+# Input core support is needed for joysticks
+#
+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
+# CONFIG_FAT_FS is not set
+# CONFIG_MSDOS_FS is not set
+# CONFIG_UMSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_TMPFS is not set
+# CONFIG_RAMFS is not set
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_FREEVXFS_FS is not set
+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+CONFIG_ROOT_NFS=y
+CONFIG_NFSD=y
+# CONFIG_NFSD_V3 is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y
+# CONFIG_SMB_FS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_SMB_NLS is not set
+# CONFIG_NLS is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+#   Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
+# Input core support
+#
+# CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+
+#
+# Kernel hacking
+#
+CONFIG_CROSSCOMPILE=y
+# CONFIG_REMOTE_DEBUG is not set
+# CONFIG_GDB_CONSOLE is not set
+# CONFIG_LL_DEBUG is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_MIPS_UNCACHED is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips/defconfig-orion linux/arch/mips/defconfig-orion
--- v2.4.9/linux/arch/mips/defconfig-orion	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/defconfig-orion	Wed Dec 31 16:00:00 1969
@@ -1,304 +0,0 @@
-#
-# Automatically generated make config: don't edit
-#
-
-#
-# Code maturity level options
-#
-CONFIG_EXPERIMENTAL=y
-
-#
-# Machine selection
-#
-# CONFIG_ACER_PICA_61 is not set
-# CONFIG_ALGOR_P4032 is not set
-# CONFIG_BAGET_MIPS is not set
-# CONFIG_COBALT_MICRO_SERVER is not set
-# CONFIG_DECSTATION is not set
-# CONFIG_DDB5074 is not set
-# CONFIG_MIPS_MAGNUM_4000 is not set
-# CONFIG_OLIVETTI_M700 is not set
-# CONFIG_SGI_IP22 is not set
-# CONFIG_SNI_RM200_PCI is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-# CONFIG_PCI is not set
-
-#
-# Loadable module support
-#
-# CONFIG_MODULES is not set
-
-#
-# CPU selection
-#
-# CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_R6000 is not set
-# CONFIG_CPU_R4300 is not set
-# CONFIG_CPU_R4X00 is not set
-CONFIG_CPU_R5000=y
-# CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R8000 is not set
-# CONFIG_CPU_R10000 is not set
-# CONFIG_CPU_ADVANCED is not set
-CONFIG_CPU_HAS_LLSC=y
-# CONFIG_CPU_HAS_WB is not set
-
-#
-# General setup
-#
-# CONFIG_CPU_LITTLE_ENDIAN is not set
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
-# CONFIG_BINFMT_IRIX is not set
-# CONFIG_FORWARD_KEYBOARD is not set
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
-CONFIG_NET=y
-# CONFIG_SYSVIPC is not set
-# CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_SYSCTL is not set
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-# CONFIG_PCMCIA is not set
-
-#
-# Memory Technology Devices (MTD)
-#
-# CONFIG_MTD is not set
-
-#
-# Block devices
-#
-# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_XD is not set
-# CONFIG_PARIDE is not set
-# CONFIG_BLK_CPQ_DA is not set
-# CONFIG_BLK_CPQ_CISS_DA is not set
-# CONFIG_BLK_DEV_DAC960 is not set
-# CONFIG_BLK_DEV_LOOP is not set
-# CONFIG_BLK_DEV_NBD is not set
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_INITRD=y
-
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-# CONFIG_BLK_DEV_MD is not set
-# CONFIG_MD_LINEAR is not set
-# CONFIG_MD_RAID0 is not set
-# CONFIG_MD_RAID1 is not set
-# CONFIG_MD_RAID5 is not set
-# CONFIG_BLK_DEV_LVM is not set
-
-#
-# Networking options
-#
-# CONFIG_PACKET is not set
-# CONFIG_NETLINK is not set
-# CONFIG_NETFILTER is not set
-# CONFIG_FILTER is not set
-# CONFIG_UNIX is not set
-# CONFIG_INET is not set
-# CONFIG_ATM is not set
-
-#
-#  
-#
-# CONFIG_IPX is not set
-# CONFIG_ATALK is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_LLC is not set
-# CONFIG_NET_DIVERT is not set
-# CONFIG_ECONET_AUNUDP is not set
-# CONFIG_ECONET_NATIVE 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
-
-#
-# Telephony Support
-#
-# CONFIG_PHONE is not set
-# CONFIG_PHONE_IXJ is not set
-
-#
-# ATA/IDE/MFM/RLL support
-#
-# CONFIG_IDE is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
-# CONFIG_BLK_DEV_HD is not set
-
-#
-# SCSI support
-#
-# CONFIG_SCSI is not set
-
-#
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
-# Network device support
-#
-# CONFIG_NETDEVICES is not set
-
-#
-# Character devices
-#
-# CONFIG_VT is not set
-# CONFIG_SERIAL is not set
-# CONFIG_SERIAL_EXTENDED is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
-# CONFIG_UNIX98_PTYS is not set
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
-# CONFIG_MOUSE is not set
-
-#
-# Joysticks
-#
-# CONFIG_JOYSTICK is not set
-
-#
-# Input core support is needed for joysticks
-#
-# CONFIG_QIC02_TAPE is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
-# CONFIG_NVRAM is not set
-# CONFIG_RTC is not set
-# CONFIG_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
-
-#
-# Multimedia devices
-#
-# CONFIG_VIDEO_DEV is not set
-
-#
-# File systems
-#
-# CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_REISERFS_FS is not set
-# CONFIG_REISERFS_CHECK is not set
-# CONFIG_ADFS_FS is not set
-# CONFIG_ADFS_FS_RW is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_FAT_FS is not set
-# CONFIG_MSDOS_FS is not set
-# CONFIG_UMSDOS_FS is not set
-# CONFIG_VFAT_FS is not set
-# CONFIG_EFS_FS is not set
-# CONFIG_JFFS_FS is not set
-# CONFIG_CRAMFS is not set
-CONFIG_RAMFS=y
-# CONFIG_ISO9660_FS is not set
-# CONFIG_JOLIET is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_NTFS_FS is not set
-# CONFIG_NTFS_RW is not set
-# CONFIG_HPFS_FS is not set
-CONFIG_PROC_FS=y
-# CONFIG_DEVFS_FS is not set
-# CONFIG_DEVFS_MOUNT is not set
-# CONFIG_DEVFS_DEBUG is not set
-# CONFIG_DEVPTS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_QNX4FS_RW is not set
-# CONFIG_ROMFS_FS is not set
-CONFIG_EXT2_FS=y
-# CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set
-# CONFIG_UDF_FS is not set
-# CONFIG_UDF_RW is not set
-# CONFIG_UFS_FS is not set
-# CONFIG_UFS_FS_WRITE is not set
-
-#
-# Network File Systems
-#
-# CONFIG_CODA_FS is not set
-# CONFIG_NFS_FS is not set
-# CONFIG_NFS_V3 is not set
-# CONFIG_ROOT_NFS is not set
-# CONFIG_NFSD is not set
-# CONFIG_NFSD_V3 is not set
-# CONFIG_SUNRPC is not set
-# CONFIG_LOCKD is not set
-# CONFIG_SMB_FS is not set
-# CONFIG_NCPFS_NLS is not set
-
-#
-# Partition Types
-#
-# CONFIG_PARTITION_ADVANCED is not set
-CONFIG_MSDOS_PARTITION=y
-# CONFIG_SMB_NLS is not set
-# CONFIG_NLS is not set
-
-#
-# Sound
-#
-# CONFIG_SOUND is not set
-
-#
-# USB support
-#
-# CONFIG_USB is not set
-
-#
-# Input core support
-#
-# CONFIG_INPUT is not set
-
-#
-# Kernel hacking
-#
-CONFIG_CROSSCOMPILE=y
-# CONFIG_MAGIC_SYSRQ is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips/defconfig-pb1000 linux/arch/mips/defconfig-pb1000
--- v2.4.9/linux/arch/mips/defconfig-pb1000	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/defconfig-pb1000	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,565 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_MIPS=y
+# CONFIG_SMP is not set
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+
+#
+# Machine selection
+#
+# CONFIG_ACER_PICA_61 is not set
+# CONFIG_ALGOR_P4032 is not set
+# CONFIG_BAGET_MIPS is not set
+# CONFIG_DECSTATION is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_NINO is not set
+# CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_OLIVETTI_M700 is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MIPS_IVR is not set
+CONFIG_MIPS_PB1000=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
+CONFIG_MIPS_AU1000=y
+CONFIG_NEW_IRQ=y
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_PCI is not set
+# CONFIG_I8259 is not set
+
+#
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
+# CPU selection
+#
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_CPU_MIPS32=y
+# CONFIG_CPU_MIPS64 is not set
+CONFIG_CPU_ADVANCED=y
+CONFIG_CPU_HAS_LLSC=y
+# CONFIG_CPU_HAS_LLDSCD is not set
+CONFIG_CPU_HAS_WB=y
+
+#
+# General setup
+#
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_KCORE_ELF=y
+CONFIG_ELF_KERNEL=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+CONFIG_NET=y
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_BLK_DEV_INITRD is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_MD_RAID1 is not set
+# CONFIG_MD_RAID5 is not set
+# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+# CONFIG_NETLINK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_FILTER is not set
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set
+
+#
+#  
+#
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_LLC is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+# CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#
+# CONFIG_IDE is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI support
+#
+# CONFIG_SCSI is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MIPS_AU1000_ENET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_NET_ISA is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL is not set
+# CONFIG_SERIAL_EXTENDED is not set
+CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_COMPUTONE is not set
+# CONFIG_ROCKETPORT is not set
+# CONFIG_CYCLADES is not set
+# CONFIG_DIGIEPCA is not set
+# CONFIG_DIGI is not set
+# CONFIG_ESPSERIAL is not set
+# CONFIG_MOXA_INTELLIO is not set
+# CONFIG_MOXA_SMARTIO is not set
+# CONFIG_SYNCLINK is not set
+# CONFIG_N_HDLC is not set
+# CONFIG_RISCOM8 is not set
+# CONFIG_SPECIALIX is not set
+# CONFIG_SX is not set
+# CONFIG_RIO is not set
+# CONFIG_STALDRV is not set
+# CONFIG_SERIAL_TX3912 is not set
+# CONFIG_SERIAL_TX3912_CONSOLE is not set
+CONFIG_AU1000_UART=y
+CONFIG_AU1000_SERIAL_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
+
+#
+# Input core support is needed for joysticks
+#
+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+CONFIG_AUTOFS_FS=y
+CONFIG_AUTOFS4_FS=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
+# CONFIG_FAT_FS is not set
+# CONFIG_MSDOS_FS is not set
+# CONFIG_UMSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_TMPFS is not set
+# CONFIG_RAMFS is not set
+CONFIG_ISO9660_FS=y
+# CONFIG_JOLIET is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_FREEVXFS_FS is not set
+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+# CONFIG_DEVPTS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y
+# CONFIG_SMB_FS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_SMB_NLS is not set
+# CONFIG_NLS is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+#   Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
+# Input core support
+#
+# CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+
+#
+# Kernel hacking
+#
+CONFIG_CROSSCOMPILE=y
+# CONFIG_REMOTE_DEBUG is not set
+# CONFIG_GDB_CONSOLE is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_MIPS_UNCACHED is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips/defconfig-rm200 linux/arch/mips/defconfig-rm200
--- v2.4.9/linux/arch/mips/defconfig-rm200	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/defconfig-rm200	Sun Sep  9 10:43:02 2001
@@ -1,6 +1,8 @@
 #
 # Automatically generated make config: don't edit
 #
+CONFIG_MIPS=y
+# CONFIG_SMP is not set
 
 #
 # Code maturity level options
@@ -13,19 +15,34 @@
 # CONFIG_ACER_PICA_61 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
-# CONFIG_COBALT_MICRO_SERVER is not set
 # CONFIG_DECSTATION is not set
 # CONFIG_DDB5074 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_NINO is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
 # CONFIG_OLIVETTI_M700 is not set
 # CONFIG_SGI_IP22 is not set
 CONFIG_SNI_RM200_PCI=y
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_PB1000 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 # CONFIG_MCA is not set
 # CONFIG_SBUS is not set
 CONFIG_ARC32=y
-CONFIG_PCI=y
+CONFIG_I8259=y
 CONFIG_ISA=y
 CONFIG_PC_KEYB=y
+CONFIG_PCI=y
+CONFIG_ROTTEN_IRQ=y
+CONFIG_OLD_TIME_C=y
 CONFIG_EISA=y
 
 #
@@ -40,14 +57,20 @@
 #
 # CONFIG_CPU_R3000 is not set
 # CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_VR41XX is not set
 # CONFIG_CPU_R4300 is not set
 # CONFIG_CPU_R4X00 is not set
 CONFIG_CPU_R5000=y
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_RM7000 is not set
 # CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R8000 is not set
 # CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_SB1 is not set
+# CONFIG_CPU_MIPS32 is not set
+# CONFIG_CPU_MIPS64 is not set
 # CONFIG_CPU_ADVANCED is not set
 CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_LLDSCD=y
 # CONFIG_CPU_HAS_WB is not set
 
 #
@@ -56,26 +79,24 @@
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_KCORE_ELF=y
 CONFIG_ELF_KERNEL=y
+# CONFIG_ARC_CONSOLE is not set
 # CONFIG_BINFMT_AOUT is not set
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
 # CONFIG_PCI_NAMES is not set
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
 # CONFIG_SYSVIPC is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 
 #
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
-#
 # Plug and Play configuration
 #
 # CONFIG_PNP is not set
 # CONFIG_ISAPNP is not set
-# CONFIG_PCMCIA is not set
+# CONFIG_PNPBIOS is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -83,6 +104,11 @@
 # CONFIG_MTD is not set
 
 #
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
 # Block devices
 #
 CONFIG_BLK_DEV_FD=y
@@ -154,6 +180,7 @@
 #
 # CONFIG_PHONE is not set
 # CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
 
 #
 # ATA/IDE/MFM/RLL support
@@ -168,19 +195,19 @@
 # CONFIG_SCSI is not set
 
 #
-# I2O device support
+# Network device support
 #
-# CONFIG_I2O is not set
-# CONFIG_I2O_PCI is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
+# CONFIG_NETDEVICES is not set
 
 #
-# Network device support
+# Amateur Radio support
 #
-# CONFIG_NETDEVICES is not set
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
 
 #
 # ISDN subsystem
@@ -200,7 +227,8 @@
 # CONFIG_SERIAL is not set
 # CONFIG_SERIAL_EXTENDED is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
-# CONFIG_UNIX98_PTYS is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
 
 #
 # I2C support
@@ -216,7 +244,11 @@
 #
 # Joysticks
 #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
 
 #
 # Input core support is needed for joysticks
@@ -233,6 +265,7 @@
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
 
 #
 # Ftape, the floppy tape device driver
@@ -254,22 +287,30 @@
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
 # CONFIG_ADFS_FS is not set
 # CONFIG_ADFS_FS_RW is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
 # CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
 # CONFIG_FAT_FS is not set
 # CONFIG_MSDOS_FS is not set
 # CONFIG_UMSDOS_FS is not set
 # CONFIG_VFAT_FS is not set
 # CONFIG_EFS_FS is not set
 # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
+# CONFIG_TMPFS is not set
 # CONFIG_RAMFS is not set
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_MINIX_FS is not set
+# CONFIG_FREEVXFS_FS is not set
 # CONFIG_NTFS_FS is not set
 # CONFIG_NTFS_RW is not set
 # CONFIG_HPFS_FS is not set
@@ -277,13 +318,12 @@
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVFS_MOUNT is not set
 # CONFIG_DEVFS_DEBUG is not set
-# CONFIG_DEVPTS_FS is not set
+CONFIG_DEVPTS_FS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_QNX4FS_RW is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_EXT2_FS=y
 # CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set
 # CONFIG_UDF_FS is not set
 # CONFIG_UDF_RW is not set
 # CONFIG_UFS_FS is not set
@@ -293,6 +333,7 @@
 # Network File Systems
 #
 # CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_NFS_FS is not set
 # CONFIG_NFS_V3 is not set
 # CONFIG_ROOT_NFS is not set
@@ -325,6 +366,7 @@
 # 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_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
@@ -335,7 +377,7 @@
 # Console drivers
 #
 CONFIG_VGA_CONSOLE=y
-# CONFIG_FB is not set
+# CONFIG_MDA_CONSOLE is not set
 
 #
 # Frame-buffer support
@@ -353,13 +395,111 @@
 # CONFIG_USB is not set
 
 #
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+#   Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
 # Input core support
 #
 # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
 
 #
 # Kernel hacking
 #
 CONFIG_CROSSCOMPILE=y
-# CONFIG_MIPS_FPE_MODULE is not set
 # CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_MIPS_UNCACHED is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips/gt64120/common/Makefile linux/arch/mips/gt64120/common/Makefile
--- v2.4.9/linux/arch/mips/gt64120/common/Makefile	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/gt64120/common/Makefile	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,18 @@
+#
+# Makefile for common code of gt64120-based boards.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+
+.S.s:
+	$(CPP) $(CFLAGS) $< -o $*.s
+.S.o:
+	$(CC) $(CFLAGS) -c $< -o $*.o
+
+O_TARGET:= gt64120.o
+
+obj-y	 := gt_irq.o pci.o
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/mips/gt64120/common/gt_irq.c linux/arch/mips/gt64120/common/gt_irq.c
--- v2.4.9/linux/arch/mips/gt64120/common/gt_irq.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/gt64120/common/gt_irq.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,250 @@
+/*
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: jsun@mvista.com or jsun@junsun.net
+ *
+ * arch/mips/gt64120/common/gt_irq.c
+ *     Interrupt routines for gt64120.  Currently it only handles timer irq.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
+#include <asm/ptrace.h>
+#include <linux/config.h>
+#include <linux/sched.h>
+#include <linux/kernel_stat.h>
+#include <asm/io.h>
+#include <asm/gt64120/gt64120.h>
+
+/*
+ * These are interrupt handlers for the GT on-chip interrupts.  They
+ * all come in to the MIPS on a single interrupt line, and have to
+ * be handled and ack'ed differently than other MIPS interrupts.
+ */
+
+#if CURRENTLY_UNUSED
+
+struct tq_struct irq_handlers[MAX_CAUSE_REGS][MAX_CAUSE_REG_WIDTH];
+void hook_irq_handler(int int_cause, int bit_num, void *isr_ptr);
+
+/*
+ * Hooks IRQ handler to the system. When the system is interrupted
+ * the interrupt service routine is called.
+ *
+ * Inputs :
+ * int_cause - The interrupt cause number. In EVB64120 two parameters 
+ *             are declared, INT_CAUSE_MAIN and INT_CAUSE_HIGH. 
+ * bit_num   - Indicates which bit number in the cause register
+ * isr_ptr   - Pointer to the interrupt service routine
+ */
+void hook_irq_handler(int int_cause, int bit_num, void *isr_ptr)
+{
+	irq_handlers[int_cause][bit_num].routine = isr_ptr;
+}
+
+
+/*
+ * Enables the IRQ on Galileo Chip
+ *
+ * Inputs :
+ * int_cause - The interrupt cause number. In EVB64120 two parameters 
+ *             are declared, INT_CAUSE_MAIN and INT_CAUSE_HIGH.
+ * bit_num   - Indicates which bit number in the cause register
+ *
+ * Outputs :
+ * 1 if succesful, 0 if failure
+ */
+int enable_galileo_irq(int int_cause, int bit_num)
+{
+	if (int_cause == INT_CAUSE_MAIN)
+		SET_REG_BITS(CPU_INTERRUPT_MASK_REGISTER, (1 << bit_num));
+	else if (int_cause == INT_CAUSE_HIGH)
+		SET_REG_BITS(CPU_HIGH_INTERRUPT_MASK_REGISTER,
+			     (1 << bit_num));
+	else
+		return 0;
+
+	return 1;
+}
+
+/*
+ * Disables the IRQ on Galileo Chip
+ *
+ * Inputs :
+ * int_cause - The interrupt cause number. In EVB64120 two parameters 
+ *             are declared, INT_CAUSE_MAIN and INT_CAUSE_HIGH.
+ * bit_num   - Indicates which bit number in the cause register
+ *
+ * Outputs :
+ * 1 if succesful, 0 if failure
+ */
+int disable_galileo_irq(int int_cause, int bit_num)
+{
+	if (int_cause == INT_CAUSE_MAIN)
+		RESET_REG_BITS(CPU_INTERRUPT_MASK_REGISTER,
+			       (1 << bit_num));
+	else if (int_cause == INT_CAUSE_HIGH)
+		RESET_REG_BITS(CPU_HIGH_INTERRUPT_MASK_REGISTER,
+			       (1 << bit_num));
+	else
+		return 0;
+	return 1;
+}
+#endif				/*  UNUSED  */
+
+/*
+ * Interrupt handler for interrupts coming from the Galileo chip.
+ * It could be timer interrupt, built in ethernet ports etc...
+ */
+static void gt64120_irq(int irq, void *dev_id, struct pt_regs *regs)
+{
+	unsigned int irq_src, int_high_src, irq_src_mask,
+	    int_high_src_mask;
+	int handled;
+
+	GT_READ(GT_INTRCAUSE_OFS, &irq_src);
+	GT_READ(GT_INTRMASK_OFS, &irq_src_mask);
+	GT_READ(GT_HINTRCAUSE_OFS, &int_high_src);
+	GT_READ(GT_HINTRMASK_OFS, &int_high_src_mask);
+	irq_src = irq_src & irq_src_mask;
+	int_high_src = int_high_src & int_high_src_mask;
+
+	handled = 0;
+
+	/* Execute all interrupt handlers */
+	/* Check for timer interrupt */
+	if (irq_src & 0x00000800) {
+		handled = 1;
+		irq_src &= ~0x00000800;
+		//    RESET_REG_BITS (INTERRUPT_CAUSE_REGISTER,BIT8);
+		do_timer(regs);
+	}
+
+	if (irq_src) {
+		printk(KERN_INFO
+		       "Other Galileo interrupt received irq_src %x\n",
+		       irq_src);
+#if CURRENTLY_UNUSED
+		for (count = 0; count < MAX_CAUSE_REG_WIDTH; count++) {
+			if (irq_src & (1 << count)) {
+				if (irq_handlers[INT_CAUSE_MAIN][count].
+				    routine) {
+					queue_task(&irq_handlers
+						   [INT_CAUSE_MAIN][count],
+						   &tq_immediate);
+					mark_bh(IMMEDIATE_BH);
+					handled = 1;
+				}
+			}
+		}
+#endif				/*  UNUSED  */
+	}
+	GT_WRITE(GT_INTRCAUSE_OFS, 0);
+	GT_WRITE(GT_HINTRCAUSE_OFS, 0);
+
+#undef GALILEO_I2O
+#ifdef GALILEO_I2O
+	/*
+	 * Future I2O support.  We currently attach I2O interrupt handlers to
+	 * the Galileo interrupt (int 4) and handle them in do_IRQ.
+	 */
+	if (isInBoundDoorBellInterruptSet()) {
+		printk(KERN_INFO "I2O doorbell interrupt received.\n");
+		handled = 1;
+	}
+
+	if (isInBoundPostQueueInterruptSet()) {
+		printk(KERN_INFO "I2O Queue interrupt received.\n");
+		handled = 1;
+	}
+
+	/*
+	 * This normally would be outside of the ifdef, but since we're
+	 * handling I2O outside of this handler, this printk shows up every
+	 * time we get a valid I2O interrupt.  So turn this off for now.
+	 */
+	if (handled == 0) {
+		if (counter < 50) {
+			printk("Spurious Galileo interrupt...\n");
+			counter++;
+		}
+	}
+#endif
+}
+
+/*
+ * Initializes timer using galileo's built in timer.
+ */
+#ifdef CONFIG_SYSCLK_100
+#define Sys_clock (100 * 1000000)	// 100 MHz
+#endif
+#ifdef CONFIG_SYSCLK_83
+#define Sys_clock (83.333 * 1000000)	// 83.333 MHz
+#endif
+#ifdef CONFIG_SYSCLK_75
+#define Sys_clock (75 * 1000000)	// 75 MHz
+#endif
+
+/*
+ * This will ignore the standard MIPS timer interrupt handler
+ * that is passed in as *irq (=irq0 in ../kernel/time.c).
+ * We will do our own timer interrupt handling.
+ */
+void gt64120_time_init(void)
+{
+	extern irq_desc_t irq_desc[NR_IRQS];
+	static struct irqaction timer;
+
+	/* Disable timer first */
+	GT_WRITE(GT_TC_CONTROL_OFS, 0);
+	/* Load timer value for 100 Hz */
+	GT_WRITE(GT_TC3_OFS, Sys_clock / 100);
+
+	/*
+	 * Create the IRQ structure entry for the timer.  Since we're too early
+	 * in the boot process to use the "request_irq()" call, we'll hard-code
+	 * the values to the correct interrupt line.
+	 */
+	timer.handler = &gt64120_irq;
+	timer.flags = SA_SHIRQ | SA_INTERRUPT;
+	timer.name = "timer";
+	timer.dev_id = NULL;
+	timer.next = NULL;
+	timer.mask = 0;
+	irq_desc[TIMER].action = &timer;
+
+	enable_irq(TIMER);
+
+	/* Enable timer ints */
+	GT_WRITE(GT_TC_CONTROL_OFS, 0xc0);
+	/* clear Cause register first */
+	GT_WRITE(GT_INTRCAUSE_OFS, 0x0);
+	/* Unmask timer int */
+	GT_WRITE(GT_INTRMASK_OFS, 0x800);
+	/* Clear High int register */
+	GT_WRITE(GT_HINTRCAUSE_OFS, 0x0);
+	/* Mask All interrupts at High cause interrupt */
+	GT_WRITE(GT_HINTRMASK_OFS, 0x0);
+}
+
+void gt64120_irq_init(void)
+{
+#if CURRENTLY_UNUSED
+	int i, j;
+
+	/* Reset irq handlers pointers to NULL */
+	for (i = 0; i < MAX_CAUSE_REGS; i++) {
+		for (j = 0; j < MAX_CAUSE_REG_WIDTH; j++) {
+			irq_handlers[i][j].next = NULL;
+			irq_handlers[i][j].sync = 0;
+			irq_handlers[i][j].routine = NULL;
+			irq_handlers[i][j].data = NULL;
+		}
+	}
+#endif
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/gt64120/common/pci.c linux/arch/mips/gt64120/common/pci.c
--- v2.4.9/linux/arch/mips/gt64120/common/pci.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/gt64120/common/pci.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,1145 @@
+/*
+ * BRIEF MODULE DESCRIPTION
+ * Galileo Evaluation Boards PCI support.
+ *
+ * The general-purpose functions to read/write and configure the GT64120A's
+ * PCI registers (function names start with pci0 or pci1) are either direct
+ * copies of functions written by Galileo Technology, or are modifications
+ * of their functions to work with Linux 2.4 vs Linux 2.2.  These functions
+ * are Copyright - Galileo Technology.
+ *
+ * Other functions are derived from other MIPS PCI implementations, or were
+ * written by RidgeRun, Inc,  Copyright (C) 2000 RidgeRun, Inc.
+ *   glonnon@ridgerun.com, skranz@ridgerun.com, stevej@ridgerun.com
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
+ *
+ *  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  SOFTWARE  IS PROVIDED   ``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.
+ *
+ *  You should have received a copy of the  GNU General Public License along
+ *  with this program; if not, write  to the Free Software Foundation, Inc.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/version.h>
+#include <asm/pci.h>
+#include <asm/io.h>
+#include <asm/gt64120/gt64120.h>
+
+#include <linux/init.h>
+
+#ifdef CONFIG_PCI
+
+#define SELF 0
+
+/*
+ * These functions and structures provide the BIOS scan and mapping of the PCI
+ * devices.
+ */
+
+#define MAX_PCI_DEVS 10
+
+struct pci_device {
+	u32 slot;
+	u32 BARtype[6];
+	u32 BARsize[6];
+};
+
+static void __init scan_and_initialize_pci(void);
+static u32 __init scan_pci_bus(struct pci_device *pci_devices);
+static void __init allocate_pci_space(struct pci_device *pci_devices);
+
+/*
+ * The functions that actually read and write to the controller.
+ *
+ *  Copied from or modified from Galileo Technology code.
+ */
+static unsigned int pci0ReadConfigReg(int offset, struct pci_dev *device);
+static void pci0WriteConfigReg(unsigned int offset,
+			       struct pci_dev *device, unsigned int data);
+static unsigned int pci1ReadConfigReg(int offset, struct pci_dev *device);
+static void pci1WriteConfigReg(unsigned int offset,
+			       struct pci_dev *device, unsigned int data);
+
+static void pci0MapIOspace(unsigned int pci0IoBase,
+			   unsigned int pci0IoLength);
+static void pci1MapIOspace(unsigned int pci1IoBase,
+			   unsigned int pci1IoLength);
+static void pci0MapMemory0space(unsigned int pci0Mem0Base,
+				unsigned int pci0Mem0Length);
+static void pci1MapMemory0space(unsigned int pci1Mem0Base,
+				unsigned int pci1Mem0Length);
+static void pci0MapMemory1space(unsigned int pci0Mem1Base,
+				unsigned int pci0Mem1Length);
+static void pci1MapMemory1space(unsigned int pci1Mem1Base,
+				unsigned int pci1Mem1Length);
+static unsigned int pci0GetIOspaceBase(void);
+static unsigned int pci0GetIOspaceSize(void);
+static unsigned int pci0GetMemory0Base(void);
+static unsigned int pci0GetMemory0Size(void);
+static unsigned int pci0GetMemory1Base(void);
+static unsigned int pci0GetMemory1Size(void);
+static unsigned int pci1GetIOspaceBase(void);
+static unsigned int pci1GetIOspaceSize(void);
+static unsigned int pci1GetMemory0Base(void);
+static unsigned int pci1GetMemory0Size(void);
+static unsigned int pci1GetMemory1Base(void);
+static unsigned int pci1GetMemory1Size(void);
+
+
+/*  Functions to implement "pci ops"  */
+static int galileo_pcibios_read_config_word(struct pci_dev *dev,
+					    int offset, u16 * val);
+static int galileo_pcibios_read_config_byte(struct pci_dev *dev,
+					    int offset, u8 * val);
+static int galileo_pcibios_read_config_dword(struct pci_dev *dev,
+					     int offset, u32 * val);
+static int galileo_pcibios_write_config_byte(struct pci_dev *dev,
+					     int offset, u8 val);
+static int galileo_pcibios_write_config_word(struct pci_dev *dev,
+					     int offset, u16 val);
+static int galileo_pcibios_write_config_dword(struct pci_dev *dev,
+					      int offset, u32 val);
+static void galileo_pcibios_set_master(struct pci_dev *dev);
+
+/*
+ *  General-purpose PCI functions.
+ */
+
+/*
+ * pci0MapIOspace - Maps PCI0 IO space for the master.
+ * Inputs: base and length of pci0Io
+ */
+
+static void pci0MapIOspace(unsigned int pci0IoBase,
+			   unsigned int pci0IoLength)
+{
+	unsigned int pci0IoTop =
+	    (unsigned int) (pci0IoBase + pci0IoLength);
+
+	if (pci0IoLength == 0)
+		pci0IoTop++;
+
+	pci0IoBase = (unsigned int) (pci0IoBase >> 21);
+	pci0IoTop = (unsigned int) (((pci0IoTop - 1) & 0x0fffffff) >> 21);
+	GT_WRITE(GT_PCI0IOLD_OFS, pci0IoBase);
+	GT_WRITE(GT_PCI0IOHD_OFS, pci0IoTop);
+}
+
+/*
+ * pci1MapIOspace - Maps PCI1 IO space for the master.
+ * Inputs: base and length of pci1Io
+ */
+
+static void pci1MapIOspace(unsigned int pci1IoBase,
+			   unsigned int pci1IoLength)
+{
+	unsigned int pci1IoTop =
+	    (unsigned int) (pci1IoBase + pci1IoLength);
+
+	if (pci1IoLength == 0)
+		pci1IoTop++;
+
+	pci1IoBase = (unsigned int) (pci1IoBase >> 21);
+	pci1IoTop = (unsigned int) (((pci1IoTop - 1) & 0x0fffffff) >> 21);
+	GT_WRITE(GT_PCI1IOLD_OFS, pci1IoBase);
+	GT_WRITE(GT_PCI1IOHD_OFS, pci1IoTop);
+}
+
+/*
+ * pci0MapMemory0space - Maps PCI0 memory0 space for the master.
+ * Inputs: base and length of pci0Mem0
+ */
+
+static void pci0MapMemory0space(unsigned int pci0Mem0Base,
+				unsigned int pci0Mem0Length)
+{
+	unsigned int pci0Mem0Top = pci0Mem0Base + pci0Mem0Length;
+
+	if (pci0Mem0Length == 0)
+		pci0Mem0Top++;
+
+	pci0Mem0Base = pci0Mem0Base >> 21;
+	pci0Mem0Top = ((pci0Mem0Top - 1) & 0x0fffffff) >> 21;
+	GT_WRITE(GT_PCI0M0LD_OFS, pci0Mem0Base);
+	GT_WRITE(GT_PCI0M0HD_OFS, pci0Mem0Top);
+}
+
+/*
+ * pci1MapMemory0space - Maps PCI1 memory0 space for the master.
+ * Inputs: base and length of pci1Mem0
+ */
+
+static void pci1MapMemory0space(unsigned int pci1Mem0Base,
+				unsigned int pci1Mem0Length)
+{
+	unsigned int pci1Mem0Top = pci1Mem0Base + pci1Mem0Length;
+
+	if (pci1Mem0Length == 0)
+		pci1Mem0Top++;
+
+	pci1Mem0Base = pci1Mem0Base >> 21;
+	pci1Mem0Top = ((pci1Mem0Top - 1) & 0x0fffffff) >> 21;
+	GT_WRITE(GT_PCI1M0LD_OFS, pci1Mem0Base);
+	GT_WRITE(GT_PCI1M0HD_OFS, pci1Mem0Top);
+}
+
+/*
+ * pci0MapMemory1space - Maps PCI0 memory1 space for the master.
+ * Inputs: base and length of pci0Mem1
+ */
+
+static void pci0MapMemory1space(unsigned int pci0Mem1Base,
+				unsigned int pci0Mem1Length)
+{
+	unsigned int pci0Mem1Top = pci0Mem1Base + pci0Mem1Length;
+
+	if (pci0Mem1Length == 0)
+		pci0Mem1Top++;
+
+	pci0Mem1Base = pci0Mem1Base >> 21;
+	pci0Mem1Top = ((pci0Mem1Top - 1) & 0x0fffffff) >> 21;
+	GT_WRITE(GT_PCI0M1LD_OFS, pci0Mem1Base);
+	GT_WRITE(GT_PCI0M1HD_OFS, pci0Mem1Top);
+
+}
+
+/*
+ * pci1MapMemory1space - Maps PCI1 memory1 space for the master.
+ * Inputs: base and length of pci1Mem1
+ */
+
+static void pci1MapMemory1space(unsigned int pci1Mem1Base,
+				unsigned int pci1Mem1Length)
+{
+	unsigned int pci1Mem1Top = pci1Mem1Base + pci1Mem1Length;
+
+	if (pci1Mem1Length == 0)
+		pci1Mem1Top++;
+
+	pci1Mem1Base = pci1Mem1Base >> 21;
+	pci1Mem1Top = ((pci1Mem1Top - 1) & 0x0fffffff) >> 21;
+	GT_WRITE(GT_PCI1M1LD_OFS, pci1Mem1Base);
+	GT_WRITE(GT_PCI1M1HD_OFS, pci1Mem1Top);
+}
+
+/*
+ * pci0GetIOspaceBase - Return PCI0 IO Base Address.
+ * Inputs: N/A
+ * Returns: PCI0 IO Base Address.
+ */
+
+static unsigned int pci0GetIOspaceBase(void)
+{
+	unsigned int base;
+	GT_READ(GT_PCI0IOLD_OFS, &base);
+	base = base << 21;
+	return base;
+}
+
+/*
+ * pci0GetIOspaceSize - Return PCI0 IO Bar Size.
+ * Inputs: N/A
+ * Returns: PCI0 IO Bar Size.
+ */
+
+static unsigned int pci0GetIOspaceSize(void)
+{
+	unsigned int top, base, size;
+	GT_READ(GT_PCI0IOLD_OFS, &base);
+	base = base << 21;
+	GT_READ(GT_PCI0IOHD_OFS, &top);
+	top = (top << 21);
+	size = ((top - base) & 0xfffffff);
+	size = size | 0x1fffff;
+	return (size + 1);
+}
+
+/*
+ * pci0GetMemory0Base - Return PCI0 Memory 0 Base Address.
+ * Inputs: N/A
+ * Returns: PCI0 Memory 0 Base Address.
+ */
+
+static unsigned int pci0GetMemory0Base(void)
+{
+	unsigned int base;
+	GT_READ(GT_PCI0M0LD_OFS, &base);
+	base = base << 21;
+	return base;
+}
+
+/*
+ * pci0GetMemory0Size - Return PCI0 Memory 0 Bar Size.
+ * Inputs: N/A
+ * Returns: PCI0 Memory 0 Bar Size.
+ */
+
+static unsigned int pci0GetMemory0Size(void)
+{
+	unsigned int top, base, size;
+	GT_READ(GT_PCI0M0LD_OFS, &base);
+	base = base << 21;
+	GT_READ(GT_PCI0M0HD_OFS, &top);
+	top = (top << 21);
+	size = ((top - base) & 0xfffffff);
+	size = size | 0x1fffff;
+	return (size + 1);
+}
+
+/*
+ * pci0GetMemory1Base - Return PCI0 Memory 1 Base Address.
+ * Inputs: N/A
+ * Returns: PCI0 Memory 1 Base Address.
+ */
+
+static unsigned int pci0GetMemory1Base(void)
+{
+	unsigned int base;
+	GT_READ(GT_PCI0M1LD_OFS, &base);
+	base = base << 21;
+	return base;
+}
+
+/*
+ * pci0GetMemory1Size - Return PCI0 Memory 1 Bar Size.
+ * Inputs: N/A
+ * Returns: PCI0 Memory 1 Bar Size.
+ */
+
+static unsigned int pci0GetMemory1Size(void)
+{
+	unsigned int top, base, size;
+	GT_READ(GT_PCI0M1LD_OFS, &base);
+	base = base << 21;
+	GT_READ(GT_PCI0M1HD_OFS, &top);
+	top = (top << 21);
+	size = ((top - base) & 0xfffffff);
+	size = size | 0x1fffff;
+	return (size + 1);
+}
+
+/*
+ * pci1GetIOspaceBase - Return PCI1 IO Base Address.
+ * Inputs: N/A
+ * Returns: PCI1 IO Base Address.
+ */
+
+static unsigned int pci1GetIOspaceBase(void)
+{
+	unsigned int base;
+	GT_READ(GT_PCI1IOLD_OFS, &base);
+	base = base << 21;
+	return base;
+}
+
+/*
+ * pci1GetIOspaceSize - Return PCI1 IO Bar Size.
+ * Inputs: N/A
+ * Returns: PCI1 IO Bar Size.
+ */
+
+static unsigned int pci1GetIOspaceSize(void)
+{
+	unsigned int top, base, size;
+	GT_READ(GT_PCI1IOLD_OFS, &base);
+	base = base << 21;
+	GT_READ(GT_PCI1IOHD_OFS, &top);
+	top = (top << 21);
+	size = ((top - base) & 0xfffffff);
+	size = size | 0x1fffff;
+	return (size + 1);
+}
+
+/*
+ * pci1GetMemory0Base - Return PCI1 Memory 0 Base Address.
+ * Inputs: N/A
+ * Returns: PCI1 Memory 0 Base Address.
+ */
+
+static unsigned int pci1GetMemory0Base(void)
+{
+	unsigned int base;
+	GT_READ(GT_PCI1M0LD_OFS, &base);
+	base = base << 21;
+	return base;
+}
+
+/*
+ * pci1GetMemory0Size - Return PCI1 Memory 0 Bar Size.
+ * Inputs: N/A
+ * Returns: PCI1 Memory 0 Bar Size.
+ */
+
+static unsigned int pci1GetMemory0Size(void)
+{
+	unsigned int top, base, size;
+	GT_READ(GT_PCI1M1LD_OFS, &base);
+	base = base << 21;
+	GT_READ(GT_PCI1M1HD_OFS, &top);
+	top = (top << 21);
+	size = ((top - base) & 0xfffffff);
+	size = size | 0x1fffff;
+	return (size + 1);
+}
+
+/*
+ * pci1GetMemory1Base - Return PCI1 Memory 1 Base Address.
+ * Inputs: N/A
+ * Returns: PCI1 Memory 1 Base Address.
+ */
+
+static unsigned int pci1GetMemory1Base(void)
+{
+	unsigned int base;
+	GT_READ(GT_PCI1M1LD_OFS, &base);
+	base = base << 21;
+	return base;
+}
+
+/*
+ * pci1GetMemory1Size - Return PCI1 Memory 1 Bar Size.
+ * Inputs: N/A
+ * Returns: PCI1 Memory 1 Bar Size.
+ */
+
+static unsigned int pci1GetMemory1Size(void)
+{
+	unsigned int top, base, size;
+	GT_READ(GT_PCI1M1LD_OFS, &base);
+	base = base << 21;
+	GT_READ(GT_PCI1M1HD_OFS, &top);
+	top = (top << 21);
+	size = ((top - base) & 0xfffffff);
+	size = size | 0x1fffff;
+	return (size + 1);
+}
+
+
+
+/*
+ * pci_range_ck -
+ *
+ * Check if the pci device that are trying to access does really exists
+ * on the evaluation board.  
+ *
+ * Inputs :
+ * bus - bus number (0 for PCI 0 ; 1 for PCI 1)
+ * dev - number of device on the specific pci bus
+ *
+ * Outpus :
+ * 0 - if OK , 1 - if failure
+ */
+static __inline__ int pci_range_ck(unsigned char bus, unsigned char dev)
+{
+	/*
+	 * We don't even pretend to handle other busses than bus 0 correctly.
+	 * Accessing device 31 crashes the CP7000 for some reason.
+	 */
+	if ((bus == 0) && (dev != 31))
+		return 0;
+	return -1;
+}
+
+/*
+ * pciXReadConfigReg  - Read from a PCI configuration register
+ *                    - Make sure the GT is configured as a master before 
+ *                      reading from another device on the PCI.
+ *                   - The function takes care of Big/Little endian conversion.
+ * INPUTS:   regOffset: The register offset as it apears in the GT spec (or PCI
+ *                        spec)
+ *           pciDevNum: The device number needs to be addressed.                
+ * RETURNS: data , if the data == 0xffffffff check the master abort bit in the 
+ *                 cause register to make sure the data is valid
+ *
+ *  Configuration Address 0xCF8:
+ *
+ *       31 30    24 23  16 15  11 10     8 7      2  0     <=bit Number
+ *  |congif|Reserved|  Bus |Device|Function|Register|00|
+ *  |Enable|        |Number|Number| Number | Number |  |    <=field Name
+ *
+ */
+static unsigned int pci0ReadConfigReg(int offset, struct pci_dev *device)
+{
+	unsigned int DataForRegCf8;
+	unsigned int data;
+
+	DataForRegCf8 = ((PCI_SLOT(device->devfn) << 11) |
+			 (PCI_FUNC(device->devfn) << 8) |
+			 (offset & ~0x3)) | 0x80000000;
+	GT_WRITE(GT_PCI0_CFGADDR_OFS, DataForRegCf8);
+
+	/*
+	 * The casual observer might wonder why the READ is duplicated here,
+	 * rather than immediately following the WRITE, and just have the swap
+	 * in the "if".  That's because there is a latency problem with trying
+	 * to read immediately after setting up the address register.  The "if"
+	 * check gives enough time for the address to stabilize, so the READ
+	 * can work.
+	 */
+	if (PCI_SLOT(device->devfn) == SELF) {	/* This board */
+		GT_READ(GT_PCI0_CFGDATA_OFS, &data);
+		return data;
+	} else { /* The PCI is working in LE Mode so swap the Data. */
+		GT_READ(GT_PCI0_CFGDATA_OFS, &data);
+		return cpu_to_le32(data);
+	}
+}
+
+static unsigned int pci1ReadConfigReg(int offset, struct pci_dev *device)
+{
+	unsigned int DataForRegCf8;
+	unsigned int data;
+
+	DataForRegCf8 = ((PCI_SLOT(device->devfn) << 11) |
+			 (PCI_FUNC(device->devfn) << 8) |
+			 (offset & ~0x3)) | 0x80000000;
+	/*
+	 * The casual observer might wonder why the READ is duplicated here,
+	 * rather than immediately following the WRITE, and just have the
+	 * swap in the "if".  That's because there is a latency problem
+	 * with trying to read immediately after setting up the address
+	 * register.  The "if" check gives enough time for the address
+	 * to stabilize, so the READ can work.
+	 */
+	if (PCI_SLOT(device->devfn) == SELF) {	/* This board */
+		/* when configurating our own PCI 1 L-unit the access is through  
+		   the PCI 0 interface with reg number = reg number + 0x80 */
+		DataForRegCf8 |= 0x80;
+		GT_WRITE(GT_PCI0_CFGADDR_OFS, DataForRegCf8);
+	} else {		/* The PCI is working in LE Mode so swap the Data. */
+		GT_WRITE(GT_PCI1_CFGADDR_OFS, DataForRegCf8);
+	}
+	if (PCI_SLOT(device->devfn) == SELF) {	/* This board */
+		GT_READ(GT_PCI0_CFGDATA_OFS, &data);
+		return data;
+	} else {
+		GT_READ(GT_PCI1_CFGDATA_OFS, &data);
+		return cpu_to_le32(data);
+	}
+}
+
+
+
+/*
+ * pciXWriteConfigReg - Write to a PCI configuration register
+ *                    - Make sure the GT is configured as a master before 
+ *                      writingto another device on the PCI.
+ *                    - The function takes care of Big/Little endian conversion.
+ * Inputs:   unsigned int regOffset: The register offset as it apears in the
+ *           GT spec 
+ *                   (or any other PCI device spec)
+ *           pciDevNum: The device number needs to be addressed.                
+ *
+ *  Configuration Address 0xCF8:
+ *
+ *       31 30    24 23  16 15  11 10     8 7      2  0     <=bit Number
+ *  |congif|Reserved|  Bus |Device|Function|Register|00|
+ *  |Enable|        |Number|Number| Number | Number |  |    <=field Name
+ *
+ */
+static void pci0WriteConfigReg(unsigned int offset,
+			       struct pci_dev *device, unsigned int data)
+{
+	unsigned int DataForRegCf8;
+
+	DataForRegCf8 = ((PCI_SLOT(device->devfn) << 11) |
+			 (PCI_FUNC(device->devfn) << 8) |
+			 (offset & ~0x3)) | 0x80000000;
+	GT_WRITE(GT_PCI0_CFGADDR_OFS, DataForRegCf8);
+	if (PCI_SLOT(device->devfn) == SELF) {	/* This board */
+		GT_WRITE(GT_PCI0_CFGDATA_OFS, data);
+	} else {		/* configuration Transaction over the pci. */
+		/* The PCI is working in LE Mode so swap the Data. */
+		GT_WRITE(GT_PCI0_CFGDATA_OFS, le32_to_cpu(data));
+	}
+}
+
+static void pci1WriteConfigReg(unsigned int offset,
+			       struct pci_dev *device, unsigned int data)
+{
+	unsigned int DataForRegCf8;
+
+	DataForRegCf8 = ((PCI_SLOT(device->devfn) << 11) |
+			 (PCI_FUNC(device->devfn) << 8) |
+			 (offset & ~0x3)) | 0x80000000;
+	/*
+	 * There is a latency problem
+	 * with trying to read immediately after setting up the address
+	 * register.  The "if" check gives enough time for the address
+	 * to stabilize, so the WRITE can work.
+	 */
+	if (PCI_SLOT(device->devfn) == SELF) {	/* This board */
+		/*
+		 * when configurating our own PCI 1 L-unit the access is through
+		 * the PCI 0 interface with reg number = reg number + 0x80
+		 */
+		DataForRegCf8 |= 0x80;
+		GT_WRITE(GT_PCI0_CFGADDR_OFS, DataForRegCf8);
+	} else {	/* configuration Transaction over the pci. */
+		/* The PCI is working in LE Mode so swap the Data. */
+		GT_WRITE(GT_PCI1_CFGADDR_OFS, DataForRegCf8);
+	}
+	if (PCI_SLOT(device->devfn) == SELF) {	/* This board */
+		GT_WRITE(GT_PCI0_CFGDATA_OFS, data);
+	} else {		/* configuration Transaction over the pci. */
+		GT_WRITE(GT_PCI1_CFGADDR_OFS, le32_to_cpu(data));
+	}
+}
+
+
+/*
+ * galileo_pcibios_(read/write)_config_(dword/word/byte) -
+ *
+ * reads/write a dword/word/byte register from the configuration space
+ * of a device.
+ *
+ * Inputs :
+ * bus - bus number
+ * dev - device number
+ * offset - register offset in the configuration space
+ * val - value to be written / read
+ *
+ * Outputs :
+ * PCIBIOS_SUCCESSFUL when operation was succesfull
+ * PCIBIOS_DEVICE_NOT_FOUND when the bus or dev is errorneous
+ * PCIBIOS_BAD_REGISTER_NUMBER when accessing non aligned
+ */
+
+static int galileo_pcibios_read_config_dword(struct pci_dev *device,
+					     int offset, u32 * val)
+{
+	int dev, bus;
+	bus = device->bus->number;
+	dev = PCI_SLOT(device->devfn);
+
+	if (pci_range_ck(bus, dev)) {
+		*val = 0xffffffff;
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	}
+	if (offset & 0x3)
+		return PCIBIOS_BAD_REGISTER_NUMBER;
+	if (bus == 0)
+		*val = pci0ReadConfigReg(offset, device);
+
+	/*  This is so that the upper PCI layer will get the correct return value if
+	   we're not attached to anything.  */
+	if ((offset == 0) && (*val == 0xffffffff)) {
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	}
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int galileo_pcibios_read_config_word(struct pci_dev *device,
+					    int offset, u16 * val)
+{
+	int dev, bus;
+
+	bus = device->bus->number;
+	dev = PCI_SLOT(device->devfn);
+
+	if (pci_range_ck(bus, dev)) {
+		*val = 0xffff;
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	}
+	if (offset & 0x1)
+		return PCIBIOS_BAD_REGISTER_NUMBER;
+
+	if (bus == 0)
+		*val =
+		    (unsigned short) (pci0ReadConfigReg(offset, device) >>
+				      ((offset & ~0x3) * 8));
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int galileo_pcibios_read_config_byte(struct pci_dev *device,
+					    int offset, u8 * val)
+{
+	int dev, bus;
+
+	bus = device->bus->number;
+	dev = PCI_SLOT(device->devfn);
+
+	if (pci_range_ck(bus, dev)) {
+		*val = 0xff;
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	}
+
+	if (bus == 0)
+		*val =
+		    (unsigned char) (pci0ReadConfigReg(offset, device) >>
+				     ((offset & ~0x3) * 8));
+
+	/*
+	 *  This is so that the upper PCI layer will get the correct return
+	 * value if we're not attached to anything.
+	 */
+	if ((offset == 0xe) && (*val == 0xff)) {
+		u32 MasterAbort;
+		GT_READ(GT_INTRCAUSE_OFS, &MasterAbort);
+		if (MasterAbort & 0x40000) {
+			GT_WRITE(GT_INTRCAUSE_OFS,
+				 (MasterAbort & 0xfffbffff));
+			return PCIBIOS_DEVICE_NOT_FOUND;
+		}
+	}
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int galileo_pcibios_write_config_dword(struct pci_dev *device,
+					      int offset, u32 val)
+{
+	int dev, bus;
+
+	bus = device->bus->number;
+	dev = PCI_SLOT(device->devfn);
+
+	if (pci_range_ck(bus, dev))
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	if (offset & 0x3)
+		return PCIBIOS_BAD_REGISTER_NUMBER;
+	if (bus == 0)
+		pci0WriteConfigReg(offset, device, val);
+//  if (bus == 1) pci1WriteConfigReg (offset,device,val);
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+
+static int galileo_pcibios_write_config_word(struct pci_dev *device,
+					     int offset, u16 val)
+{
+	int dev, bus;
+	unsigned long tmp;
+
+	bus = device->bus->number;
+	dev = PCI_SLOT(device->devfn);
+
+	if (pci_range_ck(bus, dev))
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	if (offset & 0x1)
+		return PCIBIOS_BAD_REGISTER_NUMBER;
+	if (bus == 0)
+		tmp = pci0ReadConfigReg(offset, device);
+//  if (bus == 1) tmp = pci1ReadConfigReg (offset,device);
+
+	if ((offset % 4) == 0)
+		tmp = (tmp & 0xffff0000) | (val & 0xffff);
+	if ((offset % 4) == 2)
+		tmp = (tmp & 0x0000ffff) | ((val & 0xffff) << 16);
+
+	if (bus == 0)
+		pci0WriteConfigReg(offset, device, tmp);
+//  if (bus == 1) pci1WriteConfigReg (offset,device,tmp);
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int galileo_pcibios_write_config_byte(struct pci_dev *device,
+					     int offset, u8 val)
+{
+	int dev, bus;
+	unsigned long tmp;
+
+	bus = device->bus->number;
+	dev = PCI_SLOT(device->devfn);
+
+	if (pci_range_ck(bus, dev))
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	if (bus == 0)
+		tmp = pci0ReadConfigReg(offset, device);
+//  if (bus == 1) tmp = pci1ReadConfigReg (offset,device);
+
+	if ((offset % 4) == 0)
+		tmp = (tmp & 0xffffff00) | (val & 0xff);
+	if ((offset % 4) == 1)
+		tmp = (tmp & 0xffff00ff) | ((val & 0xff) << 8);
+	if ((offset % 4) == 2)
+		tmp = (tmp & 0xff00ffff) | ((val & 0xff) << 16);
+	if ((offset % 4) == 3)
+		tmp = (tmp & 0x00ffffff) | ((val & 0xff) << 24);
+
+	if (bus == 0)
+		pci0WriteConfigReg(offset, device, tmp);
+//  if (bus == 1) pci1WriteConfigReg (offset,device,tmp);
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static void galileo_pcibios_set_master(struct pci_dev *dev)
+{
+	u16 cmd;
+
+	galileo_pcibios_read_config_word(dev, PCI_COMMAND, &cmd);
+	cmd |= PCI_COMMAND_MASTER;
+	galileo_pcibios_write_config_word(dev, PCI_COMMAND, cmd);
+}
+
+/*  Externally-expected functions.  Do not change function names  */
+
+int pcibios_enable_resources(struct pci_dev *dev)
+{
+	u16 cmd, old_cmd;
+	u8 tmp1;
+	int idx;
+	struct resource *r;
+
+	galileo_pcibios_read_config_word(dev, PCI_COMMAND, &cmd);
+	old_cmd = cmd;
+	for (idx = 0; idx < 6; idx++) {
+		r = &dev->resource[idx];
+		if (!r->start && r->end) {
+			printk(KERN_ERR
+			       "PCI: Device %s not available because of "
+			       "resource collisions\n", dev->slot_name);
+			return -EINVAL;
+		}
+		if (r->flags & IORESOURCE_IO)
+			cmd |= PCI_COMMAND_IO;
+		if (r->flags & IORESOURCE_MEM)
+			cmd |= PCI_COMMAND_MEMORY;
+	}
+	if (cmd != old_cmd) {
+		galileo_pcibios_write_config_word(dev, PCI_COMMAND, cmd);
+	}
+
+	/*
+	 * Let's fix up the latency timer and cache line size here.  Cache
+	 * line size = 32 bytes / sizeof dword (4) = 8.
+	 * Latency timer must be > 8.  32 is random but appears to work.
+	 */
+	galileo_pcibios_read_config_byte(dev, PCI_CACHE_LINE_SIZE, &tmp1);
+	if (tmp1 != 8) {
+		printk(KERN_WARNING "PCI setting cache line size to 8 from "
+		       "%d\n", tmp1);
+		galileo_pcibios_write_config_byte(dev, PCI_CACHE_LINE_SIZE,
+						  8);
+	}
+	galileo_pcibios_read_config_byte(dev, PCI_LATENCY_TIMER, &tmp1);
+	if (tmp1 < 32) {
+		printk(KERN_WARNING "PCI setting latency timer to 32 from %d\n",
+		       tmp1);
+		galileo_pcibios_write_config_byte(dev, PCI_LATENCY_TIMER,
+						  32);
+	}
+
+	return 0;
+}
+
+int pcibios_enable_device(struct pci_dev *dev)
+{
+	return pcibios_enable_resources(dev);
+}
+
+void pcibios_update_resource(struct pci_dev *dev, struct resource *root,
+			     struct resource *res, int resource)
+{
+	u32 new, check;
+	int reg;
+
+	return;
+
+	new = res->start | (res->flags & PCI_REGION_FLAG_MASK);
+	if (resource < 6) {
+		reg = PCI_BASE_ADDRESS_0 + 4 * resource;
+	} else if (resource == PCI_ROM_RESOURCE) {
+		res->flags |= PCI_ROM_ADDRESS_ENABLE;
+		reg = dev->rom_base_reg;
+	} else {
+		/*
+		 * Somebody might have asked allocation of a non-standard
+		 * resource
+		 */
+		return;
+	}
+
+	pci_write_config_dword(dev, reg, new);
+	pci_read_config_dword(dev, reg, &check);
+	if ((new ^ check) &
+	    ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK :
+	     PCI_BASE_ADDRESS_MEM_MASK)) {
+		printk(KERN_ERR "PCI: Error while updating region "
+		       "%s/%d (%08x != %08x)\n", dev->slot_name, resource,
+		       new, check);
+	}
+}
+
+void pcibios_align_resource(void *data, struct resource *res,
+			    unsigned long size)
+{
+	struct pci_dev *dev = data;
+
+	if (res->flags & IORESOURCE_IO) {
+		unsigned long start = res->start;
+
+		/* We need to avoid collisions with `mirrored' VGA ports
+		   and other strange ISA hardware, so we always want the
+		   addresses kilobyte aligned.  */
+		if (size > 0x100) {
+			printk(KERN_ERR "PCI: I/O Region %s/%d too large"
+			       " (%ld bytes)\n", dev->slot_name,
+			        dev->resource - res, size);
+		}
+
+		start = (start + 1024 - 1) & ~(1024 - 1);
+		res->start = start;
+	}
+}
+
+struct pci_ops galileo_pci_ops = {
+	galileo_pcibios_read_config_byte,
+	galileo_pcibios_read_config_word,
+	galileo_pcibios_read_config_dword,
+	galileo_pcibios_write_config_byte,
+	galileo_pcibios_write_config_word,
+	galileo_pcibios_write_config_dword
+};
+
+struct pci_fixup pcibios_fixups[] = {
+	{0}
+};
+
+void __init pcibios_fixup_bus(struct pci_bus *c)
+{
+	gt64120_board_pcibios_fixup_bus(c);
+}
+
+/*
+ * This code was derived from Galileo Technology's example
+ * and significantly reworked.
+ *
+ * This is very simple.  It does not scan multiple function devices.  It does
+ * not scan behind bridges.  Those would be simple to implement, but we don't
+ * currently need this.
+ */
+
+static void __init scan_and_initialize_pci(void)
+{
+	struct pci_device pci_devices[MAX_PCI_DEVS];
+
+	if (scan_pci_bus(pci_devices)) {
+		allocate_pci_space(pci_devices);
+	}
+}
+
+/*
+ * This is your basic PCI scan.  It goes through each slot and checks to
+ * see if there's something that responds.  If so, then get the size and
+ * type of each of the responding BARs.  Save them for later.
+ */
+
+static u32 __init scan_pci_bus(struct pci_device *pci_devices)
+{
+	u32 arrayCounter = 0;
+	u32 memType;
+	u32 memSize;
+	u32 pci_slot, bar;
+	u32 id;
+	u32 c18RegValue;
+	struct pci_dev device;
+
+	/*
+	 * According to PCI REV 2.1 MAX agents on the bus are 21.
+	 * We don't bother scanning ourselves (slot 0).
+	 */
+	for (pci_slot = 1; pci_slot < 22; pci_slot++) {
+
+		device.devfn = PCI_DEVFN(pci_slot, 0);
+		id = pci0ReadConfigReg(PCI_VENDOR_ID, &device);
+
+		/*
+		 *  Check for a PCI Master Abort (nothing responds in the
+		 * slot)
+		 */
+		GT_READ(GT_INTRCAUSE_OFS, &c18RegValue);
+		/*
+		 * Clearing bit 18 of in the Cause Register 0xc18 by
+		 * writting 0.
+		 */
+		GT_WRITE(GT_INTRCAUSE_OFS, (c18RegValue & 0xfffbffff));
+		if ((id != 0xffffffff) && !(c18RegValue & 0x40000)) {
+			pci_devices[arrayCounter].slot = pci_slot;
+			for (bar = 0; bar < 6; bar++) {
+				memType =
+				    pci0ReadConfigReg(PCI_BASE_ADDRESS_0 +
+						      (bar * 4), &device);
+				pci_devices[arrayCounter].BARtype[bar] =
+				    memType & 1;
+				pci0WriteConfigReg(PCI_BASE_ADDRESS_0 +
+						   (bar * 4), &device,
+						   0xffffffff);
+				memSize =
+				    pci0ReadConfigReg(PCI_BASE_ADDRESS_0 +
+						      (bar * 4), &device);
+				if (memType & 1) {	/*  IO space  */
+					pci_devices[arrayCounter].
+					    BARsize[bar] =
+					    ~(memSize & 0xfffffffc) + 1;
+				} else {	/*  memory space */
+					pci_devices[arrayCounter].
+					    BARsize[bar] =
+					    ~(memSize & 0xfffffff0) + 1;
+				}
+			}	/*  BAR counter  */
+
+			arrayCounter++;
+		}
+		/*  found a device  */
+	} /*  slot counter  */
+
+	if (arrayCounter < MAX_PCI_DEVS)
+		pci_devices[arrayCounter].slot = -1;
+
+	return arrayCounter;
+}
+
+#define ALIGN(val,align)        (((val) + ((align) - 1)) & ~((align) - 1))
+#define MAX(val1, val2) ((val1) > (val2) ? (val1) : (val2))
+
+/*
+ * This function goes through the list of devices and allocates the BARs in
+ * either IO or MEM space.  It does it in order of size, which will limit the
+ * amount of fragmentation we have in the IO and MEM spaces.
+ */
+
+static void __init allocate_pci_space(struct pci_device *pci_devices)
+{
+	u32 count, maxcount, bar;
+	u32 maxSize, maxDevice, maxBAR;
+	u32 alignto;
+	u32 base;
+	u32 pci0_mem_base = pci0GetMemory0Base();
+	u32 pci0_io_base = pci0GetIOspaceBase();
+	struct pci_dev device;
+
+	/*  How many PCI devices do we have?  */
+	maxcount = MAX_PCI_DEVS;
+	for (count = 0; count < MAX_PCI_DEVS; count++) {
+		if (pci_devices[count].slot == -1) {
+			maxcount = count;
+			break;
+		}
+	}
+
+	do {
+		/*  Find the largest size BAR we need to allocate  */
+		maxSize = 0;
+		for (count = 0; count < maxcount; count++) {
+			for (bar = 0; bar < 6; bar++) {
+				if (pci_devices[count].BARsize[bar] >
+				    maxSize) {
+					maxSize =
+					    pci_devices[count].
+					    BARsize[bar];
+					maxDevice = count;
+					maxBAR = bar;
+				}
+			}
+		}
+
+		/*
+		 * We've found the largest BAR.  Allocate it into IO or
+		 * mem space.  We don't idiot check the bases to make
+		 * sure they haven't overflowed the current size for that
+		 * aperture.  
+		 * Don't bother to enable the device's IO or MEM space here.
+		 * That will be done in pci_enable_resources if the device is
+		 * activated by a driver.
+		 */
+		if (maxSize) {
+			device.devfn =
+			    PCI_DEVFN(pci_devices[maxDevice].slot, 0);
+			if (pci_devices[maxDevice].BARtype[maxBAR] == 1) {
+				alignto = MAX(0x1000, maxSize);
+				base = ALIGN(pci0_io_base, alignto);
+				pci0WriteConfigReg(PCI_BASE_ADDRESS_0 +
+						   (maxBAR * 4), &device,
+						   base | 0x1);
+				pci0_io_base = base + alignto;
+			} else {
+				alignto = MAX(0x1000, maxSize);
+				base = ALIGN(pci0_mem_base, alignto);
+				pci0WriteConfigReg(PCI_BASE_ADDRESS_0 +
+						   (maxBAR * 4), &device,
+						   base);
+				pci0_mem_base = base + alignto;
+			}
+			/*
+			 * This entry is finished.  Remove it from the list
+			 * we'll scan.
+			 */
+			pci_devices[maxDevice].BARsize[maxBAR] = 0;
+		}
+	} while (maxSize);
+}
+
+void __init pcibios_init(void)
+{
+	u32 tmp;
+	struct pci_dev controller;
+
+	controller.devfn = SELF;
+
+	GT_READ(GT_PCI0_CMD_OFS, &tmp);
+	GT_READ(GT_PCI0_BARE_OFS, &tmp);
+
+	/*
+	 * You have to enable bus mastering to configure any other
+	 * card on the bus.
+	 */
+	tmp = pci0ReadConfigReg(PCI_COMMAND, &controller);
+	tmp |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_SERR;
+	pci0WriteConfigReg(PCI_COMMAND, &controller, tmp);
+
+	/*  This scans the PCI bus and sets up initial values.  */
+	scan_and_initialize_pci();
+
+	/*
+	 *  Reset PCI I/O and PCI MEM values to ones supported by EVM.
+	 */
+	ioport_resource.start = GT_PCI_IO_BASE;
+	ioport_resource.end   = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1;
+	iomem_resource.start  = GT_PCI_MEM_BASE;
+	iomem_resource.end    = GT_PCI_MEM_BASE + GT_PCI_MEM_BASE - 1;
+
+	pci_scan_bus(0, &galileo_pci_ops, NULL);
+}
+
+/*
+ * for parsing "pci=" kernel boot arguments.
+ */
+char *pcibios_setup(char *str)
+{
+        printk(KERN_INFO "rr: pcibios_setup\n");
+        /* Nothing to do for now.  */
+
+        return str;
+}
+
+unsigned __init int pcibios_assign_all_busses(void)
+{
+	return 1;
+}
+
+#endif	/* CONFIG_PCI */
diff -u --recursive --new-file v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/Makefile linux/arch/mips/gt64120/momenco_ocelot/Makefile
--- v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/Makefile	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/gt64120/momenco_ocelot/Makefile	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,20 @@
+#
+# Makefile for Momentum's Ocelot board.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+
+.S.s:
+	$(CPP) $(CFLAGS) $< -o $*.s
+.S.o:
+	$(CC) $(CFLAGS) -c $< -o $*.o
+
+O_TARGET:= momenco_ocelot.o
+
+obj-y	 += int-handler.o irq.o pci.o prom.o reset.o setup.o
+
+obj-$(CONFIG_REMOTE_DEBUG) += dbg_io.o
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/dbg_io.c linux/arch/mips/gt64120/momenco_ocelot/dbg_io.c
--- v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/dbg_io.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/gt64120/momenco_ocelot/dbg_io.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,124 @@
+#include <linux/config.h>
+
+#if defined(CONFIG_REMOTE_DEBUG)
+
+/* --- CONFIG --- */
+
+typedef unsigned char uint8;
+typedef unsigned int uint32;
+
+/* --- END OF CONFIG --- */
+
+#define         UART16550_BAUD_2400             2400
+#define         UART16550_BAUD_4800             4800
+#define         UART16550_BAUD_9600             9600
+#define         UART16550_BAUD_19200            19200
+#define         UART16550_BAUD_38400            38400
+#define         UART16550_BAUD_57600            57600
+#define         UART16550_BAUD_115200           115200
+
+#define         UART16550_PARITY_NONE           0
+#define         UART16550_PARITY_ODD            0x08
+#define         UART16550_PARITY_EVEN           0x18
+#define         UART16550_PARITY_MARK           0x28
+#define         UART16550_PARITY_SPACE          0x38
+
+#define         UART16550_DATA_5BIT             0x0
+#define         UART16550_DATA_6BIT             0x1
+#define         UART16550_DATA_7BIT             0x2
+#define         UART16550_DATA_8BIT             0x3
+
+#define         UART16550_STOP_1BIT             0x0
+#define         UART16550_STOP_2BIT             0x4
+
+/* ----------------------------------------------------- */
+
+/* === CONFIG === */
+
+/* [jsun] we use the second serial port for kdb */
+#define         BASE                    0xbd000020
+#define         MAX_BAUD                115200
+
+/* === END OF CONFIG === */
+
+#define         REG_OFFSET              4
+
+/* register offset */
+#define         OFS_RCV_BUFFER          0
+#define         OFS_TRANS_HOLD          0
+#define         OFS_SEND_BUFFER         0
+#define         OFS_INTR_ENABLE         (1*REG_OFFSET)
+#define         OFS_INTR_ID             (2*REG_OFFSET)
+#define         OFS_DATA_FORMAT         (3*REG_OFFSET)
+#define         OFS_LINE_CONTROL        (3*REG_OFFSET)
+#define         OFS_MODEM_CONTROL       (4*REG_OFFSET)
+#define         OFS_RS232_OUTPUT        (4*REG_OFFSET)
+#define         OFS_LINE_STATUS         (5*REG_OFFSET)
+#define         OFS_MODEM_STATUS        (6*REG_OFFSET)
+#define         OFS_RS232_INPUT         (6*REG_OFFSET)
+#define         OFS_SCRATCH_PAD         (7*REG_OFFSET)
+
+#define         OFS_DIVISOR_LSB         (0*REG_OFFSET)
+#define         OFS_DIVISOR_MSB         (1*REG_OFFSET)
+
+
+/* memory-mapped read/write of the port */
+#define         UART16550_READ(y)    (*((volatile uint8*)(BASE + y)))
+#define         UART16550_WRITE(y, z)  ((*((volatile uint8*)(BASE + y))) = z)
+
+void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
+{
+	/* disable interrupts */
+	UART16550_WRITE(OFS_INTR_ENABLE, 0);
+
+	/* set up buad rate */
+	{
+		uint32 divisor;
+
+		/* set DIAB bit */
+		UART16550_WRITE(OFS_LINE_CONTROL, 0x80);
+
+		/* set divisor */
+		divisor = MAX_BAUD / baud;
+		UART16550_WRITE(OFS_DIVISOR_LSB, divisor & 0xff);
+		UART16550_WRITE(OFS_DIVISOR_MSB, (divisor & 0xff00) >> 8);
+
+		/* clear DIAB bit */
+		UART16550_WRITE(OFS_LINE_CONTROL, 0x0);
+	}
+
+	/* set data format */
+	UART16550_WRITE(OFS_DATA_FORMAT, data | parity | stop);
+}
+
+static int remoteDebugInitialized = 0;
+
+uint8 getDebugChar(void)
+{
+	if (!remoteDebugInitialized) {
+		remoteDebugInitialized = 1;
+		debugInit(UART16550_BAUD_38400,
+			  UART16550_DATA_8BIT,
+			  UART16550_PARITY_NONE, UART16550_STOP_1BIT);
+	}
+
+	while ((UART16550_READ(OFS_LINE_STATUS) & 0x1) == 0);
+	return UART16550_READ(OFS_RCV_BUFFER);
+}
+
+
+int putDebugChar(uint8 byte)
+{
+	if (!remoteDebugInitialized) {
+		remoteDebugInitialized = 1;
+		debugInit(UART16550_BAUD_9600,
+			  UART16550_DATA_8BIT,
+			  UART16550_PARITY_NONE, UART16550_STOP_1BIT);
+	}
+
+	while ((UART16550_READ(OFS_LINE_STATUS) & 0x20) == 0);
+	UART16550_WRITE(OFS_SEND_BUFFER, byte);
+	return 1;
+}
+
+#endif
diff -u --recursive --new-file v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/int-handler.S linux/arch/mips/gt64120/momenco_ocelot/int-handler.S
--- v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/int-handler.S	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/gt64120/momenco_ocelot/int-handler.S	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: jsun@mvista.com or jsun@junsun.net
+ *
+ * First-level interrupt dispatcher for ocelot board.
+ *
+ * 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/asm.h>
+#include <asm/mipsregs.h>
+#include <asm/addrspace.h>
+#include <asm/regdef.h>
+#include <asm/stackframe.h>
+
+/*
+ * first level interrupt dispatcher for ocelot board -
+ * We check for the timer first, then check PCI ints A and D.
+ * Then check for serial IRQ and fall through.
+ */
+		.align	5
+		NESTED(ocelot_handle_int, PT_SIZE, sp)
+		SAVE_ALL
+		CLI
+		.set	at
+		mfc0	t0, CP0_CAUSE  
+		mfc0	t2, CP0_STATUS
+
+		and	t0, t2
+        
+		 andi	t1, t0, STATUSF_IP2	/* int0 hardware line */
+		bnez	t1, ll_pri_enet_irq
+		 andi	t1, t0, STATUSF_IP3	/* int1 hardware line */
+		bnez	t1, ll_sec_enet_irq
+		 andi	t1, t0, STATUSF_IP4	/* int2 hardware line */
+		bnez	t1, ll_uart1_irq
+		 andi	t1, t0, STATUSF_IP5	/* int3 hardware line */
+		bnez	t1, ll_cpci_irq
+		 andi	t1, t0, STATUSF_IP6	/* int4 hardware line */
+		bnez	t1, ll_galileo_irq
+		 andi	t1, t0, STATUSF_IP7	/* cpu timer */
+		bnez	t1, ll_cputimer_irq
+
+                /* now look at the extended interrupts */
+		mfc0	t0, CP0_CAUSE  
+		cfc0	t1, CP0_S1_INTCONTROL
+
+		/* shift the mask 8 bits left to line up the bits */
+		 sll	t2, t1, 8
+
+		 and	t0, t2
+		 srl	t0, t0, 16
+
+		 andi	t1, t0, STATUSF_IP8	/* int6 hardware line */
+		bnez	t1, ll_pmc1_irq
+		 andi	t1, t0, STATUSF_IP9	/* int7 hardware line */
+		bnez	t1, ll_pmc2_irq
+		 andi	t1, t0, STATUSF_IP10	/* int8 hardware line */
+		bnez	t1, ll_cpci_abcd_irq
+		 andi	t1, t0, STATUSF_IP11	/* int9 hardware line */
+		bnez	t1, ll_uart2_irq
+
+		.set	reorder
+
+		/* wrong alarm or masked ... */
+		j	spurious_interrupt
+		nop
+		END(ocelot_handle_int)
+
+		.align	5
+ll_pri_enet_irq:
+		li	a0, 2
+		move	a1, sp
+		jal	do_IRQ
+		j	ret_from_irq
+
+ll_sec_enet_irq:
+		li	a0, 3
+		move	a1, sp
+		jal	do_IRQ
+		j	ret_from_irq
+
+ll_uart1_irq:
+		li	a0, 4
+		move	a1, sp
+		jal	do_IRQ
+		j	ret_from_irq
+	
+ll_cpci_irq:
+		li	a0, 5
+		move	a1, sp
+		jal	do_IRQ
+		j	ret_from_irq
+
+ll_galileo_irq:
+		li	a0, 6
+		move	a1, sp
+		jal	do_IRQ
+		j	ret_from_irq
+
+ll_cputimer_irq:
+		li	a0, 7
+		move	a1, sp
+		jal	do_IRQ
+		j	ret_from_irq
+	
+ll_pmc1_irq:
+		li	a0, 8
+		move	a1, sp
+		jal	do_IRQ
+		j	ret_from_irq
+
+ll_pmc2_irq:
+		li	a0, 9
+		move	a1, sp
+		jal	do_IRQ
+		j	ret_from_irq
+
+ll_cpci_abcd_irq:
+		li	a0, 10
+		move	a1, sp
+		jal	do_IRQ
+		j	ret_from_irq
+
+ll_uart2_irq:
+		li	a0, 11
+		move	a1, sp
+		jal	do_IRQ
+		j	ret_from_irq
diff -u --recursive --new-file v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/irq.c linux/arch/mips/gt64120/momenco_ocelot/irq.c
--- v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/irq.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/gt64120/momenco_ocelot/irq.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,173 @@
+/*
+ * Copyright (C) 2000 RidgeRun, Inc.
+ * Author: RidgeRun, Inc.
+ *   glonnon@ridgerun.com, skranz@ridgerun.com, stevej@ridgerun.com
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
+ * Copyright (C) 2000, 2001 Ralf Baechle (ralf@gnu.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  SOFTWARE  IS PROVIDED   ``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.
+ *
+ *  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/errno.h>
+#include <linux/init.h>
+#include <linux/kernel_stat.h>
+#include <linux/module.h>
+#include <linux/signal.h>
+#include <linux/sched.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/timex.h>
+#include <linux/slab.h>
+#include <linux/random.h>
+#include <linux/irq.h>
+#include <asm/bitops.h>
+#include <asm/bootinfo.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mipsregs.h>
+#include <asm/system.h>
+
+
+static spinlock_t rm7000_irq_lock = SPIN_LOCK_UNLOCKED;
+
+/* Function for careful CP0 interrupt mask access */
+static inline void modify_cp0_intmask(unsigned clr_mask_in, unsigned set_mask_in)
+{
+	unsigned long status;
+	unsigned clr_mask;
+	unsigned set_mask;
+
+	/* do the low 8 bits first */
+	clr_mask = 0xff & clr_mask_in;
+	set_mask = 0xff & set_mask_in;
+	status = read_32bit_cp0_register(CP0_STATUS);
+	status &= ~((clr_mask & 0xFF) << 8);
+	status |= (set_mask & 0xFF) << 8;
+	write_32bit_cp0_register(CP0_STATUS, status);
+
+	/* do the high 8 bits */
+	clr_mask = 0xff & (clr_mask_in >> 8);
+	set_mask = 0xff & (set_mask_in >> 8);
+	status = read_32bit_cp0_set1_register(CP0_S1_INTCONTROL);
+	status &= ~((clr_mask & 0xFF) << 8);
+	status |= (set_mask & 0xFF) << 8;
+	write_32bit_cp0_set1_register(CP0_S1_INTCONTROL, status);
+}
+
+static inline void mask_irq(unsigned int irq)
+{
+	modify_cp0_intmask(irq, 0);
+}
+
+static inline void unmask_irq(unsigned int irq)
+{
+	modify_cp0_intmask(0, irq);
+}
+
+static void enable_cp7000_irq(unsigned int irq)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&rm7000_irq_lock, flags);
+	unmask_irq(1 << irq);
+	spin_unlock_irqrestore(&rm7000_irq_lock, flags);
+}
+
+static unsigned int startup_cp7000_irq(unsigned int irq)
+{
+	enable_cp7000_irq(irq);
+
+	return 0;				/* never anything pending */
+}
+
+static void disable_cp7000_irq(unsigned int irq)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&rm7000_irq_lock, flags);
+	mask_irq(1 << irq);
+	spin_unlock_irqrestore(&rm7000_irq_lock, flags);
+}
+
+#define shutdown_cp7000_irq disable_cp7000_irq
+
+static void mask_and_ack_cp7000_irq(unsigned int irq)
+{
+	mask_irq(1 << irq);
+}
+
+static void end_cp7000_irq(unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		unmask_irq(1 << irq);
+}
+
+static struct hw_interrupt_type cp7000_hpcdma_irq_type = {
+	"CP7000",
+	startup_cp7000_irq,
+	shutdown_cp7000_irq,
+	enable_cp7000_irq,
+	disable_cp7000_irq,
+	mask_and_ack_cp7000_irq,
+	end_cp7000_irq,
+	NULL
+};
+
+
+extern asmlinkage void ocelot_handle_int(void);
+extern void gt64120_irq_init(void);
+
+void __init init_IRQ(void)
+{
+	int i;
+
+	/*
+	 * Clear all of the interrupts while we change the able around a bit.
+	 * int-handler is not on bootstrap
+	 */
+	clear_cp0_status(ST0_IM | ST0_BEV);
+	__cli();
+
+	/* Sets the first-level interrupt dispatcher. */
+	set_except_vector(0, ocelot_handle_int);
+	init_generic_irq();
+
+	for (i = 0; i <= 15; i++) {
+		irq_desc[i].status	= IRQ_DISABLED;
+		irq_desc[i].action	= 0;
+		irq_desc[i].depth	= 1;
+		irq_desc[i].handler	= &cp7000_hpcdma_irq_type;
+	}
+
+	gt64120_irq_init();
+
+#ifdef CONFIG_REMOTE_DEBUG
+	printk("start kgdb ...\n");
+	set_debug_traps();
+	breakpoint();	/* you may move this line to whereever you want :-) */
+#endif
+#ifdef CONFIG_GDB_CONSOLE
+	register_gdb_console();
+#endif
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/ocelot_pld.h linux/arch/mips/gt64120/momenco_ocelot/ocelot_pld.h
--- v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/ocelot_pld.h	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/gt64120/momenco_ocelot/ocelot_pld.h	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,34 @@
+/*
+ * $Id$
+ *
+ * Ocelot Board Register Definitions
+ *
+ * (C) 2001 Red Hat, Inc.
+ *
+ * GPL'd
+ *
+ */
+
+#ifndef __MOMENCO_OCELOT_PLD_H__
+#define __MOMENCO_OCELOT_PLD_H__
+
+#define OCELOT_CS0_ADDR (0xe0020000)
+
+#define OCELOT_REG_BOARDREV (0)
+#define OCELOT_REG_PLD1_ID (1)
+#define OCELOT_REG_PLD2_ID (2)
+#define OCELOT_REG_RESET_STATUS (3)
+#define OCELOT_REG_BOARD_STATUS (4)
+#define OCELOT_REG_CPCI_ID (5)
+#define OCELOT_REG_I2C_CTRL (8)
+#define OCELOT_REG_EEPROM_MODE (9)
+#define OCELOT_REG_INTMASK (10)
+#define OCELOT_REG_INTSTATUS (11)
+#define OCELOT_REG_INTSET (12)
+#define OCELOT_REG_INTCLR (13)
+
+#define OCELOT_PLD_WRITE(x, y) writeb(x, OCELOT_CS0_ADDR + OCELOT_REG_##y)
+#define OCELOT_PLD_READ(x) readb(OCELOT_CS0_ADDR + OCELOT_REG_##x)
+
+
+#endif /* __MOMENCO_OCELOT_PLD_H__ */
diff -u --recursive --new-file v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/pci.c linux/arch/mips/gt64120/momenco_ocelot/pci.c
--- v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/pci.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/gt64120/momenco_ocelot/pci.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
+ *
+ * arch/mips/gt64120/momenco_ocelot/pci.c
+ *     Board-specific PCI routines for gt64120 controller.
+ *
+ * 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/types.h>
+#include <linux/pci.h>
+#include <linux/kernel.h>
+#include <linux/version.h>
+#include <linux/init.h>
+#include <asm/pci.h>
+
+
+void __init gt64120_board_pcibios_fixup_bus(struct pci_bus *bus)
+{
+	struct pci_bus *current_bus = bus;
+	struct pci_dev *devices;
+	struct list_head *devices_link;
+	u16 cmd;
+
+	list_for_each(devices_link, &(current_bus->devices)) {
+
+		devices = pci_dev_b(devices_link);
+		if (devices == NULL)
+			continue;
+
+		if (PCI_SLOT(devices->devfn) == 1) {
+			/*
+			 * Slot 1 is primary ether port, i82559
+			 * we double-check against that assumption
+			 */
+			if ((devices->vendor != 0x8086) ||
+			    (devices->device != 0x1209) ) {
+				panic("gt64120_board_pcibios_fixup_bus: found "
+				      "unexpected PCI device in slot 1.");
+			}
+			devices->irq = 2;       /* irq_nr is 2 for INT0 */
+		} else if (PCI_SLOT(devices->devfn) == 2) {
+			/*
+			 * Slot 2 is secondary ether port, i21143 
+			 * we double-check against that assumption
+			 */
+			if ((devices->vendor != 0x1011) ||
+			    (devices->device != 0x19) ) {
+				panic("galileo_pcibios_fixup_bus: "
+				      "found unexpected PCI device in slot 2.");
+			}
+			devices->irq = 3;       /* irq_nr is 3 for INT1 */
+		} else if (PCI_SLOT(devices->devfn) == 4) {
+			/* PMC Slot 1 */
+			devices->irq = 8;       /* irq_nr is 8 for INT6 */
+		} else if (PCI_SLOT(devices->devfn) == 5) {
+			/* PMC Slot 1 */
+			devices->irq = 9;       /* irq_nr is 9 for INT7 */
+		} else {
+			/* We don't have assign interrupts for other devices. */
+			devices->irq = 0xff;
+		}
+
+		/* Assign an interrupt number for the device */
+		bus->ops->write_byte(devices, PCI_INTERRUPT_LINE, devices->irq);
+
+		/* enable master */
+		bus->ops->read_word(devices, PCI_COMMAND, &cmd);
+		cmd |= PCI_COMMAND_MASTER;
+		bus->ops->write_word(devices, PCI_COMMAND, cmd);
+	}
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/prom.c linux/arch/mips/gt64120/momenco_ocelot/prom.c
--- v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/prom.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/gt64120/momenco_ocelot/prom.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: jsun@mvista.com or jsun@junsun.net
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/bootmem.h>
+
+#include <asm/addrspace.h>
+#include <asm/bootinfo.h>
+
+#define PLD_BASE	0xbc000000
+
+#define REV             0x0     /* Board Assembly Revision */
+#define PLD1ID          0x1     /* PLD 1 ID */
+#define PLD2ID          0x2     /* PLD 2 ID */
+#define RESET_STAT      0x3     /* Reset Status Register */
+#define BOARD_STAT      0x4     /* Board Status Register */
+#define CPCI_ID         0x5     /* Compact PCI ID Register */
+#define CONTROL         0x8     /* Control Register */
+#define CPU_EEPROM      0x9     /* CPU Configuration EEPROM Register */
+#define INTMASK         0xA     /* Interrupt Mask Register */
+#define INTSTAT         0xB     /* Interrupt Status Register */
+#define INTSET          0xC     /* Interrupt Set Register */
+#define INTCLR          0xD     /* Interrupt Clear Register */
+
+#define PLD_REG(x)	((uint8_t*)(PLD_BASE+(x)))
+
+char arcs_cmdline[COMMAND_LINE_SIZE];
+
+/* [jsun@junsun.net] PMON passes arguments in C main() style */
+void __init prom_init(int argc, const char **arg)
+{
+	int i;
+
+	/* arg[0] is "g", the rest is boot parameters */
+	arcs_cmdline[0] = '\0';
+	for (i = 1; i < argc; i++) {
+		if (strlen(arcs_cmdline) + strlen(arg[i] + 1)
+		    >= sizeof(arcs_cmdline))
+			break;
+		strcat(arcs_cmdline, arg[i]);
+		strcat(arcs_cmdline, " ");
+	}
+
+	mips_machgroup = MACH_GROUP_MOMENCO;
+	mips_machtype = MACH_MOMENCO_OCELOT;
+
+	/* turn off the Bit Error LED, which comes on automatically
+	 * at power-up reset */
+	*PLD_REG(INTCLR) = 0x80;
+
+	/* All the boards have at least 64MiB. If there's more, we
+	   detect and register it later */
+	add_memory_region(0, 64 << 20, BOOT_MEM_RAM);
+}
+
+void __init prom_free_prom_memory(void)
+{
+}
+
+void __init prom_fixup_mem_map(unsigned long start, unsigned long end)
+{
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/reset.c linux/arch/mips/gt64120/momenco_ocelot/reset.c
--- v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/reset.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/gt64120/momenco_ocelot/reset.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ *
+ * Copyright (C) 1997, 2001 Ralf Baechle
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: jsun@mvista.com or jsun@junsun.net
+ */
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <asm/io.h>
+#include <asm/pgtable.h>
+#include <asm/processor.h>
+#include <asm/reboot.h>
+#include <asm/system.h>
+
+void momenco_ocelot_restart(char *command)
+{
+	*(volatile char *) 0xbc000000 = 0x0f;
+
+	/*
+	 * Ouch, we're still alive ... This time we take the silver bullet ...
+	 * ... and find that we leave the hardware in a state in which the
+	 * kernel in the flush locks up somewhen during of after the PCI
+	 * detection stuff.
+	 */
+	clear_cp0_status(ST0_BEV | ST0_ERL);
+	change_cp0_config(CONF_CM_CMASK, CONF_CM_UNCACHED);
+	flush_cache_all();
+	write_32bit_cp0_register(CP0_WIRED, 0);
+	__asm__ __volatile__("jr\t%0"::"r"(0xbfc00000));
+}
+
+void momenco_ocelot_halt(void)
+{
+	printk(KERN_NOTICE "\n** You can safely turn off the power\n");
+	while (1)
+		__asm__(".set\tmips3\n\t"
+	                "wait\n\t"
+			".set\tmips0");
+}
+
+void momenco_ocelot_power_off(void)
+{
+	momenco_ocelot_halt();
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/setup.c linux/arch/mips/gt64120/momenco_ocelot/setup.c
--- v2.4.9/linux/arch/mips/gt64120/momenco_ocelot/setup.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/gt64120/momenco_ocelot/setup.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,282 @@
+/*
+ * setup.c
+ *
+ * BRIEF MODULE DESCRIPTION
+ * Galileo Evaluation Boards - board dependent boot routines
+ *
+ * Copyright (C) 1996, 1997, 2001  Ralf Baechle
+ * Copyright (C) 2000 RidgeRun, Inc.
+ * Copyright (C) 2001 Red Hat, Inc.
+ *
+ * Author: RidgeRun, Inc.
+ *   glonnon@ridgerun.com, skranz@ridgerun.com, stevej@ridgerun.com
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: jsun@mvista.com or jsun@junsun.net
+ *
+ *  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  SOFTWARE  IS PROVIDED   ``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.
+ *
+ *  You should have received a copy of the  GNU General Public License along
+ *  with this program; if not, write  to the Free Software Foundation, Inc.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/mc146818rtc.h>
+#include <linux/mm.h>
+#include <linux/swap.h>
+#include <linux/ioport.h>
+#include <linux/sched.h>
+#include <linux/interrupt.h>
+#include <linux/pci.h>
+#include <linux/timex.h>
+#include <linux/vmalloc.h>
+#include <asm/time.h>
+#include <asm/bootinfo.h>
+#include <asm/page.h>
+#include <asm/bootinfo.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/pci.h>
+#include <asm/processor.h>
+#include <asm/ptrace.h>
+#include <asm/reboot.h>
+#include <asm/mc146818rtc.h>
+#include <linux/version.h>
+#include <linux/bootmem.h>
+#include <linux/blk.h>
+#include <asm/gt64120/gt64120.h>
+#include "ocelot_pld.h"
+
+extern struct rtc_ops no_rtc_ops;
+
+unsigned long gt64120_base = KSEG1ADDR(GT_DEF_BASE);
+
+/* These functions are used for rebooting or halting the machine*/
+extern void momenco_ocelot_restart(char *command);
+extern void momenco_ocelot_halt(void);
+extern void momenco_ocelot_power_off(void);
+
+extern void gt64120_time_init(void);
+extern void momenco_ocelot_irq_setup(void);
+
+static char reset_reason;
+
+#define ENTRYLO(x) ((pte_val(mk_pte_phys((x), PAGE_KERNEL_UNCACHED)) >> 6)|1)
+
+static void __init setup_l3cache(unsigned long size);
+
+void __init momenco_ocelot_setup(void)
+{
+	void (*l3func)(unsigned long)=KSEG1ADDR(&setup_l3cache);
+	unsigned int tmpword;
+
+	board_time_init = gt64120_time_init;
+
+	_machine_restart = momenco_ocelot_restart;
+	_machine_halt = momenco_ocelot_halt;
+	_machine_power_off = momenco_ocelot_power_off;
+
+	/*
+	 * initrd_start = (ulong)ocelot_initrd_start;
+	 * initrd_end = (ulong)ocelot_initrd_start + (ulong)ocelot_initrd_size;
+	 * initrd_below_start_ok = 1;
+	 */
+	rtc_ops = &no_rtc_ops;
+
+
+	/* A wired TLB entry for the GT64120A and the serial port. The
+	   GT64120A is going to be hit on every IRQ anyway - there's
+	   absolutely no point in letting it be a random TLB entry, as
+	   it'll just cause needless churning of the TLB. And we use
+	   the other half for the serial port, which is just a PITA
+	   otherwise :)
+
+		Device			Physical	Virtual
+		GT64120 Internal Regs	0x24000000	0xe0000000
+		UARTs (CS2)		0x2d000000	0xe0001000
+	*/
+	add_wired_entry(ENTRYLO(0x24000000), ENTRYLO(0x2D000000), 0xe0000000, PM_4K);
+
+	/* Also a temporary entry to let us talk to the Ocelot PLD and NVRAM
+	   in the CS[012] region. We can't use ioremap() yet. The NVRAM
+	   appears to be one of the variants of ST M48T35 - see 
+	   http://www.st.com/stonline/bin/sftab.exe?table=172&filter0=M48T35
+
+		Ocelot PLD (CS0)	0x2c000000	0xe0020000
+		NVRAM			0x2c800000	0xe0030000
+	*/
+		
+	add_temporary_entry(ENTRYLO(0x2C000000), ENTRYLO(0x2d000000), 0xe0020000, PM_64K);
+
+
+	/* Relocate the CS3/BootCS region */
+  	GT_WRITE( GT_CS3BOOTLD_OFS, 0x2f000000 >> 21);
+
+	/* Relocate CS[012] */
+ 	GT_WRITE(GT_CS20LD_OFS, 0x2c000000 >> 21);
+
+	/* Relocate the GT64120A itself... */
+	GT_WRITE(GT_ISD_OFS, 0x24000000 >> 21);
+	mb();
+	gt64120_base = 0xe0000000;
+
+	/* ...and the PCI0 view of it. */
+	GT_WRITE(GT_PCI0_CFGADDR_OFS, 0x80000020);
+	GT_WRITE(GT_PCI0_CFGDATA_OFS, 0x24000000);
+	GT_WRITE(GT_PCI0_CFGADDR_OFS, 0x80000024);
+	GT_WRITE(GT_PCI0_CFGDATA_OFS, 0x24000001);
+
+	/* Relocate PCI0 I/O and Mem0 */
+	GT_WRITE(GT_PCI0IOLD_OFS, 0x20000000 >> 21);
+	GT_WRITE(GT_PCI0M0LD_OFS, 0x22000000 >> 21);
+
+	/* Relocate PCI0 Mem1 */
+	GT_WRITE(GT_PCI0M1LD_OFS, 0x36000000 >> 21);
+
+	/* Relocate all the PCI1 stuff, not that we use it */
+	GT_WRITE(GT_PCI1IOLD_OFS, 0x30000000 >> 21);
+	GT_WRITE(GT_PCI1M0LD_OFS, 0x32000000 >> 21);
+	GT_WRITE(GT_PCI1M1LD_OFS, 0x34000000 >> 21);
+
+	/* Relocate the CPU's view of the RAM... */
+	GT_WRITE(GT_SCS10LD_OFS, 0);
+	GT_WRITE(GT_SCS10HD_OFS, 0x0fe00000 >> 21);
+	GT_WRITE(GT_SCS32LD_OFS, 0x10000000 >> 21);
+	GT_WRITE(GT_SCS32HD_OFS, 0x0fe00000 >> 21);
+
+	GT_WRITE(GT_SCS1LD_OFS, 0xff);
+	GT_WRITE(GT_SCS1HD_OFS, 0x00);
+	GT_WRITE(GT_SCS0LD_OFS, 0);
+	GT_WRITE(GT_SCS0HD_OFS, 0xff);
+	GT_WRITE(GT_SCS3LD_OFS, 0xff);
+	GT_WRITE(GT_SCS3HD_OFS, 0x00);
+	GT_WRITE(GT_SCS2LD_OFS, 0);
+	GT_WRITE(GT_SCS2HD_OFS, 0xff);
+
+	/* ...and the PCI0 view of it. */
+	GT_WRITE(GT_PCI0_CFGADDR_OFS, 0x80000010);
+	GT_WRITE(GT_PCI0_CFGDATA_OFS, 0x00000000);
+	GT_WRITE(GT_PCI0_CFGADDR_OFS, 0x80000014);
+	GT_WRITE(GT_PCI0_CFGDATA_OFS, 0x10000000);
+	GT_WRITE(GT_PCI0_BS_SCS10_OFS, 0x0ffff000);
+	GT_WRITE(GT_PCI0_BS_SCS32_OFS, 0x0ffff000);
+
+	tmpword = OCELOT_PLD_READ(BOARDREV);
+	if (tmpword < 26)
+		printk("Momenco Ocelot: Board Assembly Rev. %c\n", 'A'+tmpword);
+	else
+		printk("Momenco Ocelot: Board Assembly Revision #0x%x\n", tmpword);
+
+	tmpword = OCELOT_PLD_READ(PLD1_ID);
+	printk("PLD 1 ID: %d.%d\n", tmpword>>4, tmpword&15);
+	tmpword = OCELOT_PLD_READ(PLD2_ID);
+	printk("PLD 2 ID: %d.%d\n", tmpword>>4, tmpword&15);
+	tmpword = OCELOT_PLD_READ(RESET_STATUS);
+	printk("Reset reason: 0x%x\n", tmpword);
+	reset_reason = tmpword;
+	OCELOT_PLD_WRITE(0xff, RESET_STATUS);
+
+	tmpword = OCELOT_PLD_READ(BOARD_STATUS);
+	printk("Board Status register: 0x%02x\n", tmpword);
+	printk("  - User jumper: %s\n", (tmpword & 0x80)?"installed":"absent");
+	printk("  - Boot flash write jumper: %s\n", (tmpword&0x40)?"installed":"absent");
+	printk("  - Tulip PHY %s connected\n", (tmpword&0x10)?"is":"not");
+	printk("  - L3 Cache size: %d MiB\n", (1<<((tmpword&12) >> 2))&~1);
+	printk("  - SDRAM size: %d MiB\n", 1<<(6+(tmpword&3)));
+
+	if (tmpword&12)
+		l3func((1<<(((tmpword&12) >> 2)+20)));
+
+	switch(tmpword &3) {
+	case 3:
+		/* 512MiB */
+		add_memory_region(256<<20, 256<<20, BOOT_MEM_RAM);
+	case 2:
+		/* 256MiB */
+		/* FIXME: Is it actually here, or at 0x10000000? */
+		add_memory_region(128<<20, 128<<20, BOOT_MEM_RAM);
+	case 1:
+		/* 128MiB */
+		add_memory_region(64<<20, 64<<20, BOOT_MEM_RAM);
+	case 0:
+		/* 64MiB */
+		;
+	}
+
+	/* Fix up the DiskOnChip mapping */
+	GT_WRITE(0x468, 0xfef73);
+}
+
+extern int rm7k_tcache_enabled;
+/*
+ * This runs in KSEG1. See the verbiage in rm7k.c::probe_scache()
+ */
+#define Page_Invalidate_T 0x16
+static void __init setup_l3cache(unsigned long size)
+{
+	int register i;
+	unsigned long tmp;
+	
+	printk("Enabling L3 cache...");
+
+	/* Enable the L3 cache in the GT64120A's CPU Configuration register */
+	GT_READ(0, &tmp);
+	GT_WRITE(0, tmp | (1<<14));
+
+	/* Enable the L3 cache in the CPU */
+	set_cp0_config(1<<12 /* CONF_TE */);
+
+	/* Clear the cache */
+	set_taglo(0);
+	set_taghi(0);
+
+	for (i=0; i < size; i+= 4096) {
+		__asm__ __volatile__ (
+			".set noreorder\n\t"
+			".set mips3\n\t"
+			"cache %1, (%0)\n\t"
+			".set mips0\n\t"
+			".set reorder"
+			:
+			: "r" (KSEG0ADDR(i)),
+			  "i" (Page_Invalidate_T));
+	}
+
+	/* Let the RM7000 MM code know that the tertiary cache is enabled */
+	rm7k_tcache_enabled = 1;
+
+	printk("Done\n");
+}
+
+
+/* This needs to be one of the first initcalls, because no I/O port access
+   can work before this */
+
+static int io_base_ioremap(void)
+{
+	void *io_remap_range = ioremap(GT_PCI_IO_BASE, GT_PCI_IO_SIZE);
+	if (!io_remap_range) {
+		panic("Could not ioremap I/O port range\n");
+	}
+	mips_io_port_base = io_remap_range - GT_PCI_IO_BASE;
+	return 0;
+}
+module_init(io_base_ioremap);
+
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/generic/Makefile linux/arch/mips/ite-boards/generic/Makefile
--- v2.4.9/linux/arch/mips/ite-boards/generic/Makefile	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ite-boards/generic/Makefile	Sun Sep  9 10:43:01 2001
@@ -1,7 +1,7 @@
 #
 #  Copyright 2000 MontaVista Software Inc.
 #  Author: MontaVista Software, Inc.
-#     	ppopov@mvista.com or support@mvista.com
+#     	ppopov@mvista.com or source@mvista.com
 #
 # Makefile for the ITE 8172 (qed-4n-s01b) board, generic files.
 #
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/generic/dbg_io.c linux/arch/mips/ite-boards/generic/dbg_io.c
--- v2.4.9/linux/arch/mips/ite-boards/generic/dbg_io.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ite-boards/generic/dbg_io.c	Sun Sep  9 10:43:01 2001
@@ -7,8 +7,8 @@
 
 /* we need uint32 uint8 */
 /* #include "types.h" */
-typedef         unsigned char uint8;
-typedef         unsigned int  uint32;
+typedef unsigned char uint8;
+typedef unsigned int uint32;
 
 /* --- END OF CONFIG --- */
 
@@ -39,7 +39,7 @@
 /* === CONFIG === */
 
 /* [stevel] we use the IT8712 serial port for kgdb */
-#define	DEBUG_BASE  0xB40003F8 /* 8712 serial port 1 base address */
+#define	DEBUG_BASE  0xB40003F8	/* 8712 serial port 1 base address */
 #define MAX_BAUD    115200
 
 /* === END OF CONFIG === */
@@ -69,59 +69,57 @@
 
 void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
 {
-    /* disable interrupts */
-    UART16550_WRITE(OFS_INTR_ENABLE, 0);
+	/* disable interrupts */
+	UART16550_WRITE(OFS_INTR_ENABLE, 0);
 
-    /* set up buad rate */
-    { 
-        uint32 divisor;
-       
-        /* set DIAB bit */
-        UART16550_WRITE(OFS_LINE_CONTROL, 0x80);
-        
-        /* set divisor */
-        divisor = MAX_BAUD / baud;
-        UART16550_WRITE(OFS_DIVISOR_LSB, divisor & 0xff);
-        UART16550_WRITE(OFS_DIVISOR_MSB, (divisor & 0xff00)>>8);
-
-        /* clear DIAB bit */
-        UART16550_WRITE(OFS_LINE_CONTROL, 0x0);
-    }
+	/* set up buad rate */
+	{
+		uint32 divisor;
+
+		/* set DIAB bit */
+		UART16550_WRITE(OFS_LINE_CONTROL, 0x80);
+
+		/* set divisor */
+		divisor = MAX_BAUD / baud;
+		UART16550_WRITE(OFS_DIVISOR_LSB, divisor & 0xff);
+		UART16550_WRITE(OFS_DIVISOR_MSB, (divisor & 0xff00) >> 8);
+
+		/* clear DIAB bit */
+		UART16550_WRITE(OFS_LINE_CONTROL, 0x0);
+	}
 
-    /* set data format */
-    UART16550_WRITE(OFS_DATA_FORMAT, data | parity | stop);
+	/* set data format */
+	UART16550_WRITE(OFS_DATA_FORMAT, data | parity | stop);
 }
 
 static int remoteDebugInitialized = 0;
 
 uint8 getDebugChar(void)
 {
-    if (!remoteDebugInitialized) {
-	remoteDebugInitialized = 1;
-	debugInit(UART16550_BAUD_115200,
-		  UART16550_DATA_8BIT,
-		  UART16550_PARITY_NONE,
-		  UART16550_STOP_1BIT);
-    }
+	if (!remoteDebugInitialized) {
+		remoteDebugInitialized = 1;
+		debugInit(UART16550_BAUD_115200,
+			  UART16550_DATA_8BIT,
+			  UART16550_PARITY_NONE, UART16550_STOP_1BIT);
+	}
 
-    while((UART16550_READ(OFS_LINE_STATUS) & 0x1) == 0);
-    return UART16550_READ(OFS_RCV_BUFFER);
+	while ((UART16550_READ(OFS_LINE_STATUS) & 0x1) == 0);
+	return UART16550_READ(OFS_RCV_BUFFER);
 }
 
 
 int putDebugChar(uint8 byte)
 {
-    if (!remoteDebugInitialized) {
-	remoteDebugInitialized = 1;
-	debugInit(UART16550_BAUD_115200,
-		  UART16550_DATA_8BIT,
-		  UART16550_PARITY_NONE,
-		  UART16550_STOP_1BIT);
-    }
-
-    while ((UART16550_READ(OFS_LINE_STATUS) &0x20) == 0);
-    UART16550_WRITE(OFS_SEND_BUFFER, byte);
-    return 1;
+	if (!remoteDebugInitialized) {
+		remoteDebugInitialized = 1;
+		debugInit(UART16550_BAUD_115200,
+			  UART16550_DATA_8BIT,
+			  UART16550_PARITY_NONE, UART16550_STOP_1BIT);
+	}
+
+	while ((UART16550_READ(OFS_LINE_STATUS) & 0x20) == 0);
+	UART16550_WRITE(OFS_SEND_BUFFER, byte);
+	return 1;
 }
 
 #endif
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/generic/irq.c linux/arch/mips/ite-boards/generic/irq.c
--- v2.4.9/linux/arch/mips/ite-boards/generic/irq.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/mips/ite-boards/generic/irq.c	Sun Sep  9 10:43:01 2001
@@ -5,7 +5,7 @@
  *
  * Copyright 2000,2001 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or support@mvista.com
+ *         	ppopov@mvista.com or source@mvista.com
  *
  * Part of this file was derived from Carsten Langgaard's 
  * arch/mips/mips-boards/atlas/atlas_int.c.
@@ -33,7 +33,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
@@ -76,12 +75,13 @@
 extern void set_debug_traps(void);
 extern void mips_timer_interrupt(int irq, struct pt_regs *regs);
 extern asmlinkage void it8172_IRQ(void);
-irq_cpustat_t irq_stat [NR_CPUS];
 unsigned int local_bh_count[NR_CPUS];
 unsigned int local_irq_count[NR_CPUS];
 unsigned long spurious_count = 0;
 irq_desc_t irq_desc[NR_IRQS];
 irq_desc_t *irq_desc_base=&irq_desc[0];
+void disable_it8172_irq(unsigned int irq_nr);
+void enable_it8172_irq(unsigned int irq_nr);
 
 struct it8172_intc_regs volatile *it8172_hw0_icregs
 	= (struct it8172_intc_regs volatile *)(KSEG1ADDR(IT8172_PCI_IO_BASE + IT_INTC_BASE));
@@ -110,7 +110,7 @@
         unsigned long flags;
 
         save_and_cli(flags);
-        mask_irq(irq_nr);
+	disable_it8172_irq(irq_nr);
         restore_flags(flags);
 }
 
@@ -119,15 +119,13 @@
 	unsigned long flags;
 
         save_and_cli(flags);
-        unmask_irq(irq_nr);
+	enable_it8172_irq(irq_nr);
         restore_flags(flags);
 }
 
 
 void disable_it8172_irq(unsigned int irq_nr)
 {
-	unsigned short mask;
-
 	DPRINTK("disable_it8172_irq %d\n", irq_nr);
 
 	if ( (irq_nr >= IT8172_LPC_IRQ_BASE) && (irq_nr <= IT8172_SERIRQ_15)) {
@@ -290,7 +288,6 @@
 		printk("Unhandled interrupt %d, cause %x, disabled\n", 
 				(unsigned)irq, (unsigned)regs->cp0_cause);
 		disable_it8172_irq(irq);
-		//disable_irq(1<<irq);
 	}
 	irq_exit(cpu, irq);
 }
@@ -325,7 +322,6 @@
                         cli();
                         *p = action->next;
 			disable_it8172_irq(irq);
-                        //disable_irq(1<<irq);
                         restore_flags(flags);
                         kfree(action);
                         return 0;
@@ -378,7 +374,11 @@
 
 void enable_cpu_timer(void)
 {
-	enable_irq(1<<EXT_IRQ5_TO_IP); /* timer interrupt */
+        unsigned long flags;
+
+        save_and_cli(flags);
+	unmask_irq(1<<EXT_IRQ5_TO_IP); /* timer interrupt */
+        restore_flags(flags);
 }
 
 unsigned long probe_irq_on (void)
@@ -395,6 +395,8 @@
 void __init init_IRQ(void)
 {
 	int i;
+        unsigned long flags;
+
 
         memset(irq_desc, 0, sizeof(irq_desc));
         set_except_vector(0, it8172_IRQ);
@@ -440,8 +442,9 @@
 	 * Enable external int line 2
 	 * All ITE interrupts are masked for now.
 	 */
-	enable_irq(1<<EXT_IRQ0_TO_IP);
-	//change_cp0_status(ST0_IM, IE_IRQ2);
+        save_and_cli(flags);
+	unmask_irq(1<<EXT_IRQ0_TO_IP);
+        restore_flags(flags);
 
 #ifdef CONFIG_REMOTE_DEBUG
 	/* If local serial I/O used for debug port, enter kgdb at once */
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/generic/it8172_cir.c linux/arch/mips/ite-boards/generic/it8172_cir.c
--- v2.4.9/linux/arch/mips/ite-boards/generic/it8172_cir.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ite-boards/generic/it8172_cir.c	Sun Sep  9 10:43:01 2001
@@ -5,7 +5,7 @@
  *
  * Copyright 2001 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or support@mvista.com
+ *         	ppopov@mvista.com or source@mvista.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
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/generic/it8172_pci.c linux/arch/mips/ite-boards/generic/it8172_pci.c
--- v2.4.9/linux/arch/mips/ite-boards/generic/it8172_pci.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ite-boards/generic/it8172_pci.c	Sun Sep  9 10:43:01 2001
@@ -1,11 +1,10 @@
 /*
- *
  * BRIEF MODULE DESCRIPTION
  *	IT8172 system controller specific pci support.
  *
  * Copyright 2000 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or support@mvista.com
+ *         	ppopov@mvista.com or source@mvista.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
@@ -271,6 +270,12 @@
 
 void __init pcibios_fixup_bus(struct pci_bus *b)
 {
-	printk("pcibios_fixup_bus\n");
+	//printk("pcibios_fixup_bus\n");
 }
+
+unsigned __init int pcibios_assign_all_busses(void)
+{
+	return 1;
+}
+
 #endif /* CONFIG_PCI */
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/generic/it8172_rtc.c linux/arch/mips/ite-boards/generic/it8172_rtc.c
--- v2.4.9/linux/arch/mips/ite-boards/generic/it8172_rtc.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ite-boards/generic/it8172_rtc.c	Sun Sep  9 10:43:01 2001
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or support@mvista.com
+ *         	ppopov@mvista.com or source@mvista.com
  *
  * Carsten Langgaard, carstenl@mips.com
  * Copyright (C) 1999,2000 MIPS Technologies, Inc.  All rights reserved.
@@ -26,7 +26,6 @@
  * RTC routines for ITE8172 MC146818-compatible rtc chip.
  *
  */
-#include <asm/spinlock.h>
 #include <linux/mc146818rtc.h>
 #include <asm/it8172/it8172.h>
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/generic/it8172_setup.c linux/arch/mips/ite-boards/generic/it8172_setup.c
--- v2.4.9/linux/arch/mips/ite-boards/generic/it8172_setup.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ite-boards/generic/it8172_setup.c	Sun Sep  9 10:43:01 2001
@@ -5,7 +5,7 @@
  *
  * Copyright 2000 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or support@mvista.com
+ *         	ppopov@mvista.com or source@mvista.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
@@ -66,7 +66,7 @@
 extern int SearchIT8712(void);
 extern void InitLPCInterface(void);
 extern char * __init prom_getcmdline(void);
-extern void it8172_restart(void);
+extern void it8172_restart(char *command);
 extern void it8172_halt(void);
 extern void it8172_power_off(void);
 
@@ -114,19 +114,18 @@
 
 void __init it8172_setup(void)
 {
-#ifdef CONFIG_BLK_DEV_IT8172
 	unsigned short dsr;
-#endif
 	char *argptr;
 
 	argptr = prom_getcmdline();
 #ifdef CONFIG_SERIAL_CONSOLE
-	if ((argptr = strstr(argptr, "console=ttyS0")) == NULL) {
-		strcpy(serial_console, "ttyS0,115200");
-		console_setup(serial_console, NULL);
+	if ((argptr = strstr(argptr, "console=")) == NULL) {
+		argptr = prom_getcmdline();
+		strcat(argptr, " console=ttyS0,115200");
 	}
 #endif	  
 
+	clear_cp0_status(ST0_FR);
 	rtc_ops = &it8172_rtc_ops;
 
 	_machine_restart = it8172_restart;
@@ -153,19 +152,25 @@
 	ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
 #endif
 
-#ifdef CONFIG_BLK_DEV_IT8172
 	/*
-	 * Pull IDE device out of standby mode.
+	 * Pull enabled devices out of standby
 	 */
 	IT_IO_READ16(IT_PM_DSR, dsr);
+#ifdef CONFIG_SOUND_IT8172
+	dsr &= ~IT_PM_DSR_ACSB;
+#else
+	dsr |= IT_PM_DSR_ACSB;
+#endif	
+#ifdef CONFIG_BLK_DEV_IT8172
 	dsr &= ~IT_PM_DSR_IDESB;
-	IT_IO_WRITE16(IT_PM_DSR, dsr);
-
 	ide_ops = &std_ide_ops;
+#else
+	dsr |= IT_PM_DSR_IDESB;
 #endif
+	IT_IO_WRITE16(IT_PM_DSR, dsr);
 
 #ifdef CONFIG_FB
-    conswitchp = &dummy_con;
+	conswitchp = &dummy_con;
 #endif
 
 	InitLPCInterface();
@@ -266,8 +271,6 @@
 	unsigned int data_port = 0x14000060;
 	unsigned char data;
 	int i;
-
-	printk("8712 keyboard init");
 
 	outb(0xaa, cmd_port); /* send self-test cmd */
 	i = 0;
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/generic/lpc.c linux/arch/mips/ite-boards/generic/lpc.c
--- v2.4.9/linux/arch/mips/ite-boards/generic/lpc.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ite-boards/generic/lpc.c	Sun Sep  9 10:43:01 2001
@@ -5,7 +5,7 @@
  *
  * Copyright 2001 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or support@mvista.com
+ *         	ppopov@mvista.com or source@mvista.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
@@ -41,7 +41,7 @@
 #define FALSE 0
 #endif
 
-void LPCEnterMBPnP()
+void LPCEnterMBPnP(void)
 {
 	int i;
 	unsigned char key[4] = {0x87, 0x01, 0x55, 0x55};
@@ -51,7 +51,7 @@
 
 }
 
-void LPCExitMBPnP()
+void LPCExitMBPnP(void)
 {
 	outb(0x02, LPC_KEY_ADDR);
 	outb(0x02, LPC_DATA_ADDR);
@@ -80,7 +80,7 @@
 	return rtn;
 }
 
-int SearchIT8712()
+int SearchIT8712(void)
 {
 	unsigned char Id1, Id2;
 	unsigned short Id;
@@ -98,7 +98,7 @@
 		return FALSE;
 }
 
-void InitLPCInterface()
+void InitLPCInterface(void)
 {
 	unsigned char bus, dev_fn;
 	unsigned long data;
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/generic/pmon_prom.c linux/arch/mips/ite-boards/generic/pmon_prom.c
--- v2.4.9/linux/arch/mips/ite-boards/generic/pmon_prom.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ite-boards/generic/pmon_prom.c	Sun Sep  9 10:43:01 2001
@@ -6,7 +6,7 @@
  *
  * Copyright 2000 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or support@mvista.com
+ *         	ppopov@mvista.com or source@mvista.com
  *
  * This file was derived from Carsten Langgaard's 
  * arch/mips/mips-boards/xx files.
@@ -35,6 +35,7 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/string.h>
@@ -44,8 +45,8 @@
 /* #define DEBUG_CMDLINE */
 
 char arcs_cmdline[COMMAND_LINE_SIZE];
-int prom_argc;
-char **prom_argv, **prom_envp;
+extern int prom_argc;
+extern char **prom_argv, **prom_envp;
 
 typedef struct
 {
@@ -126,12 +127,16 @@
 
 	memsize_str = prom_getenv("memsize");
 	if (!memsize_str) {
-		printk("memsize unknown: setting to 32MB\n");
+#ifdef CONFIG_MIPS_ITE8172
 		memsize = 32; 
-	} else {
-#ifdef DEBUG
-		printk("prom_memsize: %s\n", memsize_str);
+#elif defined(CONFIG_MIPS_IVR)
+		memsize = 64; 
+#else
+		memsize = 8; 
 #endif
+		printk("memsize unknown: setting to %dMB\n", memsize);
+	} else {
+		printk("memsize: %s\n", memsize_str);
 		memsize = simple_strtol(memsize_str, NULL, 0);
 	}
 	return memsize;
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/generic/puts.c linux/arch/mips/ite-boards/generic/puts.c
--- v2.4.9/linux/arch/mips/ite-boards/generic/puts.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ite-boards/generic/puts.c	Sun Sep  9 10:43:01 2001
@@ -5,7 +5,7 @@
  *
  * Copyright 2000,2001 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or support@mvista.com
+ *         	ppopov@mvista.com or source@mvista.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
@@ -30,7 +30,7 @@
 
 #include <linux/types.h>
 
-#define SERIAL_BASE   0xB4011800 /* it8172 */
+#define SERIAL_BASE   0xB4011800	/* it8172 */
 #define SER_CMD       5
 #define SER_DATA      0x00
 #define TX_BUSY       0x20
@@ -39,106 +39,101 @@
 #undef SLOW_DOWN
 
 static const char digits[16] = "0123456789abcdef";
-static volatile unsigned char * const com1 = (unsigned char *)SERIAL_BASE;
+static volatile unsigned char *const com1 = (unsigned char *) SERIAL_BASE;
 
 
 #ifdef SLOW_DOWN
 static inline void slow_down()
 {
-    int k;
-    for (k=0; k<10000; k++);
+	int k;
+	for (k = 0; k < 10000; k++);
 }
 #else
 #define slow_down()
 #endif
 
-void
-putch(const unsigned char c)
+void putch(const unsigned char c)
 {
-    unsigned char ch;
-    int i = 0;
+	unsigned char ch;
+	int i = 0;
 
-    do {
-        ch = com1[SER_CMD];
-        slow_down();
-        i++;
-        if (i>TIMEOUT) {
-            break;
-        }
-    } while (0 == (ch & TX_BUSY));
-    com1[SER_DATA] = c;
+	do {
+		ch = com1[SER_CMD];
+		slow_down();
+		i++;
+		if (i > TIMEOUT) {
+			break;
+		}
+	} while (0 == (ch & TX_BUSY));
+	com1[SER_DATA] = c;
 }
 
-void
-puts(unsigned char *cp)
+void puts(unsigned char *cp)
 {
-    unsigned char ch;
-    int i = 0;
+	unsigned char ch;
+	int i = 0;
 
-    while (*cp) {
-        do {
-             ch = com1[SER_CMD];
-            slow_down();
-            i++;
-            if (i>TIMEOUT) {
-                break;
-            }
-        } while (0 == (ch & TX_BUSY));
-        com1[SER_DATA] = *cp++;
-    }
-    putch('\r');
-    putch('\n');
+	while (*cp) {
+		do {
+			ch = com1[SER_CMD];
+			slow_down();
+			i++;
+			if (i > TIMEOUT) {
+				break;
+			}
+		} while (0 == (ch & TX_BUSY));
+		com1[SER_DATA] = *cp++;
+	}
+	putch('\r');
+	putch('\n');
 }
 
-void
-fputs(unsigned char *cp)
+void fputs(unsigned char *cp)
 {
-    unsigned char ch;
-    int i = 0;
+	unsigned char ch;
+	int i = 0;
 
-    while (*cp) {
+	while (*cp) {
 
-        do {
-             ch = com1[SER_CMD];
-             slow_down();
-            i++;
-            if (i>TIMEOUT) {
-                break;
-            }
-        } while (0 == (ch & TX_BUSY));
-        com1[SER_DATA] = *cp++;
-    }
+		do {
+			ch = com1[SER_CMD];
+			slow_down();
+			i++;
+			if (i > TIMEOUT) {
+				break;
+			}
+		} while (0 == (ch & TX_BUSY));
+		com1[SER_DATA] = *cp++;
+	}
 }
 
 
-void
-put64(uint64_t ul)
+void put64(uint64_t ul)
 {
-    int cnt;
-    unsigned ch;
+	int cnt;
+	unsigned ch;
 
-    cnt = 16;            /* 16 nibbles in a 64 bit long */
-    putch('0');
-    putch('x');
-    do {
-        cnt--;
-        ch = (unsigned char)(ul >> cnt * 4) & 0x0F;
-                putch(digits[ch]);
-    } while (cnt > 0);
+	cnt = 16;		/* 16 nibbles in a 64 bit long */
+	putch('0');
+	putch('x');
+	do {
+		cnt--;
+		ch = (unsigned char) (ul >> cnt * 4) & 0x0F;
+		putch(digits[ch]);
+	} while (cnt > 0);
 }
 
-void
-put32(unsigned u)
+void put32(unsigned u)
 {
-    int cnt;
-    unsigned ch;
+	int cnt;
+	unsigned ch;
 
-    cnt = 8;            /* 8 nibbles in a 32 bit long */
-    putch('0');
-    putch('x');
-    do {
-        cnt--;
-        ch = (unsigned char)(u >> cnt * 4) & 0x0F;
-                putch(digits[ch]);
-    } while (cnt > 0);
+	cnt = 8;		/* 8 nibbles in a 32 bit long */
+	putch('0');
+	putch('x');
+	do {
+		cnt--;
+		ch = (unsigned char) (u >> cnt * 4) & 0x0F;
+		putch(digits[ch]);
+	} while (cnt > 0);
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/generic/reset.c linux/arch/mips/ite-boards/generic/reset.c
--- v2.4.9/linux/arch/mips/ite-boards/generic/reset.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ite-boards/generic/reset.c	Sun Sep  9 10:43:01 2001
@@ -3,10 +3,9 @@
  * BRIEF MODULE DESCRIPTION
  *	ITE 8172 reset routines.
  *
- * Copyright (C) 1997, 2001 Ralf Baechle
  * Copyright 2001 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or support@mvista.com
+ *         	ppopov@mvista.com or source@mvista.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
@@ -37,7 +36,7 @@
 #include <asm/reboot.h>
 #include <asm/system.h>
 
-void it8172_restart(char *command)
+void it8172_restart()
 {
 	set_cp0_status(ST0_BEV | ST0_ERL);
 	change_cp0_config(CONF_CM_CMASK, CONF_CM_UNCACHED);
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/generic/time.c linux/arch/mips/ite-boards/generic/time.c
--- v2.4.9/linux/arch/mips/ite-boards/generic/time.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ite-boards/generic/time.c	Sun Sep  9 10:43:01 2001
@@ -23,6 +23,7 @@
  *
  */
 
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
 #include <linux/sched.h>
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/ivr/Makefile linux/arch/mips/ite-boards/ivr/Makefile
--- v2.4.9/linux/arch/mips/ite-boards/ivr/Makefile	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ite-boards/ivr/Makefile	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,28 @@
+#
+#  Copyright 2000 MontaVista Software Inc.
+#  Author: MontaVista Software, Inc.
+#     	ppopov@mvista.com or source@mvista.com
+#
+# Makefile for the Globespan IVR board,
+# board-specific files.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+
+.S.s:
+	$(CPP) $(CFLAGS) $< -o $*.s
+.S.o:
+	$(CC) $(CFLAGS) -c $< -o $*.o
+
+all: ivr.o
+
+O_TARGET := ivr.o
+
+obj-y := init.o 
+
+obj-CONFIG_PCI += pci_fixup.o
+obj-CONFIG_BLK_DEV_INITRD += le_ramdisk.o
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/ivr/README linux/arch/mips/ite-boards/ivr/README
--- v2.4.9/linux/arch/mips/ite-boards/ivr/README	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ite-boards/ivr/README	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,3 @@
+This is not really a board made by ITE Semi, but it's very 
+similar to the ITE QED-4N-S01B board.  The IVR board is made
+by Globespan and it's a reference board for the PVR chip.
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/ivr/init.c linux/arch/mips/ite-boards/ivr/init.c
--- v2.4.9/linux/arch/mips/ite-boards/ivr/init.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ite-boards/ivr/init.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,87 @@
+/*
+ *
+ * BRIEF MODULE DESCRIPTION
+ *	IVR board setup.
+ *
+ * Copyright 2000 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc.
+ *         	ppopov@mvista.com or source@mvista.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ *  THIS  SOFTWARE  IS PROVIDED   ``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.
+ *
+ *  You should have received a copy of the  GNU General Public License along
+ *  with this program; if not, write  to the Free Software Foundation, Inc.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/bootmem.h>
+#include <asm/addrspace.h>
+#include <asm/bootinfo.h>
+#include <linux/config.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <asm/it8172/it8172.h>
+#include <asm/it8172/it8172_dbg.h>
+
+int prom_argc;
+char **prom_argv, **prom_envp;
+
+extern char _end;
+extern void  __init prom_init_cmdline(void);
+extern unsigned long __init prom_get_memsize(void);
+extern void __init it8172_init_ram_resource(unsigned long memsize);
+
+#define PFN_UP(x)	(((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
+#define PFN_ALIGN(x)	(((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
+
+
+int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
+{
+	unsigned long mem_size;
+	unsigned long pcicr;
+
+	prom_argc = argc;
+	prom_argv = argv;
+	prom_envp = envp;
+
+	puts("IVR board running...");
+
+	mips_machgroup = MACH_GROUP_GLOBESPAN;
+	mips_machtype = MACH_IVR;  /* Globespan's iTVC15 reference board */
+
+	prom_init_cmdline();
+
+	/* pmon does not set memsize */
+	mem_size = prom_get_memsize();
+	mem_size = mem_size << 20;
+
+	/*
+	 * make the entire physical memory visible to pci bus masters
+	 */
+	IT_READ(IT_MC_PCICR, pcicr);
+	pcicr &= ~0x1f; 
+	pcicr |= (mem_size - 1) >> 22;
+	IT_WRITE(IT_MC_PCICR, pcicr);
+
+	it8172_init_ram_resource(mem_size);
+	add_memory_region(0, mem_size, BOOT_MEM_RAM);
+	return 0;
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/ivr/pci_fixup.c linux/arch/mips/ite-boards/ivr/pci_fixup.c
--- v2.4.9/linux/arch/mips/ite-boards/ivr/pci_fixup.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ite-boards/ivr/pci_fixup.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,139 @@
+/*
+ *
+ * BRIEF MODULE DESCRIPTION
+ *	Globespan IVR board-specific pci fixups.
+ *
+ * Copyright 2000 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc.
+ *         	ppopov@mvista.com or source@mvista.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ *  THIS  SOFTWARE  IS PROVIDED   ``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.
+ *
+ *  You should have received a copy of the  GNU General Public License along
+ *  with this program; if not, write  to the Free Software Foundation, Inc.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include <linux/config.h>
+
+#ifdef CONFIG_PCI
+
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+
+#include <asm/it8172/it8172.h>
+#include <asm/it8172/it8172_pci.h>
+#include <asm/it8172/it8172_int.h>
+
+void __init board_int_line_fixup(struct pci_dev *dev)     
+{
+	unsigned int slot, func;
+	unsigned char pin;
+        const int internal_func_irqs[7] = {
+            IT8172_AC97_IRQ,
+            IT8172_DMA_IRQ,
+            IT8172_CDMA_IRQ,
+            IT8172_USB_IRQ,
+            IT8172_BRIDGE_MASTER_IRQ,
+            IT8172_IDE_IRQ,
+            IT8172_MC68K_IRQ
+        };
+
+#ifdef DEBUG
+	printk("board_int_line_fixup bus %d\n", dev->bus->number);
+#endif
+	if (dev->bus->number != 0)
+		return;
+
+	pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
+
+#ifdef DEBUG
+	pci_read_config_dword(dev, PCI_SUBSYSTEM_VENDOR_ID, &vendor);
+#endif
+
+	slot = PCI_SLOT(dev->devfn);
+        func = PCI_FUNC(dev->devfn);
+
+	switch (slot) {
+                case 0x01:
+                    /*
+                     * Internal device 1 is actually 7 different internal
+                     * devices on the IT8172G (a multi-function device).
+                     */
+                    if (func < 7)
+                        dev->irq = internal_func_irqs[func];
+                    break;
+		case 0x11:
+			switch (pin) {
+				case 0: /* pin A, hardware bug */
+				case 1: /* pin A */
+					dev->irq = IT8172_PCI_INTC_IRQ;
+					break;
+				case 2: /* pin B */
+					dev->irq = IT8172_PCI_INTD_IRQ;
+					break;
+				case 3: /* pin C */
+					dev->irq = IT8172_PCI_INTA_IRQ;
+					break;
+				case 4: /* pin D */
+					dev->irq = IT8172_PCI_INTB_IRQ;
+					break;
+				default:
+					dev->irq = 0xff; 
+					break;
+
+			}
+			break;
+		case 0x13:
+			switch (pin) {
+				case 0: /* pin A, hardware bug */
+				case 1: /* pin A */
+					dev->irq = IT8172_PCI_INTA_IRQ;
+					break;
+				case 2: /* pin B */
+					dev->irq = IT8172_PCI_INTB_IRQ;
+					break;
+				case 3: /* pin C */
+					dev->irq = IT8172_PCI_INTC_IRQ;
+					break;
+				case 4: /* pin D */
+					dev->irq = IT8172_PCI_INTD_IRQ;
+					break;
+				default:
+					dev->irq = 0xff; 
+					break;
+
+			}
+			break;
+		default:
+			return;
+	}
+
+#ifdef DEBUG
+	printk("irq fixup: slot %d, vendor %x, int line %d, int number %d\n",
+			slot, vendor, pin, dev->irq);
+#endif
+	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
+
+}
+
+struct pci_fixup pcibios_fixups[] = {
+	{ PCI_FIXUP_HEADER, PCI_ANY_ID, PCI_ANY_ID, board_int_line_fixup },
+	{ 0 }
+};
+#endif
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/qed-4n-s01b/Makefile linux/arch/mips/ite-boards/qed-4n-s01b/Makefile
--- v2.4.9/linux/arch/mips/ite-boards/qed-4n-s01b/Makefile	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ite-boards/qed-4n-s01b/Makefile	Sun Sep  9 10:43:01 2001
@@ -1,7 +1,7 @@
 #
 #  Copyright 2000 MontaVista Software Inc.
 #  Author: MontaVista Software, Inc.
-#     	ppopov@mvista.com or support@mvista.com
+#     	ppopov@mvista.com or source@mvista.com
 #
 # Makefile for the ITE 8172 (qed-4n-s01b) board, board
 # specific files.
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/qed-4n-s01b/init.c linux/arch/mips/ite-boards/qed-4n-s01b/init.c
--- v2.4.9/linux/arch/mips/ite-boards/qed-4n-s01b/init.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ite-boards/qed-4n-s01b/init.c	Sun Sep  9 10:43:01 2001
@@ -5,7 +5,7 @@
  *
  * Copyright 2000 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or support@mvista.com
+ *         	ppopov@mvista.com or source@mvista.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
@@ -34,8 +34,10 @@
 #include <linux/bootmem.h>
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
+#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
+#include <linux/sched.h>
 #include <asm/it8172/it8172.h>
 #include <asm/it8172/it8172_dbg.h>
 
@@ -53,7 +55,7 @@
 
 int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
 {
-	unsigned long mem_size, free_start, free_end, bootmap_size;
+	unsigned long mem_size;
 	unsigned long pcicr;
 
 	prom_argc = argc;
@@ -81,7 +83,7 @@
 	IT_WRITE(IT_MC_PCICR, pcicr);
 
 	it8172_init_ram_resource(mem_size);
-	add_memory_region(0, 20 << 20, BOOT_MEM_RAM);
+	add_memory_region(0, mem_size, BOOT_MEM_RAM);
 
 	return 0;
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/qed-4n-s01b/pci_fixup.c linux/arch/mips/ite-boards/qed-4n-s01b/pci_fixup.c
--- v2.4.9/linux/arch/mips/ite-boards/qed-4n-s01b/pci_fixup.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/ite-boards/qed-4n-s01b/pci_fixup.c	Sun Sep  9 10:43:01 2001
@@ -5,7 +5,7 @@
  *
  * Copyright 2000 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or support@mvista.com
+ *         	ppopov@mvista.com or source@mvista.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
diff -u --recursive --new-file v2.4.9/linux/arch/mips/jazz/irq.c linux/arch/mips/jazz/irq.c
--- v2.4.9/linux/arch/mips/jazz/irq.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/jazz/irq.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,45 @@
+/*
+ * 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 Linus Torvalds
+ * Copyright (C) 1994 - 2001 Ralf Baechle
+ */
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
+#include <linux/spinlock.h>
+
+#include <asm/io.h>
+#include <asm/jazz.h>
+
+extern asmlinkage void jazz_handle_int(void);
+
+/*
+ * On systems with i8259-style interrupt controllers we assume for
+ * driver compatibility reasons interrupts 0 - 15 to be the i8295
+ * interrupts even if the hardware uses a different interrupt numbering.
+ */
+void __init init_IRQ (void)
+{
+	int i;
+
+	set_except_vector(0, jazz_handle_int);
+
+	init_generic_irq();
+	init_i8259_irqs();			/* Integrated i8259  */
+#if 0
+	init_jazz_irq();
+
+	/* Actually we've got more interrupts to handle ...  */
+	for (i = PCIMT_IRQ_INT2; i <= PCIMT_IRQ_ETHERNET; i++) {
+		irq_desc[i].status     = IRQ_DISABLED;
+		irq_desc[i].action     = 0;
+		irq_desc[i].depth      = 1;
+		irq_desc[i].handler    = &pciasic_irq_type;
+	}
+#endif
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/jazz/jazzdma.c linux/arch/mips/jazz/jazzdma.c
--- v2.4.9/linux/arch/mips/jazz/jazzdma.c	Thu Feb 24 22:52:30 2000
+++ linux/arch/mips/jazz/jazzdma.c	Sun Sep  9 10:43:01 2001
@@ -1,6 +1,4 @@
 /*
- * arch/mips/jazz/jazzdma.c
- *
  * Mips Jazz DMA controller support
  * Copyright (C) 1995, 1996 by Andreas Busse
  *
@@ -27,7 +25,7 @@
  */
 #define CONF_DEBUG_VDMA 0
 
-static unsigned long vdma_pagetable_start = 0;
+static unsigned long vdma_pagetable_start;
 
 /*
  * Debug stuff
@@ -44,16 +42,16 @@
  */
 static inline void vdma_pgtbl_init(void)
 {
-    int i;
-    unsigned long paddr = 0;
-    VDMA_PGTBL_ENTRY *pgtbl = (VDMA_PGTBL_ENTRY *)vdma_pagetable_start;
-  
-    for (i=0; i<VDMA_PGTBL_ENTRIES; i++)
-    {
-        pgtbl[i].frame = paddr;
-        pgtbl[i].owner = VDMA_PAGE_EMPTY;
-        paddr += VDMA_PAGESIZE;
-    }
+	int i;
+	unsigned long paddr = 0;
+	VDMA_PGTBL_ENTRY *pgtbl =
+	    (VDMA_PGTBL_ENTRY *) vdma_pagetable_start;
+
+	for (i = 0; i < VDMA_PGTBL_ENTRIES; i++) {
+		pgtbl[i].frame = paddr;
+		pgtbl[i].owner = VDMA_PAGE_EMPTY;
+		paddr += VDMA_PAGESIZE;
+	}
 }
 
 /*
@@ -77,13 +75,12 @@
 	 */
 	vdma_pgtbl_init();
 
-	r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE,PHYSADDR(vdma_pagetable_start));
+	r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE,
+			  PHYSADDR(vdma_pagetable_start));
 	r4030_write_reg32(JAZZ_R4030_TRSTBL_LIM, VDMA_PGTBL_SIZE);
 	r4030_write_reg32(JAZZ_R4030_TRSTBL_INV, 0);
 
 	printk("VDMA: R4030 DMA pagetables initialized.\n");
-
-	return KSEG0ADDR(vdma_pagetable_end);
 }
 
 /*
@@ -91,92 +88,90 @@
  */
 unsigned long vdma_alloc(unsigned long paddr, unsigned long size)
 {
-    VDMA_PGTBL_ENTRY *entry = (VDMA_PGTBL_ENTRY *)vdma_pagetable_start;
-    int first;
-    int last;
-    int pages;
-    unsigned int frame;
-    unsigned long laddr;
-    int i;
-    unsigned long flags;
-
-    /* check arguments */
-  
-    if (paddr > 0x1fffffff)
-    {
-        if (vdma_debug)
-            printk("vdma_alloc: Invalid physical address: %08lx\n",paddr);
-        return VDMA_ERROR;	/* invalid physical address */
-    }
-    if (size > 0x400000 || size == 0)
-    {
-        if (vdma_debug)
-            printk("vdma_alloc: Invalid size: %08lx\n",size);
-        return VDMA_ERROR;	/* invalid physical address */
-    }
-  
-    save_and_cli (flags);
-    /*
-     * Find free chunk
-     */
-    pages = (size + 4095) >> 12; /* no. of pages to allocate */
-    first = 0;
-    while (1)
-    {
-        while (entry[first].owner != VDMA_PAGE_EMPTY &&
-               first < VDMA_PGTBL_ENTRIES)
-            first++;
-        if (first+pages > VDMA_PGTBL_ENTRIES) { /* nothing free */
-	    restore_flags (flags);
-            return VDMA_ERROR;
-	}
-
-        last = first+1;
-        while (entry[last].owner == VDMA_PAGE_EMPTY && last-first < pages)
-            last++;
-    
-        if (last-first == pages)
-            break;			/* found */
-    }
-  
-    /*
-     * Mark pages as allocated
-     */
-    laddr = (first << 12) + (paddr & (VDMA_PAGESIZE-1));
-    frame = paddr & ~(VDMA_PAGESIZE-1);
-  
-    for (i=first; i<last; i++)
-    {
-        entry[i].frame = frame;
-        entry[i].owner = laddr;
-        frame += VDMA_PAGESIZE;
-    }
-
-    /*
-     * Update translation table and return logical start address
-     */
-    r4030_write_reg32(JAZZ_R4030_TRSTBL_INV,0);
-
-    if (vdma_debug > 1)
-        printk("vdma_alloc: Allocated %d pages starting from %08lx\n",
-               pages,laddr);
-
-    if (vdma_debug > 2)
-    {
-        printk("LADDR: ");
-        for (i=first; i<last; i++)
-            printk("%08x ",i<<12);
-        printk("\nPADDR: ");
-        for (i=first; i<last; i++)
-            printk("%08x ",entry[i].frame);
-        printk("\nOWNER: ");
-        for (i=first; i<last; i++)
-            printk("%08x ",entry[i].owner);
-        printk("\n");
-    }
-  
-    restore_flags(flags);
-    return laddr;
+	VDMA_PGTBL_ENTRY *entry =
+	    (VDMA_PGTBL_ENTRY *) vdma_pagetable_start;
+	int first;
+	int last;
+	int pages;
+	unsigned int frame;
+	unsigned long laddr;
+	int i;
+	unsigned long flags;
+
+	/* check arguments */
+
+	if (paddr > 0x1fffffff) {
+		if (vdma_debug)
+			printk("vdma_alloc: Invalid physical address: %08lx\n",
+			       paddr);
+		return VDMA_ERROR;	/* invalid physical address */
+	}
+	if (size > 0x400000 || size == 0) {
+		if (vdma_debug)
+			printk("vdma_alloc: Invalid size: %08lx\n", size);
+		return VDMA_ERROR;	/* invalid physical address */
+	}
+
+	save_and_cli(flags);
+	/*
+	 * Find free chunk
+	 */
+	pages = (size + 4095) >> 12;	/* no. of pages to allocate */
+	first = 0;
+	while (1) {
+		while (entry[first].owner != VDMA_PAGE_EMPTY &&
+		       first < VDMA_PGTBL_ENTRIES) first++;
+		if (first + pages > VDMA_PGTBL_ENTRIES) {	/* nothing free */
+			restore_flags(flags);
+			return VDMA_ERROR;
+		}
+
+		last = first + 1;
+		while (entry[last].owner == VDMA_PAGE_EMPTY
+		       && last - first < pages)
+			last++;
+
+		if (last - first == pages)
+			break;	/* found */
+	}
+
+	/*
+	 * Mark pages as allocated
+	 */
+	laddr = (first << 12) + (paddr & (VDMA_PAGESIZE - 1));
+	frame = paddr & ~(VDMA_PAGESIZE - 1);
+
+	for (i = first; i < last; i++) {
+		entry[i].frame = frame;
+		entry[i].owner = laddr;
+		frame += VDMA_PAGESIZE;
+	}
+
+	/*
+	 * Update translation table and return logical start address
+	 */
+	r4030_write_reg32(JAZZ_R4030_TRSTBL_INV, 0);
+
+	if (vdma_debug > 1)
+		printk
+		    ("vdma_alloc: Allocated %d pages starting from %08lx\n",
+		     pages, laddr);
+
+	if (vdma_debug > 2) {
+		printk("LADDR: ");
+		for (i = first; i < last; i++)
+			printk("%08x ", i << 12);
+		printk("\nPADDR: ");
+		for (i = first; i < last; i++)
+			printk("%08x ", entry[i].frame);
+		printk("\nOWNER: ");
+		for (i = first; i < last; i++)
+			printk("%08x ", entry[i].owner);
+		printk("\n");
+	}
+
+	restore_flags(flags);
+	return laddr;
 }
 
 /*
@@ -186,102 +181,103 @@
  */
 int vdma_free(unsigned long laddr)
 {
-    VDMA_PGTBL_ENTRY *pgtbl = (VDMA_PGTBL_ENTRY *)vdma_pagetable_start;
-    int i;
+	VDMA_PGTBL_ENTRY *pgtbl =
+	    (VDMA_PGTBL_ENTRY *) vdma_pagetable_start;
+	int i;
+
+	i = laddr >> 12;
+
+	if (pgtbl[i].owner != laddr) {
+		printk
+		    ("vdma_free: trying to free other's dma pages, laddr=%8lx\n",
+		     laddr);
+		return -1;
+	}
+
+	while (pgtbl[i].owner == laddr && i < VDMA_PGTBL_ENTRIES) {
+		pgtbl[i].owner = VDMA_PAGE_EMPTY;
+		i++;
+	}
 
-    i = laddr >> 12;
+	if (vdma_debug > 1)
+		printk("vdma_free: freed %ld pages starting from %08lx\n",
+		       i - (laddr >> 12), laddr);
 
-    if (pgtbl[i].owner != laddr)
-    {
-        printk("vdma_free: trying to free other's dma pages, laddr=%8lx\n",
-               laddr);
-        return -1;
-    }
-  
-    while (pgtbl[i].owner == laddr && i < VDMA_PGTBL_ENTRIES)
-    {
-        pgtbl[i].owner = VDMA_PAGE_EMPTY;
-        i++;
-    }
-  
-    if (vdma_debug > 1)
-        printk("vdma_free: freed %ld pages starting from %08lx\n",
-               i-(laddr>>12),laddr);
-  
-    return 0;
+	return 0;
 }
 
 /*
  * Map certain page(s) to another physical address.
  * Caller must have allocated the page(s) before.
  */
-int vdma_remap(unsigned long laddr, unsigned long paddr, unsigned long size)
+int vdma_remap(unsigned long laddr, unsigned long paddr,
+	       unsigned long size)
 {
-    VDMA_PGTBL_ENTRY *pgtbl = (VDMA_PGTBL_ENTRY *)vdma_pagetable_start;
-    int first, pages, npages;
+	VDMA_PGTBL_ENTRY *pgtbl =
+	    (VDMA_PGTBL_ENTRY *) vdma_pagetable_start;
+	int first, pages, npages;
+
+	if (laddr > 0xffffff) {
+		if (vdma_debug)
+			printk
+			    ("vdma_map: Invalid logical address: %08lx\n",
+			     laddr);
+		return -EINVAL;	/* invalid logical address */
+	}
+	if (paddr > 0x1fffffff) {
+		if (vdma_debug)
+			printk
+			    ("vdma_map: Invalid physical address: %08lx\n",
+			     paddr);
+		return -EINVAL;	/* invalid physical address */
+	}
+
+	npages = pages =
+	    (((paddr & (VDMA_PAGESIZE - 1)) + size) >> 12) + 1;
+	first = laddr >> 12;
+	if (vdma_debug)
+		printk("vdma_remap: first=%x, pages=%x\n", first, pages);
+	if (first + pages > VDMA_PGTBL_ENTRIES) {
+		if (vdma_debug)
+			printk("vdma_alloc: Invalid size: %08lx\n", size);
+		return -EINVAL;
+	}
+
+	paddr &= ~(VDMA_PAGESIZE - 1);
+	while (pages > 0 && first < VDMA_PGTBL_ENTRIES) {
+		if (pgtbl[first].owner != laddr) {
+			if (vdma_debug)
+				printk("Trying to remap other's pages.\n");
+			return -EPERM;	/* not owner */
+		}
+		pgtbl[first].frame = paddr;
+		paddr += VDMA_PAGESIZE;
+		first++;
+		pages--;
+	}
+
+	/*
+	 * Update translation table
+	 */
+	r4030_write_reg32(JAZZ_R4030_TRSTBL_INV, 0);
+
+	if (vdma_debug > 2) {
+		int i;
+		pages = (((paddr & (VDMA_PAGESIZE - 1)) + size) >> 12) + 1;
+		first = laddr >> 12;
+		printk("LADDR: ");
+		for (i = first; i < first + pages; i++)
+			printk("%08x ", i << 12);
+		printk("\nPADDR: ");
+		for (i = first; i < first + pages; i++)
+			printk("%08x ", pgtbl[i].frame);
+		printk("\nOWNER: ");
+		for (i = first; i < first + pages; i++)
+			printk("%08x ", pgtbl[i].owner);
+		printk("\n");
+	}
 
-    if (laddr > 0xffffff)
-    {
-        if (vdma_debug)
-            printk("vdma_map: Invalid logical address: %08lx\n",laddr);
-        return -EINVAL;		/* invalid logical address */
-    }
-    if (paddr > 0x1fffffff)
-    {
-        if (vdma_debug)
-            printk("vdma_map: Invalid physical address: %08lx\n",paddr);
-        return -EINVAL;		/* invalid physical address */
-    }
-  
-    npages = pages = (((paddr & (VDMA_PAGESIZE-1)) + size) >> 12) + 1;
-    first = laddr >> 12;
-    if (vdma_debug)
-        printk("vdma_remap: first=%x, pages=%x\n",first,pages);
-    if (first+pages > VDMA_PGTBL_ENTRIES)
-    {
-        if (vdma_debug)
-            printk("vdma_alloc: Invalid size: %08lx\n",size);
-        return -EINVAL;
-    }
-
-    paddr &= ~(VDMA_PAGESIZE-1);
-    while (pages > 0 && first < VDMA_PGTBL_ENTRIES)
-    {
-        if (pgtbl[first].owner != laddr)
-        {
-            if (vdma_debug)
-                printk("Trying to remap other's pages.\n");
-            return -EPERM;		/* not owner */
-        }
-        pgtbl[first].frame = paddr;
-        paddr += VDMA_PAGESIZE;
-        first++;
-        pages--;
-    }
-
-    /*
-     * Update translation table
-     */
-    r4030_write_reg32(JAZZ_R4030_TRSTBL_INV,0);
-  
-    if (vdma_debug > 2)
-    {
-        int i;
-        pages = (((paddr & (VDMA_PAGESIZE-1)) + size) >> 12) + 1;
-        first = laddr >> 12;
-        printk("LADDR: ");
-        for (i=first; i<first+pages; i++)
-            printk("%08x ",i<<12);
-        printk("\nPADDR: ");
-        for (i=first; i<first+pages; i++)
-            printk("%08x ",pgtbl[i].frame);
-        printk("\nOWNER: ");
-        for (i=first; i<first+pages; i++)
-            printk("%08x ",pgtbl[i].owner);
-        printk("\n");
-    }
-      
-    return 0;
+	return 0;
 }
 
 /*
@@ -291,22 +287,22 @@
  */
 unsigned long vdma_phys2log(unsigned long paddr)
 {
-    int i;
-    int frame;
-    VDMA_PGTBL_ENTRY *pgtbl = (VDMA_PGTBL_ENTRY *)vdma_pagetable_start;
-
-    frame = paddr & ~(VDMA_PAGESIZE-1);
-
-    for (i=0; i<VDMA_PGTBL_ENTRIES; i++)
-    {
-        if (pgtbl[i].frame == frame)
-            break;
-    }
+	int i;
+	int frame;
+	VDMA_PGTBL_ENTRY *pgtbl =
+	    (VDMA_PGTBL_ENTRY *) vdma_pagetable_start;
+
+	frame = paddr & ~(VDMA_PAGESIZE - 1);
+
+	for (i = 0; i < VDMA_PGTBL_ENTRIES; i++) {
+		if (pgtbl[i].frame == frame)
+			break;
+	}
 
-    if (i == VDMA_PGTBL_ENTRIES)
-        return ~0UL;
+	if (i == VDMA_PGTBL_ENTRIES)
+		return ~0UL;
 
-    return (i<<12) + (paddr & (VDMA_PAGESIZE-1));
+	return (i << 12) + (paddr & (VDMA_PAGESIZE - 1));
 }
 
 /*
@@ -314,44 +310,47 @@
  */
 unsigned long vdma_log2phys(unsigned long laddr)
 {
-    VDMA_PGTBL_ENTRY *pgtbl = (VDMA_PGTBL_ENTRY *)vdma_pagetable_start;
+	VDMA_PGTBL_ENTRY *pgtbl =
+	    (VDMA_PGTBL_ENTRY *) vdma_pagetable_start;
 
-    return pgtbl[laddr >> 12].frame + (laddr & (VDMA_PAGESIZE-1));
+	return pgtbl[laddr >> 12].frame + (laddr & (VDMA_PAGESIZE - 1));
 }
-  
+
 /*
  * Print DMA statistics
  */
 void vdma_stats(void)
 {
-    int i;
-  
-    printk("vdma_stats: CONFIG: %08x\n",
-           r4030_read_reg32(JAZZ_R4030_CONFIG));
-    printk("R4030 translation table base: %08x\n",
-           r4030_read_reg32(JAZZ_R4030_TRSTBL_BASE));
-    printk("R4030 translation table limit: %08x\n",
-           r4030_read_reg32(JAZZ_R4030_TRSTBL_LIM));
-    printk("vdma_stats: INV_ADDR: %08x\n",
-           r4030_read_reg32(JAZZ_R4030_INV_ADDR));
-    printk("vdma_stats: R_FAIL_ADDR: %08x\n",
-           r4030_read_reg32(JAZZ_R4030_R_FAIL_ADDR));
-    printk("vdma_stats: M_FAIL_ADDR: %08x\n",
-           r4030_read_reg32(JAZZ_R4030_M_FAIL_ADDR));
-    printk("vdma_stats: IRQ_SOURCE: %08x\n",
-           r4030_read_reg32(JAZZ_R4030_IRQ_SOURCE));
-    printk("vdma_stats: I386_ERROR: %08x\n",
-           r4030_read_reg32(JAZZ_R4030_I386_ERROR));
-    printk("vdma_chnl_modes:   ");
-    for (i=0; i<8; i++)
-        printk("%04x ",
-               (unsigned)r4030_read_reg32(JAZZ_R4030_CHNL_MODE+(i<<5)));
-    printk("\n");
-    printk("vdma_chnl_enables: ");
-    for (i=0; i<8; i++)
-        printk("%04x ",
-               (unsigned)r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE+(i<<5)));
-    printk("\n");
+	int i;
+
+	printk("vdma_stats: CONFIG: %08x\n",
+	       r4030_read_reg32(JAZZ_R4030_CONFIG));
+	printk("R4030 translation table base: %08x\n",
+	       r4030_read_reg32(JAZZ_R4030_TRSTBL_BASE));
+	printk("R4030 translation table limit: %08x\n",
+	       r4030_read_reg32(JAZZ_R4030_TRSTBL_LIM));
+	printk("vdma_stats: INV_ADDR: %08x\n",
+	       r4030_read_reg32(JAZZ_R4030_INV_ADDR));
+	printk("vdma_stats: R_FAIL_ADDR: %08x\n",
+	       r4030_read_reg32(JAZZ_R4030_R_FAIL_ADDR));
+	printk("vdma_stats: M_FAIL_ADDR: %08x\n",
+	       r4030_read_reg32(JAZZ_R4030_M_FAIL_ADDR));
+	printk("vdma_stats: IRQ_SOURCE: %08x\n",
+	       r4030_read_reg32(JAZZ_R4030_IRQ_SOURCE));
+	printk("vdma_stats: I386_ERROR: %08x\n",
+	       r4030_read_reg32(JAZZ_R4030_I386_ERROR));
+	printk("vdma_chnl_modes:   ");
+	for (i = 0; i < 8; i++)
+		printk("%04x ",
+		       (unsigned) r4030_read_reg32(JAZZ_R4030_CHNL_MODE +
+						   (i << 5)));
+	printk("\n");
+	printk("vdma_chnl_enables: ");
+	for (i = 0; i < 8; i++)
+		printk("%04x ",
+		       (unsigned) r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE +
+						   (i << 5)));
+	printk("\n");
 }
 
 /*
@@ -363,33 +362,35 @@
  */
 void vdma_enable(int channel)
 {
-    int status;
-  
-    if (vdma_debug)
-        printk("vdma_enable: channel %d\n",channel);
-  
-    /*
-     * Check error conditions first
-     */
-    status = r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE+(channel<<5));
-    if (status & 0x400)
-        printk("VDMA: Channel %d: Address error!\n",channel);
-    if (status & 0x200)
-        printk("VDMA: Channel %d: Memory error!\n",channel);
-
-    /*
-     * Clear all interrupt flags
-     */
-    r4030_write_reg32(JAZZ_R4030_CHNL_ENABLE+(channel<<5),
-		      r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE+(channel<<5)) |
-                      R4030_TC_INTR | R4030_MEM_INTR | R4030_ADDR_INTR);
-
-    /*
-     * Enable the desired channel
-     */
-    r4030_write_reg32(JAZZ_R4030_CHNL_ENABLE+(channel<<5),
-                      r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE+(channel<<5)) |
-                      R4030_CHNL_ENABLE);
+	int status;
+
+	if (vdma_debug)
+		printk("vdma_enable: channel %d\n", channel);
+
+	/*
+	 * Check error conditions first
+	 */
+	status = r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE + (channel << 5));
+	if (status & 0x400)
+		printk("VDMA: Channel %d: Address error!\n", channel);
+	if (status & 0x200)
+		printk("VDMA: Channel %d: Memory error!\n", channel);
+
+	/*
+	 * Clear all interrupt flags
+	 */
+	r4030_write_reg32(JAZZ_R4030_CHNL_ENABLE + (channel << 5),
+			  r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE +
+					   (channel << 5)) | R4030_TC_INTR
+			  | R4030_MEM_INTR | R4030_ADDR_INTR);
+
+	/*
+	 * Enable the desired channel
+	 */
+	r4030_write_reg32(JAZZ_R4030_CHNL_ENABLE + (channel << 5),
+			  r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE +
+					   (channel << 5)) |
+			  R4030_CHNL_ENABLE);
 }
 
 /*
@@ -397,28 +398,34 @@
  */
 void vdma_disable(int channel)
 {
-    if (vdma_debug)
-    {
-        int status = r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE+(channel<<5));
-
-        printk("vdma_disable: channel %d\n",channel);
-        printk("VDMA: channel %d status: %04x (%s) mode: "
-               "%02x addr: %06x count: %06x\n",
-               channel,status,((status & 0x600) ? "ERROR" : "OK"),
-               (unsigned)r4030_read_reg32(JAZZ_R4030_CHNL_MODE+(channel<<5)),
-               (unsigned)r4030_read_reg32(JAZZ_R4030_CHNL_ADDR+(channel<<5)),
-               (unsigned)r4030_read_reg32(JAZZ_R4030_CHNL_COUNT+(channel<<5)));
-    }
-  
-    r4030_write_reg32(JAZZ_R4030_CHNL_ENABLE+(channel<<5),
-                      r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE+(channel<<5)) &
-                      ~R4030_CHNL_ENABLE);
-
-    /*
-     * After disabling a DMA channel a remote bus register should be
-     * read to ensure that the current DMA acknowledge cycle is completed.
-     */
-    *((volatile unsigned int *)JAZZ_DUMMY_DEVICE);
+	if (vdma_debug) {
+		int status =
+		    r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE +
+				     (channel << 5));
+
+		printk("vdma_disable: channel %d\n", channel);
+		printk("VDMA: channel %d status: %04x (%s) mode: "
+		       "%02x addr: %06x count: %06x\n",
+		       channel, status,
+		       ((status & 0x600) ? "ERROR" : "OK"),
+		       (unsigned) r4030_read_reg32(JAZZ_R4030_CHNL_MODE +
+						   (channel << 5)),
+		       (unsigned) r4030_read_reg32(JAZZ_R4030_CHNL_ADDR +
+						   (channel << 5)),
+		       (unsigned) r4030_read_reg32(JAZZ_R4030_CHNL_COUNT +
+						   (channel << 5)));
+	}
+
+	r4030_write_reg32(JAZZ_R4030_CHNL_ENABLE + (channel << 5),
+			  r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE +
+					   (channel << 5)) &
+			  ~R4030_CHNL_ENABLE);
+
+	/*
+	 * After disabling a DMA channel a remote bus register should be
+	 * read to ensure that the current DMA acknowledge cycle is completed.
+	 */
+	*((volatile unsigned int *) JAZZ_DUMMY_DEVICE);
 }
 
 /*
@@ -432,56 +439,60 @@
  */
 void vdma_set_mode(int channel, int mode)
 {
-    if (vdma_debug)
-        printk("vdma_set_mode: channel %d, mode 0x%x\n", channel, mode);
-
-    switch(channel)
-    {
-    case JAZZ_SCSI_DMA:			/* scsi */
-        r4030_write_reg32(JAZZ_R4030_CHNL_MODE+(channel<<5),
+	if (vdma_debug)
+		printk("vdma_set_mode: channel %d, mode 0x%x\n", channel,
+		       mode);
+
+	switch (channel) {
+	case JAZZ_SCSI_DMA:	/* scsi */
+		r4030_write_reg32(JAZZ_R4030_CHNL_MODE + (channel << 5),
 /*			  R4030_MODE_FAST | */
 /*			  R4030_MODE_BURST | */
-                          R4030_MODE_INTR_EN |
-                          R4030_MODE_WIDTH_16 |
-                          R4030_MODE_ATIME_80);
-        break;
-      
-    case JAZZ_FLOPPY_DMA:	/* floppy */
-        r4030_write_reg32(JAZZ_R4030_CHNL_MODE+(channel<<5),
+				  R4030_MODE_INTR_EN |
+				  R4030_MODE_WIDTH_16 |
+				  R4030_MODE_ATIME_80);
+		break;
+
+	case JAZZ_FLOPPY_DMA:	/* floppy */
+		r4030_write_reg32(JAZZ_R4030_CHNL_MODE + (channel << 5),
 /*			  R4030_MODE_FAST | */
 /*			  R4030_MODE_BURST | */
-                          R4030_MODE_INTR_EN |
-                          R4030_MODE_WIDTH_8 |
-                          R4030_MODE_ATIME_120);
-        break;
-
-    case JAZZ_AUDIOL_DMA:
-    case JAZZ_AUDIOR_DMA:
-        printk("VDMA: Audio DMA not supported yet.\n");
-        break;
-      
-    default:
-        printk("VDMA: vdma_set_mode() called with unsupported channel %d!\n",
-               channel);
-    }
-  
-    switch(mode)
-    {
-    case DMA_MODE_READ:
-        r4030_write_reg32(JAZZ_R4030_CHNL_ENABLE+(channel<<5),
-                          r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE+(channel<<5)) &
-                          ~R4030_CHNL_WRITE);
-        break;
-      
-    case DMA_MODE_WRITE:
-        r4030_write_reg32(JAZZ_R4030_CHNL_ENABLE+(channel<<5),
-                          r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE+(channel<<5)) |
-                          R4030_CHNL_WRITE);
-      break;
-      
-    default:
-        printk("VDMA: vdma_set_mode() called with unknown dma mode 0x%x\n",mode);
-    }
+				  R4030_MODE_INTR_EN |
+				  R4030_MODE_WIDTH_8 |
+				  R4030_MODE_ATIME_120);
+		break;
+
+	case JAZZ_AUDIOL_DMA:
+	case JAZZ_AUDIOR_DMA:
+		printk("VDMA: Audio DMA not supported yet.\n");
+		break;
+
+	default:
+		printk
+		    ("VDMA: vdma_set_mode() called with unsupported channel %d!\n",
+		     channel);
+	}
+
+	switch (mode) {
+	case DMA_MODE_READ:
+		r4030_write_reg32(JAZZ_R4030_CHNL_ENABLE + (channel << 5),
+				  r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE +
+						   (channel << 5)) &
+				  ~R4030_CHNL_WRITE);
+		break;
+
+	case DMA_MODE_WRITE:
+		r4030_write_reg32(JAZZ_R4030_CHNL_ENABLE + (channel << 5),
+				  r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE +
+						   (channel << 5)) |
+				  R4030_CHNL_WRITE);
+		break;
+
+	default:
+		printk
+		    ("VDMA: vdma_set_mode() called with unknown dma mode 0x%x\n",
+		     mode);
+	}
 }
 
 /*
@@ -489,10 +500,11 @@
  */
 void vdma_set_addr(int channel, long addr)
 {
-    if (vdma_debug)
-        printk("vdma_set_addr: channel %d, addr %lx\n",channel,addr);
+	if (vdma_debug)
+		printk("vdma_set_addr: channel %d, addr %lx\n", channel,
+		       addr);
 
-    r4030_write_reg32(JAZZ_R4030_CHNL_ADDR+(channel<<5),addr);
+	r4030_write_reg32(JAZZ_R4030_CHNL_ADDR + (channel << 5), addr);
 }
 
 /*
@@ -500,25 +512,28 @@
  */
 void vdma_set_count(int channel, int count)
 {
-    if (vdma_debug)
-        printk("vdma_set_count: channel %d, count %08x\n",channel,(unsigned)count);
-  
-    r4030_write_reg32(JAZZ_R4030_CHNL_COUNT+(channel<<5),count);
+	if (vdma_debug)
+		printk("vdma_set_count: channel %d, count %08x\n", channel,
+		       (unsigned) count);
+
+	r4030_write_reg32(JAZZ_R4030_CHNL_COUNT + (channel << 5), count);
 }
-     
+
 /*
  * Get Residual
  */
 int vdma_get_residue(int channel)
 {
-    int residual;
-  
-    residual = r4030_read_reg32(JAZZ_R4030_CHNL_COUNT+(channel<<5));
-
-    if (vdma_debug)
-        printk("vdma_get_residual: channel %d: residual=%d\n",channel,residual);
-  
-    return residual;
+	int residual;
+
+	residual =
+	    r4030_read_reg32(JAZZ_R4030_CHNL_COUNT + (channel << 5));
+
+	if (vdma_debug)
+		printk("vdma_get_residual: channel %d: residual=%d\n",
+		       channel, residual);
+
+	return residual;
 }
 
 /*
@@ -526,12 +541,13 @@
  */
 int vdma_get_enable(int channel)
 {
-    int enable;
-    
-    enable = r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE+(channel<<5));
-    
-    if (vdma_debug)
-	printk("vdma_get_enable: channel %d: enable=%d\n",channel,enable);
-    
-    return enable;
+	int enable;
+
+	enable = r4030_read_reg32(JAZZ_R4030_CHNL_ENABLE + (channel << 5));
+
+	if (vdma_debug)
+		printk("vdma_get_enable: channel %d: enable=%d\n", channel,
+		       enable);
+
+	return enable;
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/jazz/rtc-jazz.c linux/arch/mips/jazz/rtc-jazz.c
--- v2.4.9/linux/arch/mips/jazz/rtc-jazz.c	Sat May 13 08:29:14 2000
+++ linux/arch/mips/jazz/rtc-jazz.c	Sun Sep  9 10:43:01 2001
@@ -1,12 +1,11 @@
-/* $Id: rtc-jazz.c,v 1.2 1998/06/25 20:19:14 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
  * RTC routines for Jazz style attached Dallas chip.
  *
- * Copyright (C) 1998 by Ralf Baechle
+ * Copyright (C) 1998, 2001 by Ralf Baechle
  */
 #include <linux/mc146818rtc.h>
 #include <asm/io.h>
diff -u --recursive --new-file v2.4.9/linux/arch/mips/jazz/setup.c linux/arch/mips/jazz/setup.c
--- v2.4.9/linux/arch/mips/jazz/setup.c	Sat May 13 08:29:14 2000
+++ linux/arch/mips/jazz/setup.c	Sun Sep  9 10:43:01 2001
@@ -1,12 +1,12 @@
-/* $Id: setup.c,v 1.24 1999/10/09 00:00:58 ralf Exp $
- *
+/*
  * Setup pointers to hardware-dependent routines.
  *
  * 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) 1996, 1997, 1998 by Ralf Baechle
+ * Copyright (C) 1996, 1997, 1998, 2001 by Ralf Baechle
+ * Copyright (C) 2001 MIPS Technologies, Inc.
  */
 #include <linux/config.h>
 #include <linux/hdreg.h>
@@ -72,7 +72,7 @@
 			  JAZZ_IE_FLOPPY);
 	r4030_read_reg16(JAZZ_IO_IRQ_SOURCE); /* clear pending IRQs */
 	r4030_read_reg32(JAZZ_R4030_INVAL_ADDR); /* clear error bits */
-	set_cp0_status(ST0_IM, IE_IRQ4 | IE_IRQ3 | IE_IRQ2 | IE_IRQ1);
+	change_cp0_status(ST0_IM, IE_IRQ4 | IE_IRQ3 | IE_IRQ2 | IE_IRQ1);
 	/* set the clock to 100 Hz */
 	r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9);
 	request_region(0x20, 0x20, "pic1");
@@ -80,11 +80,6 @@
 	i8259_setup_irq(2, &irq2);
 }
 
-int __init page_is_ram(unsigned long pagenr)
-{
-	return 1;
-}
-
 void __init jazz_setup(void)
 {
 	add_wired_entry (0x02000017, 0x03c00017, 0xe0000000, PM_64K);
@@ -93,6 +88,8 @@
 
 	irq_setup = jazz_irq_setup;
 	mips_io_port_base = JAZZ_PORT_BASE;
+	if (mips_machtype == MACH_MIPS_MAGNUM_4000)
+		EISA_bus = 1;
 	isa_slot_offset = 0xe3000000;
 	request_region(0x00,0x20,"dma1");
 	request_region(0x40,0x20,"timer");
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/Makefile linux/arch/mips/kernel/Makefile
--- v2.4.9/linux/arch/mips/kernel/Makefile	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/Makefile	Sun Sep  9 10:43:01 2001
@@ -35,15 +35,12 @@
 endif
 
 obj-$(CONFIG_SMP)		+= smp.o
-obj-$(CONFIG_MIPS_FPE_MODULE)	+= fpe.o
-ifndef CONFIG_MIPS_FPU_EMULATOR
-  obj-y				+= softfp.o
-endif
 
 # Old style irq support, going to die in 2.5.
 export-objs			+= old-irq.o
 obj-$(CONFIG_NEW_IRQ)		+= irq.o
 obj-$(CONFIG_ROTTEN_IRQ)	+= old-irq.o
+obj-$(CONFIG_I8259)		+= i8259.o
 
 # transition from old time.c to new time.c
 # some boards uses old-time.c, some use time.c, and some use their own ones
@@ -56,6 +53,11 @@
 obj-$(CONFIG_REMOTE_DEBUG)	+= gdb-low.o gdb-stub.o 
 obj-$(CONFIG_PCI)		+= pci-dma.o
 obj-$(CONFIG_PROC_FS)		+= proc.o
+
+ifdef CONFIG_PCI
+obj-$(CONFIG_NEW_PCI)          += pci.o
+obj-$(CONFIG_PCI_AUTO)         += pci_auto.o
+endif
 
 entry.o: entry.S
 head.o: head.S
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/branch.c linux/arch/mips/kernel/branch.c
--- v2.4.9/linux/arch/mips/kernel/branch.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/kernel/branch.c	Sun Sep  9 10:43:01 2001
@@ -5,9 +5,9 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1996, 97, 2000 by Ralf Baechle
+ * Copyright (C) 1996, 97, 2000, 2001 by Ralf Baechle
+ * Copyright (C) 2001 MIPS Technologies, Inc.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
@@ -29,11 +29,8 @@
 	union mips_instruction insn;
 
 	epc = regs->cp0_epc;
-	if (epc & 3) {
-		printk("%s: unaligned epc - sending SIGBUS.\n", current->comm);
-		force_sig(SIGBUS, current);
-		return -EFAULT;
-	}
+	if (epc & 3)
+		goto unaligned;
 
 	/*
 	 * Read the instruction
@@ -167,12 +164,10 @@
 	 * And now the FPA/cp1 branch instructions.
 	 */
 	case cop1_op:
-#ifdef CONFIG_MIPS_FPU_EMULATOR
 		if(!(mips_cpu.options & MIPS_CPU_FPU))
 			fcr31 = current->thread.fpu.soft.sr;
 		else
-#endif
-		asm ("cfc1\t%0,$31":"=r" (fcr31));
+			asm ("cfc1\t%0,$31":"=r" (fcr31));
 		bit = (insn.i_format.rt >> 2);
 		bit += (bit != 0);
 		bit += 23;
@@ -199,4 +194,9 @@
 	}
 
 	return 0;
+
+unaligned:
+	printk("%s: unaligned epc - sending SIGBUS.\n", current->comm);
+	force_sig(SIGBUS, current);
+	return -EFAULT;
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/entry.S linux/arch/mips/kernel/entry.S
--- v2.4.9/linux/arch/mips/kernel/entry.S	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/entry.S	Sun Sep  9 10:43:01 2001
@@ -1,13 +1,12 @@
-/* $Id: entry.S,v 1.19 1999/12/08 22:05:10 harald Exp $
- *
- * Low level exception handling
- *
+/*
+/*
  * 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) 1994 - 2000 by Ralf Baechle
+ * Copyright (C) 1994 - 2000, 2001 by Ralf Baechle
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ * Copyright (C) 2001 MIPS Technologies, Inc.
  */
 #include <linux/config.h>
 #include <linux/sys.h>
@@ -26,50 +25,64 @@
 #include <asm/unistd.h>
 #include <asm/isadep.h>
 
+/* This duplicates the definition from <linux/sched.h> */
+#define PT_TRACESYS	0x00000002		/* tracing system calls */
+
+
 		.text
 		.align 4
 		.set	push
 		.set	reorder
 EXPORT(ret_from_fork)
-		 move	a0, v0			# prev
+		move	a0, v0			# prev
 		jal	schedule_tail
+		lw	t0, TASK_PTRACE($28)	# syscall tracing enabled?
+		andi	t0, PT_TRACESYS
+		bnez	t0, tracesys_exit
 		j	ret_from_sys_call
 
-EXPORT(handle_softirq)
-		jal	do_softirq
-		b	9f
+tracesys_exit:	jal	syscall_trace
+		b	ret_from_sys_call
+
+EXPORT(ret_from_irq)
+EXPORT(ret_from_exception)
+		lw	t0, PT_STATUS(sp)	# returning to kernel mode?
+		andi	t0, t0, KU_USER
+		bnez	t0, ret_from_sys_call
+		j	restore_all
 
 reschedule:	jal	schedule 
 
 EXPORT(ret_from_sys_call)
-EXPORT(ret_from_irq)
 		.type	ret_from_irq,@function
-		la	t1, irq_stat		# softirq_active
-#ifdef CONFIG_SMP
-		lw	t0, TASK_PROCESSOR($28)
-		sll	t0, t0, 5
-		addu	t1, t0
-#endif
-		lw	t0, 0(t1)		# softirq_active
-		lw	t1, 4(t1)		# softirq_mask.  unused delay slot
-		and	t0, t1
-		bnez	t0, handle_softirq
-
-9:		lw	t0,PT_STATUS(sp)	# returning to kernel mode?
-		lw	t2, TASK_NEED_RESCHED($28)
-		andi	t1, t0, KU_USER
-		beqz	t1, return		# -> yes
-		bnez	t2, reschedule
-		lw	v0, TASK_SIGPENDING($28)
-		 move	a0, zero
-		beqz	v0, return
-		 move	a1, sp
-		jal	do_signal
 
-EXPORT(return)	.set	noat
+		mfc0	t0, CP0_STATUS	# need_resched and signals atomic test
+		ori	t0, t0, 1
+		xori	t0, t0, 1
+		mtc0	t0, CP0_STATUS
+		nop; nop; nop
+
+		lw	v0, TASK_NEED_RESCHED($28)
+		lw	v1, TASK_SIGPENDING($28)
+		bnez	v0, reschedule
+		bnez	v1, signal_return
+restore_all:	.set	noat
 		RESTORE_ALL_AND_RET
 		.set	at
 
+/* Put this behind restore_all for the sake of the branch prediction.  */
+signal_return:
+		.type	signal_return, @function
+
+		mfc0	t0, CP0_STATUS
+		ori	t0, t0, 1
+		mtc0	t0, CP0_STATUS
+
+		move	a0, zero
+		move	a1, sp
+		jal	do_signal
+		b	restore_all
+
 /*
  * Common spurious interrupt handler.
  */
@@ -85,8 +98,8 @@
 		lw      t0,%lo(spurious_count)(t1)
 		.set	noreorder
 		addiu   t0,1
+		sw      t0,%lo(spurious_count)(t1)
 		j	ret_from_irq
-		 sw      t0,%lo(spurious_count)(t1)
 		END(spurious_interrupt)
 
 /*
@@ -106,7 +119,7 @@
 		ctc1	a2,fcr31;                                       \
 		STI
 #define __BUILD_clear_ade(exception)                                    \
-		.set	reorder;						\
+		.set	reorder;					\
 		MFC0	t0,CP0_BADVADDR;                                \
 		.set	noreorder;					\
 		REG_S	t0,PT_BVADDR(sp);                               \
@@ -139,8 +152,8 @@
 		.set	at;                                             \
 		__BUILD_##verbose(exception);                           \
 		jal	do_##handler;                                   \
-		 move	a0,sp;                                          \
-		j	ret_from_sys_call;                              \
+		 move	a0, sp;                                         \
+		j	ret_from_exception;                             \
 		 nop;                                                   \
 		END(handle_##exception)
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/fpe.c linux/arch/mips/kernel/fpe.c
--- v2.4.9/linux/arch/mips/kernel/fpe.c	Sun Jul  9 22:18:15 2000
+++ linux/arch/mips/kernel/fpe.c	Wed Dec 31 16:00:00 1969
@@ -1,51 +0,0 @@
-/*
- * The real floating point exception handler.  While it doesn't really
- * make sense to have this in a module, it makes debugging of this code
- * in the kernel space a lot easier.  So far this handler in the released
- * kernel source is just a dummy.
- *
- * Copyright (C) 1997, 2000 Ralf Baechle
- */
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/sched.h>
-#include <linux/signal.h>
-#include <linux/smp.h>
-#include <linux/smp_lock.h>
-
-#include <asm/branch.h>
-#include <asm/ptrace.h>
-
-MODULE_AUTHOR("Ralf Baechle <ralf@gnu.org>");
-MODULE_DESCRIPTION("Experimental floating point exception handler");
-MODULE_SUPPORTED_DEVICE("MIPS FPU");
-
-static void do_fpe(struct pt_regs *regs, unsigned int fcr31)
-{
-#ifdef CONF_DEBUG_EXCEPTIONS
-	show_regs(regs);
-#endif
-	printk("Caught floating exception at epc == %08lx, fcr31 == %08x\n",
-	       regs->cp0_epc, fcr31);
-	if (compute_return_epc(regs))
-		goto out;
-	force_sig(SIGFPE, current);
-out:
-}
-
-/*
- * For easier experimentation we never increment/decrement
- * the module usable counter.
- */
-int register_fpe(void (*handler)(struct pt_regs *regs, unsigned int fcr31));
-int unregister_fpe(void (*handler)(struct pt_regs *regs, unsigned int fcr31));
-
-int init_module(void)
-{
-	return register_fpe(do_fpe);
-}
-
-void cleanup_module(void)
-{
-	unregister_fpe(do_fpe);
-}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/gdb-low.S linux/arch/mips/kernel/gdb-low.S
--- v2.4.9/linux/arch/mips/kernel/gdb-low.S	Sat May 13 08:29:14 2000
+++ linux/arch/mips/kernel/gdb-low.S	Sun Sep  9 10:43:01 2001
@@ -1,16 +1,13 @@
 /*
- * arch/mips/kernel/gdb-low.S
- *
  * gdb-low.S contains the low-level trap handler for the GDB stub.
  *
  * Copyright (C) 1995 Andreas Busse
- *
- * $Id: gdb-low.S,v 1.4 1997/12/01 17:57:26 ralf Exp $
  */
-
+#include <linux/config.h>
 #include <linux/sys.h>
 
 #include <asm/asm.h>
+#include <asm/errno.h>
 #include <asm/mipsregs.h>
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
@@ -30,10 +27,15 @@
 		move	k1,sp
 
 		/*
-		 * Called from user mode, new stack
+		 * Called from user mode, go somewhere else.
 		 */
-		lui	k1,%hi(kernelsp)
-		lw	k1,%lo(kernelsp)(k1)
+		lui	k1,%hi(saved_vectors)
+		mfc0	k0,CP0_CAUSE
+		andi	k0,k0,0x7c
+		add	k1,k1,k0
+		lw	k0,%lo(saved_vectors)(k1)
+		jr	k0
+		nop
 1:
 		move	k0,sp
 		subu	sp,k1,GDB_FR_SIZE
@@ -302,11 +304,51 @@
 		lw	v1,GDB_FR_REG3(sp)
 		lw	v0,GDB_FR_REG2(sp)
 		lw	$1,GDB_FR_REG1(sp)
-		lw	sp,GDB_FR_REG29(sp)		/* Deallocate stack */
+#ifdef CONFIG_CPU_R3000
+		lw	k0, GDB_FR_EPC(sp)
+		lw	sp, GDB_FR_REG29(sp)		/* Deallocate stack */
+		jr	k0
+		rfe
+#else
+		lw	sp, GDB_FR_REG29(sp)		/* Deallocate stack */
 
 		.set	mips3
 		eret
 		.set	mips0
+#endif
 		.set	at
 		.set	reorder
 		END(trap_low)
+
+LEAF(kgdb_read_byte)
+		.set push
+		.set noreorder
+		.set nomacro
+4:		lb	t0, (a0)
+		.set pop
+		sb	t0, (a1)
+		li	v0, 0
+		jr	ra
+		.section __ex_table,"a"
+		PTR	4b, kgdbfault
+		.previous
+		END(kgdb_read_byte)
+
+LEAF(kgdb_write_byte)
+		.set push
+		.set noreorder
+		.set nomacro
+5:		sb	a0, (a1)
+		.set pop
+		li	v0, 0
+		jr	ra
+		.section __ex_table,"a"
+		PTR	5b, kgdbfault
+		.previous
+		END(kgdb_write_byte)
+
+		.type	kgdbfault@function
+		.ent	kgdbfault
+kgdbfault:	li	v0, -EFAULT
+		jr	ra
+		.end	kgdbfault
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/gdb-stub.c linux/arch/mips/kernel/gdb-stub.c
--- v2.4.9/linux/arch/mips/kernel/gdb-stub.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/gdb-stub.c	Sun Sep  9 10:43:01 2001
@@ -142,7 +142,6 @@
 
 extern int putDebugChar(char c);    /* write a single character      */
 extern char getDebugChar(void);     /* read and return a single char */
-extern void fltr_set_mem_err(void);
 extern void trap_low(void);
 
 /*
@@ -175,6 +174,10 @@
 static int initialized;	/* !0 means we've been initialized */
 static const char hexchars[]="0123456789abcdef";
 
+/* Used to prevent crashes in memory access.  Note that they'll crash anyway if
+   we haven't set up fault handlers yet... */
+int kgdb_read_byte(unsigned *address, unsigned *dest);
+int kgdb_write_byte(unsigned val, unsigned *dest);
 
 /*
  * Convert ch from a hex digit to an int
@@ -294,42 +297,18 @@
 
 
 /*
- * Indicate to caller of mem2hex or hex2mem that there
- * has been an error.
- */
-static volatile int mem_err = 0;
-
-
-#if 0
-static void set_mem_fault_trap(int enable)
-{
-  mem_err = 0;
-
-#if 0
-  if (enable)
-    exceptionHandler(9, fltr_set_mem_err);
-  else
-    exceptionHandler(9, trap_low);
-#endif  
-}
-#endif /* dead code */
-
-/*
  * Convert the memory pointed to by mem into hex, placing result in buf.
  * Return a pointer to the last char put in buf (null), in case of mem fault,
  * return 0.
- * If MAY_FAULT is non-zero, then we will handle memory faults by returning
- * a 0, else treat a fault like any other fault in the stub.
+ * may_fault is non-zero if we are reading from arbitrary memory, but is currently
+ * not used.
  */
 static unsigned char *mem2hex(char *mem, char *buf, int count, int may_fault)
 {
 	unsigned char ch;
 
-/*	set_mem_fault_trap(may_fault); */
-
 	while (count-- > 0) {
-		ch = *(mem++);
-		if (mem_err)
+		if (kgdb_read_byte(mem++, &ch) != 0)
 			return 0;
 		*buf++ = hexchars[ch >> 4];
 		*buf++ = hexchars[ch & 0xf];
@@ -337,33 +316,28 @@
 
 	*buf = 0;
 
-/*	set_mem_fault_trap(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
+ * may_fault is non-zero if we are reading from arbitrary memory, but is currently
+ * not used.
  */
 static char *hex2mem(char *buf, char *mem, int count, int may_fault)
 {
 	int i;
 	unsigned char ch;
 
-/*	set_mem_fault_trap(may_fault); */
-
 	for (i=0; i<count; i++)
 	{
 		ch = hex(*buf++) << 4;
 		ch |= hex(*buf++);
-		*(mem++) = ch;
-		if (mem_err)
+		if (kgdb_write_byte(ch, mem++) != 0)
 			return 0;
 	}
 
-/*	set_mem_fault_trap(0); */
-
 	return mem;
 }
 
@@ -390,6 +364,8 @@
 	{ 0, 0}				/* Must be last */
 };
 
+/* Save the normal trap handlers for user-mode traps. */
+void *saved_vectors[32];
 
 /*
  * Set up exception handlers for tracing and breakpoints
@@ -402,7 +378,7 @@
 
 	save_and_cli(flags);
 	for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
-		set_except_vector(ht->tt, trap_low);
+		saved_vectors[ht->tt] = set_except_vector(ht->tt, trap_low);
   
 	putDebugChar('+'); /* 'hello world' */
 	/*
@@ -417,18 +393,6 @@
 
 	initialized = 1;
 	restore_flags(flags);
-}
-
-
-/*
- * Trap handler for memory errors.  This just sets mem_err to be non-zero.  It
- * assumes that %l1 is non-zero.  This should be safe, as it is doubtful that
- * 0 would ever contain code that could mem fault.  This routine will skip
- * past the faulting instruction after setting mem_err.
- */
-extern void fltr_set_mem_err(void)
-{
-	/* FIXME: Needs to be written... */
 }
 
 /*
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/head.S linux/arch/mips/kernel/head.S
--- v2.4.9/linux/arch/mips/kernel/head.S	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/head.S	Sun Sep  9 10:43:01 2001
@@ -76,7 +76,11 @@
 	addu	k1, k1, k0			# add in pgd offset
 	mfc0	k0, CP0_CONTEXT			# get context reg
 	lw	k1, (k1)
+#if defined(CONFIG_CPU_VR41XX)
+	srl	k0, k0, 3			# get pte offset
+#else
 	srl	k0, k0, 1			# get pte offset
+#endif
 	and	k0, k0, 0xff8
 	addu	k1, k1, k0			# add in offset
 	lw	k0, 0(k1)			# get even pte
@@ -275,7 +279,7 @@
 	END(except_vec0_r4k_MP250MHZhwbug)
 #endif
 
-	/* TLB refill, EXL == 0, R[23]00 version */
+	/* TLB refill, R[23]00 version */
 	LEAF(except_vec0_r2300)
 	.set	noat
 	.set	mips1
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/i8259.c linux/arch/mips/kernel/i8259.c
--- v2.4.9/linux/arch/mips/kernel/i8259.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/i8259.c	Sun Sep  9 10:43:01 2001
@@ -295,7 +295,6 @@
 
 	request_resource(&ioport_resource, &pic1_io_resource);
 	request_resource(&ioport_resource, &pic2_io_resource);
-	setup_irq(2, &irq2);
 
 	init_8259A(0);
 
@@ -305,4 +304,6 @@
 		irq_desc[i].depth = 1;
 		irq_desc[i].handler = &i8259A_irq_type;
 	}
+
+	setup_irq(2, &irq2);
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/init_task.c linux/arch/mips/kernel/init_task.c
--- v2.4.9/linux/arch/mips/kernel/init_task.c	Mon Jul 26 22:41:09 1999
+++ linux/arch/mips/kernel/init_task.c	Mon Sep 17 15:29:09 2001
@@ -4,7 +4,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct vm_area_struct init_mmap = INIT_MMAP;
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
 static struct signal_struct init_signals = INIT_SIGNALS;
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/irq.c linux/arch/mips/kernel/irq.c
--- v2.4.9/linux/arch/mips/kernel/irq.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/irq.c	Sun Sep  9 10:43:01 2001
@@ -303,7 +303,7 @@
 	desc->handler->end(irq);
 	spin_unlock(&desc->lock);
 
-	if (softirq_active(cpu) & softirq_mask(cpu))
+	if (softirq_pending(cpu))
 		do_softirq();
 	return 1;
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/mips_ksyms.c linux/arch/mips/kernel/mips_ksyms.c
--- v2.4.9/linux/arch/mips/kernel/mips_ksyms.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/mips_ksyms.c	Sun Sep  9 10:43:01 2001
@@ -17,6 +17,7 @@
 #include <linux/pci.h>
 #include <linux/ide.h>
 
+#include <asm/bootinfo.h>
 #include <asm/checksum.h>
 #include <asm/dma.h>
 #include <asm/io.h>
@@ -40,6 +41,7 @@
 extern long __strnlen_user_nocheck_asm(const char *s);
 extern long __strnlen_user_asm(const char *s);
 
+EXPORT_SYMBOL(mips_machtype);
 EXPORT_SYMBOL(EISA_bus);
 
 /*
@@ -125,12 +127,6 @@
 
 int register_fpe(void (*handler)(struct pt_regs *regs, unsigned int fcr31));
 int unregister_fpe(void (*handler)(struct pt_regs *regs, unsigned int fcr31));
-
-#ifdef CONFIG_MIPS_FPE_MODULE
-EXPORT_SYMBOL(__compute_return_epc);
-EXPORT_SYMBOL(register_fpe);
-EXPORT_SYMBOL(unregister_fpe);
-#endif
 
 #ifdef CONFIG_VT
 EXPORT_SYMBOL(screen_info);
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/old-irq.c linux/arch/mips/kernel/old-irq.c
--- v2.4.9/linux/arch/mips/kernel/old-irq.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/old-irq.c	Sun Sep  9 10:43:01 2001
@@ -232,7 +232,7 @@
 	}
 	irq_exit(cpu, irq);
 
-	if (softirq_active(cpu)&softirq_mask(cpu))
+	if (softirq_pending(cpu))
 		do_softirq();
 
 	/* unmasking and bottom half handling is done magically for us. */
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/old-time.c linux/arch/mips/kernel/old-time.c
--- v2.4.9/linux/arch/mips/kernel/old-time.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/old-time.c	Sun Sep  9 10:43:01 2001
@@ -1,18 +1,11 @@
 /*
  * Copyright (C) 1991, 1992, 1995  Linus Torvalds
  * Copyright (C) 1996 - 2000  Ralf Baechle
+ * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
  *
- * This file contains the time handling details for PC-style clocks as
- * found in some MIPS systems.
+ * Don't use.  Deprecated.  Dead meat.
  */
-/**************************************************************************
- *  9 Nov, 2000.
- *  Changed init_cycle_counter() routine, use the mips_cpu structure.
- *
- *  Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips
- *  Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
- *************************************************************************/
-
 #include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
@@ -450,7 +443,12 @@
 void indy_r4k_timer_interrupt (struct pt_regs *regs)
 {
 	static const int INDY_R4K_TIMER_IRQ = 7;
+	int cpu = smp_processor_id();
+
 	r4k_timer_interrupt (INDY_R4K_TIMER_IRQ, NULL, regs);
+
+	if (softirq_pending(cpu))
+		do_softirq();
 }
 
 struct irqaction irq0  = { timer_interrupt, SA_INTERRUPT, 0,
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/pci-dma.c linux/arch/mips/kernel/pci-dma.c
--- v2.4.9/linux/arch/mips/kernel/pci-dma.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/pci-dma.c	Sun Sep  9 10:43:01 2001
@@ -4,9 +4,10 @@
  * for more details.
  *
  * Copyright (C) 2000  Ani Joshi <ajoshi@unixbox.com>
- * Copyright (C) 2000  Ralf Baechle <ralf@gnu.org>
+ * Copyright (C) 2000, 2001  Ralf Baechle <ralf@gnu.org>
  * swiped from i386, and cloned for MIPS by Geert, polished by Ralf.
  */
+#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/string.h>
@@ -26,9 +27,11 @@
 
 	if (ret != NULL) {
 		memset(ret, 0, size);
+#ifndef CONFIG_COHERENT_IO
 		dma_cache_wback_inv((unsigned long) ret, size);
-		*dma_handle = virt_to_bus(ret);
 		ret = KSEG1ADDR(ret);
+#endif
+		*dma_handle = virt_to_bus(ret);
 	}
 
 	return ret;
@@ -37,5 +40,10 @@
 void pci_free_consistent(struct pci_dev *hwdev, size_t size,
 			 void *vaddr, dma_addr_t dma_handle)
 {
-	free_pages((unsigned long) KSEG0ADDR(vaddr), get_order(size));
+	unsigned long addr = (unsigned long) vaddr;
+
+#ifndef CONFIG_COHERENT_IO
+	addr = KSEG0ADDR(addr);
+#endif
+	free_pages(addr, get_order(size));
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/pci.c linux/arch/mips/kernel/pci.c
--- v2.4.9/linux/arch/mips/kernel/pci.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/kernel/pci.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,174 @@
+/*
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
+ *
+ * Modified to be mips generic, ppopov@mvista.com
+ * arch/mips/kernl/pci.c
+ *     Common MIPS PCI routines.
+ *
+ * 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 common PCI routines meant to be shared for
+ * all MIPS machines.
+ *
+ * Strategies:
+ *
+ * . We rely on pci_auto.c file to assign PCI resources (MEM and IO)
+ *   TODO: this shold be optional for some machines where they do have
+ *   a real "pcibios" that does resource assignment.
+ *
+ * . We then use pci_scan_bus() to "discover" all the resources for
+ *   later use by Linux.
+ *
+ * . We finally reply on a board supplied function, pcibios_fixup_irq(), to
+ *   to assign the interrupts.  We may use setup-irq.c under drivers/pci
+ *   later.
+ *
+ * . Specifically, we will *NOT* use pci_assign_unassigned_resources(),
+ *   because we assume all PCI devices should have the resources correctly
+ *   assigned and recorded.
+ *
+ * Limitations:
+ *
+ * . We "collapse" all IO and MEM spaces in sub-buses under a top-level bus
+ *   into a contiguous range.
+ *
+ * . In the case of Memory space, the rnage is 1:1 mapping with CPU physical
+ *   address space.
+ *
+ * . In the case of IO space, it starts from 0, and the beginning address
+ *   is mapped to KSEG0ADDR(mips_io_port) in the CPU physical address.
+ *
+ * . These are the current MIPS limitations (by ioremap, etc).  In the
+ *   future, we may remove them.
+ *
+ * Credits:
+ *	Most of the code are derived from the pci routines from PPC and Alpha,
+ *	which were mostly writtne by
+ *		Cort Dougan, cort@fsmlabs.com
+ *		Matt Porter, mporter@mvista.com
+ *		Dave Rusling david.rusling@reo.mts.dec.com
+ *		David Mosberger davidm@cs.arizona.edu
+ */
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+
+#include <asm/pci_channel.h>
+
+extern void pcibios_fixup(void);
+extern void pcibios_fixup_irqs(void);
+
+struct pci_fixup pcibios_fixups[] = {
+	{ PCI_FIXUP_HEADER, PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources },
+	{ 0 }
+};
+
+extern int pciauto_assign_resources(int busno, struct pci_channel * hose);
+
+void __init pcibios_init(void)
+{
+	struct pci_channel *p;
+	struct pci_bus *bus;
+	int busno;
+
+#ifdef CONFIG_PCI_AUTO
+	/* assign resources */
+	busno=0;
+	for (p= mips_pci_channels; p->pci_ops != NULL; p++) {
+		busno = pciauto_assign_resources(busno, p) + 1;
+	}
+#endif
+
+	/* scan the buses */
+	busno = 0;
+	for (p= mips_pci_channels; p->pci_ops != NULL; p++) {
+		bus = pci_scan_bus(busno, p->pci_ops, p);
+		busno = bus->subordinate+1;
+	}
+
+	/* machine dependent fixups */
+	pcibios_fixup();
+	/* fixup irqs (board specific routines) */
+	pcibios_fixup_irqs();
+}
+
+int pcibios_enable_device(struct pci_dev *dev)
+{
+	/* pciauto_assign_resources() will enable all devices found */
+	return 0;
+}
+
+unsigned long __init pci_bridge_check_io(struct pci_dev *bridge)
+{
+	u16 io;
+
+	pci_read_config_word(bridge, PCI_IO_BASE, &io);
+	if (!io) {
+		pci_write_config_word(bridge, PCI_IO_BASE, 0xf0f0);
+		pci_read_config_word(bridge, PCI_IO_BASE, &io);
+		pci_write_config_word(bridge, PCI_IO_BASE, 0x0);
+	}
+	if (io)
+		return IORESOURCE_IO;
+	printk(KERN_WARNING "PCI: bridge %s does not support I/O forwarding!\n",
+				bridge->name);
+	return 0;
+}
+
+void __init pcibios_fixup_bus(struct pci_bus *bus)
+{
+	/* Propogate hose info into the subordinate devices.  */
+
+	struct pci_channel *hose = bus->sysdata;
+	struct pci_dev *dev = bus->self;
+
+	if (!dev) {
+		/* Root bus */
+		bus->resource[0] = hose->io_resource;
+		bus->resource[1] = hose->mem_resource;
+	} else {
+		/* This is a bridge. Do not care how it's initialized,
+		   just link its resources to the bus ones */
+		int i;
+
+		for(i=0; i<3; i++) {
+			bus->resource[i] =
+				&dev->resource[PCI_BRIDGE_RESOURCES+i];
+			bus->resource[i]->name = bus->name;
+		}
+		bus->resource[0]->flags |= pci_bridge_check_io(dev);
+		bus->resource[1]->flags |= IORESOURCE_MEM;
+		/* For now, propogate hose limits to the bus;
+		   we'll adjust them later. */
+		bus->resource[0]->end = hose->io_resource->end;
+		bus->resource[1]->end = hose->mem_resource->end;
+		/* Turn off downstream PF memory address range by default */
+		bus->resource[2]->start = 1024*1024;
+		bus->resource[2]->end = bus->resource[2]->start - 1;
+	}
+}
+
+char *pcibios_setup(char *str)
+{
+	return str;
+}
+
+void
+pcibios_align_resource(void *data, struct resource *res, unsigned long size)
+{
+	/* this should not be called */
+}
+
+void
+pcibios_update_resource(struct pci_dev *dev, struct resource *root,
+			struct resource *res, int resource)
+{
+	/* this should not be called */
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/pci_auto.c linux/arch/mips/kernel/pci_auto.c
--- v2.4.9/linux/arch/mips/kernel/pci_auto.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/kernel/pci_auto.c	Sun Sep  9 10:43:01 2001
@@ -0,0 +1,323 @@
+/*
+ * PCI autoconfiguration library
+ *
+ * Author: Matt Porter <mporter@mvista.com>
+ *
+ * Copyright 2000, 2001 MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/*
+ * Modified for MIPS by Jun Sun, jsun@mvista.com
+ *
+ * . Simplify the interface between pci_auto and the rest: a single function.
+ * . Assign resources from low address to upper address.
+ * . change most int to u32.
+ *
+ * Further modified to include it as mips generic code, ppopov@mvista.com.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+
+#include <asm/pci_channel.h>
+
+#define	DEBUG
+#ifdef 	DEBUG
+#define	DBG(x...)	printk(x)
+#else
+#define	DBG(x...)	
+#endif
+
+/* These are used for config access before all the PCI probing has been done. */
+int early_read_config_byte(struct pci_channel *hose, int bus, int dev_fn, int where, u8 *val);
+int early_read_config_word(struct pci_channel *hose, int bus, int dev_fn, int where, u16 *val);
+int early_read_config_dword(struct pci_channel *hose, int bus, int dev_fn, int where, u32 *val);
+int early_write_config_byte(struct pci_channel *hose, int bus, int dev_fn, int where, u8 val);
+int early_write_config_word(struct pci_channel *hose, int bus, int dev_fn, int where, u16 val);
+int early_write_config_dword(struct pci_channel *hose, int bus, int dev_fn, int where, u32 val);
+
+static u32 pciauto_lower_iospc;
+static u32 pciauto_upper_iospc;
+
+static u32 pciauto_lower_memspc;
+static u32 pciauto_upper_memspc;
+
+void __init 
+pciauto_setup_bars(struct pci_channel *hose,
+		   int current_bus,
+		   int pci_devfn)
+{
+	u32 bar_response, bar_size, bar_value;
+	u32 bar, addr_mask, bar_nr = 0;
+	u32 * upper_limit;
+	u32 * lower_limit;
+	int found_mem64 = 0;
+
+	DBG("PCI Autoconfig: Found Bus %d, Device %d, Function %d\n",
+	    current_bus, PCI_SLOT(pci_devfn), PCI_FUNC(pci_devfn) );
+
+	for (bar = PCI_BASE_ADDRESS_0; bar <= PCI_BASE_ADDRESS_5; bar+=4) {
+		/* Tickle the BAR and get the response */
+		early_write_config_dword(hose,
+					 current_bus,
+					 pci_devfn,
+					 bar,
+					 0xffffffff);
+		early_read_config_dword(hose,
+					current_bus,
+					pci_devfn,
+					bar,
+					&bar_response);
+
+		/* If BAR is not implemented go to the next BAR */
+		if (!bar_response)
+			continue;
+
+		/* Check the BAR type and set our address mask */
+		if (bar_response & PCI_BASE_ADDRESS_SPACE) {
+			addr_mask = PCI_BASE_ADDRESS_IO_MASK;
+			upper_limit = &pciauto_upper_iospc;
+			lower_limit = &pciauto_lower_iospc;
+			DBG("PCI Autoconfig: BAR %d, I/O, ", bar_nr);
+		} else {
+			if ((bar_response & PCI_BASE_ADDRESS_MEM_TYPE_MASK) ==
+			    PCI_BASE_ADDRESS_MEM_TYPE_64)
+				found_mem64 = 1;
+
+			addr_mask = PCI_BASE_ADDRESS_MEM_MASK;		
+			upper_limit = &pciauto_upper_memspc;
+			lower_limit = &pciauto_lower_memspc;
+			DBG("PCI Autoconfig: BAR %d, Mem, ", bar_nr);
+		}
+
+		/* Calculate requested size */
+		bar_size = ~(bar_response & addr_mask) + 1;
+
+		/* Allocate a base address */
+		bar_value = ((*lower_limit - 1) & ~(bar_size - 1)) + bar_size;
+
+		/* Write it out and update our limit */
+		early_write_config_dword(hose, current_bus, pci_devfn,
+					 bar, bar_value);
+
+		*lower_limit = bar_value + bar_size;
+
+		/*
+		 * If we are a 64-bit decoder then increment to the
+		 * upper 32 bits of the bar and force it to locate
+		 * in the lower 4GB of memory.
+		 */ 
+		if (found_mem64) {
+			bar += 4;
+			early_write_config_dword(hose,
+						 current_bus,
+						 pci_devfn,
+						 bar,
+						 0x00000000);
+		}
+
+		bar_nr++;
+
+		DBG("size=0x%x, address=0x%x\n",
+		    bar_size, bar_value);
+	}
+
+}
+
+void __init
+pciauto_prescan_setup_bridge(struct pci_channel *hose,
+			     int current_bus,
+			     int pci_devfn,
+			     int sub_bus)
+{
+	int cmdstat;
+
+	/* Configure bus number registers */
+	early_write_config_byte(hose, current_bus, pci_devfn,
+	                        PCI_PRIMARY_BUS, current_bus);
+	early_write_config_byte(hose, current_bus, pci_devfn,
+				PCI_SECONDARY_BUS, sub_bus + 1);
+	early_write_config_byte(hose, current_bus, pci_devfn,
+				PCI_SUBORDINATE_BUS, 0xff);
+
+	/* Round memory allocator to 1MB boundary */
+	pciauto_upper_memspc &= ~(0x100000 - 1);
+
+	/* Round I/O allocator to 4KB boundary */
+	pciauto_upper_iospc &= ~(0x1000 - 1);
+
+	/* Set up memory and I/O filter limits, assume 32-bit I/O space */
+	early_write_config_word(hose, current_bus, pci_devfn, PCI_MEMORY_LIMIT,
+				((pciauto_upper_memspc - 1) & 0xfff00000) >> 16);
+	early_write_config_byte(hose, current_bus, pci_devfn, PCI_IO_LIMIT,
+				((pciauto_upper_iospc - 1) & 0x0000f000) >> 8);
+	early_write_config_word(hose, current_bus, pci_devfn,
+				PCI_IO_LIMIT_UPPER16,
+				((pciauto_upper_iospc - 1) & 0xffff0000) >> 16);
+			
+	/* We don't support prefetchable memory for now, so disable */
+	early_write_config_word(hose, current_bus, pci_devfn,
+				PCI_PREF_MEMORY_BASE, 0x1000);
+	early_write_config_word(hose, current_bus, pci_devfn,
+				PCI_PREF_MEMORY_LIMIT, 0x1000);
+
+	/* Enable memory and I/O accesses, enable bus master */
+	early_read_config_dword(hose, current_bus, pci_devfn, PCI_COMMAND,
+				&cmdstat);
+	early_write_config_dword(hose, current_bus, pci_devfn, PCI_COMMAND,
+				 cmdstat | PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
+				 PCI_COMMAND_MASTER);
+}
+
+void __init
+pciauto_postscan_setup_bridge(struct pci_channel *hose,
+			      int current_bus,
+			      int pci_devfn,
+			      int sub_bus)
+{
+	/* Configure bus number registers */
+	early_write_config_byte(hose, current_bus, pci_devfn,
+				PCI_SUBORDINATE_BUS, sub_bus);
+
+	/* Round memory allocator to 1MB boundary */
+	pciauto_upper_memspc &= ~(0x100000 - 1);
+	early_write_config_word(hose, current_bus, pci_devfn, PCI_MEMORY_BASE,
+				pciauto_upper_memspc >> 16);
+
+	/* Round I/O allocator to 4KB boundary */
+	pciauto_upper_iospc &= ~(0x1000 - 1);
+	early_write_config_byte(hose, current_bus, pci_devfn, PCI_IO_BASE,
+				(pciauto_upper_iospc & 0x0000f000) >> 8);
+	early_write_config_word(hose, current_bus, pci_devfn,
+				PCI_IO_BASE_UPPER16, pciauto_upper_iospc >> 16);
+}
+
+#define      PCIAUTO_IDE_MODE_MASK           0x05
+
+int __init
+pciauto_bus_scan(struct pci_channel *hose, int current_bus)
+{
+	int sub_bus;
+	u32 pci_devfn, pci_class, cmdstat, found_multi=0;
+	unsigned short vid;
+	unsigned char header_type;
+	int devfn_start = 0;
+	int devfn_stop = 0xff;
+
+	sub_bus = current_bus;
+	
+	if (hose->first_devfn)
+		devfn_start = hose->first_devfn;
+	if (hose->last_devfn)
+		devfn_stop = hose->last_devfn;
+	
+	for (pci_devfn=devfn_start; pci_devfn<devfn_stop; pci_devfn++) {
+
+		if (PCI_FUNC(pci_devfn) && !found_multi)
+			continue;
+
+		early_read_config_byte(hose, current_bus, pci_devfn,
+				       PCI_HEADER_TYPE, &header_type);
+
+		if (!PCI_FUNC(pci_devfn))
+			found_multi = header_type & 0x80;
+
+		early_read_config_word(hose, current_bus, pci_devfn,
+				       PCI_VENDOR_ID, &vid);
+
+		if (vid == 0xffff) continue;
+
+		early_read_config_dword(hose, current_bus, pci_devfn,
+					PCI_CLASS_REVISION, &pci_class);
+		if ((pci_class >> 16) == PCI_CLASS_BRIDGE_PCI) {
+			DBG("PCI Autoconfig: Found P2P bridge, device %d\n", PCI_SLOT(pci_devfn));
+			pciauto_prescan_setup_bridge(hose, current_bus,
+						     pci_devfn, sub_bus);
+			sub_bus = pciauto_bus_scan(hose, sub_bus+1);
+			pciauto_postscan_setup_bridge(hose, current_bus,
+						      pci_devfn, sub_bus);
+
+		} else if ((pci_class >> 16) == PCI_CLASS_STORAGE_IDE) {
+
+			unsigned char prg_iface;
+
+			early_read_config_byte(hose, current_bus, pci_devfn,
+					       PCI_CLASS_PROG, &prg_iface);
+			if (!(prg_iface & PCIAUTO_IDE_MODE_MASK)) {
+				DBG("PCI Autoconfig: Skipping legacy mode IDE controller\n");
+				continue;
+			}
+		}
+
+		/*
+		 * Found a peripheral, enable some standard
+		 * settings
+		 */
+		early_read_config_dword(hose, current_bus, pci_devfn,
+					PCI_COMMAND, &cmdstat);
+		early_write_config_dword(hose, current_bus, pci_devfn,
+					 PCI_COMMAND, cmdstat | PCI_COMMAND_IO |
+					 PCI_COMMAND_MEMORY |
+					 PCI_COMMAND_MASTER);
+		early_write_config_byte(hose, current_bus, pci_devfn,
+					PCI_LATENCY_TIMER, 0x80);
+
+		/* Allocate PCI I/O and/or memory space */
+		pciauto_setup_bars(hose, current_bus, pci_devfn);
+	}
+	return sub_bus;
+}
+
+int __init
+pciauto_assign_resources(int busno, struct pci_channel *hose)
+{
+	/* setup resource limits */
+	pciauto_lower_iospc = hose->io_resource->start;
+	pciauto_upper_iospc = hose->io_resource->end + 1;
+	pciauto_lower_memspc = hose->mem_resource->start;
+	pciauto_upper_memspc = hose->mem_resource->end + 1;
+
+	return pciauto_bus_scan(hose, busno);
+}
+
+
+/*
+ * These functions are used early on before PCI scanning is done
+ * and all of the pci_dev and pci_bus structures have been created.
+ */
+static struct pci_dev *fake_pci_dev(struct pci_channel *hose, int busnr,
+                                    int devfn)
+{
+	static struct pci_dev dev;
+	static struct pci_bus bus;
+
+	dev.bus = &bus;
+	dev.sysdata = hose;
+	dev.devfn = devfn;
+	bus.number = busnr;
+	bus.ops = hose->pci_ops;
+
+	return &dev;
+}
+
+#define EARLY_PCI_OP(rw, size, type)					\
+int early_##rw##_config_##size(struct pci_channel *hose, int bus,	\
+                               int devfn, int offset, type value)	\
+{									\
+	return pci_##rw##_config_##size(fake_pci_dev(hose, bus, devfn),	\
+	                                offset, value);			\
+}
+
+EARLY_PCI_OP(read, byte, u8 *)
+EARLY_PCI_OP(read, word, u16 *)
+EARLY_PCI_OP(read, dword, u32 *)
+EARLY_PCI_OP(write, byte, u8)
+EARLY_PCI_OP(write, word, u16)
+EARLY_PCI_OP(write, dword, u32)
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/proc.c linux/arch/mips/kernel/proc.c
--- v2.4.9/linux/arch/mips/kernel/proc.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/proc.c	Sun Sep  9 10:43:01 2001
@@ -1,8 +1,10 @@
 /*
  *  linux/arch/mips/kernel/proc.c
  *
- *  Copyright (C) 1995, 1996  Ralf Baechle
+ *  Copyright (C) 1995, 1996, 2001  Ralf Baechle
+ *  Copyright (C) 2001  MIPS Technologies, Inc.
  */
+#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -12,9 +14,9 @@
 #include <asm/processor.h>
 #include <asm/watch.h>
 
-unsigned long unaligned_instructions;
+extern unsigned long unaligned_instructions;
 unsigned int vced_count, vcei_count;
-#if !defined(CONFIG_CPU_HAS_LLSC)
+#ifndef CONFIG_CPU_HAS_LLSC
 unsigned long ll_ops, sc_ops;
 #endif
 
@@ -83,7 +85,7 @@
 	len += sprintf(buffer + len, "microsecond timers\t: %s\n",
 	               (mips_cpu.options & MIPS_CPU_COUNTER) ? "yes" : "no");
 	len += sprintf(buffer + len, "extra interrupt vector\t: %s\n",
-	               dedicated_iv_available ? "yes" : "no");
+	               (mips_cpu.options & MIPS_CPU_DIVEC) ? "yes" : "no");
 	len += sprintf(buffer + len, "hardware watchpoint\t: %s\n",
 	               watch_available ? "yes" : "no");
 
@@ -92,7 +94,7 @@
 	len += sprintf(buffer + len, fmt, 'D', vced_count);
 	len += sprintf(buffer + len, fmt, 'I', vcei_count);
 
-#if !defined(CONFIG_CPU_HAS_LLSC)
+#ifndef CONFIG_CPU_HAS_LLSC
 	len += sprintf(buffer + len, "ll emulations\t\t: %lu\n",
 		       ll_ops);
 	len += sprintf(buffer + len, "sc emulations\t\t: %lu\n",
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/process.c linux/arch/mips/kernel/process.c
--- v2.4.9/linux/arch/mips/kernel/process.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/process.c	Sun Sep  9 10:43:01 2001
@@ -83,13 +83,10 @@
 	childksp = (unsigned long)p + KERNEL_STACK_SIZE - 32;
 
 	if (last_task_used_math == current)
-#ifdef CONFIG_MIPS_FPU_EMULATOR
-		if (mips_cpu.options & MIPS_CPU_FPU)
-#endif
-	{
+		if (mips_cpu.options & MIPS_CPU_FPU) {
 			set_cp0_status(ST0_CU1);
 			save_fp(p);
-	}
+		}
 	/* set up new TSS. */
 	childregs = (struct pt_regs *) childksp - 1;
 	*childregs = *regs;
@@ -120,8 +117,8 @@
 	 * switching for most programs since they don't use the fpu.
 	 */
 	p->thread.cp0_status = read_32bit_cp0_register(CP0_STATUS) &
-                            ~(ST0_CU3|ST0_CU2|ST0_CU1|KU_MASK);
-	childregs->cp0_status &= ~(ST0_CU3|ST0_CU2|ST0_CU1);
+                            ~(ST0_CU2|ST0_CU1|KU_MASK);
+	childregs->cp0_status &= ~(ST0_CU2|ST0_CU1);
 
 	return 0;
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/ptrace.c linux/arch/mips/kernel/ptrace.c
--- v2.4.9/linux/arch/mips/kernel/ptrace.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips/kernel/ptrace.c	Tue Sep 18 16:56:19 2001
@@ -29,11 +29,21 @@
 #include <asm/bootinfo.h>
 #include <asm/cpu.h>
 
+/*
+ * Called by kernel/ptrace.c when detaching..
+ *
+ * Make sure single step bits etc are not set.
+ */
+void ptrace_disable(struct task_struct *child)
+{
+	/* Nothing to do.. */
+}
+
 asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 {
 	struct task_struct *child;
 	int res;
-	extern void save_fp(void*);
+	extern void save_fp(struct task_struct *);
 
 	lock_kernel();
 #if 0
@@ -111,19 +121,31 @@
 			        unsigned long long *fregs
 					= (unsigned long long *)
 					    &child->thread.fpu.hard.fp_regs[0];
-#ifdef CONFIG_MIPS_FPU_EMULATOR
-			    if(!(mips_cpu.options & MIPS_CPU_FPU)) {
-				    fregs = (unsigned long long *)
-					&child->thread.fpu.soft.regs[0];
-			    } else 
+			 	if(!(mips_cpu.options & MIPS_CPU_FPU)) {
+					fregs = (unsigned long long *)
+						child->thread.fpu.soft.regs;
+				} else 
+					if (last_task_used_math == child) {
+						enable_cp1();
+						save_fp(child);
+						disable_cp1();
+						last_task_used_math = NULL;
+						regs->cp0_status &= ~ST0_CU1;
+					}
+				/*
+				 * The odd registers are actually the high
+				 * order bits of the values stored in the even
+				 * registers - unless we're using r2k_switch.S.
+				 */
+#ifdef CONFIG_CPU_R3000
+				if (mips_cpu.options & MIPS_CPU_FPU)
+					tmp = *(unsigned long *)(fregs + addr);
+				else
 #endif
-				if (last_task_used_math == child) {
-					enable_cp1();
-					save_fp(child);
-					disable_cp1();
-					last_task_used_math = NULL;
-				}
-				tmp = (unsigned long) fregs[(addr - 32)];
+				if (addr & 1)
+					tmp = (unsigned long) (fregs[((addr & ~1) - 32)] >> 32);
+				else
+					tmp = (unsigned long) (fregs[(addr - 32)] & 0xffffffff);
 			} else {
 				tmp = -1;	/* FP not yet used  */
 			}
@@ -144,12 +166,10 @@
 			tmp = regs->lo;
 			break;
 		case FPC_CSR:
-#ifdef CONFIG_MIPS_FPU_EMULATOR
-			if(!(mips_cpu.options & MIPS_CPU_FPU))
+			if (!(mips_cpu.options & MIPS_CPU_FPU))
 				tmp = child->thread.fpu.soft.sr;
 			else
-#endif
-			tmp = child->thread.fpu.hard.control;
+				tmp = child->thread.fpu.hard.control;
 			break;
 		case FPC_EIR: {	/* implementation / version register */
 			unsigned int flags;
@@ -192,19 +212,17 @@
 			unsigned long long *fregs;
 			fregs = (unsigned long long *)&child->thread.fpu.hard.fp_regs[0];
 			if (child->used_math) {
-				if (last_task_used_math == child)
-#ifdef CONFIG_MIPS_FPU_EMULATOR
-				    if(!(mips_cpu.options & MIPS_CPU_FPU)) {
-					fregs = (unsigned long long *)
-					    &child->thread.fpu.soft.regs[0];
-				    } else
-#endif
-				{
-					enable_cp1();
-					save_fp(child);
-					disable_cp1();
-					last_task_used_math = NULL;
-					regs->cp0_status &= ~ST0_CU1;
+				if (last_task_used_math == child) {
+					if(!(mips_cpu.options & MIPS_CPU_FPU)) {
+						fregs = (unsigned long long *)
+						child->thread.fpu.soft.regs;
+					} else {
+						enable_cp1();
+						save_fp(child);
+						disable_cp1();
+						last_task_used_math = NULL;
+						regs->cp0_status &= ~ST0_CU1;
+					}
 				}
 			} else {
 				/* FP not yet used  */
@@ -212,7 +230,23 @@
 				       sizeof(child->thread.fpu.hard));
 				child->thread.fpu.hard.control = 0;
 			}
-			fregs[addr - FPR_BASE] = data;
+			/*
+			 * The odd registers are actually the high order bits
+			 * of the values stored in the even registers - unless
+			 * we're using r2k_switch.S.
+			 */
+#ifdef CONFIG_CPU_R3000
+			if (mips_cpu.options & MIPS_CPU_FPU)
+				*(unsigned long *)(fregs + addr) = data;
+			else
+#endif
+			if (addr & 1) {
+				fregs[(addr & ~1) - FPR_BASE] &= 0xffffffff;
+				fregs[(addr & ~1) - FPR_BASE] |= ((unsigned long long) data) << 32;
+			} else {
+				fregs[addr - FPR_BASE] &= ~0xffffffffLL;
+				fregs[addr - FPR_BASE] |= data;
+			}
 			break;
 		}
 		case PC:
@@ -225,12 +259,10 @@
 			regs->lo = data;
 			break;
 		case FPC_CSR:
-#ifdef CONFIG_MIPS_FPU_EMULATOR
-			if(!(mips_cpu.options & MIPS_CPU_FPU)) 
+			if (!(mips_cpu.options & MIPS_CPU_FPU)) 
 				child->thread.fpu.soft.sr = data;
 			else
-#endif
-			child->thread.fpu.hard.control = data;
+				child->thread.fpu.hard.control = data;
 			break;
 		default:
 			/* The rest are not allowed. */
@@ -269,18 +301,7 @@
 		break;
 
 	case PTRACE_DETACH: /* detach a process that was attached. */
-		res = -EIO;
-		if ((unsigned long) data > _NSIG)
-			break;
-		child->ptrace = 0;
-		child->exit_code = data;
-		write_lock_irq(&tasklist_lock);
-		REMOVE_LINKS(child);
-		child->p_pptr = child->p_opptr;
-		SET_LINKS(child);
-		write_unlock_irq(&tasklist_lock);
-		wake_up_process(child);
-		res = 0;
+		res = ptrace_detach(child, data);
 		break;
 
 	case PTRACE_SETOPTIONS:
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/r2300_switch.S linux/arch/mips/kernel/r2300_switch.S
--- v2.4.9/linux/arch/mips/kernel/r2300_switch.S	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/r2300_switch.S	Sun Sep  9 10:43:01 2001
@@ -1,5 +1,4 @@
-/* $Id: r2300_switch.S,v 1.8 1999/08/18 23:37:44 ralf Exp $
- *
+/*
  * r2300_switch.S: R2300 specific task switching code.
  *
  * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/r4k_switch.S linux/arch/mips/kernel/r4k_switch.S
--- v2.4.9/linux/arch/mips/kernel/r4k_switch.S	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/r4k_switch.S	Sun Sep  9 10:43:01 2001
@@ -7,15 +7,10 @@
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  * Copyright (C) 1994, 1995, 1996, by Andreas Busse
  * Copyright (C) 1999 Silicon Graphics, Inc.
+ * Copyright (C) 2000 MIPS Technologies, Inc.
+ *    written by Carsten Langgaard, carstenl@mips.com
  */
-/**************************************************************************
- *  13 Nov, 2000.
- *  Made support for MIPS32 CPUs and restoring of fp registers.
- *
- *  Carsten Langgaard, carstenl@mips.com
- *  Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
- *************************************************************************/
-	
+#include <linux/config.h>
 #include <asm/asm.h>
 #include <asm/bootinfo.h>
 #include <asm/cachectl.h>
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/reset.c linux/arch/mips/kernel/reset.c
--- v2.4.9/linux/arch/mips/kernel/reset.c	Thu Jun 26 12:33:37 1997
+++ linux/arch/mips/kernel/reset.c	Sun Sep  9 10:43:01 2001
@@ -1,7 +1,10 @@
 /*
- *  linux/arch/mips/sni/process.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.
  *
- *  Reset the machine.
+ * Copyright (C) 2001 by Ralf Baechle
+ * Copyright (C) 2001 MIPS Technologies, Inc.
  */
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -13,6 +16,9 @@
  * So handle all using function pointers to machine specific
  * functions.
  */
+void (*_machine_restart)(char *command);
+void (*_machine_halt)(void);
+void (*_machine_power_off)(void);
 
 void machine_restart(char *command)
 {
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/scall_o32.S linux/arch/mips/kernel/scall_o32.S
--- v2.4.9/linux/arch/mips/kernel/scall_o32.S	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/scall_o32.S	Sun Sep  9 10:43:01 2001
@@ -65,36 +65,32 @@
 1:	sw	v0, PT_R2(sp)		# result
 
 EXPORT(o32_ret_from_sys_call)
-	la	t1, irq_stat		# softirq_active
-#ifdef CONFIG_SMP
-	lw	t0, TASK_PROCESSOR($28)
-        sll	t0, t0, 5
-	addu	t1, t0
-#endif
-	lw	t0, 0(t1)		# softirq_active
-	lw	t1, 4(t1)		# softirq_mask.  unused delay slot
-	and	t0, t1
-	bnez	t0, o32_handle_softirq
+	mfc0	t0, CP0_STATUS		# need_resched and signals atomic test
+	ori	t0, t0, 1
+	xori	t0, t0, 1
+	mtc0	t0, CP0_STATUS
 
-9:	lw	t0,PT_STATUS(sp)	# returning to kernel mode?
-	andi	t1, t0, KU_USER
 	lw	t2, TASK_NEED_RESCHED($28)
-	beqz	t1, o32_return		# -> yes
 	bnez	t2, o32_reschedule
 	lw	v0, TASK_SIGPENDING($28)
+	bnez	v0, signal_return
+restore_all:
+	RESTORE_SOME
+	RESTORE_SP_AND_RET
+
+/* Put this behind restore_all for the sake of the branch prediction.  */
+signal_return:
+	.type	signal_return, @function
+
+	mfc0	t0, CP0_STATUS
+	ori	t0, t0, 1
+	mtc0	t0, CP0_STATUS
+
 	move	a0, zero
-	beqz	v0, o32_return
 	move	a1, sp
-	SAVE_STATIC
 	jal	do_signal
+	b	restore_all
 
-o32_return:
-	RESTORE_SOME
-	RESTORE_SP_AND_RET
-
-o32_handle_softirq:
-	jal	do_softirq
-	b	9b
 o32_reschedule:
 	SAVE_STATIC
 	jal	schedule
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/setup.c linux/arch/mips/kernel/setup.c
--- v2.4.9/linux/arch/mips/kernel/setup.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/setup.c	Sun Sep  9 10:43:01 2001
@@ -191,6 +191,12 @@
 				           MIPS_CPU_WATCH | MIPS_CPU_VCE;
 			mips_cpu.tlbsize = 48;
 			break;
+                case PRID_IMP_VR41XX:
+                        mips_cpu.cputype = CPU_VR41XX;
+                        mips_cpu.isa_level = MIPS_CPU_ISA_III;
+                        mips_cpu.options = R4K_OPTS;
+                        mips_cpu.tlbsize = 32;
+                        break;
 		case PRID_IMP_R4600:
 			mips_cpu.cputype = CPU_R4600;
 			mips_cpu.isa_level = MIPS_CPU_ISA_III;
@@ -282,7 +288,7 @@
 			break;
 		case PRID_IMP_R10000:
 			mips_cpu.cputype = CPU_R10000;
-			mips_cpu.cputype = MIPS_CPU_ISA_IV;
+			mips_cpu.isa_level = MIPS_CPU_ISA_IV;
 			mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | 
 				           MIPS_CPU_FPU | MIPS_CPU_32FPR | 
 				           MIPS_CPU_COUNTER | MIPS_CPU_WATCH;
@@ -719,8 +725,10 @@
 #ifdef CONFIG_BLK_DEV_INITRD
 	/* Board specific code should have set up initrd_start and initrd_end */
 	ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
-	initrd_start = (unsigned long)&__rd_start;
-	initrd_end = (unsigned long)&__rd_end;
+	if( __rd_start != __rd_end ) {
+		initrd_start = (unsigned long)&__rd_start;
+		initrd_end = (unsigned long)&__rd_end;
+	}
 	initrd_below_start_ok = 1;
 	if (initrd_start) {
 		unsigned long initrd_size = ((unsigned char *)initrd_end) - ((unsigned char *)initrd_start); 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/signal.c linux/arch/mips/kernel/signal.c
--- v2.4.9/linux/arch/mips/kernel/signal.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/kernel/signal.c	Sun Sep  9 10:43:01 2001
@@ -464,10 +464,10 @@
 		/*
 		 * Set up the return code ...
 		 *
-		 *         li      v0, __NR_sigreturn
+		 *         li      v0, __NR_rt_sigreturn
 		 *         syscall
 		 */
-		err |= __put_user(0x24020000 + __NR_sigreturn,
+		err |= __put_user(0x24020000 + __NR_rt_sigreturn,
 		                  frame->rs_code + 0);
 		err |= __put_user(0x0000000c                 ,
 		                  frame->rs_code + 1);
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/softfp.S linux/arch/mips/kernel/softfp.S
--- v2.4.9/linux/arch/mips/kernel/softfp.S	Sun Jul  9 22:18:15 2000
+++ linux/arch/mips/kernel/softfp.S	Wed Dec 31 16:00:00 1969
@@ -1,666 +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) 1998, 2000 by Ralf Baechle
- *
- * For now it's just a crude hack good enough to run certain fp programs like
- * Mozilla.
- * XXX: Handle MIPS II/III/IV/V enhancements, exceptions, ...
- */
-#include <asm/regdef.h>
-#include <asm/asm.h>
-
-#ifndef __KERNEL__
-#define printk printf
-#endif
-
-#define LOCK_KERNEL
-#define UNLOCK_KERNEL
-
-/*
- * This duplicates definitions from <linux/kernel.h>.
- */
-#define KERN_EMERG      "<0>"   /* system is unusable                   */
-#define KERN_ALERT      "<1>"   /* action must be taken immediately     */
-#define KERN_CRIT       "<2>"   /* critical conditions                  */
-#define KERN_ERR        "<3>"   /* error conditions                     */
-#define KERN_WARNING    "<4>"   /* warning conditions                   */
-#define KERN_NOTICE     "<5>"   /* normal but significant condition     */
-#define KERN_INFO       "<6>"   /* informational                        */
-#define KERN_DEBUG      "<7>"   /* debug-level messages                 */
-
-/*
- * This duplicates definitions from <asm/signal.h>
- */
-#define SIGILL           4      /* Illegal instruction (ANSI).  */
-
-/*
- * Definitions about the instruction format
- */
-#define fd_shift	6
-#define fr_shift	21
-#define fs_shift	11
-#define ft_shift	16
-
-/*
- * NaNs as use by the MIPS architecture
- */
-#define S_QNaN		0x7fbfffff
-#define D_QNaN		0x7ff7ffffffffffff
-#define W_QNaN		0x7fffffff
-#define L_QNaN		0x7fffffffffffffff
-
-/*
- * Checking for NaNs
- */
-#define S_is_QNaN(reg,res)						\
-	sll	res, reg, S_F_size - S_F_bits
-#define D_is_QNaN(reg1,reg2,res)					\
-	sll	res, reg1, (D_F_size - 32) - (D_F_bits - 32);		\
-	or	res, reg2
-
-/*
- * Checking for Denorms
- */
-#define S_is_Denorm(reg,res)						\
-	li	res, 1 << (S_F_bits - 1);				\
-	and	reg, res
-
-/*
- * Some constants that define the properties of single precission numbers.
- */
-#define S_M_prec	24
-#define S_E_max		127
-#define S_E_min		-126
-#define S_E_bias	127
-#define S_E_bits	8
-#define S_F_bits	23
-#define S_F_size	32
-
-/* Set temp0, if exponent of reg is S_E_max + 1.  */
-#define S_is_E_max(reg,temp0,temp1)					\
-	li	temp0, (S_E_max + 1 + S_E_bias) << S_F_bits;		\
-	and	temp1, temp0, reg;					\
-	seq	temp0, temp1			/* temp0 != 0 if NaN */
-
-/* Clear temp0, if exponent of reg is S_E_min - 1.  */
-#define S_is_E_min(reg,temp0)						\
-	li	temp0, (S_E_min - 1 + S_E_bias) << S_F_bits;		\
-	and	temp0, reg	/* temp0 == 0 if denorm or zero */
-
-/* Set temp0 if reg is a NaN assuming S_is_E_max is true  */
-#define S_get_F(reg,temp0)						\
-	li	temp0, (1 << S_F_bits) - 1;				\
-	and	temp0, reg			/* temp0 != 0 if NaN */
-
-/* Set res if fraction of reg is != 0.  */
-#define S_is_Inf(reg,res)						\
-	li	res, (1 << S_F_bits) - 1;				\
-	and	res, reg			/* temp0 == 0 if Inf */
-
-
-/*
- * Some constants that define the properties of double precission numbers.
- */
-#define D_M_prec	53
-#define D_E_max		1023
-#define D_E_min		-1022
-#define D_E_bias	1023
-#define D_E_bits	8
-#define D_F_bits	52
-#define D_F_size	64
-
-/* Set temp0, if exponent of reg1/reg2 is D_E_max.  */
-#define D_is_E_max(reg1,reg2,temp0,temp1)				\
-	li	temp0, (D_E_max + 1 + D_E_bias) << (D_F_bits - 32);	\
-	and	temp1, temp0, reg1;					\
-	seq	temp0, temp1			/* temp0 != 0 if NaN */
-
-/* Clear temp0, if exponent of reg is D_E_min.  */
-#define D_is_E_min(reg1,reg2,res)					\
-	li	res, (D_E_min + 1 + D_E_bias) << (D_F_bits - 32);	\
-	and	res, reg1	/* temp0 == 0 if NaN or zero */
-
-/* Set res if reg is a NaN assuming S_is_E_max is true  */
-#define D_get_F(reg1,reg2,res)						\
-	li	res, (1 << (D_F_bits - 32)) - 1;			\
-	and	res, reg1			/* temp0 != 0 if NaN */
-
-/* Set temp0 if reg1/reg2 is a NaN  */
-#define D_is_NAN(reg1,reg2,temp0,temp1)					\
-	li	temp0, (1 << (D_F_bits - 32) - 1;			\
-	and	temp0, reg1;						\
-	or	temp0, reg2;						\
-	sne	temp0, zero, temp0		/* temp0 != 0 if NaN */
-
-/* Set res if fraction of reg1/reg2 is != 0.  */
-#define D_is_Inf(reg1,reg2,res)						\
-	li	res, (1 << (D_F_bits - 32)) - 1;			\
-	and	res, reg1;						\
-	or	res, reg2			/* temp0 == 0 if Inf */
-
-/* Complain about yet unhandled instruction.  */
-#define BITCH(insn)							\
-insn:	LOCK_KERNEL;							\
-	la	a1, 8f;							\
-	TEXT(#insn);							\
-	la	a0, nosim;						\
-	UNLOCK_KERNEL;							\
-	j	done
-
-	.data
-nosim: .asciz	KERN_DEBUG "Don't know how to simulate %s instruction\n"
-	.previous
-
-/*
- * When we come here, we've saved some of the integer registers and
- * reenabled interrupts.
- */
-LEAF(simfp)
-	.set	noreorder
-	.cpload	$25
-	.set	reorder
-
-	subu	sp, 16
-	.cprestore 20
-	sw	ra, 16(sp)
-
-	/* For now we assume that we get the opcode to simulate passed in as
-	   an argument.  */
-	move	t0, a0
-
-	/*
-	 * First table lookup using insn[5:0]
-	 */
-	la	t1, lowtab
-	andi	t2, t0, 0x3f
-	sll	t2, t2, 2
-	addu	t1, t2
-	lw	t1, (t1)
-	jr	t1
-	END(simfp)
-
-/*
- * We only decode the lower 3 of the 5 bit in the fmt field.  That way we
- * can keep the jump table significantly shorter.
- */
-#define FMT_switch(insn,opc,temp0,temp1)				\
-insn:	srl	temp0, opc, 19;						\
-	andi	temp0, 0x1c;						\
-	la	temp1, insn##.tab;					\
-	addu	temp0, temp1;						\
-	lw	temp0, (temp0);						\
-	jr	temp0;							\
-									\
-	.data;								\
-insn##.tab:								\
-	.word	insn##.s, insn##.d, unimp, unimp;			\
-	.word	insn##.w, insn##.l, unimp, unimp;			\
-	.previous
-
-	BITCH(add)
-	BITCH(sub)
-	BITCH(mul)
-	BITCH(div)
-	BITCH(sqrt)
-	BITCH(abs)
-	BITCH(mov)
-	BITCH(neg)
-	BITCH(round.l)
-	BITCH(trunc.l)
-	BITCH(ceil.l)
-	BITCH(floor.l)
-	BITCH(round.w)
-	BITCH(trunc.w)
-	BITCH(ceil.w)
-	BITCH(floor.w)
-	BITCH(cvt.s)
-	BITCH(cvt.d)
-
-/* ------------------------------------------------------------------------ */
-
-FMT_switch(cvt.w,t0,t1,t2)
-
-/* Convert a single fp to a fixed point integer.  */
-cvt.w.s:
-	srl	t1, t0, fs_shift	# Get source register
-	andi	t1, 31
-	jal	s_get_fpreg
-
-	S_is_E_max(t1,t2,t3)
-	beqz	t2, 3f
-	/* Might be a NaN or Inf.  */
-	S_get_F(t1,t2)
-	beqz	t2, 2f
-
-	/* It's a NaN.  IEEE says undefined.  */
-	/* Is it a QNaN?  Then the result is a QNaN as well.  */
-	S_is_QNaN(t1,t2)
-	bltz	t2, 1f
-
-	/* XXX Ok, it's a SNaN.  Signal invalid exception, if enabled.
-	   For now we don't signal and supply a QNaN for result.  */
-
-1:	li	t2, W_QNaN
-	srl	t1, t0, fd_shift	# Put result register
-	andi	t1, 31
-	jal	s_put_fpreg
-	j	done
-2:
-
-	S_is_Inf(t1,t2)
-	bnez	t2, 2f
-
-	/* It's +/- Inf.  Set register to +/- max. integer.  */
-	/* XXX Send invalid operation exception instead, if enabled.  */
-	srl	t1, t1, 31		# Extract sign bit
-	li	t2, 0x7fffffff
-	addu	t2, t1
-
-	srl	t1, t0, fd_shift	# Put result register
-	andi	t1, 31
-	jal	s_put_fpreg
-	j	done
-2:
-3:	
-
-	/* But then it might be a denorm or zero?  */
-	S_is_E_min(t1,t2)
-	bnez	t2, 2f
-
-	/* Ok, it's a denorm or zero.  */
-	S_get_F(t1,t2)
-	beqz	t2, 1f
-
-	/* It's a denorm.  */
-	/* XXX Should be signaling inexact exception, if enabled.  */
-	/* Fall through.  */
-1:
-	/* Yes, it is a denorm or zero.  Supply a zero as result.  */
-	move	t2, zero
-	srl	t1, t0, fd_shift	# Put result register
-	andi	t1, 31
-	jal	s_put_fpreg
-	j	done
-2:
-
-	/* XXX Ok, it's a normal number.  We don't handle that case yet.
-	   If we have fp hardware this case is unreached.  Add this for
-	   full fp simulation.  */
-
-	/* Done, return.  */
-	lw	ra, 16(sp)
-	addu	sp, 16
-	jr	ra
-
-/* Convert a double fp to a fixed point integer.  */
-cvt.w.d:
-	srl	t1, t0, fs_shift	# Get source register
-	andi	t1, 31
-	jal	d_get_fpreg
-
-	D_is_E_max(t1,t2,t3,t4)
-	beqz	t3, 3f
-
-	/* Might be a NaN or Inf.  */
-	D_get_F(t1,t2,t3)
-	or	t3, t2
-	beqz	t3, 2f
-
-	/* It's a NaN.  IEEE says undefined.  */
-	/* Is it a QNaN?  Then the result is a QNaN as well.  */
-	D_is_QNaN(t1,t2,t3)
-	bltz	t3, 1f
-
-	/* XXX Ok, it's a SNaN.  Signal invalid exception, if enabled.
-	   For now we don't signal and supply a QNaN for result.  */
-
-1:	li	t2, W_QNaN
-	srl	t1, t0, fd_shift	# Put result register
-	andi	t1, 31
-	jal	s_put_fpreg
-	j	done
-2:
-
-	D_is_Inf(t1,t2,t3)
-	bnez	t3, 2f
-
-	/* It's +/- Inf.  Set register to +/- max. integer.  */
-	/* XXX Send invalid operation exception instead, if enabled.  */
-	srl	t1, t1, 31		# Extract sign bit
-	li	t2, 0x7fffffff
-	addu	t2, t1
-
-	srl	t1, t0, fd_shift	# Put result register
-	andi	t1, 31
-	jal	s_put_fpreg
-	j	done
-2:
-3:	
-
-	/* But then it might be a denorm or zero?  */
-	D_is_E_min(t1,t2,t3)
-	bnez	t3, 2f
-
-	/* Ok, it's a denorm or zero.  */
-	D_get_F(t1,t2,t3)
-	or	t3, t2
-	beqz	t3, 1f
-
-	/* It's a denorm.  */
-	/* XXX Should be signaling inexact exception, if enabled.  */
-	/* Fall through.  */
-1:
-	/* Yes, it is a denorm or zero.  Supply a zero as result.  */
-	move	t2, zero
-	srl	t1, t0, fd_shift	# Put result register
-	andi	t1, 31
-	jal	s_put_fpreg
-	j	done
-2:
-
-	/* XXX Ok, it's a normal number.  We don't handle that case yet.
-	   If we have fp hardware this case is only reached if the value
-	   of the source register exceeds the range which is representable
-	   in a single precission register.  For now we kludge by returning
-	   +/- maxint and don't signal overflow. */
-
-	srl	t1, t1, 31		# Extract sign bit
-	li	t2, 0x7fffffff
-	addu	t2, t1
-
-	srl	t1, t0, fd_shift	# Put result register
-	andi	t1, 31
-	jal	s_put_fpreg
-
-	/* Done, return.  */
-	lw	ra, 16(sp)
-	addu	sp, 16
-	jr	ra
-
-cvt.w.w = unimp				# undefined result
-cvt.w.l = unimp				# undefined result
-
-/* MIPS III extension, no need to handle for 32bit OS.  */
-cvt.l = unimp
-
-/* ------------------------------------------------------------------------ */
-
-	BITCH(c.f)
-	BITCH(c.un)
-	BITCH(c.eq)
-	BITCH(c.ueq)
-	BITCH(c.olt)
-	BITCH(c.ult)
-	BITCH(c.ole)
-	BITCH(c.ule)
-	BITCH(c.sf)
-	BITCH(c.ngle)
-	BITCH(c.seq)
-	BITCH(c.ngl)
-	BITCH(c.lt)
-	BITCH(c.nge)
-	BITCH(c.le)
-	BITCH(c.ngt)
-
-/* Get the single precission register which's number is in t1.  */
-s_get_fpreg:
-	.set	noat
-	sll	AT, t1, 2
-	sll	t1, 3
-	addu	t1, AT
-	la	AT, 1f
-	addu	AT, t1
-	jr	AT
-	.set	at
-
-1:	mfc1	t1, $0
-	jr	ra
-	mfc1	t1, $1
-	jr	ra
-	mfc1	t1, $2
-	jr	ra
-	mfc1	t1, $3
-	jr	ra
-	mfc1	t1, $4
-	jr	ra
-	mfc1	t1, $5
-	jr	ra
-	mfc1	t1, $6
-	jr	ra
-	mfc1	t1, $7
-	jr	ra
-	mfc1	t1, $8
-	jr	ra
-	mfc1	t1, $9
-	jr	ra
-	mfc1	t1, $10
-	jr	ra
-	mfc1	t1, $11
-	jr	ra
-	mfc1	t1, $12
-	jr	ra
-	mfc1	t1, $13
-	jr	ra
-	mfc1	t1, $14
-	jr	ra
-	mfc1	t1, $15
-	jr	ra
-	mfc1	t1, $16
-	jr	ra
-	mfc1	t1, $17
-	jr	ra
-	mfc1	t1, $18
-	jr	ra
-	mfc1	t1, $19
-	jr	ra
-	mfc1	t1, $20
-	jr	ra
-	mfc1	t1, $21
-	jr	ra
-	mfc1	t1, $22
-	jr	ra
-	mfc1	t1, $23
-	jr	ra
-	mfc1	t1, $24
-	jr	ra
-	mfc1	t1, $25
-	jr	ra
-	mfc1	t1, $26
-	jr	ra
-	mfc1	t1, $27
-	jr	ra
-	mfc1	t1, $28
-	jr	ra
-	mfc1	t1, $29
-	jr	ra
-	mfc1	t1, $30
-	jr	ra
-	mfc1	t1, $31
-	jr	ra
-
-/*
- * Put the value in t2 into the single precission register which's number
- * is in t1.
- */
-s_put_fpreg:
-	.set	noat
-	sll	AT, t1, 2
-	sll	t1, 3
-	addu	t1, AT
-	la	AT, 1f
-	addu	AT, t1
-	jr	AT
-	.set	at
-	
-1:	mtc1	t2, $0
-	jr	ra
-	mtc1	t2, $1
-	jr	ra
-	mtc1	t2, $2
-	jr	ra
-	mtc1	t2, $3
-	jr	ra
-	mtc1	t2, $4
-	jr	ra
-	mtc1	t2, $5
-	jr	ra
-	mtc1	t2, $6
-	jr	ra
-	mtc1	t2, $7
-	jr	ra
-	mtc1	t2, $8
-	jr	ra
-	mtc1	t2, $9
-	jr	ra
-	mtc1	t2, $10
-	jr	ra
-	mtc1	t2, $11
-	jr	ra
-	mtc1	t2, $12
-	jr	ra
-	mtc1	t2, $13
-	jr	ra
-	mtc1	t2, $14
-	jr	ra
-	mtc1	t2, $15
-	jr	ra
-	mtc1	t2, $16
-	jr	ra
-	mtc1	t2, $17
-	jr	ra
-	mtc1	t2, $18
-	jr	ra
-	mtc1	t2, $19
-	jr	ra
-	mtc1	t2, $20
-	jr	ra
-	mtc1	t2, $21
-	jr	ra
-	mtc1	t2, $22
-	jr	ra
-	mtc1	t2, $23
-	jr	ra
-	mtc1	t2, $24
-	jr	ra
-	mtc1	t2, $25
-	jr	ra
-	mtc1	t2, $26
-	jr	ra
-	mtc1	t2, $27
-	jr	ra
-	mtc1	t2, $28
-	jr	ra
-	mtc1	t2, $29
-	jr	ra
-	mtc1	t2, $30
-	jr	ra
-	mtc1	t2, $31
-	jr	ra
-
-/* Get the double precission register which's number is in t1 into t1/t2.  */
-d_get_fpreg:
-	.set	noat
-	sll	t1, 3
-	la	AT, 1f
-	addu	AT, t1
-	jr	AT
-	.set	at
-
-1:	mfc1	t1, $0
-	mfc1	t2, $1
-	jr	ra
-	mfc1	t1, $2
-	mfc1	t2, $3
-	jr	ra
-	mfc1	t1, $4
-	mfc1	t2, $5
-	jr	ra
-	mfc1	t1, $6
-	mfc1	t2, $7
-	jr	ra
-	mfc1	t1, $8
-	mfc1	t2, $9
-	jr	ra
-	mfc1	t1, $10
-	mfc1	t2, $11
-	jr	ra
-	mfc1	t1, $12
-	mfc1	t2, $13
-	jr	ra
-	mfc1	t1, $14
-	mfc1	t2, $15
-	jr	ra
-	mfc1	t1, $16
-	mfc1	t2, $17
-	jr	ra
-	mfc1	t1, $18
-	mfc1	t2, $19
-	jr	ra
-	mfc1	t1, $20
-	mfc1	t2, $21
-	jr	ra
-	mfc1	t1, $22
-	mfc1	t2, $23
-	jr	ra
-	mfc1	t1, $24
-	mfc1	t2, $25
-	jr	ra
-	mfc1	t1, $26
-	mfc1	t2, $27
-	jr	ra
-	mfc1	t1, $28
-	mfc1	t2, $29
-	jr	ra
-	mfc1	t1, $30
-	mfc1	t2, $31
-	jr	ra
-
-/*
- * Send an invalid operation exception.
- */
-invalid:
-	lw	ra, 16(sp)
-	addu	sp, 16
-	jr	ra
-
-/*
- * Done, just skip over the current instruction
- */
-done:
-	lw	ra, 16(sp)
-	addu	sp, 16
-	jr	ra
-
-unimp:
-	/* We've run into an yet unknown instruction.  This happens either
-	   on new, yet unsupported CPU types or when the faulting instruction
-	   is being executed for cache but has been overwritten in memory.  */
-	LOCK_KERNEL
-	move	a0, t0
-	PRINT(KERN_DEBUG "FP support: unknown fp op %08lx, ")
-	PRINT("please mail to ralf@gnu.org.\n")
-
-	li	a0, SIGILL			# Die, sucker ...
-	move	a1, $28
-	jal	force_sig
-	UNLOCK_KERNEL
-
-	lw	ra, 16(sp)
-	addu	sp, 16
-	jr	ra
-
-/*
- * Jump table for the lowest 6 bits of a cp1 instruction.
- */
-	.data
-lowtab:	.word	add,   sub,   mul,   div,   sqrt,  abs,   mov,   neg
-	.word	round.l,trunc.l,ceil.l,floor.l,round.w,trunc.w,ceil.w,floor.w
-	.word	unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp
-	.word	unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp
-	.word	cvt.s, cvt.d, unimp, unimp, cvt.w, cvt.l, unimp, unimp
-	.word	unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp
-	.word	c.f,   c.un,  c.eq,  c.ueq, c.olt, c.ult, c.ole, c.ule
-	.word	c.sf,  c.ngle,c.seq, c.ngl, c.lt,  c.nge, c.le, c.ngt
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/time.c linux/arch/mips/kernel/time.c
--- v2.4.9/linux/arch/mips/kernel/time.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/time.c	Sun Sep  9 10:43:01 2001
@@ -1,18 +1,15 @@
-/***********************************************************************
+/*
  * Copyright 2001 MontaVista Software Inc.
  * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
  *
- * arch/mips/kernel/time.c
- *     Common time service routines for MIPS machines.  See 
- *     Documents/MIPS/time.txt. 
+ * Common time service routines for MIPS machines. See 
+ * Documents/MIPS/README.txt. 
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
- ***********************************************************************
  */
-
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -29,22 +26,11 @@
 #include <asm/cpu.h>
 #include <asm/time.h>
 #include <asm/hardirq.h>
-
-/* 
- * macro for catching spurious errors.  Eable to LL_DEBUG in kernel hacking
- * config menu.
- */
-#ifdef CONFIG_LL_DEBUG
-#define	MIPS_ASSERT(x)	if (!(x)) { panic("MIPS_ASSERT failed at %s:%d\n", __FILE__, __LINE__); }
-#define MIPS_DEBUG(x)  do { x; } while (0)
-#else
-#define MIPS_ASSERT(x)
-#define MIPS_DEBUG(x)
-#endif
+#include <asm/div64.h>
 
 /* This is for machines which generate the exact clock. */
 #define USECS_PER_JIFFY (1000000/HZ)
-#define USECS_PER_JIFFY_FRAC (0x100000000*1000000/HZ&0xffffffff)
+#define USECS_PER_JIFFY_FRAC ((1000000ULL << 32) / HZ & 0xffffffff)
 
 /*
  * forward reference
@@ -74,50 +60,50 @@
  */
 void do_gettimeofday(struct timeval *tv)
 {
-        unsigned long flags;
+	unsigned long flags;
+
+	read_lock_irqsave (&xtime_lock, flags);
+	*tv = xtime;
+	tv->tv_usec += do_gettimeoffset();
+
+	/*
+	 * xtime is atomically updated in timer_bh. jiffies - wall_jiffies
+	 * is nonzero if the timer bottom half hasnt executed yet.
+	 */
+	if (jiffies - wall_jiffies)
+		tv->tv_usec += USECS_PER_JIFFY;
 
-        read_lock_irqsave (&xtime_lock, flags);
-        *tv = xtime;
-        tv->tv_usec += do_gettimeoffset();
-
-        /*
-         * xtime is atomically updated in timer_bh. jiffies - wall_jiffies
-         * is nonzero if the timer bottom half hasnt executed yet.
-         */
-        if (jiffies - wall_jiffies)
-                tv->tv_usec += USECS_PER_JIFFY;
-
-        read_unlock_irqrestore (&xtime_lock, flags);
-
-        if (tv->tv_usec >= 1000000) {
-                tv->tv_usec -= 1000000;
-                tv->tv_sec++;
-        }
+	read_unlock_irqrestore (&xtime_lock, flags);
+
+	if (tv->tv_usec >= 1000000) {
+		tv->tv_usec -= 1000000;
+		tv->tv_sec++;
+	}
 }
 
 void do_settimeofday(struct timeval *tv)
 {
-        write_lock_irq (&xtime_lock);
+	write_lock_irq (&xtime_lock);
 
-        /* This is revolting. We need to set the xtime.tv_usec
-         * correctly. However, the value in this location is
-         * is value at the last tick.
-         * Discover what correction gettimeofday
-         * would have done, and then undo it!
-         */
-        tv->tv_usec -= do_gettimeoffset();
-
-        if (tv->tv_usec < 0) {
-                tv->tv_usec += 1000000;
-                tv->tv_sec--;
-        }
-        xtime = *tv;
-        time_adjust = 0;                /* stop active adjtime() */
-        time_status |= STA_UNSYNC;
-        time_maxerror = NTP_PHASE_LIMIT;
-        time_esterror = NTP_PHASE_LIMIT;
+	/* This is revolting. We need to set the xtime.tv_usec
+	 * correctly. However, the value in this location is
+	 * is value at the last tick.
+	 * Discover what correction gettimeofday
+	 * would have done, and then undo it!
+	 */
+	tv->tv_usec -= do_gettimeoffset();
 
-        write_unlock_irq (&xtime_lock);
+	if (tv->tv_usec < 0) {
+		tv->tv_usec += 1000000;
+		tv->tv_sec--;
+	}
+	xtime = *tv;
+	time_adjust = 0;			/* stop active adjtime() */
+	time_status |= STA_UNSYNC;
+	time_maxerror = NTP_PHASE_LIMIT;
+	time_esterror = NTP_PHASE_LIMIT;
+
+	write_unlock_irq (&xtime_lock);
 }
 
 
@@ -162,30 +148,26 @@
 	u32 count;
 	unsigned long res;
 
-	MIPS_ASSERT(mips_cpu.options & MIPS_CPU_COUNTER);
-	MIPS_ASSERT(mips_counter_frequency != 0);
-	MIPS_ASSERT(sll32_usecs_per_cycle != 0);
-
 	/* Get last timer tick in absolute kernel time */
-        count = read_32bit_cp0_register(CP0_COUNT);
+	count = read_32bit_cp0_register(CP0_COUNT);
 
-        /* .. relative to previous jiffy (32 bits is enough) */
-        count -= timerlo;
+	/* .. relative to previous jiffy (32 bits is enough) */
+	count -= timerlo;
 
-        __asm__("multu\t%1,%2\n\t"
-                "mfhi\t%0"
-                :"=r" (res)
-                :"r" (count),
-                 "r" (sll32_usecs_per_cycle));
-
-        /*
-         * Due to possible jiffies inconsistencies, we need to check
-         * the result so that we'll get a timer that is monotonic.
-         */
-        if (res >= USECS_PER_JIFFY)
-                res = USECS_PER_JIFFY-1;
+	__asm__("multu\t%1,%2\n\t"
+	        "mfhi\t%0"
+	        :"=r" (res)
+	        :"r" (count),
+	         "r" (sll32_usecs_per_cycle));
 
-        return res;
+	/*
+	 * Due to possible jiffies inconsistencies, we need to check
+	 * the result so that we'll get a timer that is monotonic.
+	 */
+	if (res >= USECS_PER_JIFFY)
+		res = USECS_PER_JIFFY-1;
+
+	return res;
 }
 
 /*
@@ -197,156 +179,107 @@
 /* Last jiffy when calibrate_divXX_gettimeoffset() was called. */
 static unsigned long last_jiffies = 0;
 
-/* 
- * copied from include/asm/div64.  
- * We do the copy instead of include the header file because we don't
- * want to reply on _MIPS_ISA value.
- */
-#define do_div64_32(res, high, low, base) ({ \
-        unsigned long __quot, __mod; \
-        unsigned long __cf, __tmp, __i; \
-        \
-        __asm__(".set   push\n\t" \
-                ".set   noat\n\t" \
-                ".set   noreorder\n\t" \
-                "b      1f\n\t" \
-                " li    %4,0x21\n" \
-                "0:\n\t" \
-                "sll    $1,%0,0x1\n\t" \
-                "srl    %3,%0,0x1f\n\t" \
-                "or     %0,$1,$2\n\t" \
-                "sll    %1,%1,0x1\n\t" \
-                "sll    %2,%2,0x1\n" \
-                "1:\n\t" \
-                "bnez   %3,2f\n\t" \
-                "sltu   $2,%0,%z5\n\t" \
-                "bnez   $2,3f\n\t" \
-                "2:\n\t" \
-                " addiu %4,%4,-1\n\t" \
-                "subu   %0,%0,%z5\n\t" \
-                "addiu  %2,%2,1\n" \
-                "3:\n\t" \
-                "bnez   %4,0b\n\t" \
-                " srl   $2,%1,0x1f\n\t" \
-                ".set   pop" \
-                : "=&r" (__mod), "=&r" (__tmp), "=&r" (__quot), "=&r" (__cf), \
-                  "=&r" (__i) \
-                : "Jr" (base), "0" (high), "1" (low), "2" (0), "3" (0) \
-                /* Aarrgh!  Ran out of gcc's limit on constraints... */ \
-                : "$1", "$2"); \
-        \
-        (res) = __quot; \
-        __mod; })
 
 /*
  * This is copied from dec/time.c:do_ioasic_gettimeoffset() by Mercij.
  */
 unsigned long calibrate_div32_gettimeoffset(void)
 {
-        u32 count;
-        unsigned long res, tmp;
-        unsigned long quotient;
-
-	MIPS_ASSERT(mips_cpu.options & MIPS_CPU_COUNTER);
-
-        tmp = jiffies;
-
-        quotient = cached_quotient;
-
-        if (last_jiffies != tmp) {
-                last_jiffies = tmp;
-                if (last_jiffies != 0) {
-                        unsigned long r0;
-                        do_div64_32(r0, timerhi, timerlo, tmp);
-                        do_div64_32(quotient, USECS_PER_JIFFY,
-                                    USECS_PER_JIFFY_FRAC, r0);
-                        cached_quotient = quotient;
-                }
-        }
-
-        /* Get last timer tick in absolute kernel time */
-        count = read_32bit_cp0_register(CP0_COUNT);
-
-        /* .. relative to previous jiffy (32 bits is enough) */
-        count -= timerlo;
-
-        __asm__("multu  %2,%3"
-                : "=l" (tmp), "=h" (res)
-                : "r" (count), "r" (quotient));
-
-        /*
-         * Due to possible jiffies inconsistencies, we need to check
-         * the result so that we'll get a timer that is monotonic.
-         */
-        if (res >= USECS_PER_JIFFY)
-                res = USECS_PER_JIFFY - 1;
+	u32 count;
+	unsigned long res, tmp;
+	unsigned long quotient;
+
+	tmp = jiffies;
+
+	quotient = cached_quotient;
+
+	if (last_jiffies != tmp) {
+		last_jiffies = tmp;
+		if (last_jiffies != 0) {
+			unsigned long r0;
+			do_div64_32(r0, timerhi, timerlo, tmp);
+			do_div64_32(quotient, USECS_PER_JIFFY,
+			            USECS_PER_JIFFY_FRAC, r0);
+			cached_quotient = quotient;
+		}
+	}
+
+	/* Get last timer tick in absolute kernel time */
+	count = read_32bit_cp0_register(CP0_COUNT);
+
+	/* .. relative to previous jiffy (32 bits is enough) */
+	count -= timerlo;
+
+	__asm__("multu  %2,%3"
+	        : "=l" (tmp), "=h" (res)
+	        : "r" (count), "r" (quotient));
+
+	/*
+	 * Due to possible jiffies inconsistencies, we need to check
+	 * the result so that we'll get a timer that is monotonic.
+	 */
+	if (res >= USECS_PER_JIFFY)
+		res = USECS_PER_JIFFY - 1;
 
-        return res;
+	return res;
 }
 
 unsigned long calibrate_div64_gettimeoffset(void)
 {
-        u32 count;
-        unsigned long res, tmp;
-        unsigned long quotient;
-
-
-	MIPS_ASSERT(mips_cpu.options & MIPS_CPU_COUNTER);
-	MIPS_ASSERT((mips_cpu.isa_level != MIPS_CPU_ISA_I) &&
-		    (mips_cpu.isa_level != MIPS_CPU_ISA_II) &&
-		    (mips_cpu.isa_level != MIPS_CPU_ISA_M32));
-
-
-        tmp = jiffies;
-
-        quotient = cached_quotient;
-
-        if (tmp && last_jiffies != tmp) {
-                last_jiffies = tmp;
-                __asm__(".set\tnoreorder\n\t"
-                        ".set\tnoat\n\t"
-                        ".set\tmips3\n\t"
-                        "lwu\t%0,%2\n\t"
-                        "dsll32\t$1,%1,0\n\t"
-                        "or\t$1,$1,%0\n\t"
-                        "ddivu\t$0,$1,%3\n\t"
-                        "mflo\t$1\n\t"
-                        "dsll32\t%0,%4,0\n\t"
-                        "nop\n\t"
-                        "ddivu\t$0,%0,$1\n\t"
-                        "mflo\t%0\n\t"
-                        ".set\tmips0\n\t"
-                        ".set\tat\n\t"
-                        ".set\treorder"
-                        :"=&r" (quotient)
-                        :"r" (timerhi),
-                         "m" (timerlo),
-                         "r" (tmp),
-                         "r" (USECS_PER_JIFFY)
-                        :"$1");
-                cached_quotient = quotient;
-        }
-
-        /* Get last timer tick in absolute kernel time */
-        count = read_32bit_cp0_register(CP0_COUNT);
-
-        /* .. relative to previous jiffy (32 bits is enough) */
-        count -= timerlo;
-
-        __asm__("multu\t%1,%2\n\t"
-                "mfhi\t%0"
-                :"=r" (res)
-                :"r" (count),
-                 "r" (quotient));
-
-        /*
-         * Due to possible jiffies inconsistencies, we need to check
-         * the result so that we'll get a timer that is monotonic.
-         */
-        if (res >= USECS_PER_JIFFY)
-                res = USECS_PER_JIFFY-1;
+	u32 count;
+	unsigned long res, tmp;
+	unsigned long quotient;
+
+	tmp = jiffies;
 
-        return res;
+	quotient = cached_quotient;
+
+	if (tmp && last_jiffies != tmp) {
+		last_jiffies = tmp;
+		__asm__(".set\tnoreorder\n\t"
+	        ".set\tnoat\n\t"
+	        ".set\tmips3\n\t"
+	        "lwu\t%0,%2\n\t"
+	        "dsll32\t$1,%1,0\n\t"
+	        "or\t$1,$1,%0\n\t"
+	        "ddivu\t$0,$1,%3\n\t"
+	        "mflo\t$1\n\t"
+	        "dsll32\t%0,%4,0\n\t"
+	        "nop\n\t"
+	        "ddivu\t$0,%0,$1\n\t"
+	        "mflo\t%0\n\t"
+	        ".set\tmips0\n\t"
+	        ".set\tat\n\t"
+	        ".set\treorder"
+	        :"=&r" (quotient)
+	        :"r" (timerhi),
+	         "m" (timerlo),
+	         "r" (tmp),
+	         "r" (USECS_PER_JIFFY)
+	        :"$1");
+	        cached_quotient = quotient;
+	}
+
+	/* Get last timer tick in absolute kernel time */
+	count = read_32bit_cp0_register(CP0_COUNT);
+
+	/* .. relative to previous jiffy (32 bits is enough) */
+	count -= timerlo;
+
+	__asm__("multu\t%1,%2\n\t"
+	        "mfhi\t%0"
+	        :"=r" (res)
+	        :"r" (count),
+	         "r" (quotient));
+
+	/*
+	 * Due to possible jiffies inconsistencies, we need to check
+	 * the result so that we'll get a timer that is monotonic.
+	 */
+	if (res >= USECS_PER_JIFFY)
+		res = USECS_PER_JIFFY-1;
+
+	return res;
 }
 
 
@@ -377,57 +310,56 @@
 
 	}
 
-        if(!user_mode(regs)) {
+	if(!user_mode(regs)) {
 		if (prof_buffer && current->pid) {
-                        extern int _stext;
-                        unsigned long pc = regs->cp0_epc;
+			extern int _stext;
+			unsigned long pc = regs->cp0_epc;
 
-                        pc -= (unsigned long) &_stext;
-                        pc >>= prof_shift;
-                        /*
-                         * Dont ignore out-of-bounds pc values silently,
-                         * put them into the last histogram slot, so if
-                         * present, they will show up as a sharp peak.
-                         */
-                        if (pc > prof_len-1)
-                                pc = prof_len-1;
-                        atomic_inc((atomic_t *)&prof_buffer[pc]);
-                }
-        }
+			pc -= (unsigned long) &_stext;
+			pc >>= prof_shift;
+			/*
+			 * Dont ignore out-of-bounds pc values silently,
+			 * put them into the last histogram slot, so if
+			 * present, they will show up as a sharp peak.
+			 */
+			if (pc > prof_len-1)
+			pc = prof_len-1;
+			atomic_inc((atomic_t *)&prof_buffer[pc]);
+		}
+	}
 
 	/*
 	 * call the generic timer interrupt handling
 	 */
-        do_timer(regs);
-
-        /*
-         * If we have an externally synchronized Linux clock, then update
-         * CMOS clock accordingly every ~11 minutes. rtc_set_time() has to be
-         * called as close as possible to 500 ms before the new second starts.
-         */
-        read_lock (&xtime_lock);
-        if ((time_status & STA_UNSYNC) == 0 &&
-            xtime.tv_sec > last_rtc_update + 660 &&
-            xtime.tv_usec >= 500000 - ((unsigned) tick) / 2 &&
-            xtime.tv_usec <= 500000 + ((unsigned) tick) / 2) {
+	do_timer(regs);
 
+	/*
+	 * If we have an externally synchronized Linux clock, then update
+	 * CMOS clock accordingly every ~11 minutes. rtc_set_time() has to be
+	 * called as close as possible to 500 ms before the new second starts.
+	 */
+	read_lock (&xtime_lock);
+	if ((time_status & STA_UNSYNC) == 0 &&
+	    xtime.tv_sec > last_rtc_update + 660 &&
+	    xtime.tv_usec >= 500000 - ((unsigned) tick) / 2 &&
+	    xtime.tv_usec <= 500000 + ((unsigned) tick) / 2) {
 		if (rtc_set_time(xtime.tv_sec) == 0) {
 			last_rtc_update = xtime.tv_sec;
 		} else {
 			last_rtc_update = xtime.tv_sec - 600; 
 			/* do it again in 60 s */
 		}
-        }
-        read_unlock (&xtime_lock);
+	}
+	read_unlock (&xtime_lock);
 
 	/*
 	 * If jiffies has overflowed in this timer_interrupt we must
 	 * update the timer[hi]/[lo] to make fast gettimeoffset funcs
 	 * quotient calc still valid. -arca
 	 */
-        if (!jiffies) {
-                timerhi = timerlo = 0;
-        }
+	if (!jiffies) {
+		timerhi = timerlo = 0;
+	}
 }
 
 asmlinkage void ll_timer_interrupt(int irq, struct pt_regs *regs)
@@ -442,9 +374,8 @@
 	
 	irq_exit(cpu, irq);
 
-	/* check for bottom half */
-        if (softirq_active(cpu)&softirq_mask(cpu))
-                do_softirq();
+	if (softirq_pending(cpu))
+		do_softirq();
 }
 
 
@@ -480,19 +411,14 @@
 
 void __init time_init(void)
 {
-	printk("New MIPS time_init() invoked.\n");
-
 	if (board_time_init)
 		board_time_init();
 
-	/* setup xtime */
-	write_lock_irq(&xtime_lock);
 	xtime.tv_sec = rtc_get_time();
 	xtime.tv_usec = 0;
-	write_unlock_irq(&xtime_lock);
 
 	/* choose appropriate gettimeoffset routine */
-	if ( ! (mips_cpu.options & MIPS_CPU_COUNTER) ) {
+	if (!(mips_cpu.options & MIPS_CPU_COUNTER)) {
 		/* no cpu counter - sorry */
 		do_gettimeoffset = null_gettimeoffset;
 	} else if (mips_counter_frequency != 0) {
@@ -519,11 +445,6 @@
 		sll32_usecs_per_cycle = mips_counter_frequency / 100000;
 		sll32_usecs_per_cycle = 0xffffffff / sll32_usecs_per_cycle;
 		sll32_usecs_per_cycle *= 10;
-
-		MIPS_DEBUG(printk("cycles_per_jiffy = %d\n", 
-				  cycles_per_jiffy));
-		MIPS_DEBUG(printk("sll32_usecs_per_cycle = %d \n",
-				  sll32_usecs_per_cycle));
 	}
 
 	/* 
@@ -537,6 +458,52 @@
 	 * to be NULL function so that we are sure the high-level code
 	 * is not invoked accidentally.
 	 */
-	MIPS_ASSERT(board_timer_setup != NULL);
 	board_timer_setup(&timer_irqaction);
+}
+
+#define FEBRUARY		2
+#define STARTOFTIME		1970
+#define SECDAY			86400L
+#define SECYR			(SECDAY * 365)
+#define leapyear(year)		((year) % 4 == 0)
+#define days_in_year(a)		(leapyear(a) ? 366 : 365)
+#define days_in_month(a)	(month_days[(a) - 1])
+
+static int month_days[12] = {
+	31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
+};
+
+void to_tm(unsigned long tim, struct rtc_time * tm)
+{
+	long hms, day;
+	int i;
+
+	day = tim / SECDAY;
+	hms = tim % SECDAY;
+
+	/* Hours, minutes, seconds are easy */
+	tm->tm_hour = hms / 3600;
+	tm->tm_min = (hms % 3600) / 60;
+	tm->tm_sec = (hms % 3600) % 60;
+
+	/* Number of years in days */
+	for (i = STARTOFTIME; day >= days_in_year(i); i++)
+	day -= days_in_year(i);
+	tm->tm_year = i;
+
+	/* Number of months in days left */
+	if (leapyear(tm->tm_year))
+	days_in_month(FEBRUARY) = 29;
+	for (i = 1; day >= days_in_month(i); i++)
+	day -= days_in_month(i);
+	days_in_month(FEBRUARY) = 28;
+	tm->tm_mon = i;
+
+	/* Days are what is left over (+1) from all that. */
+	tm->tm_mday = day + 1;
+
+	/*
+	 * Determine the day of week
+	 */
+	tm->tm_wday = (day + 3) % 7;
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/traps.c linux/arch/mips/kernel/traps.c
--- v2.4.9/linux/arch/mips/kernel/traps.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/traps.c	Sun Sep  9 10:43:01 2001
@@ -3,17 +3,18 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1994 - 1999 by Ralf Baechle
+ * Copyright (C) 1994 - 1999, 2000, 01 Ralf Baechle
  * Modified for R3000 by Paul M. Antoine, 1995, 1996
  * Complete output from die() by Ulf Carlsson, 1998
  * Copyright (C) 1999 Silicon Graphics, Inc.
  *
  * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
- * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ * Copyright (C) 2000, 01 MIPS Technologies, Inc.
  */
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
+#include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
@@ -25,6 +26,7 @@
 #include <asm/cachectl.h>
 #include <asm/inst.h>
 #include <asm/jazz.h>
+#include <asm/module.h>
 #include <asm/pgtable.h>
 #include <asm/io.h>
 #include <asm/siginfo.h>
@@ -32,9 +34,6 @@
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/mmu_context.h>
-#ifndef CONFIG_MIPS_FPU_EMULATOR 
-#include <asm/inst.h>
-#endif
 
 /*
  * Machine specific interrupt handlers
@@ -63,12 +62,9 @@
 extern asmlinkage void handle_mcheck(void);
 extern asmlinkage void handle_reserved(void);
 
-extern int fpu_emulator_cop1Handler(int, struct pt_regs *);
-
-static char *cpu_names[] = CPU_NAMES;
+extern int fpu_emulator_cop1Handler(struct pt_regs *);
 
 char watch_available = 0;
-char dedicated_iv_available = 0;
 
 void (*ibe_board_handler)(struct pt_regs *regs);
 void (*dbe_board_handler)(struct pt_regs *regs);
@@ -81,7 +77,7 @@
  */
 #define MODULE_RANGE (8*1024*1024)
 
-#if !defined(CONFIG_CPU_HAS_LLSC)
+#ifndef CONFIG_CPU_HAS_LLSC
 /*
  * This stuff is needed for the userland ll-sc emulation for R2300
  */
@@ -94,8 +90,6 @@
 #define OFFSET 0x0000ffff
 #define LL     0xc0000000
 #define SC     0xe0000000
-
-#undef DEBUG_LLSC
 #endif
 
 /*
@@ -212,7 +206,6 @@
 	show_trace((unsigned int *) regs->regs[29]);
 	show_code((unsigned int *) regs->cp0_epc);
 	printk("\n");
-while(1);
 	spin_unlock_irq(&die_lock);
 	do_exit(SIGSEGV);
 }
@@ -254,89 +247,101 @@
 	return (first == last && first->insn == value) ? first->nextinsn : 0;
 }
 
-#define search_dbe_table(addr)	\
-	search_one_table(__start___dbe_table, __stop___dbe_table - 1, (addr))
+extern spinlock_t modlist_lock;
+
+static inline unsigned long
+search_dbe_table(unsigned long addr)
+{
+	unsigned long ret = 0;
+
+#ifndef CONFIG_MODULES
+	/* There is only the kernel to search.  */
+	ret = search_one_table(__start___dbe_table, __stop___dbe_table-1, addr);
+	return ret;
+#else
+	unsigned long flags;
+
+	/* The kernel is the last "module" -- no need to treat it special.  */
+	struct module *mp;
+	struct archdata *ap;
+
+	spin_lock_irqsave(&modlist_lock, flags);
+	for (mp = module_list; mp != NULL; mp = mp->next) {
+		if (!mod_member_present(mp, archdata_end) ||
+        	    !mod_archdata_member_present(mp, struct archdata,
+						 dbe_table_end))
+			continue;
+		ap = (struct archdata *)(mp->archdata_start);
+
+		if (ap->dbe_table_start == NULL ||
+		    !(mp->flags & (MOD_RUNNING | MOD_INITIALIZING)))
+			continue;
+		ret = search_one_table(ap->dbe_table_start,
+				       ap->dbe_table_end - 1, addr);
+		if (ret)
+			break;
+	}
+	spin_unlock_irqrestore(&modlist_lock, flags);
+	return ret;
+#endif
+}
 
 static void default_be_board_handler(struct pt_regs *regs)
 {
 	unsigned long new_epc;
-	unsigned long fixup = search_dbe_table(regs->cp0_epc);
+	unsigned long fixup;
+	int data = regs->cp0_cause & 4;
 
-	if (fixup) {
-		new_epc = fixup_exception(dpf_reg, fixup, regs->cp0_epc);
-		regs->cp0_epc = new_epc;
-		return;
+	if (data && !user_mode(regs)) {
+		fixup = search_dbe_table(regs->cp0_epc);
+		if (fixup) {
+			new_epc = fixup_exception(dpf_reg, fixup,
+						  regs->cp0_epc);
+			regs->cp0_epc = new_epc;
+			return;
+		}
 	}
 
 	/*
 	 * Assume it would be too dangerous to continue ...
 	 */
+	printk(KERN_ALERT "%s bus error, epc == %08lx, ra == %08lx\n",
+	       data ? "Data" : "Instruction",
+	       regs->cp0_epc, regs->regs[31]);
+	die_if_kernel("Oops", regs);
 	force_sig(SIGBUS, current);
 }
 
-void do_ibe(struct pt_regs *regs)
+asmlinkage void do_ibe(struct pt_regs *regs)
 {
 	ibe_board_handler(regs);
 }
 
-void do_dbe(struct pt_regs *regs)
+asmlinkage void do_dbe(struct pt_regs *regs)
 {
 	dbe_board_handler(regs);
 }
 
-void do_ov(struct pt_regs *regs)
+asmlinkage void do_ov(struct pt_regs *regs)
 {
 	if (compute_return_epc(regs))
 		return;
-	force_sig(SIGFPE, current);
-}
-
-#ifdef CONFIG_MIPS_FPE_MODULE
-static void (*fpe_handler)(struct pt_regs *regs, unsigned int fcr31);
 
-/*
- * Register_fpe/unregister_fpe are for debugging purposes only.  To make
- * this hack work a bit better there is no error checking.
- */
-int register_fpe(void (*handler)(struct pt_regs *regs, unsigned int fcr31))
-{
-	fpe_handler = handler;
-	return 0;
-}
-
-int unregister_fpe(void (*handler)(struct pt_regs *regs, unsigned int fcr31))
-{
-	fpe_handler = NULL;
-	return 0;
+	force_sig(SIGFPE, current);
 }
-#endif
 
 /*
  * XXX Delayed fp exceptions when doing a lazy ctx switch XXX
  */
-void do_fpe(struct pt_regs *regs, unsigned long fcr31)
+asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
 {
-
-#ifdef CONFIG_MIPS_FPU_EMULATOR
-	if(!(mips_cpu.options & MIPS_CPU_FPU))
-		panic("Floating Point Exception with No FPU");
-#endif
-
-#ifdef CONFIG_MIPS_FPE_MODULE
-	if (fpe_handler != NULL) {
-		fpe_handler(regs, fcr31);
-		return;
-	}
-#endif
-
 	if (fcr31 & FPU_CSR_UNI_X) {
-#ifdef CONFIG_MIPS_FPU_EMULATOR
 		extern void save_fp(struct task_struct *);
 		extern void restore_fp(struct task_struct *);
 		int sig;
 		/*
 	 	 * Unimplemented operation exception.  If we've got the
-	 	 * Full software emulator on-board, let's use it...
+	 	 * full software emulator on-board, let's use it...
 		 *
 		 * Force FPU to dump state into task/thread context.
 		 * We're moving a lot of data here for what is probably
@@ -348,11 +353,11 @@
 		save_fp(current);
 	
 		/* Run the emulator */
-		sig = fpu_emulator_cop1Handler(0, regs);
+		sig = fpu_emulator_cop1Handler(regs);
 
 		/* 
 		 * We can't allow the emulated instruction to leave the
-		 * Unimplemented Operation bit set in the FCR31 fp-register.
+		 * Unimplemented Operation bit set in $fcr31.
 		 */
 		current->thread.fpu.soft.sr &= ~FPU_CSR_UNI_X;
 
@@ -362,37 +367,6 @@
 		/* If something went wrong, signal */
 		if (sig)
 			force_sig(sig, current);
-#else
-		/* Else use mini-emulator */
-
-		extern void simfp(int);
-		unsigned long pc;
-		unsigned int insn;
-
-		/* Retry instruction with flush to zero ...  */
-		if (!(fcr31 & (1<<24))) {
-			printk("Setting flush to zero for %s.\n",
-			       current->comm);
-			fcr31 &= ~FPU_CSR_UNI_X;
-			fcr31 |= (1<<24);
-			__asm__ __volatile__(
-				"ctc1\t%0,$31"
-				: /* No outputs */
-				: "r" (fcr31));
-			return;
-		}
-		pc = regs->cp0_epc + ((regs->cp0_cause & CAUSEF_BD) ? 4 : 0);
-		if(pc & 0x80000000) insn = *(unsigned int *)pc;
-		else if (get_user(insn, (unsigned int *)pc)) {
-			/* XXX Can this happen?  */
-			force_sig(SIGSEGV, current);
-		}
-
-		printk(KERN_DEBUG "Unimplemented exception for insn %08x at 0x%08lx in %s.\n",
-		       insn, regs->cp0_epc, current->comm);
-		simfp(MIPSInst(insn));
-		compute_return_epc(regs);
-#endif /* CONFIG_MIPS_FPU_EMULATOR */
 
 		return;
 	}
@@ -408,31 +382,31 @@
 {
 	unsigned int *epc;
 
-	epc = (unsigned int *) (unsigned long) regs->cp0_epc;
-	if (regs->cp0_cause & CAUSEF_BD)
-		epc++;
-
-	if (verify_area(VERIFY_READ, epc, 4)) {
-		force_sig(SIGSEGV, current);
-		return 1;
-	}
-	*opcode = *epc;
+	epc = (unsigned int *) regs->cp0_epc +
+	      ((regs->cp0_cause & CAUSEF_BD) != 0);
+	if (!get_user(*opcode, epc))
+		return 0;
 
-	return 0;
+	force_sig(SIGSEGV, current);
+	return 1;
 }
 
-void do_bp(struct pt_regs *regs)
+asmlinkage void do_bp(struct pt_regs *regs)
 {
 	siginfo_t info;
 	unsigned int opcode, bcode;
+	unsigned int *epc;
+
+	epc = (unsigned int *) regs->cp0_epc +
+	      ((regs->cp0_cause & CAUSEF_BD) != 0);
+	if (get_user(opcode, epc))
+		goto sigsegv;
 
 	/*
 	 * There is the ancient bug in the MIPS assemblers that the break
 	 * code starts left to bit 16 instead to bit 6 in the opcode.
 	 * Gas is bug-compatible ...
 	 */
-	if (get_insn_opcode(regs, &opcode))
-		return;
 	bcode = ((opcode >> 16) & ((1 << 20) - 1));
 
 	/*
@@ -456,15 +430,23 @@
 	default:
 		force_sig(SIGTRAP, current);
 	}
+	return;
+
+sigsegv:
+	force_sig(SIGSEGV, current);
 }
 
-void do_tr(struct pt_regs *regs)
+asmlinkage void do_tr(struct pt_regs *regs)
 {
 	siginfo_t info;
 	unsigned int opcode, bcode;
+	unsigned *epc;
+
+	epc = (unsigned int *) regs->cp0_epc +
+	      ((regs->cp0_cause & CAUSEF_BD) != 0);
+	if (get_user(opcode, epc))
+		goto sigsegv;
 
-	if (get_insn_opcode(regs, &opcode))
-		return;
 	bcode = ((opcode >> 6) & ((1 << 20) - 1));
 
 	/*
@@ -488,9 +470,13 @@
 	default:
 		force_sig(SIGTRAP, current);
 	}
+	return;
+
+sigsegv:
+	force_sig(SIGSEGV, current);
 }
 
-#if !defined(CONFIG_CPU_HAS_LLSC)
+#ifndef CONFIG_CPU_HAS_LLSC
 
 #ifdef CONFIG_SMP
 #error "ll/sc emulation is not SMP safe"
@@ -503,7 +489,7 @@
  * this implementation can handle only sychronization between 2 or more
  * user contexts and is not SMP safe.
  */
-void do_ri(struct pt_regs *regs)
+asmlinkage void do_ri(struct pt_regs *regs)
 {
 	unsigned int opcode;
 
@@ -520,9 +506,7 @@
 			return;
 		}
 	}
-	printk("[%s:%d] Illegal instruction %08lx at %08lx, ra=%08lx, CP0_STATUS=%08lx\n",
-	       current->comm, current->pid, *((unsigned long*)regs->cp0_epc), regs->cp0_epc,
-		regs->regs[31], regs->cp0_status);
+
 	if (compute_return_epc(regs))
 		return;
 	force_sig(SIGILL, current);
@@ -558,10 +542,6 @@
 
 	vaddr = (unsigned long *)((long)(regp->regs[(opcode & BASE) >> 21]) + offset);
 
-#ifdef DEBUG_LLSC
-	printk("ll: vaddr = 0x%08x, reg = %d\n", (unsigned int)vaddr, (opcode & RT) >> 16);
-#endif
-
 #ifdef CONFIG_PROC_FS
 	ll_ops++;
 #endif
@@ -604,10 +584,6 @@
 	vaddr = (unsigned long *)((long)(regp->regs[(opcode & BASE) >> 21]) + offset);
 	reg = (opcode & RT) >> 16;
 
-#ifdef DEBUG_LLSC
-	printk("sc: vaddr = 0x%08x, reg = %d\n", (unsigned int)vaddr, (unsigned int)reg);
-#endif
-
 #ifdef CONFIG_PROC_FS
 	sc_ops++;
 #endif
@@ -628,52 +604,33 @@
 
 #else /* MIPS 2 or higher */
 
-void do_ri(struct pt_regs *regs)
+asmlinkage void do_ri(struct pt_regs *regs)
 {
 	unsigned int opcode;
 
-        get_insn_opcode(regs, &opcode);
-	printk("[%s:%ld] Illegal instruction %08x at %08lx ra=%08lx\n",
-	       current->comm, (unsigned long)current->pid, opcode,
-	       regs->cp0_epc, regs->regs[31]);
+	get_insn_opcode(regs, &opcode);
 	if (compute_return_epc(regs))
 		return;
+
 	force_sig(SIGILL, current);
 }
 
 #endif
 
-void do_cpu(struct pt_regs *regs)
+asmlinkage void do_cpu(struct pt_regs *regs)
 {
 	unsigned int cpid;
-	extern void lazy_fpu_switch(void*);
+	extern void lazy_fpu_switch(void *);
 	extern void init_fpu(void);
-#ifdef CONFIG_MIPS_FPU_EMULATOR
 	void fpu_emulator_init_fpu(void);
 	int sig;
-#endif
+
 	cpid = (regs->cp0_cause >> CAUSEB_CE) & 3;
 	if (cpid != 1)
 		goto bad_cid;
 
-#ifdef CONFIG_MIPS_FPU_EMULATOR
-	if(!(mips_cpu.options & MIPS_CPU_FPU)) {
-	    if (last_task_used_math != current) {
-		if(!current->used_math) {
-		    fpu_emulator_init_fpu();
-		    current->used_math = 1;
-		}
-	    }
-	    sig = fpu_emulator_cop1Handler(0, regs);
-	    last_task_used_math = current;
-	    if(sig) {
-		force_sig(sig, current);
-	    }
-	    return;
-	}
-#else
-	if(!(mips_cpu.options & MIPS_CPU_FPU)) goto bad_cid;
-#endif
+	if (!(mips_cpu.options & MIPS_CPU_FPU))
+		goto fp_emul;
 
 	regs->cp0_status |= ST0_CU1;
 	if (last_task_used_math == current)
@@ -682,18 +639,30 @@
 	if (current->used_math) {		/* Using the FPU again.  */
 		lazy_fpu_switch(last_task_used_math);
 	} else {				/* First time FPU user.  */
-
 		init_fpu();
 		current->used_math = 1;
 	}
 	last_task_used_math = current;
 	return;
 
+fp_emul:
+	if (last_task_used_math != current) {
+		if (!current->used_math) {
+			fpu_emulator_init_fpu();
+			current->used_math = 1;
+		}
+	}
+	sig = fpu_emulator_cop1Handler(regs);
+	last_task_used_math = current;
+	if (sig)
+		force_sig(sig, current);
+	return;
+
 bad_cid:
 	force_sig(SIGILL, current);
 }
 
-void do_watch(struct pt_regs *regs)
+asmlinkage void do_watch(struct pt_regs *regs)
 {
 	/*
 	 * We use the watch exception where available to detect stack
@@ -703,14 +672,14 @@
 	panic("Caught WATCH exception - probably caused by stack overflow.");
 }
 
-void do_mcheck(struct pt_regs *regs)
+asmlinkage void do_mcheck(struct pt_regs *regs)
 {
 	show_regs(regs);
 	panic("Caught Machine Check exception - probably caused by multiple "
 	      "matching entries in the TLB.");
 }
 
-void do_reserved(struct pt_regs *regs)
+asmlinkage void do_reserved(struct pt_regs *regs)
 {
 	/*
 	 * Game over - no way to handle this if it ever occurs.  Most probably
@@ -723,34 +692,19 @@
 
 static inline void watch_init(void)
 {
-        if(mips_cpu.options & MIPS_CPU_WATCH ) {
-		(void)set_except_vector(23, handle_watch);
+	if (mips_cpu.options & MIPS_CPU_WATCH ) {
+		set_except_vector(23, handle_watch);
  		watch_available = 1;
  	}
 }
 
 /*
- * Some MIPS CPUs have a dedicated interrupt vector which reduces the
- * interrupt processing overhead.  Use it where available.
- */
-static inline void setup_dedicated_int(void)
-{
-	extern void except_vec4(void);
-
-	if(mips_cpu.options & MIPS_CPU_DIVEC) {
-		memcpy((void *)(KSEG0 + 0x200), except_vec4, 8);
-		set_cp0_cause(CAUSEF_IV);
-		dedicated_iv_available = 1;
-	}
-}
-
-/*
- * Some MIPS CPUs can enable/disable for cache parity detection, but does
+ * Some MIPS CPUs can enable/disable for cache parity detection, but do
  * it different ways.
  */
 static inline void parity_protection_init(void)
 {
-	switch(mips_cpu.cputype) {
+	switch (mips_cpu.cputype) {
 	case CPU_5KC:
 		/* Set the PE bit (bit 31) in the CP0_ECC register. */
 		printk(KERN_INFO "Enable the cache parity protection for "
@@ -764,38 +718,39 @@
 	}
 }
 
-void cache_parity_error(void)
+asmlinkage void cache_parity_error(void)
 {
-        unsigned int reg_val;
+	unsigned int reg_val;
 
-        /* For the moment, report the problem and hang. */
-        reg_val = read_32bit_cp0_register(CP0_ERROREPC);
+	/* For the moment, report the problem and hang. */
+	reg_val = read_32bit_cp0_register(CP0_ERROREPC);
 	printk("Cache error exception:\n");
 	printk("cp0_errorepc == %08x\n", reg_val);
 	reg_val = read_32bit_cp0_register(CP0_CACHEERR);
 	printk("cp0_cacheerr == %08x\n", reg_val);
 
 	printk("Decoded CP0_CACHEERR: %s cache fault in %s reference.\n",
-	       reg_val&(1<<30)?"secondary":"primary",
-	       reg_val&(1<<31)?"data":"insn");
+	       reg_val & (1<<30) ? "secondary" : "primary",
+	       reg_val & (1<<31) ? "data" : "insn");
 	printk("Error bits: %s%s%s%s%s%s%s\n",
-	       reg_val&(1<<29)?"ED ":"",
-	       reg_val&(1<<28)?"ET ":"",
-	       reg_val&(1<<26)?"EE ":"",
-	       reg_val&(1<<25)?"EB ":"",
-	       reg_val&(1<<24)?"EI ":"",
-	       reg_val&(1<<23)?"E1 ":"",
-	       reg_val&(1<<22)?"E0 ":"");
-	printk("IDX: 0x%08x\n", reg_val&((1<<22)-1));
+	       reg_val & (1<<29) ? "ED " : "",
+	       reg_val & (1<<28) ? "ET " : "",
+	       reg_val & (1<<26) ? "EE " : "",
+	       reg_val & (1<<25) ? "EB " : "",
+	       reg_val & (1<<24) ? "EI " : "",
+	       reg_val & (1<<23) ? "E1 " : "",
+	       reg_val & (1<<22) ? "E0 " : "");
+	printk("IDX: 0x%08x\n", reg_val & ((1<<22)-1));
 
 	if (reg_val&(1<<22))
-		printk("DErrAddr0: 0x%08x\n", read_32bit_cp0_set1_register(CP0_S1_DERRADDR0));
+		printk("DErrAddr0: 0x%08x\n",
+		       read_32bit_cp0_set1_register(CP0_S1_DERRADDR0));
 
 	if (reg_val&(1<<23))
-		printk("DErrAddr1: 0x%08x\n", read_32bit_cp0_set1_register(CP0_S1_DERRADDR1));
+		printk("DErrAddr1: 0x%08x\n",
+		       read_32bit_cp0_set1_register(CP0_S1_DERRADDR1));
 
-
-	panic("Can't handle the cache error - panic!");
+	panic("Can't handle the cache error!");
 }
 
 unsigned long exception_handlers[32];
@@ -810,7 +765,8 @@
 	unsigned handler = (unsigned long) addr;
 	unsigned old_handler = exception_handlers[n];
 	exception_handlers[n] = handler;
-	if (n == 0 && dedicated_iv_available) {
+
+	if (n == 0 && mips_cpu.options & MIPS_CPU_DIVEC) {
 		*(volatile u32 *)(KSEG0+0x200) = 0x08000000 |
 		                                 (0x03ffffff & (handler >> 2));
 		flush_icache_range(KSEG0+0x200, KSEG0 + 0x204);
@@ -823,10 +779,8 @@
 extern asmlinkage int _save_fp_context(struct sigcontext *sc);
 extern asmlinkage int _restore_fp_context(struct sigcontext *sc);
 
-#ifdef CONFIG_MIPS_FPU_EMULATOR
 extern asmlinkage int fpu_emulator_save_context(struct sigcontext *sc);
 extern asmlinkage int fpu_emulator_restore_context(struct sigcontext *sc);
-#endif
 
 void __init trap_init(void)
 {
@@ -834,13 +788,10 @@
 	extern char except_vec0_r4600, except_vec0_r2300;
 	extern char except_vec1_generic, except_vec2_generic;
 	extern char except_vec3_generic, except_vec3_r4000;
+	extern char except_vec4;
 	extern char except_vec_ejtag_debug;
 	unsigned long i;
 
-	if(mips_machtype == MACH_MIPS_MAGNUM_4000 ||
-	   mips_machtype == MACH_SNI_RM200_PCI)
-		EISA_bus = 1;
-
 	/* Some firmware leaves the BEV flag set, clear it.  */
 	clear_cp0_status(ST0_BEV);
 
@@ -852,8 +803,8 @@
 	/*
 	 * Setup default vectors
 	 */
-	for(i = 0; i <= 31; i++)
-		(void)set_except_vector(i, handle_reserved);
+	for (i = 0; i <= 31; i++)
+		set_except_vector(i, handle_reserved);
 
 	/* 
 	 * Copy the EJTAG debug exception vector handler code to it's final 
@@ -866,7 +817,15 @@
 	 * interrupt vector.
 	 */
 	watch_init();
-	setup_dedicated_int();
+
+	/*
+	 * Some MIPS CPUs have a dedicated interrupt vector which reduces the
+	 * interrupt processing overhead.  Use it where available.
+	 */
+	if (mips_cpu.options & MIPS_CPU_DIVEC) {
+		memcpy((void *)(KSEG0 + 0x200), &except_vec4, 8);
+		set_cp0_cause(CAUSEF_IV);
+	}
 
 	/*
 	 * Some CPUs can enable/disable for cache parity detection, but does
@@ -874,35 +833,38 @@
 	 */
 	parity_protection_init();
 
-	(void)set_except_vector(1, handle_mod);
-	(void)set_except_vector(2, handle_tlbl);
-	(void)set_except_vector(3, handle_tlbs);
-	(void)set_except_vector(4, handle_adel);
-	(void)set_except_vector(5, handle_ades);
+	set_except_vector(1, handle_mod);
+	set_except_vector(2, handle_tlbl);
+	set_except_vector(3, handle_tlbs);
+	set_except_vector(4, handle_adel);
+	set_except_vector(5, handle_ades);
+
 	/*
 	 * The Data Bus Error/ Instruction Bus Errors are signaled
 	 * by external hardware.  Therefore these two expection have
 	 * board specific handlers.
 	 */
-	(void)set_except_vector(6, handle_ibe);
-	(void)set_except_vector(7, handle_dbe);
+	set_except_vector(6, handle_ibe);
+	set_except_vector(7, handle_dbe);
 	ibe_board_handler = default_be_board_handler;
 	dbe_board_handler = default_be_board_handler;
 
-	(void)set_except_vector(8, handle_sys);
-	(void)set_except_vector(9, handle_bp);
-	(void)set_except_vector(10, handle_ri);
-	(void)set_except_vector(11, handle_cpu);
-	(void)set_except_vector(12, handle_ov);
-	(void)set_except_vector(13, handle_tr);
-	(void)set_except_vector(15, handle_fpe);
-	
+	set_except_vector(8, handle_sys);
+	set_except_vector(9, handle_bp);
+	set_except_vector(10, handle_ri);
+	set_except_vector(11, handle_cpu);
+	set_except_vector(12, handle_ov);
+	set_except_vector(13, handle_tr);
+
+	if (mips_cpu.options & MIPS_CPU_FPU)
+		set_except_vector(15, handle_fpe);
+
 	/*
 	 * Handling the following exceptions depends mostly of the cpu type
 	 */
 	if ((mips_cpu.options & MIPS_CPU_4KEX)
 	    && (mips_cpu.options & MIPS_CPU_4KTLB)) {
-		if(mips_cpu.cputype == CPU_NEVADA) {
+		if (mips_cpu.cputype == CPU_NEVADA) {
 			memcpy((void *)KSEG0, &except_vec0_nevada, 0x80);
 		} else if (mips_cpu.cputype == CPU_R4600)
 			memcpy((void *)KSEG0, &except_vec0_r4600, 0x80);
@@ -919,36 +881,25 @@
 			       0x80);
 		}
 
-		if(mips_cpu.options & MIPS_CPU_FPU) {
+		if (mips_cpu.options & MIPS_CPU_FPU) {
 		        save_fp_context = _save_fp_context;
 			restore_fp_context = _restore_fp_context;
-#ifdef CONFIG_MIPS_FPU_EMULATOR
 		} else {
 		        save_fp_context = fpu_emulator_save_context;
 			restore_fp_context = fpu_emulator_restore_context;
-#endif
 		}
-	} else switch(mips_cpu.cputype) {
-	case CPU_R10000:
-		/*
-		 * The R10000 is in most aspects similar to the R4400.  It
-		 * should get some special optimizations.
-		 */
-		write_32bit_cp0_register(CP0_FRAMEMASK, 0);
-		set_cp0_status(ST0_XX);
+	} else switch (mips_cpu.cputype) {
+	case CPU_SB1:
 		/*
-		 * The R10k might even work for Linux/MIPS - but we're paranoid
-		 * and refuse to run until this is tested on real silicon
+		 * XXX - This should be folded in to the "cleaner" handling,
+		 * above
 		 */
-		panic("CPU too expensive - making holiday in the ANDES!");
-		break;
-	case CPU_SB1:
-		/* XXX - This should be folded in to the "cleaner" handling, above */
 		memcpy((void *)KSEG0, &except_vec0_r4000, 0x80);
 		memcpy((void *)(KSEG0 + 0x180), &except_vec3_r4000, 0x80);
 		save_fp_context = _save_fp_context;
 		restore_fp_context = _restore_fp_context;
-		/* Enable timer interrupt and scd mapped interrupt in status register */
+
+		/* Enable timer interrupt and scd mapped interrupt */
 		clear_cp0_status(0xf000);
 		set_cp0_status(0xc00);
 		break;
@@ -983,17 +934,15 @@
 		memcpy((void *)KSEG0, &except_vec0_r2300, 0x80);
 		memcpy((void *)(KSEG0 + 0x80), &except_vec3_generic, 0x80);
 		break;
-	case CPU_R8000:
-		printk("Detected unsupported CPU type %s.\n",
-			cpu_names[mips_cpu.cputype]);
-		panic("Can't handle CPU");
-		break;
 
 	case CPU_UNKNOWN:
 	default:
 		panic("Unknown CPU type");
 	}
 	flush_icache_range(KSEG0, KSEG0 + 0x200);
+
+	if (mips_cpu.isa_level == MIPS_CPU_ISA_IV)
+		set_cp0_status(ST0_XX);
 
 	atomic_inc(&init_mm.mm_count);	/* XXX  UP?  */
 	current->active_mm = &init_mm;
diff -u --recursive --new-file v2.4.9/linux/arch/mips/kernel/unaligned.c linux/arch/mips/kernel/unaligned.c
--- v2.4.9/linux/arch/mips/kernel/unaligned.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/kernel/unaligned.c	Sun Sep  9 10:43:01 2001
@@ -72,6 +72,7 @@
  *       A store crossing a page boundary might be executed only partially.
  *       Undo the partial store in this case.
  */
+#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/signal.h>
 #include <linux/smp.h>
@@ -378,26 +379,26 @@
 	return;
 }
 
+#ifdef CONFIG_PROC_FS
 unsigned long unaligned_instructions;
+#endif
 
 asmlinkage void do_ade(struct pt_regs *regs)
 {
 	unsigned long pc;
-#ifdef CONFIG_MIPS_FPU_EMULATOR
-        extern int do_dsemulret(struct pt_regs *);
+	extern int do_dsemulret(struct pt_regs *);
+
+	/* 
+	 * Address errors may be deliberately induced
+	 * by the FPU emulator to take retake control
+	 * of the CPU after executing the instruction
+	 * in the delay slot of an emulated branch.
+	 */
 
-        /* 
-         * Address errors may be deliberately induced
-         * by the FPU emulator to take retake control
-         * of the CPU after executing the instruction
-         * in the delay slot of an emulated branch.
-         */
-
-        if((unsigned long)regs->cp0_epc == current->thread.dsemul_aerpc) {
-                (void)do_dsemulret(regs);
-                return;
-        }
-#endif /* CONFIG_MIPS_FPU_EMULATOR */
+	if ((unsigned long)regs->cp0_epc == current->thread.dsemul_aerpc) {
+		do_dsemulret(regs);
+		return;
+	}
 
 	/*
 	 * Did we catch a fault trying to load an instruction?
@@ -414,7 +415,9 @@
 		goto sigbus;
 
 	emulate_load_store_insn(regs, regs->cp0_badvaddr, pc);
+#ifdef CONFIG_PROC_FS
 	unaligned_instructions++;
+#endif
 
 	return;
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/lib/ide-std.c linux/arch/mips/lib/ide-std.c
--- v2.4.9/linux/arch/mips/lib/ide-std.c	Sat May 13 08:29:14 2000
+++ linux/arch/mips/lib/ide-std.c	Sun Sep  9 10:43:01 2001
@@ -1,12 +1,11 @@
-/* $Id: ide-std.c,v 1.4 1999/06/11 14:29:45 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
  * IDE routines for typical pc-like standard configurations.
  *
- * Copyright (C) 1998, 1999 by Ralf Baechle
+ * Copyright (C) 1998, 1999, 2001 by Ralf Baechle
  */
 #include <linux/sched.h>
 #include <linux/ide.h>
@@ -60,6 +59,7 @@
 	}
 	if (irq != NULL)
 		*irq = 0;
+	hw->io_ports[IDE_IRQ_OFFSET] = 0;
 }
 
 static int std_ide_request_irq(unsigned int irq,
diff -u --recursive --new-file v2.4.9/linux/arch/mips/lib/memcpy.S linux/arch/mips/lib/memcpy.S
--- v2.4.9/linux/arch/mips/lib/memcpy.S	Tue Dec  5 23:15:12 2000
+++ linux/arch/mips/lib/memcpy.S	Sun Sep  9 10:43:01 2001
@@ -402,16 +402,20 @@
 
 	.align	5
 LEAF(memmove)
-	sltu	t0, a0, a1			# dst < src -> memcpy
-	bnez	t0, memcpy
-	 addu	v0, a0, a2
-	sltu	t0, v0, a1			# dst + len < src -> non-
-	bnez	t0, __memcpy			# overlapping, can use memcpy
+	addu	t0, a0, a2
+	sltu	t0, a1, t0			# dst + len <= src -> memcpy
+	addu	t1, a1, a2
+	sltu	t1, a0, t1			# dst >= src + len -> memcpy
+	and	t0, t1
+	beqz	t0, __memcpy
 	 move	v0, a0				/* return value */
 	beqz	a2, r_out
 	END(memmove)
 
 LEAF(__rmemcpy)					/* a0=dst a1=src a2=len */
+	sltu	t0, a1, a0
+	beqz	t0, r_end_bytes_up		# src >= dst
+	 nop
 	addu	a0, a2				# dst = dst + len
 	addu	a1, a2				# src = src + len
 
@@ -563,6 +567,17 @@
 	 subu	a0, a0, 0x1
 
 r_out:
+	jr	ra
+	 move	a2, zero
+
+r_end_bytes_up:
+	lb	t0, (a1)
+	subu	a2, a2, 0x1
+	sb	t0, (a0)
+	addu	a1, a1, 0x1
+	bnez	a2, r_end_bytes_up
+	 addu	a0, a0, 0x1
+
 	jr	ra
 	 move	a2, zero
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/math-emu/cp1emu.c linux/arch/mips/math-emu/cp1emu.c
--- v2.4.9/linux/arch/mips/math-emu/cp1emu.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/math-emu/cp1emu.c	Sun Sep  9 10:43:01 2001
@@ -5,7 +5,8 @@
  * Copyright (C) 1994-2000 Algorithmics Ltd.  All rights reserved.
  * http://www.algor.co.uk
  *
- * ########################################################################
+ * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000  MIPS Technologies, Inc.
  *
  *  This program is free software; you can distribute it and/or modify it
  *  under the terms of the GNU General Public License (Version 2) as
@@ -20,8 +21,6 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  *
- * ########################################################################
- *
  * A complete emulator for MIPS coprocessor 1 instructions.  This is
  * required for #float(switch) or #float(trap), where it catches all
  * COP1 instructions via the "CoProcessor Unusable" exception.  
@@ -32,24 +31,9 @@
  * quite nasty because emulation of some non-COP1 instructions is
  * required, e.g. in branch delay slots.
  * 
- * Notes: 
- *  1) the IEEE754 library (-le) performs the actual arithmetic;
- *  2) if you know that you won't have an fpu, then you'll get much 
- *     better performance by compiling with -msoft-float!  */
-
-/**************************************************************************
- *  Nov 7, 2000
- *  Massive changes to integrate with Linux kernel.
- *
- *  Replace use of kernel data area with use of user stack 
- *  for execution of instructions in branch delay slots.
- *
- *  Replace use of static kernel variables with thread_struct elements.
- *
- *  Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
- *  Copyright (C) 2000  MIPS Technologies, Inc.  All rights reserved.
- *************************************************************************/
-#include <linux/config.h>
+ * Note if you know that you won't have an fpu, then you'll get much 
+ * better performance by compiling with -msoft-float!
+ */
 #include <linux/mm.h>
 #include <linux/signal.h>
 #include <linux/smp.h>
@@ -57,7 +41,9 @@
 
 #include <asm/asm.h>
 #include <asm/branch.h>
+#include <asm/bootinfo.h>
 #include <asm/byteorder.h>
+#include <asm/cpu.h>
 #include <asm/inst.h>
 #include <asm/uaccess.h>
 #include <asm/processor.h>
@@ -181,19 +167,17 @@
 #define REG_TO_VA (vaddr_t)
 #define VA_TO_REG (unsigned long)
 
-static unsigned long
-mips_get_word(struct pt_regs *xcp, void *va, int *perr)
+static unsigned long mips_get_word(struct pt_regs *xcp, void *va, int *perr)
 {
 	unsigned long temp;
 
 	if (!user_mode(xcp)) {
 		*perr = 0;
 		return (*(unsigned long *) va);
-	} else {
-		/* Use kernel get_user() macro */
-		*perr = (int) get_user(temp, (unsigned long *) va);
-		return temp;
 	}
+
+	*perr = (int) get_user(temp, (unsigned long *) va);
+	return temp;
 }
 
 static unsigned long long
@@ -204,11 +188,10 @@
 	if (!user_mode(xcp)) {
 		*perr = 0;
 		return (*(unsigned long long *) va);
-	} else {
-		/* Use kernel get_user() macro */
-		*perr = (int) get_user(temp, (unsigned long long *) va);
-		return temp;
 	}
+
+	*perr = (int) get_user(temp, (unsigned long long *) va);
+	return temp;
 }
 
 static int mips_put_word(struct pt_regs *xcp, void *va, unsigned long val)
@@ -216,10 +199,9 @@
 	if (!user_mode(xcp)) {
 		*(unsigned long *) va = val;
 		return 0;
-	} else {
-		/* Use kernel get_user() macro */
-		return (int) put_user(val, (unsigned long *) va);
 	}
+
+	return put_user(val, (unsigned long *) va);
 }
 
 static int mips_put_dword(struct pt_regs *xcp, void *va, long long val)
@@ -227,10 +209,9 @@
 	if (!user_mode(xcp)) {
 		*(unsigned long long *) va = val;
 		return 0;
-	} else {
-		/* Use kernel get_user() macro */
-		return (int) put_user(val, (unsigned long long *) va);
 	}
+
+	return put_user(val, (unsigned long long *) va);
 }
 
 
@@ -249,9 +230,7 @@
  * Two instructions if the instruction is in a branch delay slot.
  */
 
-static int
-cop1Emulate(int xcptno, struct pt_regs *xcp,
-	    struct mips_fpu_soft_struct *ctx)
+static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
 {
 	mips_instruction ir;
 	vaddr_t emulpc;
@@ -259,7 +238,6 @@
 	unsigned int cond;
 	int err = 0;
 
-
 	ir = mips_get_word(xcp, REG_TO_VA xcp->cp0_epc, &err);
 	if (err) {
 		fpuemuprivate.stats.errors++;
@@ -303,7 +281,7 @@
 		contpc = REG_TO_VA xcp->cp0_epc + 4;
 	}
 
-      emul:
+emul:
 	fpuemuprivate.stats.emulated++;
 	switch (MIPSInst_OPCODE(ir)) {
 #ifdef CP0_STATUS_FR_SUPPORT
@@ -491,9 +469,8 @@
 			}
 			break;
 
-		case dmtc_op:
+		case dmtc_op: {
 			/* copregister fs <- rt */
-			{
 				fpureg_t value;
 				int fs = MIPSInst_RD(ir);
 				if (!(xcp->cp0_status & ST0_FR))
@@ -502,8 +479,8 @@
 				    (MIPSInst_RT(ir) ==
 				     0) ? 0 : xcp->regs[MIPSInst_RT(ir)];
 				ctx->regs[fs] = value;
-			}
 			break;
+		}
 #endif
 
 		case mfc_op:
@@ -638,95 +615,92 @@
 			}
 			break;
 
-		case bc_op:
-			if (xcp->cp0_cause & CAUSEF_BD) {
+		case bc_op: {
+			int likely = 0;
+
+			if (xcp->cp0_cause & CAUSEF_BD)
 				return SIGILL;
-			}
-			{
-				int likely = 0;
 
 #if __mips >= 4
-				cond =
-				    ctx->
-				    sr & fpucondbit[MIPSInst_RT(ir) >> 2];
+			cond = ctx-> sr & fpucondbit[MIPSInst_RT(ir) >> 2];
 #else
-				cond = ctx->sr & FPU_CSR_COND;
+			cond = ctx->sr & FPU_CSR_COND;
 #endif
-				switch (MIPSInst_RT(ir) & 3) {
-				case bcfl_op:
-					likely = 1;
-				case bcf_op:
-					cond = !cond;
-					break;
-				case bctl_op:
-					likely = 1;
-				case bct_op:
-					break;
-				default:
-					/* thats an illegal instruction */
-					return SIGILL;
-				}
+			switch (MIPSInst_RT(ir) & 3) {
+			case bcfl_op:
+				likely = 1;
+			case bcf_op:
+				cond = !cond;
+				break;
+			case bctl_op:
+				likely = 1;
+			case bct_op:
+				break;
+			default:
+				/* thats an illegal instruction */
+				return SIGILL;
+			}
 
-				xcp->cp0_cause |= CAUSEF_BD;
-				if (cond) {
-					/* branch taken: emulate dslot instruction */
-					xcp->cp0_epc += 4;
-					contpc =
-					    REG_TO_VA xcp->cp0_epc +
-					    (MIPSInst_SIMM(ir) << 2);
-
-					ir =
-					    mips_get_word(xcp,
-							  REG_TO_VA(xcp->
-								    cp0_epc),
-							  &err);
-					if (err) {
-						fpuemuprivate.stats.
-						    errors++;
-						return SIGBUS;
-					}
+			xcp->cp0_cause |= CAUSEF_BD;
+			if (cond) {
+				/* branch taken: emulate dslot instruction */
+				xcp->cp0_epc += 4;
+				contpc = REG_TO_VA xcp->cp0_epc +
+				         (MIPSInst_SIMM(ir) << 2);
+
+				ir = mips_get_word(xcp, REG_TO_VA(xcp->cp0_epc),
+				      &err);
+				if (err) {
+					fpuemuprivate.stats.errors++;
+					return SIGBUS;
+				}
 
-					switch (MIPSInst_OPCODE(ir)) {
-					case lwc1_op:
-					case swc1_op:
+				switch (MIPSInst_OPCODE(ir)) {
+				case lwc1_op:
+				case swc1_op:
 #if (__mips >= 2 || __mips64) && !defined(SINGLE_ONLY_FPU)
-					case ldc1_op:
-					case sdc1_op:
+				case ldc1_op:
+				case sdc1_op:
 #endif
-					case cop1_op:
+				case cop1_op:
 #if __mips >= 4 && __mips != 32
-					case cop1x_op:
+				case cop1x_op:
 #endif
-						/* its one of ours */
-						goto emul;
+					/* its one of ours */
+					goto emul;
 #if __mips >= 4
-					case spec_op:
-						if (MIPSInst_FUNC(ir) ==
-						    movc_op) goto emul;
-						break;
+				case spec_op:
+					if (MIPSInst_FUNC(ir) == movc_op)
+						goto emul;
+					break;
 #endif
-					}
+				}
 
-					/* single step the non-cp1 instruction in the dslot */
-					return mips_dsemul(xcp, ir,
-							   contpc);
-				} else {
-					/* branch not taken */
-					if (likely)
-						/* branch likely nullifies dslot if not taken */
-						xcp->cp0_epc += 4;
+				/*
+				 * Single step the non-cp1 instruction in the
+				 * dslot
+				 */
+				return mips_dsemul(xcp, ir, contpc);
+			} else {
+				/* branch not taken */
+				if (likely)
+					/*
+					 * branch likely nullifies dslot if not
+					 * taken
+					 */
+					xcp->cp0_epc += 4;
 					/* else continue & execute dslot as normal insn */
-				}
 			}
 			break;
+		}
 
-		default:
-			if (!(MIPSInst_RS(ir) & 0x10)) {
+		default: {
+			int sig;
+
+			if (!(MIPSInst_RS(ir) & 0x10))
 				return SIGILL;
-			}
+
 			/* a real fpu computation instruction */
-			{
-				int sig;
 				if ((sig = fpu_emu(xcp, ctx, ir)))
 					return sig;
 			}
@@ -822,14 +796,15 @@
 	 */
 	dsemul_insns = (mips_instruction *) (xcp->regs[29] & ~3);
 	dsemul_insns -= 3;	/* Two instructions, plus one for luck ;-) */
+
 	/* Verify that the stack pointer is not competely insane */
-	if (verify_area
-	    (VERIFY_WRITE, dsemul_insns, sizeof(mips_instruction) * 2))
+	if (verify_area(VERIFY_WRITE, dsemul_insns,
+	                sizeof(mips_instruction) * 2))
 		return SIGBUS;
 
 	if (mips_put_word(xcp, &dsemul_insns[0], ir)) {
 		fpuemuprivate.stats.errors++;
-		return (SIGBUS);
+		return SIGBUS;
 	}
 
 	/* 
@@ -856,11 +831,8 @@
 	current->thread.dsemul_epc = (unsigned long) cpc;
 	current->thread.dsemul_aerpc = (unsigned long) &dsemul_insns[1];
 	xcp->cp0_epc = VA_TO_REG & dsemul_insns[0];
+	flush_cache_sigtramp((unsigned long) dsemul_insns);
 
-	/* What we'd really like to do is just flush the line(s) of the */
-	/* icache containing the dsemulret instructions, but there's no */
-	/* mechanism to do this yet...  */
-	flush_cache_all();
 	return SIGILL;		/* force out of emulation loop */
 }
 
@@ -971,9 +943,8 @@
 	return ieee754sp_neg(ieee754sp_sub(ieee754sp_mul(s, t), r));
 }
 
-static int
-fpux_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
-	 mips_instruction ir)
+static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
+                    mips_instruction ir)
 {
 	unsigned rcsr = 0;	/* resulting csr */
 
@@ -1226,9 +1197,8 @@
 /*
  * Emulate a single COP1 arithmetic instruction.
  */
-static int
-fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
-	mips_instruction ir)
+static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
+                   mips_instruction ir)
 {
 	int rfmt;		/* resulting format */
 	unsigned rcsr = 0;	/* resulting csr */
@@ -1244,8 +1214,7 @@
 
 	fpuemuprivate.stats.cp1ops++;
 	switch (rfmt = (MIPSInst_FFMT(ir) & 0xf)) {
-
-	case s_fmt:{		/* 0 */
+	case s_fmt: {		/* 0 */
 		ieee754sp(*handler) ();
 
 		switch (MIPSInst_FUNC(ir)) {
@@ -1342,73 +1311,68 @@
 				/* unary conv ops */
 		case fcvts_op:
 			return SIGILL;	/* not defined */
-		case fcvtd_op:
-#if defined(SINGLE_ONLY_FPU)
+		case fcvtd_op: {
+#ifdef SINGLE_ONLY_FPU
 			return SIGILL;	/* not defined */
 #else
-			{
-				ieee754sp fs;
+			ieee754sp fs;
 
-				SPFROMREG(fs, MIPSInst_FS(ir));
-				rv.d = ieee754dp_fsp(fs);
-				rfmt = d_fmt;
-				goto copcsr;
-			}
+			SPFROMREG(fs, MIPSInst_FS(ir));
+			rv.d = ieee754dp_fsp(fs);
+			rfmt = d_fmt;
+			goto copcsr;
+		}
 #endif
-		case fcvtw_op:
-			{
-				ieee754sp fs;
+		case fcvtw_op: {
+			ieee754sp fs;
 
-				SPFROMREG(fs, MIPSInst_FS(ir));
-				rv.w = ieee754sp_tint(fs);
-				rfmt = w_fmt;
-				goto copcsr;
-			}
+			SPFROMREG(fs, MIPSInst_FS(ir));
+			rv.w = ieee754sp_tint(fs);
+			rfmt = w_fmt;
+			goto copcsr;
+		}
 
 #if __mips >= 2 || __mips64
 		case fround_op:
 		case ftrunc_op:
 		case fceil_op:
-		case ffloor_op:
-			{
-				unsigned int oldrm = ieee754_csr.rm;
-				ieee754sp fs;
-
-				SPFROMREG(fs, MIPSInst_FS(ir));
-				ieee754_csr.rm = ieee_rm[MIPSInst_FUNC(ir) & 0x3];
-				rv.w = ieee754sp_tint(fs);
-				ieee754_csr.rm = oldrm;
-				rfmt = w_fmt;
-				goto copcsr;
-			}
-#endif			/* __mips >= 2 */
+		case ffloor_op: {
+			unsigned int oldrm = ieee754_csr.rm;
+			ieee754sp fs;
+
+			SPFROMREG(fs, MIPSInst_FS(ir));
+			ieee754_csr.rm = ieee_rm[MIPSInst_FUNC(ir) & 0x3];
+			rv.w = ieee754sp_tint(fs);
+			ieee754_csr.rm = oldrm;
+			rfmt = w_fmt;
+			goto copcsr;
+		}
+#endif /* __mips >= 2 */
 
 #if __mips64 && !defined(SINGLE_ONLY_FPU)
-		case fcvtl_op:
-			{
-				ieee754sp fs;
+		case fcvtl_op: {
+			ieee754sp fs;
 
-				SPFROMREG(fs, MIPSInst_FS(ir));
-				rv.l = ieee754sp_tlong(fs);
-				rfmt = l_fmt;
-				goto copcsr;
-			}
+			SPFROMREG(fs, MIPSInst_FS(ir));
+			rv.l = ieee754sp_tlong(fs);
+			rfmt = l_fmt;
+			goto copcsr;
+		}
 
 		case froundl_op:
 		case ftruncl_op:
 		case fceill_op:
-		case ffloorl_op:
-			{
-				unsigned int oldrm = ieee754_csr.rm;
-				ieee754sp fs;
-
-				SPFROMREG(fs, MIPSInst_FS(ir));
-				ieee754_csr.rm = ieee_rm[MIPSInst_FUNC(ir) & 0x3];
-				rv.l = ieee754sp_tlong(fs);
-				ieee754_csr.rm = oldrm;
-				rfmt = l_fmt;
-				goto copcsr;
-			}
+		case ffloorl_op: {
+			unsigned int oldrm = ieee754_csr.rm;
+			ieee754sp fs;
+
+			SPFROMREG(fs, MIPSInst_FS(ir));
+			ieee754_csr.rm = ieee_rm[MIPSInst_FUNC(ir) & 0x3];
+			rv.l = ieee754sp_tlong(fs);
+			ieee754_csr.rm = oldrm;
+			rfmt = l_fmt;
+			goto copcsr;
+		}
 #endif /* __mips64 && !fpu(single) */
 
 		default:
@@ -1484,9 +1448,11 @@
 		case fabs_op:
 			handler = ieee754dp_abs;
 			goto dcopuop;
+
 		case fneg_op:
 			handler = ieee754dp_neg;
 			goto dcopuop;
+
 		case fmov_op:
 			/* an easy one */
 			DPFROMREG(rv.d, MIPSInst_FS(ir));
@@ -1513,71 +1479,67 @@
 			}
 
 		/* unary conv ops */
-		case fcvts_op:
-			{
-				ieee754dp fs;
+		case fcvts_op: {
+			ieee754dp fs;
 
-				DPFROMREG(fs, MIPSInst_FS(ir));
-				rv.s = ieee754sp_fdp(fs);
-				rfmt = s_fmt;
-				goto copcsr;
-			}
+			DPFROMREG(fs, MIPSInst_FS(ir));
+			rv.s = ieee754sp_fdp(fs);
+			rfmt = s_fmt;
+			goto copcsr;
+		}
 		case fcvtd_op:
 			return SIGILL;	/* not defined */
-		case fcvtw_op:
-			{
-				ieee754dp fs;
 
-				DPFROMREG(fs, MIPSInst_FS(ir));
-				rv.w = ieee754dp_tint(fs);	/* wrong */
-				rfmt = w_fmt;
-				goto copcsr;
-			}
+		case fcvtw_op: {
+			ieee754dp fs;
+
+			DPFROMREG(fs, MIPSInst_FS(ir));
+			rv.w = ieee754dp_tint(fs);	/* wrong */
+			rfmt = w_fmt;
+			goto copcsr;
+		}
 
 #if __mips >= 2 || __mips64
 		case fround_op:
 		case ftrunc_op:
 		case fceil_op:
-		case ffloor_op:
-			{
-				unsigned int oldrm = ieee754_csr.rm;
-				ieee754dp fs;
-
-				DPFROMREG(fs, MIPSInst_FS(ir));
-				ieee754_csr.rm = ieee_rm[MIPSInst_FUNC(ir) & 0x3];
-				rv.w = ieee754dp_tint(fs);
-				ieee754_csr.rm = oldrm;
-				rfmt = w_fmt;
-				goto copcsr;
-			}
+		case ffloor_op: {
+			unsigned int oldrm = ieee754_csr.rm;
+			ieee754dp fs;
+
+			DPFROMREG(fs, MIPSInst_FS(ir));
+			ieee754_csr.rm = ieee_rm[MIPSInst_FUNC(ir) & 0x3];
+			rv.w = ieee754dp_tint(fs);
+			ieee754_csr.rm = oldrm;
+			rfmt = w_fmt;
+			goto copcsr;
+		}
 #endif
 
 #if __mips64 && !defined(SINGLE_ONLY_FPU)
-		case fcvtl_op:
-			{
-				ieee754dp fs;
+		case fcvtl_op: {
+			ieee754dp fs;
 
-				DPFROMREG(fs, MIPSInst_FS(ir));
-				rv.l = ieee754dp_tlong(fs);
-				rfmt = l_fmt;
-				goto copcsr;
-			}
+			DPFROMREG(fs, MIPSInst_FS(ir));
+			rv.l = ieee754dp_tlong(fs);
+			rfmt = l_fmt;
+			goto copcsr;
+		}
 
 		case froundl_op:
 		case ftruncl_op:
 		case fceill_op:
-		case ffloorl_op:
-			{
-				unsigned int oldrm = ieee754_csr.rm;
-				ieee754dp fs;
-
-				DPFROMREG(fs, MIPSInst_FS(ir));
-				ieee754_csr.rm = ieee_rm[MIPSInst_FUNC(ir) & 0x3];
-				rv.l = ieee754dp_tlong(fs);
-				ieee754_csr.rm = oldrm;
-				rfmt = l_fmt;
-				goto copcsr;
-			}
+		case ffloorl_op: {
+			unsigned int oldrm = ieee754_csr.rm;
+			ieee754dp fs;
+
+			DPFROMREG(fs, MIPSInst_FS(ir));
+			ieee754_csr.rm = ieee_rm[MIPSInst_FUNC(ir) & 0x3];
+			rv.l = ieee754dp_tlong(fs);
+			ieee754_csr.rm = oldrm;
+			rfmt = l_fmt;
+			goto copcsr;
+		}
 #endif /* __mips >= 3 && !fpu(single) */
 
 		default:
@@ -1598,7 +1560,7 @@
 		}
 		break;
 	}
-#endif				/* !defined(SINGLE_ONLY_FPU) */
+#endif /* !defined(SINGLE_ONLY_FPU) */
 
 	case w_fmt: {
 		switch (MIPSInst_FUNC(ir)) {
@@ -1698,12 +1660,11 @@
 
 
 /*
- * Emulate the floating point instruction at EPC, and continue
- * to run until we hit a non-fp instruction, or a backward
- * branch.  This cuts down dramatically on the per instruction 
- * exception overhead.
+ * Emulate the floating point instruction at EPC, and continue to run until we
+ * hit a non-fp instruction, or a backward branch.  This cuts down dramatically
+ * on the per instruction exception overhead.
  */
-int fpu_emulator_cop1Handler(int xcptno, struct pt_regs *xcp)
+int fpu_emulator_cop1Handler(struct pt_regs *xcp)
 {
 	struct mips_fpu_soft_struct *ctx = &current->thread.fpu.soft;
 	unsigned long oldepc, prevepc;
@@ -1713,6 +1674,9 @@
 
 	oldepc = xcp->cp0_epc;
 	do {
+		if (current->need_resched)
+			schedule();
+
 		prevepc = xcp->cp0_epc;
 		insn = mips_get_word(xcp, REG_TO_VA(xcp->cp0_epc), &err);
 		if (err) {
@@ -1720,9 +1684,12 @@
 			return SIGBUS;
 		}
 		if (insn != 0)
-			sig = cop1Emulate(xcptno, xcp, ctx);
+			sig = cop1Emulate(xcp, ctx);
 		else
 			xcp->cp0_epc += 4;	/* skip nops */
+
+		if (mips_cpu.options & MIPS_CPU_FPU)
+			break;
 	} while (xcp->cp0_epc > prevepc && sig == 0);
 
 	/* SIGILL indicates a non-fpu instruction */
@@ -1753,7 +1720,7 @@
 
 	/* get current rounding mode for IEEE library, and emulate insn */
 	ieee754_csr.rm = ieee_rm[ctx->sr & 0x3];
-	sig = cop1Emulate(xcptno, xcp, ctx);
+	sig = cop1Emulate(xcp, ctx);
 
 	/* don't return with f.p. exceptions pending */
 	ctx->sr &= ~FPU_CSR_ALL_X;
@@ -1809,4 +1776,3 @@
 	}
 }
 #endif
-
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mips-boards/atlas/atlas_int.c linux/arch/mips/mips-boards/atlas/atlas_int.c
--- v2.4.9/linux/arch/mips/mips-boards/atlas/atlas_int.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/mips-boards/atlas/atlas_int.c	Sun Sep  9 10:43:02 2001
@@ -51,6 +51,11 @@
 #define DEBUG_INT(x...)
 #endif
 
+void inline disable_irq_nosync(unsigned int irq_nr)
+{
+	disable_atlas_irq(irq_nr);
+}
+
 void disable_atlas_irq(unsigned int irq_nr)
 {
 	atlas_hw0_icregs->intrsten = (1 << irq_nr);
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mips-boards/atlas/atlas_rtc.c linux/arch/mips/mips-boards/atlas/atlas_rtc.c
--- v2.4.9/linux/arch/mips/mips-boards/atlas/atlas_rtc.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/mips-boards/atlas/atlas_rtc.c	Sun Sep  9 10:43:02 2001
@@ -22,7 +22,6 @@
  * RTC routines for Atlas style attached Dallas chip.
  *
  */
-#include <linux/spinlock.h>
 #include <linux/mc146818rtc.h>
 #include <asm/mips-boards/atlas.h>
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mips-boards/atlas/atlas_setup.c linux/arch/mips/mips-boards/atlas/atlas_setup.c
--- v2.4.9/linux/arch/mips/mips-boards/atlas/atlas_setup.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/mips-boards/atlas/atlas_setup.c	Sun Sep  9 10:43:02 2001
@@ -54,8 +54,8 @@
 	char rs_getDebugChar(void);
 	int saa9730_putDebugChar(char);
 	char saa9730_getDebugChar(void);
-	extern int (*putDebugChar)(char);
-	extern char (*getDebugChar)(void);
+	extern int (*generic_putDebugChar)(char);
+	extern char (*generic_getDebugChar)(void);
 #endif
 	char *argptr;
 
@@ -89,12 +89,12 @@
 
 		if(line == 0) {
 			rs_kgdb_hook(line);
-			putDebugChar = rs_putDebugChar;
-			getDebugChar = rs_getDebugChar;
+			generic_putDebugChar = rs_putDebugChar;
+			generic_getDebugChar = rs_getDebugChar;
 		} else {
 			saa9730_kgdb_hook();
-			putDebugChar = saa9730_putDebugChar;
-			getDebugChar = saa9730_getDebugChar;
+			generic_putDebugChar = saa9730_putDebugChar;
+			generic_getDebugChar = saa9730_getDebugChar;
 		}
 
 		prom_printf("KGDB: Using serial line /dev/ttyS%d for session, "
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mips-boards/generic/cmdline.c linux/arch/mips/mips-boards/generic/cmdline.c
--- v2.4.9/linux/arch/mips/mips-boards/generic/cmdline.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/mips-boards/generic/cmdline.c	Sun Sep  9 10:43:02 2001
@@ -17,6 +17,7 @@
  *
  * Kernel command line creation using the prom monitor (YAMON) argc/argv.
  */
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/string.h>
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mips-boards/generic/gdb_hook.c linux/arch/mips/mips-boards/generic/gdb_hook.c
--- v2.4.9/linux/arch/mips/mips-boards/generic/gdb_hook.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/mips-boards/generic/gdb_hook.c	Sun Sep  9 10:43:02 2001
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/serialP.h>
 #include <linux/serial_reg.h>
 
@@ -36,8 +35,8 @@
 
 static struct async_struct kdb_port_info = {0};
 
-int (*putDebugChar)(char);
-char (*getDebugChar)(void);
+int (*generic_putDebugChar)(char);
+char (*generic_getDebugChar)(void);
 
 static __inline__ unsigned int serial_in(struct async_struct *info, int offset)
 {
@@ -96,6 +95,16 @@
 	serial_out(&kdb_port_info, UART_DLM, t >> 8);  /* MS of divisor */
 	/* reset DLAB */
 	serial_out(&kdb_port_info, UART_LCR, UART_LCR_WLEN8);
+}
+
+int putDebugChar(char c)
+{
+	return generic_putDebugChar(c);
+}
+
+char getDebugChar(void) 
+{
+	return generic_getDebugChar();
 }
 
 int rs_putDebugChar(char c)
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mips-boards/generic/memory.c linux/arch/mips/mips-boards/generic/memory.c
--- v2.4.9/linux/arch/mips/mips-boards/generic/memory.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/mips-boards/generic/memory.c	Sun Sep  9 10:43:02 2001
@@ -50,6 +50,11 @@
 };
 #endif
 
+/* References to section boundaries */
+extern char _end;
+
+#define PFN_ALIGN(x)    (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
+
 
 struct prom_pmemblock * __init prom_getmdesc(void)
 {
@@ -94,9 +99,13 @@
 	mdesc[2].size = 0x00010000;
 #endif
 
-	mdesc[3].type = yamon_free;
+	mdesc[3].type = yamon_dontuse;
 	mdesc[3].base = 0x00100000;
-	mdesc[3].size = memsize - mdesc[3].base;
+	mdesc[3].size = PHYSADDR(PFN_ALIGN(&_end)) - mdesc[3].base;
+
+	mdesc[4].type = yamon_free;
+	mdesc[4].base = PHYSADDR(PFN_ALIGN(&_end));
+	mdesc[4].size = memsize - mdesc[4].base;
 
 	return &mdesc[0];
 }
@@ -118,11 +127,10 @@
 	struct prom_pmemblock *p;
 
 #ifdef DEBUG
-	int i = 0;
-
 	prom_printf("YAMON MEMORY DESCRIPTOR dump:\n");
 	p = prom_getmdesc();
 	while (p->size) {
+		int i = 0;
 		prom_printf("[%d,%p]: base<%08lx> size<%08lx> type<%s>\n",
 			    i, p, p->base, p->size, mtypes[p->type]);
 		p++;
@@ -130,24 +138,24 @@
 	}
 #endif
 	p = prom_getmdesc();
+
 	while (p->size) {
-		unsigned long base, size;
 		long type;
+		unsigned long base, size;
 
 		type = prom_memtype_classify (p->type);
 		base = p->base;
 		size = p->size;
 
 		add_memory_region(base, size, type);
-
-		p++;
+                p++; 
 	}
 }
 
-void prom_free_prom_memory (void)
+void __init
+prom_free_prom_memory (void)
 {
 	int i;
-	struct prom_pmemblock *p;
 	unsigned long freed = 0;
 	unsigned long addr;
 
@@ -158,9 +166,9 @@
 		addr = boot_mem_map.map[i].addr;
 		while (addr < boot_mem_map.map[i].addr
 			      + boot_mem_map.map[i].size) {
-		        ClearPageReserved(virt_to_page(phys_to_virt(addr)));
-			set_page_count(virt_to_page(phys_to_virt(addr)), 1);
-			free_page(phys_to_virt(addr));
+			ClearPageReserved(virt_to_page(__va(addr)));
+			set_page_count(virt_to_page(__va(addr)), 1);
+			free_page(__va(addr));
 			addr += PAGE_SIZE;
 			freed += PAGE_SIZE;
 		}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mips-boards/generic/pci.c linux/arch/mips/mips-boards/generic/pci.c
--- v2.4.9/linux/arch/mips/mips-boards/generic/pci.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/mips-boards/generic/pci.c	Sun Sep  9 10:43:02 2001
@@ -325,4 +325,9 @@
 	pci_read_bridge_bases(b);
 }
 
+unsigned __init int pcibios_assign_all_busses(void)
+{
+	return 1;
+}
+
 #endif /* CONFIG_PCI */
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mips-boards/generic/time.c linux/arch/mips/mips-boards/generic/time.c
--- v2.4.9/linux/arch/mips/mips-boards/generic/time.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/mips-boards/generic/time.c	Sun Sep  9 10:43:02 2001
@@ -275,7 +275,7 @@
 
 /* This is for machines which generate the exact clock. */
 #define USECS_PER_JIFFY (1000000/HZ)
-#define USECS_PER_JIFFY_FRAC (0x100000000*1000000/HZ&0xffffffff)
+#define USECS_PER_JIFFY_FRAC ((1000000 << 32) / HZ & 0xffffffff)
 
 /* Cycle counter value at the previous timer interrupt.. */
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mips-boards/malta/malta_int.c linux/arch/mips/mips-boards/malta/malta_int.c
--- v2.4.9/linux/arch/mips/mips-boards/malta/malta_int.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/mips-boards/malta/malta_int.c	Sun Sep  9 10:43:02 2001
@@ -1,6 +1,7 @@
 /*
  * Carsten Langgaard, carstenl@mips.com
- * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ * Copyright (C) 2000, 2001 MIPS Technologies, Inc.
+ * Copyright (C) 2001 Ralf Baechle
  *
  *  This program is free software; you can distribute it and/or modify it
  *  under the terms of the GNU General Public License (Version 2) as
@@ -20,6 +21,7 @@
  * The interrupt controller is located in the South Bridge a PIIX4 device 
  * with two internal 82C95 interrupt controllers.
  */
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
@@ -37,342 +39,42 @@
 
 extern asmlinkage void mipsIRQ(void);
 
-unsigned int local_bh_count[NR_CPUS];
-unsigned int local_irq_count[NR_CPUS];
-unsigned long spurious_count = 0;
-
-static struct irqaction *hw0_irq_action[MALTAINT_END] = {
-	NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL
-};
-
-static struct irqaction r4ktimer_action = {
-	NULL, 0, 0, "R4000 timer/counter", NULL, NULL,
-};
-
-static struct irqaction *irq_action[8] = {
-	NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, &r4ktimer_action
-};
-
-#if 0
-#define DEBUG_INT(x...) printk(x)
-#else
-#define DEBUG_INT(x...)
-#endif
-
-/*
- * This contains the interrupt mask for both 82C59 interrupt controllers.
- */
-static unsigned int cached_int_mask = 0xffff;
-
-
-void disable_irq(unsigned int irq_nr)
-{
-        unsigned long flags;
-
-	if(irq_nr >= MALTAINT_END) {
-		printk("whee, invalid irq_nr %d\n", irq_nr);
-		panic("IRQ, you lose...");
-	}
-
-	save_and_cli(flags);
-	cached_int_mask |= (1 << irq_nr);
-	if (irq_nr & 8) {
-	        outb((cached_int_mask >> 8) & 0xff, PIIX4_ICTLR2_OCW1);
-	} else {
-		outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1);
-	}
-	restore_flags(flags);
-}
-
-
-void enable_irq(unsigned int irq_nr)
-{
-        unsigned long flags;
-
-	if(irq_nr >= MALTAINT_END) {
-		printk("whee, invalid irq_nr %d\n", irq_nr);
-		panic("IRQ, you lose...");
-	}
-
-	save_and_cli(flags);
-	cached_int_mask &= ~(1 << irq_nr);
-	if (irq_nr & 8) {
-		outb((cached_int_mask >> 8) & 0xff, PIIX4_ICTLR2_OCW1);
-
-		/* Enable irq 2 (cascade interrupt). */
-	        cached_int_mask &= ~(1 << 2); 
-		outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1);
-	} else {
-		outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1);
-	}	
-	restore_flags(flags);
-}
-
-
-int get_irq_list(char *buf)
-{
-	int i, len = 0;
-	int num = 0;
-	struct irqaction *action;
-
-	for (i = 0; i < 8; i++, num++) {
-		action = irq_action[i];
-		if (!action) 
-			continue;
-		len += sprintf(buf+len, "%2d: %8d %c %s",
-			num, kstat.irqs[0][num],
-			(action->flags & SA_INTERRUPT) ? '+' : ' ',
-			action->name);
-		for (action=action->next; action; action = action->next) {
-			len += sprintf(buf+len, ",%s %s",
-				(action->flags & SA_INTERRUPT) ? " +" : "",
-				action->name);
-		}
-		len += sprintf(buf+len, " [on-chip]\n");
-	}
-	for (i = 0; i < MALTAINT_END; i++, num++) {
-		action = hw0_irq_action[i];
-		if (!action) 
-			continue;
-		len += sprintf(buf+len, "%2d: %8d %c %s",
-			num, kstat.irqs[0][num],
-			(action->flags & SA_INTERRUPT) ? '+' : ' ',
-			action->name);
-		for (action=action->next; action; action = action->next) {
-			len += sprintf(buf+len, ",%s %s",
-				(action->flags & SA_INTERRUPT) ? " +" : "",
-				action->name);
-		}
-		len += sprintf(buf+len, " [hw0]\n");
-	}
-	return len;
-}
-
-
-static int setup_irq(unsigned int irq, struct irqaction * new)
-{
-	int shared = 0;
-	struct irqaction *old, **p;
-
-	p = &hw0_irq_action[irq];
-	if ((old = *p) != NULL) {
-		/* Can't share interrupts unless both agree to */
-		if (!(old->flags & new->flags & SA_SHIRQ))
-			return -EBUSY;
-
-		/* Can't share interrupts unless both are same type */
-		if ((old->flags ^ new->flags) & SA_INTERRUPT)
-			return -EBUSY;
-
-		/* add new interrupt at end of irq queue */
-		do {
-			p = &old->next;
-			old = *p;
-		} while (old);
-		shared = 1;
-	}
-
-	if (new->flags & SA_SAMPLE_RANDOM)
-		rand_initialize_irq(irq);
-
-	*p = new;
-	if (!shared)
-		enable_irq(irq);
-
-	return 0;
-}
-
-int request_irq(unsigned int irq, 
-		void (*handler)(int, void *, struct pt_regs *),
-		unsigned long irqflags, 
-		const char * devname,
-		void *dev_id)
-{  
-        struct irqaction *action;
-	int retval;
-
-	DEBUG_INT("request_irq: irq=%d, devname = %s\n", irq, devname);
-
-        if (irq >= MALTAINT_END)
-	        return -EINVAL;
-	if (!handler)
-	        return -EINVAL;
-
-	action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL);
-	if(!action)
-	        return -ENOMEM;
-
-	action->handler = handler;
-	action->flags = irqflags;
-	action->mask = 0;
-	action->name = devname;
-	action->dev_id = dev_id;
-	action->next = 0;
-
-	retval = setup_irq(irq, action);
-	if (retval)
-		kfree(action);
-
-	return retval;	
-}
-
-
-void free_irq(unsigned int irq, void *dev_id)
-{
-	struct irqaction *action, **p;
-
-	if (irq >= MALTAINT_END) {
-		printk("Trying to free IRQ%d\n",irq);
-		return;
-	}
-	
-	for (p = &hw0_irq_action[irq]; (action = *p) != NULL; 
-	     p = &action->next) 
-	{
-		if (action->dev_id != dev_id)
-			continue;
-
-		/* Found it - now free it */
-		*p = action->next;
-		kfree(action);
-		if (!hw0_irq_action[irq])
-			disable_irq(irq);
-		return;
-	}
-	printk("Trying to free IRQ%d\n",irq);
-}
-
-void __init init_IRQ(void)
+void malta_hw0_irqdispatch(struct pt_regs *regs)
 {
-	irq_setup();
-}
+	int irq;
 
-static inline int get_int(int *irq)
-{
 	/*  
-	 * Determine highest priority pending interrupt by performing
-         * a PCI Interrupt Acknowledge cycle.
+	 * Determine highest priority pending interrupt by performing a PCI
+	 * Interrupt Acknowledge cycle.
 	 */
-	GT_READ(GT_PCI0_IACK_OFS, *irq);
-	*irq &= 0xFF;
+	GT_READ(GT_PCI0_IACK_OFS, irq);
+	irq &= 0xFF;
 
 	/*  
-	 * IRQ7 is used to detect spurious interrupts.
-	 * The interrupt acknowledge cycle returns IRQ7, if no 
-	 * interrupts is requested.
-	 * We can differentiate between this situation and a
-	 * "Normal" IRQ7 by reading the ISR.
+	 * IRQ7 is used to detect spurious interrupts.  The interrupt
+	 * acknowledge cycle returns IRQ7, if no interrupts is requested.  We
+	 * can differentiate between this situation and a "normal" IRQ7 by
+	 * reading the ISR.
 	 */
-	if (*irq == 7) 
-	{
+	if (irq == 7) {
 		outb(PIIX4_OCW3_SEL | PIIX4_OCW3_ISR, PIIX4_ICTLR1_OCW3);
 		if (!(inb(PIIX4_ICTLR1_OCW3) & (1 << 7)))
-		        return -1;    /* Spurious interrupt. */
-	}
-
-	return 0;
-}
-
-static inline void ack_int(int irq)
-{
-	if (irq & 8) {
-	        /* Specific EOI to cascade */
-		outb(PIIX4_OCW2_SEL | PIIX4_OCW2_NSEOI | PIIX4_OCW2_ILS_2, 
-		     PIIX4_ICTLR1_OCW2);
-
-	        /* Non specific EOI to cascade */
-		outb(PIIX4_OCW2_SEL | PIIX4_OCW2_NSEOI, PIIX4_ICTLR2_OCW2);
-	} else {
-	        /* Non specific EOI to cascade */
-		outb(PIIX4_OCW2_SEL | PIIX4_OCW2_NSEOI, PIIX4_ICTLR1_OCW2);
+		        return;    /* Spurious interrupt. */
 	}
-}
-
-void malta_hw0_irqdispatch(struct pt_regs *regs)
-{
-        struct irqaction *action;
-	int irq=0, cpu = smp_processor_id();
-
-	DEBUG_INT("malta_hw0_irqdispatch\n");
-	
-	if (get_int(&irq))
-	        return;  /* interrupt has already been cleared */
 
-	disable_irq(irq);
-	ack_int(irq);
-
-	DEBUG_INT("malta_hw0_irqdispatch: irq=%d\n", irq);
-	action = hw0_irq_action[irq];
-
-	/* 
-	 * if action == NULL, then we don't have a handler 
-	 * for the irq 
-	 */
-	if ( action == NULL )
-		return;
-
-	irq_enter(cpu, irq);
-	kstat.irqs[0][irq + 8]++;
-	do {
-	        action->handler(irq, action->dev_id, regs);
-		action = action->next;
-	} while (action);
-
-	enable_irq(irq);
-	irq_exit(cpu, irq);
+	do_IRQ(irq, regs);
 }
 
-
-unsigned long probe_irq_on (void)
+void __init init_IRQ(void)
 {
-	unsigned int i, irqs = 0;
-	unsigned long delay;
+	set_except_vector(0, mipsIRQ);
+	init_generic_irq();
+	init_i8259_irqs();
 
-	/* first, enable any unassigned irqs */
-	for (i = MALTAINT_END-1; i > 0; i--) {
-		if (!hw0_irq_action[i]) {
-			enable_irq(i);
-			irqs |= (1 << i);
-		}
+#ifdef CONFIG_REMOTE_DEBUG
+	if (remote_debug) {
+		set_debug_traps();
+		breakpoint();
 	}
-
-	/* wait for spurious interrupts to mask themselves out again */
-	for (delay = jiffies + HZ/10; time_before(jiffies, delay); )
-		/* about 100ms delay */;
-
-	/* now filter out any obviously spurious interrupts */
-	return irqs & ~cached_int_mask;
-}
-
-
-int probe_irq_off (unsigned long irqs)
-{
-	unsigned int i;
-
-	irqs &= cached_int_mask;
-	if (!irqs)
-		return 0;
-	i = ffz(~irqs);
-	if (irqs != (irqs & (1 << i)))
-		i = -i;
-
-	return i;
-}
-
-
-void __init maltaint_init(void)
-{
-        /* 
-	 * Mask out all interrupt by writing "1" to all bit position in 
-	 * the IMR register. 
-	 */
-	outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1);
-	outb((cached_int_mask >> 8) & 0xff, PIIX4_ICTLR2_OCW1);
-
-	/* Now safe to set the exception vector. */
-	set_except_vector(0, mipsIRQ);
+#endif
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mips-boards/malta/malta_rtc.c linux/arch/mips/mips-boards/malta/malta_rtc.c
--- v2.4.9/linux/arch/mips/mips-boards/malta/malta_rtc.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/mips-boards/malta/malta_rtc.c	Sun Sep  9 10:43:02 2001
@@ -23,7 +23,6 @@
  * Motorola MC146818A-compatible Real Time Clock.
  *
  */
-#include <linux/spinlock.h>
 #include <linux/mc146818rtc.h>
 #include <asm/mips-boards/malta.h>
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mips-boards/malta/malta_setup.c linux/arch/mips/mips-boards/malta/malta_setup.c
--- v2.4.9/linux/arch/mips/mips-boards/malta/malta_setup.c	Fri Apr 13 20:26:07 2001
+++ linux/arch/mips/mips-boards/malta/malta_setup.c	Sun Sep  9 10:43:02 2001
@@ -2,8 +2,6 @@
  * Carsten Langgaard, carstenl@mips.com
  * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
  *
- * ########################################################################
- *
  *  This program is free software; you can distribute it and/or modify it
  *  under the terms of the GNU General Public License (Version 2) as
  *  published by the Free Software Foundation.
@@ -16,11 +14,6 @@
  *  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.
- *
- * ########################################################################
- *
- * Malta specific setup, including init of the feature struct.
- *
  */
 #include <linux/config.h>
 #include <linux/init.h>
@@ -56,53 +49,33 @@
 static int remote_debug = 0;
 #endif
 
-#ifdef CONFIG_BLK_DEV_IDE
 extern struct ide_ops std_ide_ops;
-#endif
-#ifdef CONFIG_BLK_DEV_FD
 extern struct fd_ops std_fd_ops;
-#endif
 extern struct rtc_ops malta_rtc_ops;
+extern struct kbd_ops std_kbd_ops;
 
 extern void mips_reboot_setup(void);
 
 struct resource standard_io_resources[] = {
 	{ "dma1", 0x00, 0x1f, IORESOURCE_BUSY },
-	{ "pic1", 0x20, 0x3f, IORESOURCE_BUSY },
 	{ "timer", 0x40, 0x5f, IORESOURCE_BUSY },
 	{ "dma page reg", 0x80, 0x8f, IORESOURCE_BUSY },
-	{ "pic2", 0xa0, 0xbf, IORESOURCE_BUSY },
 	{ "dma2", 0xc0, 0xdf, IORESOURCE_BUSY },
 };
 
 #define STANDARD_IO_RESOURCES (sizeof(standard_io_resources)/sizeof(struct resource))
 
-static void __init malta_irq_setup(void)
-{
-  	maltaint_init();
-
-#ifdef CONFIG_REMOTE_DEBUG
-	if (remote_debug) {
-		set_debug_traps();
-		breakpoint(); 
-	}
-#endif
-}
-
-
 void __init malta_setup(void)
 {
 #ifdef CONFIG_REMOTE_DEBUG
 	int rs_putDebugChar(char);
 	char rs_getDebugChar(void);
-	extern int (*putDebugChar)(char);
-	extern char (*getDebugChar)(void);
+	extern int (*generic_putDebugChar)(char);
+	extern char (*generic_getDebugChar)(void);
 #endif
 	char *argptr;
 	int i;
 
-	irq_setup = malta_irq_setup;
-
 	/* Request I/O space for devices used on the Malta board. */
 	for (i = 0; i < STANDARD_IO_RESOURCES; i++)
 		request_resource(&ioport_resource, standard_io_resources+i);
@@ -133,14 +106,14 @@
 		       line ? 1 : 0);
 
 		rs_kgdb_hook(line);
-		putDebugChar = rs_putDebugChar;
-		getDebugChar = rs_getDebugChar;
+		generic_putDebugChar = rs_putDebugChar;
+		generic_getDebugChar = rs_getDebugChar;
 
 		prom_printf("KGDB: Using serial line /dev/ttyS%d for session, "
 			    "please connect your debugger\n", line ? 1 : 0);
 
 		remote_debug = 1;
-		/* Breakpoints and stuff are in malta_irq_setup() */
+		/* Breakpoints are in init_IRQ() */
 	}
 #endif
 
@@ -154,6 +127,9 @@
 #endif
 #ifdef CONFIG_BLK_DEV_FD
         fd_ops = &std_fd_ops;
+#endif
+#ifdef CONFIG_PC_KEYB
+	kbd_ops = &std_kbd_ops;
 #endif
 	mips_reboot_setup();
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mm/Makefile linux/arch/mips/mm/Makefile
--- v2.4.9/linux/arch/mips/mm/Makefile	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips/mm/Makefile	Sun Sep  9 10:43:02 2001
@@ -15,11 +15,13 @@
 obj-$(CONFIG_CPU_R3000)		+= r2300.o
 obj-$(CONFIG_CPU_R4300)		+= r4xx0.o
 obj-$(CONFIG_CPU_R4X00)		+= r4xx0.o
+obj-$(CONFIG_CPU_VR41XX)	+= r4xx0.o
 obj-$(CONFIG_CPU_R5000)		+= r4xx0.o
 obj-$(CONFIG_CPU_NEVADA)	+= r4xx0.o
 obj-$(CONFIG_CPU_R5432)		+= r5432.o
 obj-$(CONFIG_CPU_RM7000)	+= rm7k.o
 obj-$(CONFIG_CPU_MIPS32)	+= mips32.o
+obj-$(CONFIG_CPU_MIPS64)	+= mips32.o
 obj-$(CONFIG_SGI_IP22)		+= umap.o
 obj-$(CONFIG_BAGET_MIPS)	+= umap.o
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mm/andes.c linux/arch/mips/mm/andes.c
--- v2.4.9/linux/arch/mips/mm/andes.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips/mm/andes.c	Sun Sep  9 10:43:02 2001
@@ -132,7 +132,8 @@
 
 static void andes_flush_cache_sigtramp(unsigned long page)
 {
-	/* XXX */
+	protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
+	protected_flush_icache_line(addr & ~(ic_lsize - 1));
 }
 
 /* TLB operations. XXX Write these dave... */
@@ -182,6 +183,14 @@
 	_flush_icache_page = andes_flush_icache_page;
 	_flush_icache_range = andes_flush_icache_range;
 
+	write_32bit_cp0_register(CP0_FRAMEMASK, 0);
+
 	flush_cache_all();
 	flush_tlb_all();
+
+	/*
+	 * The R10k might even work for Linux/MIPS - but we're paranoid
+	 * and refuse to run until this is tested on real silicon
+	 */
+	panic("CPU too expensive - making holiday in the ANDES!");
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mm/loadmmu.c linux/arch/mips/mm/loadmmu.c
--- v2.4.9/linux/arch/mips/mm/loadmmu.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips/mm/loadmmu.c	Sun Sep  9 10:43:02 2001
@@ -52,8 +52,9 @@
 {
 
 	if (mips_cpu.options & MIPS_CPU_4KTLB) {
-#if defined(CONFIG_CPU_R4X00) || defined(CONFIG_CPU_R4300) || \
-    defined(CONFIG_CPU_R5000) || defined(CONFIG_CPU_NEVADA)
+#if defined(CONFIG_CPU_R4X00) || defined(CONFIG_CPU_VR41XX) || \
+    defined(CONFIG_CPU_R4300) || defined(CONFIG_CPU_R5000) || \
+    defined(CONFIG_CPU_NEVADA)
 		printk("Loading R4000 MMU routines.\n");
 		ld_mmu_r4xx0();
 #endif
@@ -66,7 +67,7 @@
 		ld_mmu_r5432();
 #endif
 
-#if defined(CONFIG_CPU_MIPS32)
+#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
 		printk("Loading MIPS32 MMU routines.\n");
 		ld_mmu_mips32();
 #endif
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mm/mips32.c linux/arch/mips/mm/mips32.c
--- v2.4.9/linux/arch/mips/mm/mips32.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips/mm/mips32.c	Sun Sep  9 10:43:02 2001
@@ -69,10 +69,8 @@
 {
 	unsigned long i;
 
-        if (mips_cpu.options & MIPS_CPU_CACHE_CDEX)
-	{
-	        for (i=page; i<page+PAGE_SIZE; i+=dc_lsize)
-		{
+        if (mips_cpu.options & MIPS_CPU_CACHE_CDEX) {
+	        for (i=page; i<page+PAGE_SIZE; i+=dc_lsize) {
 		        __asm__ __volatile__(
 			        ".set\tnoreorder\n\t"
 				".set\tnoat\n\t"
@@ -94,10 +92,8 @@
 {
 	unsigned long i;
 
-        if (mips_cpu.options & MIPS_CPU_CACHE_CDEX)
-	{
-	        for (i=page; i<page+PAGE_SIZE; i+=sc_lsize)
-		{
+        if (mips_cpu.options & MIPS_CPU_CACHE_CDEX) {
+	        for (i=page; i<page+PAGE_SIZE; i+=sc_lsize) {
 		        __asm__ __volatile__(
 				".set\tnoreorder\n\t"
 				".set\tnoat\n\t"
@@ -119,10 +115,8 @@
 {
 	unsigned long i;
 
-        if (mips_cpu.options & MIPS_CPU_CACHE_CDEX)
-	{
-	        for (i=to; i<to+PAGE_SIZE; i+=dc_lsize)
-		{
+        if (mips_cpu.options & MIPS_CPU_CACHE_CDEX) {
+	        for (i=to; i<to+PAGE_SIZE; i+=dc_lsize) {
 		        __asm__ __volatile__(
 			        ".set\tnoreorder\n\t"
 				".set\tnoat\n\t"
@@ -144,10 +138,8 @@
 {
 	unsigned long i;
 
-        if (mips_cpu.options & MIPS_CPU_CACHE_CDEX)
-	{
-	        for (i=to; i<to+PAGE_SIZE; i+=sc_lsize)
-		{
+        if (mips_cpu.options & MIPS_CPU_CACHE_CDEX) {
+	        for (i=to; i<to+PAGE_SIZE; i+=sc_lsize) {
 		        __asm__ __volatile__(
 				".set\tnoreorder\n\t"
 				".set\tnoat\n\t"
@@ -514,14 +506,8 @@
  */
 static void mips32_flush_cache_sigtramp(unsigned long addr)
 {
-	unsigned long daddr, iaddr;
-
-	daddr = addr & ~(dc_lsize - 1);
-	protected_writeback_dcache_line(daddr);
-	protected_writeback_dcache_line(daddr + dc_lsize);
-	iaddr = addr & ~(ic_lsize - 1);
-	protected_flush_icache_line(iaddr);
-	protected_flush_icache_line(iaddr + ic_lsize);
+	protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
+	protected_flush_icache_line(addr & ~(ic_lsize - 1));
 }
 
 #undef DEBUG_TLB
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mm/r2300.c linux/arch/mips/mm/r2300.c
--- v2.4.9/linux/arch/mips/mm/r2300.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips/mm/r2300.c	Sun Sep  9 10:43:02 2001
@@ -33,7 +33,7 @@
 /* For R3000 cores with R4000 style caches */
 static unsigned long icache_size, dcache_size;		/* Size in bytes */
 static unsigned long icache_lsize, dcache_lsize;	/* Size in bytes */
-static unsigned long scache_size = 0;
+static unsigned long scache_size;
 
 #include <asm/cacheops.h>
 #include <asm/r4kcache.h>
@@ -134,31 +134,64 @@
 	dummy = *p;
 	status = read_32bit_cp0_register(CP0_STATUS);
 
-	if (dummy != 0xa5a55a5a || (status & (1<<19))) {
+	if (dummy != 0xa5a55a5a || (status & ST0_CM)) {
 		size = 0;
 	} else {
-		for (size = 512; size <= 0x40000; size <<= 1)
+		for (size = 128; size <= 0x40000; size <<= 1)
 			*(p + size) = 0;
 		*p = -1;
-		for (size = 512; 
+		for (size = 128; 
 		     (size <= 0x40000) && (*(p + size) == 0); 
 		     size <<= 1)
 			;
 		if (size > 0x40000)
 			size = 0;
 	}
+
 	write_32bit_cp0_register(CP0_STATUS, flags);
 
 	return size * sizeof(*p);
 }
 
+unsigned long __init r3k_cache_lsize(unsigned long ca_flags)
+{
+	unsigned long flags, status, lsize, i, j;
+	volatile unsigned long *p;
+
+	p = (volatile unsigned long *) KSEG0;
+
+	flags = read_32bit_cp0_register(CP0_STATUS);
+
+	/* isolate cache space */
+	write_32bit_cp0_register(CP0_STATUS, (ca_flags|flags)&~ST0_IEC);
+
+	for (i = 0; i < 128; i++)
+		*(p + i) = 0;
+	*(volatile unsigned char *)p = 0;
+	for (lsize = 1; lsize < 128; lsize <<= 1) {
+		*(p + lsize);
+		status = read_32bit_cp0_register(CP0_STATUS);
+		if (!(status & ST0_CM))
+			break;
+	}
+	for (i = 0; i < 128; i += lsize)
+		*(volatile unsigned char *)(p + i) = 0;
+
+	write_32bit_cp0_register(CP0_STATUS, flags);
+
+	return lsize * sizeof(*p);
+}
+
 static void __init r3k_probe_cache(void)
 {
 	dcache_size = r3k_cache_size(ST0_ISC);
-	dcache_lsize = 4;
+	if (dcache_size)
+		dcache_lsize = r3k_cache_lsize(ST0_ISC);
+	
 
 	icache_size = r3k_cache_size(ST0_ISC|ST0_SWC);
-	icache_lsize = 4;
+	if (icache_size)
+		icache_lsize = r3k_cache_lsize(ST0_ISC|ST0_SWC);
 }
 
 static void r3k_flush_icache_range(unsigned long start, unsigned long end)
@@ -391,11 +424,17 @@
 
 	flags = read_32bit_cp0_register(CP0_STATUS);
 
+	write_32bit_cp0_register(CP0_STATUS, flags&~ST0_IEC);
+
+	/* Fill the TLB to avoid an exception with caches isolated. */
+	asm ( 	"lw\t$0,0x000(%0)\n\t"
+		"lw\t$0,0x004(%0)\n\t"
+		: : "r" (addr) );
+
 	write_32bit_cp0_register(CP0_STATUS, (ST0_ISC|ST0_SWC|flags)&~ST0_IEC);
 
 	asm ( 	"sb\t$0,0x000(%0)\n\t"
 		"sb\t$0,0x004(%0)\n\t"
-		"sb\t$0,0x008(%0)\n\t"
 		: : "r" (addr) );
 
 	write_32bit_cp0_register(CP0_STATUS, flags);
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mm/r4xx0.c linux/arch/mips/mm/r4xx0.c
--- v2.4.9/linux/arch/mips/mm/r4xx0.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips/mm/r4xx0.c	Sun Sep  9 10:43:02 2001
@@ -2088,43 +2088,29 @@
  */
 static void r4k_flush_cache_sigtramp(unsigned long addr)
 {
-	unsigned long daddr, iaddr;
-
-	daddr = addr & ~(dc_lsize - 1);
 	__asm__ __volatile__("nop;nop;nop;nop");	/* R4600 V1.7 */
-	protected_writeback_dcache_line(daddr);
-	protected_writeback_dcache_line(daddr + dc_lsize);
-	iaddr = addr & ~(ic_lsize - 1);
-	protected_flush_icache_line(iaddr);
-	protected_flush_icache_line(iaddr + ic_lsize);
+	protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
+	protected_flush_icache_line(addr & ~(ic_lsize - 1));
 }
 
 static void r4600v20k_flush_cache_sigtramp(unsigned long addr)
 {
-	unsigned long daddr, iaddr;
 	unsigned int flags;
 
-	daddr = addr & ~(dc_lsize - 1);
 	__save_and_cli(flags);
 
 	/* Clear internal cache refill buffer */
 	*(volatile unsigned int *)KSEG1;
 
-	protected_writeback_dcache_line(daddr);
-	protected_writeback_dcache_line(daddr + dc_lsize);
-	iaddr = addr & ~(ic_lsize - 1);
-	protected_flush_icache_line(iaddr);
-	protected_flush_icache_line(iaddr + ic_lsize);
+	protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
+	protected_flush_icache_line(addr & ~(ic_lsize - 1));
+
 	__restore_flags(flags);
 }
 
 #undef DEBUG_TLB
 #undef DEBUG_TLBUPDATE
 
-#define NTLB_ENTRIES       48  /* Fixed on all R4XX0 variants... */
-
-#define NTLB_ENTRIES_HALF  24  /* Fixed on all R4XX0 variants... */
-
 void flush_tlb_all(void)
 {
 	unsigned long flags;
@@ -2146,7 +2132,7 @@
 	entry = get_wired();
 
 	/* Blast 'em all away. */
-	while(entry < NTLB_ENTRIES) {
+	while(entry < mips_cpu.tlbsize) {
 		set_index(entry);
 		BARRIER;
 		tlb_write_indexed();
@@ -2188,7 +2174,7 @@
 		__save_and_cli(flags);
 		size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
 		size = (size + 1) >> 1;
-		if(size <= NTLB_ENTRIES_HALF) {
+		if(size <= mips_cpu.tlbsize/2) {
 			int oldpid = (get_entryhi() & 0xff);
 			int newpid = (mm->context & 0xff);
 
@@ -2416,7 +2402,14 @@
 /* Detect and size the various r4k caches. */
 static void __init probe_icache(unsigned long config)
 {
-	icache_size = 1 << (12 + ((config >> 9) & 7));
+        switch (mips_cpu.cputype) {
+        case CPU_VR41XX:
+                icache_size = 1 << (10 + ((config >> 9) & 7));
+                break;
+        default:
+                icache_size = 1 << (12 + ((config >> 9) & 7));
+                break;
+        }
 	ic_lsize = 16 << ((config >> 5) & 1);
 
 	printk("Primary instruction cache %dkb, linesize %d bytes.\n",
@@ -2425,7 +2418,14 @@
 
 static void __init probe_dcache(unsigned long config)
 {
-	dcache_size = 1 << (12 + ((config >> 6) & 7));
+        switch (mips_cpu.cputype) {
+        case CPU_VR41XX:
+                dcache_size = 1 << (10 + ((config >> 6) & 7));
+                break;
+        default:
+                dcache_size = 1 << (12 + ((config >> 6) & 7));
+                break;
+        }
 	dc_lsize = 16 << ((config >> 4) & 1);
 
 	printk("Primary data cache %dkb, linesize %d bytes.\n",
@@ -2708,6 +2708,6 @@
 	 *   - The entire mm handling assumes the c0_pagemask register to
 	 *     be set for 4kb pages.
 	 */
-	write_32bit_cp0_register(CP0_PAGEMASK, PM_4K);
+	set_pagemask(PM_4K);
 	flush_tlb_all();
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/mm/r5432.c linux/arch/mips/mm/r5432.c
--- v2.4.9/linux/arch/mips/mm/r5432.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips/mm/r5432.c	Sun Sep  9 10:43:02 2001
@@ -531,14 +531,8 @@
  */
 static void r5432_flush_cache_sigtramp(unsigned long addr)
 {
-	unsigned long daddr, iaddr;
-
-	daddr = addr & ~(dc_lsize - 1);
-	protected_writeback_dcache_line(daddr);
-	protected_writeback_dcache_line(daddr + dc_lsize);
-	iaddr = addr & ~(ic_lsize - 1);
-	protected_flush_icache_line(iaddr);
-	protected_flush_icache_line(iaddr + ic_lsize);
+	protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
+	protected_flush_icache_line(addr & ~(ic_lsize - 1));
 }
 
 #undef DEBUG_TLB
diff -u --recursive --new-file v2.4.9/linux/arch/mips/philips/nino/Makefile linux/arch/mips/philips/nino/Makefile
--- v2.4.9/linux/arch/mips/philips/nino/Makefile	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/philips/nino/Makefile	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,33 @@
+#
+# Makefile for the Philips Nino specific parts of the kernel
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+
+.S.s:
+	$(CPP) $(AFLAGS) $< -o $@
+.S.o:
+	$(CC) $(AFLAGS) -c $< -o $@
+
+O_TARGET := nino.o
+
+all: nino.o
+
+obj-y	 := int-handler.o setup.o irq.o time.o reset.o rtc.o prom.o power.o
+
+int-handler.o: int-handler.S
+
+obj-$(CONFIG_REMOTE_DEBUG)	+= kgdb.o
+
+obj-$(CONFIG_BLK_DEV_INITRD)	+= ramdisk.o
+
+ramdisk.o:
+		$(MAKE) -C ramdisk
+		mv ramdisk/ramdisk.o ramdisk.o
+
+clean:
+		rm -f *.o
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/mips/philips/nino/int-handler.S linux/arch/mips/philips/nino/int-handler.S
--- v2.4.9/linux/arch/mips/philips/nino/int-handler.S	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/philips/nino/int-handler.S	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,137 @@
+/*
+ *  linux/arch/mips/philips/nino/int-handler.S
+ *
+ *  Copyright (C) 1999 Harald Koerfgen
+ *  Copyright (C) 2000 Jim Pick (jim@jimpick.com)
+ *  Copyright (C) 2001 Steven J. Hill (sjhill@realitydiluted.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  Interrupt handler for Philips Nino.
+ */
+#include <asm/asm.h>
+#include <asm/regdef.h>
+#include <asm/mipsregs.h>
+#include <asm/stackframe.h>
+#include <asm/tx3912.h>
+
+		.data
+	        .globl  HighPriVect
+
+HighPriVect:	.word   spurious        # Reserved
+	        .word   io_posnegint0   # IOPOSINT(0) or IONEGINT(0)
+	        .word   spurious        # CHIDMACNTINT
+	        .word   spurious        # TELDMACNTINT
+	        .word   spurious        # SNDDMACNTINT
+	        .word   spurious        # Reserved
+	        .word   io_negint56     # IONEGINT(6) or IONEGINT(5)
+	        .word   spurious        # Reserved
+	        .word   io_posint56     # IOPOSINT(6) or IOPOSINT(5)
+	        .word   spurious        # Reserved
+	        .word   spurious        # UARTBRXINT
+	        .word   uarta_rx        # UARTARXINT
+	        .word   spurious        # Reserved
+	        .word   periodic_timer  # PERINT
+	        .word   spurious        # ALARMINT
+	        .word   spurious        # POSPWROKINT or NEGPWROKINT
+
+/*
+ *  Here is the entry point to handle all interrupts.
+ */
+		.text
+		.set	noreorder
+		.align	5
+		NESTED(nino_handle_int, PT_SIZE, ra)
+		.set	noat
+		SAVE_ALL
+		CLI
+		.set	at
+	
+		/*
+		 * Get pending Interrupts
+		 */
+		mfc0	t0, CP0_CAUSE		# Get pending interrupts
+		andi	t2, t0, IE_IRQ4		# IRQ4 (high priority)
+		bne	t2, IE_IRQ4, low_priority
+		nop
+
+/*
+ *  Ok, we've got a high priority interrupt (a.k.a. an external interrupt).
+ *  Read Interrupt Status Register 6 to get vector.
+ */
+high_priority:
+		lui	t0, %hi(IntStatus6)
+		lw	t1, %lo(IntStatus6)(t0)
+		andi	t1, INT6_INTVECT
+		la	t2, HighPriVect
+		addu	t1, t1, t2
+		lw	t2, 0(t1)
+		jr	t2
+		nop
+
+/*
+ * Ok, we've got one of over a hundred other interupts.
+ */
+low_priority:
+		lui	t0, %hi(IntStatus1)
+		lw	t1, %lo(IntStatus1)(t0)
+		j	handle_it
+		li	a0, 20
+
+/*
+ * We don't currently handle spurious interrupts.
+ */
+spurious:	
+		j	spurious_interrupt
+		nop
+
+/*
+ * We have the IRQ number, dispatch to the real handler.
+ */
+handle_it:	jal	do_IRQ
+		move	a1,sp
+		j	ret_from_irq
+		nop
+
+/************************************
+ * High priority interrupt mappings *
+ ************************************/
+		
+/* 
+ *  Periodic timer - IRQ 0
+ */
+periodic_timer:
+		j	handle_it
+		li	a0, 0
+
+/* 
+ *  UARTA RX - IRQ 3
+ */
+uarta_rx:
+		j	handle_it
+		li	a0, 3
+
+/* 
+ *  GPIO Pin 0 transition - IRQ 10
+ */
+io_posnegint0:
+		j	handle_it
+		li	a0, 10
+
+/* 
+ *  GPIO Pin 5 or 6 transition (0-to-1) - IRQ 11
+ */
+io_posint56:
+		j	handle_it
+		li	a0, 11
+
+/*
+ *  GPIO Pin 5 or 6 transition (1-to-0) - IRQ 12
+ */
+io_negint56:
+		j	handle_it
+		li	a0, 12
+
+		END(nino_handle_int)
diff -u --recursive --new-file v2.4.9/linux/arch/mips/philips/nino/irq.c linux/arch/mips/philips/nino/irq.c
--- v2.4.9/linux/arch/mips/philips/nino/irq.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/philips/nino/irq.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,314 @@
+/*
+ *  linux/arch/mips/philips/nino/irq.c
+ *
+ *  Copyright (C) 1992 Linus Torvalds
+ *  Copyright (C) 1999 Harald Koerfgen
+ *  Copyright (C) 2000 Pavel Machek (pavel@suse.cz)
+ *  Copyright (C) 2001 Steven J. Hill (sjhill@realitydiluted.com)
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *  
+ *  Generic interrupt handler for Philips Nino.
+ */
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/kernel_stat.h>
+#include <linux/signal.h>
+#include <linux/sched.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/timex.h>
+#include <linux/slab.h>
+#include <linux/random.h>
+
+#include <asm/bitops.h>
+#include <asm/bootinfo.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mipsregs.h>
+#include <asm/system.h>
+#include <asm/tx3912.h>
+
+unsigned long spurious_count = 0;
+
+irq_cpustat_t irq_stat [NR_CPUS];
+
+static inline void mask_irq(unsigned int irq_nr)
+{
+	switch (irq_nr) {
+	case 0:  /* Periodic Timer Interrupt */ 
+		IntClear5 = INT5_PERIODICINT;
+		IntClear6 = INT6_PERIODICINT;
+		IntEnable6 &= ~INT6_PERIODICINT;
+		break;
+
+	case 3:
+		/* Serial port receive interrupt */
+		break;
+
+	case 2:
+		/* Serial port transmit interrupt */
+		break;
+
+	default:
+		printk( "Attempt to mask unknown IRQ %d?\n", irq_nr );
+	}
+}
+
+static inline void unmask_irq(unsigned int irq_nr)
+{
+	switch (irq_nr) {
+	case 0:
+		IntEnable6 |= INT6_PERIODICINT;
+		break;
+
+	case 3:
+		/* Serial port receive interrupt */
+		break;
+
+	case 2:
+		/* Serial port transmit interrupt */
+		break;
+
+	default:
+		printk( "Attempt to unmask unknown IRQ %d?\n", irq_nr );
+	}
+}
+
+void disable_irq(unsigned int irq_nr)
+{
+    unsigned long flags;
+
+    save_and_cli(flags);
+    mask_irq(irq_nr);
+    restore_flags(flags);
+}
+
+void enable_irq(unsigned int irq_nr)
+{
+    unsigned long flags;
+
+    save_and_cli(flags);
+    unmask_irq(irq_nr);
+    restore_flags(flags);
+}
+
+/*
+ * Pointers to the low-level handlers: first the general ones, then the
+ * fast ones, then the bad ones.
+ */
+extern void interrupt(void);
+
+static struct irqaction *irq_action[NR_IRQS] =
+{
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+};
+
+int get_irq_list(char *buf)
+{
+    int i, len = 0;
+    struct irqaction *action;
+
+    for (i = 0; i < NR_IRQS; i++) {
+	action = irq_action[i];
+	if (!action)
+	    continue;
+	len += sprintf(buf + len, "%2d: %8d %c %s",
+		       i, kstat.irqs[0][i],
+		       (action->flags & SA_INTERRUPT) ? '+' : ' ',
+		       action->name);
+	for (action = action->next; action; action = action->next) {
+	    len += sprintf(buf + len, ",%s %s",
+			   (action->flags & SA_INTERRUPT) ? " +" : "",
+			   action->name);
+	}
+	len += sprintf(buf + len, "\n");
+    }
+    return len;
+}
+
+atomic_t __mips_bh_counter;
+
+/*
+ * do_IRQ handles IRQ's that have been installed without the
+ * SA_INTERRUPT flag: it uses the full signal-handling return
+ * and runs with other interrupts enabled. All relatively slow
+ * IRQ's should use this format: notably the keyboard/timer
+ * routines.
+ */
+asmlinkage void do_IRQ(int irq, struct pt_regs *regs)
+{
+    struct irqaction *action;
+    int do_random, cpu;
+
+    if (irq == 20) {
+        if (IntStatus2 & 0xfffff00) {
+		if (IntStatus2 & 0x0f000000)
+		return do_IRQ(2, regs);
+	}
+    }
+
+    cpu = smp_processor_id();
+    irq_enter(cpu, irq);
+    kstat.irqs[cpu][irq]++;
+
+    if (irq == 20) {
+            printk("20 %08lx %08lx\n   %08lx %08lx\n   %08lx\n",
+                   IntStatus1, IntStatus2, IntStatus3,
+                   IntStatus4, IntStatus5 );
+            printk("20 %08lx %08lx\n   %08lx %08lx\n   %08lx\n",
+                   IntEnable1, IntEnable2, IntEnable3,
+                   IntEnable4, IntEnable5 );
+
+    }
+
+    mask_irq(irq);
+    action = *(irq + irq_action);
+    if (action) {
+	if (!(action->flags & SA_INTERRUPT))
+	    __sti();
+	do_random = 0;
+	do {
+	    do_random |= action->flags;
+	    action->handler(irq, action->dev_id, regs);
+	    action = action->next;
+	} while (action);
+	if (do_random & SA_SAMPLE_RANDOM)
+	    add_interrupt_randomness(irq);
+	unmask_irq(irq);
+	__cli();
+    } else {
+            IntClear1 = ~0;
+            IntClear3 = ~0;
+	    IntClear4 = ~0;
+	    IntClear5 = ~0;
+	    unmask_irq(irq);
+    }
+    irq_exit(cpu, irq);
+
+    /* unmasking and bottom half handling is done magically for us. */
+}
+
+/*
+ * Idea is to put all interrupts
+ * in a single table and differenciate them just by number.
+ */
+int setup_nino_irq(int irq, struct irqaction *new)
+{
+    int shared = 0;
+    struct irqaction *old, **p;
+    unsigned long flags;
+
+    p = irq_action + irq;
+    if ((old = *p) != NULL) {
+	/* Can't share interrupts unless both agree to */
+	if (!(old->flags & new->flags & SA_SHIRQ))
+	    return -EBUSY;
+
+	/* Can't share interrupts unless both are same type */
+	if ((old->flags ^ new->flags) & SA_INTERRUPT)
+	    return -EBUSY;
+
+	/* add new interrupt at end of irq queue */
+	do {
+	    p = &old->next;
+	    old = *p;
+	} while (old);
+	shared = 1;
+    }
+    if (new->flags & SA_SAMPLE_RANDOM)
+	rand_initialize_irq(irq);
+
+    save_and_cli(flags);
+    *p = new;
+
+    if (!shared) {
+	unmask_irq(irq);
+    }
+    restore_flags(flags);
+    return 0;
+}
+
+int request_irq(unsigned int irq,
+		void (*handler) (int, void *, struct pt_regs *),
+		unsigned long irqflags,
+		const char *devname,
+		void *dev_id)
+{
+    int retval;
+    struct irqaction *action;
+
+    if (irq >= NR_IRQS)
+	return -EINVAL;
+    if (!handler)
+	return -EINVAL;
+
+    action = (struct irqaction *) kmalloc(sizeof(struct irqaction), GFP_KERNEL);
+    if (!action)
+	return -ENOMEM;
+
+    action->handler = handler;
+    action->flags = irqflags;
+    action->mask = 0;
+    action->name = devname;
+    action->next = NULL;
+    action->dev_id = dev_id;
+
+    retval = setup_nino_irq(irq, action);
+
+    if (retval)
+	kfree(action);
+    return retval;
+}
+
+void free_irq(unsigned int irq, void *dev_id)
+{
+    struct irqaction *action, **p;
+    unsigned long flags;
+
+    if (irq >= NR_IRQS) {
+	printk(KERN_CRIT __FUNCTION__ ": trying to free IRQ%d\n", irq);
+	return;
+    }
+    for (p = irq + irq_action; (action = *p) != NULL; p = &action->next) {
+	if (action->dev_id != dev_id)
+	    continue;
+
+	/* Found it - now free it */
+	save_and_cli(flags);
+	*p = action->next;
+	if (!irq[irq_action])
+	    mask_irq(irq);
+	restore_flags(flags);
+	kfree(action);
+	return;
+    }
+    printk(KERN_CRIT __FUNCTION__ ": trying to free free IRQ%d\n", irq);
+}
+
+unsigned long probe_irq_on(void)
+{
+    /* TODO */
+    return 0;
+}
+
+int probe_irq_off(unsigned long irqs)
+{
+    /* TODO */
+    return 0;
+}
+
+void __init init_IRQ(void)
+{
+    irq_setup();
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/philips/nino/kgdb.c linux/arch/mips/philips/nino/kgdb.c
--- v2.4.9/linux/arch/mips/philips/nino/kgdb.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/philips/nino/kgdb.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,83 @@
+/*
+ *  linux/arch/mips/philips/nino/kgdb.c
+ *
+ *  Copyright (C) 2001 Steven J. Hill (sjhill@realitydiluted.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  Kernel debugging on the Philips Nino.
+ */
+#include <asm/system.h>
+#include <asm/tx3912.h>
+
+static int remoteDebugInitialized = 0;
+
+void debugInit(void)
+{
+/*
+ * If low-level debugging (before GDB or console operational) is
+ * configured, then we do not need to re-initialize the UART.
+ */
+#ifndef CONFIG_DEBUG_LL
+	earlyInitUartPR31700();
+#endif
+}
+
+char getDebugChar(void)
+{
+	char buf;
+	unsigned long int2, flags;
+
+	if (!remoteDebugInitialized) {
+		debugInit();
+		remoteDebugInitialized = 1;
+	}
+
+	save_and_cli(flags);
+
+	int2 = IntEnable2;
+
+	IntEnable2 = 0;
+
+	while(!(UartA_Ctrl1 & UART_RX_HOLD_FULL));
+
+	buf = UartA_Data;
+
+	IntEnable2 = int2;
+
+	restore_flags(flags);
+
+	return buf;	
+}
+
+int putDebugChar(char c)
+{
+	int i;
+	unsigned long int2;
+
+	if (!remoteDebugInitialized) {
+		debugInit();
+		remoteDebugInitialized = 1;
+	}
+
+	int2 = IntEnable2;
+
+	IntEnable2 &=
+		~(INT2_UARTATXINT | INT2_UARTATXOVERRUN | INT2_UARTAEMPTY);
+
+	for (i = 0; !(IntStatus2 & INT2_UARTATXINT) && (i < 10000); i++);
+
+	IntClear2 = INT2_UARTATXINT | INT2_UARTATXOVERRUN | INT2_UARTAEMPTY;
+
+	UartA_Data = c;
+
+	for (i = 0; !(IntStatus2 & INT2_UARTATXINT) && (i < 10000); i++);
+
+	IntClear2 = INT2_UARTATXINT | INT2_UARTATXOVERRUN | INT2_UARTAEMPTY;
+
+	IntEnable2 = int2;
+
+	return 1;
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/philips/nino/power.c linux/arch/mips/philips/nino/power.c
--- v2.4.9/linux/arch/mips/philips/nino/power.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/philips/nino/power.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,36 @@
+/*
+ *  linux/arch/mips/philips/nino/power.c
+ *
+ *  Copyright (C) 2000 Jim Pick <jim@jimpick.com>
+ *  Copyright (C) 2001 Steven J. Hill (sjhill@realitydiluted.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  Power management routines on the Philips Nino.
+ */
+#include <asm/tx3912.h>
+
+void nino_wait(void)
+{
+	/* We stop the CPU to conserve power */
+	PowerControl |= PWR_STOPCPU;
+
+	/* 
+	 * We wait until an interrupt happens...
+	 */
+
+	/* We resume here */
+	PowerControl &= ~PWR_STOPCPU;
+
+	/* Give ourselves a little delay */
+	__asm__ __volatile__(
+		"nop\n\t"
+		"nop\n\t"
+		"nop\n\t"
+		"nop\n\t"
+		"nop\n\t"
+		"nop\n\t"
+		"nop\n\t");
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/philips/nino/prom.c linux/arch/mips/philips/nino/prom.c
--- v2.4.9/linux/arch/mips/philips/nino/prom.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/philips/nino/prom.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,80 @@
+/*
+ *  linux/arch/mips/philips/nino/prom.c
+ *
+ *  Copyright (C) 2001 Steven J. Hill (sjhill@realitydiluted.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *  
+ *  Early initialization code for the Philips Nino.
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <asm/bootinfo.h>
+#include <asm/addrspace.h>
+#include <asm/page.h>
+
+char arcs_cmdline[COMMAND_LINE_SIZE];
+
+#ifdef CONFIG_FB_TX3912
+extern u_long tx3912fb_paddr;
+extern u_long tx3912fb_vaddr;
+extern u_long tx3912fb_size;
+#endif
+
+/* Do basic initialization */
+void __init prom_init(int argc, char **argv,
+		unsigned long magic, int *prom_vec)
+{
+	u_long free_end, mem_size;
+	u_int i;
+
+	/*
+	 * collect args and prepare cmd_line
+	 */
+	for (i = 1; i < argc; i++) {
+		strcat(arcs_cmdline, argv[i]);
+		if (i < (argc - 1))
+			strcat(arcs_cmdline, " ");
+	}
+
+	mips_machgroup = MACH_GROUP_PHILIPS;
+	mips_machtype = MACH_PHILIPS_NINO;
+
+#ifdef CONFIG_NINO_4MB
+	mem_size = 4 << 20;
+#elif CONFIG_NINO_8MB
+	mem_size = 8 << 20;
+#elif CONFIG_NINO_16MB
+	mem_size = 16 << 20;
+#endif
+
+#ifdef CONFIG_FB_TX3912
+	/*
+	 * The LCD controller requires that the framebuffer
+	 * start address fall within a 1MB segment and is
+	 * aligned on a 16 byte boundary. The way to assure
+	 * this is to place the framebuffer at the end of
+	 * memory and mark it as reserved.
+	 */
+	free_end = (mem_size - tx3912fb_size) & PAGE_MASK;
+	add_memory_region(0, free_end, BOOT_MEM_RAM); 
+	add_memory_region(free_end, (mem_size - free_end), BOOT_MEM_RESERVED); 
+
+	/*
+	 * Calculate physical and virtual addresses for
+	 * the beginning of the framebuffer.
+	 */
+	tx3912fb_paddr = PHYSADDR(free_end);
+	tx3912fb_vaddr = KSEG1ADDR(free_end);
+#else
+	add_memory_region(0, mem_size, BOOT_MEM_RAM); 
+#endif
+}
+
+void __init prom_free_prom_memory (void)
+{
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/philips/nino/ramdisk/Makefile linux/arch/mips/philips/nino/ramdisk/Makefile
--- v2.4.9/linux/arch/mips/philips/nino/ramdisk/Makefile	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/philips/nino/ramdisk/Makefile	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,12 @@
+#
+# Makefile for the Philips Nino ramdisk
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+
+ramdisk.o: ramdisk.gz ld.script
+	$(LD) -T ld.script -b binary -o $@ ramdisk.gz
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/mips/philips/nino/ramdisk/ld.script linux/arch/mips/philips/nino/ramdisk/ld.script
--- v2.4.9/linux/arch/mips/philips/nino/ramdisk/ld.script	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/philips/nino/ramdisk/ld.script	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,9 @@
+OUTPUT_FORMAT("ecoff-littlemips")
+OUTPUT_ARCH(mips)
+SECTIONS
+{
+  .initrd :
+  {
+        *(.data)
+  }
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/philips/nino/reset.c linux/arch/mips/philips/nino/reset.c
--- v2.4.9/linux/arch/mips/philips/nino/reset.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/philips/nino/reset.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,37 @@
+/*
+ *  linux/arch/mips/philips/nino/reset.c
+ *
+ *  Copyright (C) 2001 Steven J. Hill (sjhill@realitydiluted.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  Generic restart, halt and power off functions for Philips Nino.
+ */
+#include <linux/init.h>
+#include <asm/reboot.h>
+
+void (*reset_vector)(void) = (void (*)(void)) 0xBFC00000;
+
+void nino_machine_restart(char *command)
+{
+	reset_vector();
+}
+
+void nino_machine_halt(void)
+{
+	reset_vector();
+}
+
+void nino_machine_power_off(void)
+{
+	reset_vector();
+}
+
+void __init setup_nino_reset_vectors(void)
+{
+	_machine_restart = nino_machine_restart;
+	_machine_halt = nino_machine_halt;
+	_machine_power_off = nino_machine_power_off;
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/philips/nino/rtc.c linux/arch/mips/philips/nino/rtc.c
--- v2.4.9/linux/arch/mips/philips/nino/rtc.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/philips/nino/rtc.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,34 @@
+/*
+ *  linux/arch/mips/philips/nino/rtc.c
+ *
+ *  Copyright (C) 2001 Steven J. Hill (sjhill@realitydiluted.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  Functions to access RTC on the Philips Nino.
+ */
+#include <linux/spinlock.h>
+#include <linux/mc146818rtc.h>
+
+static unsigned char nino_rtc_read_data(unsigned long addr)
+{
+	return 0;
+}
+
+static void nino_rtc_write_data(unsigned char data, unsigned long addr)
+{
+}
+
+static int nino_rtc_bcd_mode(void)
+{
+	return 0;
+}
+
+struct rtc_ops nino_rtc_ops =
+{
+	&nino_rtc_read_data,
+	&nino_rtc_write_data,
+	&nino_rtc_bcd_mode
+};
diff -u --recursive --new-file v2.4.9/linux/arch/mips/philips/nino/setup.c linux/arch/mips/philips/nino/setup.c
--- v2.4.9/linux/arch/mips/philips/nino/setup.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/philips/nino/setup.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,120 @@
+/*
+ *  linux/arch/mips/philips/nino/setup.c
+ *
+ *  Copyright (C) 2001 Steven J. Hill (sjhill@realitydiluted.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  Interrupt and exception initialization for Philips Nino.
+ */
+#include <linux/console.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/mc146818rtc.h>
+#include <linux/sched.h>
+#include <asm/addrspace.h>
+#include <asm/gdb-stub.h>
+#include <asm/irq.h>
+#include <asm/wbflush.h>
+#include <asm/tx3912.h>
+
+extern struct rtc_ops nino_rtc_ops;
+
+extern void nino_wait(void);
+extern void setup_nino_reset_vectors(void);
+extern asmlinkage void nino_handle_int(void);
+extern int setup_nino_irq(int, struct irqaction *);
+void (*board_time_init) (struct irqaction * irq);
+
+#ifdef CONFIG_REMOTE_DEBUG
+extern void set_debug_traps(void);
+extern void breakpoint(void);
+static int remote_debug = 0;
+#endif
+
+static void __init nino_irq_setup(void)
+{
+	unsigned int tmp;
+
+	/* Turn all interrupts off */
+	IntEnable1 = 0;
+	IntEnable2 = 0;
+	IntEnable3 = 0;
+	IntEnable4 = 0;
+	IntEnable5 = 0;
+	IntEnable6 = 0;
+
+	/* Clear all interrupts */
+	IntClear1 = 0xffffffff;
+	IntClear2 = 0xffffffff;
+	IntClear3 = 0xffffffff;
+	IntClear4 = 0xffffffff;
+	IntClear5 = 0xffffffff;
+	IntClear6 = 0xffffffff;
+
+	/*
+	 * Enable only the interrupts for the UART and negative
+	 * edge (1-to-0) triggered multi-function I/O pins.
+	 */
+    	change_cp0_status(ST0_BEV, 0);
+	tmp = read_32bit_cp0_register(CP0_STATUS);
+    	change_cp0_status(ST0_IM, tmp | IE_IRQ2 | IE_IRQ4);
+
+	/* Register the global interrupt handler */
+	set_except_vector(0, nino_handle_int);
+
+#ifdef CONFIG_REMOTE_DEBUG
+	if (remote_debug) {
+		set_debug_traps();
+		breakpoint();
+	}
+#endif
+}
+
+static __init void nino_time_init(struct irqaction *irq)
+{
+	unsigned int scratch = 0;
+
+	/*
+	 * Enable periodic interrupts
+	 */
+	setup_nino_irq(0, irq);
+
+	RTCperiodTimer = PER_TIMER_COUNT;
+	RTCtimerControl = TIM_ENPERTIMER;
+	IntEnable5 |= INT5_PERIODICINT;
+
+	scratch = inl(TX3912_CLK_CTRL_BASE);
+	scratch |= TX3912_CLK_CTRL_ENTIMERCLK;
+	outl(scratch, TX3912_CLK_CTRL_BASE);
+
+	/* Enable all interrupts */
+	IntEnable6 |= INT6_GLOBALEN | INT6_PERIODICINT;
+}
+
+void __init nino_setup(void)
+{
+	irq_setup = nino_irq_setup;
+
+	board_time_init = nino_time_init;
+
+	/* Base address to use for PC type I/O accesses */
+	mips_io_port_base = KSEG1ADDR(0xB0C00000);
+
+	setup_nino_reset_vectors();
+
+	/* Function called during process idle (cpu_idle) */
+	cpu_wait = nino_wait;
+
+#ifdef CONFIG_FB
+	conswitchp = &dummy_con;
+#endif
+
+#ifdef CONFIG_REMOTE_DEBUG
+	remote_debug = 1;
+#endif
+
+	rtc_ops = &nino_rtc_ops;
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/philips/nino/time.c linux/arch/mips/philips/nino/time.c
--- v2.4.9/linux/arch/mips/philips/nino/time.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/philips/nino/time.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,216 @@
+/*
+ *  linux/arch/mips/philips/nino/time.c
+ *
+ *  Copyright (C) 1999 Harald Koerfgen
+ *  Copyright (C) 2000 Pavel Machek (pavel@suse.cz)
+ *  Copyright (C) 2001 Steven J. Hill (sjhill@realitydiluted.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  Time handling functinos for Philips Nino.
+ */
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/param.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/interrupt.h>
+#include <linux/timex.h>
+#include <linux/delay.h>
+#include <asm/tx3912.h>
+
+extern volatile unsigned long wall_jiffies;
+extern rwlock_t xtime_lock;
+
+static struct timeval xbase;
+
+#define USECS_PER_JIFFY (1000000/HZ)
+
+/*
+ * Poll the Interrupt Status Registers
+ */
+#undef POLL_STATUS
+
+static unsigned long do_gettimeoffset(void)
+{
+    /*
+     * This is a kludge
+     */
+    return 0;
+}
+
+static
+void inline readRTC(unsigned long *high, unsigned long *low)
+{
+	/* read twice, and keep reading till we find two
+	 * the same pairs. This is needed in case the RTC
+	 * was updating its registers and we read a old
+	 * High but a new Low. */
+	do {
+		*high = RTChigh & RTC_HIGHMASK;
+		*low = RTClow;
+	} while (*high != (RTChigh & RTC_HIGHMASK) || RTClow!=*low);
+}
+
+/*
+ * This version of gettimeofday has near millisecond resolution.
+ */
+void do_gettimeofday(struct timeval *tv)
+{
+    unsigned long flags;
+    unsigned long high, low;
+
+    read_lock_irqsave(&xtime_lock, flags);
+    // 40 bit RTC, driven by 32khz source:
+    // +-----------+-----------------------------------------+
+    // | HHHH.HHHH | LLLL.LLLL.LLLL.LLLL.LMMM.MMMM.MMMM.MMMM |
+    // +-----------+-----------------------------------------+
+    readRTC(&high,&low);
+    tv->tv_sec  = (high << 17) | (low >> 15);
+    tv->tv_usec = (low % 32768) * 1953 / 64;
+    tv->tv_sec += xbase.tv_sec;
+    tv->tv_usec += xbase.tv_usec;
+
+    tv->tv_usec += do_gettimeoffset();
+
+    /*
+     * xtime is atomically updated in timer_bh. lost_ticks is
+     * nonzero if the timer bottom half hasnt executed yet.
+     */
+    if (jiffies - wall_jiffies)
+	tv->tv_usec += USECS_PER_JIFFY;
+
+    read_unlock_irqrestore(&xtime_lock, flags);
+
+    if (tv->tv_usec >= 1000000) {
+	tv->tv_usec -= 1000000;
+	tv->tv_sec++;
+    }
+}
+
+void do_settimeofday(struct timeval *tv)
+{
+    write_lock_irq(&xtime_lock);
+    /* This is revolting. We need to set the xtime.tv_usec
+     * correctly. However, the value in this location is
+     * is value at the last tick.
+     * Discover what correction gettimeofday
+     * would have done, and then undo it!
+     */
+    tv->tv_usec -= do_gettimeoffset();
+
+    if (tv->tv_usec < 0) {
+	tv->tv_usec += 1000000;
+	tv->tv_sec--;
+    }
+
+    /* reset RTC to 0 (real time is xbase + RTC) */
+    xbase = *tv;
+    RTCtimerControl |=  TIM_RTCCLEAR;
+    RTCtimerControl &= ~TIM_RTCCLEAR;
+    RTCalarmHigh = RTCalarmLow = ~0UL;
+
+    xtime = *tv;
+    time_state = TIME_BAD;
+    time_maxerror = MAXPHASE;
+    time_esterror = MAXPHASE;
+    write_unlock_irq(&xtime_lock);
+}
+
+static int set_rtc_mmss(unsigned long nowtime)
+{
+    int retval = 0;
+
+    return retval;
+}
+
+/* last time the cmos clock got updated */
+static long last_rtc_update = 0;
+
+/*
+ * timer_interrupt() needs to keep up the real-time clock,
+ * as well as call the "do_timer()" routine every clocktick
+ */
+
+int do_write = 1;
+
+static void
+timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+#ifdef POLL_STATUS
+    static unsigned long old_IntStatus1 = 0;
+    static unsigned long old_IntStatus3 = 0;
+    static unsigned long old_IntStatus4 = 0;
+    static unsigned long old_IntStatus5 = 0;
+    static int counter = 0;
+    int i;
+
+    new_spircv = SPIData & 0xff;
+    if ((old_spircv != new_spircv) && (new_spircv != 0xff)) {
+	    printk( "SPIData changed: %x\n", new_spircv );
+    }
+    old_spircv = new_spircv;
+    if (do_write)
+	    SPIData = 0;
+#endif
+
+    if (!user_mode(regs)) {
+	if (prof_buffer && current->pid) {
+	    extern int _stext;
+	    unsigned long pc = regs->cp0_epc;
+
+	    pc -= (unsigned long) &_stext;
+	    pc >>= prof_shift;
+	    /*
+	     * Dont ignore out-of-bounds pc values silently,
+	     * put them into the last histogram slot, so if
+	     * present, they will show up as a sharp peak.
+	     */
+	    if (pc > prof_len - 1)
+		pc = prof_len - 1;
+		atomic_inc((atomic_t *) & prof_buffer[pc]);
+	    }
+    }
+
+    /*
+     * aaaand... action!
+     */
+    do_timer(regs);
+
+    /*
+     * If we have an externally syncronized Linux clock, then update
+     * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
+     * called as close as possible to 500 ms before the new second starts.
+     */
+    if (time_state != TIME_BAD && xtime.tv_sec > last_rtc_update + 660 &&
+	xtime.tv_usec > 500000 - (tick >> 1) &&
+	xtime.tv_usec < 500000 + (tick >> 1))
+    {
+	if (set_rtc_mmss(xtime.tv_sec) == 0)
+	    last_rtc_update = xtime.tv_sec;
+	else
+	    last_rtc_update = xtime.tv_sec - 600;  /* do it again in 60 s */
+    }
+}
+
+static struct irqaction irq0 = {timer_interrupt, SA_INTERRUPT, 0,
+ 			 "timer", NULL, NULL};
+
+void (*board_time_init) (struct irqaction * irq);
+
+int __init time_init(void)
+{
+    struct timeval starttime;
+
+    starttime.tv_sec = mktime(2000, 1, 1, 0, 0, 0);
+    starttime.tv_usec = 0;
+    do_settimeofday(&starttime);
+
+    board_time_init(&irq0);
+
+    return 0;
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/sgi/kernel/indy_hpc.c linux/arch/mips/sgi/kernel/indy_hpc.c
--- v2.4.9/linux/arch/mips/sgi/kernel/indy_hpc.c	Sat May 13 08:29:14 2000
+++ linux/arch/mips/sgi/kernel/indy_hpc.c	Sun Sep  9 10:43:02 2001
@@ -12,6 +12,7 @@
 #include <asm/sgi/sgihpc.h>
 #include <asm/sgi/sgint23.h>
 #include <asm/sgialib.h>
+#include <asm/bootinfo.h>
 
 /* #define DEBUG_SGIHPC */
 
@@ -50,10 +51,12 @@
 		prom_printf("GUINESS ");
 #endif
 		sgi_guiness = 1;
+		mips_machtype = MACH_SGI_INDY;
 	} else {
 #ifdef DEBUG_SGIHPC
 		prom_printf("FULLHOUSE ");
 #endif
+                mips_machtype = MACH_SGI_INDIGO2;
 		sgi_guiness = 0;
 	}
 	sgi_boardid = brev;
diff -u --recursive --new-file v2.4.9/linux/arch/mips/sgi/kernel/indy_int.c linux/arch/mips/sgi/kernel/indy_int.c
--- v2.4.9/linux/arch/mips/sgi/kernel/indy_int.c	Fri Feb  9 11:29:44 2001
+++ linux/arch/mips/sgi/kernel/indy_int.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: indy_int.c,v 1.18 2000/03/02 02:36:50 ralf Exp $
- *
+/*
  * indy_int.c: Routines for generic manipulation of the INT[23] ASIC
  *             found on INDY workstations..
  *
@@ -70,8 +69,6 @@
 
 extern asmlinkage void indyIRQ(void);
 
-unsigned long spurious_count = 0;
-
 /* Local IRQ's are layed out logically like this:
  *
  * 0  --> 7   ==   local 0 interrupts
@@ -79,433 +76,333 @@
  * 16 --> 23  ==   vectored level 2 interrupts
  * 24 --> 31  ==   vectored level 3 interrupts (not used)
  */
-void disable_local_irq(unsigned int irq_nr)
+static void enable_local0_irq(unsigned int irq)
 {
 	unsigned long flags;
 
 	save_and_cli(flags);
-	switch(irq_nr) {
-	case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
-		ioc_icontrol->imask0 &= ~(1 << irq_nr);
-		break;
-
-	case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15:
-		ioc_icontrol->imask1 &= ~(1 << (irq_nr - 8));
-		break;
-
-	case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23:
-		ioc_icontrol->cmeimask0 &= ~(1 << (irq_nr - 16));
-		break;
-
-	default:
-		/* This way we'll see if anyone would ever want vectored
-		 * level 3 interrupts.  Highly unlikely.
-		 */
-		printk("Yeeee, got passed irq_nr %d at disable_irq\n", irq_nr);
-		panic("INVALID IRQ level!");
-	};
+	ioc_icontrol->imask0 |= (1 << (irq - SGINT_LOCAL0));
 	restore_flags(flags);
 }
 
-void enable_local_irq(unsigned int irq_nr)
+static unsigned int startup_local0_irq(unsigned int irq)
+{
+	enable_local0_irq(irq);
+
+	return 0;		/* Never anything pending  */
+}
+
+static void disable_local0_irq(unsigned int irq)
 {
 	unsigned long flags;
+
 	save_and_cli(flags);
-	switch(irq_nr) {
-	case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
-		ioc_icontrol->imask0 |= (1 << irq_nr);
-		break;
-
-	case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15:
-		ioc_icontrol->imask1 |= (1 << (irq_nr - 8));
-		break;
-
-	case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23:
-		enable_local_irq(7);
-		ioc_icontrol->cmeimask0 |= (1 << (irq_nr - 16));
-		break;
-
-	default:
-		printk("Yeeee, got passed irq_nr %d at disable_irq\n", irq_nr);
-		panic("INVALID IRQ level!");
-	};
+	ioc_icontrol->imask0 &= ~(1 << (irq - SGINT_LOCAL0));
 	restore_flags(flags);
 }
 
-void disable_gio_irq(unsigned int irq_nr)
+#define shutdown_local0_irq	disable_local0_irq
+#define mask_and_ack_local0_irq	disable_local0_irq
+
+static void end_local0_irq (unsigned int irq)
 {
-	/* XXX TODO XXX */
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		enable_local0_irq(irq);
 }
 
-void enable_gio_irq(unsigned int irq_nr)
+static struct hw_interrupt_type ip22_local0_irq_type = {
+	"IP22 local 0",
+	startup_local0_irq,
+	shutdown_local0_irq,
+	enable_local0_irq,
+	disable_local0_irq,
+	mask_and_ack_local0_irq,
+	end_local0_irq,
+	NULL
+};
+
+static void enable_local1_irq(unsigned int irq)
 {
-	/* XXX TODO XXX */
+	unsigned long flags;
+
+	save_and_cli(flags);
+	ioc_icontrol->imask1 |= (1 << (irq - SGINT_LOCAL1));
+	restore_flags(flags);
 }
 
-void disable_hpcdma_irq(unsigned int irq_nr)
+static unsigned int startup_local1_irq(unsigned int irq)
 {
-	/* XXX TODO XXX */
+	enable_local1_irq(irq);
+
+	return 0;		/* Never anything pending  */
 }
 
-void enable_hpcdma_irq(unsigned int irq_nr)
+void disable_local1_irq(unsigned int irq)
 {
-	/* XXX TODO XXX */
+	unsigned long flags;
+
+	save_and_cli(flags);
+	ioc_icontrol->imask1 &= ~(1 << (irq- SGINT_LOCAL1));
+	restore_flags(flags);
 }
 
-void disable_irq(unsigned int irq_nr)
+#define shutdown_local1_irq	disable_local1_irq
+#define mask_and_ack_local1_irq	disable_local1_irq
+
+static void end_local1_irq (unsigned int irq)
 {
-	unsigned int n = irq_nr;
-	if(n >= SGINT_END) {
-		printk("whee, invalid irq_nr %d\n", irq_nr);
-		panic("IRQ, you lose...");
-	}
-	if(n >= SGINT_LOCAL0 && n < SGINT_GIO) {
-		disable_local_irq(n - SGINT_LOCAL0);
-	} else if(n >= SGINT_GIO && n < SGINT_HPCDMA) {
-		disable_gio_irq(n - SGINT_GIO);
-	} else if(n >= SGINT_HPCDMA && n < SGINT_END) {
-		disable_hpcdma_irq(n - SGINT_HPCDMA);
-	} else {
-		panic("how did I get here?");
-	}
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		enable_local1_irq(irq);
 }
 
-void enable_irq(unsigned int irq_nr)
+static struct hw_interrupt_type ip22_local1_irq_type = {
+	"IP22 local 1",
+	startup_local1_irq,
+	shutdown_local1_irq,
+	enable_local1_irq,
+	disable_local1_irq,
+	mask_and_ack_local1_irq,
+	end_local1_irq,
+	NULL
+};
+
+static void enable_local2_irq(unsigned int irq)
 {
-	unsigned int n = irq_nr;
-	if(n >= SGINT_END) {
-		printk("whee, invalid irq_nr %d\n", irq_nr);
-		panic("IRQ, you lose...");
-	}
-	if(n >= SGINT_LOCAL0 && n < SGINT_GIO) {
-		enable_local_irq(n - SGINT_LOCAL0);
-	} else if(n >= SGINT_GIO && n < SGINT_HPCDMA) {
-		enable_gio_irq(n - SGINT_GIO);
-	} else if(n >= SGINT_HPCDMA && n < SGINT_END) {
-		enable_hpcdma_irq(n - SGINT_HPCDMA);
-	} else {
-		panic("how did I get here?");
-	}
+	unsigned long flags;
+
+	save_and_cli(flags);
+	enable_local0_irq(7);
+	ioc_icontrol->cmeimask0 |= (1 << (irq - SGINT_LOCAL2));
+	restore_flags(flags);
 }
 
-#if 0
-/*
- * Currently unused.
- */
-static void local_unex(int irq, void *data, struct pt_regs *regs)
+static unsigned int startup_local2_irq(unsigned int irq)
 {
-	printk("Whee: unexpected local IRQ at %08lx\n",
-	       (unsigned long) regs->cp0_epc);
-	printk("DUMP: stat0<%x> stat1<%x> vmeistat<%x>\n",
-	       ioc_icontrol->istat0, ioc_icontrol->istat1,
-	       ioc_icontrol->vmeistat);
-}
-#endif
+	enable_local2_irq(irq);
 
-static struct irqaction *local_irq_action[24] = {
-	NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL
-};
+	return 0;		/* Never anything pending  */
+}
 
-int setup_indy_irq(int irq, struct irqaction * new)
+void disable_local2_irq(unsigned int irq)
 {
-	printk("setup_indy_irq: Yeee, don't know how to setup irq<%d> for %s  %p\n",
-	       irq, new->name, new->handler);
-	return 0;
+	unsigned long flags;
+
+	save_and_cli(flags);
+	ioc_icontrol->cmeimask0 &= ~(1 << (irq - SGINT_LOCAL2));
+	restore_flags(flags);
 }
 
-static struct irqaction r4ktimer_action = {
-	NULL, 0, 0, "R4000 timer/counter", NULL, NULL,
-};
+#define shutdown_local2_irq disable_local2_irq
+#define mask_and_ack_local2_irq	disable_local2_irq
 
-static struct irqaction indy_berr_action = {
-	NULL, 0, 0, "IP22 Bus Error", NULL, NULL,
-};
+static void end_local2_irq (unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		enable_local2_irq(irq);
+}
 
-static struct irqaction *irq_action[16] = {
-	NULL, NULL, NULL, NULL,
-	NULL, NULL, &indy_berr_action, &r4ktimer_action,
-	NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL
+static struct hw_interrupt_type ip22_local2_irq_type = {
+	"IP22 local 2",
+	startup_local2_irq,
+	shutdown_local2_irq,
+	enable_local2_irq,
+	disable_local2_irq,
+	mask_and_ack_local2_irq,
+	end_local2_irq,
+	NULL
 };
 
-int get_irq_list(char *buf)
+static void enable_local3_irq(unsigned int irq)
 {
-	int i, len = 0;
-	int num = 0;
-	struct irqaction * action;
-
-	for (i = 0 ; i < 16 ; i++, num++) {
-		action = irq_action[i];
-		if (!action) 
-			continue;
-		len += sprintf(buf+len, "%2d: %8d %c %s",
-			num, kstat.irqs[0][num],
-			(action->flags & SA_INTERRUPT) ? '+' : ' ',
-			action->name);
-		for (action=action->next; action; action = action->next) {
-			len += sprintf(buf+len, ",%s %s",
-				(action->flags & SA_INTERRUPT) ? " +" : "",
-				action->name);
-		}
-		len += sprintf(buf+len, " [on-chip]\n");
-	}
-	for (i = 0 ; i < 24 ; i++, num++) {
-		action = local_irq_action[i];
-		if (!action) 
-			continue;
-		len += sprintf(buf+len, "%2d: %8d %c %s",
-			num, kstat.irqs[0][num],
-			(action->flags & SA_INTERRUPT) ? '+' : ' ',
-			action->name);
-		for (action=action->next; action; action = action->next) {
-			len += sprintf(buf+len, ",%s %s",
-				(action->flags & SA_INTERRUPT) ? " +" : "",
-				action->name);
-		}
-		len += sprintf(buf+len, " [local]\n");
-	}
-	return len;
+	unsigned long flags;
+
+	save_and_cli(flags);
+	printk("Yeeee, got passed irq_nr %d at enable_local3_irq\n", irq);
+	panic("INVALID IRQ level!");
+	restore_flags(flags);
 }
 
-/*
- * do_IRQ handles IRQ's that have been installed without the
- * SA_INTERRUPT flag: it uses the full signal-handling return
- * and runs with other interrupts enabled. All relatively slow
- * IRQ's should use this format: notably the keyboard/timer
- * routines.
- */
-asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
+static unsigned int startup_local3_irq(unsigned int irq)
 {
-	struct irqaction *action;
-	int do_random, cpu;
+	enable_local3_irq(irq);
 
-	cpu = smp_processor_id();
-	irq_enter(cpu);
-	kstat.irqs[0][irq]++;
+	return 0;		/* Never anything pending  */
+}
 
-	printk("Got irq %d, press a key.", irq);
-	prom_getchar();
-	romvec->imode();
+void disable_local3_irq(unsigned int irq)
+{
+	unsigned long flags;
 
+	save_and_cli(flags);
 	/*
-	 * mask and ack quickly, we don't want the irq controller
-	 * thinking we're snobs just because some other CPU has
-	 * disabled global interrupts (we have already done the
-	 * INT_ACK cycles, it's too late to try to pretend to the
-	 * controller that we aren't taking the interrupt).
-	 *
-	 * Commented out because we've already done this in the
-	 * machinespecific part of the handler.  It's reasonable to
-	 * do this here in a highlevel language though because that way
-	 * we could get rid of a good part of duplicated code ...
+	 * This way we'll see if anyone would ever want vectored level 3
+	 * interrupts.  Highly unlikely.
 	 */
-        /* mask_and_ack_irq(irq); */
+	printk("Yeeee, got passed irq_nr %d at disable_local3_irq\n", irq);
+	panic("INVALID IRQ level!");
+	restore_flags(flags);
+}
 
-	action = *(irq + irq_action);
-	if (action) {
-		if (!(action->flags & SA_INTERRUPT))
-			__sti();
-		action = *(irq + irq_action);
-		do_random = 0;
-		do {
-			do_random |= action->flags;
-			action->handler(irq, action->dev_id, regs);
-			action = action->next;
-		} while (action);
-		if (do_random & SA_SAMPLE_RANDOM)
-			add_interrupt_randomness(irq);
-		__cli();
-	}
-	irq_exit(cpu);
+#define shutdown_local3_irq disable_local3_irq
+#define mask_and_ack_local3_irq	disable_local3_irq
 
-	/* unmasking and bottom half handling is done magically for us. */
+static void end_local3_irq (unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		enable_local3_irq(irq);
 }
 
-int request_local_irq(unsigned int lirq, void (*func)(int, void *, struct pt_regs *),
-		      unsigned long iflags, const char *dname, void *devid)
+static struct hw_interrupt_type ip22_local3_irq_type = {
+	"IP22 local 3",
+	startup_local3_irq,
+	shutdown_local3_irq,
+	enable_local3_irq,
+	disable_local3_irq,
+	mask_and_ack_local3_irq,
+	end_local3_irq,
+	NULL
+};
+
+void enable_gio_irq(unsigned int irq)
 {
-	struct irqaction *action;
+	/* XXX TODO XXX */
+}
 
-	lirq -= SGINT_LOCAL0;
-	if(lirq >= 24 || !func)
-		return -EINVAL;
+static unsigned int startup_gio_irq(unsigned int irq)
+{
+	enable_gio_irq(irq);
 
-	action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL);
-	if(!action)
-		return -ENOMEM;
+	return 0;		/* Never anything pending  */
+}
 
-	action->handler = func;
-	action->flags = iflags;
-	action->mask = 0;
-	action->name = dname;
-	action->dev_id = devid;
-	action->next = 0;
-	local_irq_action[lirq] = action;
-	enable_irq(lirq + SGINT_LOCAL0);
-	return 0;
+void disable_gio_irq(unsigned int irq)
+{
+	/* XXX TODO XXX */
 }
 
-void free_local_irq(unsigned int lirq, void *dev_id)
+#define shutdown_gio_irq	disable_gio_irq
+#define mask_and_ack_gio_irq	disable_gio_irq
+
+static void end_gio_irq (unsigned int irq)
 {
-	struct irqaction *action;
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		enable_gio_irq(irq);
+}
 
-	lirq -= SGINT_LOCAL0;
-	if(lirq >= 24) {
-		printk("Aieee: trying to free bogus local irq %d\n",
-		       lirq + SGINT_LOCAL0);
-		return;
-	}
-	action = local_irq_action[lirq];
-	local_irq_action[lirq] = NULL;
-	disable_irq(lirq + SGINT_LOCAL0);
-	kfree(action);
-}
-
-int request_irq(unsigned int irq, 
-		void (*handler)(int, void *, struct pt_regs *),
-		unsigned long irqflags, 
-		const char * devname,
-		void *dev_id)
-{
-	int retval;
-	struct irqaction * action;
-
-	if (irq >= SGINT_END)
-		return -EINVAL;
-	if (!handler)
-		return -EINVAL;
-
-	if((irq >= SGINT_LOCAL0) && (irq < SGINT_GIO))
-		return request_local_irq(irq, handler, irqflags, devname, dev_id);
-
-	action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL);
-	if (!action)
-		return -ENOMEM;
-
-	action->handler = handler;
-	action->flags = irqflags;
-	action->mask = 0;
-	action->name = devname;
-	action->next = NULL;
-	action->dev_id = dev_id;
-
-	retval = setup_indy_irq(irq, action);
-
-	if (retval)
-		kfree(action);
-	return retval;
+static struct hw_interrupt_type ip22_gio_irq_type = {
+	"IP22 GIO",
+	startup_gio_irq,
+	shutdown_gio_irq,
+	enable_gio_irq,
+	disable_gio_irq,
+	mask_and_ack_gio_irq,
+	end_gio_irq,
+	NULL
+};
+
+void enable_hpcdma_irq(unsigned int irq)
+{
+	/* XXX TODO XXX */
 }
-		
-void free_irq(unsigned int irq, void *dev_id)
+
+static unsigned int startup_hpcdma_irq(unsigned int irq)
 {
-	struct irqaction * action, **p;
-	unsigned long flags;
+	enable_hpcdma_irq(irq);
 
-	if (irq >= SGINT_END) {
-		printk("Trying to free IRQ%d\n",irq);
-		return;
-	}
-	if((irq >= SGINT_LOCAL0) && (irq < SGINT_GIO)) {
-		free_local_irq(irq, dev_id);
-		return;
-	}
-	for (p = irq + irq_action; (action = *p) != NULL; p = &action->next) {
-		if (action->dev_id != dev_id)
-			continue;
-
-		/* Found it - now free it */
-		save_and_cli(flags);
-		*p = action->next;
-		restore_flags(flags);
-		kfree(action);
-		return;
-	}
-	printk("Trying to free free IRQ%d\n",irq);
+	return 0;		/* Never anything pending  */
 }
 
-int (*irq_cannonicalize)(int irq);
-
-static int indy_irq_cannonicalize(int irq)
+void disable_hpcdma_irq(unsigned int irq)
 {
-	return irq;	/* Sane hardware, sane code ... */
+	/* XXX TODO XXX */
 }
 
-void __init init_IRQ(void)
+#define shutdown_hpcdma_irq	disable_hpcdma_irq
+#define mask_and_ack_hpcdma_irq	disable_hpcdma_irq
+
+static void end_hpcdma_irq (unsigned int irq)
 {
-	irq_cannonicalize = indy_irq_cannonicalize;
-	irq_setup();
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		enable_hpcdma_irq(irq);
 }
 
+static struct hw_interrupt_type ip22_hpcdma_irq_type = {
+	"IP22 HPC DMA",
+	startup_hpcdma_irq,
+	shutdown_hpcdma_irq,
+	enable_hpcdma_irq,
+	disable_hpcdma_irq,
+	mask_and_ack_hpcdma_irq,
+	end_hpcdma_irq,
+	NULL
+};
+
+static struct irqaction r4ktimer_action = {
+	NULL, 0, 0, "R4000 timer/counter", NULL, NULL,
+};
+
+static struct irqaction indy_berr_action = {
+	NULL, 0, 0, "IP22 Bus Error", NULL, NULL,
+};
+
+static struct irqaction *irq_action[16] = {
+	NULL, NULL, NULL, NULL,
+	NULL, NULL, &indy_berr_action, &r4ktimer_action,
+	NULL, NULL, NULL, NULL,
+	NULL, NULL, NULL, NULL
+};
+
 void indy_local0_irqdispatch(struct pt_regs *regs)
 {
-	struct irqaction *action;
 	unsigned char mask = ioc_icontrol->istat0;
 	unsigned char mask2 = 0;
-	int irq, cpu = smp_processor_id();;
+	int irq;
 
 	mask &= ioc_icontrol->imask0;
-	if(mask & ISTAT0_LIO2) {
+	if (mask & ISTAT0_LIO2) {
 		mask2 = ioc_icontrol->vmeistat;
 		mask2 &= ioc_icontrol->cmeimask0;
 		irq = lc2msk_to_irqnr[mask2];
-		action = local_irq_action[irq];
 	} else {
 		irq = lc0msk_to_irqnr[mask];
-		action = local_irq_action[irq];
 	}
 
 	/* if irq == 0, then the interrupt has already been cleared */
-	if ( irq == 0 ) { goto end; }
-	/* if action == NULL, then we do have a handler for the irq */
-	if ( action == NULL ) { goto no_handler; }
-	
-	irq_enter(cpu);
-	kstat.irqs[0][irq + 16]++;
-	action->handler(irq, action->dev_id, regs);
-	irq_exit(cpu);
+	if (irq == 0)
+		goto end;
+
+	do_IRQ(irq, regs);
 	goto end;
 
 no_handler:
 	printk("No handler for local0 irq: %i\n", irq);
 
 end:	
-	return;	
-	
+	return;
 }
 
 void indy_local1_irqdispatch(struct pt_regs *regs)
 {
-	struct irqaction *action;
 	unsigned char mask = ioc_icontrol->istat1;
 	unsigned char mask2 = 0;
-	int irq, cpu = smp_processor_id();;
+	int irq;
 
 	mask &= ioc_icontrol->imask1;
-	if(mask & ISTAT1_LIO3) {
+	if (mask & ISTAT1_LIO3) {
 		printk("WHee: Got an LIO3 irq, winging it...\n");
 		mask2 = ioc_icontrol->vmeistat;
 		mask2 &= ioc_icontrol->cmeimask1;
 		irq = lc3msk_to_irqnr[ioc_icontrol->vmeistat];
-		action = local_irq_action[irq];
 	} else {
 		irq = lc1msk_to_irqnr[mask];
-		action = local_irq_action[irq];
 	}
+
 	/* if irq == 0, then the interrupt has already been cleared */
 	/* not sure if it is needed here, but it is needed for local0 */
-	if ( irq == 0 ) { goto end; }
-	/* if action == NULL, then we do have a handler for the irq */
-	if ( action == NULL ) { goto no_handler; }
-	
-	irq_enter(cpu);
-	kstat.irqs[0][irq + 24]++;
-	action->handler(irq, action->dev_id, regs);
-	irq_exit(cpu);
+	if (irq == 0)
+		goto end;
+
+	do_IRQ(irq, regs);
 	goto end;
 	
 no_handler:
@@ -520,27 +417,16 @@
 	int cpu = smp_processor_id();
 	int irq = 6;
 
-	irq_enter(cpu);
+	irq_enter(cpu, irq);
 	kstat.irqs[0][irq]++;
 	printk("Got a bus error IRQ, shouldn't happen yet\n");
 	show_regs(regs);
 	printk("Spinning...\n");
 	while(1);
-	irq_exit(cpu);
-}
-
-/* Misc. crap just to keep the kernel linking... */
-unsigned long probe_irq_on (void)
-{
-	return 0;
+	irq_exit(cpu, irq);
 }
 
-int probe_irq_off (unsigned long irqs)
-{
-	return 0;
-}
-
-void __init sgint_init(void)
+void __init init_IRQ(void)
 {
 	int i;
 
@@ -548,43 +434,43 @@
 	sgi_i3regs = (struct sgi_int3_regs *) (KSEG1 + SGI_INT3_BASE);
 
 	/* Init local mask --> irq tables. */
-	for(i = 0; i < 256; i++) {
-		if(i & 0x80) {
+	for (i = 0; i < 256; i++) {
+		if (i & 0x80) {
 			lc0msk_to_irqnr[i] = 7;
 			lc1msk_to_irqnr[i] = 15;
 			lc2msk_to_irqnr[i] = 23;
 			lc3msk_to_irqnr[i] = 31;
-		} else if(i & 0x40) {
+		} else if (i & 0x40) {
 			lc0msk_to_irqnr[i] = 6;
 			lc1msk_to_irqnr[i] = 14;
 			lc2msk_to_irqnr[i] = 22;
 			lc3msk_to_irqnr[i] = 30;
-		} else if(i & 0x20) {
+		} else if (i & 0x20) {
 			lc0msk_to_irqnr[i] = 5;
 			lc1msk_to_irqnr[i] = 13;
 			lc2msk_to_irqnr[i] = 21;
 			lc3msk_to_irqnr[i] = 29;
-		} else if(i & 0x10) {
+		} else if (i & 0x10) {
 			lc0msk_to_irqnr[i] = 4;
 			lc1msk_to_irqnr[i] = 12;
 			lc2msk_to_irqnr[i] = 20;
 			lc3msk_to_irqnr[i] = 28;
-		} else if(i & 0x08) {
+		} else if (i & 0x08) {
 			lc0msk_to_irqnr[i] = 3;
 			lc1msk_to_irqnr[i] = 11;
 			lc2msk_to_irqnr[i] = 19;
 			lc3msk_to_irqnr[i] = 27;
-		} else if(i & 0x04) {
+		} else if (i & 0x04) {
 			lc0msk_to_irqnr[i] = 2;
 			lc1msk_to_irqnr[i] = 10;
 			lc2msk_to_irqnr[i] = 18;
 			lc3msk_to_irqnr[i] = 26;
-		} else if(i & 0x02) {
+		} else if (i & 0x02) {
 			lc0msk_to_irqnr[i] = 1;
 			lc1msk_to_irqnr[i] = 9;
 			lc2msk_to_irqnr[i] = 17;
 			lc3msk_to_irqnr[i] = 25;
-		} else if(i & 0x01) {
+		} else if (i & 0x01) {
 			lc0msk_to_irqnr[i] = 0;
 			lc1msk_to_irqnr[i] = 8;
 			lc2msk_to_irqnr[i] = 16;
@@ -614,6 +500,29 @@
 	ioc_icontrol->cmeimask0 = 0;
 	ioc_icontrol->cmeimask1 = 0;
 
-	/* Now safe to set the exception vector. */
 	set_except_vector(0, indyIRQ);
+
+	init_generic_irq();
+
+	for (i = SGINT_LOCAL0; i < SGINT_END; i++) {
+		hw_irq_controller *handler;
+
+		if (i < SGINT_LOCAL1)
+			handler		= &ip22_local0_irq_type;
+		else if (i < SGINT_LOCAL2)
+			handler		= &ip22_local1_irq_type;
+		else if (i < SGINT_LOCAL3)
+			handler		= &ip22_local2_irq_type;
+		else if (i < SGINT_GIO)
+			handler		= &ip22_local3_irq_type;
+		else if (i < SGINT_HPCDMA)
+			handler		= &ip22_gio_irq_type;
+		else if (i < SGINT_END)
+			handler		= &ip22_hpcdma_irq_type;
+
+		irq_desc[i].status	= IRQ_DISABLED;
+		irq_desc[i].action	= 0;
+		irq_desc[i].depth	= 1;
+		irq_desc[i].handler	= handler;
+	}
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/sgi/kernel/indy_rtc.c linux/arch/mips/sgi/kernel/indy_rtc.c
--- v2.4.9/linux/arch/mips/sgi/kernel/indy_rtc.c	Sat May 13 08:29:14 2000
+++ linux/arch/mips/sgi/kernel/indy_rtc.c	Sun Sep  9 10:43:02 2001
@@ -1,12 +1,11 @@
-/* $Id: indy_rtc.c,v 1.1 1998/06/30 00:21:58 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
  * RTC routines for Indy style attached Dallas chip.
  *
- * Copyright (C) 1998 by Ralf Baechle
+ * Copyright (C) 1998, 2001 by Ralf Baechle
  */
 #include <linux/mc146818rtc.h>
 #include <asm/sgi/sgihpc.h>
diff -u --recursive --new-file v2.4.9/linux/arch/mips/sgi/kernel/indy_sc.c linux/arch/mips/sgi/kernel/indy_sc.c
--- v2.4.9/linux/arch/mips/sgi/kernel/indy_sc.c	Tue Mar  6 19:44:36 2001
+++ linux/arch/mips/sgi/kernel/indy_sc.c	Sun Sep  9 10:43:02 2001
@@ -1,8 +1,7 @@
-/* $Id: indy_sc.c,v 1.14 2000/03/25 22:35:07 ralf Exp $
- *
+/*
  * indy_sc.c: Indy cache management functions.
  *
- * Copyright (C) 1997 Ralf Baechle (ralf@gnu.org),
+ * Copyright (C) 1997, 2001 Ralf Baechle (ralf@gnu.org),
  * derived from r4xx0.c by David S. Miller (dm@engr.sgi.com).
  */
 #include <linux/init.h>
@@ -34,30 +33,30 @@
 {
 	unsigned long tmp;
 
-	__asm__ __volatile__("
-		.set	noreorder
-		.set	mips3
-		.set	noat
-		mfc0	%2, $12
-		li	$1, 0x80	# Go 64 bit
-		mtc0	$1, $12
-
-		dli	$1, 0x9000000080000000
-		or	%0, $1		# first line to flush
-		or	%1, $1		# last line to flush
-		.set	at
-
-1:		sw	$0, 0(%0)
-		bne	%0, %1, 1b
-		daddu	%0, 32
-
-		mtc0	%2, $12		# Back to 32 bit
-		nop; nop; nop; nop;
-		.set mips0
-		.set reorder"
-		: "=r" (first), "=r" (last), "=&r" (tmp)
-		: "0" (first), "1" (last)
-		: "$1");
+	__asm__ __volatile__(
+	".set\tnoreorder\t\t\t# indy_sc_wipe\n\t"
+	".set\tmips3\n\t"
+	".set\tnoat\n\t"
+	"mfc0\t%2, $12\n\t"
+	"li\t$1, 0x80\t\t\t# Go 64 bit\n\t"
+	"mtc0\t$1, $12\n\t"
+
+	"dli\t$1, 0x9000000080000000\n\t"
+	"or\t%0, $1\t\t\t# first line to flush\n\t"
+	"or\t%1, $1\t\t\t# last line to flush\n\t"
+	".set\tat\n\t"
+
+	"1:\tsw\t$0, 0(%0)\n\t"
+	"bne\t%0, %1, 1b\n\t"
+	"daddu\t%0, 32\n\t"
+
+	"mtc0\t%2, $12\t\t\t# Back to 32 bit\n\t"
+	"nop; nop; nop; nop;\n\t"
+	".set\tmips0\n\t"
+	".set\treorder"
+	: "=r" (first), "=r" (last), "=&r" (tmp)
+	: "0" (first), "1" (last)
+	: "$1");
 }
 
 static void indy_sc_wback_invalidate(unsigned long addr, unsigned long size)
@@ -96,27 +95,27 @@
 #ifdef DEBUG_CACHE
 	printk("Enabling R4600 SCACHE\n");
 #endif
-	__asm__ __volatile__("
-		.set	push
-		.set	noreorder
-		.set	mips3
-		mfc0	%2, $12
-		nop; nop; nop; nop;
-		li	%1, 0x80
-		mtc0	%1, $12
-		nop; nop; nop; nop;
-		li	%0, 0x1
-		dsll	%0, 31
-		lui	%1, 0x9000
-		dsll32	%1, 0
-		or	%0, %1, %0
-		sb	$0, 0(%0)
-		mtc0	$0, $12
-		nop; nop; nop; nop;
-		mtc0	%2, $12
-		nop; nop; nop; nop;
-		.set	pop"
-		: "=r" (tmp1), "=r" (tmp2), "=r" (addr));
+	__asm__ __volatile__(
+	".set\tpush\n\t"
+	".set\tnoreorder\n\t"
+	".set\tmips3\n\t"
+	"mfc0\t%2, $12\n\t"
+	"nop; nop; nop; nop;\n\t"
+	"li\t%1, 0x80\n\t"
+	"mtc0\t%1, $12\n\t"
+	"nop; nop; nop; nop;\n\t"
+	"li\t%0, 0x1\n\t"
+	"dsll\t%0, 31\n\t"
+	"lui\t%1, 0x9000\n\t"
+	"dsll32\t%1, 0\n\t"
+	"or\t%0, %1, %0\n\t"
+	"sb\t$0, 0(%0)\n\t"
+	"mtc0\t$0, $12\n\t"
+	"nop; nop; nop; nop;\n\t"
+	"mtc0\t%2, $12\n\t"
+	"nop; nop; nop; nop;\n\t"
+	".set\tpop"
+	: "=r" (tmp1), "=r" (tmp2), "=r" (addr));
 }
 
 static void indy_sc_disable(void)
@@ -126,27 +125,27 @@
 #ifdef DEBUG_CACHE
 	printk("Disabling R4600 SCACHE\n");
 #endif
-	__asm__ __volatile__("
-		.set	push
-		.set	noreorder
-		.set	mips3
-		li	%0, 0x1
-		dsll	%0, 31
-		lui	%1, 0x9000
-		dsll32	%1, 0
-		or	%0, %1, %0
-		mfc0	%2, $12
-		nop; nop; nop; nop;
-		li	%1, 0x80
-		mtc0	%1, $12
-		nop; nop; nop; nop;
-		sh	$0, 0(%0)
-		mtc0	$0, $12
-		nop; nop; nop; nop;
-		mtc0	%2, $12
-		nop; nop; nop; nop;
-		.set	pop"
-		: "=r" (tmp1), "=r" (tmp2), "=r" (tmp3));
+	__asm__ __volatile__(
+	".set\tpush\n\t"
+	".set\tnoreorder\n\t"
+	".set\tmips3\n\t"
+	"li\t%0, 0x1\n\t"
+	"dsll\t%0, 31\n\t"
+	"lui\t%1, 0x9000\n\t"
+	"dsll32\t%1, 0\n\t"
+	"or\t%0, %1, %0\n\t"
+	"mfc0\t%2, $12\n\t"
+	"nop; nop; nop; nop\n\t"
+	"li\t%1, 0x80\n\t"
+	"mtc0\t%1, $12\n\t"
+	"nop; nop; nop; nop\n\t"
+	"sh\t$0, 0(%0)\n\t"
+	"mtc0\t$0, $12\n\t"
+	"nop; nop; nop; nop\n\t"
+	"mtc0\t%2, $12\n\t"
+	"nop; nop; nop; nop\n\t"
+	".set\tpop"
+	: "=r" (tmp1), "=r" (tmp2), "=r" (tmp3));
 }
 
 static inline int __init indy_sc_probe(void)
diff -u --recursive --new-file v2.4.9/linux/arch/mips/sgi/kernel/indy_timer.c linux/arch/mips/sgi/kernel/indy_timer.c
--- v2.4.9/linux/arch/mips/sgi/kernel/indy_timer.c	Mon Oct 16 12:58:51 2000
+++ linux/arch/mips/sgi/kernel/indy_timer.c	Wed Dec 31 16:00:00 1969
@@ -1,266 +0,0 @@
-/* $Id: indy_timer.c,v 1.17 2000/01/21 22:34:03 ralf Exp $
- *
- * indy_timer.c: Setting up the clock on the INDY 8254 controller.
- *
- * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
- * Copytight (C) 1997, 1998 Ralf Baechle (ralf@gnu.org)
- */
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/kernel.h>
-#include <linux/param.h>
-#include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/interrupt.h>
-#include <linux/timex.h>
-#include <linux/kernel_stat.h>
-
-#include <asm/bootinfo.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/ptrace.h>
-#include <asm/system.h>
-#include <asm/sgialib.h>
-#include <asm/sgi/sgi.h>
-#include <asm/sgi/sgihpc.h>
-#include <asm/sgi/sgint23.h>
-
-
-/* Because of a bug in the i8254 timer we need to use the onchip r4k
- * counter as our system wide timer interrupt running at 100HZ.
- */
-static unsigned long r4k_offset; /* Amount to increment compare reg each time */
-static unsigned long r4k_cur;    /* What counter should be at next timer irq */
-
-extern rwlock_t xtime_lock;
-
-static inline void ack_r4ktimer(unsigned long newval)
-{
-	write_32bit_cp0_register(CP0_COMPARE, newval);
-}
-
-static int set_rtc_mmss(unsigned long nowtime)
-{
-	struct indy_clock *clock = (struct indy_clock *)INDY_CLOCK_REGS;
-	int retval = 0;
-	int real_seconds, real_minutes, clock_minutes;
-
-#define FROB_FROM_CLOCK(x) (((x) & 0xf) | ((((x) & 0xf0) >> 4) * 10));
-#define FROB_TO_CLOCK(x)  ((((((x) & 0xff) / 10)<<4) | (((x) & 0xff) % 10)) & 0xff)
-
-	clock->cmd &= ~(0x80);
-	clock_minutes = clock->min;
-	clock->cmd |= (0x80);
-
-	clock_minutes = FROB_FROM_CLOCK(clock_minutes);
-	real_seconds = nowtime % 60;
-	real_minutes = nowtime / 60;
-
-	if(((abs(real_minutes - clock_minutes) + 15)/30) & 1)
-		real_minutes += 30; /* correct for half hour time zone */
-
-	real_minutes %= 60;
-	if(abs(real_minutes - clock_minutes) < 30) {
-		/* Force clock oscillator to be on. */
-		clock->month &= ~(0x80);
-
-		/* Write real_seconds and real_minutes into the Dallas. */
-		clock->cmd &= ~(0x80);
-		clock->sec = real_seconds;
-		clock->min = real_minutes;
-		clock->cmd |= (0x80);
-	} else
-		return -1;
-
-#undef FROB_FROM_CLOCK
-#undef FROB_TO_CLOCK
-
-	return retval;
-}
-
-static long last_rtc_update;
-unsigned long missed_heart_beats;
-
-void indy_timer_interrupt(struct pt_regs *regs)
-{
-	unsigned long count;
-	int irq = 7;
-
-	write_lock(&xtime_lock);
-	/* Ack timer and compute new compare. */
-	count = read_32bit_cp0_register(CP0_COUNT);
-	/* This has races.  */
-	if ((count - r4k_cur) >= r4k_offset) {
-		/* If this happens to often we'll need to compensate.  */
-		missed_heart_beats++;
-		r4k_cur = count + r4k_offset;
-	}
-        else
-            r4k_cur += r4k_offset;
-	ack_r4ktimer(r4k_cur);
-	kstat.irqs[0][irq]++;
-	do_timer(regs);
-
-	/* We update the Dallas time of day approx. every 11 minutes,
-	 * because of how the numbers work out we need to make
-	 * absolutely sure we do this update within 500ms before the
-	 * next second starts, thus the following code.
-	 */
-	if ((time_status & STA_UNSYNC) == 0 &&
-	    xtime.tv_sec > last_rtc_update + 660 &&
-	    xtime.tv_usec >= 500000 - (tick >> 1) &&
-	    xtime.tv_usec <= 500000 + (tick >> 1)) {
-		if (set_rtc_mmss(xtime.tv_sec) == 0)
-			last_rtc_update = xtime.tv_sec;
-		else
-			/* do it again in 60 s */
-			last_rtc_update = xtime.tv_sec - 600;
-	}
-	write_unlock(&xtime_lock);
-}
-
-static unsigned long dosample(volatile unsigned char *tcwp,
-                              volatile unsigned char *tc2p)
-{
-	unsigned long ct0, ct1;
-	unsigned char msb, lsb;
-
-	/* Start the counter. */
-	*tcwp = (SGINT_TCWORD_CNT2 | SGINT_TCWORD_CALL | SGINT_TCWORD_MRGEN);
-	*tc2p = (SGINT_TCSAMP_COUNTER & 0xff);
-	*tc2p = (SGINT_TCSAMP_COUNTER >> 8);
-
-	/* Get initial counter invariant */
-	ct0 = read_32bit_cp0_register(CP0_COUNT);
-
-	/* Latch and spin until top byte of counter2 is zero */
-	do {
-		*tcwp = (SGINT_TCWORD_CNT2 | SGINT_TCWORD_CLAT);
-		lsb = *tc2p;
-		msb = *tc2p;
-		ct1 = read_32bit_cp0_register(CP0_COUNT);
-	} while(msb);
-
-	/* Stop the counter. */
-	*tcwp = (SGINT_TCWORD_CNT2 | SGINT_TCWORD_CALL | SGINT_TCWORD_MSWST);
-
-	/* Return the difference, this is how far the r4k counter increments
-	 * for every one HZ.
-	 */
-	return ct1 - ct0;
-}
-
-static unsigned long __init get_indy_time(void)
-{
-	struct indy_clock *clock = (struct indy_clock *)INDY_CLOCK_REGS;
-	unsigned int year, mon, day, hour, min, sec;
-
-	/* Freeze it. */
-	clock->cmd &= ~(0x80);
-
-	/* Read regs. */
-	sec = clock->sec;
-	min = clock->min;
-	hour = (clock->hr & 0x3f);
-	day = (clock->date & 0x3f);
-	mon = (clock->month & 0x1f);
-	year = clock->year;
-
-	/* Unfreeze clock. */
-	clock->cmd |= 0x80;
-
-	/* Frob the bits. */
-#define FROB1(x)  (((x) & 0xf) + ((((x) & 0xf0) >> 4) * 10));
-#define FROB2(x)  (((x) & 0xf) + (((((x) & 0xf0) >> 4) & 0x3) * 10));
-
-	/* XXX Should really check that secs register is the same
-	 * XXX as when we first read it and if not go back and
-	 * XXX read the regs above again.
-	 */
-	sec = FROB1(sec); min = FROB1(min); day = FROB1(day);
-	mon = FROB1(mon); year = FROB1(year);
-	hour = FROB2(hour);
-
-#undef FROB1
-#undef FROB2
-
-	/* Wheee... */
-	if(year < 45)
-		year += 30;
-	if ((year += 1940) < 1970)
-		year += 100;
-
-	return mktime(year, mon, day, hour, min, sec);
-}
-
-#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
-
-void __init indy_timer_init(void)
-{
-	struct sgi_ioc_timers *p;
-	volatile unsigned char *tcwp, *tc2p;
-
-	/* Figure out the r4k offset, the algorithm is very simple
-	 * and works in _all_ cases as long as the 8254 counter
-	 * register itself works ok (as an interrupt driving timer
-	 * it does not because of bug, this is why we are using
-	 * the onchip r4k counter/compare register to serve this
-	 * purpose, but for r4k_offset calculation it will work
-	 * ok for us).  There are other very complicated ways
-	 * of performing this calculation but this one works just
-	 * fine so I am not going to futz around. ;-)
-	 */
-	p = ioc_timers;
-	tcwp = &p->tcword;
-	tc2p = &p->tcnt2;
-
-	printk("calculating r4koff... ");
-	dosample(tcwp, tc2p);			/* First sample. */
-	dosample(tcwp, tc2p);			/* Eat one.	*/
-	r4k_offset = dosample(tcwp, tc2p);	/* Second sample. */
-
-	printk("%08lx(%d)\n", r4k_offset, (int) r4k_offset);
-
-	r4k_cur = (read_32bit_cp0_register(CP0_COUNT) + r4k_offset);
-	write_32bit_cp0_register(CP0_COMPARE, r4k_cur);
-	set_cp0_status(ST0_IM, ALLINTS);
-	sti();
-
-	write_lock_irq(&xtime_lock);
-	xtime.tv_sec = get_indy_time();		/* Read time from RTC. */
-	xtime.tv_usec = 0;
-	write_unlock_irq(&xtime_lock);
-}
-
-void indy_8254timer_irq(void)
-{
-	int cpu = smp_processor_id();
-	int irq = 4;
-
-	irq_enter(cpu);
-	kstat.irqs[0][irq]++;
-	printk("indy_8254timer_irq: Whoops, should not have gotten this IRQ\n");
-	prom_getchar();
-	prom_imode();
-	irq_exit(cpu);
-}
-
-void do_gettimeofday(struct timeval *tv)
-{
-	unsigned long flags;
-
-	read_lock_irqsave(&xtime_lock, flags);
-	*tv = xtime;
-	read_unlock_irqrestore(&xtime_lock, flags);
-}
-
-void do_settimeofday(struct timeval *tv)
-{
-	write_lock_irq(&xtime_lock);
-	xtime = *tv;
-	time_state = TIME_BAD;
-	time_maxerror = MAXPHASE;
-	time_esterror = MAXPHASE;
-	write_unlock_irq(&xtime_lock);
-}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/sgi/kernel/promcon.c linux/arch/mips/sgi/kernel/promcon.c
--- v2.4.9/linux/arch/mips/sgi/kernel/promcon.c	Thu Oct 12 14:20:48 2000
+++ linux/arch/mips/sgi/kernel/promcon.c	Wed Dec 31 16:00:00 1969
@@ -1,68 +0,0 @@
-/*
- * Wrap-around code for a console using the
- * SGI PROM io-routines.
- *
- * Copyright (c) 1999 Ulf Carlsson
- *
- * Derived from DECstation promcon.c
- * Copyright (c) 1998 Harald Koerfgen 
- */
-
-#include <linux/tty.h>
-#include <linux/major.h>
-#include <linux/ptrace.h>
-#include <linux/init.h>
-#include <linux/console.h>
-#include <linux/fs.h>
-
-#include <asm/sgialib.h>
-
-static void prom_console_write(struct console *co, const char *s,
-			       unsigned count)
-{
-    unsigned i;
-
-    /*
-     *    Now, do each character
-     */
-    for (i = 0; i < count; i++) {
-	if (*s == 10)
-	    prom_printf("%c", 13);
-	prom_printf("%c", *s++);
-    }
-}
-
-static int prom_console_wait_key(struct console *co)
-{
-    return prom_getchar();
-}
-
-static int __init prom_console_setup(struct console *co, char *options)
-{
-    return 0;
-}
-
-static kdev_t prom_console_device(struct console *c)
-{
-    return MKDEV(TTY_MAJOR, 64 + c->index);
-}
-
-static struct console sercons =
-{
-    name:	"ttyS",
-    write:	prom_console_write,
-    device:	prom_console_device,
-    wait_key:	prom_console_wait_key,
-    setup:	prom_console_setup,
-    flags:	CON_PRINTBUFFER,
-    index:	-1,
-};
-
-/*
- *    Register console.
- */
-
-void __init sgi_prom_console_init(void )
-{
-    register_console(&sercons);
-}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/sgi/kernel/reset.c linux/arch/mips/sgi/kernel/reset.c
--- v2.4.9/linux/arch/mips/sgi/kernel/reset.c	Sat May 13 08:29:14 2000
+++ linux/arch/mips/sgi/kernel/reset.c	Sun Sep  9 10:43:02 2001
@@ -1,12 +1,9 @@
-/* $Id: reset.c,v 1.7 1999/08/11 20:26:51 andrewb Exp $
- *
- * Reset a SGI.
- *
+/*
  * 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) 1997, 1998 by Ralf Baechle
+ * Copyright (C) 1997, 1998, 2001 by Ralf Baechle
  */
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -54,7 +51,7 @@
 {
 	if (shuting_down)
 		sgi_machine_power_off();
-	prom_imode();
+	ArcEnterInteractiveMode();
 }
 
 static void sgi_machine_power_off(void)
diff -u --recursive --new-file v2.4.9/linux/arch/mips/sgi/kernel/setup.c linux/arch/mips/sgi/kernel/setup.c
--- v2.4.9/linux/arch/mips/sgi/kernel/setup.c	Tue Mar  6 19:44:36 2001
+++ linux/arch/mips/sgi/kernel/setup.c	Sun Sep  9 10:43:02 2001
@@ -24,6 +24,7 @@
 #include <asm/sgi/sgimc.h>
 #include <asm/sgi/sgihpc.h>
 #include <asm/sgi/sgint23.h>
+#include <asm/time.h>
 #include <asm/gdb-stub.h>
 
 #ifdef CONFIG_REMOTE_DEBUG
@@ -32,7 +33,7 @@
 static int remote_debug = 0;
 #endif
 
-#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_SGI_PROM_CONSOLE)
+#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_ARC_CONSOLE)
 extern void console_setup(char *);
 #endif
 
@@ -117,28 +118,6 @@
 	sgi_read_status
 };
 
-static void __init sgi_irq_setup(void)
-{
-	sgint_init();
-
-#ifdef CONFIG_REMOTE_DEBUG
-	if (remote_debug)
-		set_debug_traps();
-	breakpoint(); /* you may move this line to whereever you want :-) */
-#endif
-}
-
-int __init page_is_ram(unsigned long pagenr)
-{
-	if ((pagenr<<PAGE_SHIFT) < 0x2000UL)
-		return 1;
-	if ((pagenr<<PAGE_SHIFT) > 0x08002000)
-		return 1;
-	return 0;
-}
-
-void (*board_time_init)(struct irqaction *irq);
-
 static unsigned long dosample(volatile unsigned char *tcwp,
                               volatile unsigned char *tc2p)
 {
@@ -161,14 +140,16 @@
                 ct1 = read_32bit_cp0_register(CP0_COUNT);
         } while(msb);
 
-        /* Stop the counter. */
-        *tcwp = (SGINT_TCWORD_CNT2 | SGINT_TCWORD_CALL | SGINT_TCWORD_MSWST);
+	/* Stop the counter. */
+	*tcwp = (SGINT_TCWORD_CNT2 | SGINT_TCWORD_CALL | SGINT_TCWORD_MSWST);
 
-        /* Return the difference, this is how far the r4k counter increments
-         * for every 1/HZ seconds. We round off the nearest 1 MHz of
-	 * master clock (= 1000000 / 100 / 2 = 5000 count).
-         */
-        return ((ct1 - ct0) / 5000) * 5000;
+	/*
+	 * Return the difference, this is how far the r4k counter increments
+	 * for every 1/HZ seconds. We round off the nearest 1 MHz of master
+	 * clock (= 1000000 / 100 / 2 = 5000 count).
+	 */
+
+	return ((ct1 - ct0) / 5000) * 5000;
 }
 
 #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
@@ -180,7 +161,7 @@
 	 */
         struct sgi_ioc_timers *p;
         volatile unsigned char *tcwp, *tc2p;
-	unsigned long r4k_ticks[3] = { 0, 0, 0 };
+	unsigned long r4k_ticks[3];
 	unsigned long r4k_next;
 
         /* Figure out the r4k offset, the algorithm is very simple
@@ -201,10 +182,12 @@
         dosample(tcwp, tc2p);                   /* Prime cache. */
         dosample(tcwp, tc2p);                   /* Prime cache. */
 	/* Zero is NOT an option. */
-	while (!r4k_ticks[0])
+	do {
 		r4k_ticks[0] = dosample (tcwp, tc2p);
-	while (!r4k_ticks[1])
+	} while (!r4k_ticks[0]);
+	do {
 		r4k_ticks[1] = dosample (tcwp, tc2p);
+	} while (!r4k_ticks[1]);
 
 	if (r4k_ticks[0] != r4k_ticks[1]) {
 		printk ("warning: timer counts differ, retrying...");
@@ -226,7 +209,7 @@
 	/* Set ourselves up for future interrupts */
         r4k_next = (read_32bit_cp0_register(CP0_COUNT) + r4k_interval);
         write_32bit_cp0_register(CP0_COMPARE, r4k_next);
-        set_cp0_status(ST0_IM, ALLINTS);
+        change_cp0_status(ST0_IM, ALLINTS);
 	sti ();
 }
 
@@ -239,8 +222,6 @@
 	char *kgdb_ttyd;
 #endif
 
-
-	irq_setup = sgi_irq_setup;
 	board_time_init = sgi_time_init;
 
 	/* Init the INDY HPC I/O controller.  Need to call this before
@@ -282,7 +263,7 @@
 		       line ? 1 : 2);
 		rs_kgdb_hook(line);
 
-		prom_printf("KGDB: Using serial line /dev/ttyd%d for session, "
+		printk("KGDB: Using serial line /dev/ttyd%d for session, "
 			    "please connect your debugger\n", line ? 1 : 2);
 
 		remote_debug = 1;
@@ -290,7 +271,7 @@
 	}
 #endif
 
-#ifdef CONFIG_SGI_PROM_CONSOLE
+#ifdef CONFIG_ARC_CONSOLE
 	console_setup("ttyS0");
 #endif
  
@@ -324,5 +305,4 @@
 #ifdef CONFIG_VIDEO_VINO
 	init_vino();
 #endif
-
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/sgi/kernel/time.c linux/arch/mips/sgi/kernel/time.c
--- v2.4.9/linux/arch/mips/sgi/kernel/time.c	Sun Jul  9 22:18:15 2000
+++ linux/arch/mips/sgi/kernel/time.c	Sun Sep  9 10:43:02 2001
@@ -9,13 +9,13 @@
 
 void indy_8254timer_irq(void)
 {
-        int cpu = smp_processor_id();
-        int irq = 4;
+	int cpu = smp_processor_id();
+	int irq = 4;
 
-        irq_enter(cpu);
-        kstat.irqs[0][irq]++;
-        printk("indy_8254timer_irq: Whoops, should not have gotten this IRQ\n");
-        prom_getchar();
-        prom_imode();
-        irq_exit(cpu);
+	irq_enter(cpu, irq);
+	kstat.irqs[0][irq]++;
+	printk("indy_8254timer_irq: Whoops, should not have gotten this IRQ\n");
+	prom_getchar();
+	ArcEnterInteractiveMode();
+	irq_exit(cpu, irq);
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips/sni/dma.c linux/arch/mips/sni/dma.c
--- v2.4.9/linux/arch/mips/sni/dma.c	Sat May 13 08:29:14 2000
+++ linux/arch/mips/sni/dma.c	Wed Dec 31 16:00:00 1969
@@ -1,42 +0,0 @@
-/* $Id: dma.c,v 1.1 2000/02/18 00:24:30 ralf Exp $
- *
- * Dynamic DMA mapping support.
- *
- * On RM200 there is no hardware dynamic DMA address translation,
- * so consistent alloc/free are merely page allocation/freeing.
- * The rest of the dynamic DMA mapping interface is implemented
- * in <asm/pci.h>.
- *
- * These routines assume that the RM has all it's memory at physical
- * addresses of < 512mb.
- */
-#include <linux/types.h>
-#include <linux/mm.h>
-#include <linux/string.h>
-#include <linux/pci.h>
-#include <asm/io.h>
-
-void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
-			   dma_addr_t *dma_handle)
-{
-	void *ret;
-	int gfp = GFP_ATOMIC;
-	int order = get_order(size);
-
-	if (hwdev == NULL || hwdev->dma_mask != 0xffffffff)
-		gfp |= GFP_DMA;
-	ret = (void *)__get_free_pages(gfp, order);
-
-	if (ret != NULL) {
-		memset(ret, 0, size);
-		*dma_handle = virt_to_bus(ret);
-	}
-	dma_cache_wback_inv(ret, PAGE_SIZE << order);
-	return KSEG1ADDR(ret);
-}
-
-void pci_free_consistent(struct pci_dev *hwdev, size_t size,
-			 void *vaddr, dma_addr_t dma_handle)
-{
-	free_pages((unsigned long)vaddr, get_order(size));
-}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/sni/int-handler.S linux/arch/mips/sni/int-handler.S
--- v2.4.9/linux/arch/mips/sni/int-handler.S	Sat May 13 08:29:14 2000
+++ linux/arch/mips/sni/int-handler.S	Sun Sep  9 10:43:02 2001
@@ -1,8 +1,7 @@
-/* $Id: int-handler.S,v 1.4 1999/01/04 16:03:58 ralf Exp $
- *
+/*
  * SNI RM200 PCI specific interrupt handler code.
  *
- * Copyright (C) 1994 - 1997 by Ralf Baechle
+ * Copyright (C) 1994, 95, 96, 97, 98, 1999, 2000 by Ralf Baechle
  */
 #include <asm/asm.h>
 #include <asm/mipsregs.h>
@@ -37,22 +36,14 @@
 		mfc0	t1, CP0_CAUSE
 		and	t0, t1
 
-		/* The following interrupt dispatch tests for hwint 1 /
-		   EISA bridge first such that the timer interrupt get the
-		   highest priority.  */
-		 andi	t1, t0, 0x0800			# hardware interrupt 1
-		bnez	t1, hwint1
-		 andi	t1, t0, 0x4000			# hardware interrupt 4
-		bnez	t1, hwint4
-
+		 andi	t1, t0, 0x4a00			# hardware interrupt 1
+		bnez	t1, _hwint134
 		 andi	t1, t0, 0x1000			# hardware interrupt 2
-		bnez	t1, hwint2
-		 andi	t1, t0, 0x2000			# hardware interrupt 3
-		bnez	t1, hwint3
+		bnez	t1, _hwint2
 		 andi	t1, t0, 0x8000			# hardware interrupt 5
-		bnez	t1, hwint5
+		bnez	t1, _hwint5
 		 andi	t1, t0, 0x0400			# hardware interrupt 0
-		bnez	t1, hwint0
+		bnez	t1, _hwint0
 		 nop
 
 		j	return				# spurious interrupt
@@ -60,66 +51,23 @@
 
  ##############################################################################
 
-swint0:		PANIC("swint0")
-swint1:		PANIC("swint1")
-
- /* ------------------------------------------------------------------------ */
-
-/* hwint1 deals with EISA and SCSI interrupts.  */
-hwint1:		lbu	s0, PCIMT_CSITPEND
-
-		andi	t1, s0, 0x20
-		beqz	t1, 1f
-		 andi	s1, s0, 0x40
-		lbu	a0, PCIMT_INT_ACKNOWLEDGE	# IACK cycle
-		xori	t0, a0, 0xff
-		beqz	t0, 1f				# spurious interrupt?
-		 nop
-		jal	i8259_do_irq			# call real handler
-		 move	a1, sp
-
-1:		bnez	s1, 1f
-		 li	a0, PCIMT_IRQ_SCSI
-		jal	do_IRQ
-		 move	a1, sp
-
-1:		lui	t0, %hi(PCIMT_CSITPEND)
-		j	ret_from_irq
-		 lbu	zero, %lo(PCIMT_CSITPEND)(t0)
-
- /* ------------------------------------------------------------------------ */
-
 /* hwint0 should deal with MP agent, ASIC PCI, EISA NMI and debug
    button interrupts.  */
-hwint0:		PANIC("Received int0 but no handler yet ...\n")
-1:		j	1b
-		 nop
-
-go_spurious:	j	spurious_interrupt		# we got fooled
-		 nop
-
-/* hwint4 is used for only the onboard PCnet 32.  */
-hwint4:		mfc0	s0, CP0_STATUS
-		ori	t0, s0, 0x4000
-		xori	t0, 0x4000
-		mtc0	t0, CP0_STATUS
-
-		li	a0, PCIMT_IRQ_ETHERNET
-		jal	do_IRQ
+_hwint0:	jal	pciasic_hwint0
 		 move	a1, sp
 
-		mtc0	s0, CP0_STATUS
+/*
+ * hwint 1 deals with EISA and SCSI interrupts,
+ * hwint 3 should deal with the PCI A - D interrupts,
+ * hwint 4 is used for only the onboard PCnet 32.
+ */
+_hwint134:	jal	pciasic_hwint134
 
-		j	ret_from_irq
-		 nop
 
 /* This interrupt was used for the com1 console on the first prototypes.  */
-hwint2:		PANIC("hwint2 and no handler yet")
-
-/* hwint3 should deal with the PCI A - D interrupts.  */
-hwint3:		PANIC("hwint3 and no handler yet")
+_hwint2:	jal	pciasic_hwint2
 
 /* hwint5 is the r4k count / compare interrupt  */
-hwint5:		PANIC("hwint5 and no handler yet")
+_hwint5:	jal	pciasic_hwint5
 
 		END(sni_rm200_pci_handle_int)
diff -u --recursive --new-file v2.4.9/linux/arch/mips/sni/irq.c linux/arch/mips/sni/irq.c
--- v2.4.9/linux/arch/mips/sni/irq.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/sni/irq.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,159 @@
+/*
+ * 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 Linus Torvalds
+ * Copyright (C) 1994 - 2000 Ralf Baechle
+ */
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
+#include <linux/spinlock.h>
+
+#include <asm/io.h>
+#include <asm/sni.h>
+
+spinlock_t pciasic_lock = SPIN_LOCK_UNLOCKED;
+
+extern asmlinkage void sni_rm200_pci_handle_int(void);
+extern void do_IRQ(int irq, struct pt_regs *regs);
+
+static void enable_pciasic_irq(unsigned int irq);
+
+static unsigned int startup_pciasic_irq(unsigned int irq)
+{
+	enable_pciasic_irq(irq);
+	return 0; /* never anything pending */
+}
+
+#define shutdown_pciasic_irq	disable_pciasic_irq
+
+void disable_pciasic_irq(unsigned int irq)
+{
+	unsigned int mask = ~(1 << (irq - PCIMT_IRQ_INT2));
+	unsigned long flags;
+
+	spin_lock_irqsave(&pciasic_lock, flags);
+	*(volatile u8 *) PCIMT_IRQSEL &= mask;
+	spin_unlock_irqrestore(&pciasic_lock, flags);
+}
+
+static void enable_pciasic_irq(unsigned int irq)
+{
+	unsigned int mask = 1 << (irq - PCIMT_IRQ_INT2);
+	unsigned long flags;
+
+	spin_lock_irqsave(&pciasic_lock, flags);
+	*(volatile u8 *) PCIMT_IRQSEL |= mask;
+	spin_unlock_irqrestore(&pciasic_lock, flags);
+}
+
+#define mask_and_ack_pciasic_irq disable_pciasic_irq
+
+static void end_pciasic_irq(unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		enable_pciasic_irq(irq);
+}
+
+static struct hw_interrupt_type pciasic_irq_type = {
+	"PCIASIC",
+	startup_pciasic_irq,
+	shutdown_pciasic_irq,
+	enable_pciasic_irq,
+	disable_pciasic_irq,
+	mask_and_ack_pciasic_irq,
+	end_pciasic_irq,
+	NULL
+};
+
+/*
+ * hwint0 should deal with MP agent, ASIC PCI, EISA NMI and debug
+ * button interrupts.  Later ...
+ */
+void pciasic_hwint0(struct pt_regs *regs)
+{
+	panic("Received int0 but no handler yet ...");
+}
+
+/* This interrupt was used for the com1 console on the first prototypes.  */
+void pciasic_hwint2(struct pt_regs *regs)
+{
+	/* I think this shouldn't happen on production machines.  */
+	panic("hwint2 and no handler yet");
+}
+
+/* hwint5 is the r4k count / compare interrupt  */
+void pciasic_hwint5(struct pt_regs *regs)
+{
+	panic("hwint5 and no handler yet");
+}
+
+static inline int ls1bit8(unsigned int x)
+{
+	int b = 8, s;
+
+	x <<= 24;
+	s = 4; if ((x & 0x0f) == 0) s = 0; b -= s; x <<= s;
+	s = 2; if ((x & 0x03) == 0) s = 0; b -= s; x <<= s;
+	s = 1; if ((x & 0x01) == 0) s = 0; b -= s;
+
+	return b;
+}
+
+/*
+ * hwint 1 deals with EISA and SCSI interrupts,
+ * hwint 3 should deal with the PCI A - D interrupts,
+ * hwint 4 is used for only the onboard PCnet 32.
+ */
+void pciasic_hwint134(struct pt_regs *regs)
+{
+	u8 pend = *(volatile char *)PCIMT_CSITPEND;
+	int irq;
+
+	irq = PCIMT_IRQ_INT2 + ls1bit8(pend);
+	if (irq == PCIMT_IRQ_EISA) {
+		pend = *(volatile char *)PCIMT_INT_ACKNOWLEDGE;
+		if (!(pend ^ 0xff))
+			return;
+	}
+	do_IRQ(irq, regs);
+	return;
+}
+
+void __init init_pciasic(void)
+{
+	unsigned int flags;
+
+	spin_lock_irqsave(&pciasic_lock, flags);
+	* (volatile u8 *) PCIMT_IRQSEL =
+		IT_EISA | IT_INTA | IT_INTB | IT_INTC | IT_INTD;
+	spin_unlock_irqrestore(&pciasic_lock, flags);
+}
+
+/*
+ * On systems with i8259-style interrupt controllers we assume for
+ * driver compatibility reasons interrupts 0 - 15 to be the i8295
+ * interrupts even if the hardware uses a different interrupt numbering.
+ */
+void __init init_IRQ (void)
+{
+	int i;
+
+	set_except_vector(0, sni_rm200_pci_handle_int);
+
+	init_generic_irq();
+	init_i8259_irqs();			/* Integrated i8259  */
+	init_pciasic();
+
+	/* Actually we've got more interrupts to handle ...  */
+	for (i = PCIMT_IRQ_INT2; i <= PCIMT_IRQ_ETHERNET; i++) {
+		irq_desc[i].status     = IRQ_DISABLED;
+		irq_desc[i].action     = 0;
+		irq_desc[i].depth      = 1;
+		irq_desc[i].handler    = &pciasic_irq_type;
+	}
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips/sni/pci.c linux/arch/mips/sni/pci.c
--- v2.4.9/linux/arch/mips/sni/pci.c	Mon Aug  7 14:31:40 2000
+++ linux/arch/mips/sni/pci.c	Sun Sep  9 10:43:02 2001
@@ -203,6 +203,11 @@
 {
 }
 
+unsigned __init int pcibios_assign_all_busses(void)
+{
+	return 0;
+}
+
 char * __init
 pcibios_setup(char *str)
 {
diff -u --recursive --new-file v2.4.9/linux/arch/mips/sni/setup.c linux/arch/mips/sni/setup.c
--- v2.4.9/linux/arch/mips/sni/setup.c	Sun Jul  9 22:18:15 2000
+++ linux/arch/mips/sni/setup.c	Sun Sep  9 10:43:02 2001
@@ -31,18 +31,6 @@
 #include <asm/reboot.h>
 #include <asm/sni.h>
 
-/*
- * Initial irq handlers.
- */
-static void no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
-
-/*
- * IRQ2 is cascade interrupt to second interrupt controller
- */
-static struct irqaction irq2  = { no_action, 0, 0, "cascade", NULL, NULL};
-
-extern asmlinkage void sni_rm200_pci_handle_int(void);
-
 extern void sni_machine_restart(char *command);
 extern void sni_machine_halt(void);
 extern void sni_machine_power_off(void);
@@ -51,20 +39,6 @@
 extern struct rtc_ops std_rtc_ops;
 extern struct kbd_ops std_kbd_ops;
 
-static void __init sni_irq_setup(void)
-{
-	set_except_vector(0, sni_rm200_pci_handle_int);
-	request_region(0x20,0x20, "pic1");
-	request_region(0xa0,0x20, "pic2");	
-	i8259_setup_irq(2, &irq2);
-	/*
-	 * IRQ0 seems to be the irq for PC style stuff.
-	 * I don't know how to handle the debug button interrupt, so
-	 * don't use this button yet or bad things happen ...
-	 */
-	set_cp0_status(ST0_IM, IE_IRQ1 | IE_IRQ3 | IE_IRQ4);
-}
-
 void (*board_time_init)(struct irqaction *irq);
 
 static void __init sni_rm200_pci_time_init(struct irqaction *irq)
@@ -73,7 +47,7 @@
 	outb_p(0x34,0x43);		/* binary, mode 2, LSB/MSB, ch 0 */
 	outb_p(LATCH & 0xff , 0x40);	/* LSB */
 	outb(LATCH >> 8 , 0x40);	/* MSB */
-	i8259_setup_irq(0, irq);
+	setup_irq(0, irq);
 }
 
 unsigned char aux_device_present;
@@ -101,45 +75,11 @@
 	printk("%s.\n", boardtype);
 }
 
-int __init page_is_ram(unsigned long pagenr)
-{
-	return 1;
-}
-
 void __init sni_rm200_pci_setup(void)
 {
-#if 0 /* XXX Tag me deeper  */
-	tag *atag;
-
-	/*
-	 * We just check if a tag_screen_info can be gathered
-	 * in setup_arch(), if yes we don't proceed futher...
-	 */
-	atag = bi_TagFind(tag_screen_info);
-	if (!atag) {
-		/*
-		 * If no, we try to find the tag_arc_displayinfo which is
-		 * always created by Milo for an ARC box (for now Milo only
-		 * works on ARC boxes :) -Stoned.
-		 */
-		atag = bi_TagFind(tag_arcdisplayinfo);
-		if (atag) {
-			screen_info.orig_x = 
-				((mips_arc_DisplayInfo*)TAGVALPTR(atag))->cursor_x;
-			screen_info.orig_y = 
-				((mips_arc_DisplayInfo*)TAGVALPTR(atag))->cursor_y;
-			screen_info.orig_video_cols  = 
-				((mips_arc_DisplayInfo*)TAGVALPTR(atag))->columns;
-			screen_info.orig_video_lines  = 
-				((mips_arc_DisplayInfo*)TAGVALPTR(atag))->lines;
-		}
-	}
-#endif
-
 	sni_pcimt_detect();
 	sni_pcimt_sc_init();
 
-	irq_setup = sni_irq_setup;
 	mips_io_port_base = SNI_PORT_BASE;
 
 	/*
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/Makefile linux/arch/mips64/Makefile
--- v2.4.9/linux/arch/mips64/Makefile	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/Makefile	Sun Sep  9 10:43:02 2001
@@ -84,7 +84,8 @@
 endif
 
 ifdef CONFIG_SGI_IP27
-LIBS          += arch/mips64/sgi-ip27/ip27.a arch/mips64/arc/arclib.a
+CORE_FILES    += arch/mips64/sgi-ip27/ip27.o
+LIBS          += arch/mips64/arc/arclib.a
 SUBDIRS       += arch/mips64/sgi-ip27 arch/mips64/arc
 #
 # Set LOADADDR to >= 0xc000000000300000 if you want to leave space for
@@ -97,6 +98,17 @@
 else
 LOADADDR      += 0x8001c000
 endif
+endif
+
+ifdef CONFIG_SGI_IP32
+LIBS		+= arch/mips64/sgi-ip32/ip32-kern.a arch/mips64/arc/arclib.a
+SUBDIRS		+= arch/mips64/sgi-ip32 arch/mips64/arc
+#
+# Set LOADADDR to >= 0x????????? if you want to leave space for symmon,
+# 0x80002000 for production kernels.  Note that the value must be
+# 16kb aligned or the handling of the current variable will break.
+#
+LOADADDR	+= 0x80002000
 endif
 
 #
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/arc/env.c linux/arch/mips64/arc/env.c
--- v2.4.9/linux/arch/mips64/arc/env.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/arc/env.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: env.c,v 1.4 1999/10/19 20:51:44 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/arc/file.c linux/arch/mips64/arc/file.c
--- v2.4.9/linux/arch/mips64/arc/file.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/arc/file.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: file.c,v 1.3 1999/10/19 20:51:44 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/arc/init.c linux/arch/mips64/arc/init.c
--- v2.4.9/linux/arch/mips64/arc/init.c	Mon Feb 28 07:18:20 2000
+++ linux/arch/mips64/arc/init.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: init.c,v 1.3 1999/11/19 23:29:05 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/arc/memory.c linux/arch/mips64/arc/memory.c
--- v2.4.9/linux/arch/mips64/arc/memory.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/arc/memory.c	Sun Sep  9 10:43:02 2001
@@ -54,7 +54,8 @@
 	"FirmwarePermanent",
 	"FreeContiguous"
 };
-#define mtypes(a) (prom_flags & PROM_FLAG_ARCS) ? arcs_mtypes[a.arcs] : arc_mtypes[a.arc]
+#define mtypes(a) (prom_flags & PROM_FLAG_ARCS) ? arcs_mtypes[a.arcs] \
+						: arc_mtypes[a.arc]
 #endif
 
 static inline int memtype_classify_arcs (union linux_memtypes type)
@@ -138,10 +139,8 @@
 	}
 }
 
-void __init
-prom_free_prom_memory (void)
+void __init prom_free_prom_memory (void)
 {
-	struct prom_pmemblock *p;
 	unsigned long freed = 0;
 	unsigned long addr;
 	int i;
@@ -160,5 +159,5 @@
 			freed += PAGE_SIZE;
 		}
 	}
-	printk("Freeing prom memory: %ldkb freed\n", freed >> 10);
+	printk(KERN_INFO "Freeing prom memory: %ldkb freed\n", freed >> 10);
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/arc/misc.c linux/arch/mips64/arc/misc.c
--- v2.4.9/linux/arch/mips64/arc/misc.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/arc/misc.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: misc.c,v 1.2 1999/08/21 21:42:59 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/arc/salone.c linux/arch/mips64/arc/salone.c
--- v2.4.9/linux/arch/mips64/arc/salone.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/arc/salone.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: salone.c,v 1.2 1999/08/21 21:42:59 ralf Exp $
- *
+/*
  * Routines to load into memory and execute stand-along program images using
  * ARCS PROM firmware.
  *
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/arc/time.c linux/arch/mips64/arc/time.c
--- v2.4.9/linux/arch/mips64/arc/time.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/arc/time.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: time.c,v 1.2 1999/08/21 21:42:59 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/arc/tree.c linux/arch/mips64/arc/tree.c
--- v2.4.9/linux/arch/mips64/arc/tree.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/arc/tree.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: tree.c,v 1.3 1999/09/27 16:01:37 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/config.in linux/arch/mips64/config.in
--- v2.4.9/linux/arch/mips64/config.in	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/config.in	Sun Sep  9 10:43:02 2001
@@ -41,6 +41,7 @@
 unset CONFIG_BOOT_ELF64
 unset CONFIG_COHERENT_IO
 unset CONFIG_ISA
+unset CONFIG_MAPPED_PCI_IO
 unset CONFIG_PCI
 
 if [ "$CONFIG_SGI_IP22" = "y" ]; then
@@ -56,6 +57,7 @@
    define_bool CONFIG_BOOT_ELF64 y
    define_bool CONFIG_ARC64 y
    define_bool CONFIG_COHERENT_IO y
+   define_bool CONFIG_MAPPED_PCI_IO y
    define_bool CONFIG_PCI y
    define_bool CONFIG_QL_ISP_A64 y
    define_int CONFIG_L1_CACHE_SHIFT 7
@@ -177,7 +179,7 @@
 fi
 endmenu
 
-source drivers/message/i2o/Config.in
+#source drivers/message/i2o/Config.in
 
 if [ "$CONFIG_NET" = "y" ]; then
    mainmenu_option next_comment
@@ -270,7 +272,7 @@
 fi
 bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG
 bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
-if [ "$CONFIG_SMP" != "n" ]; then
+if [ "$CONFIG_SMP" != "y" ]; then
    bool 'Run uncached' CONFIG_MIPS_UNCACHED
 fi
 endmenu
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/defconfig linux/arch/mips64/defconfig
--- v2.4.9/linux/arch/mips64/defconfig	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/defconfig	Sun Sep  9 10:43:02 2001
@@ -24,6 +24,7 @@
 CONFIG_BOOT_ELF64=y
 CONFIG_ARC64=y
 CONFIG_COHERENT_IO=y
+CONFIG_MAPPED_PCI_IO=y
 CONFIG_PCI=y
 CONFIG_QL_ISP_A64=y
 CONFIG_L1_CACHE_SHIFT=7
@@ -142,6 +143,7 @@
 #
 # CONFIG_PHONE is not set
 # CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
 
 #
 # ATA/IDE/MFM/RLL support
@@ -184,6 +186,7 @@
 # CONFIG_SCSI_AHA1740 is not set
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_IN2000 is not set
 # CONFIG_SCSI_AM53C974 is not set
@@ -201,6 +204,7 @@
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_NCR_D700 is not set
 # CONFIG_SCSI_NCR53C7xx is not set
 # CONFIG_SCSI_NCR53C8XX is not set
 # CONFIG_SCSI_SYM53C8XX is not set
@@ -219,16 +223,6 @@
 # CONFIG_SCSI_U14_34F is not set
 
 #
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_PCI is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
 # Network device support
 #
 CONFIG_NETDEVICES=y
@@ -241,18 +235,22 @@
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-# CONFIG_NET_SB1000 is not set
 
 #
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
 CONFIG_SGI_IOC3_ETH=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_LANCE is not set
 # CONFIG_NET_VENDOR_SMC is not set
 # CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_DEPCA is not set
 # CONFIG_HP100 is not set
 # CONFIG_NET_ISA is not set
 # CONFIG_NET_PCI is not set
@@ -262,9 +260,14 @@
 # Ethernet (1000 Mbit)
 #
 # CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_FDDI is not set
+# CONFIG_PLIP is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 
@@ -329,7 +332,11 @@
 #
 # Joysticks
 #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
 
 #
 # Input core support is needed for joysticks
@@ -367,24 +374,30 @@
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
 # CONFIG_ADFS_FS is not set
 # CONFIG_ADFS_FS_RW is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
 # CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
 # CONFIG_FAT_FS is not set
 # CONFIG_MSDOS_FS is not set
 # CONFIG_UMSDOS_FS is not set
 # CONFIG_VFAT_FS is not set
 # CONFIG_EFS_FS is not set
 # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
 # CONFIG_RAMFS is not set
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_MINIX_FS is not set
-# CONFIG_VXFS_FS is not set
+# CONFIG_FREEVXFS_FS is not set
 # CONFIG_NTFS_FS is not set
 # CONFIG_NTFS_RW is not set
 # CONFIG_HPFS_FS is not set
@@ -398,7 +411,6 @@
 # CONFIG_ROMFS_FS is not set
 CONFIG_EXT2_FS=y
 # CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set
 # CONFIG_UDF_FS is not set
 # CONFIG_UDF_RW is not set
 # CONFIG_UFS_FS is not set
@@ -408,6 +420,7 @@
 # Network File Systems
 #
 # CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_ROOT_NFS=y
@@ -441,6 +454,7 @@
 # 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_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
@@ -459,9 +473,107 @@
 # CONFIG_USB is not set
 
 #
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+#   Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
 # Input core support
 #
 # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
 
 #
 # Kernel hacking
@@ -469,4 +581,3 @@
 CONFIG_CROSSCOMPILE=y
 # CONFIG_REMOTE_DEBUG is not set
 # CONFIG_MAGIC_SYSRQ is not set
-# CONFIG_MIPS_UNCACHED is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/defconfig-ip22 linux/arch/mips64/defconfig-ip22
--- v2.4.9/linux/arch/mips64/defconfig-ip22	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/defconfig-ip22	Sun Sep  9 10:43:02 2001
@@ -149,6 +149,7 @@
 #
 # CONFIG_PHONE is not set
 # CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
 
 #
 # ATA/IDE/MFM/RLL support
@@ -193,6 +194,7 @@
 # CONFIG_SCSI_AHA1740 is not set
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_IN2000 is not set
 # CONFIG_SCSI_AM53C974 is not set
@@ -209,6 +211,7 @@
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_NCR_D700 is not set
 # CONFIG_SCSI_NCR53C7xx is not set
 # CONFIG_SCSI_PAS16 is not set
 # CONFIG_SCSI_PCI2000 is not set
@@ -222,15 +225,6 @@
 # CONFIG_SCSI_DEBUG is not set
 
 #
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
 # Network device support
 #
 CONFIG_NETDEVICES=y
@@ -244,18 +238,20 @@
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
-# CONFIG_NET_SB1000 is not set
 
 #
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_LANCE is not set
 # CONFIG_NET_VENDOR_SMC is not set
 # CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_AT1700 is not set
-# CONFIG_DEPCA is not set
 # CONFIG_NET_ISA is not set
 # CONFIG_NET_PCI is not set
 # CONFIG_NET_POCKET is not set
@@ -265,11 +261,15 @@
 # Ethernet (1000 Mbit)
 #
 # CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 
@@ -336,7 +336,11 @@
 #
 # Joysticks
 #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
 
 #
 # Input core support is needed for joysticks
@@ -353,6 +357,7 @@
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
 
 #
 # Ftape, the floppy tape device driver
@@ -374,24 +379,30 @@
 CONFIG_AUTOFS4_FS=y
 # CONFIG_REISERFS_FS is not set
 # CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
 # CONFIG_ADFS_FS is not set
 # CONFIG_ADFS_FS_RW is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
 # CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
 # CONFIG_FAT_FS is not set
 # CONFIG_MSDOS_FS is not set
 # CONFIG_UMSDOS_FS is not set
 # CONFIG_VFAT_FS is not set
 # CONFIG_EFS_FS is not set
 # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
 # CONFIG_RAMFS is not set
 CONFIG_ISO9660_FS=y
 # CONFIG_JOLIET is not set
 # CONFIG_MINIX_FS is not set
-# CONFIG_VXFS_FS is not set
+# CONFIG_FREEVXFS_FS is not set
 # CONFIG_NTFS_FS is not set
 # CONFIG_NTFS_RW is not set
 # CONFIG_HPFS_FS is not set
@@ -405,7 +416,6 @@
 # CONFIG_ROMFS_FS is not set
 CONFIG_EXT2_FS=y
 # CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set
 # CONFIG_UDF_FS is not set
 # CONFIG_UDF_RW is not set
 # CONFIG_UFS_FS is not set
@@ -415,6 +425,7 @@
 # Network File Systems
 #
 # CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
 CONFIG_NFS_FS=y
 # CONFIG_NFS_V3 is not set
 CONFIG_ROOT_NFS=y
@@ -447,6 +458,7 @@
 # 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_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
@@ -484,9 +496,107 @@
 # CONFIG_USB is not set
 
 #
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+#   Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
 # Input core support
 #
 # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
 
 #
 # Kernel hacking
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/defconfig-ip27 linux/arch/mips64/defconfig-ip27
--- v2.4.9/linux/arch/mips64/defconfig-ip27	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/defconfig-ip27	Sun Sep  9 10:43:02 2001
@@ -24,6 +24,7 @@
 CONFIG_BOOT_ELF64=y
 CONFIG_ARC64=y
 CONFIG_COHERENT_IO=y
+CONFIG_MAPPED_PCI_IO=y
 CONFIG_PCI=y
 CONFIG_QL_ISP_A64=y
 CONFIG_L1_CACHE_SHIFT=7
@@ -142,6 +143,7 @@
 #
 # CONFIG_PHONE is not set
 # CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
 
 #
 # ATA/IDE/MFM/RLL support
@@ -184,6 +186,7 @@
 # CONFIG_SCSI_AHA1740 is not set
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_IN2000 is not set
 # CONFIG_SCSI_AM53C974 is not set
@@ -201,6 +204,7 @@
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_NCR_D700 is not set
 # CONFIG_SCSI_NCR53C7xx is not set
 # CONFIG_SCSI_NCR53C8XX is not set
 # CONFIG_SCSI_SYM53C8XX is not set
@@ -219,16 +223,6 @@
 # CONFIG_SCSI_U14_34F is not set
 
 #
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_PCI is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
 # Network device support
 #
 CONFIG_NETDEVICES=y
@@ -241,18 +235,22 @@
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-# CONFIG_NET_SB1000 is not set
 
 #
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
 CONFIG_SGI_IOC3_ETH=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_LANCE is not set
 # CONFIG_NET_VENDOR_SMC is not set
 # CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_DEPCA is not set
 # CONFIG_HP100 is not set
 # CONFIG_NET_ISA is not set
 # CONFIG_NET_PCI is not set
@@ -262,9 +260,14 @@
 # Ethernet (1000 Mbit)
 #
 # CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_FDDI is not set
+# CONFIG_PLIP is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 
@@ -329,7 +332,11 @@
 #
 # Joysticks
 #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
 
 #
 # Input core support is needed for joysticks
@@ -367,24 +374,30 @@
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
 # CONFIG_ADFS_FS is not set
 # CONFIG_ADFS_FS_RW is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
 # CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
 # CONFIG_FAT_FS is not set
 # CONFIG_MSDOS_FS is not set
 # CONFIG_UMSDOS_FS is not set
 # CONFIG_VFAT_FS is not set
 # CONFIG_EFS_FS is not set
 # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
 # CONFIG_RAMFS is not set
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_MINIX_FS is not set
-# CONFIG_VXFS_FS is not set
+# CONFIG_FREEVXFS_FS is not set
 # CONFIG_NTFS_FS is not set
 # CONFIG_NTFS_RW is not set
 # CONFIG_HPFS_FS is not set
@@ -398,7 +411,6 @@
 # CONFIG_ROMFS_FS is not set
 CONFIG_EXT2_FS=y
 # CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set
 # CONFIG_UDF_FS is not set
 # CONFIG_UDF_RW is not set
 # CONFIG_UFS_FS is not set
@@ -408,6 +420,7 @@
 # Network File Systems
 #
 # CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_ROOT_NFS=y
@@ -441,6 +454,7 @@
 # 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_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
@@ -459,9 +473,107 @@
 # CONFIG_USB is not set
 
 #
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+#   Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
 # Input core support
 #
 # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
 
 #
 # Kernel hacking
@@ -469,4 +581,3 @@
 CONFIG_CROSSCOMPILE=y
 # CONFIG_REMOTE_DEBUG is not set
 # CONFIG_MAGIC_SYSRQ is not set
-# CONFIG_MIPS_UNCACHED is not set
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/defconfig-ip32 linux/arch/mips64/defconfig-ip32
--- v2.4.9/linux/arch/mips64/defconfig-ip32	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/defconfig-ip32	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,511 @@
+#
+# Automatically generated make config: don't edit
+#
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+
+#
+# Machine selection
+#
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+CONFIG_SGI_IP32=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+CONFIG_BOOT_ELF32=y
+CONFIG_ARC32=y
+CONFIG_PC_KEYB=y
+CONFIG_PCI=y
+CONFIG_ARC_MEMORY=y
+CONFIG_L1_CACHE_SHIFT=5
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
+
+#
+# CPU selection
+#
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+CONFIG_CPU_R5000=y
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+
+#
+# General setup
+#
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+# CONFIG_MIPS_FPU_EMULATOR is not set
+CONFIG_NET=y
+CONFIG_PCI_NAMES=y
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
+CONFIG_SYSVIPC=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_SYSCTL=y
+# CONFIG_PROM_CONSOLE is not set
+CONFIG_BINFMT_ELF=y
+CONFIG_MIPS32_COMPAT=y
+CONFIG_BINFMT_ELF32=y
+CONFIG_BINFMT_MISC=y
+
+#
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+CONFIG_PCI_NAMES=y
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_BLK_DEV_INITRD is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_MD_RAID1 is not set
+# CONFIG_MD_RAID5 is not set
+# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+# CONFIG_NETLINK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_FILTER is not set
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set
+
+#
+#  
+#
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_LLC is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+# CONFIG_PHONE_IXJ is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#
+# CONFIG_IDE is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI support
+#
+CONFIG_SCSI=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+CONFIG_SD_EXTRA_DEVS=40
+CONFIG_CHR_DEV_ST=y
+CONFIG_CHR_DEV_OSST=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
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_7000FASST is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AHA152X is not set
+# CONFIG_SCSI_AHA1542 is not set
+# CONFIG_SCSI_AHA1740 is not set
+CONFIG_SCSI_AIC7XXX=y
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
+# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_IN2000 is not set
+# CONFIG_SCSI_AM53C974 is not set
+# CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_CPQFCTS is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_EATA_DMA 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_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_NCR53C7xx is not set
+# CONFIG_SCSI_NCR53C8XX is not set
+# CONFIG_SCSI_SYM53C8XX is not set
+# CONFIG_SCSI_PAS16 is not set
+# CONFIG_SCSI_PCI2000 is not set
+# CONFIG_SCSI_PCI2220I is not set
+# CONFIG_SCSI_PSI240I is not set
+# CONFIG_SCSI_QLOGIC_FAS is not set
+# CONFIG_SCSI_QLOGIC_ISP is not set
+# CONFIG_SCSI_QLOGIC_FC is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_SIM710 is not set
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_PCI is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set
+# CONFIG_I2O_PROC is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_NET_SB1000 is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_ISA is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_APRICOT is not set
+# CONFIG_CS89x0 is not set
+CONFIG_TULIP=y
+# CONFIG_DE4X5 is not set
+# CONFIG_DGRS is not set
+# CONFIG_DM9102 is not set
+CONFIG_EEPRO100=y
+# CONFIG_EEPRO100_PM is not set
+# CONFIG_LNE390 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_NE3210 is not set
+# CONFIG_ES3210 is not set
+# CONFIG_8139TOO is not set
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+# CONFIG_WINBOND_840 is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_LAN_SAA9730 is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+CONFIG_SERIAL=y
+CONFIG_SERIAL_CONSOLE=y
+# CONFIG_SERIAL_EXTENDED is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+CONFIG_MOUSE=y
+CONFIG_PSMOUSE=y
+# CONFIG_82C710_MOUSE is not set
+# CONFIG_PC110_PAD is not set
+
+#
+# Joysticks
+#
+# CONFIG_JOYSTICK is not set
+
+#
+# Input core support is needed for joysticks
+#
+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_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
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_FAT_FS is not set
+# CONFIG_MSDOS_FS is not set
+# CONFIG_UMSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+# CONFIG_CRAMFS is not set
+CONFIG_TMPFS=y
+# CONFIG_RAMFS is not set
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_SYSV_FS_WRITE is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+# CONFIG_SMB_FS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+# CONFIG_MSDOS_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_SMB_NLS is not set
+# CONFIG_NLS is not set
+CONFIG_KCORE_ELF=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# Input core support
+#
+# CONFIG_INPUT is not set
+
+#
+# Kernel hacking
+#
+CONFIG_CROSSCOMPILE=y
+# CONFIG_REMOTE_DEBUG is not set
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_MIPS_UNCACHED=y
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/binfmt_elf32.c linux/arch/mips64/kernel/binfmt_elf32.c
--- v2.4.9/linux/arch/mips64/kernel/binfmt_elf32.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/kernel/binfmt_elf32.c	Sun Sep  9 10:43:01 2001
@@ -32,7 +32,7 @@
 
 #define TASK32_SIZE		0x80000000UL
 #undef ELF_ET_DYN_BASE
-#define ELF_ET_DYN_BASE         (2 * TASK32_SIZE / 3)
+#define ELF_ET_DYN_BASE         (TASK32_SIZE / 3 * 2)
 
 #include <asm/processor.h>
 #include <linux/module.h>
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/entry.S linux/arch/mips64/kernel/entry.S
--- v2.4.9/linux/arch/mips64/kernel/entry.S	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/kernel/entry.S	Sun Sep  9 10:43:01 2001
@@ -5,8 +5,9 @@
  *
  * Low level exception handling
  *
- * Copyright (C) 1994 - 2000 by Ralf Baechle
+ * Copyright (C) 1994 - 2000, 2001 Ralf Baechle
  * Copyright (C) 1999, 2000 Silicon Graphics
+ * Copyright (C) 2001 MIPS Technologies, Inc.
  */
 #include <linux/config.h>
 
@@ -15,53 +16,61 @@
 #include <asm/mipsregs.h>
 #include <asm/stackframe.h>
 
+/* This duplicates the definition from <linux/sched.h> */
+#define PT_TRACESYS	0x00000002		/* tracing system calls */
+
+#define KU_USER 0x10
+
 		.text
-		.set	noreorder
 		.align 4
 FEXPORT(ret_from_fork)
+		move	a0, v0			# prev
 		jal	schedule_tail
-		 move	a0, v0					# prev
+		lw	t0, TASK_PTRACE($28)	# syscall tracing enabled?
+		andi	t0, PT_TRACESYS
+		bnez	t0, tracesys_exit
 		j	ret_from_sys_call
-		 nop
-FEXPORT(handle_softirq)
-		jal	do_softirq
-		 nop
-		b	9f
-		 nop
+
+tracesys_exit:
+		jal	syscall_trace
+		b	ret_from_sys_call
+
+EXPORT(ret_from_irq)
+EXPORT(ret_from_exception)
+		lw	t0, PT_STATUS(sp)	# returning to kernel mode?
+		andi	t0, t0, KU_USER
+		bnez	t0, ret_from_sys_call
+		j	restore_all
 
 reschedule:	jal	schedule 
-		 nop
 
 FEXPORT(ret_from_sys_call)
-FEXPORT(ret_from_irq)
-		la	t1, irq_stat		# softirq_active
-#ifdef CONFIG_SMP
-		lwu	t0, TASK_PROCESSOR($28)
-		dsll	t0, t0, 5
-		daddu	t1, t0
-#endif
-		lw	t0, 0 (t1)		# softirq_active
-		lw	t1, 4 (t1)		# softirq_mask.  unused delay slot
-		and	t0, t1
-		bnez	t0, handle_softirq
-9:		 ld	t0, PT_STATUS(sp)	# returning to kernel mode?
-
-		andi	t1, t0, 0x10
-		beqz	t1, return		# -> yes
-		 ld	t1, TASK_NEED_RESCHED($28)
-		bnez	t1, reschedule
-		lw	v0, TASK_SIGPENDING($28)
-		 move	a0, zero
-		beqz	v0, return
-		 nop
-		jal	do_signal
-		 move	a1, sp
+		mfc0	t0, CP0_STATUS	# need_resched and signals atomic test
+		ori	t0, t0, 1
+		xori	t0, t0, 1
+		mtc0	t0, CP0_STATUS
+
+		ld	v0, TASK_NEED_RESCHED($28)
+		lw	v1, TASK_SIGPENDING($28)
+		bnez	v0, reschedule
+		bnez	v1, signal_return
 
-FEXPORT(return)	.set	noat
+restore_all:	.set	noat
 		RESTORE_ALL
 		eret
 		.set	at
 
+signal_return:	.type	signal_return, @function
+
+		mfc0	t0, CP0_STATUS
+		ori	t0, t0, 1
+		mtc0	t0, CP0_STATUS
+
+		move	a0, zero
+		move	a1, sp
+		jal	do_signal
+		b	restore_all
+
 /*
  * Common spurious interrupt handler.
  */
@@ -75,6 +84,6 @@
 		lui     t1,%hi(spurious_count)
 		lw      t0,%lo(spurious_count)(t1)
 		addiu   t0,1
+		sw      t0,%lo(spurious_count)(t1)
 		j	ret_from_irq
-		 sw      t0,%lo(spurious_count)(t1)
 		END(spurious_interrupt)
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/init_task.c linux/arch/mips64/kernel/init_task.c
--- v2.4.9/linux/arch/mips64/kernel/init_task.c	Thu Feb 24 22:53:35 2000
+++ linux/arch/mips64/kernel/init_task.c	Mon Sep 17 15:29:09 2001
@@ -4,7 +4,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct vm_area_struct init_mmap = INIT_MMAP;
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
 static struct signal_struct init_signals = INIT_SIGNALS;
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/ioctl32.c linux/arch/mips64/kernel/ioctl32.c
--- v2.4.9/linux/arch/mips64/kernel/ioctl32.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/kernel/ioctl32.c	Sat Sep  1 11:01:28 2001
@@ -770,6 +770,8 @@
 	IOCTL32_HANDLER(BLKPG, blkpg_ioctl_trans),
 	IOCTL32_DEFAULT(BLKELVGET),
 	IOCTL32_DEFAULT(BLKELVSET),
+	IOCTL32_DEFAULT(BLKBSZGET),
+	IOCTL32_DEFAULT(BLKBSZSET),
 
 #ifdef CONFIG_MD
 	/* status */
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/linux32.c linux/arch/mips64/kernel/linux32.c
--- v2.4.9/linux/arch/mips64/kernel/linux32.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/kernel/linux32.c	Sun Sep  9 10:43:01 2001
@@ -1538,11 +1538,11 @@
 	err = -EFAULT;
 	if (get_user (pad, (u32 *)uptr))
 		return err;
-	if(third == SETVAL)
+	if ((third & ~IPC_64) == SETVAL)
 		fourth.val = (int)pad;
 	else
 		fourth.__pad = (void *)A(pad);
-	switch (third) {
+	switch (third & ~IPC_64) {
 
 	case IPC_INFO:
 	case IPC_RMID:
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/mips64_ksyms.c linux/arch/mips64/kernel/mips64_ksyms.c
--- v2.4.9/linux/arch/mips64/kernel/mips64_ksyms.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/kernel/mips64_ksyms.c	Sun Sep  9 10:43:01 2001
@@ -17,6 +17,7 @@
 #include <linux/in6.h>
 #include <linux/pci.h>
 
+#include <asm/bootinfo.h>
 #include <asm/dma.h>
 #include <asm/floppy.h>
 #include <asm/io.h>
@@ -37,6 +38,7 @@
 extern long __strnlen_user_nocheck_asm(const char *s);
 extern long __strnlen_user_asm(const char *s);
 
+EXPORT_SYMBOL(mips_machtype);
 EXPORT_SYMBOL(EISA_bus);
 
 /*
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/proc.c linux/arch/mips64/kernel/proc.c
--- v2.4.9/linux/arch/mips64/kernel/proc.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/kernel/proc.c	Sun Sep  9 10:43:01 2001
@@ -1,12 +1,10 @@
-/* $Id: proc.c,v 1.1 1999/09/28 22:25:51 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1995, 1996, 1999 Ralf Baechle
- *
- * XXX Rewrite this mess.
+ * Copyright (C) 1995, 1996, 1999, 2001 Ralf Baechle
+ * Copyright (C) 2001 MIPS Technologies, Inc.
  */
 #include <linux/delay.h>
 #include <linux/kernel.h>
@@ -17,7 +15,7 @@
 #include <asm/processor.h>
 #include <asm/watch.h>
 
-unsigned long unaligned_instructions;
+extern unsigned long unaligned_instructions;
 unsigned int vced_count, vcei_count;
 
 /*
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/ptrace.c linux/arch/mips64/kernel/ptrace.c
--- v2.4.9/linux/arch/mips64/kernel/ptrace.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/kernel/ptrace.c	Tue Sep 18 16:56:19 2001
@@ -29,6 +29,16 @@
 #include <asm/uaccess.h>
 
 /*
+ * Called by kernel/ptrace.c when detaching..
+ *
+ * Make sure single step bits etc are not set.
+ */
+void ptrace_disable(struct task_struct *child)
+{
+	/* Nothing to do.. */
+}
+
+/*
  * Tracing a 32-bit process with a 64-bit strace and vice versa will not
  * work.  I don't know how to fix this.
  */
@@ -104,6 +114,9 @@
 			break;
 		case FPR_BASE ... FPR_BASE + 31:
 			if (child->used_math) {
+				unsigned long *fregs =
+					(void *) child->thread.fpu.hard.fp_regs;
+
 #ifndef CONFIG_SMP
 				if (last_task_used_math == child) {
 					set_cp0_status(ST0_CU1, ST0_CU1);
@@ -112,7 +125,15 @@
 					last_task_used_math = NULL;
 				}
 #endif
-				tmp = child->thread.fpu.hard.fp_regs[addr - 32];
+				/*
+				 * The odd registers are actually the high
+				 * order bits of the values stored in the even
+				 * registers.
+				 */
+				if (addr & 1)
+					tmp = (unsigned long) (fregs[((addr & ~1) - 32)] >> 32);
+				else
+					tmp = (unsigned long) (fregs[(addr - 32)] & 0xffffffff);
 			} else {
 				tmp = -EIO;
 			}
@@ -171,7 +192,8 @@
 			regs->regs[addr] = data;
 			break;
 		case FPR_BASE ... FPR_BASE + 31: {
-			unsigned long *fregs;
+			unsigned long *fregs =
+				(void *) child->thread.fpu.hard.fp_regs;
 			if (child->used_math) {
 #ifndef CONFIG_SMP
 				if (last_task_used_math == child) {
@@ -188,8 +210,18 @@
 				       sizeof(child->thread.fpu.hard));
 				child->thread.fpu.hard.control = 0;
 			}
-			fregs = child->thread.fpu.hard.fp_regs;
-			fregs[addr - FPR_BASE] = data;
+			/*
+			 * The odd registers are actually the high order bits
+			 * of the values stored in the even registers - unless
+			 * we're using r2k_switch.S.
+			 */
+			if (addr & 1) {
+				fregs[(addr & ~1) - FPR_BASE] &= 0xffffffff;
+				fregs[(addr & ~1) - FPR_BASE] |= ((unsigned long) data) << 32;
+			} else {
+				fregs[addr - FPR_BASE] &= ~0xffffffffLL;
+				fregs[addr - FPR_BASE] |= data;
+			}
 			break;
 		}
 		case PC:
@@ -239,21 +271,9 @@
 		break;
 	}
 
-	case PTRACE_DETACH: { /* detach a process that was attached. */
-		ret = -EIO;
-		if ((unsigned long) data > _NSIG)
-			break;
-		child->ptrace = 0;
-		child->exit_code = data;
-		write_lock_irq(&tasklist_lock);
-		REMOVE_LINKS(child);
-		child->p_pptr = child->p_opptr;
-		SET_LINKS(child);
-		write_unlock_irq(&tasklist_lock);
-		wake_up_process(child);
-		ret = 0;
+	case PTRACE_DETACH: /* detach a process that was attached. */
+		ret = ptrace_detach(child, data);
 		break;
-	}
 
 	case PTRACE_SETOPTIONS: {
 		if (data & PTRACE_O_TRACESYSGOOD)
@@ -354,6 +374,9 @@
 			break;
 		case FPR_BASE ... FPR_BASE + 31:
 			if (child->used_math) {
+				unsigned long long *fregs
+					= (unsigned long long *)
+					&child->thread.fpu.hard.fp_regs[0];
 #ifndef CONFIG_SMP
 				if (last_task_used_math == child) {
 					set_cp0_status(ST0_CU1, ST0_CU1);
@@ -362,7 +385,15 @@
 					last_task_used_math = NULL;
 				}
 #endif
-				tmp = child->thread.fpu.hard.fp_regs[addr - 32];
+				/*
+				 * The odd registers are actually the high
+				 * order bits of the values stored in the even
+				 * registers.
+				 */
+				if (addr & 1)
+					tmp = (unsigned long) (fregs[((addr & ~1) - 32)] >> 32);
+				else
+					tmp = (unsigned long) (fregs[(addr - 32)] & 0xffffffff);
 			} else {
 				tmp = -EIO;
 			}
@@ -421,7 +452,8 @@
 			regs->regs[addr] = data;
 			break;
 		case FPR_BASE ... FPR_BASE + 31: {
-			unsigned long *fregs;
+			unsigned long *fregs =
+				(void *) child->thread.fpu.hard.fp_regs;
 			if (child->used_math) {
 #ifndef CONFIG_SMP
 				if (last_task_used_math == child) {
@@ -438,8 +470,18 @@
 				       sizeof(child->thread.fpu.hard));
 				child->thread.fpu.hard.control = 0;
 			}
-			fregs = child->thread.fpu.hard.fp_regs;
-			fregs[addr - FPR_BASE] = data;
+			/*
+			 * The odd registers are actually the high order bits
+			 * of the values stored in the even registers - unless
+			 * we're using r2k_switch.S.
+			 */
+			if (addr & 1) {
+				fregs[(addr & ~1) - FPR_BASE] &= 0xffffffff;
+				fregs[(addr & ~1) - FPR_BASE] |= ((unsigned long) data) << 32;
+			} else {
+				fregs[addr - FPR_BASE] &= ~0xffffffffLL;
+				fregs[addr - FPR_BASE] |= data;
+			}
 			break;
 		}
 		case PC:
@@ -489,21 +531,9 @@
 		break;
 	}
 
-	case PTRACE_DETACH: { /* detach a process that was attached. */
-		ret = -EIO;
-		if ((unsigned long) data > _NSIG)
-			break;
-		child->ptrace = 0;
-		child->exit_code = data;
-		write_lock_irq(&tasklist_lock);
-		REMOVE_LINKS(child);
-		child->p_pptr = child->p_opptr;
-		SET_LINKS(child);
-		write_unlock_irq(&tasklist_lock);
-		wake_up_process(child);
-		ret = 0;
+	case PTRACE_DETACH: /* detach a process that was attached. */
+		ret = ptrace_detach(child, data);
 		break;
-	}
 
 	case PTRACE_SETOPTIONS: {
 		if (data & PTRACE_O_TRACESYSGOOD)
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/r4k_cache.S linux/arch/mips64/kernel/r4k_cache.S
--- v2.4.9/linux/arch/mips64/kernel/r4k_cache.S	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/kernel/r4k_cache.S	Sun Sep  9 10:43:01 2001
@@ -1,5 +1,4 @@
-/* $Id: r4k_cache.S,v 1.1 1999/10/10 18:49:17 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/r4k_genex.S linux/arch/mips64/kernel/r4k_genex.S
--- v2.4.9/linux/arch/mips64/kernel/r4k_genex.S	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/kernel/r4k_genex.S	Sun Sep  9 10:43:01 2001
@@ -1,5 +1,4 @@
-/* $Id: r4k_genex.S,v 1.3 1999/11/23 17:12:49 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/r4k_switch.S linux/arch/mips64/kernel/r4k_switch.S
--- v2.4.9/linux/arch/mips64/kernel/r4k_switch.S	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/kernel/r4k_switch.S	Sun Sep  9 10:43:01 2001
@@ -1,5 +1,4 @@
-/* $Id: r4k_switch.S,v 1.1 1999/12/04 03:59:00 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/r4k_tlb_debug.c linux/arch/mips64/kernel/r4k_tlb_debug.c
--- v2.4.9/linux/arch/mips64/kernel/r4k_tlb_debug.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/kernel/r4k_tlb_debug.c	Sun Sep  9 10:43:01 2001
@@ -1,5 +1,4 @@
-/* $Id: r4k_tlb_debug.c,v 1.2 2000/01/17 23:32:46 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/r4k_tlb_glue.S linux/arch/mips64/kernel/r4k_tlb_glue.S
--- v2.4.9/linux/arch/mips64/kernel/r4k_tlb_glue.S	Tue Jul 11 11:14:48 2000
+++ linux/arch/mips64/kernel/r4k_tlb_glue.S	Sun Sep  9 10:43:01 2001
@@ -1,5 +1,4 @@
-/* $Id: r4k_tlb_glue.S,v 1.5 1999/11/23 17:12:49 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/scall_64.S linux/arch/mips64/kernel/scall_64.S
--- v2.4.9/linux/arch/mips64/kernel/scall_64.S	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/kernel/scall_64.S	Sun Sep  9 10:43:01 2001
@@ -3,8 +3,9 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 by Ralf Baechle
+ * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01 by Ralf Baechle
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ * Copyright (C) 2001 MIPS Technologies, Inc.
  */
 #include <linux/config.h>
 #include <asm/asm.h>
@@ -62,44 +63,39 @@
 	sd	v0, PT_R0(sp)		# set flag for syscall restarting
 1:	sd	v0, PT_R2(sp)		# result
 
-FEXPORT(ret_from_sys_call_64)
-	la	t1, irq_stat		# softirq_active
-#ifdef CONFIG_SMP
-	lwu	t0, TASK_PROCESSOR($28)
-	dsll	t0, t0, 5
-	daddu	t1, t0
-#endif
-	lw	t0, 0(t1)		# softirq_active
-	lw	t1, 4(t1)		# softirq_mask.  unused delay slot
-	and	t0, t1
-	bnez	t0, handle_softirq_64
+ret_from_sys_call:
+	mfc0	t0, CP0_STATUS
+	xori	t0, t0, 1
+	ori	t0, t0, 1
+	mtc0	t0, CP0_STATUS
 
-9:	ld	t0, PT_STATUS(sp)	# returning to kernel mode?
-	andi	t1, t0, 0x10
 	ld	t2, TASK_NEED_RESCHED($28)
-	beqz	t1, return_64		# -> yes
-	bnez	t2, reschedule_64
+	bnez	t2, reschedule
 	lw	v0, TASK_SIGPENDING($28)
-	move	a0, zero
-	beqz	v0, return_64
-	move	a1, sp
-	SAVE_STATIC
-	jal	do_signal
+	bnez	v0, signal_return
 
-return_64:
+restore_all:
 	RESTORE_SOME
 	RESTORE_SP
-	.set	mips3
 	eret
-	.set	mips0
 
-handle_softirq_64:
-	jal	do_softirq
-	b	9b
-reschedule_64:
+/* Put this behind restore_all for the sake of the branch prediction.  */
+signal_return:
+	.type	signal_return, @function
+
+	mfc0	t0, CP0_STATUS
+	ori	t0, t0, 1
+	mtc0	t0, CP0_STATUS
+
+	move	a0, zero
+	move	a1, sp
+	jal	do_signal
+	b	restore_all
+
+reschedule:
 	SAVE_STATIC
 	jal	schedule
-	b	ret_from_sys_call_64
+	b	ret_from_sys_call
 
 /* ------------------------------------------------------------------------ */
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/scall_o32.S linux/arch/mips64/kernel/scall_o32.S
--- v2.4.9/linux/arch/mips64/kernel/scall_o32.S	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/kernel/scall_o32.S	Sun Sep  9 10:43:01 2001
@@ -3,8 +3,9 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1995 - 2000 by Ralf Baechle
+ * Copyright (C) 1995 - 2000, 2001 by Ralf Baechle
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ * Copyright (C) 2001 MIPS Technologies, Inc.
  *
  * Hairy, the userspace application uses a different argument passing
  * convention than the kernel, so we have to translate things from o32
@@ -18,6 +19,7 @@
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
 #include <asm/unistd.h>
+#include <asm/sysmips.h>
 
 /* This duplicates the definition from <linux/sched.h> */
 #define PT_TRACESYS	0x00000002	/* tracing system calls */
@@ -34,14 +36,6 @@
 	SAVE_SOME
 	STI
 	.set	at
-#if DEBUG_MIPS64
- jal dodebug
- ld $4, PT_R4(sp)
- ld $5, PT_R5(sp)
- ld $6, PT_R6(sp)
- ld $7, PT_R7(sp)
- ld $2, PT_R2(sp)
-#endif
 	ld	t1, PT_EPC(sp)		# skip syscall on return
 
 	subu	t0, v0, __NR_Linux32	# check syscall number
@@ -60,59 +54,50 @@
 	bgez	t0, stackargs
 
 stack_done:
-	ld	t0, TASK_PTRACE($28)	# syscall tracing enabled?
-	andi	t0, PT_TRACESYS
-	bnez	t0, trace_a_syscall
-
-	jalr	t2			# Do The Real Thing (TM)
-
-	li	t0, -EMAXERRNO - 1	# error?
-	sltu	t0, t0, v0
-	sd	t0, PT_R7(sp)		# set error flag
-	beqz	t0, 1f
+		ld	t0, TASK_PTRACE($28)	# syscall tracing enabled?
+		andi	t0, PT_TRACESYS
+		bnez	t0, trace_a_syscall
+
+		jalr	t2			# Do The Real Thing (TM)
+
+		li	t0, -EMAXERRNO - 1	# error?
+		sltu	t0, t0, v0
+		sd	t0, PT_R7(sp)		# set error flag
+		beqz	t0, 1f
+
+		negu	v0			# error
+		sd	v0, PT_R0(sp)		# flag for syscall restarting
+1:		sd	v0, PT_R2(sp)		# result
 
-	negu	v0			# error
-	sd	v0, PT_R0(sp)		# set flag for syscall restarting
-1:	sd	v0, PT_R2(sp)		# result
-	
 FEXPORT(o32_ret_from_sys_call)
-	la	t1, irq_stat		# softirq_active
-#ifdef CONFIG_SMP
-	lwu	t0, TASK_PROCESSOR($28)
-	dsll	t0, t0, 5
-	daddu	t1, t0
-#endif
-	lw	t0, 0(t1)		# softirq_active
-	lw	t1, 4(t1)		# softirq_mask.  unused delay slot
-	and	t0, t1
-	bnez	t0, o32_handle_softirq
-
-9:	ld	t0,PT_STATUS(sp)	# returning to kernel mode?
-	andi	t1, t0, 0x10
-	ld	t2, TASK_NEED_RESCHED($28)
-	beqz	t1, o32_return		# -> yes
-	bnez	t2, o32_reschedule
-	lw	v0, TASK_SIGPENDING($28)
-	move	a0, zero
-	beqz	v0, o32_return
-	move	a1, sp
-	SAVE_STATIC
-	jal	do_signal
+		mfc0	t0, CP0_STATUS	# need_resched and signals atomic test
+		ori	t0, t0, 1
+		xori	t0, t0, 1
+		mtc0	t0, CP0_STATUS
+
+		ld	t2, TASK_NEED_RESCHED($28)
+		bnez	t2, o32_reschedule
+		lw	v0, TASK_SIGPENDING($28)
+		bnez	v0, signal_return
+
+restore_all:	RESTORE_SOME
+		RESTORE_SP
+		.set	mips3
+		eret
+		.set	mips0
+
+signal_return:	mfc0	t0, CP0_STATUS	# need_resched and signals atomic test
+		ori	t0, t0, 1
+		mtc0	t0, CP0_STATUS
+		move	a0, zero
+		move	a1, sp
+		SAVE_STATIC
+		jal	do_signal
 
-o32_return:
-	RESTORE_SOME
-	RESTORE_SP
-	.set	mips3
-	eret
-	.set	mips0
-
-o32_handle_softirq:
-	jal	do_softirq
-	b	9b
 o32_reschedule:
-	SAVE_STATIC
-	jal	schedule
-	b	o32_ret_from_sys_call
+		SAVE_STATIC
+		jal	schedule
+		b	o32_ret_from_sys_call
 
 /* ------------------------------------------------------------------------ */
 
@@ -205,6 +190,47 @@
 	sd	t0, PT_R7(sp)
 	j	ret_from_sys_call
 	END(handle_sys)
+
+	LEAF(mips_atomic_set)
+	ld	v1, THREAD_CURDS($28)
+	daddiu	a0, a1, 4
+	or	a0, a0, a1
+	li	v0, -EFAULT
+	and	a0, a0, v1
+	bltz	a0, 9f
+
+	/* Ok, this is the ll/sc case.  World is sane :-)  */
+1:	ll	v0, (a1)
+	move	a0, a2
+2:	sc	a0, (a1)
+	beqz	a0, 1b
+
+	.section __ex_table,"a"
+	PTR	1b, bad_stack
+	PTR	2b, bad_stack
+	.previous
+
+1:	sd	v0, PT_R2(sp)		# result
+
+	/* Success, so skip usual error handling garbage.  */
+	ld	t0, TASK_PTRACE($28)	# syscall tracing enabled?
+	andi	t0, PT_TRACESYS
+	bnez	t0, 1f
+	b	o32_ret_from_sys_call
+
+1:	SAVE_STATIC
+	jal	syscall_trace
+	li	a3, 0			# success
+	j	ret_from_sys_call
+
+9:	li	v0, -EFAULT
+	jr	ra
+	END(mips_atomic_set)
+
+	LEAF(sys_sysmips)
+	beq	a0, MIPS_ATOMIC_SET, mips_atomic_set
+	j	_sys_sysmips
+	END(sys_sysmips)
 
 	.macro	syscalltable
 	sys	sys_syscall	0			/* 4000 */
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/setup.c linux/arch/mips64/kernel/setup.c
--- v2.4.9/linux/arch/mips64/kernel/setup.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/kernel/setup.c	Sun Sep  9 10:43:01 2001
@@ -81,7 +81,6 @@
  *
  * These are initialized so they are in the .data section
  */
-unsigned long mips_memory_upper = KSEG0;
 unsigned long mips_cputype = CPU_UNKNOWN;
 unsigned long mips_machtype = MACH_UNKNOWN;
 unsigned long mips_machgroup = MACH_GROUP_UNKNOWN;
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/signal.c linux/arch/mips64/kernel/signal.c
--- v2.4.9/linux/arch/mips64/kernel/signal.c	Wed Jan 24 15:22:55 2001
+++ linux/arch/mips64/kernel/signal.c	Sun Sep  9 10:43:01 2001
@@ -267,8 +267,7 @@
 	struct ucontext rs_uc;
 };
 
-asmlinkage void
-sys_sigreturn(abi64_no_regargs, struct pt_regs regs)
+asmlinkage void sys_sigreturn(abi64_no_regargs, struct pt_regs regs)
 {
 	struct sigframe *frame;
 	sigset_t blocked;
@@ -304,8 +303,7 @@
 	force_sig(SIGSEGV, current);
 }
 
-asmlinkage void
-sys_rt_sigreturn(abi64_no_regargs, struct pt_regs regs)
+asmlinkage void sys_rt_sigreturn(abi64_no_regargs, struct pt_regs regs)
 {
 	struct rt_sigframe *frame;
 	sigset_t set;
@@ -346,8 +344,8 @@
 	force_sig(SIGSEGV, current);
 }
 
-static int inline
-setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
+static int inline setup_sigcontext(struct pt_regs *regs,
+				   struct sigcontext *sc)
 {
 	int err = 0;
 
@@ -392,8 +390,8 @@
 /*
  * Determine which stack to use..
  */
-static inline void *
-get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
+static inline void *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
+				 size_t frame_size)
 {
 	unsigned long sp;
 
@@ -407,9 +405,8 @@
 	return (void *)((sp - frame_size) & ALMASK);
 }
 
-static void inline
-setup_frame(struct k_sigaction * ka, struct pt_regs *regs,
-            int signr, sigset_t *set)
+static void inline setup_frame(struct k_sigaction * ka, struct pt_regs *regs,
+			       int signr, sigset_t *set)
 {
 	struct sigframe *frame;
 	int err = 0;
@@ -470,9 +467,9 @@
 	force_sig(SIGSEGV, current);
 }
 
-static void inline
-setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs,
-               int signr, sigset_t *set, siginfo_t *info)
+static void inline setup_rt_frame(struct k_sigaction * ka,
+				  struct pt_regs *regs, int signr,
+				  sigset_t *set, siginfo_t *info)
 {
 	struct rt_sigframe *frame;
 	int err = 0;
@@ -489,10 +486,10 @@
 		/*
 		 * Set up the return code ...
 		 *
-		 *         li      v0, __NR_sigreturn
+		 *         li      v0, __NR_rt_sigreturn
 		 *         syscall
 		 */
-		err |= __put_user(0x24020000 + __NR_sigreturn,
+		err |= __put_user(0x24020000 + __NR_rt_sigreturn,
 		                  frame->rs_code + 0);
 		err |= __put_user(0x0000000c                 ,
 		                  frame->rs_code + 1);
@@ -546,9 +543,9 @@
 	force_sig(SIGSEGV, current);
 }
 
-static inline void
-handle_signal(unsigned long sig, struct k_sigaction *ka,
-	siginfo_t *info, sigset_t *oldset, struct pt_regs * regs)
+static inline void handle_signal(unsigned long sig, struct k_sigaction *ka,
+				 siginfo_t *info, sigset_t *oldset,
+				 struct pt_regs *regs)
 {
 	if (ka->sa.sa_flags & SA_SIGINFO)
 		setup_rt_frame(ka, regs, sig, oldset, info);
@@ -566,8 +563,8 @@
 	}
 }
 
-static inline void
-syscall_restart(struct pt_regs *regs, struct k_sigaction *ka)
+static inline void syscall_restart(struct pt_regs *regs,
+				   struct k_sigaction *ka)
 {
 	switch(regs->regs[0]) {
 	case ERESTARTNOHAND:
@@ -599,11 +596,6 @@
 	if (current->thread.mflags & MF_32BIT) {
 		return do_signal32(oldset, regs);
 	}
-#endif
-
-#ifdef CONFIG_BINFMT_IRIX
-	if (current->personality != PER_LINUX)
-		return do_irix_signal(oldset, regs);
 #endif
 
 	if (!oldset)
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/signal32.c linux/arch/mips64/kernel/signal32.c
--- v2.4.9/linux/arch/mips64/kernel/signal32.c	Wed Jan 24 15:22:55 2001
+++ linux/arch/mips64/kernel/signal32.c	Sun Sep  9 10:43:01 2001
@@ -152,10 +152,6 @@
 	sigset32_t *uset;
 	sigset_t newset, saveset;
 
-#if DEBUG_MIPS64
-printk("%s called.\n", __FUNCTION__);
-#endif
-
 	save_static(&regs);
 	uset = (sigset32_t *) regs.regs[4];
 	if (get_sigset(&newset, uset))
@@ -185,10 +181,6 @@
 	sigset_t newset, saveset;
         size_t sigsetsize;
 
-#if DEBUG_MIPS64
-printk("%s called.\n", __FUNCTION__);
-#endif
-
 	save_static(&regs);
 	/* XXX Don't preclude handling different sized sigset_t's.  */
 	sigsetsize = regs.regs[5];
@@ -359,10 +351,6 @@
 	struct sigframe *frame;
 	sigset_t blocked;
 
-#if DEBUG_MIPS64
-printk("%s called.\n", __FUNCTION__);
-#endif
-
 	frame = (struct sigframe *) regs.regs[29];
 	if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
 		goto badframe;
@@ -400,7 +388,6 @@
 	struct rt_sigframe *frame;
 	sigset_t set;
 	stack_t st;
-printk("%s called.\n", __FUNCTION__);
 
 	frame = (struct rt_sigframe *) regs.regs[29];
 	if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
@@ -580,10 +567,10 @@
 		/*
 		 * Set up the return code ...
 		 *
-		 *         li      v0, __NR_Linux32_sigreturn
+		 *         li      v0, __NR_Linux32_rt_sigreturn
 		 *         syscall
 		 */
-		err |= __put_user(0x24020000 + __NR_Linux32_sigreturn,
+		err |= __put_user(0x24020000 + __NR_Linux32_rt_sigreturn,
 		                  frame->rs_code + 0);
 		err |= __put_user(0x0000000c                 ,
 		                  frame->rs_code + 1);
@@ -683,10 +670,6 @@
 	struct k_sigaction *ka;
 	siginfo_t info;
 
-#if DEBUG_MIPS64
-printk("%s: delivering signal.\n", current->comm);
-#endif
-
 	if (!oldset)
 		oldset = &current->blocked;
 
@@ -785,9 +768,6 @@
 		if (regs->regs[0])
 			syscall_restart(regs, ka);
 		/* Whee!  Actually deliver the signal.  */
-#if DEBUG_MIPS64
-printk("%s: delivering signal.\n", __FUNCTION__);
-#endif
 		handle_signal(signr, ka, &info, oldset, regs);
 		return 1;
 	}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/syscall.c linux/arch/mips64/kernel/syscall.c
--- v2.4.9/linux/arch/mips64/kernel/syscall.c	Mon Mar 19 12:35:10 2001
+++ linux/arch/mips64/kernel/syscall.c	Sun Sep  9 10:43:01 2001
@@ -3,8 +3,9 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1995 - 2000 by Ralf Baechle
+ * Copyright (C) 1995 - 2000, 2001 by Ralf Baechle
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ * Copyright (C) 2001 MIPS Technologies, Inc.
  */
 #include <linux/errno.h>
 #include <linux/linkage.h>
@@ -129,7 +130,7 @@
 }
 
 asmlinkage int
-sys_sysmips(int cmd, long arg1, int arg2, int arg3)
+_sys_sysmips(int cmd, long arg1, int arg2, int arg3)
 {
 	int	*p;
 	char	*name;
@@ -155,50 +156,9 @@
 		return 0;
 	}
 
-	case MIPS_ATOMIC_SET: {
-		unsigned int tmp;
-
-		p = (int *) arg1;
-		errno = verify_area(VERIFY_WRITE, p, sizeof(*p));
-		if (errno)
-			return errno;
-		errno = 0;
-
-		__asm__(".set\tpush\t\t\t# sysmips(MIPS_ATOMIC, ...)\n\t"
-			".set\tnoreorder\n\t"
-			".set\tnoat\n\t"
-			"1:\tll\t%0, %4\n\t"
-			"2:\tmove\t$1, %3\n\t"
-			"3:\tsc\t$1, %1\n\t"
-			"beqzl\t$1, 2b\n\t"
-			"4:\t ll\t%0, %4\n\t"
-			".set\tpop\n\t"
-			".section\t.fixup,\"ax\"\n"
-			"5:\tli\t%2, 1\t\t\t# error\n\t"
-			".previous\n\t"
-			".section\t__ex_table,\"a\"\n\t"
-			".dword\t1b, 5b\n\t"
-			".dword\t3b, 5b\n\t"
-			".dword\t4b, 5b\n\t"
-			".previous\n\t"
-			: "=&r" (tmp), "=o" (* (u32 *) p), "=r" (errno)
-			: "r" (arg2), "o" (* (u32 *) p), "2" (errno)
-			: "$1");
-
-		if (errno)
-			return -EFAULT;
-
-		/* We're skipping error handling etc.  */
-		if (current->ptrace & PT_TRACESYS)
-			syscall_trace();
-
-		__asm__ __volatile__(
-			"move\t$29, %0\n\t"
-			"j\tret_from_sys_call"
-			: /* No outputs */
-			: "r" (&cmd));
-		/* Unreached */
-	}
+	case MIPS_ATOMIC_SET:
+		printk(KERN_CRIT "How did I get here?\n");
+		return -EINVAL;
 
 	case MIPS_FIXADE:
 		tmp = current->thread.mflags & ~3;
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/traps.c linux/arch/mips64/kernel/traps.c
--- v2.4.9/linux/arch/mips64/kernel/traps.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/kernel/traps.c	Sun Sep  9 10:43:01 2001
@@ -258,58 +258,91 @@
 	printk(KERN_DEBUG "Should send SIGFPE to %s\n", current->comm);
 }
 
-static inline int get_insn_opcode(struct pt_regs *regs, unsigned int *opcode)
-{
-	unsigned int *epc;
-
-	epc = (unsigned int *) (unsigned long) regs->cp0_epc;
-	if (regs->cp0_cause & CAUSEF_BD)
-		epc++;
-
-	if (verify_area(VERIFY_READ, epc, 4)) {
-		force_sig(SIGSEGV, current);
-		return 1;
-	}
-	*opcode = *epc;
-
-	return 0;
-}
-
 void do_bp(struct pt_regs *regs)
 {
 	unsigned int opcode, bcode;
+	unsigned int *epc;
+	siginfo_t info;
+
+	epc = (unsigned int *) regs->cp0_epc +
+	      ((regs->cp0_cause & CAUSEF_BD) != 0);
+	if (get_user(opcode, epc))
+		goto sigsegv;
 
 	/*
 	 * There is the ancient bug in the MIPS assemblers that the break
 	 * code starts left to bit 16 instead to bit 6 in the opcode.
 	 * Gas is bug-compatible ...
 	 */
-	if (get_insn_opcode(regs, &opcode))
-		return;
 	bcode = ((opcode >> 16) & ((1 << 20) - 1));
 
 	/*
 	 * (A short test says that IRIX 5.3 sends SIGTRAP for all break
 	 * insns, even for break codes that indicate arithmetic failures.
 	 * Weird ...)
+	 * But should we continue the brokenness???  --macro
 	 */
+	switch (bcode) {
+	case 6:
+	case 7:
+		if (bcode == 7)
+			info.si_code = FPE_INTDIV;
+		else
+			info.si_code = FPE_INTOVF;
+		info.si_signo = SIGFPE;
+		info.si_errno = 0;
+		info.si_addr = (void *)compute_return_epc(regs);
+		force_sig_info(SIGFPE, &info, current);
+		break;
+	default:
+		force_sig(SIGTRAP, current);
+	}
+
 	force_sig(SIGTRAP, current);
+	return;
+
+sigsegv:
+	force_sig(SIGSEGV, current);
 }
 
 void do_tr(struct pt_regs *regs)
 {
 	unsigned int opcode, bcode;
+	unsigned int *epc;
+	siginfo_t info;
+
+	epc = (unsigned int *) regs->cp0_epc +
+	      ((regs->cp0_cause & CAUSEF_BD) != 0);
+	if (get_user(opcode, epc))
+		goto sigsegv;
 
-	if (get_insn_opcode(regs, &opcode))
-		return;
 	bcode = ((opcode >> 6) & ((1 << 20) - 1));
 
 	/*
 	 * (A short test says that IRIX 5.3 sends SIGTRAP for all break
 	 * insns, even for break codes that indicate arithmetic failures.
 	 * Wiered ...)
+	 * But should we continue the brokenness???  --macro
 	 */
-	force_sig(SIGTRAP, current);
+	switch (bcode) {
+	case 6:
+	case 7:
+		if (bcode == 7)
+			info.si_code = FPE_INTDIV;
+		else
+			info.si_code = FPE_INTOVF;
+		info.si_signo = SIGFPE;
+		info.si_errno = 0;
+		info.si_addr = (void *)compute_return_epc(regs);
+		force_sig_info(SIGFPE, &info, current);
+		break;
+	default:
+		force_sig(SIGTRAP, current);
+	}
+	return;
+
+sigsegv:
+	force_sig(SIGSEGV, current);
 }
 
 void do_ri(struct pt_regs *regs)
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/kernel/unaligned.c linux/arch/mips64/kernel/unaligned.c
--- v2.4.9/linux/arch/mips64/kernel/unaligned.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/kernel/unaligned.c	Sun Sep  9 10:43:01 2001
@@ -72,6 +72,7 @@
  *       A store crossing a page boundary might be executed only partially.
  *       Undo the partial store in this case.
  */
+#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/signal.h>
 #include <linux/smp.h>
@@ -378,7 +379,9 @@
 	return;
 }
 
+#ifdef CONFIG_PROC_FS
 unsigned long unaligned_instructions;
+#endif
 
 asmlinkage void do_ade(struct pt_regs *regs)
 {
@@ -399,7 +402,9 @@
 		goto sigbus;
 
 	emulate_load_store_insn(regs, regs->cp0_badvaddr, pc);
+#ifdef CONFIG_PROC_FS
 	unaligned_instructions++;
+#endif
 
 	return;
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/lib/csum_partial.S linux/arch/mips64/lib/csum_partial.S
--- v2.4.9/linux/arch/mips64/lib/csum_partial.S	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/lib/csum_partial.S	Sun Sep  9 10:43:01 2001
@@ -1,5 +1,4 @@
-/* $Id: csum_partial.S,v 1.1 1999/08/21 21:43:00 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/lib/csum_partial_copy.c linux/arch/mips64/lib/csum_partial_copy.c
--- v2.4.9/linux/arch/mips64/lib/csum_partial_copy.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/lib/csum_partial_copy.c	Sun Sep  9 10:43:01 2001
@@ -1,5 +1,4 @@
-/* $Id: csum_partial_copy.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/lib/dump_tlb.c linux/arch/mips64/lib/dump_tlb.c
--- v2.4.9/linux/arch/mips64/lib/dump_tlb.c	Sun Jul  9 22:18:16 2000
+++ linux/arch/mips64/lib/dump_tlb.c	Sun Sep  9 10:43:01 2001
@@ -168,14 +168,12 @@
 	printk("\n");
 }
 
-void
-dump_list_current(void *address)
+void dump_list_current(void *address)
 {
 	dump_list_process(current, address);
 }
 
-unsigned int
-vtop(void *address)
+unsigned int vtop(void *address)
 {
 	pgd_t	*pgd;
 	pmd_t	*pmd;
@@ -192,16 +190,17 @@
 	return paddr;
 }
 
-void
-dump16(unsigned long *p)
+void dump16(unsigned long *p)
 {
 	int i;
 
 	for(i=0;i<8;i++)
 	{
 		printk("*%08lx == %08lx, ",
-		       (unsigned long)p, (unsigned long)*p++);
+		       (unsigned long)p, (unsigned long)*p);
+		p++;
 		printk("*%08lx == %08lx\n",
-		       (unsigned long)p, (unsigned long)*p++);
+		       (unsigned long)p, (unsigned long)*p);
+		p++;
 	}
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/lib/floppy-no.c linux/arch/mips64/lib/floppy-no.c
--- v2.4.9/linux/arch/mips64/lib/floppy-no.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/lib/floppy-no.c	Sun Sep  9 10:43:01 2001
@@ -1,5 +1,4 @@
-/* $Id: floppy-no.c,v 1.1 1999/08/21 21:43:00 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/lib/ide-no.c linux/arch/mips64/lib/ide-no.c
--- v2.4.9/linux/arch/mips64/lib/ide-no.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/lib/ide-no.c	Sun Sep  9 10:43:01 2001
@@ -1,5 +1,4 @@
-/* $Id: ide-no.c,v 1.1 1999/08/21 21:43:00 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/lib/ide-std.c linux/arch/mips64/lib/ide-std.c
--- v2.4.9/linux/arch/mips64/lib/ide-std.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/lib/ide-std.c	Sun Sep  9 10:43:01 2001
@@ -1,12 +1,11 @@
-/* $Id: ide-std.c,v 1.1 1999/08/21 21:43:00 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
  * IDE routines for typical pc-like standard configurations.
  *
- * Copyright (C) 1998, 1999 by Ralf Baechle
+ * Copyright (C) 1998, 1999, 2001 by Ralf Baechle
  */
 #include <linux/sched.h>
 #include <linux/ide.h>
@@ -60,6 +59,7 @@
 	}
 	if (irq != NULL)
 		*irq = 0;
+	hw->io_ports[IDE_IRQ_OFFSET] = 0;
 }
 
 static int std_ide_request_irq(unsigned int irq,
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/lib/kbd-no.c linux/arch/mips64/lib/kbd-no.c
--- v2.4.9/linux/arch/mips64/lib/kbd-no.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/lib/kbd-no.c	Sun Sep  9 10:43:01 2001
@@ -1,5 +1,4 @@
-/* $Id: kbd-no.c,v 1.1 1999/08/21 21:43:00 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/lib/kbd-std.c linux/arch/mips64/lib/kbd-std.c
--- v2.4.9/linux/arch/mips64/lib/kbd-std.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/lib/kbd-std.c	Sun Sep  9 10:43:01 2001
@@ -1,5 +1,4 @@
-/* $Id: kbd-std.c,v 1.1 1999/08/21 21:43:01 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/lib/memcpy.S linux/arch/mips64/lib/memcpy.S
--- v2.4.9/linux/arch/mips64/lib/memcpy.S	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/lib/memcpy.S	Sun Sep  9 10:43:02 2001
@@ -5,7 +5,7 @@
  *
  * Unified implementation of memcpy, memmove and the __copy_user backend.
  *
- * Copyright (C) 1998, 1999, 2000 Ralf Baechle
+ * Copyright (C) 1998, 1999, 2000, 2001 Ralf Baechle
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  *
  * For __rmemcpy and memmove an exception is always a kernel bug, therefore
@@ -238,10 +238,8 @@
 	 andi	ta2, a2, 0x40
 
 move_128bytes:
-#if (_MIPS_ISA == _MIPS_ISA_MIPS4)
-	pref	0, 2*128(a0)
-	pref	1, 2*128(a1)
-#endif
+	PREF	(0, 2*128(a0))
+	PREF	(1, 2*128(a1))
 	MOVE_BIGGERCHUNK(a1, a0, 0x00, ta0, ta1, ta3, t0)
 	MOVE_BIGGERCHUNK(a1, a0, 0x40, ta0, ta1, ta3, t0)
 	dsubu	t8, t8, 0x01
@@ -454,16 +452,21 @@
 
 	.align	5
 LEAF(memmove)
-	sltu	ta0, a0, a1			# dst < src -> memcpy
-	bnez	ta0, memcpy
-	 daddu	v0, a0, a2
-	sltu	ta0, v0, a1			# dst + len < src -> non-
-	bnez	ta0, __memcpy			# overlapping, can use memcpy
+	daddu	t0, a0, a2
+	sltu	t0, a1, t0			# dst + len <= src -> memcpy
+	daddu	t1, a1, a2
+	sltu	t1, a0, t1			# dst >= src + len -> memcpy
+	and	t0, t1
+	beqz	t0, __memcpy
+
 	 move	v0, a0				/* return value */
 	beqz	a2, r_out
 	END(memmove)
 
 LEAF(__rmemcpy)					/* a0=dst a1=src a2=len */
+	sltu	t0, a1, a0
+	beqz	t0, r_end_bytes_up		# src >= dst
+	 nop
 	daddu	a0, a2				# dst = dst + len
 	daddu	a1, a2				# src = src + len
 
@@ -615,6 +618,17 @@
 	 dsubu	a0, a0, 0x1
 
 r_out:
+	jr      ra
+	 move   a2, zero
+
+r_end_bytes_up:
+	lb	t0, (a1)
+	dsubu	a2, a2, 0x1
+	sb	t0, (a0)
+	daddu	a1, a1, 0x1
+	bnez	a2, r_end_bytes_up
+	 daddu	a0, a0, 0x1
+
 	jr	ra
 	 move	a2, zero
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/lib/strlen_user.S linux/arch/mips64/lib/strlen_user.S
--- v2.4.9/linux/arch/mips64/lib/strlen_user.S	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/lib/strlen_user.S	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: strlen_user.S,v 1.2 1999/11/19 20:35:22 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/lib/strncpy_user.S linux/arch/mips64/lib/strncpy_user.S
--- v2.4.9/linux/arch/mips64/lib/strncpy_user.S	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/lib/strncpy_user.S	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: strncpy_user.S,v 1.2 1999/11/19 20:35:23 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/lib/strnlen_user.S linux/arch/mips64/lib/strnlen_user.S
--- v2.4.9/linux/arch/mips64/lib/strnlen_user.S	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/lib/strnlen_user.S	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: strnlen_user.S,v 1.1 1999/11/19 20:35:23 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/math-emu/cp1emu.c linux/arch/mips64/math-emu/cp1emu.c
--- v2.4.9/linux/arch/mips64/math-emu/cp1emu.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/mips64/math-emu/cp1emu.c	Sun Sep  9 10:43:02 2001
@@ -53,7 +53,9 @@
 
 #include <asm/asm.h>
 #include <asm/branch.h>
+#include <asm/bootinfo.h>
 #include <asm/byteorder.h>
+#include <asm/cpu.h>
 #include <asm/inst.h>
 #include <asm/uaccess.h>
 #include <asm/processor.h>
@@ -851,11 +853,8 @@
 	current->thread.dsemul_epc = (unsigned long) cpc;
 	current->thread.dsemul_aerpc = (unsigned long) &dsemul_insns[1];
 	xcp->cp0_epc = VA_TO_REG & dsemul_insns[0];
+	flush_cache_sigtramp((unsigned long) dsemul_insns);
 
-	/* What we'd really like to do is just flush the line(s) of the */
-	/* icache containing the dsemulret instructions, but there's no */
-	/* mechanism to do this yet...  */
-	flush_cache_all();
 	return SIGILL;		/* force out of emulation loop */
 }
 
@@ -1708,6 +1707,9 @@
 
 	oldepc = xcp->cp0_epc;
 	do {
+		if (current->need_resched)
+			schedule();
+
 		prevepc = xcp->cp0_epc;
 		insn = mips_get_word(xcp, REG_TO_VA(xcp->cp0_epc), &err);
 		if (err) {
@@ -1718,6 +1720,9 @@
 			sig = cop1Emulate(xcptno, xcp, ctx);
 		else
 			xcp->cp0_epc += 4;	/* skip nops */
+
+		if (mips_cpu.options & MIPS_CPU_FPU)
+			break;
 	} while (xcp->cp0_epc > prevepc && sig == 0);
 
 	/* SIGILL indicates a non-fpu instruction */
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/atlas/Makefile linux/arch/mips64/mips-boards/atlas/Makefile
--- v2.4.9/linux/arch/mips64/mips-boards/atlas/Makefile	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/atlas/Makefile	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,42 @@
+#
+# Carsten Langgaard, carstenl@mips.com
+# Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+#
+# ########################################################################
+#
+# This program is free software; you can distribute it and/or modify it
+# under the terms of the GNU General Public License (Version 2) as
+# published by the Free Software Foundation.
+# 
+# This program is distributed in the hope 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.
+#
+# #######################################################################
+#
+# Makefile for the MIPS Atlas specific kernel interface routines
+# under Linux.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+# Note 2! The CFLAGS definitions are now in the main makefile...
+
+.S.s:
+	$(CPP) $(CFLAGS) $< -o $*.s
+.S.o:
+	$(CC) $(CFLAGS) -c $< -o $*.o
+
+all: atlas.o
+
+O_TARGET := atlas.o
+
+obj-y   := atlas_int.o atlas_rtc.o atlas_setup.o
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/atlas/atlas_int.c linux/arch/mips64/mips-boards/atlas/atlas_int.c
--- v2.4.9/linux/arch/mips64/mips-boards/atlas/atlas_int.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/atlas/atlas_int.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,249 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * Routines for generic manipulation of the interrupts found on the MIPS 
+ * Atlas board.
+ *
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/interrupt.h>
+#include <linux/kernel_stat.h>
+
+#include <asm/irq.h>
+#include <asm/mips-boards/atlas.h>
+#include <asm/mips-boards/atlasint.h>
+#ifdef CONFIG_REMOTE_DEBUG
+#include <asm/gdb-stub.h>
+#endif
+
+struct atlas_ictrl_regs *atlas_hw0_icregs
+	= (struct atlas_ictrl_regs *)ATLAS_ICTRL_REGS_BASE;
+
+extern asmlinkage void mipsIRQ(void);
+extern void do_IRQ(int irq, struct pt_regs *regs);
+
+unsigned long spurious_count = 0;
+irq_desc_t irq_desc[NR_IRQS];
+
+#if 0
+#define DEBUG_INT(x...) printk(x)
+#else
+#define DEBUG_INT(x...)
+#endif
+
+void disable_atlas_irq(unsigned int irq_nr)
+{
+	atlas_hw0_icregs->intrsten = (1 << irq_nr);
+}
+
+void enable_atlas_irq(unsigned int irq_nr)
+{
+	atlas_hw0_icregs->intseten = (1 << irq_nr);
+}
+
+static unsigned int startup_atlas_irq(unsigned int irq)
+{
+	enable_atlas_irq(irq);
+	return 0; /* never anything pending */
+}
+
+#define shutdown_atlas_irq	disable_atlas_irq
+
+#define mask_and_ack_atlas_irq disable_atlas_irq
+
+static void end_atlas_irq(unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		enable_atlas_irq(irq);
+}
+
+static struct hw_interrupt_type atlas_irq_type = {
+	"Atlas",
+	startup_atlas_irq,
+	shutdown_atlas_irq,
+	enable_atlas_irq,
+	disable_atlas_irq,
+	mask_and_ack_atlas_irq,
+	end_atlas_irq,
+	NULL
+};
+
+int get_irq_list(char *buf)
+{
+	int i, len = 0;
+	int num = 0;
+	struct irqaction *action;
+
+	for (i = 0; i < ATLASINT_END; i++, num++) {
+		action = irq_desc[i].action;
+		if (!action) 
+			continue;
+		len += sprintf(buf+len, "%2d: %8d %c %s",
+			num, kstat.irqs[0][num],
+			(action->flags & SA_INTERRUPT) ? '+' : ' ',
+			action->name);
+		for (action=action->next; action; action = action->next) {
+			len += sprintf(buf+len, ",%s %s",
+				(action->flags & SA_INTERRUPT) ? " +" : "",
+				action->name);
+		}
+		len += sprintf(buf+len, " [hw0]\n");
+	}
+	return len;
+}
+
+int request_irq(unsigned int irq, 
+		void (*handler)(int, void *, struct pt_regs *),
+		unsigned long irqflags, 
+		const char * devname,
+		void *dev_id)
+{  
+        struct irqaction *action;
+
+	DEBUG_INT("request_irq: irq=%d, devname = %s\n", irq, devname);
+
+        if (irq >= ATLASINT_END)
+	        return -EINVAL;
+	if (!handler)
+	        return -EINVAL;
+
+	action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL);
+	if(!action)
+	        return -ENOMEM;
+
+	action->handler = handler;
+	action->flags = irqflags;
+	action->mask = 0;
+	action->name = devname;
+	action->dev_id = dev_id;
+	action->next = 0;
+	irq_desc[irq].action = action;
+	enable_atlas_irq(irq);
+
+	return 0;
+}
+
+void free_irq(unsigned int irq, void *dev_id)
+{
+	struct irqaction *action;
+
+	if (irq >= ATLASINT_END) {
+		printk("Trying to free IRQ%d\n",irq);
+		return;
+	}
+
+	action = irq_desc[irq].action;
+	irq_desc[irq].action = NULL;
+	disable_atlas_irq(irq);
+	kfree(action);
+}
+
+static inline int ls1bit32(unsigned int x)
+{
+	int b = 31, s;
+
+	s = 16; if (x << 16 == 0) s = 0; b -= s; x <<= s;
+	s =  8; if (x <<  8 == 0) s = 0; b -= s; x <<= s;
+	s =  4; if (x <<  4 == 0) s = 0; b -= s; x <<= s;
+	s =  2; if (x <<  2 == 0) s = 0; b -= s; x <<= s;
+	s =  1; if (x <<  1 == 0) s = 0; b -= s;
+
+	return b;
+}
+
+void atlas_hw0_irqdispatch(struct pt_regs *regs)
+{
+	struct irqaction *action;
+	unsigned long int_status;
+	int irq, cpu = smp_processor_id();
+
+	int_status = atlas_hw0_icregs->intstatus; 
+
+	/* if int_status == 0, then the interrupt has already been cleared */
+	if (int_status == 0)
+		return;
+
+	irq = ls1bit32(int_status);
+	action = irq_desc[irq].action;
+
+	DEBUG_INT("atlas_hw0_irqdispatch: irq=%d\n", irq);
+
+	/* if action == NULL, then we don't have a handler for the irq */
+	if ( action == NULL ) {
+	        printk("No handler for hw0 irq: %i\n", irq);
+		spurious_count++;
+		return;
+	}
+
+	irq_enter(cpu, irq);
+	kstat.irqs[0][irq]++;
+	action->handler(irq, action->dev_id, regs);
+	irq_exit(cpu, irq);
+
+	return;		
+}
+
+unsigned long probe_irq_on (void)
+{
+	return 0;
+}
+
+
+int probe_irq_off (unsigned long irqs)
+{
+	return 0;
+}
+
+#ifdef CONFIG_REMOTE_DEBUG
+extern void breakpoint(void);
+extern int remote_debug;
+#endif
+
+void __init init_IRQ(void)
+{
+	int i;
+
+	/* 
+	 * Mask out all interrupt by writing "1" to all bit position in 
+	 * the interrupt reset reg. 
+	 */
+	atlas_hw0_icregs->intrsten = 0xffffffff;    
+
+	/* Now safe to set the exception vector. */
+	set_except_vector(0, mipsIRQ);
+
+	for (i = 0; i <= ATLASINT_END; i++) {
+		irq_desc[i].status	= IRQ_DISABLED;
+		irq_desc[i].action	= 0;
+		irq_desc[i].depth	= 1;
+		irq_desc[i].handler	= &atlas_irq_type;
+	}
+
+#ifdef CONFIG_REMOTE_DEBUG
+	if (remote_debug) {
+		set_debug_traps();
+		breakpoint();
+	}
+#endif
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/atlas/atlas_rtc.c linux/arch/mips64/mips-boards/atlas/atlas_rtc.c
--- v2.4.9/linux/arch/mips64/mips-boards/atlas/atlas_rtc.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/atlas/atlas_rtc.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,58 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * RTC routines for Atlas style attached Dallas chip.
+ *
+ */
+#include <asm/mc146818rtc.h>
+#include <asm/mips-boards/atlas.h>
+
+
+static unsigned char atlas_rtc_read_data(unsigned long addr)
+{
+	volatile unsigned int *rtc_adr_reg = (void *)ATLAS_RTC_ADR_REG;
+	volatile unsigned int *rtc_dat_reg = (void *)ATLAS_RTC_DAT_REG;
+
+	*rtc_adr_reg = addr;
+
+	return *rtc_dat_reg;
+}
+
+static void atlas_rtc_write_data(unsigned char data, unsigned long addr)
+{
+	volatile unsigned int *rtc_adr_reg = (void *)ATLAS_RTC_ADR_REG;
+	volatile unsigned int *rtc_dat_reg = (void *)ATLAS_RTC_DAT_REG;
+
+	*rtc_adr_reg = addr;
+	*rtc_dat_reg = data;
+}
+
+static int atlas_rtc_bcd_mode(void)
+{
+	return 0;
+}
+
+struct rtc_ops atlas_rtc_ops = {
+	&atlas_rtc_read_data,
+	&atlas_rtc_write_data,
+	&atlas_rtc_bcd_mode
+};
+
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/atlas/atlas_setup.c linux/arch/mips64/mips-boards/atlas/atlas_setup.c
--- v2.4.9/linux/arch/mips64/mips-boards/atlas/atlas_setup.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/atlas/atlas_setup.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,123 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * Atlas specific setup, including init of the feature struct.
+ *
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/mc146818rtc.h>
+#include <linux/ioport.h>
+
+#include <asm/cpu.h>
+#include <asm/bootinfo.h>
+#include <asm/irq.h>
+#include <asm/mips-boards/generic.h>
+#include <asm/mips-boards/prom.h>
+#include <asm/mips-boards/gt64120.h>
+#include <asm/mips-boards/atlasint.h>
+
+#include <asm/mmu_context.h>
+
+#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_PROM_CONSOLE)
+extern void console_setup(char *, int *);
+char serial_console[20];
+#endif
+
+#ifdef CONFIG_REMOTE_DEBUG
+extern void rs_kgdb_hook(int);
+extern void saa9730_kgdb_hook(void);
+extern void breakpoint(void);
+int remote_debug = 0;
+#endif
+
+extern struct rtc_ops atlas_rtc_ops;
+
+extern void mips_reboot_setup(void);
+
+void __init atlas_setup(void)
+{
+#ifdef CONFIG_REMOTE_DEBUG
+	int rs_putDebugChar(char);
+	char rs_getDebugChar(void);
+	int saa9730_putDebugChar(char);
+	char saa9730_getDebugChar(void);
+	extern int (*putDebugChar)(char);
+	extern char (*getDebugChar)(void);
+#endif
+	char *argptr;
+
+	current_cpu_data.asid_cache = ASID_FIRST_VERSION;
+	TLBMISS_HANDLER_SETUP();
+
+	ioport_resource.end = 0x7fffffff;
+
+#ifdef CONFIG_SERIAL_CONSOLE
+	argptr = prom_getcmdline();
+	if ((argptr = strstr(argptr, "console=ttyS0")) == NULL) {
+		int i = 0;
+		char *s = prom_getenv("modetty0");
+		while(s[i] >= '0' && s[i] <= '9')
+			i++;
+		strcpy(serial_console, "ttyS0,");
+		strncpy(serial_console + 6, s, i);
+		prom_printf("Config serial console: %s\n", serial_console);
+		console_setup(serial_console, NULL);
+	}
+#endif	  
+
+#ifdef CONFIG_REMOTE_DEBUG
+	argptr = prom_getcmdline();
+	if ((argptr = strstr(argptr, "kgdb=ttyS")) != NULL) {
+		int line;
+		argptr += strlen("kgdb=ttyS");
+		if (*argptr != '0' && *argptr != '1')
+			printk("KGDB: Uknown serial line /dev/ttyS%c, "
+			       "falling back to /dev/ttyS1\n", *argptr);
+		line = *argptr == '0' ? 0 : 1;
+		printk("KGDB: Using serial line /dev/ttyS%d for session\n",
+		       line ? 1 : 0);
+
+		if(line == 0) {
+			rs_kgdb_hook(line);
+			putDebugChar = rs_putDebugChar;
+			getDebugChar = rs_getDebugChar;
+		} else {
+			saa9730_kgdb_hook();
+			putDebugChar = saa9730_putDebugChar;
+			getDebugChar = saa9730_getDebugChar;
+		}
+
+		prom_printf("KGDB: Using serial line /dev/ttyS%d for session, "
+			    "please connect your debugger\n", line ? 1 : 0);
+
+		remote_debug = 1;
+		/* Breakpoints and stuff are in atlas_irq_setup() */
+	}
+#endif
+	argptr = prom_getcmdline();
+
+	if ((argptr = strstr(argptr, "nofpu")) != NULL)
+		mips_cpu.options &= ~MIPS_CPU_FPU;
+
+	rtc_ops = &atlas_rtc_ops;
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/generic/Makefile linux/arch/mips64/mips-boards/generic/Makefile
--- v2.4.9/linux/arch/mips64/mips-boards/generic/Makefile	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/generic/Makefile	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,43 @@
+#
+# Carsten Langgaard, carstenl@mips.com
+# Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+#
+# ########################################################################
+#
+# This program is free software; you can distribute it and/or modify it
+# under the terms of the GNU General Public License (Version 2) as
+# published by the Free Software Foundation.
+# 
+# This program is distributed in the hope 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.
+#
+# #######################################################################
+#
+# Makefile for the MIPS boards generic routines under Linux.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+# Note 2! The CFLAGS definitions are now in the main makefile...
+
+.S.s:
+	$(CPP) $(CFLAGS) $< -o $*.s
+.S.o:
+	$(CC) $(CFLAGS) -c $< -o $*.o
+
+all: mipsboards.o
+
+O_TARGET := mipsboards.o
+
+obj-y                           := mipsIRQ.o pci.o reset.o display.o init.o \
+                                   memory.o printf.o cmdline.o time.o
+obj-$(CONFIG_REMOTE_DEBUG)      += gdb_hook.o
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/generic/cmdline.c linux/arch/mips64/mips-boards/generic/cmdline.c
--- v2.4.9/linux/arch/mips64/mips-boards/generic/cmdline.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/generic/cmdline.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,71 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ * 
+ * Kernel command line creation using the prom monitor (YAMON) argc/argv.
+ *
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/string.h>
+
+#include <asm/bootinfo.h>
+
+/*#define DEBUG_CMDLINE*/
+
+extern int prom_argc;
+extern int *_prom_argv;
+
+/*
+ * A 32-bit PROM pass arguments and environment as 32-bit pointer.
+ * This macro take care of sign extension.
+ */
+#define prom_argv(index) ((char *)(((int *)(int)_prom_argv)[(index)]))
+
+char arcs_cmdline[CL_SIZE];
+
+char * __init prom_getcmdline(void)
+{
+	return &(arcs_cmdline[0]);
+}
+
+
+void  __init prom_init_cmdline(void)
+{
+	char *cp;
+	int actr;
+
+	actr = 1; /* Always ignore argv[0] */
+
+	cp = &(arcs_cmdline[0]);
+	while(actr < prom_argc) {
+	        strcpy(cp, prom_argv(actr));
+		cp += strlen(prom_argv(actr));
+		*cp++ = ' ';
+		actr++;
+	}
+	if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */
+		--cp;
+	*cp = '\0';
+
+#ifdef DEBUG_CMDLINE
+	prom_printf("prom_init_cmdline: %s\n", &(arcs_cmdline[0]));
+#endif
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/generic/display.c linux/arch/mips64/mips-boards/generic/display.c
--- v2.4.9/linux/arch/mips64/mips-boards/generic/display.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/generic/display.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,47 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ * 
+ * Display routines for display messages in MIPS boards ascii display.
+ *
+ */
+
+#include <asm/mips-boards/generic.h>
+
+
+void mips_display_message(const char *str)
+{
+        volatile unsigned int *display = (void *)ASCII_DISPLAY_POS_BASE;
+	int i;
+
+	for (i = 0; i <= 14; i=i+2) {
+	         if (*str)
+		         display[i] = *str++;
+		 else
+		         display[i] = ' ';
+	}
+}
+
+void mips_display_word(unsigned int num)
+{
+        volatile unsigned int *display = (void *)ASCII_DISPLAY_WORD_BASE;
+	
+	*display = num;
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/generic/gdb_hook.c linux/arch/mips64/mips-boards/generic/gdb_hook.c
--- v2.4.9/linux/arch/mips64/mips-boards/generic/gdb_hook.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/generic/gdb_hook.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,202 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * This is the interface to the remote debugger stub.
+ *
+ */
+
+#include <linux/serialP.h>
+#include <linux/serial_reg.h>
+
+#include <asm/serial.h>
+#include <asm/io.h>
+
+static struct serial_state rs_table[RS_TABLE_SIZE] = {
+	SERIAL_PORT_DFNS	/* Defined in serial.h */
+};
+
+static struct async_struct kdb_port_info = {0};
+
+
+static __inline__ unsigned int serial_in(struct async_struct *info, int offset)
+{
+	return inb(info->port + offset);
+}
+
+static __inline__ void serial_out(struct async_struct *info, int offset,
+				int value)
+{
+	outb(value, info->port+offset);
+}
+
+void rs_kgdb_hook(int tty_no) {
+	int t;
+	struct serial_state *ser = &rs_table[tty_no];
+
+	kdb_port_info.state = ser;
+	kdb_port_info.magic = SERIAL_MAGIC;
+	kdb_port_info.port = ser->port;
+	kdb_port_info.flags = ser->flags;
+
+	/*
+	 * Clear all interrupts
+	 */
+	serial_in(&kdb_port_info, UART_LSR);
+	serial_in(&kdb_port_info, UART_RX);
+	serial_in(&kdb_port_info, UART_IIR);
+	serial_in(&kdb_port_info, UART_MSR);
+
+	/*
+	 * Now, initialize the UART 
+	 */
+	serial_out(&kdb_port_info, UART_LCR, UART_LCR_WLEN8);	/* reset DLAB */
+	if (kdb_port_info.flags & ASYNC_FOURPORT) {
+		kdb_port_info.MCR = UART_MCR_DTR | UART_MCR_RTS;
+		t = UART_MCR_DTR | UART_MCR_OUT1;
+	} else {
+		kdb_port_info.MCR 
+			= UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2;
+		t = UART_MCR_DTR | UART_MCR_RTS;
+	}
+
+	kdb_port_info.MCR = t;		/* no interrupts, please */
+	serial_out(&kdb_port_info, UART_MCR, kdb_port_info.MCR);
+	
+	/*
+	 * and set the speed of the serial port
+	 * (currently hardwired to 9600 8N1
+	 */
+
+	/* baud rate is fixed to 9600 (is this sufficient?)*/
+	t = kdb_port_info.state->baud_base / 9600;	
+	/* set DLAB */
+	serial_out(&kdb_port_info, UART_LCR, UART_LCR_WLEN8 | UART_LCR_DLAB);
+	serial_out(&kdb_port_info, UART_DLL, t & 0xff);/* LS of divisor */
+	serial_out(&kdb_port_info, UART_DLM, t >> 8);  /* MS of divisor */
+	/* reset DLAB */
+	serial_out(&kdb_port_info, UART_LCR, UART_LCR_WLEN8);
+}
+
+int rs_putDebugChar(char c)
+{
+
+	if (!kdb_port_info.state) { 	/* need to init device first */
+		return 0;
+	}
+
+	while ((serial_in(&kdb_port_info, UART_LSR) & UART_LSR_THRE) == 0)
+		;
+
+	serial_out(&kdb_port_info, UART_TX, c);
+
+	return 1;
+}
+
+char rs_getDebugChar(void)
+{
+	if (!kdb_port_info.state) { 	/* need to init device first */
+		return 0;
+	}
+
+	while (!(serial_in(&kdb_port_info, UART_LSR) & 1))
+		;
+
+	return(serial_in(&kdb_port_info, UART_RX));
+}
+
+
+#ifdef CONFIG_MIPS_ATLAS
+
+#include <asm/mips-boards/atlas.h>
+#include <asm/mips-boards/saa9730_uart.h>
+
+#define INB(a)     inb((unsigned long)a)
+#define OUTB(x,a)  outb(x,(unsigned long)a)
+
+/*
+ * This is the interface to the remote debugger stub
+ * if the Philips part is used for the debug port,
+ * called from the platform setup code.
+ *
+ * PCI init will not have been done yet, we make a
+ * universal assumption about the way the bootloader (YAMON)
+ * have located and set up the chip.
+ */
+static t_uart_saa9730_regmap *kgdb_uart = (void *)(ATLAS_SAA9730_REG + SAA9730_UART_REGS_ADDR);
+
+static int saa9730_kgdb_active = 0;
+
+void saa9730_kgdb_hook(void) 
+{
+        volatile unsigned char t;
+
+        /*
+         * Clear all interrupts
+         */
+	t = INB(&kgdb_uart->Lsr);
+	t += INB(&kgdb_uart->Msr);
+	t += INB(&kgdb_uart->Thr_Rbr);
+	t += INB(&kgdb_uart->Iir_Fcr);
+
+        /*
+         * Now, initialize the UART
+         */
+	/* 8 data bits, one stop bit, no parity */
+	OUTB(SAA9730_LCR_DATA8, &kgdb_uart->Lcr);
+
+        /* baud rate is fixed to 9600 (is this sufficient?)*/
+	OUTB(0, &kgdb_uart->BaudDivMsb); /* HACK - Assumes standard crystal */
+	OUTB(23, &kgdb_uart->BaudDivLsb); /* HACK - known for MIPS Atlas */
+
+	/* Set RTS/DTR active */
+	OUTB(SAA9730_MCR_DTR | SAA9730_MCR_RTS, &kgdb_uart->Mcr);
+	saa9730_kgdb_active = 1;
+}
+
+int saa9730_putDebugChar(char c)
+{
+
+        if (!saa9730_kgdb_active) {     /* need to init device first */
+                return 0;
+        }
+
+        while (!(INB(&kgdb_uart->Lsr) & SAA9730_LSR_THRE))
+                ;
+	OUTB(c, &kgdb_uart->Thr_Rbr);
+
+        return 1;
+}
+
+char saa9730_getDebugChar(void)
+{
+	char c;
+
+        if (!saa9730_kgdb_active) {     /* need to init device first */
+                return 0;
+        }
+        while (!(INB(&kgdb_uart->Lsr) & SAA9730_LSR_DR))
+                ;
+
+	c = INB(&kgdb_uart->Thr_Rbr);
+        return(c);
+}
+
+#endif
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/generic/init.c linux/arch/mips64/mips-boards/generic/init.c
--- v2.4.9/linux/arch/mips64/mips-boards/generic/init.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/generic/init.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,152 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * PROM library initialisation code.
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+
+#include <asm/io.h>
+#include <asm/mips-boards/prom.h>
+#include <asm/mips-boards/generic.h>
+#include <asm/mips-boards/gt64120.h>
+#include <asm/mips-boards/malta.h>
+
+/* Environment variable */
+typedef struct
+{
+    char *name;
+    char *val;
+}t_env_var;
+
+int prom_argc;
+int *_prom_argv, *_prom_envp;
+
+/*
+ * A 32-bit PROM pass arguments and environment as 32-bit pointer.
+ * This macro take care of sign extension.
+ */
+#define prom_envp(index) ((char *)(((int *)(int)_prom_envp)[(index)]))
+
+int init_debug = 0;
+
+char *prom_getenv(char *envname)
+{
+        /*
+	 * Return a pointer to the given environment variable.
+	 * We're using 64-bit pointers, but all pointers in the PROM 
+	 * structures are only 32-bit, so we need some workarounds.
+	 */
+	int i, index=0;
+
+	i = strlen(envname);
+
+	while(prom_envp(index)) {
+		if(strncmp(envname, prom_envp(index), i) == 0) {
+			return(prom_envp(index+1));
+		}
+		index += 2;
+	}
+
+	return(NULL);
+}
+
+static inline unsigned char str2hexnum(unsigned char c)
+{
+	if(c >= '0' && c <= '9')
+		return c - '0';
+	if(c >= 'a' && c <= 'f')
+		return c - 'a' + 10;
+	return 0; /* foo */
+}
+
+static inline void str2eaddr(unsigned char *ea, unsigned char *str)
+{
+	int i;
+
+	for(i = 0; i < 6; i++) {
+		unsigned char num;
+
+		if((*str == '.') || (*str == ':'))
+			str++;
+		num = str2hexnum(*str++) << 4;
+		num |= (str2hexnum(*str++));
+		ea[i] = num;
+	}
+}
+ 
+int get_ethernet_addr(char *ethernet_addr)
+{
+        char *ethaddr_str;
+
+        ethaddr_str = prom_getenv("ethaddr");
+	if (!ethaddr_str) {
+	        printk("ethaddr not set in boot prom\n");
+		return -1;
+	}
+	str2eaddr(ethernet_addr, ethaddr_str);
+
+	if (init_debug > 1)
+	{
+	        int i;
+		printk("get_ethernet_addr: ");
+	        for (i=0; i<5; i++)
+		        printk("%02x:", (unsigned char)*(ethernet_addr+i));
+		printk("%02x\n", *(ethernet_addr+i));
+	}
+
+	return 0;
+}
+
+int __init prom_init(int argc, char **argv, char **envp)
+{
+	prom_argc = argc;
+	_prom_argv = (int *)argv;
+	_prom_envp = (int *)envp;
+
+	mips_display_message("LINUX");
+
+	/*
+	 * Setup the North bridge to do Master byte-lane swapping when 
+	 * running in bigendian.
+	 */
+#if defined(__MIPSEL__)
+	GT_WRITE(GT_PCI0_CMD_OFS, GT_PCI0_CMD_MBYTESWAP_BIT |
+		 GT_PCI0_CMD_SBYTESWAP_BIT);
+#else
+	GT_WRITE(GT_PCI0_CMD_OFS, 0);
+#endif
+
+#if defined(CONFIG_MIPS_MALTA)
+	mips_io_port_base = MALTA_PORT_BASE;
+#else
+	mips_io_port_base = KSEG1;
+#endif
+
+	setup_prom_printf(0);
+	prom_printf("\nLINUX started...\n");
+	prom_init_cmdline();
+	prom_meminit();
+
+	return 0;
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/generic/memory.c linux/arch/mips64/mips-boards/generic/memory.c
--- v2.4.9/linux/arch/mips64/mips-boards/generic/memory.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/generic/memory.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,263 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * PROM library functions for acquiring/using memory descriptors given to 
+ * us from the YAMON.
+ * 
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/bootmem.h>
+
+#include <asm/bootinfo.h>
+#include <asm/page.h>
+
+#include <asm/mips-boards/prom.h>
+
+/*#define DEBUG*/
+
+enum yamon_memtypes {
+	yamon_dontuse,
+	yamon_prom,
+	yamon_free,
+};
+struct prom_pmemblock mdesc[PROM_MAX_PMEMBLOCKS];
+
+#define MEMTYPE_DONTUSE 0
+#define MEMTYPE_PROM    1
+#define MEMTYPE_FREE    2
+
+#ifdef DEBUG
+static char *mtypes[3] = {
+	"Dont use memory",
+	"YAMON PROM memory",
+	"Free memmory",
+};
+#endif
+
+/* References to section boundaries */
+extern char _end;
+
+#define PFN_ALIGN(x)    (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
+
+struct prom_pmemblock * __init prom_getmdesc(void)
+{
+	char *memsize_str;
+	unsigned int memsize;
+
+	memsize_str = prom_getenv("memsize");
+	if (!memsize_str) {
+		prom_printf("memsize not set in boot prom, set to default (32Mb)\n");
+		memsize = 0x02000000;
+	} else {
+#ifdef DEBUG
+		prom_printf("prom_memsize = %s\n", memsize_str);
+#endif
+		memsize = simple_strtol(memsize_str, NULL, 0);
+	}
+
+	memset(mdesc, 0, sizeof(mdesc));
+
+	mdesc[0].type = yamon_dontuse;
+	mdesc[0].base = 0x00000000;
+	mdesc[0].size = 0x00001000;
+
+	mdesc[1].type = yamon_prom;
+	mdesc[1].base = 0x00001000;
+	mdesc[1].size = 0x000ef000;
+
+#if (CONFIG_MIPS_MALTA)
+	/* 
+	 * The area 0x000f0000-0x000fffff is allocated for BIOS memory by the
+	 * south bridge and PCI access always forwarded to the ISA Bus and 
+	 * BIOSCS# is always generated.
+	 * This mean that this area can't be used as DMA memory for PCI 
+	 * devices.
+	 */
+	mdesc[2].type = yamon_dontuse;
+	mdesc[2].base = 0x000f0000;
+	mdesc[2].size = 0x00010000;
+#else
+	mdesc[2].type = yamon_prom;
+	mdesc[2].base = 0x000f0000;
+	mdesc[2].size = 0x00010000;
+#endif
+
+	mdesc[3].type = yamon_dontuse;
+	mdesc[3].base = 0x00100000;
+	mdesc[3].size = CPHYSADDR(PFN_ALIGN(&_end)) - mdesc[3].base;
+
+	mdesc[4].type = yamon_free;
+	mdesc[4].base = CPHYSADDR(PFN_ALIGN(&_end));
+	mdesc[4].size = memsize - mdesc[4].base;
+
+	return &mdesc[0];
+}
+
+int __init page_is_ram(unsigned long pagenr)
+{
+	if ((pagenr << PAGE_SHIFT) < mdesc[4].base + mdesc[4].size)
+		return 1;
+
+	return 0;
+}
+
+static struct prom_pmemblock pblocks[PROM_MAX_PMEMBLOCKS];
+
+static int __init prom_memtype_classify (unsigned int type)
+{
+	switch (type) {
+	case yamon_free:
+		return MEMTYPE_FREE;
+	case yamon_prom:
+		return MEMTYPE_PROM;
+	default:
+		return MEMTYPE_DONTUSE;
+	}
+}
+
+static inline unsigned long find_max_low_pfn(void)
+{
+	struct prom_pmemblock *p, *highest;
+	unsigned long pfn;
+
+	p = pblocks;
+	highest = 0;
+	while (p->size != 0) {
+		if (!highest || p->base > highest->base)
+			highest = p;
+		p++;
+        }
+
+	pfn = (highest->base + highest->size) >> PAGE_SHIFT;
+#ifdef DEBUG
+	prom_printf("find_max_low_pfn: 0x%lx pfns.\n", pfn);
+#endif
+	return pfn;
+}
+
+static inline struct prom_pmemblock *find_largest_memblock(void)
+{
+	struct prom_pmemblock *p, *largest;
+
+	p = pblocks;
+	largest = 0;
+	while (p->size != 0) {
+		if (!largest || p->size > largest->size)
+			largest = p;
+		p++;
+	}
+
+	return largest;
+}
+
+void __init prom_meminit(void)
+{
+	struct prom_pmemblock *largest, *p;
+	unsigned long bootmap_size;
+	int totram;
+	int i = 0;
+
+#ifdef DEBUG
+	prom_printf("YAMON MEMORY DESCRIPTOR dump:\n");
+	p = prom_getmdesc();
+	while (p->size) {
+		prom_printf("[%d,%p]: base<%08lx> size<%08lx> type<%s>\n",
+			    i, p, p->base, p->size, mtypes[p->type]);
+		p++;
+		i++;
+	}
+#endif
+	totram = 0;
+	i = 0;
+	p = prom_getmdesc();
+
+	while (p->size) {
+		pblocks[i].type = prom_memtype_classify (p->type);
+		pblocks[i].base = p->base;
+		pblocks[i].size = p->size;
+		switch (pblocks[i].type) {
+		case MEMTYPE_FREE:
+			totram += pblocks[i].size;
+#ifdef DEBUG
+			prom_printf("free_chunk[%d]: base=%08lx size=%d\n",
+				    i, pblocks[i].base, pblocks[i].size);
+#endif
+			i++;
+			break;
+		case MEMTYPE_PROM:
+#ifdef DEBUG
+		        prom_printf("prom_chunk[%d]: base=%08lx size=%d\n",
+				    i, pblocks[i].base, pblocks[i].size);
+#endif
+			i++;
+			break;
+		default:
+			break;
+		}
+		p++;
+	}
+	pblocks[i].base = 0xdeadbeef;
+	pblocks[i].size = 0; /* indicates last elem. of array */
+
+	max_low_pfn = find_max_low_pfn();
+	largest = find_largest_memblock();
+	bootmap_size = init_bootmem(largest->base >> PAGE_SHIFT, max_low_pfn);
+
+	for (i = 0; pblocks[i].size; i++)
+		if (pblocks[i].type == MEMTYPE_FREE)
+			free_bootmem(pblocks[i].base, pblocks[i].size);
+
+	/* This test is simpleminded.  It will fail if the bootmem bitmap
+	   falls into multiple adjacent PROM memory areas.  */
+	if (bootmap_size > largest->size) {
+		prom_printf("CRITIAL: overwriting PROM data.\n");
+		BUG();
+	}
+
+	/* Reserve the memory bootmap itself */
+	reserve_bootmem(largest->base, bootmap_size);
+	printk("PROMLIB: Total free ram %d bytes (%dK,%dMB)\n",
+	       totram, (totram/1024), (totram/1024/1024));
+}
+
+void prom_free_prom_memory (void)
+{
+	struct prom_pmemblock *p;
+	unsigned long freed = 0;
+	unsigned long addr;
+
+	for (p = pblocks; p->size != 0; p++) {
+		if (p->type != MEMTYPE_PROM)
+			continue;
+
+		addr = p->base;
+		while (addr < p->base + p->size) {
+		        ClearPageReserved(virt_to_page(__va(addr)));
+			set_page_count(virt_to_page(__va(addr)), 1);
+			free_page(__va(addr));
+			addr += PAGE_SIZE;
+			freed += PAGE_SIZE;
+		}
+	}
+	printk("Freeing prom memory: %ldkb freed\n", freed >> 10);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/generic/mipsIRQ.S linux/arch/mips64/mips-boards/generic/mipsIRQ.S
--- v2.4.9/linux/arch/mips64/mips-boards/generic/mipsIRQ.S	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/generic/mipsIRQ.S	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,122 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * Interrupt exception dispatch code.
+ *
+ */
+#include <linux/config.h>
+
+#include <asm/asm.h>
+#include <asm/mipsregs.h>
+#include <asm/regdef.h>
+#include <asm/stackframe.h>
+
+/* A lot of complication here is taken away because:
+ *
+ * 1) We handle one interrupt and return, sitting in a loop and moving across
+ *    all the pending IRQ bits in the cause register is _NOT_ the answer, the
+ *    common case is one pending IRQ so optimize in that direction.
+ *
+ * 2) We need not check against bits in the status register IRQ mask, that
+ *    would make this routine slow as hell.
+ *
+ * 3) Linux only thinks in terms of all IRQs on or all IRQs off, nothing in
+ *    between like BSD spl() brain-damage.
+ *
+ * Furthermore, the IRQs on the MIPS board look basically (barring software
+ * IRQs which we don't use at all and all external interrupt sources are
+ * combined together on hardware interrupt 0 (MIPS IRQ 2)) like:
+ *
+ *	MIPS IRQ	Source
+ *      --------        ------
+ *             0	Software (ignored)
+ *             1        Software (ignored)
+ *             2        Combined hardware interrupt (hw0)
+ *             3        Hardware (ignored)
+ *             4        Hardware (ignored)
+ *             5        Hardware (ignored)
+ *             6        Hardware (ignored)
+ *             7        R4k timer (what we use)
+ *
+ * We handle the IRQ according to _our_ priority which is:
+ *
+ * Highest ----     R4k Timer
+ * Lowest  ----     Combined hardware interrupt
+ *
+ * then we just return, if multiple IRQs are pending then we will just take
+ * another exception, big deal.
+ */
+
+	.text
+	.set	noreorder
+	.set	noat
+	.align	5
+	NESTED(mipsIRQ, PT_SIZE, sp)
+	SAVE_ALL
+	CLI
+	.set	at
+
+	mfc0	s0, CP0_CAUSE		# get irq mask
+
+	/* First we check for r4k counter/timer IRQ. */
+	andi	a0, s0, CAUSEF_IP7
+	beq	a0, zero, 1f
+	 andi	a0, s0, CAUSEF_IP2	# delay slot, check hw0 interrupt
+
+	/* Wheee, a timer interrupt. */
+	move	a0, sp
+	jal	mips_timer_interrupt
+	 nop
+
+	j	ret_from_irq
+	 nop
+
+1:
+	beq	a0, zero, 1f
+	 nop
+
+	/* Wheee, combined hardware level zero interrupt. */
+#if defined(CONFIG_MIPS_ATLAS)
+	jal	atlas_hw0_irqdispatch
+#elif defined(CONFIG_MIPS_MALTA)
+	jal	malta_hw0_irqdispatch
+#else
+#error "MIPS board not supported\n"	
+#endif
+	 move	a0, sp			# delay slot
+
+	j	ret_from_irq
+	 nop				# delay slot
+
+1:
+	/*
+	 * Here by mistake?  This is possible, what can happen is that by the
+	 * time we take the exception the IRQ pin goes low, so just leave if
+	 * this is the case.
+	 */
+	move	a1,s0
+	PRINT("Got interrupt: c0_cause = %08x\n")
+	mfc0	a1, CP0_EPC
+	PRINT("c0_epc = %08x\n")
+
+	j	ret_from_irq
+	 nop
+	END(mipsIRQ)
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/generic/pci.c linux/arch/mips64/mips-boards/generic/pci.c
--- v2.4.9/linux/arch/mips64/mips-boards/generic/pci.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/generic/pci.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,337 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * MIPS boards specific PCI support.
+ *
+ */
+#include <linux/config.h>
+
+#ifdef CONFIG_PCI
+
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+
+#include <asm/mips-boards/generic.h>
+#include <asm/mips-boards/gt64120.h>
+#ifdef CONFIG_MIPS_MALTA
+#include <asm/mips-boards/malta.h>
+#endif
+
+#define PCI_ACCESS_READ  0
+#define PCI_ACCESS_WRITE 1
+
+static int
+mips_pcibios_config_access(unsigned char access_type, struct pci_dev *dev,
+                           unsigned char where, u32 *data)
+{
+	unsigned char bus = dev->bus->number;
+	unsigned char dev_fn = dev->devfn;
+        u32 intr;
+
+	if ((bus == 0) && (dev_fn >= PCI_DEVFN(31,0)))
+	        return -1; /* Because of a bug in the galileo (for slot 31). */
+
+	/* Clear cause register bits */
+	GT_WRITE(GT_INTRCAUSE_OFS, ~(GT_INTRCAUSE_MASABORT0_BIT | 
+	                             GT_INTRCAUSE_TARABORT0_BIT));
+
+	/* Setup address */
+	GT_WRITE(GT_PCI0_CFGADDR_OFS, 
+		 (bus         << GT_PCI0_CFGADDR_BUSNUM_SHF)   |
+		 (dev_fn      << GT_PCI0_CFGADDR_FUNCTNUM_SHF) |
+		 ((where / 4) << GT_PCI0_CFGADDR_REGNUM_SHF)   |
+		 GT_PCI0_CFGADDR_CONFIGEN_BIT);
+
+	if (access_type == PCI_ACCESS_WRITE) {
+	        if (bus == 0 && dev_fn == 0) {
+		        /* 
+			 * Galileo is acting differently than other devices. 
+			 */
+		        GT_WRITE(GT_PCI0_CFGDATA_OFS, *data);
+		} else {
+		        GT_PCI_WRITE(GT_PCI0_CFGDATA_OFS, *data);
+		}
+	} else {
+	        if (bus == 0 && dev_fn == 0) {
+		        /* 
+			 * Galileo is acting differently than other devices. 
+			 */
+		        GT_READ(GT_PCI0_CFGDATA_OFS, *data);
+		} else {
+		        GT_PCI_READ(GT_PCI0_CFGDATA_OFS, *data);
+		}
+	}
+
+	/* Check for master or target abort */
+	GT_READ(GT_INTRCAUSE_OFS, intr);
+
+	if (intr & (GT_INTRCAUSE_MASABORT0_BIT | GT_INTRCAUSE_TARABORT0_BIT))
+	{
+	        /* Error occured */
+
+	        /* Clear bits */
+	        GT_WRITE( GT_INTRCAUSE_OFS, ~(GT_INTRCAUSE_MASABORT0_BIT | 
+					      GT_INTRCAUSE_TARABORT0_BIT) );
+
+		return -1;
+	}
+
+	return 0;
+}
+
+
+/*
+ * We can't address 8 and 16 bit words directly.  Instead we have to
+ * read/write a 32bit word and mask/modify the data we actually want.
+ */
+static int
+mips_pcibios_read_config_byte (struct pci_dev *dev, int where, u8 *val)
+{
+	u32 data = 0;
+
+	if (mips_pcibios_config_access(PCI_ACCESS_READ, dev, where, &data))
+		return -1;
+
+	*val = (data >> ((where & 3) << 3)) & 0xff;
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+
+static int
+mips_pcibios_read_config_word (struct pci_dev *dev, int where, u16 *val)
+{
+	u32 data = 0;
+
+	if (where & 1)
+		return PCIBIOS_BAD_REGISTER_NUMBER;
+
+	if (mips_pcibios_config_access(PCI_ACCESS_READ, dev, where, &data))
+	       return -1;
+
+	*val = (data >> ((where & 3) << 3)) & 0xffff;
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int
+mips_pcibios_read_config_dword (struct pci_dev *dev, int where, u32 *val)
+{
+	u32 data = 0;
+
+	if (where & 3)
+		return PCIBIOS_BAD_REGISTER_NUMBER;
+	
+	if (mips_pcibios_config_access(PCI_ACCESS_READ, dev, where, &data))
+		return -1;
+
+	*val = data;
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+
+static int
+mips_pcibios_write_config_byte (struct pci_dev *dev, int where, u8 val)
+{
+	u32 data = 0;
+       
+	if (mips_pcibios_config_access(PCI_ACCESS_READ, dev, where, &data))
+		return -1;
+
+	data = (data & ~(0xff << ((where & 3) << 3))) |
+	       (val << ((where & 3) << 3));
+
+	if (mips_pcibios_config_access(PCI_ACCESS_WRITE, dev, where, &data))
+		return -1;
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int
+mips_pcibios_write_config_word (struct pci_dev *dev, int where, u16 val)
+{
+        u32 data = 0;
+
+	if (where & 1)
+		return PCIBIOS_BAD_REGISTER_NUMBER;
+       
+        if (mips_pcibios_config_access(PCI_ACCESS_READ, dev, where, &data))
+	       return -1;
+
+	data = (data & ~(0xffff << ((where & 3) << 3))) | 
+	       (val << ((where & 3) << 3));
+
+	if (mips_pcibios_config_access(PCI_ACCESS_WRITE, dev, where, &data))
+	       return -1;
+
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int
+mips_pcibios_write_config_dword(struct pci_dev *dev, int where, u32 val)
+{
+	if (where & 3)
+		return PCIBIOS_BAD_REGISTER_NUMBER;
+
+	if (mips_pcibios_config_access(PCI_ACCESS_WRITE, dev, where, &val))
+	       return -1;
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+struct pci_ops mips_pci_ops = {
+	mips_pcibios_read_config_byte,
+        mips_pcibios_read_config_word,
+	mips_pcibios_read_config_dword,
+	mips_pcibios_write_config_byte,
+	mips_pcibios_write_config_word,
+	mips_pcibios_write_config_dword
+};
+
+void __init pcibios_init(void)
+{
+#ifdef CONFIG_MIPS_MALTA
+	struct pci_dev *pdev;
+	unsigned char reg_val;
+#endif
+
+	printk("PCI: Probing PCI hardware on host bus 0.\n");
+	pci_scan_bus(0, &mips_pci_ops, NULL);
+
+	/* 
+	 * Due to a bug in the Galileo system controller, we need to setup 
+	 * the PCI BAR for the Galileo internal registers.
+	 * This should be done in the bios/bootprom and will be fixed in
+	 * a later revision of YAMON (the MIPS boards boot prom).
+	 */
+	GT_WRITE(GT_PCI0_CFGADDR_OFS,
+		 (0 << GT_PCI0_CFGADDR_BUSNUM_SHF)   |  /* Local bus */
+		 (0 << GT_PCI0_CFGADDR_DEVNUM_SHF)   |  /* GT64120 device */
+		 (0 << GT_PCI0_CFGADDR_FUNCTNUM_SHF) |  /* Function 0 */
+		 ((0x20/4) << GT_PCI0_CFGADDR_REGNUM_SHF) |  /* BAR 4 */
+		 GT_PCI0_CFGADDR_CONFIGEN_BIT );
+
+	/* Perform the write */
+	GT_WRITE( GT_PCI0_CFGDATA_OFS, CPHYSADDR(MIPS_GT_BASE)); 
+
+#ifdef CONFIG_MIPS_MALTA
+	pci_for_each_dev(pdev) {
+		if ((pdev->vendor == PCI_VENDOR_ID_INTEL)
+		    && (pdev->device == PCI_DEVICE_ID_INTEL_82371AB)
+		    && (PCI_SLOT(pdev->devfn) == 0x0a)) {
+			/*
+			 * IDE Decode enable.
+			 */
+			pci_read_config_byte(pdev, 0x41, &reg_val);
+        		pci_write_config_byte(pdev, 0x41, reg_val | 0x80);
+			pci_read_config_byte(pdev, 0x43, &reg_val);
+        		pci_write_config_byte(pdev, 0x43, reg_val | 0x80);
+		}
+
+		if ((pdev->vendor == PCI_VENDOR_ID_INTEL)
+		    && (pdev->device == PCI_DEVICE_ID_INTEL_82371AB_0)
+		    && (PCI_SLOT(pdev->devfn) == 0x0a)) {
+			/*
+			 * Set top of main memory accessible by ISA or DMA
+			 * devices to 16 Mb.
+			 */
+			pci_read_config_byte(pdev, 0x69, &reg_val);
+			pci_write_config_byte(pdev, 0x69, reg_val | 0xf0);
+		}
+	}
+
+	/* 
+	 * Activate Floppy Controller in the SMSC FDC37M817 Super I/O 
+	 * Controller.
+	 * This should be done in the bios/bootprom and will be fixed in
+         * a later revision of YAMON (the MIPS boards boot prom).
+	 */
+	/* Entering config state. */
+	SMSC_WRITE(SMSC_CONFIG_ENTER, SMSC_CONFIG_REG); 
+       
+	/* Activate floppy controller. */
+	SMSC_WRITE(SMSC_CONFIG_DEVNUM, SMSC_CONFIG_REG);
+	SMSC_WRITE(SMSC_CONFIG_DEVNUM_FLOPPY, SMSC_DATA_REG);
+	SMSC_WRITE(SMSC_CONFIG_ACTIVATE, SMSC_CONFIG_REG);
+	SMSC_WRITE(SMSC_CONFIG_ACTIVATE_ENABLE, SMSC_DATA_REG);
+
+	/* Exit config state. */
+	SMSC_WRITE(SMSC_CONFIG_EXIT, SMSC_CONFIG_REG);
+#endif
+}
+
+int __init
+pcibios_enable_device(struct pci_dev *dev)
+{
+	/* Not needed, since we enable all devices at startup.  */
+	return 0;
+}
+
+void __init
+pcibios_align_resource(void *data, struct resource *res, unsigned long size)
+{
+}
+
+char * __init
+pcibios_setup(char *str)
+{
+	/* Nothing to do for now.  */
+
+	return str;
+}
+
+struct pci_fixup pcibios_fixups[] = {
+	{ 0 }
+};
+
+void __init
+pcibios_update_resource(struct pci_dev *dev, struct resource *root,
+                        struct resource *res, int resource)
+{
+	unsigned long where, size;
+	u32 reg;
+
+	where = PCI_BASE_ADDRESS_0 + (resource * 4);
+	size = res->end - res->start;
+	pci_read_config_dword(dev, where, &reg);
+	reg = (reg & size) | (((u32)(res->start - root->start)) & ~size);
+	pci_write_config_dword(dev, where, reg);
+}
+
+unsigned __init int pcibios_assign_all_busses(void)
+{
+	return 1;
+}
+
+/*
+ *  Called after each bus is probed, but before its children
+ *  are examined.
+ */
+void __init pcibios_fixup_bus(struct pci_bus *b)
+{
+	pci_read_bridge_bases(b);
+}
+
+#endif /* CONFIG_PCI */
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/generic/printf.c linux/arch/mips64/mips-boards/generic/printf.c
--- v2.4.9/linux/arch/mips64/mips-boards/generic/printf.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/generic/printf.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,140 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * Putting things on the screen/serial line using YAMONs facilities.
+ *
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/serialP.h>
+#include <linux/serial_reg.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/serial.h>
+
+
+#ifdef CONFIG_MIPS_ATLAS 
+/* 
+ * Atlas registers are memory mapped on 64-bit aligned boundaries and 
+ * only word access are allowed.
+ * When reading the UART 8 bit registers only the LSB are valid.
+ */
+unsigned int atlas_serial_in(struct async_struct *info, int offset)
+{
+	return (*(volatile unsigned int *)(info->port + mips_io_port_base + offset*8) & 0xff);
+}
+
+void atlas_serial_out(struct async_struct *info, int offset, int value)
+{
+	*(volatile unsigned int *)(info->port + mips_io_port_base + offset*8) = value;
+}
+
+#define serial_in  atlas_serial_in
+#define serial_out atlas_serial_out
+
+#else
+
+static unsigned int serial_in(struct async_struct *info, int offset)
+{
+	return inb(info->port + offset);
+}
+
+static void serial_out(struct async_struct *info, int offset,
+				int value)
+{
+	outb(value, info->port + offset);
+}
+#endif
+
+static struct serial_state rs_table[] = {
+	SERIAL_PORT_DFNS	/* Defined in serial.h */
+};
+
+/*
+ * Hooks to fake "prom" console I/O before devices 
+ * are fully initialized. 
+ */
+static struct async_struct prom_port_info = {0};
+
+void __init setup_prom_printf(int tty_no) {
+	struct serial_state *ser = &rs_table[tty_no];
+
+	prom_port_info.state = ser;
+	prom_port_info.magic = SERIAL_MAGIC;
+	prom_port_info.port = ser->port;
+	prom_port_info.flags = ser->flags;
+
+	/* No setup of UART - assume YAMON left in sane state */
+}
+
+int putPromChar(char c)
+{
+        if (!prom_port_info.state) { 	/* need to init device first */
+		return 0;
+	}
+
+	while ((serial_in(&prom_port_info, UART_LSR) & UART_LSR_THRE) == 0)
+		;
+
+	serial_out(&prom_port_info, UART_TX, c);
+
+	return 1;
+}
+
+char getPromChar(void)
+{
+	if (!prom_port_info.state) { 	/* need to init device first */
+		return 0;
+	}
+
+	while (!(serial_in(&prom_port_info, UART_LSR) & 1))
+		;
+
+	return(serial_in(&prom_port_info, UART_RX));
+}
+
+static char buf[1024];
+
+void __init prom_printf(char *fmt, ...)
+{
+	va_list args;
+	int l;
+	char *p, *buf_end;
+	long flags;
+
+	int putPromChar(char);
+
+	/* Low level, brute force, not SMP safe... */
+	save_and_cli(flags);
+	va_start(args, fmt);
+	l = vsprintf(buf, fmt, args); /* hopefully i < sizeof(buf) */
+	va_end(args);
+
+	buf_end = buf + l;
+
+	for (p = buf; p < buf_end; p++) {
+		/* Crude cr/nl handling is better than none */
+		if(*p == '\n')putPromChar('\r');
+		putPromChar(*p);
+	}
+	restore_flags(flags);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/generic/reset.c linux/arch/mips64/mips-boards/generic/reset.c
--- v2.4.9/linux/arch/mips64/mips-boards/generic/reset.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/generic/reset.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,61 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * Reset the MIPS boards.
+ *
+ */
+#include <linux/config.h>
+
+#include <asm/mips-boards/generic.h>
+#if defined(CONFIG_MIPS_ATLAS)
+#include <asm/mips-boards/atlas.h>
+#endif
+
+void machine_restart(char *command) __attribute__((noreturn));
+void machine_halt(void) __attribute__((noreturn));
+#if defined(CONFIG_MIPS_ATLAS)
+void machine_power_off(void) __attribute__((noreturn));
+#endif
+
+void machine_restart(char *command)
+{
+        volatile unsigned int *softres_reg = (void *)SOFTRES_REG;
+
+	*softres_reg = GORESET;
+}
+
+void machine_halt(void)
+{
+        volatile unsigned int *softres_reg = (void *)SOFTRES_REG;
+
+	*softres_reg = GORESET;
+}
+
+void machine_power_off(void)
+{
+#if defined(CONFIG_MIPS_ATLAS)
+        volatile unsigned int *psustby_reg = (void *)ATLAS_PSUSTBY_REG;
+
+	*psustby_reg = ATLAS_GOSTBY;
+#else
+	machine_halt();
+#endif
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/generic/time.c linux/arch/mips64/mips-boards/generic/time.c
--- v2.4.9/linux/arch/mips64/mips-boards/generic/time.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/generic/time.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,399 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * Setting up the clock on the MIPS boards.
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/kernel_stat.h>
+#include <linux/sched.h>
+#include <linux/spinlock.h>
+
+#include <asm/mipsregs.h>
+#include <asm/ptrace.h>
+
+#include <linux/mc146818rtc.h>
+#include <linux/timex.h>
+
+#include <asm/mips-boards/generic.h>
+#include <asm/mips-boards/prom.h>
+
+extern volatile unsigned long wall_jiffies;
+static long last_rtc_update = 0;
+unsigned long missed_heart_beats = 0;
+
+static unsigned long r4k_offset; /* Amount to increment compare reg each time */
+static unsigned long r4k_cur;    /* What counter should be at next timer irq */
+extern rwlock_t xtime_lock;
+
+#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
+
+#if defined(CONFIG_MIPS_ATLAS)
+static char display_string[] = "        LINUX ON ATLAS       ";
+#endif
+#if defined(CONFIG_MIPS_MALTA)
+static char display_string[] = "        LINUX ON MALTA       ";
+#endif
+static unsigned int display_count = 0;
+#define MAX_DISPLAY_COUNT (sizeof(display_string) - 8) 
+
+static unsigned int timer_tick_count=0;
+
+
+static inline void ack_r4ktimer(unsigned long newval)
+{
+	write_32bit_cp0_register(CP0_COMPARE, newval);
+}
+
+
+/*
+ * In order to set the CMOS clock precisely, set_rtc_mmss has to be
+ * called 500 ms after the second nowtime has started, because when
+ * nowtime is written into the registers of the CMOS clock, it will
+ * jump to the next second precisely 500 ms later. Check the Motorola
+ * MC146818A or Dallas DS12887 data sheet for details.
+ *
+ * BUG: This routine does not handle hour overflow properly; it just
+ *      sets the minutes. Usually you won't notice until after reboot!
+ */
+static int set_rtc_mmss(unsigned long nowtime)
+{
+	int retval = 0;
+	int real_seconds, real_minutes, cmos_minutes;
+	unsigned char save_control, save_freq_select;
+
+	save_control = CMOS_READ(RTC_CONTROL); /* tell the clock it's being set */
+	CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL);
+
+	save_freq_select = CMOS_READ(RTC_FREQ_SELECT); /* stop and reset prescaler */
+	CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
+
+	cmos_minutes = CMOS_READ(RTC_MINUTES);
+
+	/*
+	 * since we're only adjusting minutes and seconds,
+	 * don't interfere with hour overflow. This avoids
+	 * messing with unknown time zones but requires your
+	 * RTC not to be off by more than 15 minutes
+	 */
+	real_seconds = nowtime % 60;
+	real_minutes = nowtime / 60;
+	if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
+		real_minutes += 30;		/* correct for half hour time zone */
+	real_minutes %= 60;
+
+	if (abs(real_minutes - cmos_minutes) < 30) {
+		CMOS_WRITE(real_seconds,RTC_SECONDS);
+		CMOS_WRITE(real_minutes,RTC_MINUTES);
+	} else {
+		printk(KERN_WARNING
+		       "set_rtc_mmss: can't update from %d to %d\n",
+		       cmos_minutes, real_minutes);
+ 		retval = -1;
+	}
+
+	/* The following flags have to be released exactly in this order,
+	 * otherwise the DS12887 (popular MC146818A clone with integrated
+	 * battery and quartz) will not reset the oscillator and will not
+	 * update precisely 500 ms later. You won't find this mentioned in
+	 * the Dallas Semiconductor data sheets, but who believes data
+	 * sheets anyway ...                           -- Markus Kuhn
+	 */
+	CMOS_WRITE(save_control, RTC_CONTROL);
+	CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
+
+	return retval;
+}
+
+/*
+ * There are a lot of conceptually broken versions of the MIPS timer interrupt
+ * handler floating around.  This one is rather different, but the algorithm
+ * is provably more robust.
+ */
+void mips_timer_interrupt(struct pt_regs *regs)
+{
+	int irq = 7;
+
+	if (r4k_offset == 0)
+		goto null;
+
+	do {
+		kstat.irqs[0][irq]++;
+		do_timer(regs);
+
+		/* Historical comment/code:
+ 		 * RTC time of day s updated approx. every 11 
+ 		 * minutes.  Because of how the numbers work out 
+ 		 * we need to make absolutely sure we do this update
+ 		 * within 500ms before the * next second starts, 
+ 		 * thus the following code.
+ 		 */
+		read_lock(&xtime_lock);
+		if ((time_status & STA_UNSYNC) == 0 
+		    && xtime.tv_sec > last_rtc_update + 660 
+		    && xtime.tv_usec >= 500000 - (tick >> 1) 
+		    && xtime.tv_usec <= 500000 + (tick >> 1))
+			if (set_rtc_mmss(xtime.tv_sec) == 0)
+				last_rtc_update = xtime.tv_sec;
+			else
+				/* do it again in 60 s */
+	    			last_rtc_update = xtime.tv_sec - 600; 
+		read_unlock(&xtime_lock);
+
+		if ((timer_tick_count++ % HZ) == 0) {
+		    mips_display_message(&display_string[display_count++]);
+		    if (display_count == MAX_DISPLAY_COUNT)
+		        display_count = 0;
+		}
+
+		r4k_cur += r4k_offset;
+		ack_r4ktimer(r4k_cur);
+
+	} while (((unsigned int)read_32bit_cp0_register(CP0_COUNT)
+	         - (unsigned int)r4k_cur) < 0x7fffffff);
+
+	return;
+
+null:
+	ack_r4ktimer(0);
+}
+
+/* 
+ * Figure out the r4k offset, the amount to increment the compare
+ * register for each time tick. 
+ * Use the RTC to calculate offset.
+ */
+static unsigned long __init cal_r4koff(void)
+{
+	unsigned long count;
+	unsigned int flags;
+
+	__save_and_cli(flags);
+
+	/* Start counter exactly on falling edge of update flag */
+	while (CMOS_READ(RTC_REG_A) & RTC_UIP);
+	while (!(CMOS_READ(RTC_REG_A) & RTC_UIP));
+
+	/* Start r4k counter. */
+	write_32bit_cp0_register(CP0_COUNT, 0);
+
+	/* Read counter exactly on falling edge of update flag */
+	while (CMOS_READ(RTC_REG_A) & RTC_UIP);
+	while (!(CMOS_READ(RTC_REG_A) & RTC_UIP));
+
+	count = read_32bit_cp0_register(CP0_COUNT);
+
+	/* restore interrupts */
+	__restore_flags(flags);
+
+	return (count / HZ);
+}
+
+static unsigned long __init get_mips_time(void)
+{
+	unsigned int year, mon, day, hour, min, sec;
+	unsigned char save_control;
+
+	save_control = CMOS_READ(RTC_CONTROL);
+
+	/* Freeze it. */
+	CMOS_WRITE(save_control | RTC_SET, RTC_CONTROL);
+
+	/* Read regs. */
+	sec = CMOS_READ(RTC_SECONDS);
+	min = CMOS_READ(RTC_MINUTES);
+	hour = CMOS_READ(RTC_HOURS);
+
+	if (!(save_control & RTC_24H))
+	{
+		if ((hour & 0xf) == 0xc)
+		        hour &= 0x80;
+	        if (hour & 0x80)
+		        hour = (hour & 0xf) + 12;     
+	}
+	day = CMOS_READ(RTC_DAY_OF_MONTH);
+	mon = CMOS_READ(RTC_MONTH);
+	year = CMOS_READ(RTC_YEAR);
+
+	/* Unfreeze clock. */
+	CMOS_WRITE(save_control, RTC_CONTROL);
+
+	if ((year += 1900) < 1970)
+	        year += 100;
+
+	return mktime(year, mon, day, hour, min, sec);
+}
+
+void __init time_init(void)
+{
+        unsigned int est_freq, flags;
+
+        /* Set Data mode - binary. */ 
+        CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL);
+
+	printk("calculating r4koff... ");
+	r4k_offset = cal_r4koff();
+	printk("%08lx(%d)\n", r4k_offset, (int) r4k_offset);
+
+	est_freq = 2*r4k_offset*HZ;	
+	est_freq += 5000;    /* round */
+	est_freq -= est_freq%10000;
+	printk("CPU frequency %d.%02d MHz\n", est_freq/1000000, 
+	       (est_freq%1000000)*100/1000000);
+	r4k_cur = (read_32bit_cp0_register(CP0_COUNT) + r4k_offset);
+
+	write_32bit_cp0_register(CP0_COMPARE, r4k_cur);
+	set_cp0_status(ST0_IM, ALLINTS);
+
+	/* Read time from the RTC chipset. */
+	write_lock_irqsave (&xtime_lock, flags);
+	xtime.tv_sec = get_mips_time();
+	xtime.tv_usec = 0;
+	write_unlock_irqrestore(&xtime_lock, flags);
+}
+
+/* This is for machines which generate the exact clock. */
+#define USECS_PER_JIFFY (1000000/HZ)
+#define USECS_PER_JIFFY_FRAC (0x100000000*1000000/HZ&0xffffffff)
+
+/* Cycle counter value at the previous timer interrupt.. */
+
+static unsigned int timerhi = 0, timerlo = 0;
+
+/*
+ * FIXME: Does playing with the RP bit in c0_status interfere with this code?
+ */
+static unsigned long do_fast_gettimeoffset(void)
+{
+	u32 count;
+	unsigned long res, tmp;
+
+	/* Last jiffy when do_fast_gettimeoffset() was called. */
+	static unsigned long last_jiffies=0;
+	unsigned long quotient;
+
+	/*
+	 * Cached "1/(clocks per usec)*2^32" value.
+	 * It has to be recalculated once each jiffy.
+	 */
+	static unsigned long cached_quotient=0;
+
+	tmp = jiffies;
+
+	quotient = cached_quotient;
+
+	if (tmp && last_jiffies != tmp) {
+		last_jiffies = tmp;
+		__asm__(".set\tnoreorder\n\t"
+			".set\tnoat\n\t"
+			".set\tmips3\n\t"
+			"lwu\t%0,%2\n\t"
+			"dsll32\t$1,%1,0\n\t"
+			"or\t$1,$1,%0\n\t"
+			"ddivu\t$0,$1,%3\n\t"
+			"mflo\t$1\n\t"
+			"dsll32\t%0,%4,0\n\t"
+			"nop\n\t"
+			"ddivu\t$0,%0,$1\n\t"
+			"mflo\t%0\n\t"
+			".set\tmips0\n\t"
+			".set\tat\n\t"
+			".set\treorder"
+			:"=&r" (quotient)
+			:"r" (timerhi),
+			 "m" (timerlo),
+			 "r" (tmp),
+			 "r" (USECS_PER_JIFFY)
+			:"$1");
+		cached_quotient = quotient;
+	}
+
+	/* Get last timer tick in absolute kernel time */
+	count = read_32bit_cp0_register(CP0_COUNT);
+
+	/* .. relative to previous jiffy (32 bits is enough) */
+	count -= timerlo;
+
+	__asm__("multu\t%1,%2\n\t"
+		"mfhi\t%0"
+		:"=r" (res)
+		:"r" (count),
+		 "r" (quotient));
+
+	/*
+ 	 * Due to possible jiffies inconsistencies, we need to check 
+	 * the result so that we'll get a timer that is monotonic.
+	 */
+	if (res >= USECS_PER_JIFFY)
+		res = USECS_PER_JIFFY-1;
+
+	return res;
+}
+
+void do_gettimeofday(struct timeval *tv)
+{
+	unsigned int flags;
+
+	read_lock_irqsave (&xtime_lock, flags);
+	*tv = xtime;
+	tv->tv_usec += do_fast_gettimeoffset();
+
+	/*
+	 * xtime is atomically updated in timer_bh. jiffies - wall_jiffies
+	 * is nonzero if the timer bottom half hasnt executed yet.
+	 */
+	if (jiffies - wall_jiffies)
+		tv->tv_usec += USECS_PER_JIFFY;
+
+	read_unlock_irqrestore (&xtime_lock, flags);
+
+	if (tv->tv_usec >= 1000000) {
+		tv->tv_usec -= 1000000;
+		tv->tv_sec++;
+	}
+}
+
+void do_settimeofday(struct timeval *tv)
+{
+	write_lock_irq (&xtime_lock);
+
+	/* This is revolting. We need to set the xtime.tv_usec correctly.
+	 * However, the value in this location is is value at the last tick.
+	 * Discover what correction gettimeofday would have done, and then
+	 * undo it!
+	 */
+	tv->tv_usec -= do_fast_gettimeoffset();
+
+	if (tv->tv_usec < 0) {
+		tv->tv_usec += 1000000;
+		tv->tv_sec--;
+	}
+
+	xtime = *tv;
+	time_adjust = 0;		/* stop active adjtime() */
+	time_status |= STA_UNSYNC;
+	time_maxerror = NTP_PHASE_LIMIT;
+	time_esterror = NTP_PHASE_LIMIT;
+
+	write_unlock_irq (&xtime_lock);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/malta/Makefile linux/arch/mips64/mips-boards/malta/Makefile
--- v2.4.9/linux/arch/mips64/mips-boards/malta/Makefile	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/malta/Makefile	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,42 @@
+#
+# Carsten Langgaard, carstenl@mips.com
+# Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+#
+# ########################################################################
+#
+# This program is free software; you can distribute it and/or modify it
+# under the terms of the GNU General Public License (Version 2) as
+# published by the Free Software Foundation.
+# 
+# This program is distributed in the hope 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.
+#
+# #######################################################################
+#
+# Makefile for the MIPS Malta specific kernel interface routines
+# under Linux.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+# Note 2! The CFLAGS definitions are now in the main makefile...
+
+.S.s:
+	$(CPP) $(CFLAGS) $< -o $*.s
+.S.o:
+	$(CC) $(CFLAGS) -c $< -o $*.o
+
+all: malta.o
+
+O_TARGET := malta.o
+
+obj-y := malta_int.o malta_rtc.o malta_setup.o
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/malta/malta_int.c linux/arch/mips64/mips-boards/malta/malta_int.c
--- v2.4.9/linux/arch/mips64/mips-boards/malta/malta_int.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/malta/malta_int.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,383 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * Routines for generic manipulation of the interrupts found on the MIPS 
+ * Malta board.
+ * The interrupt controller is located in the South Bridge a PIIX4 device 
+ * with two internal 82C95 interrupt controllers.
+ *
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/interrupt.h>
+#include <linux/kernel_stat.h>
+#include <linux/random.h>
+
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <asm/mips-boards/malta.h>
+#include <asm/mips-boards/maltaint.h>
+#include <asm/mips-boards/piix4.h>
+#include <asm/mips-boards/gt64120.h>
+#include <asm/mips-boards/generic.h>
+
+extern asmlinkage void mipsIRQ(void);
+
+unsigned int local_bh_count[NR_CPUS];
+unsigned int local_irq_count[NR_CPUS];
+unsigned long spurious_count = 0;
+
+static struct irqaction *hw0_irq_action[MALTAINT_END] = {
+	NULL, NULL, NULL, NULL,
+	NULL, NULL, NULL, NULL,
+	NULL, NULL, NULL, NULL,
+	NULL, NULL, NULL, NULL
+};
+
+static struct irqaction r4ktimer_action = {
+	NULL, 0, 0, "R4000 timer/counter", NULL, NULL,
+};
+
+static struct irqaction *irq_action[8] = {
+	NULL, NULL, NULL, NULL,
+	NULL, NULL, NULL, &r4ktimer_action
+};
+
+#if 0
+#define DEBUG_INT(x...) printk(x)
+#else
+#define DEBUG_INT(x...)
+#endif
+
+/*
+ * This contains the interrupt mask for both 82C59 interrupt controllers.
+ */
+static unsigned int cached_int_mask = 0xffff;
+
+
+void disable_irq(unsigned int irq_nr)
+{
+        unsigned long flags;
+
+	if(irq_nr >= MALTAINT_END) {
+		printk("whee, invalid irq_nr %d\n", irq_nr);
+		panic("IRQ, you lose...");
+	}
+
+	save_and_cli(flags);
+	cached_int_mask |= (1 << irq_nr);
+	if (irq_nr & 8) {
+	        outb((cached_int_mask >> 8) & 0xff, PIIX4_ICTLR2_OCW1);
+	} else {
+		outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1);
+	}
+	restore_flags(flags);
+}
+
+
+void enable_irq(unsigned int irq_nr)
+{
+        unsigned long flags;
+
+	if(irq_nr >= MALTAINT_END) {
+		printk("whee, invalid irq_nr %d\n", irq_nr);
+		panic("IRQ, you lose...");
+	}
+
+	save_and_cli(flags);
+	cached_int_mask &= ~(1 << irq_nr);
+	if (irq_nr & 8) {
+		outb((cached_int_mask >> 8) & 0xff, PIIX4_ICTLR2_OCW1);
+
+		/* Enable irq 2 (cascade interrupt). */
+	        cached_int_mask &= ~(1 << 2); 
+		outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1);
+	} else {
+		outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1);
+	}	
+	restore_flags(flags);
+}
+
+
+int get_irq_list(char *buf)
+{
+	int i, len = 0;
+	int num = 0;
+	struct irqaction *action;
+
+	for (i = 0; i < 8; i++, num++) {
+		action = irq_action[i];
+		if (!action) 
+			continue;
+		len += sprintf(buf+len, "%2d: %8d %c %s",
+			num, kstat.irqs[0][num],
+			(action->flags & SA_INTERRUPT) ? '+' : ' ',
+			action->name);
+		for (action=action->next; action; action = action->next) {
+			len += sprintf(buf+len, ",%s %s",
+				(action->flags & SA_INTERRUPT) ? " +" : "",
+				action->name);
+		}
+		len += sprintf(buf+len, " [on-chip]\n");
+	}
+	for (i = 0; i < MALTAINT_END; i++, num++) {
+		action = hw0_irq_action[i];
+		if (!action) 
+			continue;
+		len += sprintf(buf+len, "%2d: %8d %c %s",
+			num, kstat.irqs[0][num],
+			(action->flags & SA_INTERRUPT) ? '+' : ' ',
+			action->name);
+		for (action=action->next; action; action = action->next) {
+			len += sprintf(buf+len, ",%s %s",
+				(action->flags & SA_INTERRUPT) ? " +" : "",
+				action->name);
+		}
+		len += sprintf(buf+len, " [hw0]\n");
+	}
+	return len;
+}
+
+int request_irq(unsigned int irq, 
+		void (*handler)(int, void *, struct pt_regs *),
+		unsigned long irqflags, 
+		const char * devname,
+		void *dev_id)
+{  
+        struct irqaction *action;
+	int retval;
+
+	DEBUG_INT("request_irq: irq=%d, devname = %s\n", irq, devname);
+
+        if (irq >= MALTAINT_END)
+	        return -EINVAL;
+	if (!handler)
+	        return -EINVAL;
+
+	action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL);
+	if(!action)
+	        return -ENOMEM;
+
+	action->handler = handler;
+	action->flags = irqflags;
+	action->mask = 0;
+	action->name = devname;
+	action->dev_id = dev_id;
+	action->next = 0;
+
+	retval = setup_irq(irq, action);
+	if (retval)
+		kfree(action);
+
+	return retval;	
+}
+
+
+void free_irq(unsigned int irq, void *dev_id)
+{
+	struct irqaction *action, **p;
+
+	if (irq >= MALTAINT_END) {
+		printk("Trying to free IRQ%d\n",irq);
+		return;
+	}
+	
+	for (p = &hw0_irq_action[irq]; (action = *p) != NULL; 
+	     p = &action->next) 
+	{
+		if (action->dev_id != dev_id)
+			continue;
+
+		/* Found it - now free it */
+		*p = action->next;
+		kfree(action);
+		if (!hw0_irq_action[irq])
+			disable_irq(irq);
+		return;
+	}
+	printk("Trying to free IRQ%d\n",irq);
+}
+
+void __init init_IRQ(void)
+{
+	irq_setup();
+}
+
+static int setup_irq(unsigned int irq, struct irqaction * new)
+{
+	int shared = 0;
+	struct irqaction *old, **p;
+
+	p = &hw0_irq_action[irq];
+	if ((old = *p) != NULL) {
+		/* Can't share interrupts unless both agree to */
+		if (!(old->flags & new->flags & SA_SHIRQ))
+			return -EBUSY;
+
+		/* Can't share interrupts unless both are same type */
+		if ((old->flags ^ new->flags) & SA_INTERRUPT)
+			return -EBUSY;
+
+		/* add new interrupt at end of irq queue */
+		do {
+			p = &old->next;
+			old = *p;
+		} while (old);
+		shared = 1;
+	}
+
+	if (new->flags & SA_SAMPLE_RANDOM)
+		rand_initialize_irq(irq);
+
+	*p = new;
+	if (!shared)
+		enable_irq(irq);
+
+	return 0;
+}
+
+static inline int get_int(int *irq)
+{
+	/*  
+	 * Determine highest priority pending interrupt by performing
+         * a PCI Interrupt Acknowledge cycle.
+	 */
+	GT_READ(GT_PCI0_IACK_OFS, *irq);
+	*irq &= 0xFF;
+
+	/*  
+	 * IRQ7 is used to detect spurious interrupts.
+	 * The interrupt acknowledge cycle returns IRQ7, if no 
+	 * interrupts is requested.
+	 * We can differentiate between this situation and a
+	 * "Normal" IRQ7 by reading the ISR.
+	 */
+	if (*irq == 7) 
+	{
+		outb(PIIX4_OCW3_SEL | PIIX4_OCW3_ISR, PIIX4_ICTLR1_OCW3);
+		if (!(inb(PIIX4_ICTLR1_OCW3) & (1 << 7)))
+		        return -1;    /* Spurious interrupt. */
+	}
+
+	return 0;
+}
+
+static inline void ack_int(int irq)
+{
+	if (irq & 8) {
+	        /* Specific EOI to cascade */
+		outb(PIIX4_OCW2_SEL | PIIX4_OCW2_NSEOI | PIIX4_OCW2_ILS_2, 
+		     PIIX4_ICTLR1_OCW2);
+
+	        /* Non specific EOI to cascade */
+		outb(PIIX4_OCW2_SEL | PIIX4_OCW2_NSEOI, PIIX4_ICTLR2_OCW2);
+	} else {
+	        /* Non specific EOI to cascade */
+		outb(PIIX4_OCW2_SEL | PIIX4_OCW2_NSEOI, PIIX4_ICTLR1_OCW2);
+	}
+}
+
+void malta_hw0_irqdispatch(struct pt_regs *regs)
+{
+        struct irqaction *action;
+	int irq=0, cpu = smp_processor_id();
+
+	DEBUG_INT("malta_hw0_irqdispatch\n");
+	
+	if (get_int(&irq))
+	        return;  /* interrupt has already been cleared */
+
+	disable_irq(irq);
+	ack_int(irq);
+
+	DEBUG_INT("malta_hw0_irqdispatch: irq=%d\n", irq);
+	action = hw0_irq_action[irq];
+
+	/* 
+	 * if action == NULL, then we don't have a handler 
+	 * for the irq 
+	 */
+	if ( action == NULL )
+		return;
+
+	irq_enter(cpu, irq);
+	kstat.irqs[0][irq + 8]++;
+	do {
+	        action->handler(irq, action->dev_id, regs);
+		action = action->next;
+	} while (action);
+
+	enable_irq(irq);
+	irq_exit(cpu, irq);
+}
+
+
+unsigned long probe_irq_on (void)
+{
+	unsigned int i, irqs = 0;
+	unsigned long delay;
+
+	/* first, enable any unassigned irqs */
+	for (i = MALTAINT_END-1; i > 0; i--) {
+		if (!hw0_irq_action[i]) {
+			enable_irq(i);
+			irqs |= (1 << i);
+		}
+	}
+
+	/* wait for spurious interrupts to mask themselves out again */
+	for (delay = jiffies + HZ/10; time_before(jiffies, delay); )
+		/* about 100ms delay */;
+
+	/* now filter out any obviously spurious interrupts */
+	return irqs & ~cached_int_mask;
+}
+
+
+int probe_irq_off (unsigned long irqs)
+{
+	unsigned int i;
+
+	irqs &= cached_int_mask;
+	if (!irqs)
+		return 0;
+	i = ffz(~irqs);
+	if (irqs != (irqs & (1 << i)))
+		i = -i;
+
+	return i;
+}
+
+
+void __init maltaint_init(void)
+{
+        /* 
+	 * Mask out all interrupt by writing "1" to all bit position in 
+	 * the IMR register. 
+	 */
+	outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1);
+	outb((cached_int_mask >> 8) & 0xff, PIIX4_ICTLR2_OCW1);
+
+	/* Now safe to set the exception vector. */
+	set_except_vector(0, mipsIRQ);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/malta/malta_rtc.c linux/arch/mips64/mips-boards/malta/malta_rtc.c
--- v2.4.9/linux/arch/mips64/mips-boards/malta/malta_rtc.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/malta/malta_rtc.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,50 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * RTC routines for Malta style attached PIIX4 device, which contains a
+ * Motorola MC146818A-compatible Real Time Clock.
+ *
+ */
+#include <asm/mc146818rtc.h>
+#include <asm/mips-boards/malta.h>
+
+static unsigned char malta_rtc_read_data(unsigned long addr)
+{
+	outb(addr, MALTA_RTC_ADR_REG);
+	return inb(MALTA_RTC_DAT_REG);
+}
+
+static void malta_rtc_write_data(unsigned char data, unsigned long addr)
+{
+	outb(addr, MALTA_RTC_ADR_REG);
+	outb(data, MALTA_RTC_DAT_REG);
+}
+
+static int malta_rtc_bcd_mode(void)
+{
+	return 0;
+}
+
+struct rtc_ops malta_rtc_ops = {
+	&malta_rtc_read_data,
+	&malta_rtc_write_data,
+	&malta_rtc_bcd_mode
+};
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mips-boards/malta/malta_setup.c linux/arch/mips64/mips-boards/malta/malta_setup.c
--- v2.4.9/linux/arch/mips64/mips-boards/malta/malta_setup.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/mips-boards/malta/malta_setup.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,170 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * Malta specific setup, including init of the feature struct.
+ *
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/mc146818rtc.h>
+#include <linux/ioport.h>
+#include <linux/pci.h>
+#ifdef CONFIG_BLK_DEV_IDE
+#include <linux/ide.h>
+#endif
+
+#include <asm/cpu.h>
+#include <asm/bootinfo.h>
+#include <asm/irq.h>
+#include <asm/mips-boards/generic.h>
+#include <asm/mips-boards/prom.h>
+#include <asm/mips-boards/gt64120.h>
+#include <asm/mips-boards/malta.h>
+#include <asm/mips-boards/maltaint.h>
+#ifdef CONFIG_BLK_DEV_FD
+#include <asm/floppy.h>
+#endif
+#include <asm/dma.h>
+#include <asm/mmu_context.h>
+
+#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_PROM_CONSOLE)
+extern void console_setup(char *, int *);
+char serial_console[20];
+#endif
+
+#ifdef CONFIG_REMOTE_DEBUG
+extern void set_debug_traps(void);
+extern void rs_kgdb_hook(int);
+extern void breakpoint(void);
+static int remote_debug = 0;
+#endif
+
+#ifdef CONFIG_BLK_DEV_IDE
+extern struct ide_ops std_ide_ops;
+#endif
+#ifdef CONFIG_BLK_DEV_FD
+extern struct fd_ops std_fd_ops;
+#endif
+extern struct rtc_ops malta_rtc_ops;
+
+extern void mips_reboot_setup(void);
+
+struct resource standard_io_resources[] = {
+	{ "dma1", 0x00, 0x1f, IORESOURCE_BUSY },
+	{ "pic1", 0x20, 0x3f, IORESOURCE_BUSY },
+	{ "timer", 0x40, 0x5f, IORESOURCE_BUSY },
+	{ "dma page reg", 0x80, 0x8f, IORESOURCE_BUSY },
+	{ "pic2", 0xa0, 0xbf, IORESOURCE_BUSY },
+	{ "dma2", 0xc0, 0xdf, IORESOURCE_BUSY },
+};
+
+#define STANDARD_IO_RESOURCES (sizeof(standard_io_resources)/sizeof(struct resource))
+
+static void __init malta_irq_setup(void)
+{
+  	maltaint_init();
+
+#ifdef CONFIG_REMOTE_DEBUG
+	if (remote_debug) {
+		set_debug_traps();
+		breakpoint(); 
+	}
+#endif
+}
+
+
+void __init malta_setup(void)
+{
+#ifdef CONFIG_REMOTE_DEBUG
+	int rs_putDebugChar(char);
+	char rs_getDebugChar(void);
+	extern int (*putDebugChar)(char);
+	extern char (*getDebugChar)(void);
+#endif
+	char *argptr;
+	int i;
+
+	current_cpu_data.asid_cache = ASID_FIRST_VERSION;
+	TLBMISS_HANDLER_SETUP();
+
+	irq_setup = malta_irq_setup;
+
+	/* Request I/O space for devices used on the Malta board. */
+	for (i = 0; i < STANDARD_IO_RESOURCES; i++)
+		request_resource(&ioport_resource, standard_io_resources+i);
+
+	/* 
+	 * Enable DMA channel 4 (cascade channel) in the PIIX4 south bridge.
+	 */
+	enable_dma(4);
+
+#ifdef CONFIG_SERIAL_CONSOLE
+        argptr = prom_getcmdline();
+	if ((argptr = strstr(argptr, "console=ttyS0")) == NULL) 
+	{
+	        int i=0;
+	        char *s = prom_getenv("modetty0");
+		while(s[i] >= '0' && s[i] <= '9')
+			i++;
+		strcpy(serial_console, "ttyS0,");
+		strncpy(serial_console + 6, s, i);
+		prom_printf("Config serial console: %s\n", serial_console);
+	        console_setup(serial_console, NULL);
+	}
+#endif	  
+
+#ifdef CONFIG_REMOTE_DEBUG
+	argptr = prom_getcmdline();
+	if ((argptr = strstr(argptr, "kgdb=ttyS")) != NULL) {
+		int line;
+		argptr += strlen("kgdb=ttyS");
+		if (*argptr != '0' && *argptr != '1')
+			printk("KGDB: Uknown serial line /dev/ttyS%c, "
+			       "falling back to /dev/ttyS1\n", *argptr);
+		line = *argptr == '0' ? 0 : 1;
+		printk("KGDB: Using serial line /dev/ttyS%d for session\n",
+		       line ? 1 : 0);
+
+		rs_kgdb_hook(line);
+		putDebugChar = rs_putDebugChar;
+		getDebugChar = rs_getDebugChar;
+
+		prom_printf("KGDB: Using serial line /dev/ttyS%d for session, "
+			    "please connect your debugger\n", line ? 1 : 0);
+
+		remote_debug = 1;
+		/* Breakpoints and stuff are in malta_irq_setup() */
+	}
+#endif
+
+	argptr = prom_getcmdline();
+	if ((argptr = strstr(argptr, "nofpu")) != NULL)
+		mips_cpu.options &= ~MIPS_CPU_FPU;
+
+	rtc_ops = &malta_rtc_ops;
+#ifdef CONFIG_BLK_DEV_IDE
+        ide_ops = &std_ide_ops;
+#endif
+#ifdef CONFIG_BLK_DEV_FD
+        fd_ops = &std_fd_ops;
+#endif
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mm/andes.c linux/arch/mips64/mm/andes.c
--- v2.4.9/linux/arch/mips64/mm/andes.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/mm/andes.c	Sun Sep  9 10:43:02 2001
@@ -125,14 +125,8 @@
 static void
 andes_flush_cache_sigtramp(unsigned long addr)
 {
-	unsigned long daddr, iaddr;
-
-	daddr = addr & ~(dc_lsize - 1);
-	protected_writeback_dcache_line(daddr);
-	protected_writeback_dcache_line(daddr + dc_lsize);
-	iaddr = addr & ~(ic_lsize - 1);
-	protected_flush_icache_line(iaddr);
-	protected_flush_icache_line(iaddr + ic_lsize);
+	protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
+	protected_flush_icache_line(addr & ~(ic_lsize - 1));
 }
 
 #define NTLB_ENTRIES       64
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mm/extable.c linux/arch/mips64/mm/extable.c
--- v2.4.9/linux/arch/mips64/mm/extable.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/mm/extable.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: extable.c,v 1.2 1999/11/23 17:12:50 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
@@ -38,8 +37,7 @@
 
 extern spinlock_t modlist_lock;
 
-unsigned long
-search_exception_table(unsigned long addr)
+unsigned long search_exception_table(unsigned long addr)
 {
 	unsigned long ret = 0;
 	unsigned long flags;
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mm/fault.c linux/arch/mips64/mm/fault.c
--- v2.4.9/linux/arch/mips64/mm/fault.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/mm/fault.c	Sun Sep 16 21:22:50 2001
@@ -32,7 +32,6 @@
 #define development_version (LINUX_VERSION_CODE & 0x100)
 
 extern void die(char *, struct pt_regs *, unsigned long write);
-extern int console_loglevel;
 
 /*
  * Macro for exception fixup code to access integer registers.
@@ -63,7 +62,7 @@
 
 /*
  * Unlock any spinlocks which will prevent us from getting the
- * message out (timerlist_lock is aquired through the
+ * message out (timerlist_lock is acquired through the
  * console unblank code)
  */
 void bust_spinlocks(int yes)
@@ -71,12 +70,11 @@
 	spin_lock_init(&timerlist_lock);
 	if (yes) {
 		oops_in_progress = 1;
-#ifdef CONFIG_SMP
-		global_irq_lock = 0;	/* Many serial drivers do __global_cli() */
-#endif
 	} else {
 		int loglevel_save = console_loglevel;
+#ifdef CONFIG_VT
 		unblank_screen();
+#endif
 		oops_in_progress = 0;
 		/*
 		 * OK, the message is on the console.  Now we call printk()
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mm/loadmmu.c linux/arch/mips64/mm/loadmmu.c
--- v2.4.9/linux/arch/mips64/mm/loadmmu.c	Tue Nov 28 21:42:04 2000
+++ linux/arch/mips64/mm/loadmmu.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: loadmmu.c,v 1.5 2000/01/27 01:05:24 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mm/r4xx0.c linux/arch/mips64/mm/r4xx0.c
--- v2.4.9/linux/arch/mips64/mm/r4xx0.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/mm/r4xx0.c	Sun Sep  9 10:43:02 2001
@@ -776,9 +776,9 @@
 	__restore_flags(flags);
 }
 
-static void
-r4k_flush_cache_range_s16d16i16(struct mm_struct *mm, unsigned long start,
-                                unsigned long end)
+static void r4k_flush_cache_range_s16d16i16(struct mm_struct *mm,
+					    unsigned long start,
+					    unsigned long end)
 {
 	struct vm_area_struct *vma;
 	unsigned long flags;
@@ -815,9 +815,9 @@
 	}
 }
 
-static void
-r4k_flush_cache_range_s32d16i16(struct mm_struct *mm, unsigned long start,
-                                unsigned long end)
+static void r4k_flush_cache_range_s32d16i16(struct mm_struct *mm,
+					    unsigned long start,
+					    unsigned long end)
 {
 	struct vm_area_struct *vma;
 	unsigned long flags;
@@ -854,9 +854,9 @@
 	}
 }
 
-static void
-r4k_flush_cache_range_s64d16i16(struct mm_struct *mm, unsigned long start,
-                                unsigned long end)
+static void r4k_flush_cache_range_s64d16i16(struct mm_struct *mm,
+					    unsigned long start,
+					    unsigned long end)
 {
 	struct vm_area_struct *vma;
 	unsigned long flags;
@@ -893,9 +893,9 @@
 	}
 }
 
-static void
-r4k_flush_cache_range_s128d16i16(struct mm_struct *mm, unsigned long start,
-                                 unsigned long end)
+static void r4k_flush_cache_range_s128d16i16(struct mm_struct *mm,
+					     unsigned long start,
+					     unsigned long end)
 {
 	struct vm_area_struct *vma;
 	unsigned long flags;
@@ -932,9 +932,9 @@
 	}
 }
 
-static void
-r4k_flush_cache_range_s32d32i32(struct mm_struct *mm, unsigned long start,
-                                unsigned long end)
+static void r4k_flush_cache_range_s32d32i32(struct mm_struct *mm,
+					    unsigned long start,
+					    unsigned long end)
 {
 	struct vm_area_struct *vma;
 	unsigned long flags;
@@ -971,9 +971,9 @@
 	}
 }
 
-static void
-r4k_flush_cache_range_s64d32i32(struct mm_struct *mm, unsigned long start,
-                                unsigned long end)
+static void r4k_flush_cache_range_s64d32i32(struct mm_struct *mm,
+					    unsigned long start,
+					    unsigned long end)
 {
 	struct vm_area_struct *vma;
 	unsigned long flags;
@@ -1010,9 +1010,9 @@
 	}
 }
 
-static void
-r4k_flush_cache_range_s128d32i32(struct mm_struct *mm, unsigned long start,
-                                 unsigned long end)
+static void r4k_flush_cache_range_s128d32i32(struct mm_struct *mm,
+					     unsigned long start,
+					     unsigned long end)
 {
 	struct vm_area_struct *vma;
 	unsigned long flags;
@@ -1049,9 +1049,9 @@
 	}
 }
 
-static void
-r4k_flush_cache_range_d16i16(struct mm_struct *mm, unsigned long start,
-                             unsigned long end)
+static void r4k_flush_cache_range_d16i16(struct mm_struct *mm,
+					 unsigned long start,
+					 unsigned long end)
 {
 	if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
 		unsigned long flags;
@@ -1065,9 +1065,9 @@
 	}
 }
 
-static void
-r4k_flush_cache_range_d32i32(struct mm_struct *mm, unsigned long start,
-                             unsigned long end)
+static void r4k_flush_cache_range_d32i32(struct mm_struct *mm,
+					 unsigned long start,
+					 unsigned long end)
 {
 	if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
 		unsigned long flags;
@@ -1176,8 +1176,8 @@
 	}
 }
 
-static void
-r4k_flush_cache_page_s16d16i16(struct vm_area_struct *vma, unsigned long page)
+static void r4k_flush_cache_page_s16d16i16(struct vm_area_struct *vma,
+					   unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long flags;
@@ -1213,8 +1213,8 @@
 	 * for every cache flush operation.  So we do indexed flushes
 	 * in that case, which doesn't overly flush the cache too much.
 	 */
-	if (CPU_CONTEXT(smp_processor_id(), mm) != 
-				CPU_CONTEXT(smp_processor_id(), current->mm)) {
+	if (CPU_CONTEXT(smp_processor_id(), mm) !=
+	    CPU_CONTEXT(smp_processor_id(), current->mm)) {
 		/* Do indexed flush, too much work to get the (possible)
 		 * tlb refills to work correctly.
 		 */
@@ -1227,8 +1227,8 @@
 	__restore_flags(flags);
 }
 
-static void
-r4k_flush_cache_page_s32d16i16(struct vm_area_struct *vma, unsigned long page)
+static void r4k_flush_cache_page_s32d16i16(struct vm_area_struct *vma,
+					   unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long flags;
@@ -1263,8 +1263,8 @@
 	 * for every cache flush operation.  So we do indexed flushes
 	 * in that case, which doesn't overly flush the cache too much.
 	 */
-	if (CPU_CONTEXT(smp_processor_id(), mm) != 
-				CPU_CONTEXT(smp_processor_id(), current->mm)) {
+	if (CPU_CONTEXT(smp_processor_id(), mm) !=
+	    CPU_CONTEXT(smp_processor_id(), current->mm)) {
 		/* Do indexed flush, too much work to get the (possible)
 		 * tlb refills to work correctly.
 		 */
@@ -1277,8 +1277,8 @@
 	__restore_flags(flags);
 }
 
-static void
-r4k_flush_cache_page_s64d16i16(struct vm_area_struct *vma, unsigned long page)
+static void r4k_flush_cache_page_s64d16i16(struct vm_area_struct *vma,
+					   unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long flags;
@@ -1315,7 +1315,7 @@
 	 * in that case, which doesn't overly flush the cache too much.
 	 */
 	if (CPU_CONTEXT(smp_processor_id(), mm) != 
-				CPU_CONTEXT(smp_processor_id(), current->mm)) {
+	    CPU_CONTEXT(smp_processor_id(), current->mm)) {
 		/* Do indexed flush, too much work to get the (possible)
 		 * tlb refills to work correctly.
 		 */
@@ -1328,8 +1328,8 @@
 	__restore_flags(flags);
 }
 
-static void
-r4k_flush_cache_page_s128d16i16(struct vm_area_struct *vma, unsigned long page)
+static void r4k_flush_cache_page_s128d16i16(struct vm_area_struct *vma,
+					    unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long flags;
@@ -1366,7 +1366,7 @@
 	 * in that case, which doesn't overly flush the cache too much.
 	 */
 	if (CPU_CONTEXT(smp_processor_id(), mm) != 
-				CPU_CONTEXT(smp_processor_id(), current->mm)) {
+	    CPU_CONTEXT(smp_processor_id(), current->mm)) {
 		/*
 		 * Do indexed flush, too much work to get the (possible)
 		 * tlb refills to work correctly.
@@ -1380,8 +1380,8 @@
 	__restore_flags(flags);
 }
 
-static void
-r4k_flush_cache_page_s32d32i32(struct vm_area_struct *vma, unsigned long page)
+static void r4k_flush_cache_page_s32d32i32(struct vm_area_struct *vma,
+					   unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long flags;
@@ -1419,7 +1419,7 @@
 	 * in that case, which doesn't overly flush the cache too much.
 	 */
 	if (CPU_CONTEXT(smp_processor_id(), mm) != 
-				CPU_CONTEXT(smp_processor_id(), current->mm)) {
+	    CPU_CONTEXT(smp_processor_id(), current->mm)) {
 		/*
 		 * Do indexed flush, too much work to get the (possible)
 		 * tlb refills to work correctly.
@@ -1433,8 +1433,8 @@
 	__restore_flags(flags);
 }
 
-static void
-r4k_flush_cache_page_s64d32i32(struct vm_area_struct *vma, unsigned long page)
+static void r4k_flush_cache_page_s64d32i32(struct vm_area_struct *vma,
+					   unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long flags;
@@ -1472,7 +1472,7 @@
 	 * in that case, which doesn't overly flush the cache too much.
 	 */
 	if (CPU_CONTEXT(smp_processor_id(), mm) != 
-				CPU_CONTEXT(smp_processor_id(), current->mm)) {
+	    CPU_CONTEXT(smp_processor_id(), current->mm)) {
 		/*
 		 * Do indexed flush, too much work to get the (possible)
 		 * tlb refills to work correctly.
@@ -1486,8 +1486,8 @@
 	__restore_flags(flags);
 }
 
-static void
-r4k_flush_cache_page_s128d32i32(struct vm_area_struct *vma, unsigned long page)
+static void r4k_flush_cache_page_s128d32i32(struct vm_area_struct *vma,
+					    unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long flags;
@@ -1524,7 +1524,7 @@
 	 * in that case, which doesn't overly flush the cache too much.
 	 */
 	if (CPU_CONTEXT(smp_processor_id(), mm) != 
-				CPU_CONTEXT(smp_processor_id(), current->mm)) {
+	    CPU_CONTEXT(smp_processor_id(), current->mm)) {
 		/* Do indexed flush, too much work to get the (possible)
 		 * tlb refills to work correctly.
 		 */
@@ -1537,8 +1537,8 @@
 	__restore_flags(flags);
 }
 
-static void
-r4k_flush_cache_page_d16i16(struct vm_area_struct *vma, unsigned long page)
+static void r4k_flush_cache_page_d16i16(struct vm_area_struct *vma,
+					unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long flags;
@@ -1587,8 +1587,8 @@
 	__restore_flags(flags);
 }
 
-static void
-r4k_flush_cache_page_d32i32(struct vm_area_struct *vma, unsigned long page)
+static void r4k_flush_cache_page_d32i32(struct vm_area_struct *vma,
+					unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long flags;
@@ -1639,9 +1639,8 @@
 	__restore_flags(flags);
 }
 
-static void
-r4k_flush_cache_page_d32i32_r4600(struct vm_area_struct *vma,
-                                  unsigned long page)
+static void r4k_flush_cache_page_d32i32_r4600(struct vm_area_struct *vma,
+					      unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long flags;
@@ -1741,8 +1740,7 @@
  * (Revision 2.0 device errata from IDT available on http://www.idt.com/
  * in .pdf format.)
  */
-static void
-r4k_dma_cache_wback_inv_pc(unsigned long addr, unsigned long size)
+static void r4k_dma_cache_wback_inv_pc(unsigned long addr, unsigned long size)
 {
 	unsigned long end, a;
 	unsigned int flags;
@@ -1766,8 +1764,7 @@
 	bc_wback_inv(addr, size);
 }
 
-static void
-r4k_dma_cache_wback_inv_sc(unsigned long addr, unsigned long size)
+static void r4k_dma_cache_wback_inv_sc(unsigned long addr, unsigned long size)
 {
 	unsigned long end, a;
 
@@ -1785,8 +1782,7 @@
 	}
 }
 
-static void
-r4k_dma_cache_inv_pc(unsigned long addr, unsigned long size)
+static void r4k_dma_cache_inv_pc(unsigned long addr, unsigned long size)
 {
 	unsigned long end, a;
 	unsigned int flags;
@@ -1811,8 +1807,7 @@
 	bc_inv(addr, size);
 }
 
-static void
-r4k_dma_cache_inv_sc(unsigned long addr, unsigned long size)
+static void r4k_dma_cache_inv_sc(unsigned long addr, unsigned long size)
 {
 	unsigned long end, a;
 
@@ -1830,8 +1825,7 @@
 	}
 }
 
-static void
-r4k_dma_cache_wback(unsigned long addr, unsigned long size)
+static void r4k_dma_cache_wback(unsigned long addr, unsigned long size)
 {
 	panic("r4k_dma_cache called - should not happen.\n");
 }
@@ -1843,33 +1837,24 @@
  */
 static void r4k_flush_cache_sigtramp(unsigned long addr)
 {
-	unsigned long daddr, iaddr;
-
-	daddr = addr & ~((unsigned long)dc_lsize - 1);
 	__asm__ __volatile__("nop;nop;nop;nop");	/* R4600 V1.7 */
-	protected_writeback_dcache_line(daddr);
-	protected_writeback_dcache_line(daddr + dc_lsize);
-	iaddr = addr & ~((unsigned long)ic_lsize - 1);
-	protected_flush_icache_line(iaddr);
-	protected_flush_icache_line(iaddr + ic_lsize);
+
+	protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
+	protected_flush_icache_line(addr & ~(ic_lsize - 1));
 }
 
 static void r4600v20k_flush_cache_sigtramp(unsigned long addr)
 {
-	unsigned long daddr, iaddr;
 	unsigned int flags;
 
-	daddr = addr & ~((unsigned long)dc_lsize - 1);
 	__save_and_cli(flags);
 
 	/* Clear internal cache refill buffer */
 	*(volatile unsigned int *)KSEG1;
 
-	protected_writeback_dcache_line(daddr);
-	protected_writeback_dcache_line(daddr + dc_lsize);
-	iaddr = addr & ~((unsigned long)ic_lsize - 1);
-	protected_flush_icache_line(iaddr);
-	protected_flush_icache_line(iaddr + ic_lsize);
+	protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
+	protected_flush_icache_line(addr & ~(ic_lsize - 1));
+
 	__restore_flags(flags);
 }
 
@@ -2011,8 +1996,7 @@
 	}
 }
 
-static void
-r4k_flush_cache_l2(void)
+static void r4k_flush_cache_l2(void)
 {
 }
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/mm/umap.c linux/arch/mips64/mm/umap.c
--- v2.4.9/linux/arch/mips64/mm/umap.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/mips64/mm/umap.c	Sun Sep  9 10:43:02 2001
@@ -25,8 +25,8 @@
 #include <asm/pgalloc.h>
 #include <asm/page.h>
 
-static inline void
-remove_mapping_pte_range (pmd_t *pmd, unsigned long address, unsigned long size)
+static inline void remove_mapping_pte_range (pmd_t *pmd, unsigned long address,
+					     unsigned long size)
 {
 	pte_t *pte;
 	unsigned long end;
@@ -34,7 +34,8 @@
 	if (pmd_none (*pmd))
 		return;
 	if (pmd_bad (*pmd)){
-		printk ("remove_graphics_pte_range: bad pmd (%08lx)\n", pmd_val (*pmd));
+		printk ("remove_graphics_pte_range: bad pmd (%08lx)\n",
+			pmd_val (*pmd));
 		pmd_clear (pmd);
 		return;
 	}
@@ -53,8 +54,8 @@
 						  
 }
 
-static inline void
-remove_mapping_pmd_range (pgd_t *pgd, unsigned long address, unsigned long size)
+static inline void remove_mapping_pmd_range (pgd_t *pgd, unsigned long address,
+					     unsigned long size)
 {
 	pmd_t *pmd;
 	unsigned long end;
@@ -63,7 +64,8 @@
 		return;
 
 	if (pgd_bad (*pgd)){
-		printk ("remove_graphics_pmd_range: bad pgd (%08lx)\n", pgd_val (*pgd));
+		printk ("remove_graphics_pmd_range: bad pgd (%08lx)\n",
+			pgd_val (*pgd));
 		pgd_clear (pgd);
 		return;
 	}
@@ -84,8 +86,8 @@
  * This routine is called from the page fault handler to remove a
  * range of active mappings at this point
  */
-void
-remove_mapping (struct task_struct *task, unsigned long start, unsigned long end)
+void remove_mapping (struct task_struct *task, unsigned long start,
+		     unsigned long end)
 {
 	unsigned long beg = start;
 	pgd_t *dir;
@@ -137,8 +139,8 @@
  * maps a range of vmalloc()ed memory into the requested pages. the old
  * mappings are removed. 
  */
-static inline void
-vmap_pte_range (pte_t *pte, unsigned long address, unsigned long size, unsigned long vaddr)
+static inline void vmap_pte_range (pte_t *pte, unsigned long address,
+				   unsigned long size, unsigned long vaddr)
 {
 	unsigned long end;
 	pgd_t *vdir;
@@ -167,8 +169,8 @@
 	} while (address < end);
 }
 
-static inline int
-vmap_pmd_range (pmd_t *pmd, unsigned long address, unsigned long size, unsigned long vaddr)
+static inline int vmap_pmd_range (pmd_t *pmd, unsigned long address,
+				  unsigned long size, unsigned long vaddr)
 {
 	unsigned long end;
 
@@ -178,7 +180,7 @@
 		end = PGDIR_SIZE;
 	vaddr -= address;
 	do {
-		pte_t * pte = pte_alloc(pmd, address);
+		pte_t * pte = pte_alloc(current->mm, pmd, address);
 		if (!pte)
 			return -ENOMEM;
 		vmap_pte_range(pte, address, end - address, address + vaddr);
@@ -188,8 +190,8 @@
 	return 0;
 }
 
-int
-vmap_page_range (unsigned long from, unsigned long size, unsigned long vaddr)
+int vmap_page_range (unsigned long from, unsigned long size,
+		     unsigned long vaddr)
 {
 	int error = 0;
 	pgd_t * dir;
@@ -200,7 +202,7 @@
 	dir = pgd_offset(current->mm, from);
 	flush_cache_range(current->mm, beg, end);
 	while (from < end) {
-		pmd_t *pmd = pmd_alloc(dir, from);
+		pmd_t *pmd = pmd_alloc(current->mm, dir, from);
 		error = -ENOMEM;
 		if (!pmd)
 			break;
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip22/ip22-berr.c linux/arch/mips64/sgi-ip22/ip22-berr.c
--- v2.4.9/linux/arch/mips64/sgi-ip22/ip22-berr.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/sgi-ip22/ip22-berr.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: ip22-berr.c,v 1.1 2000/01/21 22:34:03 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
@@ -9,6 +8,9 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
+
+#include <asm/module.h>
 #include <asm/uaccess.h>
 #include <asm/paccess.h>
 #include <asm/addrspace.h>
@@ -41,16 +43,43 @@
 	return 0;
 }
 
+extern spinlock_t modlist_lock;
+
 static inline unsigned long
 search_dbe_table(unsigned long addr)
 {
-	unsigned long ret;
+	unsigned long ret = 0;
 
+#ifndef CONFIG_MODULES
 	/* There is only the kernel to search.  */
 	ret = search_one_table(__start___dbe_table, __stop___dbe_table-1, addr);
-	if (ret) return ret;
-
-	return 0;
+	return ret;
+#else
+	unsigned long flags;
+
+	/* The kernel is the last "module" -- no need to treat it special.  */
+	struct module *mp;
+	struct archdata *ap;
+
+	spin_lock_irqsave(&modlist_lock, flags);
+	for (mp = module_list; mp != NULL; mp = mp->next) {
+		if (!mod_member_present(mp, archdata_end) ||
+        	    !mod_archdata_member_present(mp, struct archdata,
+						 dbe_table_end))
+			continue;
+		ap = (struct archdata *)(mod->archdata_start);
+
+		if (ap->dbe_table_start == NULL ||
+		    !(mp->flags & (MOD_RUNNING | MOD_INITIALIZING)))
+			continue;
+		ret = search_one_table(ap->dbe_table_start,
+				       ap->dbe_table_end - 1, addr);
+		if (ret)
+			break;
+	}
+	spin_unlock_irqrestore(&modlist_lock, flags);
+	return ret;
+#endif
 }
 
 void do_ibe(struct pt_regs *regs)
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip22/ip22-hpc.c linux/arch/mips64/sgi-ip22/ip22-hpc.c
--- v2.4.9/linux/arch/mips64/sgi-ip22/ip22-hpc.c	Tue Nov 28 21:42:04 2000
+++ linux/arch/mips64/sgi-ip22/ip22-hpc.c	Sun Sep  9 10:43:02 2001
@@ -1,9 +1,8 @@
-/* $Id: ip22-hpc.c,v 1.2 1999/10/19 20:51:52 ralf Exp $
- *
+/*
  * ip22-hpc.c: Routines for generic manipulation of the HPC controllers.
  *
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
- * Copyright (C) 1998, 1999 Ralf Baechle
+ * Copyright (C) 1998, 1999, 2001 Ralf Baechle
  */
 #include <linux/init.h>
 #include <linux/types.h>
@@ -11,7 +10,6 @@
 #include <asm/addrspace.h>
 #include <asm/sgi/sgihpc.h>
 #include <asm/sgi/sgint23.h>
-#include <asm/sgialib.h>
 #include <asm/bootinfo.h>
 
 #undef DEBUG_SGIHPC
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip22/ip22-int.c linux/arch/mips64/sgi-ip22/ip22-int.c
--- v2.4.9/linux/arch/mips64/sgi-ip22/ip22-int.c	Fri Feb  9 11:29:44 2001
+++ linux/arch/mips64/sgi-ip22/ip22-int.c	Sun Sep  9 10:43:02 2001
@@ -34,7 +34,6 @@
 #include <asm/sgi/sgi.h>
 #include <asm/sgi/sgihpc.h>
 #include <asm/sgi/sgint23.h>
-#include <asm/sgialib.h>
 
 /*
  * Linux has a controller-independent x86 interrupt architecture.
@@ -287,9 +286,7 @@
 	irq_enter(cpu, irq);
 	kstat.irqs[0][irq]++;
 
-	printk("Got irq %d, press a key.", irq);
-	prom_getchar();
-	ArcEnterInteractiveMode();
+	panic(KERN_DEBUG "Got irq %d, press a key.", irq);
 
 	/*
 	 * mask and ack quickly, we don't want the irq controller
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip22/ip22-irq.S linux/arch/mips64/sgi-ip22/ip22-irq.S
--- v2.4.9/linux/arch/mips64/sgi-ip22/ip22-irq.S	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/sgi-ip22/ip22-irq.S	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: ip22-irq.S,v 1.1 1999/08/20 21:13:33 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip22/ip22-mc.c linux/arch/mips64/sgi-ip22/ip22-mc.c
--- v2.4.9/linux/arch/mips64/sgi-ip22/ip22-mc.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/sgi-ip22/ip22-mc.c	Sun Sep  9 10:43:02 2001
@@ -1,12 +1,10 @@
-/* $Id: ip22-mc.c,v 1.2 1999/10/19 20:51:52 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * indy_mc.c: Routines for manipulating the INDY memory controller.
- *
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
+ * Copyright (C) 2001 Ralf Baechle (ralf@gnu.org)
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -15,7 +13,6 @@
 #include <asm/ptrace.h>
 #include <asm/sgi/sgimc.h>
 #include <asm/sgi/sgihpc.h>
-#include <asm/sgialib.h>
 
 /* #define DEBUG_SGIMC */
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip22/ip22-reset.c linux/arch/mips64/sgi-ip22/ip22-reset.c
--- v2.4.9/linux/arch/mips64/sgi-ip22/ip22-reset.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/sgi-ip22/ip22-reset.c	Sun Sep  9 10:43:02 2001
@@ -1,12 +1,11 @@
-/* $Id: ip22-reset.c,v 1.3 1999/10/08 21:07:51 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
  * Reset an IP22.
  *
- * Copyright (C) 1997, 1998, 1999 by Ralf Baechle
+ * Copyright (C) 1997, 1998, 1999, 2001 by Ralf Baechle
  */
 #include <linux/kernel.h>
 #include <linux/sched.h>
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip22/ip22-rtc.c linux/arch/mips64/sgi-ip22/ip22-rtc.c
--- v2.4.9/linux/arch/mips64/sgi-ip22/ip22-rtc.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/sgi-ip22/ip22-rtc.c	Sun Sep  9 10:43:02 2001
@@ -1,12 +1,11 @@
-/* $Id: ip22-rtc.c,v 1.1 1999/08/20 21:13:34 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
  * RTC routines for Indy style attached Dallas chip.
  *
- * Copyright (C) 1998 by Ralf Baechle
+ * Copyright (C) 1998, 2001 by Ralf Baechle
  */
 #include <linux/mc146818rtc.h>
 #include <asm/sgi/sgihpc.h>
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip22/ip22-sc.c linux/arch/mips64/sgi-ip22/ip22-sc.c
--- v2.4.9/linux/arch/mips64/sgi-ip22/ip22-sc.c	Tue Mar  6 19:44:36 2001
+++ linux/arch/mips64/sgi-ip22/ip22-sc.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: ip22-sc.c,v 1.2 1999/12/04 03:59:01 ralf Exp $
- *
+/*
  * indy_sc.c: Indy cache management functions.
  *
  * Copyright (C) 1997 Ralf Baechle (ralf@gnu.org),
@@ -16,7 +15,6 @@
 #include <asm/pgtable.h>
 #include <asm/system.h>
 #include <asm/bootinfo.h>
-#include <asm/sgialib.h>
 #include <asm/mmu_context.h>
 
 /* Secondary cache size in bytes, if present.  */
@@ -31,17 +29,17 @@
 
 static inline void indy_sc_wipe(unsigned long first, unsigned long last)
 {
-	__asm__ __volatile__("
-		.set	noreorder
-		or	%0, %4		# first line to flush
-		or	%1, %4		# last line to flush
-1:		sw	$0, 0(%0)
-		bne	%0, %1, 1b
-		daddu	%0, 32
-		.set reorder"
-		: "=r" (first), "=r" (last)
-		: "0" (first), "1" (last), "r" (0x9000000080000000)
-		: "$1");
+	__asm__ __volatile__(
+	".set\tnoreorder\n\t"
+	"or\t%0, %4\t\t\t# first line to flush\n\t"
+	"or\t%1, %4\t\t\t# last line to flush\n"
+	"1:\tsw	$0, 0(%0)\n\t"
+	"bne\t%0, %1, 1b\n\t"
+	"daddu\t%0, 32\n\t"
+	".set reorder"
+	: "=r" (first), "=r" (last)
+	: "0" (first), "1" (last), "r" (0x9000000080000000)
+	: "$1");
 }
 
 static void indy_sc_wback_invalidate(unsigned long addr, unsigned long size)
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip22/ip22-setup.c linux/arch/mips64/sgi-ip22/ip22-setup.c
--- v2.4.9/linux/arch/mips64/sgi-ip22/ip22-setup.c	Tue Nov 28 21:42:04 2000
+++ linux/arch/mips64/sgi-ip22/ip22-setup.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: ip22-setup.c,v 1.4 1999/10/08 21:07:51 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
@@ -145,7 +144,7 @@
 	 * graphics console, it is set to "d" for the first serial
 	 * line and "d2" for the second serial line.
 	 */
-	ctype = ArcArcGetEnvironmentVariable("console");
+	ctype = ArcGetEnvironmentVariable("console");
 	if(*ctype == 'd') {
 		if(*(ctype+1)=='2')
 			console_setup ("ttyS1");
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip22/ip22-timer.c linux/arch/mips64/sgi-ip22/ip22-timer.c
--- v2.4.9/linux/arch/mips64/sgi-ip22/ip22-timer.c	Tue Nov 28 21:42:04 2000
+++ linux/arch/mips64/sgi-ip22/ip22-timer.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: ip22-timer.c,v 1.6 2000/02/04 07:40:24 ralf Exp $
- *
+/*
  * indy_timer.c: Setting up the clock on the INDY 8254 controller.
  *
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
@@ -238,9 +237,7 @@
 
 	irq_enter(cpu, irq);
 	kstat.irqs[0][irq]++;
-	printk("indy_8254timer_irq: Whoops, should not have gotten this IRQ\n");
-	prom_getchar();
-	ArcEnterInteractiveMode();
+	panic("indy_8254timer_irq: Whoops, should not have gotten this IRQ\n");
 	irq_exit(cpu, irq);
 }
 
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip22/system.c linux/arch/mips64/sgi-ip22/system.c
--- v2.4.9/linux/arch/mips64/sgi-ip22/system.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/sgi-ip22/system.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: system.c,v 1.3 1999/10/19 20:51:52 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
@@ -7,6 +6,7 @@
  * system.c: Probe the system type using ARCS prom interface library.
  *
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
+ * Copyright (C) 2000, 2001 Ralf Baechle (ralf@gnu.org)
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -17,8 +17,6 @@
 #include <asm/sgialib.h>
 #include <asm/bootinfo.h>
 
-enum sgi_mach sgimach;
-
 struct smatch {
 	char *name;
 	int type;
@@ -46,10 +44,7 @@
 		if(!strcmp(s, sgi_cputable[i].name))
 			return sgi_cputable[i].type;
 	}
-	prom_printf("\nYeee, could not determine MIPS cpu type <%s>\n", s);
-	prom_printf("press a key to reboot\n");
-	prom_getchar();
-	ArcEnterInteractiveMode();
+	panic("\nYeee, could not determine MIPS cpu type <%s>", s);
 	return 0;
 }
 
@@ -74,23 +69,16 @@
 		int ncpus = 0;
 
 		if(p->type == Cpu) {
-			if(++ncpus > 1) {
-				prom_printf("\nYeee, SGI MP not ready yet\n");
-				prom_printf("press a key to reboot\n");
-				prom_getchar();
-				ArcEnterInteractiveMode();
-			}
+			if (++ncpus > 1)
+				panic("\nYeee, SGI MP not ready yet");
 			printk("CPU: %s ", p->iname);
 			cpup = p;
 			cputype = string_to_cpu(cpup->iname);
 		}
 		p = ArcGetPeer(p);
 	}
-	if(cputype == -1) {
-		prom_printf("\nYeee, could not find cpu ARCS component\n");
-		prom_printf("press a key to reboot\n");
-		prom_getchar();
-		ArcEnterInteractiveMode();
+	if (cputype == -1) {
+		panic("\nYeee, could not find cpu ARCS component");
 	}
 	p = ArcGetChild(cpup);
 	while(p) {
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip22/time.c linux/arch/mips64/sgi-ip22/time.c
--- v2.4.9/linux/arch/mips64/sgi-ip22/time.c	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/sgi-ip22/time.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: time.c,v 1.1 1999/08/20 21:13:34 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip27/Makefile linux/arch/mips64/sgi-ip27/Makefile
--- v2.4.9/linux/arch/mips64/sgi-ip27/Makefile	Sun Feb  4 21:48:46 2001
+++ linux/arch/mips64/sgi-ip27/Makefile	Sun Sep  9 10:43:02 2001
@@ -7,7 +7,7 @@
 .S.o:
 	$(CC) $(CFLAGS) -c $< -o $*.o
 
-O_TARGET = ip27.a
+O_TARGET = ip27.o
 
 obj-y	:= ip27-berr.o ip27-console.o ip27-irq.o ip27-init.o ip27-irq-glue.o \
 	   ip27-klconfig.o ip27-klnuma.o ip27-memory.o ip27-nmi.o ip27-pci.o \
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip27/ip27-berr.c linux/arch/mips64/sgi-ip27/ip27-berr.c
--- v2.4.9/linux/arch/mips64/sgi-ip27/ip27-berr.c	Sun Jul  9 22:18:16 2000
+++ linux/arch/mips64/sgi-ip27/ip27-berr.c	Sun Sep  9 10:43:02 2001
@@ -8,6 +8,9 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
+
+#include <asm/module.h>
 #include <asm/sn/addrs.h>
 #include <asm/sn/arch.h>
 #include <asm/sn/sn0/hub.h>
@@ -43,16 +46,43 @@
 	return 0;
 }
 
+extern spinlock_t modlist_lock;
+
 static inline unsigned long
 search_dbe_table(unsigned long addr)
 {
 	unsigned long ret;
 
+#ifndef CONFIG_MODULES
 	/* There is only the kernel to search.  */
 	ret = search_one_table(__start___dbe_table, __stop___dbe_table-1, addr);
-	if (ret) return ret;
-
-	return 0;
+	return ret;
+#else
+	unsigned long flags;
+
+	/* The kernel is the last "module" -- no need to treat it special.  */
+	struct module *mp;
+	struct archdata *ap;
+
+	spin_lock_irqsave(&modlist_lock, flags);
+	for (mp = module_list; mp != NULL; mp = mp->next) {
+		if (!mod_member_present(mp, archdata_end) ||
+        	    !mod_archdata_member_present(mp, struct archdata,
+						 dbe_table_end))
+			continue;
+		ap = (struct archdata *)(mod->archdata_start);
+
+		if (ap->dbe_table_start == NULL ||
+		    !(mp->flags & (MOD_RUNNING | MOD_INITIALIZING)))
+			continue;
+		ret = search_one_table(ap->dbe_table_start,
+				       ap->dbe_table_end - 1, addr);
+		if (ret)
+			break;
+	}
+	spin_unlock_irqrestore(&modlist_lock, flags);
+	return ret;
+#endif
 }
 
 void do_ibe(struct pt_regs *regs)
@@ -64,9 +94,43 @@
 	while(1);
 }
 
+static void dump_hub_information(unsigned long errst0, unsigned long errst1)
+{
+	static char *err_type[2][8] = {
+		{ NULL, "Uncached Partial Read PRERR", "DERR", "Read Timeout",
+		  NULL, NULL, NULL, NULL },
+		{ "WERR", "Uncached Partial Write", "PWERR", "Write Timeout",
+		  NULL, NULL, NULL, NULL }
+	};
+	int wrb = errst1 & PI_ERR_ST1_WRBRRB_MASK;
+
+	if (!(errst0 & PI_ERR_ST0_VALID_MASK)) {
+		printk("Hub does not contain valid error information\n");
+		return;
+	}
+
+	
+	printk("Hub has valid error information:\n");
+	if (errst0 & PI_ERR_ST0_OVERRUN_MASK)
+		printk("Overrun is set.  Error stack may contain additional "
+		       "information.\n");
+	printk("Hub error address is %08lx\n",
+	       (errst0 & PI_ERR_ST0_ADDR_MASK) >> (PI_ERR_ST0_ADDR_SHFT - 3));
+	printk("Incoming message command 0x%lx\n",
+	       (errst0 & PI_ERR_ST0_CMD_MASK) >> PI_ERR_ST0_CMD_SHFT);
+	printk("Supplemental field of incoming message is 0x%lx\n",
+	       (errst0 & PI_ERR_ST0_SUPPL_MASK) >> PI_ERR_ST0_SUPPL_SHFT);
+	printk("T5 Rn (for RRB only) is 0x%lx\n",
+	       (errst0 & PI_ERR_ST0_REQNUM_MASK) >> PI_ERR_ST0_REQNUM_SHFT);
+	printk("Error type is %s\n", err_type[wrb]
+	       [(errst0 & PI_ERR_ST0_TYPE_MASK) >> PI_ERR_ST0_TYPE_SHFT]
+		? : "invalid");
+}
+
 void do_dbe(struct pt_regs *regs)
 {
-	unsigned long fixup;
+	unsigned long fixup, errst0, errst1;
+	int cpu = LOCAL_HUB_L(PI_CPU_NUM);
 
 	fixup = search_dbe_table(regs->cp0_epc);
 	if (fixup) {
@@ -77,7 +141,12 @@
 		return;
 	}
 
-	printk("Got dbe at 0x%lx\n", regs->cp0_epc);
+	printk("Slice %c got dbe at 0x%lx\n", 'A' + cpu, regs->cp0_epc);
+	printk("Hub information:\n");
+	printk("ERR_INT_PEND = 0x%06lx\n", LOCAL_HUB_L(PI_ERR_INT_PEND));
+	errst0 = LOCAL_HUB_L(cpu ? PI_ERR_STATUS0_B : PI_ERR_STATUS0_A);
+	errst1 = LOCAL_HUB_L(cpu ? PI_ERR_STATUS1_B : PI_ERR_STATUS1_A);
+	dump_hub_information(errst0, errst1);
 	show_regs(regs);
 	dump_tlb_all();
 	while(1);
@@ -95,7 +164,7 @@
 	set_except_vector(7, handle_dbe);
 
 	LOCAL_HUB_S(PI_ERR_INT_PEND,
-	            cpu ? PI_ERR_CLEAR_ALL_A : PI_ERR_CLEAR_ALL_B);
+	            cpu ? PI_ERR_CLEAR_ALL_B : PI_ERR_CLEAR_ALL_A);
 	LOCAL_HUB_S(PI_ERR_INT_MASK_A + cpuoff, 0);
 	LOCAL_HUB_S(PI_ERR_STACK_ADDR_A + cpuoff, 0);
 	LOCAL_HUB_S(PI_ERR_STACK_SIZE, 0);	/* Disable error stack */
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip27/ip27-console.c linux/arch/mips64/sgi-ip27/ip27-console.c
--- v2.4.9/linux/arch/mips64/sgi-ip27/ip27-console.c	Tue Nov 28 21:42:04 2000
+++ linux/arch/mips64/sgi-ip27/ip27-console.c	Sun Sep  9 10:43:02 2001
@@ -2,6 +2,8 @@
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
+ *
+ * Copyright (C) 2001 Ralf Baechle
  */
 #include <linux/init.h>
 #include <linux/console.h>
@@ -11,7 +13,6 @@
 #include <asm/sn/sn0/hub.h>
 #include <asm/sn/klconfig.h>
 #include <asm/sn/ioc3.h>
-#include <asm/sgialib.h>
 #include <asm/sn/sn_private.h>
 
 void prom_putchar(char c)
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip27/ip27-init.c linux/arch/mips64/sgi-ip27/ip27-init.c
--- v2.4.9/linux/arch/mips64/sgi-ip27/ip27-init.c	Sun Feb  4 21:48:46 2001
+++ linux/arch/mips64/sgi-ip27/ip27-init.c	Sun Sep  9 10:43:02 2001
@@ -1,3 +1,12 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General
+ * Public License.  See the file "COPYING" in the main directory of this
+ * archive for more details.
+ *
+ * Copyright (C) 2000 - 2001 by Kanoj Sarcar (kanoj@sgi.com)
+ * Copyright (C) 2000 - 2001 by Silicon Graphics, Inc.
+ */
+
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -23,14 +32,14 @@
 #include <asm/sn/sn_private.h>
 #include <asm/sn/sn0/ip27.h>
 #include <asm/sn/mapped_kernel.h>
+#include <asm/sn/sn0/addrs.h>
+#include <asm/sn/gda.h>
 
 #define CPU_NONE		(cpuid_t)-1
 
-#define	CPUMASK_CLRALL(p)	(p) = 0
-#define CPUMASK_SETB(p, bit)	(p) |= 1 << (bit)
-#define CPUMASK_CLRB(p, bit)	(p) &= ~(1ULL << (bit))
-#define CPUMASK_TSTB(p, bit)	((p) & (1ULL << (bit)))
-
+/*
+ * The following should work till 64 nodes, ie 128p SN0s.
+ */
 #define CNODEMASK_CLRALL(p)	(p) = 0
 #define CNODEMASK_TSTB(p, bit)	((p) & (1ULL << (bit)))
 #define CNODEMASK_SETB(p, bit)	((p) |= 1ULL << (bit))
@@ -42,11 +51,13 @@
 static spinlock_t hub_mask_lock = SPIN_LOCK_UNLOCKED;
 static cnodemask_t hub_init_mask;
 static atomic_t numstarted = ATOMIC_INIT(1);
+static int router_distance;
 nasid_t master_nasid = INVALID_NASID;
 
 cnodeid_t	nasid_to_compact_node[MAX_NASIDS];
 nasid_t		compact_to_nasid_node[MAX_COMPACT_NODES];
 cnodeid_t	cpuid_to_compact_node[MAXCPUS];
+char		node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES];
 
 hubreg_t get_region(cnodeid_t cnode)
 {
@@ -89,9 +100,13 @@
 		return brd->brd_nasid;
 }
 
+/* Tweak this for maximum number of CPUs to activate */
+static int max_cpus = NR_CPUS;
+
 int do_cpumask(cnodeid_t cnode, nasid_t nasid, cpumask_t *boot_cpumask, 
 							int *highest)
 {
+	static int tot_cpus_found = 0;
 	lboard_t *brd;
 	klcpu_t *acpu;
 	int cpus_found = 0;
@@ -109,9 +124,11 @@
 			if (cpuid > *highest)
 				*highest = cpuid;
 			/* Only let it join in if it's marked enabled */
-			if (acpu->cpu_info.flags & KLINFO_ENABLE) {
+			if ((acpu->cpu_info.flags & KLINFO_ENABLE) &&
+						(tot_cpus_found != max_cpus)) {
 				CPUMASK_SETB(*boot_cpumask, cpuid);
 				cpus_found++;
+				tot_cpus_found++;
 			}
 			acpu = (klcpu_t *)find_component(brd, (klinfo_t *)acpu, 
 								KLSTRUCT_CPU);
@@ -172,6 +189,9 @@
 void mlreset (void)
 {
 	int i;
+	void init_topology_matrix(void);
+	void dump_topology(void);
+
 
 	master_nasid = get_nasid();
 	fine_mode = is_fine_dirmode();
@@ -184,6 +204,9 @@
 	maxcpus = cpu_node_probe(&boot_cpumask, &numnodes);
 	printk("Discovered %d cpus on %d nodes\n", maxcpus, numnodes);
 
+	init_topology_matrix();
+	dump_topology();
+
 	gen_region_mask(&region_mask, numnodes);
 	CNODEMASK_CLRALL(hub_init_mask);
 
@@ -534,3 +557,284 @@
 #else /* CONFIG_SMP */
 void cboot(void) {}
 #endif /* CONFIG_SMP */
+
+
+#define	rou_rflag	rou_flags
+
+void
+router_recurse(klrou_t *router_a, klrou_t *router_b, int depth)
+{
+	klrou_t *router;
+	lboard_t *brd;
+	int	port;
+
+	if (router_a->rou_rflag == 1)
+		return;
+
+	if (depth >= router_distance)
+		return;
+
+	router_a->rou_rflag = 1;
+
+	for (port = 1; port <= MAX_ROUTER_PORTS; port++) {
+		if (router_a->rou_port[port].port_nasid == INVALID_NASID)
+			continue;
+
+		brd = (lboard_t *)NODE_OFFSET_TO_K0(
+			router_a->rou_port[port].port_nasid,
+			router_a->rou_port[port].port_offset);
+
+		if (brd->brd_type == KLTYPE_ROUTER) {
+			router = (klrou_t *)NODE_OFFSET_TO_K0(NASID_GET(brd), brd->brd_compts[0]);
+			if (router == router_b) {
+				if (depth < router_distance)
+					router_distance = depth;
+			}
+			else
+				router_recurse(router, router_b, depth + 1);
+		}
+	}
+
+	router_a->rou_rflag = 0;
+}
+
+int
+node_distance(nasid_t nasid_a, nasid_t nasid_b)
+{
+	nasid_t nasid;
+	cnodeid_t cnode;
+	lboard_t *brd, *dest_brd;
+	int port;
+	klrou_t *router, *router_a = NULL, *router_b = NULL;
+
+	/* Figure out which routers nodes in question are connected to */
+	for (cnode = 0; cnode < numnodes; cnode++) {
+		nasid = COMPACT_TO_NASID_NODEID(cnode);
+
+		if (nasid == -1) continue;
+
+		brd = find_lboard_class((lboard_t *)KL_CONFIG_INFO(nasid),
+					KLTYPE_ROUTER);
+
+		if (!brd)
+			continue;
+
+		do {
+			if (brd->brd_flags & DUPLICATE_BOARD)
+				continue;
+
+			router = (klrou_t *)NODE_OFFSET_TO_K0(NASID_GET(brd), brd->brd_compts[0]);
+			router->rou_rflag = 0;
+
+			for (port = 1; port <= MAX_ROUTER_PORTS; port++) {
+				if (router->rou_port[port].port_nasid == INVALID_NASID)
+					continue;
+
+				dest_brd = (lboard_t *)NODE_OFFSET_TO_K0(
+					router->rou_port[port].port_nasid,
+					router->rou_port[port].port_offset);
+
+				if (dest_brd->brd_type == KLTYPE_IP27) {
+					if (dest_brd->brd_nasid == nasid_a)
+						router_a = router;
+					if (dest_brd->brd_nasid == nasid_b)
+						router_b = router;
+				}
+			}
+			
+		} while ( (brd = find_lboard_class(KLCF_NEXT(brd), KLTYPE_ROUTER)) );
+	}
+
+	if (router_a == NULL) {
+		printk("node_distance: router_a NULL\n");
+		return -1;
+	}
+	if (router_b == NULL) {
+		printk("node_distance: router_b NULL\n");
+		return -1;
+	}
+
+	if (nasid_a == nasid_b)
+		return 0;
+
+	if (router_a == router_b)
+		return 1;
+
+	router_distance = 100;
+	router_recurse(router_a, router_b, 2);
+
+	return router_distance;
+}
+
+void
+init_topology_matrix(void)
+{
+	nasid_t nasid, nasid2;
+	cnodeid_t row, col;
+
+	for (row = 0; row < MAX_COMPACT_NODES; row++)
+		for (col = 0; col < MAX_COMPACT_NODES; col++)
+			node_distances[row][col] = -1;
+
+	for (row = 0; row < numnodes; row++) {
+		nasid = COMPACT_TO_NASID_NODEID(row);
+		for (col = 0; col < numnodes; col++) {
+			nasid2 = COMPACT_TO_NASID_NODEID(col);
+			node_distances[row][col] = node_distance(nasid, nasid2);
+		}
+	}
+}
+
+void
+dump_topology(void)
+{
+	nasid_t nasid;
+	cnodeid_t cnode;
+	lboard_t *brd, *dest_brd;
+	int port;
+	int router_num = 0;
+	klrou_t *router;
+	cnodeid_t row, col;
+
+	printk("************** Topology ********************\n");
+
+	printk("    ");
+	for (col = 0; col < numnodes; col++)
+		printk("%02d ", col);
+	printk("\n");
+	for (row = 0; row < numnodes; row++) {
+		printk("%02d  ", row);
+		for (col = 0; col < numnodes; col++)
+			printk("%2d ", node_distances[row][col]);
+		printk("\n");
+	}
+
+	for (cnode = 0; cnode < numnodes; cnode++) {
+		nasid = COMPACT_TO_NASID_NODEID(cnode);
+
+		if (nasid == -1) continue;
+
+		brd = find_lboard_class((lboard_t *)KL_CONFIG_INFO(nasid),
+					KLTYPE_ROUTER);
+
+		if (!brd)
+			continue;
+
+		do {
+			if (brd->brd_flags & DUPLICATE_BOARD)
+				continue;
+			printk("Router %d:", router_num);
+			router_num++;
+
+			router = (klrou_t *)NODE_OFFSET_TO_K0(NASID_GET(brd), brd->brd_compts[0]);
+
+			for (port = 1; port <= MAX_ROUTER_PORTS; port++) {
+				if (router->rou_port[port].port_nasid == INVALID_NASID)
+					continue;
+
+				dest_brd = (lboard_t *)NODE_OFFSET_TO_K0(
+					router->rou_port[port].port_nasid,
+					router->rou_port[port].port_offset);
+
+				if (dest_brd->brd_type == KLTYPE_IP27)
+					printk(" %d", dest_brd->brd_nasid);
+				if (dest_brd->brd_type == KLTYPE_ROUTER)
+					printk(" r");
+			}
+			printk("\n");
+			
+		} while ( (brd = find_lboard_class(KLCF_NEXT(brd), KLTYPE_ROUTER)) );
+	}
+}
+
+#if 0
+#define		brd_widgetnum	brd_slot
+#define NODE_OFFSET_TO_KLINFO(n,off)    ((klinfo_t*) TO_NODE_CAC(n,off))
+void
+dump_klcfg(void)
+{
+	cnodeid_t       cnode;
+	int i;
+	nasid_t         nasid;
+	lboard_t        *lbptr;
+	gda_t           *gdap;
+	
+	gdap = (gda_t *)GDA_ADDR(get_nasid());
+	if (gdap->g_magic != GDA_MAGIC) {
+		printk("dumpklcfg_cmd: Invalid GDA MAGIC\n");
+		return;
+	}
+
+	for (cnode = 0; cnode < MAX_COMPACT_NODES; cnode ++) {
+		nasid = gdap->g_nasidtable[cnode];
+
+		if (nasid == INVALID_NASID)
+			continue;
+
+		printk("\nDumpping klconfig Nasid %d:\n", nasid);
+	
+		lbptr = KL_CONFIG_INFO(nasid);
+
+		while (lbptr) {
+			printk("    %s, Nasid %d, Module %d, widget 0x%x, partition %d, NIC 0x%x lboard 0x%lx",
+				"board name here", /* BOARD_NAME(lbptr->brd_type), */
+				lbptr->brd_nasid, lbptr->brd_module, 
+				lbptr->brd_widgetnum,
+				lbptr->brd_partition, 
+				(lbptr->brd_nic), lbptr);
+			if (lbptr->brd_flags & DUPLICATE_BOARD)
+				printk(" -D");
+			printk("\n");
+			for (i = 0; i < lbptr->brd_numcompts; i++) {
+				klinfo_t *kli;
+				kli = NODE_OFFSET_TO_KLINFO(NASID_GET(lbptr), lbptr->brd_compts[i]);                       
+				printk("        type %2d, flags 0x%04x, diagval %3d, physid %4d, virtid %2d: %s\n", 
+					kli->struct_type, 
+					kli->flags,
+					kli->diagval,
+					kli->physid,
+					kli->virtid,
+					"comp. name here");
+					/* COMPONENT_NAME(kli->struct_type)); */
+			}
+			lbptr = KLCF_NEXT(lbptr);
+		}
+	}
+	printk("\n");
+
+	/* Useful to print router maps also */
+
+	for (cnode = 0; cnode < MAX_COMPACT_NODES; cnode ++) {
+		klrou_t *kr;
+		int i;
+
+        	nasid = gdap->g_nasidtable[cnode];
+        	if (nasid == INVALID_NASID)
+            		continue;
+        	lbptr = KL_CONFIG_INFO(nasid);
+
+        	while (lbptr) {
+			
+			lbptr = find_lboard_class(lbptr, KLCLASS_ROUTER);
+			if(!lbptr)
+				break;
+			if (!KL_CONFIG_DUPLICATE_BOARD(lbptr)) {
+				printk("%llx -> \n", lbptr->brd_nic);
+				kr = (klrou_t *)find_first_component(lbptr,
+					KLSTRUCT_ROU);
+				for (i = 1; i <= MAX_ROUTER_PORTS; i++) {
+					printk("[%d, %llx]; ",
+						kr->rou_port[i].port_nasid,
+						kr->rou_port[i].port_offset);
+				}
+				printk("\n");
+			}
+			lbptr = KLCF_NEXT(lbptr);
+        	}
+        	printk("\n");
+    	}
+
+	dump_topology();
+}
+#endif
+
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip27/ip27-irq-glue.S linux/arch/mips64/sgi-ip27/ip27-irq-glue.S
--- v2.4.9/linux/arch/mips64/sgi-ip27/ip27-irq-glue.S	Sat May 13 08:30:17 2000
+++ linux/arch/mips64/sgi-ip27/ip27-irq-glue.S	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip27/ip27-irq.c linux/arch/mips64/sgi-ip27/ip27-irq.c
--- v2.4.9/linux/arch/mips64/sgi-ip27/ip27-irq.c	Fri Feb  9 11:29:44 2001
+++ linux/arch/mips64/sgi-ip27/ip27-irq.c	Sun Sep  9 10:43:02 2001
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 1999, 2000 Ralf Baechle (ralf@gnu.org)
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ * Copyright (C) 1999 - 2001 Kanoj Sarcar
  */
 #include <linux/config.h>
 #include <linux/init.h>
@@ -25,6 +26,7 @@
 #include <asm/io.h>
 #include <asm/mipsregs.h>
 #include <asm/system.h>
+#include <asm/irq.h>
 
 #include <asm/ptrace.h>
 #include <asm/processor.h>
@@ -42,6 +44,10 @@
 #define DBG(x...)
 #endif
 
+/* These should die */
+unsigned char bus_to_wid[256];	/* widget id for linux pci bus */
+unsigned char bus_to_nid[256];	/* nasid for linux pci bus */
+unsigned char num_bridges;	/* number of bridges in the system */
 
 /*
  * Linux has a controller-independent x86 interrupt architecture.
@@ -67,11 +73,11 @@
 unsigned long spurious_count = 0;
 
 /*
- * we need to map irq's up to at least bit 7 of the INT_MASK0_A register
- * since bits 0-6 are pre-allocated for other purposes.
+ * There is a single intpend register per node, and we want to have
+ * distinct levels for intercpu intrs for both cpus A and B on a node.
  */
-#define IRQ_TO_SWLEVEL(cpu, i)	i + 7
-#define SWLEVEL_TO_IRQ(cpu, s)	s - 7
+int node_level_to_irq[MAX_COMPACT_NODES][PERNODE_LEVELS];
+
 /*
  * use these macros to get the encoded nasid and widget id
  * from the irq value
@@ -82,6 +88,41 @@
 #define WID_FROM_PCI_IRQ(i)		bus_to_wid[IRQ_TO_BUS(i)]
 #define	SLOT_FROM_PCI_IRQ(i)		irq_to_slot[i]
 
+static inline int alloc_level(cpuid_t cpunum, int irq)
+{
+	cnodeid_t nodenum = CPUID_TO_COMPACT_NODEID(cpunum);
+	int j = LEAST_LEVEL + 3;	/* resched & crosscall entries taken */
+
+	while (++j < PERNODE_LEVELS) {
+		if (node_level_to_irq[nodenum][j] == -1) {
+			node_level_to_irq[nodenum][j] = irq;
+			return j;
+		}
+	}
+	printk("Cpu %ld flooded with devices\n", cpunum);
+	while(1);
+	return -1;
+}
+
+static inline int find_level(cpuid_t *cpunum, int irq)
+{
+	int j;
+	cnodeid_t nodenum = INVALID_CNODEID;
+
+	while (++nodenum < MAX_COMPACT_NODES) {
+		j = LEAST_LEVEL + 3;	/* resched & crosscall entries taken */
+		while (++j < PERNODE_LEVELS)
+			if (node_level_to_irq[nodenum][j] == irq) {
+				*cpunum = 0;	/* XXX Fixme */
+				return(j);
+			}
+	}
+	printk("Could not identify cpu/level for irq %d\n", irq);
+	while(1);
+	return(-1);
+}
+
+
 void disable_irq(unsigned int irq_nr)
 {
 	panic("disable_irq() called ...");
@@ -146,7 +187,8 @@
 	}
 	irq_exit(thiscpu, irq);
 
-	/* unmasking and bottom half handling is done magically for us. */
+	if (softirq_pending(thiscpu))
+		do_softirq();
 }
 
 /*
@@ -196,7 +238,7 @@
 				swlevel = ms1bit(pend0);
 				LOCAL_HUB_CLR_INTR(swlevel);
 				/* "map" swlevel to irq */
-				irq = SWLEVEL_TO_IRQ(thiscpu, swlevel);
+				irq = LEVEL_TO_IRQ(thiscpu, swlevel);
 				do_IRQ(thiscpu, irq, regs);
 				/* clear bit in pend0 */
 				pend0 ^= 1ULL << swlevel;
@@ -227,7 +269,7 @@
 	 * "map" irq to a swlevel greater than 6 since the first 6 bits
 	 * of INT_PEND0 are taken
 	 */
-	swlevel = IRQ_TO_SWLEVEL(cpu, irq);
+	swlevel = alloc_level(cpu, irq);
 	intr_connect_level(cpu, swlevel);
 
 	bridge->b_int_addr[pin].addr = (0x20000 | swlevel | (master << 8));
@@ -254,6 +296,7 @@
 {
 	bridge_t *bridge;
 	int pin, swlevel;
+	cpuid_t cpu;
 
 	bridge = (bridge_t *) NODE_SWIN_BASE(NASID_FROM_PCI_IRQ(irq), 
 	                                     WID_FROM_PCI_IRQ(irq));
@@ -264,8 +307,9 @@
 	 * map irq to a swlevel greater than 6 since the first 6 bits
 	 * of INT_PEND0 are taken
 	 */
-	swlevel = IRQ_TO_SWLEVEL(cpu, irq);
-	intr_disconnect_level(smp_processor_id(), swlevel);
+	swlevel = find_level(&cpu, irq);
+	intr_disconnect_level(cpu, swlevel);
+	LEVEL_TO_IRQ(cpu, swlevel) = -1;
 
 	bridge->b_int_enable &= ~(1 << pin);
 	bridge->b_widget.w_tflush;                      /* Flush */
@@ -423,7 +467,6 @@
 
 	printk(" ]\nStack dumps:");
 	for(i = 0; i < smp_num_cpus; i++) {
-		unsigned long esp;
 		if (i == cpu)
 			continue;
 		printk("\nCPU %d:",i);
@@ -661,37 +704,50 @@
 #ifdef CONFIG_SMP
 #if (CPUS_PER_NODE == 2)
 	static int done = 0;
-	int irq;
 
 	/*
 	 * This is a hack till we have a pernode irqlist. Currently,
 	 * just have the master cpu set up the handlers for the per
 	 * cpu irqs.
 	 */
+	if (done == 0) {
+		int j;
 
-	irq = CPU_RESCHED_A_IRQ + cputoslice(cpu);
-	intr_connect_level(cpu, IRQ_TO_SWLEVEL(cpu, irq));
-	if (done == 0)
-	if (request_irq(irq, handle_resched_intr, 0, "resched", 0))
-		panic("intercpu intr unconnectible\n");
-	irq = CPU_CALL_A_IRQ + cputoslice(cpu);
-	intr_connect_level(cpu, IRQ_TO_SWLEVEL(cpu, irq));
-	if (done == 0)
-	if (request_irq(irq, smp_call_function_interrupt, 0,
-						"callfunc", 0))
-		panic("intercpu intr unconnectible\n");
-	/* HACK STARTS */
-	if (done)
-		return;
-	irq = CPU_RESCHED_A_IRQ + cputoslice(cpu) + 1;
-	if (request_irq(irq, handle_resched_intr, 0, "resched", 0))
-		panic("intercpu intr unconnectible\n");
-	irq = CPU_CALL_A_IRQ + cputoslice(cpu) + 1;
-	if (request_irq(irq, smp_call_function_interrupt, 0,
-						"callfunc", 0))
-		panic("intercpu intr unconnectible\n");
-	done = 1;
-	/* HACK ENDS */
+		if (request_irq(CPU_RESCHED_A_IRQ, handle_resched_intr, 
+							0, "resched", 0))
+			panic("intercpu intr unconnectible\n");
+		if (request_irq(CPU_RESCHED_B_IRQ, handle_resched_intr, 
+							0, "resched", 0))
+			panic("intercpu intr unconnectible\n");
+		if (request_irq(CPU_CALL_A_IRQ, smp_call_function_interrupt,
+							0, "callfunc", 0))
+			panic("intercpu intr unconnectible\n");
+		if (request_irq(CPU_CALL_B_IRQ, smp_call_function_interrupt,
+							0, "callfunc", 0))
+			panic("intercpu intr unconnectible\n");
+
+		for (j = 0; j < PERNODE_LEVELS; j++)
+			LEVEL_TO_IRQ(0, j) = -1;
+		LEVEL_TO_IRQ(0, FAST_IRQ_TO_LEVEL(CPU_RESCHED_A_IRQ)) = 
+							CPU_RESCHED_A_IRQ;
+		LEVEL_TO_IRQ(0, FAST_IRQ_TO_LEVEL(CPU_RESCHED_B_IRQ)) = 
+							CPU_RESCHED_B_IRQ;
+		LEVEL_TO_IRQ(0, FAST_IRQ_TO_LEVEL(CPU_CALL_A_IRQ)) = 
+							CPU_CALL_A_IRQ;
+		LEVEL_TO_IRQ(0, FAST_IRQ_TO_LEVEL(CPU_CALL_B_IRQ)) = 
+							CPU_CALL_B_IRQ;
+		for (j = 1; j < MAX_COMPACT_NODES; j++)
+			memcpy(&node_level_to_irq[j][0], 
+			&node_level_to_irq[0][0], 
+			sizeof(node_level_to_irq[0][0])*PERNODE_LEVELS);
+
+		done = 1;
+	}
+
+	intr_connect_level(cpu, FAST_IRQ_TO_LEVEL(CPU_RESCHED_A_IRQ + 
+							cputoslice(cpu)));
+	intr_connect_level(cpu, FAST_IRQ_TO_LEVEL(CPU_CALL_A_IRQ +
+							cputoslice(cpu)));
 #else /* CPUS_PER_NODE */
 #error Must redefine this for more than 2 CPUS.
 #endif /* CPUS_PER_NODE */
@@ -700,7 +756,9 @@
 
 void install_tlbintr(int cpu)
 {
+#if 0
 	int intr_bit = N_INTPEND_BITS + TLB_INTR_A + cputoslice(cpu);
 
 	intr_connect_level(cpu, intr_bit);
+#endif
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip27/ip27-klconfig.c linux/arch/mips64/sgi-ip27/ip27-klconfig.c
--- v2.4.9/linux/arch/mips64/sgi-ip27/ip27-klconfig.c	Sun Jul  9 22:18:16 2000
+++ linux/arch/mips64/sgi-ip27/ip27-klconfig.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * Copyright (C) 1999, 2000 Ralf Baechle (ralf@gnu.org)
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  */
@@ -57,6 +56,19 @@
 			return start;
 		start = KLCF_NEXT(start);
 	}
+	/* Didn't find it. */
+	return (lboard_t *)NULL;
+}
+
+lboard_t * find_lboard_class(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);
+	}
+
 	/* Didn't find it. */
 	return (lboard_t *)NULL;
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip27/ip27-klnuma.c linux/arch/mips64/sgi-ip27/ip27-klnuma.c
--- v2.4.9/linux/arch/mips64/sgi-ip27/ip27-klnuma.c	Tue Nov 28 21:42:04 2000
+++ linux/arch/mips64/sgi-ip27/ip27-klnuma.c	Sun Sep  9 10:43:02 2001
@@ -1,6 +1,7 @@
 /*
  * Ported from IRIX to Linux by Kanoj Sarcar, 06/08/00.
- * Copyright 2000 Silicon Graphics, Inc.
+ * Copyright 2000 - 2001 Silicon Graphics, Inc.
+ * Copyright 2000 - 2001 Kanoj Sarcar (kanoj@sgi.com)
  */
 #include <linux/config.h>
 #include <linux/init.h>
@@ -9,6 +10,7 @@
 #include <linux/string.h>
 
 #include <asm/page.h>
+#include <asm/smp.h>
 #include <asm/sn/types.h>
 #include <asm/sn/arch.h>
 #include <asm/sn/gda.h>
@@ -16,10 +18,6 @@
 #include <asm/sn/klkernvars.h>
 #include <asm/sn/mapped_kernel.h>
 #include <asm/sn/sn_private.h>
-
-#define CPUMASK_CLRALL(p)	(p) = 0
-#define CPUMASK_SETB(p, bit)	(p) |= 1 << (bit)
-#define CPUMASK_TSTB(p, bit)	((p) & (1ULL << (bit)))
 
 extern char _end;
 static cpumask_t ktext_repmask;
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip27/ip27-memory.c linux/arch/mips64/sgi-ip27/ip27-memory.c
--- v2.4.9/linux/arch/mips64/sgi-ip27/ip27-memory.c	Tue Nov 28 21:42:04 2000
+++ linux/arch/mips64/sgi-ip27/ip27-memory.c	Sun Sep  9 10:43:02 2001
@@ -20,6 +20,7 @@
 #include <asm/bootinfo.h>
 #include <asm/addrspace.h>
 #include <asm/pgtable.h>
+#include <asm/pgalloc.h>
 #include <asm/sn/types.h>
 #include <asm/sn/addrs.h>
 #include <asm/sn/klconfig.h>
@@ -227,15 +228,24 @@
 
 void __init paging_init(void)
 {
+	pmd_t *pmd = kpmdtbl;
+	pte_t *pte = kptbl;
+
 	cnodeid_t node;
 	unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
+	int i;
 
 	/* Initialize the entire pgd.  */
 	pgd_init((unsigned long)swapper_pg_dir);
 	pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table);
 	memset((void *)invalid_pte_table, 0, sizeof(pte_t) * PTRS_PER_PTE);
-	pmd_init((unsigned long)empty_bad_pmd_table, (unsigned long)empty_bad_page_table);
-	memset((void *)empty_bad_page_table, 0, sizeof(pte_t) * PTRS_PER_PTE);
+
+	/* This is for vmalloc  */
+	memset((void *)kptbl, 0, PAGE_SIZE << KPTBL_PAGE_ORDER);
+	memset((void *)kpmdtbl, 0, PAGE_SIZE);
+	pgd_set(swapper_pg_dir, kpmdtbl);
+	for (i = 0; i < (1 << KPTBL_PAGE_ORDER); pmd++,i++,pte+=PTRS_PER_PTE)
+		pmd_val(*pmd) = (unsigned long)pte;
 
 	for (node = 0; node < numnodes; node++) {
 		pfn_t start_pfn = slot_getbasepfn(node, 0);
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip27/ip27-pci-dma.c linux/arch/mips64/sgi-ip27/ip27-pci-dma.c
--- v2.4.9/linux/arch/mips64/sgi-ip27/ip27-pci-dma.c	Tue Nov 28 21:42:04 2000
+++ linux/arch/mips64/sgi-ip27/ip27-pci-dma.c	Sun Sep  9 10:43:02 2001
@@ -1,5 +1,4 @@
-/* $Id: ip27-pci-dma.c,v 1.1 2000/02/16 21:22:00 ralf Exp $
- *
+/*
  * Dynamic DMA mapping support.
  *
  * On the Origin there is dynamic DMA address translation for all PCI DMA.
@@ -52,4 +51,114 @@
 			 void *vaddr, dma_addr_t dma_handle)
 {
 	free_pages((unsigned long)vaddr, __get_order(size));
+}
+
+/*
+ * Map a single buffer of the indicated size for DMA in streaming mode.
+ * The 32-bit bus address to use is returned.
+ *
+ * Once the device is given the dma address, the device owns this memory
+ * until either pci_unmap_single or pci_dma_sync_single is performed.
+ */
+dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size,
+                          int direction)
+{
+	if (direction == PCI_DMA_NONE)
+		BUG();
+
+	return (bus_to_baddr[hwdev->bus->number] | __pa(ptr));
+}
+
+/*
+ * Unmap a single streaming mode DMA translation.  The dma_addr and size
+ * must match what was provided for in a previous pci_map_single call.  All
+ * other usages are undefined.
+ *
+ * After this call, reads by the cpu to the buffer are guarenteed to see
+ * whatever the device wrote there.
+ */
+void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
+                     size_t size, int direction)
+{
+	if (direction == PCI_DMA_NONE)
+		BUG();
+
+	/* Nothing to do */
+}
+
+/*
+ * Map a set of buffers described by scatterlist in streaming
+ * mode for DMA.  This is the scather-gather version of the
+ * above pci_map_single interface.  Here the scatter gather list
+ * elements are each tagged with the appropriate dma address
+ * and length.  They are obtained via sg_dma_{address,length}(SG).
+ *
+ * NOTE: An implementation may be able to use a smaller number of
+ *       DMA address/length pairs than there are SG table elements.
+ *       (for example via virtual mapping capabilities)
+ *       The routine returns the number of addr/length pairs actually
+ *       used, at most nents.
+ *
+ * Device ownership issues as mentioned above for pci_map_single are
+ * the same here.
+ */
+int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents,
+               int direction)
+{
+	int i;
+
+	if (direction == PCI_DMA_NONE)
+		BUG();
+
+	/* Make sure that gcc doesn't leave the empty loop body.  */
+	for (i = 0; i < nents; i++, sg++) {
+		sg->address = (char *)(bus_to_baddr[hwdev->bus->number] | __pa(sg->address));
+	}
+
+	return nents;
+}
+
+/*
+ * Unmap a set of streaming mode DMA translations.
+ * Again, cpu read rules concerning calls here are the same as for
+ * pci_unmap_single() above.
+ */
+void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents,
+                  int direction)
+{
+	if (direction == PCI_DMA_NONE)
+		BUG();
+
+	/* Nothing to do */
+}
+
+/*
+ * Make physical memory consistent for a single
+ * streaming mode DMA translation after a transfer.
+ *
+ * If you perform a pci_map_single() but wish to interrogate the
+ * buffer using the cpu, yet do not wish to teardown the PCI dma
+ * mapping, you must call this function before doing so.  At the
+ * next point you give the PCI dma address back to the card, the
+ * device again owns the buffer.
+ */
+void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle,
+                         size_t size, int direction)
+{
+	if (direction == PCI_DMA_NONE)
+		BUG();
+}
+
+/*
+ * Make physical memory consistent for a set of streaming
+ * mode DMA translations after a transfer.
+ *
+ * The same as pci_dma_sync_single but for a scatter-gather list,
+ * same rules and usage.
+ */
+void pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg,
+                     int nelems, int direction)
+{
+	if (direction == PCI_DMA_NONE)
+		BUG();
 }
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip27/ip27-pci.c linux/arch/mips64/sgi-ip27/ip27-pci.c
--- v2.4.9/linux/arch/mips64/sgi-ip27/ip27-pci.c	Tue Nov 28 21:42:04 2000
+++ linux/arch/mips64/sgi-ip27/ip27-pci.c	Sun Sep  9 10:43:02 2001
@@ -18,7 +18,7 @@
 /*
  * Max #PCI busses we can handle; ie, max #PCI bridges.
  */
-#define MAX_PCI_BUSSES		20
+#define MAX_PCI_BUSSES		40
 
 /*
  * Max #PCI devices (like scsi controllers) we handle on a bus.
@@ -55,8 +55,12 @@
 	bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id],        \
                                              bus_to_wid[bus_id]);       \
                                                                         \
-	/*if (dev->bus->number)			 */			\
-	/*	return PCIBIOS_DEVICE_NOT_FOUND; */			\
+	if (dev->vendor == PCI_VENDOR_ID_SGI				\
+	    && dev->device == PCI_DEVICE_ID_SGI_IOC3			\
+	    && ((where >= 0x14 && where < 0x40) || (where >= 0x48))) {	\
+		*value = 0;						\
+		return PCIBIOS_SUCCESSFUL;				\
+	}								\
 									\
 	__bit = (((where) & (bm)) << 3);				\
 	addr = &bridge->b_type0_cfg_dev[slot].f[fn].l[where >> 2];	\
@@ -96,11 +100,9 @@
 	bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id],        \
                                              bus_to_wid[bus_id]);       \
                                                                         \
-	/* if (dev->bus->number)		 */			\
-	/* 	return PCIBIOS_DEVICE_NOT_FOUND; */			\
-									\
 	if (dev->vendor == PCI_VENDOR_ID_SGI				\
-	    && dev->device == PCI_DEVICE_ID_SGI_IOC3)			\
+	    && dev->device == PCI_DEVICE_ID_SGI_IOC3			\
+	    && ((where >= 0x14 && where < 0x40) || (where >= 0x48)))	\
 		return PCIBIOS_SUCCESSFUL;				\
 									\
 	__bit = (((where) & (bm)) << 3);				\
@@ -147,6 +149,7 @@
 	int	i;
 
 	ioport_resource.end = ~0UL;
+	iomem_resource.end = ~0UL;
 
 	for (i=0; i<num_bridges; i++) {
 		printk("PCI: Probing PCI hardware on host bus %2d.\n", i);
@@ -178,7 +181,7 @@
  * All observed requests have pin == 1. We could have a global here, that
  * gets incremented and returned every time - unfortunately, pci_map_irq
  * may be called on the same device over and over, and need to return the
- * same value. On o2000, pin can be 0 or 1, and PCI slots can be [0..7]. 
+ * same value. On O2000, pin can be 0 or 1, and PCI slots can be [0..7]. 
  *
  * A given PCI device, in general, should be able to intr any of the cpus
  * on any one of the hubs connected to its xbow.
@@ -186,25 +189,23 @@
 static int __init
 pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 {
-	if ((dev->bus->number >= MAX_PCI_BUSSES) || (pin != 1) || \
-					(slot >= MAX_DEVICES_PER_PCIBUS)) {
-		printk("Increase supported PCI busses %d,%d,%d\n", \
-						dev->bus->number, slot, pin);
-		while(1);
-	}
+	if ((dev->bus->number >= MAX_PCI_BUSSES)
+	    || (pin != 1)
+	    || (slot >= MAX_DEVICES_PER_PCIBUS))
+		panic("Increase supported PCI busses %d,%d,%d\n",
+		      dev->bus->number, slot, pin);
 
 	/*
 	 * Already assigned? Then return previously assigned value ...
 	 */
 	if (irqstore[dev->bus->number][slot])
-		return(irqstore[dev->bus->number][slot]);
-	else {
-		irq_to_bus[lastirq] = dev->bus->number;
-		irq_to_slot[lastirq] = slot;
-		irqstore[dev->bus->number][slot] = lastirq;
-		lastirq++;
-		return (lastirq - 1);
-	}
+		return irqstore[dev->bus->number][slot];
+
+	irq_to_bus[lastirq] = dev->bus->number;
+	irq_to_slot[lastirq] = slot;
+	irqstore[dev->bus->number][slot] = lastirq;
+	lastirq++;
+	return lastirq - 1;
 }
 
 void __init
@@ -237,10 +238,10 @@
 pcibios_fixup_pbus_ranges(struct pci_bus * bus,
                           struct pbus_set_ranges_data * ranges)
 {
-	ranges->io_start -= bus->resource[0]->start;
-	ranges->io_end -= bus->resource[0]->start;
+	ranges->io_start  -= bus->resource[0]->start;
+	ranges->io_end    -= bus->resource[0]->start;
 	ranges->mem_start -= bus->resource[1]->start;
-	ranges->mem_end -= bus->resource[1]->start;
+	ranges->mem_end   -= bus->resource[1]->start;
 }
 
 int __init
@@ -255,6 +256,11 @@
 {
 }
 
+unsigned __init int pcibios_assign_all_busses(void)
+{
+	return 0;
+}
+
 char * __init
 pcibios_setup(char *str)
 {
@@ -263,19 +269,23 @@
 	return str;
 }
 
+/*
+ * Device might live on a subordinate PCI bus.  XXX Walk up the chain of buses
+ * to find the slot number in sense of the bridge device register.
+ * XXX This also means multiple devices might rely on conflicting bridge
+ * settings.
+ */
+
 static void __init
 pci_disable_swapping(struct pci_dev *dev)
 {
 	unsigned int bus_id = (unsigned) dev->bus->number;
 	bridge_t *bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id],
-				     bus_to_wid[bus_id]);
+	                                               bus_to_wid[bus_id]);
 	int		slot = PCI_SLOT(dev->devfn);
-	bridgereg_t 	devreg;
-
-	devreg = bridge->b_device[slot].reg;
-	devreg &= ~BRIDGE_DEV_SWAP_DIR;		/* turn off byte swapping */
-	bridge->b_device[slot].reg = devreg;
 
+	/* Turn off byte swapping */
+	bridge->b_device[slot].reg &= ~BRIDGE_DEV_SWAP_DIR;
 	bridge->b_widget.w_tflush;		/* Flush */
 }
 
@@ -284,56 +294,25 @@
 {
 	unsigned int bus_id = (unsigned) dev->bus->number;
 	bridge_t *bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id],
-				     bus_to_wid[bus_id]);
+	                                               bus_to_wid[bus_id]);
 	int		slot = PCI_SLOT(dev->devfn);
-	bridgereg_t 	devreg;
-
-	devreg = bridge->b_device[slot].reg;
-	devreg |= BRIDGE_DEV_SWAP_DIR;		/* turn on byte swapping */
-	bridge->b_device[slot].reg = devreg;
 
+	/* Turn on byte swapping */
+	bridge->b_device[slot].reg |= BRIDGE_DEV_SWAP_DIR;
 	bridge->b_widget.w_tflush;		/* Flush */
 }
 
 static void __init
 pci_fixup_ioc3(struct pci_dev *d)
 {
-	unsigned int bus_id = (unsigned) d->bus->number;
-	int i;
+	unsigned long bus_id = (unsigned) d->bus->number;
 
-	/* IOC3 only decodes 0x20 bytes of the config space, so we end up
-	   with tons of bogus information in the pci_dev.  On Origins the
-	   INTA, INTB and INTC pins are all wired together as if it'd only
-	   use INTA.  */
 	printk("PCI: Fixing base addresses for IOC3 device %s\n", d->slot_name);
 
 	d->resource[0].start |= NODE_OFFSET(bus_to_nid[bus_id]);
-	d->resource[0].end |= NODE_OFFSET(bus_to_nid[bus_id]);
-
-	for (i = 1; i <= PCI_ROM_RESOURCE; i++) {
-		d->resource[i].start = 0UL;
-		d->resource[i].end = 0UL;
-		d->resource[i].flags = 0UL;
-	}
+	d->resource[0].end   |= NODE_OFFSET(bus_to_nid[bus_id]);
 
 	pci_disable_swapping(d);
-
-	/*
-	 * The serial driver will try to probe for serial ports
-	 * later on. MENET boards dbe out unrecoverably on sio space
-	 * access to the 4th ioc3. (The first 3 iocs work okay, they
-	 * have kbd/ms ports; all have ethernet ports). Catch this
-	 * case now and disable the serial driver from looking at 
-	 * these ioc3s. Identify MENET cards by seeing if an ioc3 is
-	 * at slot 3.
-	 */
-	d->subsystem_vendor = 0xFF00;
-	if (PCI_SLOT(d->devfn) == 3) {
-		struct list_head *p;
-		list_for_each(p, &d->bus->devices) {
-			list_entry(p, struct pci_dev, bus_list)->subsystem_vendor = 0;
-		}
-	}
 }
 
 static void __init
@@ -344,7 +323,8 @@
 	d->resource[0].start |= ((unsigned long)(bus_to_nid[d->bus->number])<<32);
 	printk("PCI: Fixing isp1020 in [bus:slot.fn] %s\n", d->slot_name);
 
-	/* Configure device to allow bus mastering, i/o and memory mapping. 
+	/*
+	 * Configure device to allow bus mastering, i/o and memory mapping. 
 	 * Older qlogicisp driver expects to have the IO space enable 
 	 * bit set. Things stop working if we program the controllers as not 
 	 * having PCI_COMMAND_MEMORY, so we have to fudge the mem_flags.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip27/ip27-setup.c linux/arch/mips64/sgi-ip27/ip27-setup.c
--- v2.4.9/linux/arch/mips64/sgi-ip27/ip27-setup.c	Tue Nov 28 21:42:04 2000
+++ linux/arch/mips64/sgi-ip27/ip27-setup.c	Sun Sep  9 10:43:02 2001
@@ -14,6 +14,7 @@
 #include <linux/spinlock.h>
 #include <linux/sched.h>
 #include <linux/smp.h>
+#include <asm/io.h>
 #include <asm/sn/types.h>
 #include <asm/sn/sn0/addrs.h>
 #include <asm/sn/sn0/hubni.h>
@@ -39,6 +40,7 @@
 #define DBG(x...)
 #endif
 
+unsigned long mips_io_port_base = IO_BASE;
 
 /*
  * get_nasid() returns the physical node id number of the caller.
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip27/ip27-timer.c linux/arch/mips64/sgi-ip27/ip27-timer.c
--- v2.4.9/linux/arch/mips64/sgi-ip27/ip27-timer.c	Tue Nov 28 21:42:04 2000
+++ linux/arch/mips64/sgi-ip27/ip27-timer.c	Sun Sep  9 10:43:02 2001
@@ -145,6 +145,9 @@
         }
 
 	write_unlock(&xtime_lock);
+
+	if (softirq_pending(cpu))
+		do_softirq();
 }
 
 unsigned long inline do_gettimeoffset(void)
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip32/Makefile linux/arch/mips64/sgi-ip32/Makefile
--- v2.4.9/linux/arch/mips64/sgi-ip32/Makefile	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/sgi-ip32/Makefile	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,27 @@
+#
+# Makefile for the SGI specific kernel interface routines
+# under Linux.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+# Note 2! The CFLAGS definitions are now in the main makefile...
+
+.S.s:
+	$(CPP) $(CFLAGS) $< -o $*.s
+.S.o:
+	$(CC) $(CFLAGS) -c $< -o $*.o
+
+O_TARGET := ip32-kern.a
+
+all: ip32-kern.a ip32-irq-glue.o
+
+obj-y	+= ip32-irq.o ip32-rtc.o ip32-setup.o ip32-irq-glue.o \
+	 ip32-berr.o ip32-timer.o crime.o
+
+ifdef CONFIG_PCI
+obj-y   += ip32-pci.o ip32-pci-dma.o
+endif
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip32/crime.c linux/arch/mips64/sgi-ip32/crime.c
--- v2.4.9/linux/arch/mips64/sgi-ip32/crime.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/sgi-ip32/crime.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,50 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2001 Keith M Wesolowski
+ */
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <asm/ip32/crime.h>
+#include <asm/ptrace.h>
+#include <asm/promlib.h>
+
+void __init crime_init (void)
+{
+	u64 id = crime_read_64 (CRIME_ID);
+	u64 rev = id & CRIME_ID_REV;
+
+	id = (id & CRIME_ID_IDBITS) >> 4;
+
+	printk ("CRIME id %1lx rev %ld detected at %016lx\n", id, rev,
+		(unsigned long) CRIME_BASE);
+}
+
+/* XXX Like on Sun, these give us various useful information to printk. */
+void crime_memerr_intr (unsigned int irq, void *dev_id, struct pt_regs *regs)
+{
+	u64 memerr = crime_read_64 (CRIME_MEM_ERROR_STAT);
+	u64 addr = crime_read_64 (CRIME_MEM_ERROR_ADDR);
+	memerr &= CRIME_MEM_ERROR_STAT_MASK;
+	
+	printk ("CRIME memory error at physaddr 0x%08lx status %08lx\n",
+		addr << 2, memerr);
+
+	crime_write_64 (CRIME_MEM_ERROR_STAT, 0);
+}
+
+void crime_cpuerr_intr (unsigned int irq, void *dev_id, struct pt_regs *regs)
+{
+	u64 cpuerr = crime_read_64 (CRIME_CPU_ERROR_STAT);
+	u64 addr = crime_read_64 (CRIME_CPU_ERROR_ADDR);
+	cpuerr &= CRIME_CPU_ERROR_MASK;
+	addr <<= 2UL;
+
+	printk ("CRIME CPU interface error detected at %09lx status %08lx\n",
+		addr, cpuerr);
+
+	crime_write_64 (CRIME_CPU_ERROR_STAT, 0);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip32/ip32-berr.c linux/arch/mips64/sgi-ip32/ip32-berr.c
--- v2.4.9/linux/arch/mips64/sgi-ip32/ip32-berr.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/sgi-ip32/ip32-berr.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,97 @@
+/*
+ * 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) 1994, 1995, 1996, 1999, 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 by Silicon Graphics
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <asm/uaccess.h>
+#include <asm/paccess.h>
+#include <asm/addrspace.h>
+#include <asm/ptrace.h>
+
+/* XXX I have no idea what this does --kmw */
+
+extern asmlinkage void handle_ibe(void);
+extern asmlinkage void handle_dbe(void);
+
+extern const struct exception_table_entry __start___dbe_table[];
+extern const struct exception_table_entry __stop___dbe_table[];
+
+static inline unsigned long
+search_one_table(const struct exception_table_entry *first,
+                 const struct exception_table_entry *last,
+                 unsigned long value)
+{
+	while (first <= last) {
+		const struct exception_table_entry *mid;
+		long diff;
+
+		mid = (last - first) / 2 + first;
+		diff = mid->insn - value;
+		if (diff == 0)
+			return mid->nextinsn;
+		else if (diff < 0)
+			first = mid+1;
+		else
+			last = mid-1;
+	}
+	return 0;
+}
+
+static inline unsigned long
+search_dbe_table(unsigned long addr)
+{
+	unsigned long ret;
+
+	/* There is only the kernel to search.  */
+	ret = search_one_table(__start___dbe_table, __stop___dbe_table-1, addr);
+	if (ret) return ret;
+
+	return 0;
+}
+
+void do_ibe(struct pt_regs *regs)
+{
+	printk("Got ibe at 0x%lx\n", regs->cp0_epc);
+	show_regs(regs);
+	dump_tlb_addr(regs->cp0_epc);
+	force_sig(SIGBUS, current);
+	while(1);
+}
+
+void do_dbe(struct pt_regs *regs)
+{
+	unsigned long fixup;
+
+	fixup = search_dbe_table(regs->cp0_epc);
+	if (fixup) {
+		long new_epc;
+
+		new_epc = fixup_exception(dpf_reg, fixup, regs->cp0_epc);
+		regs->cp0_epc = new_epc;
+		return;
+	}
+
+	printk("Got dbe at 0x%lx\n", regs->cp0_epc);
+	show_regs(regs);
+	dump_tlb_all();
+	while(1);
+	force_sig(SIGBUS, current);
+}
+
+void __init
+bus_error_init(void)
+{
+	int dummy;
+
+	set_except_vector(6, handle_ibe);
+	set_except_vector(7, handle_dbe);
+
+	/* At this time nothing uses the DBE protection mechanism on the
+	   O2, so this here is needed to make the kernel link.  */
+	get_dbe(dummy, (int *)KSEG0);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip32/ip32-irq-glue.S linux/arch/mips64/sgi-ip32/ip32-irq-glue.S
--- v2.4.9/linux/arch/mips64/sgi-ip32/ip32-irq-glue.S	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/sgi-ip32/ip32-irq-glue.S	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,87 @@
+/*
+ * Low level interrupt handler for the SGI O2 aka IP32 aka Moosehead
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2000 Harald Koerfgen
+ * Copyright (C) 2001 Keith M Wesolowski
+ */
+#include <asm/asm.h>
+#include <asm/regdef.h>
+#include <asm/mipsregs.h>
+#include <asm/stackframe.h>
+#include <asm/addrspace.h>
+#include <asm/ip32/ip32_ints.h>
+
+		.text
+		.set    noreorder
+		.set    noat
+		.align  5
+		NESTED(ip32_handle_int, PT_SIZE, ra)
+		.set    noat
+		SAVE_ALL
+		CLI			# TEST: interrupts should be off
+		.set    at
+		.set    noreorder
+
+		mfc0	s0,CP0_CAUSE
+
+		andi	t1, s0, IE_IRQ0
+		bnez	t1, handle_irq0
+		 andi	t1, s0, IE_IRQ1
+		bnez	t1, handle_irq1
+		 andi	t1, s0, IE_IRQ2
+		bnez	t1, handle_irq2
+		 andi	t1, s0, IE_IRQ3
+		bnez	t1, handle_irq3
+		 andi	t1, s0, IE_IRQ4
+		bnez	t1, handle_irq4
+		 andi	t1, s0, IE_IRQ5
+		bnez	t1, handle_irq5
+		 nop
+
+		/* Either someone has triggered the "software interrupts"
+		 * or we lost an interrupt somehow.  Ignore it.
+		 */
+		j	ret_from_irq
+		 nop
+
+handle_irq0:
+		jal	ip32_irq0
+		 move	a0, sp
+		j	ret_from_irq
+		 nop
+
+handle_irq1:
+		jal	ip32_irq1
+		 move	a0, sp
+		j	ret_from_irq
+		 nop
+
+handle_irq2:
+		jal	ip32_irq2
+		 move	a0, sp
+		j	ret_from_irq
+		 nop
+
+handle_irq3:
+		jal	ip32_irq3
+		 move	a0, sp
+		j	ret_from_irq
+		 nop
+
+handle_irq4:
+		jal	ip32_irq4
+		 move	a0, sp
+		j	ret_from_irq
+		 nop
+
+handle_irq5:
+		jal	ip32_irq5
+		move	a0, sp
+		j	ret_from_irq
+		 nop
+
+		END(ip32_handle_int)
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip32/ip32-irq.c linux/arch/mips64/sgi-ip32/ip32-irq.c
--- v2.4.9/linux/arch/mips64/sgi-ip32/ip32-irq.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/sgi-ip32/ip32-irq.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,556 @@
+/*
+ * Code to handle IP32 IRQs
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2000 Harald Koerfgen
+ * Copyright (C) 2001 Keith M Wesolowski
+ */
+#include <linux/init.h>
+#include <linux/kernel_stat.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/bitops.h>
+
+#include <asm/bitops.h>
+#include <asm/mipsregs.h>
+#include <asm/system.h>
+#include <asm/ip32/ip32_ints.h>
+#include <asm/ip32/crime.h>
+#include <asm/ip32/mace.h>
+#include <asm/signal.h>
+
+#undef DEBUG_IRQ
+#ifdef DEBUG_IRQ
+#define DBG(x...) printk(x)
+#else
+#define DBG(x...)
+#endif
+
+/* O2 irq map
+ *
+ * IP0 -> software (ignored)
+ * IP1 -> software (ignored)
+ * IP2 -> (irq0) C crime 1.1 all interrupts; crime 1.5 ???
+ * IP3 -> (irq1) X unknown
+ * IP4 -> (irq2) X unknown
+ * IP5 -> (irq3) X unknown
+ * IP6 -> (irq4) X unknown
+ * IP7 -> (irq5) 0 CPU count/compare timer (system timer)
+ *
+ * crime: (C)
+ *
+ * CRIME_INT_STAT 31:0:
+ *
+ * 0 -> 1 Video in 1
+ * 1 -> 2 Video in 2
+ * 2 -> 3 Video out
+ * 3 -> 4 Mace ethernet
+ * 4 -> S  SuperIO sub-interrupt
+ * 5 -> M  Miscellaneous sub-interrupt
+ * 6 -> A  Audio sub-interrupt
+ * 7 -> 8  PCI bridge errors
+ * 8 -> 9  PCI SCSI aic7xxx 0
+ * 9 -> 10  PCI SCSI aic7xxx 1
+ * 10 -> 11 PCI slot 0
+ * 11 -> 12 unused (PCI slot 1)
+ * 12 -> 13 unused (PCI slot 2)
+ * 13 -> 14 unused (PCI shared 0)
+ * 14 -> 15 unused (PCI shared 1)
+ * 15 -> 16 unused (PCI shared 2)
+ * 16 -> 17 GBE0 (E)
+ * 17 -> 18 GBE1 (E)
+ * 18 -> 19 GBE2 (E)
+ * 19 -> 20 GBE3 (E)
+ * 20 -> 21 CPU errors
+ * 21 -> 22 Memory errors
+ * 22 -> 23 RE empty edge (E)
+ * 23 -> 24 RE full edge (E)
+ * 24 -> 25 RE idle edge (E)
+ * 25 -> 26 RE empty level
+ * 26 -> 27 RE full level
+ * 27 -> 28 RE idle level
+ * 28 -> 29  unused (software 0) (E)
+ * 29 -> 30  unused (software 1) (E)
+ * 30 -> 31  unused (software 2) - crime 1.5 CPU SysCorError (E)
+ * 31 -> 32 VICE
+ *
+ * S, M, A: Use the MACE ISA interrupt register
+ * MACE_ISA_INT_STAT 31:0
+ *
+ * 0-7 -> 33-40 Audio
+ * 8 -> 41 RTC
+ * 9 -> 42 Keyboard
+ * 10 -> X Keyboard polled
+ * 11 -> 44 Mouse
+ * 12 -> X Mouse polled
+ * 13-15 -> 46-48 Count/compare timers
+ * 16-19 -> 49-52 Parallel (16 E)
+ * 20-25 -> 53-58 Serial 1 (22 E)
+ * 26-31 -> 59-64 Serial 2 (28 E)
+ *
+ * Note that this means IRQs 5-7, 43, and 45 do not exist.  This is a
+ * different IRQ map than IRIX uses, but that's OK as Linux irq handling
+ * is quite different anyway.
+ */
+
+/* Some initial interrupts to set up */
+extern void crime_memerr_intr (unsigned int irq, void *dev_id,
+			       struct pt_regs *regs);
+extern void crime_cpuerr_intr (unsigned int irq, void *dev_id,
+			       struct pt_regs *regs);
+
+struct irqaction memerr_irq = { crime_memerr_intr, SA_INTERRUPT,
+			       0, "CRIME memory error", NULL,
+			       NULL };
+struct irqaction cpuerr_irq = { crime_cpuerr_intr, SA_INTERRUPT,
+			       0, "CRIME CPU error", NULL,
+			       NULL };
+
+unsigned long spurious_count = 0;
+extern void ip32_handle_int (void);
+extern void do_IRQ (unsigned int irq, struct pt_regs *regs);
+
+/* For interrupts wired from a single device to the CPU.  Only the clock
+ * uses this it seems, which is IRQ 0 and IP7.
+ */
+
+static void enable_cpu_irq (unsigned int irq)
+{
+	set_cp0_status (STATUSF_IP7);
+}
+
+static unsigned int startup_cpu_irq (unsigned int irq) {
+	enable_cpu_irq (irq);
+	return 0;
+}
+
+static void disable_cpu_irq (unsigned int irq)
+{
+	clear_cp0_status (STATUSF_IP7);
+}
+
+static void end_cpu_irq (unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		enable_cpu_irq (irq);
+}
+
+#define shutdown_cpu_irq disable_cpu_irq
+#define mask_and_ack_cpu_irq disable_cpu_irq
+
+static struct hw_interrupt_type ip32_cpu_interrupt = {
+	"IP32 CPU",
+	startup_cpu_irq,
+	shutdown_cpu_irq,
+	enable_cpu_irq,
+	disable_cpu_irq,
+	mask_and_ack_cpu_irq,
+	end_cpu_irq,
+	NULL
+};
+
+/*
+ * This is for pure CRIME interrupts - ie not MACE.  The advantage?
+ * We get to split the register in half and do faster lookups.
+ */
+
+static void enable_crime_irq (unsigned int irq)
+{
+	u64 crime_mask;
+	unsigned long flags;
+
+	save_and_cli (flags);
+	crime_mask = crime_read_64 (CRIME_INT_MASK);
+	crime_mask |= 1 << (irq - 1);
+	crime_write_64 (CRIME_INT_MASK, crime_mask);
+	restore_flags (flags);
+}
+
+static unsigned int startup_crime_irq (unsigned int irq)
+{
+	enable_crime_irq (irq);
+	return 0; /* This is probably not right; we could have pending irqs */
+}
+
+static void disable_crime_irq (unsigned int irq)
+{
+	u64 crime_mask;
+	unsigned long flags;
+
+	save_and_cli (flags);
+	crime_mask = crime_read_64 (CRIME_INT_MASK);
+	crime_mask &= ~(1 << (irq - 1));
+	crime_write_64 (CRIME_INT_MASK, crime_mask);
+	restore_flags (flags);
+}
+
+static void mask_and_ack_crime_irq (unsigned int irq)
+{
+	u64 crime_mask;
+	unsigned long flags;
+
+	/* Edge triggered interrupts must be cleared. */
+	if ((irq <= CRIME_GBE0_IRQ && irq >= CRIME_GBE3_IRQ)
+	    || (irq <= CRIME_RE_EMPTY_E_IRQ && irq >= CRIME_RE_IDLE_E_IRQ)
+	    || (irq <= CRIME_SOFT0_IRQ && irq >= CRIME_SOFT2_IRQ)) {
+		save_and_cli (flags);
+		crime_mask = crime_read_64 (CRIME_HARD_INT);
+		crime_mask &= ~(1 << (irq - 1));
+		crime_write_64 (CRIME_HARD_INT, crime_mask);
+		restore_flags (flags);
+	}
+	disable_crime_irq (irq);
+}
+	
+static void end_crime_irq (unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		enable_crime_irq (irq);
+}
+
+#define shutdown_crime_irq disable_crime_irq
+
+static struct hw_interrupt_type ip32_crime_interrupt = {
+	"IP32 CRIME",
+	startup_crime_irq,
+	shutdown_crime_irq,
+	enable_crime_irq,
+	disable_crime_irq,
+	mask_and_ack_crime_irq,
+	end_crime_irq,
+	NULL
+};
+
+/* This is for MACE PCI interrupts.  We can decrease bus traffic by masking
+ * as close to the source as possible.  This also means we can take the
+ * next chunk of the CRIME register in one piece.
+ */
+
+static void enable_macepci_irq (unsigned int irq)
+{
+	u32 mace_mask;
+	u64 crime_mask;
+	unsigned long flags;
+
+	save_and_cli (flags);
+	mace_mask = mace_read_32 (MACEPCI_CONTROL);
+	mace_mask |= MACEPCI_CONTROL_INT (irq - 9);
+	mace_write_32 (MACEPCI_CONTROL, mace_mask);
+	/* In case the CRIME interrupt isn't enabled, we must enable it;
+	 * however, we never disable interrupts at that level.
+	 */
+	crime_mask = crime_read_64 (CRIME_INT_MASK);
+	crime_mask |= 1 << (irq - 1);
+	crime_write_64 (CRIME_INT_MASK, crime_mask);
+	restore_flags (flags);
+}
+
+static unsigned int startup_macepci_irq (unsigned int irq) {
+	enable_macepci_irq (irq);
+	return 0; /* XXX */
+}
+
+static void disable_macepci_irq (unsigned int irq)
+{
+	u32 mace_mask;
+	unsigned long flags;
+
+	save_and_cli (flags);
+	mace_mask = mace_read_32 (MACEPCI_CONTROL);
+	mace_mask &= ~MACEPCI_CONTROL_INT (irq - 9);
+	mace_write_32 (MACEPCI_CONTROL, mace_mask);
+	restore_flags (flags);
+}
+
+static void end_macepci_irq (unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		enable_macepci_irq (irq);
+}
+
+#define shutdown_macepci_irq disable_macepci_irq
+#define mask_and_ack_macepci_irq disable_macepci_irq
+
+static struct hw_interrupt_type ip32_macepci_interrupt = {
+	"IP32 MACE PCI",
+	startup_macepci_irq,
+	shutdown_macepci_irq,
+	enable_macepci_irq,
+	disable_macepci_irq,
+	mask_and_ack_macepci_irq,
+	end_macepci_irq,
+	NULL
+};
+
+/* This is used for MACE ISA interrupts.  That means bits 4-6 in the
+ * CRIME register.
+ */
+
+static void enable_maceisa_irq (unsigned int irq)
+{
+	u64 crime_mask;
+	u32 mace_mask;
+	unsigned int crime_int = 0;
+	unsigned long flags;
+
+	DBG ("maceisa enable: %u\n", irq);
+	
+	switch (irq) {
+	case MACEISA_AUDIO_SW_IRQ ... MACEISA_AUDIO3_MERR_IRQ:
+		crime_int = MACE_AUDIO_INT;
+		break;
+	case MACEISA_RTC_IRQ ... MACEISA_TIMER2_IRQ:
+		crime_int = MACE_MISC_INT;
+		break;
+	case MACEISA_PARALLEL_IRQ ... MACEISA_SERIAL2_RDMAOR_IRQ:
+		crime_int = MACE_SUPERIO_INT;
+		break;
+	}
+	DBG ("crime_int %016lx enabled\n", crime_int);
+	save_and_cli (flags);
+	crime_mask = crime_read_64 (CRIME_INT_MASK);
+	crime_mask |= crime_int;
+	crime_write_64 (CRIME_INT_MASK, crime_mask);
+	mace_mask = mace_read_32 (MACEISA_INT_MASK);
+	mace_mask |= 1 << (irq - 33);
+	mace_write_32 (MACEISA_INT_MASK, mace_mask);
+	restore_flags (flags);
+}
+
+static unsigned int startup_maceisa_irq (unsigned int irq) {
+	enable_maceisa_irq (irq);
+	return 0;
+}
+
+static void disable_maceisa_irq (unsigned int irq)
+{
+	u32 mace_mask;
+	unsigned long flags;
+
+	save_and_cli (flags);
+	mace_mask = mace_read_32 (MACEISA_INT_MASK);
+	mace_mask &= ~(1 << (irq - 33));
+	mace_write_32 (MACEISA_INT_MASK, mace_mask);
+	restore_flags (flags);
+}
+
+static void mask_and_ack_maceisa_irq (unsigned int irq)
+{
+	u32 mace_mask;
+	unsigned long flags;
+
+	switch (irq) {
+	case MACEISA_PARALLEL_IRQ:
+	case MACEISA_SERIAL1_TDMAPR_IRQ:
+	case MACEISA_SERIAL2_TDMAPR_IRQ:
+		save_and_cli (flags);
+		mace_mask = mace_read_32 (MACEISA_INT_STAT);
+		mace_mask &= ~(1 << (irq - 33));
+		mace_write_32 (MACEISA_INT_STAT, mace_mask);
+		restore_flags (flags);
+		break;
+	}
+	disable_maceisa_irq (irq);
+}
+
+static void end_maceisa_irq (unsigned irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		enable_maceisa_irq (irq);
+}
+
+#define shutdown_maceisa_irq disable_maceisa_irq
+
+static struct hw_interrupt_type ip32_maceisa_interrupt = {
+	"IP32 MACE ISA",
+	startup_maceisa_irq,
+	shutdown_maceisa_irq,
+	enable_maceisa_irq,
+	disable_maceisa_irq,
+	mask_and_ack_maceisa_irq,
+	end_maceisa_irq,
+	NULL
+};
+
+/* This is used for regular non-ISA, non-PCI MACE interrupts.  That means
+ * bits 0-3 and 7 in the CRIME register.
+ */
+
+static void enable_mace_irq (unsigned int irq)
+{
+	u64 crime_mask;
+	unsigned long flags;
+
+	save_and_cli (flags);
+	crime_mask = crime_read_64 (CRIME_INT_MASK);
+	crime_mask |= 1 << (irq - 1);
+	crime_write_64 (CRIME_INT_MASK, crime_mask);
+	restore_flags (flags);
+}
+
+static unsigned int startup_mace_irq (unsigned int irq)
+{
+	enable_mace_irq (irq);
+	return 0;
+}
+
+static void disable_mace_irq (unsigned int irq)
+{
+	u64 crime_mask;
+	unsigned long flags;
+
+	save_and_cli (flags);
+	crime_mask = crime_read_64 (CRIME_INT_MASK);
+	crime_mask &= ~(1 << (irq - 1));
+	crime_write_64 (CRIME_INT_MASK, crime_mask);
+	restore_flags (flags);
+}
+
+static void end_mace_irq (unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		enable_mace_irq (irq);
+}
+
+#define shutdown_mace_irq disable_mace_irq
+#define mask_and_ack_mace_irq disable_mace_irq
+
+static struct hw_interrupt_type ip32_mace_interrupt = {
+	"IP32 MACE",
+	startup_mace_irq,
+	shutdown_mace_irq,
+	enable_mace_irq,
+	disable_mace_irq,
+	mask_and_ack_mace_irq,
+	end_mace_irq,
+	NULL
+};
+
+static void ip32_unknown_interrupt (struct pt_regs *regs)
+{
+	u64 crime;
+	u32 mace;
+	
+	printk ("Unknown interrupt occurred!\n");
+	printk ("cp0_status: %08x\tcp0_cause: %08x\n",
+		read_32bit_cp0_register (CP0_STATUS),
+		read_32bit_cp0_register (CP0_CAUSE));
+	crime = crime_read_64 (CRIME_INT_MASK);
+	printk ("CRIME interrupt mask: %016lx\n", crime);
+	crime = crime_read_64 (CRIME_INT_STAT);
+	printk ("CRIME interrupt status: %016lx\n", crime);
+	crime = crime_read_64 (CRIME_HARD_INT);
+	printk ("CRIME hardware interrupt register: %016lx\n", crime);
+	mace = mace_read_32 (MACEISA_INT_MASK);
+	printk ("MACE ISA interrupt mask: %08x\n", mace);
+	mace = mace_read_32 (MACEISA_INT_STAT);
+	printk ("MACE ISA interrupt status: %08x\n", mace);
+	mace = mace_read_32 (MACEPCI_CONTROL);
+	printk ("MACE PCI control register: %08x\n", mace);
+
+	printk ("Register dump:\n");
+	show_regs (regs);
+
+	printk ("Please mail this report to linux-mips@oss.sgi.com\n");
+	printk ("Spinning...");
+	while (1) ;
+}
+
+void __init ip32_irq_init(void)
+{
+	unsigned int irq;
+	extern void init_generic_irq (void);
+	
+	/* Install our interrupt handler, then clear and disable all
+	 * CRIME and MACE interrupts.
+	 */
+	crime_write_64 (CRIME_INT_MASK, 0);
+	crime_write_64 (CRIME_HARD_INT, 0);
+	crime_write_64 (CRIME_SOFT_INT, 0);
+	mace_write_32 (MACEISA_INT_STAT, 0);
+	mace_write_32 (MACEISA_INT_MASK, 0);
+	set_except_vector(0, ip32_handle_int);
+
+	init_generic_irq ();
+
+	for (irq = 0; irq <= IP32_IRQ_MAX; irq++) {
+		hw_irq_controller *controller;
+
+		if (irq == CLOCK_IRQ)
+			controller = &ip32_cpu_interrupt;
+		else if (irq <= MACE_PCI_BRIDGE_IRQ && irq >= MACE_VID_IN1_IRQ)
+			controller = &ip32_mace_interrupt;
+		else if (irq <= MACEPCI_SHARED2_IRQ && irq >= MACEPCI_SCSI0_IRQ)
+			controller = &ip32_macepci_interrupt;
+		else if (irq <= CRIME_VICE_IRQ && irq >= CRIME_GBE0_IRQ)
+			controller = &ip32_crime_interrupt;
+		else
+			controller = &ip32_maceisa_interrupt;
+
+		irq_desc[irq].status = IRQ_DISABLED;
+		irq_desc[irq].action = 0;
+		irq_desc[irq].depth = 0;
+		irq_desc[irq].handler = controller;
+	}
+	setup_irq (CRIME_MEMERR_IRQ, &memerr_irq);
+	setup_irq (CRIME_CPUERR_IRQ, &cpuerr_irq);
+}
+
+/* CRIME 1.1 appears to deliver all interrupts to this one pin. */
+void ip32_irq0 (struct pt_regs *regs)
+{
+	u64 crime_int = crime_read_64 (CRIME_INT_STAT);
+	int irq = 0;
+	
+	if (crime_int & CRIME_MACE_INT_MASK) {
+		crime_int &= CRIME_MACE_INT_MASK;
+		irq = ffs (crime_int);
+	} else if (crime_int & CRIME_MACEISA_INT_MASK) {
+		u32 mace_int;
+		mace_int = mace_read_32 (MACEISA_INT_STAT);
+		if (mace_int == 0)
+			irq = 0;
+		else
+			irq = ffs (mace_int) + 32;
+	} else if (crime_int & CRIME_MACEPCI_INT_MASK) {
+		crime_int &= CRIME_MACEPCI_INT_MASK;
+		crime_int >>= 8;
+		irq = ffs (crime_int) + 8;
+	} else if (crime_int & 0xffff0000) {
+		crime_int >>= 16;
+		irq = ffs (crime_int) + 16;
+	}
+	if (irq == 0)
+		ip32_unknown_interrupt (regs);
+	DBG ("*irq %u*\n", irq);
+	do_IRQ (irq, regs);
+}
+
+void ip32_irq1 (struct pt_regs *regs)
+{
+	ip32_unknown_interrupt (regs);
+}
+
+void ip32_irq2 (struct pt_regs *regs)
+{
+	ip32_unknown_interrupt (regs);
+}
+
+void ip32_irq3 (struct pt_regs *regs)
+{
+	ip32_unknown_interrupt (regs);
+}
+
+void ip32_irq4 (struct pt_regs *regs)
+{
+	ip32_unknown_interrupt (regs);
+}
+
+void ip32_irq5 (struct pt_regs *regs)
+{
+	do_IRQ (CLOCK_IRQ, regs);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip32/ip32-pci-dma.c linux/arch/mips64/sgi-ip32/ip32-pci-dma.c
--- v2.4.9/linux/arch/mips64/sgi-ip32/ip32-pci-dma.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/sgi-ip32/ip32-pci-dma.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,41 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2000  Ani Joshi <ajoshi@unixbox.com>
+ * Copyright (C) 2000  Ralf Baechle <ralf@gnu.org>
+ * swiped from i386, and cloned for MIPS by Geert, polished by Ralf.
+ */
+#include <linux/types.h>
+#include <linux/mm.h>
+#include <linux/string.h>
+#include <linux/pci.h>
+
+#include <asm/io.h>
+#include <asm/addrspace.h>
+#include <asm/ip32/mace.h>
+
+void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
+			   dma_addr_t * dma_handle)
+{
+	void *ret;
+	int gfp = GFP_ATOMIC;
+
+	if (hwdev == NULL || hwdev->dma_mask != 0xffffffff)
+		gfp |= GFP_DMA;
+	ret = (void *) __get_free_pages(gfp, get_order(size));
+
+	if (ret != NULL) {
+		memset(ret, 0, size);
+		dma_cache_wback_inv((unsigned long) ret, size);
+		*dma_handle = virt_to_bus(ret);
+	}
+	return ret;
+}
+
+void pci_free_consistent(struct pci_dev *hwdev, size_t size,
+			 void *vaddr, dma_addr_t dma_handle)
+{
+	free_pages((unsigned long) vaddr, get_order(size));
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip32/ip32-pci.c linux/arch/mips64/sgi-ip32/ip32-pci.c
--- v2.4.9/linux/arch/mips64/sgi-ip32/ip32-pci.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/sgi-ip32/ip32-pci.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,438 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2000, 2001 Keith M Wesolowski
+ */
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/types.h>
+#include <asm/pci.h>
+#include <asm/ip32/mace.h>
+#include <asm/ip32/crime.h>
+#include <asm/ip32/ip32_ints.h>
+#include <linux/delay.h>
+
+#undef DEBUG_MACE_PCI
+
+/*
+ * O2 has up to 5 PCI devices connected into the MACE bridge.  The device
+ * map looks like this:
+ *
+ * 0  aic7xxx 0
+ * 1  aic7xxx 1
+ * 2  expansion slot
+ * 3  N/C
+ * 4  N/C
+ */
+
+#define chkslot(dev)							\
+do {									\
+	if ((dev)->bus->number > 0 || PCI_SLOT ((dev)->devfn) < 1	\
+	    || PCI_SLOT ((dev)->devfn) > 3)				\
+		return PCIBIOS_DEVICE_NOT_FOUND;			\
+} while (0)
+		
+#define mkaddr(dev, where) \
+((((dev)->devfn & 0xffUL) << 8) | ((where) & 0xfcUL))
+
+void macepci_error (int irq, void *dev, struct pt_regs *regs);
+
+static int macepci_read_config_byte (struct pci_dev *dev, int where,
+				     u8 *val)
+{
+	*val = 0xff;
+	chkslot (dev);
+	mace_write_32 (MACEPCI_CONFIG_ADDR, mkaddr (dev, where));
+	*val = mace_read_8 (MACEPCI_CONFIG_DATA + ((where & 3UL) ^ 3UL));
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int macepci_read_config_word (struct pci_dev *dev, int where,
+				     u16 *val)
+{
+	*val = 0xffff;
+	chkslot (dev);
+	if (where & 1)
+		return PCIBIOS_BAD_REGISTER_NUMBER;
+ 	mace_write_32 (MACEPCI_CONFIG_ADDR, mkaddr (dev, where));
+	*val = mace_read_16 (MACEPCI_CONFIG_DATA + ((where & 2UL) ^ 2UL));
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int macepci_read_config_dword (struct pci_dev *dev, int where,
+				      u32 *val)
+{
+	*val = 0xffffffff;
+	chkslot (dev);
+	if (where & 3)
+		return PCIBIOS_BAD_REGISTER_NUMBER;
+	mace_write_32 (MACEPCI_CONFIG_ADDR, mkaddr (dev, where));
+	*val = mace_read_32 (MACEPCI_CONFIG_DATA);
+	
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int macepci_write_config_byte (struct pci_dev *dev, int where,
+				      u8 val)
+{
+	chkslot (dev);
+	mace_write_32 (MACEPCI_CONFIG_ADDR, mkaddr (dev, where));
+	mace_write_8 (MACEPCI_CONFIG_DATA + ((where & 3UL) ^ 3UL), val);
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int macepci_write_config_word (struct pci_dev *dev, int where,
+				      u16 val)
+{
+	chkslot (dev);
+	if (where & 1)
+		return PCIBIOS_BAD_REGISTER_NUMBER;
+	mace_write_32 (MACEPCI_CONFIG_ADDR, mkaddr (dev, where));
+	mace_write_16 (MACEPCI_CONFIG_DATA + ((where & 2UL) ^ 2UL), val);
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static int macepci_write_config_dword (struct pci_dev *dev, int where,
+                                          u32 val)
+{
+	chkslot (dev);
+	if (where & 3)
+		return PCIBIOS_BAD_REGISTER_NUMBER;
+	mace_write_32 (MACEPCI_CONFIG_ADDR, mkaddr (dev, where));
+	mace_write_32 (MACEPCI_CONFIG_DATA, val);
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
+static struct pci_ops macepci_ops = {
+	macepci_read_config_byte,
+	macepci_read_config_word,
+	macepci_read_config_dword,
+	macepci_write_config_byte,
+	macepci_write_config_word,
+	macepci_write_config_dword
+};
+
+struct pci_fixup pcibios_fixups[] = { { 0 } };
+
+void __init pcibios_init (void)
+{
+	struct pci_dev *dev;
+	u32 start, size;
+	u16 cmd;
+	u32 base_io = 0x3000; /* The first i/o address to assign after SCSI */
+	u32 base_mem = 0x80100000; /* Likewise */
+	u32 rev = mace_read_32 (MACEPCI_REV);
+	int i;
+
+	printk ("MACE: PCI rev %d detected at %016lx\n", rev,
+		(u64) MACE_BASE + MACE_PCI);
+
+	/* These are *bus* addresses */
+	ioport_resource.start = 0;
+	ioport_resource.end = 0xffffffffUL;
+	iomem_resource.start = 0x80000000UL;
+	iomem_resource.end = 0xffffffffUL;
+
+	/* Clear any outstanding errors and enable interrupts */
+	mace_write_32 (MACEPCI_ERROR_ADDR, 0);
+	mace_write_32 (MACEPCI_ERROR_FLAGS, 0);
+	mace_write_32 (MACEPCI_CONTROL, 0xff008500);
+	crime_write_64 (CRIME_HARD_INT, 0UL);
+	crime_write_64 (CRIME_SOFT_INT, 0UL);
+	crime_write_64 (CRIME_INT_STAT, 0x000000000000ff00UL);
+
+	if (request_irq (MACE_PCI_BRIDGE_IRQ, macepci_error, 0,
+			 "MACE PCI error", NULL))
+		panic ("PCI bridge can't get interrupt; can't happen.\n");
+
+	pci_scan_bus (0, &macepci_ops, NULL);
+
+#ifdef DEBUG_MACE_PCI
+	pci_for_each_dev (dev) {
+		printk ("Device: %d/%d/%d ARCS-assigned bus resource map\n",
+			dev->bus->number, PCI_SLOT (dev->devfn),
+			PCI_FUNC (dev->devfn));
+		for (i=0; i < DEVICE_COUNT_RESOURCE; i++) {
+			if (dev->resource[i].start == 0)
+				continue;
+			printk ("%d: %016lx - %016lx (flags %04lx)\n",
+				i, dev->resource[i].start,
+				dev->resource[i].end, dev->resource[i].flags);
+		}
+	}
+#endif
+	/*
+	 * Assign sane resources to and enable all devices.  The requirement
+	 * for the SCSI controllers is well-known: a 256-byte I/O region
+	 * which we must assign, and a 1-page memory region which is
+	 * assigned by the system firmware.
+	 */
+	pci_for_each_dev (dev) {
+		switch (PCI_SLOT (dev->devfn)) {
+		case 1: /* SCSI bus 0 */
+			dev->resource[0].start = 0x1000UL;
+			dev->resource[0].end = 0x10ffUL;
+			break;
+		case 2: /* SCSI bus 1 */
+			dev->resource[0].start = 0x2000UL;
+			dev->resource[0].end = 0x20ffUL;
+			break;
+		default: /* Slots - I guess we have only 1 */
+			for (i=0; i < 6; i++) {
+				size = dev->resource[i].end
+					- dev->resource[i].start;
+				if (!size
+				    || !(dev->resource[i].flags
+					 & (IORESOURCE_IO|IORESOURCE_MEM))) {
+					dev->resource[i].start
+						= dev->resource[i].end = 0UL;
+					continue;
+				}
+				if (dev->resource[i].flags & IORESOURCE_IO) {
+					dev->resource[i].start = base_io;
+					base_io += PAGE_ALIGN (size);
+				} else {
+					dev->resource[i].start = base_mem;
+					base_mem += 0x100000UL;
+				}
+				dev->resource[i].end =
+					dev->resource[i].start + size;
+			}
+			break;
+		}
+		for (i=0; i < 6; i++) {
+			if (dev->resource[i].start == 0)
+				continue;
+			start = dev->resource[i].start;
+			if (dev->resource[i].flags & IORESOURCE_IO)
+				start |= 1;
+			pci_write_config_dword (dev, 
+				PCI_BASE_ADDRESS_0 + (i << 2), (u32) start);
+		}
+		pci_write_config_byte (dev, PCI_CACHE_LINE_SIZE, 0x20);
+		pci_write_config_byte (dev, PCI_LATENCY_TIMER, 0x30);
+		pci_read_config_word (dev, PCI_COMMAND, &cmd);
+		cmd |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_PARITY);
+		pci_write_config_word (dev, PCI_COMMAND, cmd);
+		pci_set_master (dev);
+	}
+
+#ifdef DEBUG_MACE_PCI
+	printk ("Triggering PCI bridge interrupt...\n");
+	mace_write_32 (MACEPCI_ERROR_FLAGS, MACEPCI_ERROR_INTERRUPT_TEST);
+
+	pci_for_each_dev (dev) {
+		printk ("Device: %d/%d/%d final bus resource map\n",
+			dev->bus->number, PCI_SLOT (dev->devfn),
+			PCI_FUNC (dev->devfn));
+		for (i=0; i < DEVICE_COUNT_RESOURCE; i++) {
+			if (dev->resource[i].start == 0)
+				continue;
+			printk ("%d: %016lx - %016lx (flags %04lx)\n",
+				i, dev->resource[i].start,
+				dev->resource[i].end, dev->resource[i].flags);
+		}
+	}
+#endif
+}
+
+/*
+ * Given a PCI slot number (a la PCI_SLOT(...)) and the interrupt pin of
+ * the device (1-4 => A-D), tell what irq to use.  Note that we don't
+ * in theory have slots 4 and 5, and we never normally use the shared
+ * irqs.  I suppose a device without a pin A will thank us for doing it
+ * right if there exists such a broken piece of crap.
+ */
+static int __init macepci_map_irq (struct pci_dev *dev, u8 slot, u8 pin)
+{
+	chkslot (dev);
+	if (pin == 0)
+		pin = 1;
+	switch (slot) {
+	case 1:
+		return MACEPCI_SCSI0_IRQ;
+	case 2:
+		return MACEPCI_SCSI1_IRQ;
+	case 3:
+		switch (pin) {
+		case 2:
+			return MACEPCI_SHARED0_IRQ;
+		case 3:
+			return MACEPCI_SHARED1_IRQ;
+		case 4:
+			return MACEPCI_SHARED2_IRQ;
+		case 1:
+		default:
+			return MACEPCI_SLOT0_IRQ;
+		}
+	case 4:
+		switch (pin) {
+		case 2:
+			return MACEPCI_SHARED2_IRQ;
+		case 3:
+			return MACEPCI_SHARED0_IRQ;
+		case 4:
+			return MACEPCI_SHARED1_IRQ;
+		case 1:
+		default:
+			return MACEPCI_SLOT1_IRQ;
+		}
+		return MACEPCI_SLOT1_IRQ;
+	case 5:
+		switch (pin) {
+		case 2:
+			return MACEPCI_SHARED1_IRQ;
+		case 3:
+			return MACEPCI_SHARED2_IRQ;
+		case 4:
+			return MACEPCI_SHARED0_IRQ;
+		case 1:
+		default:
+			return MACEPCI_SLOT2_IRQ;
+		}
+	default:
+		return 0;
+	}
+}
+
+/*
+ * It's not entirely clear what this does in a system with no bridges.
+ * In any case, bridges are not supported by Linux in O2.
+ */
+static u8 __init macepci_swizzle (struct pci_dev *dev, u8 *pinp)
+{
+	if (PCI_SLOT (dev->devfn) == 2)
+		*pinp = 2;
+	else
+		*pinp = 1;
+	return PCI_SLOT (dev->devfn);
+}
+
+/* All devices are enabled during initialization. */
+int pcibios_enable_device (struct pci_dev *dev)
+{
+	return PCIBIOS_SUCCESSFUL;
+}
+
+char * __init pcibios_setup (char *str)
+{
+	return str;
+}
+
+void __init pcibios_align_resource (void *data, struct resource *res,
+				    unsigned long size)
+{
+}
+
+void __init pcibios_update_resource (struct pci_dev *dev, struct resource *root,
+				     struct resource *res, int resource)
+{
+}
+
+void __init pcibios_update_irq (struct pci_dev *dev, int irq)
+{
+	pci_write_config_byte (dev, PCI_INTERRUPT_LINE, irq);
+}
+
+void __init pcibios_fixup_bus (struct pci_bus *b)
+{
+	pci_fixup_irqs (macepci_swizzle, macepci_map_irq);
+}
+
+/* XXX anybody know what this is supposed to do? */
+void __init pcibios_fixup_pbus_ranges(struct pci_bus * bus,
+				      struct pbus_set_ranges_data * ranges)
+{
+	ranges->io_start -= bus->resource[0]->start;
+	ranges->io_end -= bus->resource[0]->start;
+	ranges->mem_start -= bus->resource[1]->start;
+	ranges->mem_end -= bus->resource[1]->start;
+}
+
+/*
+ * Handle errors from the bridge.  This includes master and target aborts,
+ * various command and address errors, and the interrupt test.  This gets
+ * registered on the bridge error irq.  It's conceivable that some of these
+ * conditions warrant a panic.  Anybody care to say which ones?
+ */
+void macepci_error (int irq, void *dev, struct pt_regs *regs) {
+	u32 flags, error_addr;
+	char space;
+
+	flags = mace_read_32 (MACEPCI_ERROR_FLAGS);
+	error_addr = mace_read_32 (MACEPCI_ERROR_ADDR);
+
+	if (flags & MACEPCI_ERROR_MEMORY_ADDR)
+		space = 'M';
+	else if (flags & MACEPCI_ERROR_CONFIG_ADDR)
+		space = 'C';
+	else space = 'X';
+	
+	if (flags & MACEPCI_ERROR_MASTER_ABORT) {
+		printk ("MACEPCI: Master abort at 0x%08x (%c)\n", error_addr,
+			space);
+		mace_write_32 (MACEPCI_ERROR_FLAGS, flags
+			       & ~MACEPCI_ERROR_MASTER_ABORT);
+	}
+	if (flags & MACEPCI_ERROR_TARGET_ABORT) {
+		printk ("MACEPCI: Target abort at 0x%08x (%c)\n", error_addr,
+			space);
+		mace_write_32 (MACEPCI_ERROR_FLAGS, flags
+			       & ~MACEPCI_ERROR_TARGET_ABORT);
+	}
+	if (flags & MACEPCI_ERROR_DATA_PARITY_ERR) {
+		printk ("MACEPCI: Data parity error at 0x%08x (%c)\n",
+			error_addr, space);
+		mace_write_32 (MACEPCI_ERROR_FLAGS, flags
+			       & ~MACEPCI_ERROR_DATA_PARITY_ERR);
+	}
+	if (flags & MACEPCI_ERROR_RETRY_ERR) {
+		printk ("MACEPCI: Retry error at 0x%08x (%c)\n", error_addr,
+			space);
+		mace_write_32 (MACEPCI_ERROR_FLAGS, flags
+			       & ~MACEPCI_ERROR_RETRY_ERR);
+	}
+	if (flags & MACEPCI_ERROR_ILLEGAL_CMD) {
+		printk ("MACEPCI: Illegal command at 0x%08x (%c)\n",
+			error_addr, space);
+		mace_write_32 (MACEPCI_ERROR_FLAGS,
+			       flags & ~MACEPCI_ERROR_ILLEGAL_CMD);
+	}
+	if (flags & MACEPCI_ERROR_SYSTEM_ERR) {
+		printk ("MACEPCI: System error at 0x%08x (%c)\n",
+			error_addr, space);
+		mace_write_32 (MACEPCI_ERROR_FLAGS, flags
+			       & ~MACEPCI_ERROR_SYSTEM_ERR);
+	}
+	if (flags & MACEPCI_ERROR_PARITY_ERR) {
+		printk ("MACEPCI: Parity error at 0x%08x (%c)\n", error_addr,
+			space);
+		mace_write_32 (MACEPCI_ERROR_FLAGS, flags
+			       & ~MACEPCI_ERROR_PARITY_ERR);
+	}
+	if (flags & MACEPCI_ERROR_OVERRUN) {
+		printk ("MACEPCI: Overrun error at 0x%08x (%c)\n",
+			error_addr, space);
+		mace_write_32 (MACEPCI_ERROR_FLAGS, flags
+			       & ~MACEPCI_ERROR_OVERRUN);
+	}
+	if (flags & MACEPCI_ERROR_SIG_TABORT) {
+		printk ("MACEPCI: Signaled target abort (clearing)\n");
+		mace_write_32 (MACEPCI_ERROR_FLAGS, flags
+			       & ~MACEPCI_ERROR_SIG_TABORT);
+	}
+	if (flags & MACEPCI_ERROR_INTERRUPT_TEST) {
+		printk ("MACEPCI: Interrupt test triggered (clearing)\n");
+		mace_write_32 (MACEPCI_ERROR_FLAGS, flags
+			       & ~MACEPCI_ERROR_INTERRUPT_TEST);
+	}
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip32/ip32-rtc.c linux/arch/mips64/sgi-ip32/ip32-rtc.c
--- v2.4.9/linux/arch/mips64/sgi-ip32/ip32-rtc.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/sgi-ip32/ip32-rtc.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,32 @@
+/*
+ * RTC routines for IP32 style attached Dallas chip.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2000 Harald Koerfgen
+ */
+#include <linux/mc146818rtc.h>
+#include <asm/ip32/mace.h>
+
+static unsigned char ip32_rtc_read_data(unsigned long addr)
+{
+	return (unsigned char) mace_read_8 (MACEISA_RTC_BASE + (addr << 8));
+}
+
+static void ip32_rtc_write_data(unsigned char data, unsigned long addr)
+{
+	mace_write_8 (MACEISA_RTC_BASE + (addr << 8), data);
+}
+
+static int ip32_rtc_bcd_mode(void)
+{
+	return 0;
+}
+
+struct rtc_ops ip32_rtc_ops = {
+	&ip32_rtc_read_data,
+	&ip32_rtc_write_data,
+	&ip32_rtc_bcd_mode
+};
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip32/ip32-setup.c linux/arch/mips64/sgi-ip32/ip32-setup.c
--- v2.4.9/linux/arch/mips64/sgi-ip32/ip32-setup.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/sgi-ip32/ip32-setup.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,62 @@
+/*
+ * IP32 basic setup
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2000 Harald Koerfgen
+ */
+#include <linux/sched.h>
+#include <linux/interrupt.h>
+#include <linux/mc146818rtc.h>
+#include <linux/param.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <asm/mipsregs.h>
+#include <asm/bootinfo.h>
+#include <asm/irq.h>
+#include <asm/mmu_context.h>
+#include <asm/ip32/crime.h>
+#include <asm/ip32/mace.h>
+#include <asm/ip32/ip32_ints.h>
+#include <asm/sgialib.h>
+
+extern struct rtc_ops ip32_rtc_ops;
+extern u32 cc_interval;
+
+void __init ip32_init (int argc, char **argv, char **envp) {
+	arc_meminit ();
+}
+
+void __init ip32_setup(void)
+{
+#ifdef CONFIG_SERIAL_CONSOLE
+	char *ctype;
+#endif
+	TLBMISS_HANDLER_SETUP ();
+
+#ifdef CONFIG_SERIAL_CONSOLE
+	ctype = ArcGetEnvironmentVariable("console");
+	if (*ctype == 'd') {
+		if (ctype[1] == '2')
+			console_setup ("ttyS1");
+		else
+			console_setup ("ttyS0");
+	}
+#endif
+
+#ifdef CONFIG_VT
+	conswitchp = &dummy_con;
+#endif
+
+	rtc_ops = &ip32_rtc_ops;
+
+	crime_init ();
+}
+
+int __init page_is_ram (unsigned long pagenr)
+{
+	/* XXX: to do? */
+	return 1;
+}
diff -u --recursive --new-file v2.4.9/linux/arch/mips64/sgi-ip32/ip32-timer.c linux/arch/mips64/sgi-ip32/ip32-timer.c
--- v2.4.9/linux/arch/mips64/sgi-ip32/ip32-timer.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/sgi-ip32/ip32-timer.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,47 @@
+/*
+ * IP32 timer calibration
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2001 Keith M Wesolowski
+ */
+#include <linux/irq.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <asm/mipsregs.h>
+#include <asm/param.h>
+#include <asm/ip32/crime.h>
+#include <asm/ip32/ip32_ints.h>
+
+extern u32 cc_interval;
+
+/* An arbitrary time; this can be decreased if reliability looks good */
+#define WAIT_MS 10
+#define PER_MHZ (1000000 / 2 / HZ)
+
+void __init ip32_timer_setup (struct irqaction *irq) {
+	u64 crime_time;
+	u32 cc_tick;
+
+	printk("Calibrating system timer... ");
+
+	crime_time = crime_read_64 (CRIME_TIME) & CRIME_TIME_MASK;
+	cc_tick = read_32bit_cp0_register (CP0_COUNT);
+
+	while ((crime_read_64 (CRIME_TIME) & CRIME_TIME_MASK) - crime_time 
+		< WAIT_MS * 1000000 / CRIME_NS_PER_TICK)
+		;
+	cc_tick = read_32bit_cp0_register (CP0_COUNT) - cc_tick;
+	cc_interval = cc_tick / HZ * (1000 / WAIT_MS);
+	/* The round-off seems unnecessary; in testing, the error of the
+	 * above procedure is < 100 ticks, which means it gets filtered
+	 * out by the HZ adjustment. 
+	 */
+	cc_interval = (cc_interval / PER_MHZ) * PER_MHZ;
+
+	printk("%d MHz CPU detected\n", (int) (cc_interval / PER_MHZ));
+
+	setup_irq (CLOCK_IRQ, irq);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/parisc/kernel/init_task.c linux/arch/parisc/kernel/init_task.c
--- v2.4.9/linux/arch/parisc/kernel/init_task.c	Tue Dec  5 12:29:39 2000
+++ linux/arch/parisc/kernel/init_task.c	Mon Sep 17 15:29:09 2001
@@ -6,7 +6,6 @@
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 
-static struct vm_area_struct init_mmap = INIT_MMAP;
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
 static struct signal_struct init_signals = INIT_SIGNALS;
diff -u --recursive --new-file v2.4.9/linux/arch/parisc/kernel/pdc_cons.c linux/arch/parisc/kernel/pdc_cons.c
--- v2.4.9/linux/arch/parisc/kernel/pdc_cons.c	Tue Dec  5 12:29:39 2000
+++ linux/arch/parisc/kernel/pdc_cons.c	Sun Sep 16 21:23:15 2001
@@ -141,11 +141,7 @@
 	--pdc_console_initialized;
 	
 #ifdef CONFIG_VT_CONSOLE
-	{
-	    /* fixme (needed?): Wait for console-tasklet to finish !*/
-	    extern struct tasklet_struct console_tasklet;
-    	    tasklet_schedule(&console_tasklet);
-	}
+	schedule_console_callback();
 #endif
 
 	unregister_console(&pdc_cons);
diff -u --recursive --new-file v2.4.9/linux/arch/parisc/kernel/ptrace.c linux/arch/parisc/kernel/ptrace.c
--- v2.4.9/linux/arch/parisc/kernel/ptrace.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/parisc/kernel/ptrace.c	Tue Sep 18 16:56:19 2001
@@ -31,6 +31,20 @@
 #define PT_SINGLESTEP	0x10000
 #define PT_BLOCKSTEP	0x20000
 
+/*
+ * Called by kernel/ptrace.c when detaching..
+ *
+ * Make sure single step bits etc are not set.
+ */
+void ptrace_disable(struct task_struct *child)
+{
+	/* make sure the trap bits are not set */
+	pa_psw(child)->r = 0;
+	pa_psw(child)->t = 0;
+	pa_psw(child)->h = 0;
+	pa_psw(child)->l = 0;
+}
+
 long sys_ptrace(long request, pid_t pid, long addr, long data)
 {
 	struct task_struct *child;
@@ -226,17 +240,8 @@
 		goto out_wake;
 
 	case PTRACE_DETACH:
-		ret = -EIO;
-		if ((unsigned long) data > _NSIG)
-			goto out_tsk;
-		child->ptrace &= ~(PT_PTRACED|PT_TRACESYS|PT_SINGLESTEP|PT_BLOCKSTEP);
-		child->exit_code = data;
-		write_lock_irq(&tasklist_lock);
-		REMOVE_LINKS(child);
-		child->p_pptr = child->p_opptr;
-		SET_LINKS(child);
-		write_unlock_irq(&tasklist_lock);
-		goto out_wake_notrap;
+		ret = ptrace_detach(child, data);
+		goto out_tsk;
 
 	default:
 		ret = -EIO;
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/8xx_io/Config.in linux/arch/ppc/8xx_io/Config.in
--- v2.4.9/linux/arch/ppc/8xx_io/Config.in	Wed May 16 09:57:20 2001
+++ linux/arch/ppc/8xx_io/Config.in	Sat Sep  8 12:39:33 2001
@@ -31,6 +31,7 @@
 comment 'Generic MPC8xx Options'
 bool 'Copy-Back Data Cache (else Writethrough)' CONFIG_8xx_COPYBACK
 bool 'CPU6 Silicon Errata (860 Pre Rev. C)' CONFIG_8xx_CPU6
+bool 'I2C/SPI Microcode Patch' CONFIG_UCODE_PATCH
 
 if [ "$CONFIG_IDE" = "y" ]; then
 	bool 'MPC8xx direct IDE support on PCMCIA port' CONFIG_BLK_DEV_MPC8xx_IDE
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/8xx_io/Makefile linux/arch/ppc/8xx_io/Makefile
--- v2.4.9/linux/arch/ppc/8xx_io/Makefile	Mon May 21 17:04:46 2001
+++ linux/arch/ppc/8xx_io/Makefile	Sat Sep  8 12:39:33 2001
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.3 05/17/01 18:14:20 cort
+# BK Id: SCCS/s.Makefile 1.6 08/30/01 09:33:48 trini
 #
 #
 # Makefile for the linux MPC8xx ppc-specific parts of comm processor
@@ -15,5 +15,6 @@
 
 obj-$(CONFIG_FEC_ENET)	+= fec.o
 obj-$(CONFIG_SCC_ENET)	+= enet.o
+obj-$(CONFIG_UCODE_PATCH) += micropatch.o
 
 include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/8xx_io/enet.c linux/arch/ppc/8xx_io/enet.c
--- v2.4.9/linux/arch/ppc/8xx_io/enet.c	Mon May 21 17:04:46 2001
+++ linux/arch/ppc/8xx_io/enet.c	Sun Sep  2 07:48:02 2001
@@ -651,11 +651,10 @@
 	volatile	scc_t		*sccp;
 	volatile	scc_enet_t	*ep;
 	volatile	immap_t		*immap;
-	extern unsigned long _get_IMMR(void);
 
 	cp = cpmp;	/* Get pointer to Communication Processor */
 
-	immap = (immap_t *)(_get_IMMR() & 0xFFFF0000);	/* and to internal registers */
+	immap = (immap_t *)(mfspr(IMMR) & 0xFFFF0000);	/* and to internal registers */
 
 	bd = (bd_t *)__res;
 
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/8xx_io/fec.c linux/arch/ppc/8xx_io/fec.c
--- v2.4.9/linux/arch/ppc/8xx_io/fec.c	Mon May 21 17:04:46 2001
+++ linux/arch/ppc/8xx_io/fec.c	Sun Sep  2 07:48:02 2001
@@ -1509,7 +1509,6 @@
 	volatile	immap_t	*immap;
 	volatile	fec_t	*fecp;
 	bd_t		*bd;
-	extern		uint	_get_IMMR(void);
 #ifdef CONFIG_SCC_ENET
 	unsigned char	tmpaddr[6];
 #endif
@@ -1680,7 +1679,7 @@
 
 	/* Bits moved from Rev. D onward.
 	*/
-	if ((_get_IMMR() & 0xffff) < 0x0501)
+	if ((mfspr(IMMR) & 0xffff) < 0x0501)
 		immap->im_ioport.iop_pddir = 0x1c58;	/* Pre rev. D */
 	else
 		immap->im_ioport.iop_pddir = 0x1fff;	/* Rev. D and later */
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/8xx_io/micropatch.c linux/arch/ppc/8xx_io/micropatch.c
--- v2.4.9/linux/arch/ppc/8xx_io/micropatch.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/8xx_io/micropatch.c	Sat Sep  8 12:39:33 2001
@@ -0,0 +1,777 @@
+
+/* Microcode patches for the CPM as supplied by Motorola.
+ * This is the one for IIC/SPI.  There is a newer one that
+ * also relocates SMC2, but this would require additional changes
+ * to uart.c, so I am holding off on that for a moment.
+ */
+#include <linux/config.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/param.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/interrupt.h>
+#include <asm/irq.h>
+#include <asm/mpc8xx.h>
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/8xx_immap.h>
+#include "commproc.h"
+
+/* Define this to get SMC patches as well.  You need to modify the uart
+ * driver as well......
+#define USE_SMC_PATCH 1
+ */
+
+#ifdef CONFIG_USB_MPC8xx
+#define USE_USB_SOF_PATCH
+#endif
+
+#ifdef USE_IIC_PATCH
+#define PATCH_DEFINED
+	/* IIC/SPI */
+uint patch_2000[] = {
+	0x7FFFEFD9,
+	0x3FFD0000,
+	0x7FFB49F7,
+	0x7FF90000,
+	0x5FEFADF7,
+	0x5F89ADF7,
+	0x5FEFAFF7,
+	0x5F89AFF7,
+	0x3A9CFBC8,
+	0xE7C0EDF0,
+	0x77C1E1BB,
+	0xF4DC7F1D,
+	0xABAD932F,
+	0x4E08FDCF,
+	0x6E0FAFF8,
+	0x7CCF76CF,
+	0xFD1FF9CF,
+	0xABF88DC6,
+	0xAB5679F7,
+	0xB0937383,
+	0xDFCE79F7,
+	0xB091E6BB,
+	0xE5BBE74F,
+	0xB3FA6F0F,
+	0x6FFB76CE,
+	0xEE0DF9CF,
+	0x2BFBEFEF,
+	0xCFEEF9CF,
+	0x76CEAD24,
+	0x90B2DF9A,
+	0x7FDDD0BF,
+	0x4BF847FD,
+	0x7CCF76CE,
+	0xCFEF7E1F,
+	0x7F1D7DFD,
+	0xF0B6EF71,
+	0x7FC177C1,
+	0xFBC86079,
+	0xE722FBC8,
+	0x5FFFDFFF,
+	0x5FB2FFFB,
+	0xFBC8F3C8,
+	0x94A67F01,
+	0x7F1D5F39,
+	0xAFE85F5E,
+	0xFFDFDF96,
+	0xCB9FAF7D,
+	0x5FC1AFED,
+	0x8C1C5FC1,
+	0xAFDD5FC3,
+	0xDF9A7EFD,
+	0xB0B25FB2,
+	0xFFFEABAD,
+	0x5FB2FFFE,
+	0x5FCE600B,
+	0xE6BB600B,
+	0x5FCEDFC6,
+	0x27FBEFDF,
+	0x5FC8CFDE,
+	0x3A9CE7C0,
+	0xEDF0F3C8,
+	0x7F0154CD,
+	0x7F1D2D3D,
+	0x363A7570,
+	0x7E0AF1CE,
+	0x37EF2E68,
+	0x7FEE10EC,
+	0xADF8EFDE,
+	0xCFEAE52F,
+	0x7D0FE12B,
+	0xF1CE5F65,
+	0x7E0A4DF8,
+	0xCFEA5F72,
+	0x7D0BEFEE,
+	0xCFEA5F74,
+	0xE522EFDE,
+	0x5F74CFDA,
+	0x0B627385,
+	0xDF627E0A,
+	0x30D8145B,
+	0xBFFFF3C8,
+	0x5FFFDFFF,
+	0xA7F85F5E,
+	0xBFFE7F7D,
+	0x10D31450,
+	0x5F36BFFF,
+	0xAF785F5E,
+	0xBFFDA7F8,
+	0x5F36BFFE,
+	0x77FD30C0,
+	0x4E08FDCF,
+	0xE5FF6E0F,
+	0xAFF87E1F,
+	0x7E0FFD1F,
+	0xF1CF5F1B,
+	0xABF80D5E,
+	0x5F5EFFEF,
+	0x79F730A2,
+	0xAFDD5F34,
+	0x47F85F34,
+	0xAFED7FDD,
+	0x50B24978,
+	0x47FD7F1D,
+	0x7DFD70AD,
+	0xEF717EC1,
+	0x6BA47F01,
+	0x2D267EFD,
+	0x30DE5F5E,
+	0xFFFD5F5E,
+	0xFFEF5F5E,
+	0xFFDF0CA0,
+	0xAFED0A9E,
+	0xAFDD0C3A,
+	0x5F3AAFBD,
+	0x7FBDB082,
+	0x5F8247F8
+};
+
+uint patch_2f00[] = {
+	0x3E303430,
+	0x34343737,
+	0xABF7BF9B,
+	0x994B4FBD,
+	0xBD599493,
+	0x349FFF37,
+	0xFB9B177D,
+	0xD9936956,
+	0xBBFDD697,
+	0xBDD2FD11,
+	0x31DB9BB3,
+	0x63139637,
+	0x93733693,
+	0x193137F7,
+	0x331737AF,
+	0x7BB9B999,
+	0xBB197957,
+	0x7FDFD3D5,
+	0x73B773F7,
+	0x37933B99,
+	0x1D115316,
+	0x99315315,
+	0x31694BF4,
+	0xFBDBD359,
+	0x31497353,
+	0x76956D69,
+	0x7B9D9693,
+	0x13131979,
+	0x79376935
+};
+#endif
+
+#ifdef USE_SMC_PATCH
+#define PATCH_DEFINED
+/* SMC2/IIC/SPI Patch */
+/* This is the area from 0x2000 to 0x23ff.
+*/
+uint patch_2000[] = {
+	0x3fff0000,
+	0x3ffd0000,
+	0x3ffb0000,
+	0x3ff90000,
+	0x5f13eff8,
+	0x5eb5eff8,
+	0x5f88adf7,
+	0x5fefadf7,
+	0x3a9cfbc8,
+	0x77cae1bb,
+	0xf4de7fad,
+	0xabae9330,
+	0x4e08fdcf,
+	0x6e0faff8,
+	0x7ccf76cf,
+	0xfdaff9cf,
+	0xabf88dc8,
+	0xab5879f7,
+	0xb0925d8d,
+	0xdfd079f7,
+	0xb090e6bb,
+	0xe5bbe74f,
+	0x9e046f0f,
+	0x6ffb76ce,
+	0xee0cf9cf,
+	0x2bfbefef,
+	0xcfeef9cf,
+	0x76cead23,
+	0x90b3df99,
+	0x7fddd0c1,
+	0x4bf847fd,
+	0x7ccf76ce,
+	0xcfef77ca,
+	0x7eaf7fad,
+	0x7dfdf0b7,
+	0xef7a7fca,
+	0x77cafbc8,
+	0x6079e722,
+	0xfbc85fff,
+	0xdfff5fb3,
+	0xfffbfbc8,
+	0xf3c894a5,
+	0xe7c9edf9,
+	0x7f9a7fad,
+	0x5f36afe8,
+	0x5f5bffdf,
+	0xdf95cb9e,
+	0xaf7d5fc3,
+	0xafed8c1b,
+	0x5fc3afdd,
+	0x5fc5df99,
+	0x7efdb0b3,
+	0x5fb3fffe,
+	0xabae5fb3,
+	0xfffe5fd0,
+	0x600be6bb,
+	0x600b5fd0,
+	0xdfc827fb,
+	0xefdf5fca,
+	0xcfde3a9c,
+	0xe7c9edf9,
+	0xf3c87f9e,
+	0x54ca7fed,
+	0x2d3a3637,
+	0x756f7e9a,
+	0xf1ce37ef,
+	0x2e677fee,
+	0x10ebadf8,
+	0xefdecfea,
+	0xe52f7d9f,
+	0xe12bf1ce,
+	0x5f647e9a,
+	0x4df8cfea,
+	0x5f717d9b,
+	0xefeecfea,
+	0x5f73e522,
+	0xefde5f73,
+	0xcfda0b61,
+	0x5d8fdf61,
+	0xe7c9edf9,
+	0x7e9a30d5,
+	0x1458bfff,
+	0xf3c85fff,
+	0xdfffa7f8,
+	0x5f5bbffe,
+	0x7f7d10d0,
+	0x144d5f33,
+	0xbfffaf78,
+	0x5f5bbffd,
+	0xa7f85f33,
+	0xbffe77fd,
+	0x30bd4e08,
+	0xfdcfe5ff,
+	0x6e0faff8,
+	0x7eef7e9f,
+	0xfdeff1cf,
+	0x5f17abf8,
+	0x0d5b5f5b,
+	0xffef79f7,
+	0x309eafdd,
+	0x5f3147f8,
+	0x5f31afed,
+	0x7fdd50af,
+	0x497847fd,
+	0x7f9e7fed,
+	0x7dfd70a9,
+	0xef7e7ece,
+	0x6ba07f9e,
+	0x2d227efd,
+	0x30db5f5b,
+	0xfffd5f5b,
+	0xffef5f5b,
+	0xffdf0c9c,
+	0xafed0a9a,
+	0xafdd0c37,
+	0x5f37afbd,
+	0x7fbdb081,
+	0x5f8147f8,
+	0x3a11e710,
+	0xedf0ccdd,
+	0xf3186d0a,
+	0x7f0e5f06,
+	0x7fedbb38,
+	0x3afe7468,
+	0x7fedf4fc,
+	0x8ffbb951,
+	0xb85f77fd,
+	0xb0df5ddd,
+	0xdefe7fed,
+	0x90e1e74d,
+	0x6f0dcbf7,
+	0xe7decfed,
+	0xcb74cfed,
+	0xcfeddf6d,
+	0x91714f74,
+	0x5dd2deef,
+	0x9e04e7df,
+	0xefbb6ffb,
+	0xe7ef7f0e,
+	0x9e097fed,
+	0xebdbeffa,
+	0xeb54affb,
+	0x7fea90d7,
+	0x7e0cf0c3,
+	0xbffff318,
+	0x5fffdfff,
+	0xac59efea,
+	0x7fce1ee5,
+	0xe2ff5ee1,
+	0xaffbe2ff,
+	0x5ee3affb,
+	0xf9cc7d0f,
+	0xaef8770f,
+	0x7d0fb0c6,
+	0xeffbbfff,
+	0xcfef5ede,
+	0x7d0fbfff,
+	0x5ede4cf8,
+	0x7fddd0bf,
+	0x49f847fd,
+	0x7efdf0bb,
+	0x7fedfffd,
+	0x7dfdf0b7,
+	0xef7e7e1e,
+	0x5ede7f0e,
+	0x3a11e710,
+	0xedf0ccab,
+	0xfb18ad2e,
+	0x1ea9bbb8,
+	0x74283b7e,
+	0x73c2e4bb,
+	0x2ada4fb8,
+	0xdc21e4bb,
+	0xb2a1ffbf,
+	0x5e2c43f8,
+	0xfc87e1bb,
+	0xe74ffd91,
+	0x6f0f4fe8,
+	0xc7ba32e2,
+	0xf396efeb,
+	0x600b4f78,
+	0xe5bb760b,
+	0x53acaef8,
+	0x4ef88b0e,
+	0xcfef9e09,
+	0xabf8751f,
+	0xefef5bac,
+	0x741f4fe8,
+	0x751e760d,
+	0x7fdbf081,
+	0x741cafce,
+	0xefcc7fce,
+	0x751e70ac,
+	0x741ce7bb,
+	0x3372cfed,
+	0xafdbefeb,
+	0xe5bb760b,
+	0x53f2aef8,
+	0xafe8e7eb,
+	0x4bf8771e,
+	0x7e247fed,
+	0x4fcbe2cc,
+	0x7fbc30a9,
+	0x7b0f7a0f,
+	0x34d577fd,
+	0x308b5db7,
+	0xde553e5f,
+	0xaf78741f,
+	0x741f30f0,
+	0xcfef5e2c,
+	0x741f3eac,
+	0xafb8771e,
+	0x5e677fed,
+	0x0bd3e2cc,
+	0x741ccfec,
+	0xe5ca53cd,
+	0x6fcb4f74,
+	0x5dadde4b,
+	0x2ab63d38,
+	0x4bb3de30,
+	0x751f741c,
+	0x6c42effa,
+	0xefea7fce,
+	0x6ffc30be,
+	0xefec3fca,
+	0x30b3de2e,
+	0xadf85d9e,
+	0xaf7daefd,
+	0x5d9ede2e,
+	0x5d9eafdd,
+	0x761f10ac,
+	0x1da07efd,
+	0x30adfffe,
+	0x4908fb18,
+	0x5fffdfff,
+	0xafbb709b,
+	0x4ef85e67,
+	0xadf814ad,
+	0x7a0f70ad,
+	0xcfef50ad,
+	0x7a0fde30,
+	0x5da0afed,
+	0x3c12780f,
+	0xefef780f,
+	0xefef790f,
+	0xa7f85e0f,
+	0xffef790f,
+	0xefef790f,
+	0x14adde2e,
+	0x5d9eadfd,
+	0x5e2dfffb,
+	0xe79addfd,
+	0xeff96079,
+	0x607ae79a,
+	0xddfceff9,
+	0x60795dff,
+	0x607acfef,
+	0xefefefdf,
+	0xefbfef7f,
+	0xeeffedff,
+	0xebffe7ff,
+	0xafefafdf,
+	0xafbfaf7f,
+	0xaeffadff,
+	0xabffa7ff,
+	0x6fef6fdf,
+	0x6fbf6f7f,
+	0x6eff6dff,
+	0x6bff67ff,
+	0x2fef2fdf,
+	0x2fbf2f7f,
+	0x2eff2dff,
+	0x2bff27ff,
+	0x4e08fd1f,
+	0xe5ff6e0f,
+	0xaff87eef,
+	0x7e0ffdef,
+	0xf11f6079,
+	0xabf8f542,
+	0x7e0af11c,
+	0x37cfae3a,
+	0x7fec90be,
+	0xadf8efdc,
+	0xcfeae52f,
+	0x7d0fe12b,
+	0xf11c6079,
+	0x7e0a4df8,
+	0xcfea5dc4,
+	0x7d0befec,
+	0xcfea5dc6,
+	0xe522efdc,
+	0x5dc6cfda,
+	0x4e08fd1f,
+	0x6e0faff8,
+	0x7c1f761f,
+	0xfdeff91f,
+	0x6079abf8,
+	0x761cee24,
+	0xf91f2bfb,
+	0xefefcfec,
+	0xf91f6079,
+	0x761c27fb,
+	0xefdf5da7,
+	0xcfdc7fdd,
+	0xd09c4bf8,
+	0x47fd7c1f,
+	0x761ccfcf,
+	0x7eef7fed,
+	0x7dfdf093,
+	0xef7e7f1e,
+	0x771efb18,
+	0x6079e722,
+	0xe6bbe5bb,
+	0xae0ae5bb,
+	0x600bae85,
+	0xe2bbe2bb,
+	0xe2bbe2bb,
+	0xaf02e2bb,
+	0xe2bb2ff9,
+	0x6079e2bb
+};
+
+	/* This is from 0x2f00 to 0x2fff
+	*/
+uint patch_2f00[] = {
+	0x30303030,
+	0x3e3e3434,
+	0xabbf9b99,
+	0x4b4fbdbd,
+	0x59949334,
+	0x9fff37fb,
+	0x9b177dd9,
+	0x936956bb,
+	0xfbdd697b,
+	0xdd2fd113,
+	0x1db9f7bb,
+	0x36313963,
+	0x79373369,
+	0x3193137f,
+	0x7331737a,
+	0xf7bb9b99,
+	0x9bb19795,
+	0x77fdfd3d,
+	0x573b773f,
+	0x737933f7,
+	0xb991d115,
+	0x31699315,
+	0x31531694,
+	0xbf4fbdbd,
+	0x35931497,
+	0x35376956,
+	0xbd697b9d,
+	0x96931313,
+	0x19797937,
+	0x6935af78,
+	0xb9b3baa3,
+	0xb8788683,
+	0x368f78f7,
+	0x87778733,
+	0x3ffffb3b,
+	0x8e8f78b8,
+	0x1d118e13,
+	0xf3ff3f8b,
+	0x6bd8e173,
+	0xd1366856,
+	0x68d1687b,
+	0x3daf78b8,
+	0x3a3a3f87,
+	0x8f81378f,
+	0xf876f887,
+	0x77fd8778,
+	0x737de8d6,
+	0xbbf8bfff,
+	0xd8df87f7,
+	0xfd876f7b,
+	0x8bfff8bd,
+	0x8683387d,
+	0xb873d87b,
+	0x3b8fd7f8,
+	0xf7338883,
+	0xbb8ee1f8,
+	0xef837377,
+	0x3337b836,
+	0x817d11f8,
+	0x7378b878,
+	0xd3368b7d,
+	0xed731b7d,
+	0x833731f3,
+	0xf22f3f23
+};
+
+uint patch_2e00[] = {
+	/* This is from 0x2e00 to 0x2e3c
+	*/
+	0x27eeeeee,
+	0xeeeeeeee,
+	0xeeeeeeee,
+	0xeeeeeeee,
+	0xee4bf4fb,
+	0xdbd259bb,
+	0x1979577f,
+	0xdfd2d573,
+	0xb773f737,
+	0x4b4fbdbd,
+	0x25b9b177,
+	0xd2d17376,
+	0x956bbfdd,
+	0x697bdd2f,
+	0xff9f79ff,
+	0xff9ff22f
+};
+#endif
+
+#ifdef USE_USB_SOF_PATCH
+#define PATCH_DEFINED
+uint patch_2000[] = {
+	0x7fff0000,
+	0x7ffd0000,
+	0x7ffb0000,
+	0x49f7ba5b,
+	0xba383ffb,
+	0xf9b8b46d,
+	0xe5ab4e07,
+	0xaf77bffe,
+	0x3f7bbf79,
+	0xba5bba38,
+	0xe7676076,
+	0x60750000
+};
+
+uint patch_2f00[] = {
+	0x3030304c,
+	0xcab9e441,
+	0xa1aaf220
+};
+#endif
+
+/* Load the microcode patch.  This is called early in the CPM initialization
+ * with the controller in the reset state.  We enable the processor after
+ * we load the patch.
+ */
+void
+cpm_load_patch(volatile immap_t *immr)
+{
+#ifdef PATCH_DEFINED
+	volatile uint		*dp;
+	volatile cpm8xx_t	*commproc;
+	volatile iic_t		*iip;
+	volatile spi_t		*spp;
+	int	i;
+
+	commproc = (cpm8xx_t *)&immr->im_cpm;
+
+	/* We work closely with commproc.c.  We know it only allocates
+	 * from data only space.
+	 * For this particular patch, we only use the bottom 512 bytes
+	 * and the upper 256 byte extension.  We will use the space
+	 * starting at 1K for the relocated parameters, as the general
+	 * CPM allocation won't come from that area.
+	 */
+	commproc->cp_rccr = 0;
+
+	/* Copy the patch into DPRAM.
+	*/
+	dp = (uint *)(commproc->cp_dpmem);
+	for (i=0; i<(sizeof(patch_2000)/4); i++)
+		*dp++ = patch_2000[i];
+
+	dp = (uint *)&(commproc->cp_dpmem[0x0f00]);
+	for (i=0; i<(sizeof(patch_2f00)/4); i++)
+		*dp++ = patch_2f00[i];
+
+#ifdef USE_USB_SOF_PATCH
+#if 0 /* usb patch should not relocate iic */
+	iip = (iic_t *)&commproc->cp_dparam[PROFF_IIC];
+#define RPBASE 0x0030
+	iip->iic_rpbase = RPBASE;
+
+	/* Put SPI above the IIC, also 32-byte aligned.
+	*/
+	i = (RPBASE + sizeof(iic_t) + 31) & ~31;
+	spp = (spi_t *)&commproc->cp_dparam[PROFF_SPI];
+	spp->spi_rpbase = i;
+#endif
+
+	/* Enable uCode fetches from DPRAM. */
+	commproc->cp_rccr = 0x0009;
+
+	printk("USB uCode patch installed\n");
+#endif /* USE_USB_SOF_PATCH */
+
+#if defined(USE_SMC_PATCH) || defined(USE_IIC_PATCH)
+
+	iip = (iic_t *)&commproc->cp_dparam[PROFF_IIC];
+#define RPBASE 0x0400
+	iip->iic_rpbase = RPBASE;
+
+	/* Put SPI above the IIC, also 32-byte aligned.
+	*/
+	i = (RPBASE + sizeof(iic_t) + 31) & ~31;
+	spp = (spi_t *)&commproc->cp_dparam[PROFF_SPI];
+	spp->spi_rpbase = i;
+
+#ifdef USE_SMC_PATCH
+	dp = (uint *)&(commproc->cp_dpmem[0x0e00]);
+	for (i=0; i<(sizeof(patch_2e00)/4); i++)
+		*dp++ = patch_2e00[i];
+
+	/* Enable the traps to get to it.
+	*/
+	commproc->cp_cpmcr1 = 0x8080;
+	commproc->cp_cpmcr2 = 0x808a;
+	commproc->cp_cpmcr3 = 0x8028;
+	commproc->cp_cpmcr4 = 0x802a;
+
+	/* Enable uCode fetches from DPRAM.
+	*/
+	commproc->cp_rccr = 3;
+#endif
+
+#ifdef USE_IIC_PATCH
+	/* Enable the traps to get to it.
+	*/
+	commproc->cp_cpmcr1 = 0x802a;
+	commproc->cp_cpmcr2 = 0x8028;
+	commproc->cp_cpmcr3 = 0x802e;
+	commproc->cp_cpmcr4 = 0x802c;
+
+	/* Enable uCode fetches from DPRAM.
+	*/
+	commproc->cp_rccr = 1;
+
+	printk("I2C uCode patch installed\n");
+#endif
+
+	/* Relocate the IIC and SPI parameter areas.  These have to
+	 * aligned on 32-byte boundaries.
+	 */
+	iip = (iic_t *)&commproc->cp_dparam[PROFF_IIC];
+	iip->iic_rpbase = RPBASE;
+
+	/* Put SPI above the IIC, also 32-byte aligned.
+	*/
+	i = (RPBASE + sizeof(iic_t) + 31) & ~31;
+	spp = (spi_t *)&commproc->cp_dparam[PROFF_SPI];
+	spp->spi_rpbase = i;
+
+#endif /* USE_SMC_PATCH || USE_IIC_PATCH */
+#endif /* PATCH_DEFINED */
+}
+
+void
+verify_patch(volatile immap_t *immr)
+{
+#ifdef PATCH_DEFINED
+	volatile uint		*dp;
+	volatile cpm8xx_t	*commproc;
+	int i;
+
+	commproc = (cpm8xx_t *)&immr->im_cpm;
+
+	printk("cp_rccr %x\n", commproc->cp_rccr);
+	commproc->cp_rccr = 0;
+
+	dp = (uint *)(commproc->cp_dpmem);
+	for (i=0; i<(sizeof(patch_2000)/4); i++)
+		if (*dp++ != patch_2000[i]) {
+			printk("patch_2000 bad at %d\n", i);
+			dp--;
+			printk("found 0x%X, wanted 0x%X\n", *dp, patch_2000[i]);
+			break;
+		}
+
+	dp = (uint *)&(commproc->cp_dpmem[0x0f00]);
+	for (i=0; i<(sizeof(patch_2f00)/4); i++)
+		if (*dp++ != patch_2f00[i]) {
+			printk("patch_2f00 bad at %d\n", i);
+			dp--;
+			printk("found 0x%X, wanted 0x%X\n", *dp, patch_2f00[i]);
+			break;
+		}
+
+	commproc->cp_rccr = 0x0009;
+#endif /* PATCH_DEFINED */
+}
+
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/Makefile linux/arch/ppc/Makefile
--- v2.4.9/linux/arch/ppc/Makefile	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/Makefile	Sun Sep 16 21:25:28 2001
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.18 07/07/01 13:37:26 paulus
+# BK Id: SCCS/s.Makefile 1.21 08/19/01 20:06:47 paulus
 #
 # This file is included by the global makefile so that you can add your own
 # architecture-specific flags and dependencies. Remember to do have actions
@@ -14,6 +14,7 @@
 # Rewritten by Cort Dougan and Paul Mackerras
 #
 
+# Be sure to change PAGE_OFFSET in include/asm-ppc/page.h to match
 KERNELLOAD	=0xc0000000
 
 ifeq ($(shell uname -m),ppc)
@@ -86,6 +87,9 @@
 
 BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd
 
+# All the instructions talk about "make bzImage".
+bzImage: zImage
+
 $(BOOT_TARGETS): $(CHECKS) vmlinux
 	@$(MAKEBOOT) $@
 
@@ -99,5 +103,5 @@
 
 archmrproper:
 
-archdep:
+archdep: scripts/mkdep
 	$(MAKEBOOT) fastdep
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/amiga/config.c linux/arch/ppc/amiga/config.c
--- v2.4.9/linux/arch/ppc/amiga/config.c	Mon May 21 17:04:46 2001
+++ linux/arch/ppc/amiga/config.c	Sun Sep 16 21:22:50 2001
@@ -51,22 +51,22 @@
 unsigned char amiga_psfreq;
 struct amiga_hw_present amiga_hw_present;
 
-static const char s_a500[] __initdata = "A500";
-static const char s_a500p[] __initdata = "A500+";
-static const char s_a600[] __initdata = "A600";
-static const char s_a1000[] __initdata = "A1000";
-static const char s_a1200[] __initdata = "A1200";
-static const char s_a2000[] __initdata = "A2000";
-static const char s_a2500[] __initdata = "A2500";
-static const char s_a3000[] __initdata = "A3000";
-static const char s_a3000t[] __initdata = "A3000T";
-static const char s_a3000p[] __initdata = "A3000+";
-static const char s_a4000[] __initdata = "A4000";
-static const char s_a4000t[] __initdata = "A4000T";
-static const char s_cdtv[] __initdata = "CDTV";
-static const char s_cd32[] __initdata = "CD32";
-static const char s_draco[] __initdata = "Draco";
-static const char *amiga_models[] __initdata = {
+static char s_a500[] __initdata = "A500";
+static char s_a500p[] __initdata = "A500+";
+static char s_a600[] __initdata = "A600";
+static char s_a1000[] __initdata = "A1000";
+static char s_a1200[] __initdata = "A1200";
+static char s_a2000[] __initdata = "A2000";
+static char s_a2500[] __initdata = "A2500";
+static char s_a3000[] __initdata = "A3000";
+static char s_a3000t[] __initdata = "A3000T";
+static char s_a3000p[] __initdata = "A3000+";
+static char s_a4000[] __initdata = "A4000";
+static char s_a4000t[] __initdata = "A4000T";
+static char s_cdtv[] __initdata = "CDTV";
+static char s_cd32[] __initdata = "CD32";
+static char s_draco[] __initdata = "Draco";
+static char *amiga_models[] __initdata = {
     s_a500, s_a500p, s_a600, s_a1000, s_a1200, s_a2000, s_a2500, s_a3000,
     s_a3000t, s_a3000p, s_a4000, s_a4000t, s_cdtv, s_cd32, s_draco,
 };
@@ -760,20 +760,6 @@
 	    break;
     }
     return 0;
-}
-
-void dbprintf(const char *fmt , ...)
-{
-	static char buf[1024];
-	va_list args;
-	extern void console_print (const char *str);
-	extern int vsprintf(char * buf, const char * fmt, va_list args);
-
-	va_start(args, fmt);
-	vsprintf(buf, fmt, args);
-	va_end(args);
-
-	console_print (buf);
 }
 
 static NORET_TYPE void amiga_reset( void )
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/Makefile linux/arch/ppc/boot/Makefile
--- v2.4.9/linux/arch/ppc/boot/Makefile	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/boot/Makefile	Tue Aug 28 06:58:33 2001
@@ -12,8 +12,8 @@
 
 GZIP_FLAGS = -v9f
 
-CFLAGS	:= $(CPPFLAGS) -O2 -DSTDC_HEADERS -fno-builtin -D__BOOTER__ \
-		-I$(TOPDIR)/arch/$(ARCH)/boot/include
+CFLAGS	+= -fno-builtin -D__BOOTER__ -I$(TOPDIR)/arch/$(ARCH)/boot/include
+
 AFLAGS	+= -D__BOOTER__
 OBJCOPY_ARGS = -O elf32-powerpc
 
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/chrp/Makefile linux/arch/ppc/boot/chrp/Makefile
--- v2.4.9/linux/arch/ppc/boot/chrp/Makefile	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/boot/chrp/Makefile	Tue Aug 28 06:58:33 2001
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.10 07/19/01 09:11:27 trini
+# BK Id: SCCS/s.Makefile 1.13 07/27/01 20:24:17 trini
 #
 # Makefile for making ELF bootable images for booting on CHRP
 # using Open Firmware.
@@ -14,8 +14,6 @@
 MSIZE=
 endif
 
-CFLAGS += -fno-builtin
-
 .c.o:
 	$(CC) $(CFLAGS) -DKERNELBASE=$(KERNELBASE) -c -o $*.o $<
 .S.o:
@@ -23,7 +21,8 @@
 
 LD_ARGS = -Ttext 0x00400000
 
-OBJS = ../common/crt0.o start.o main.o misc.o ../common/string.o image.o
+OBJS = ../common/crt0.o start.o main.o misc.o ../common/string.o image.o \
+	../common/ofcommon.o
 LIBS = $(TOPDIR)/lib/lib.a ../lib/zlib.a
 ADDNOTE = ../utils/addnote
 PIGGYBACK = ../utils/piggyback
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/chrp/main.c linux/arch/ppc/boot/chrp/main.c
--- v2.4.9/linux/arch/ppc/boot/chrp/main.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/ppc/boot/chrp/main.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.main.c 1.9 06/12/01 16:42:26 paulus
+ * BK Id: SCCS/s.main.c 1.13 07/27/01 20:24:17 trini
  */
 /*
  * Copyright (C) Paul Mackerras 1997.
@@ -10,14 +10,28 @@
  * 2 of the License, or (at your option) any later version.
  */
 #include "nonstdio.h"
-#include "zlib.h"
-#include <asm/bootinfo.h>
 #include <asm/processor.h>
-#include <asm/page.h>
 
-extern void *finddevice(const char *);
+extern char _end[];
+extern char initrd_data[];
+extern char image_data[];
+extern char sysmap_data[];
 extern int getprop(void *, const char *, void *, int);
-void gunzip(void *, int, unsigned char *, int *);
+extern int initrd_len;
+extern int image_len;
+extern int sysmap_len;
+extern unsigned int heap_max;
+extern void claim(unsigned int virt, unsigned int size, unsigned int align);
+extern void *finddevice(const char *);
+extern void flush_cache(void *, unsigned long);
+extern void gunzip(void *, int, unsigned char *, int *);
+extern void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
+		unsigned int progend);
+extern void pause(void);
+
+char *avail_ram;
+char *begin_avail, *end_avail;
+char *avail_high;
 
 #define RAM_START	0x00000000
 #define RAM_END		(64<<20)
@@ -27,38 +41,28 @@
 
 #define RAM_FREE	((unsigned long)(_end+0x1000)&~0xFFF)
 #define PROG_START	0x00010000
+#define PROG_SIZE	0x00400000 /* 4MB */
 
-char *avail_ram;
-char *end_avail;
-
-extern char _end[];
-extern char image_data[];
-extern int image_len;
-extern char initrd_data[];
-extern int initrd_len;
-extern char sysmap_data[];
-extern int sysmap_len;
+#define SCRATCH_SIZE	(128 << 10)
 
-static char scratch[1024<<10];	/* 1MB of scratch space for gunzip */
+static char scratch[SCRATCH_SIZE];	/* 1MB of scratch space for gunzip */
 
+void
 chrpboot(int a1, int a2, void *prom)
 {
-    int ns, oh, i;
     unsigned sa, len;
     void *dst;
     unsigned char *im;
-    unsigned initrd_start, initrd_size;
+    unsigned initrd_start=0, initrd_size=0;
     extern char _start;
     
-    printf("chrpboot starting: loaded at 0x%x\n\r", &_start);
+    printf("chrpboot starting: loaded at 0x%p\n\r", &_start);
 
     if (initrd_len) {
 	initrd_size = initrd_len;
 	initrd_start = (RAM_END - initrd_size) & ~0xFFF;
-	a1 = initrd_start;
-	a2 = initrd_size;
 	claim(initrd_start, RAM_END - initrd_start, 0);
-	printf("initial ramdisk moving 0x%x <- 0x%x (%x bytes)\n\r",
+	printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n\r",
 	       initrd_start, initrd_data, initrd_size);
 	memcpy((char *)initrd_start, initrd_data, initrd_size);
     }
@@ -66,133 +70,31 @@
     im = image_data;
     len = image_len;
     /* claim 4MB starting at PROG_START */
-    claim(PROG_START, (4<<20) - PROG_START, 0);
+    claim(PROG_START, PROG_SIZE - PROG_START, 0);
     dst = (void *) PROG_START;
     if (im[0] == 0x1f && im[1] == 0x8b) {
 	avail_ram = scratch;
+	begin_avail = avail_high = avail_ram;
 	end_avail = scratch + sizeof(scratch);
-	printf("gunzipping (0x%x <- 0x%x:0x%0x)...", dst, im, im+len);
+	printf("gunzipping (0x%p <- 0x%p:0x%p)...", dst, im, im+len);
 	gunzip(dst, 0x400000, im, &len);
 	printf("done %u bytes\n\r", len);
+	printf("%u bytes of heap consumed, max in use %u\n\r",
+	       avail_high - begin_avail, heap_max);
     } else {
 	memmove(dst, im, len);
     }
 
     flush_cache(dst, len);
+    make_bi_recs(((unsigned long) dst + len), "chrpboot", _MACH_chrp,
+		    (PROG_START + PROG_SIZE));
     
     sa = (unsigned long)PROG_START;
     printf("start address = 0x%x\n\r", sa);
 
-    {
-	    struct bi_record *rec;
-	    
-	    rec = (struct bi_record *)_ALIGN((unsigned long)dst+len+(1<<20)-1,(1<<20));
-
-	    rec->tag = BI_FIRST;
-	    rec->size = sizeof(struct bi_record);
-	    rec = (struct bi_record *)((unsigned long)rec + rec->size);
-	    
-	    rec->tag = BI_BOOTLOADER_ID;
-	    sprintf( (char *)rec->data, "chrpboot");
-	    rec->size = sizeof(struct bi_record) + strlen("chrpboot") + 1;
-	    rec = (struct bi_record *)((unsigned long)rec + rec->size);
-	    
-	    rec->tag = BI_MACHTYPE;
-	    rec->data[0] = _MACH_chrp;
-	    rec->data[1] = 1;
-	    rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
-	    rec = (struct bi_record *)((unsigned long)rec + rec->size);
-#if 0
-	    rec->tag = BI_SYSMAP;
-	    rec->data[0] = (unsigned long)sysmap_data;
-	    rec->data[1] = sysmap_len;
-	    rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
-	    rec = (struct bi_record *)((unsigned long)rec + rec->size);
-#endif
-	    rec->tag = BI_LAST;
-	    rec->size = sizeof(struct bi_record);
-	    rec = (struct bi_record *)((unsigned long)rec + rec->size);
-    }
-    (*(void (*)())sa)(a1, a2, prom);
+    (*(void (*)())sa)(a1, a2, prom, initrd_start, initrd_size);
 
     printf("returned?\n\r");
 
     pause();
-}
-
-void *zalloc(void *x, unsigned items, unsigned size)
-{
-    void *p = avail_ram;
-
-    size *= items;
-    size = (size + 7) & -8;
-    avail_ram += size;
-    if (avail_ram > end_avail) {
-	printf("oops... out of memory\n\r");
-	pause();
-    }
-    return p;
-}
-
-void zfree(void *x, void *addr, unsigned nb)
-{
-    nb = (nb + 7) & -8;
-    if (addr == (avail_ram - nb)) {
-	avail_ram -= nb;
-    }
-}
-
-#define HEAD_CRC	2
-#define EXTRA_FIELD	4
-#define ORIG_NAME	8
-#define COMMENT		0x10
-#define RESERVED	0xe0
-
-#define DEFLATED	8
-
-void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
-{
-    z_stream s;
-    int r, i, flags;
-
-    /* skip header */
-    i = 10;
-    flags = src[3];
-    if (src[2] != DEFLATED || (flags & RESERVED) != 0) {
-	printf("bad gzipped data\n\r");
-	exit();
-    }
-    if ((flags & EXTRA_FIELD) != 0)
-	i = 12 + src[10] + (src[11] << 8);
-    if ((flags & ORIG_NAME) != 0)
-	while (src[i++] != 0)
-	    ;
-    if ((flags & COMMENT) != 0)
-	while (src[i++] != 0)
-	    ;
-    if ((flags & HEAD_CRC) != 0)
-	i += 2;
-    if (i >= *lenp) {
-	printf("gunzip: ran out of data in header\n\r");
-	exit();
-    }
-
-    s.zalloc = zalloc;
-    s.zfree = zfree;
-    r = inflateInit2(&s, -MAX_WBITS);
-    if (r != Z_OK) {
-	printf("inflateInit2 returned %d\n\r", r);
-	exit();
-    }
-    s.next_in = src + i;
-    s.avail_in = *lenp - i;
-    s.next_out = dst;
-    s.avail_out = dstlen;
-    r = inflate(&s, Z_FINISH);
-    if (r != Z_OK && r != Z_STREAM_END) {
-	printf("inflate returned %d msg: %s\n\r", r, s.msg);
-	exit();
-    }
-    *lenp = s.next_out - (unsigned char *) dst;
-    inflateEnd(&s);
 }
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/chrp/start.c linux/arch/ppc/boot/chrp/start.c
--- v2.4.9/linux/arch/ppc/boot/chrp/start.c	Thu May 24 15:02:06 2001
+++ linux/arch/ppc/boot/chrp/start.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.start.c 1.6 05/18/01 15:16:59 cort
+ * BK Id: SCCS/s.start.c 1.8 07/25/01 18:13:07 trini
  */
 /*
  * Copyright (C) Paul Mackerras 1997.
@@ -24,6 +24,9 @@
 
 void printk(char *fmt, ...);
 
+extern void chrpboot(int a1, int a2, void *prom);
+extern int strlen(const char *s);
+
 void
 start(int a1, int a2, void *promptr)
 {
@@ -91,7 +94,7 @@
 }
 
 void
-exit()
+exit(void)
 {
     struct prom_args {
 	char *service;
@@ -104,7 +107,7 @@
 }
 
 void
-pause()
+pause(void)
 {
     struct prom_args {
 	char *service;
@@ -228,7 +231,7 @@
 static int lineleft;
 
 int
-getchar()
+getchar(void)
 {
     int c;
 
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/common/crt0.S linux/arch/ppc/boot/common/crt0.S
--- v2.4.9/linux/arch/ppc/boot/common/crt0.S	Thu May 24 15:02:06 2001
+++ linux/arch/ppc/boot/common/crt0.S	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.crt0.S 1.10 05/21/01 00:49:49 cort
+ * BK Id: SCCS/s.crt0.S 1.12 08/09/01 17:09:10 paulus
  */
 /*    Copyright (c) 1997 Paul Mackerras <paulus@cs.anu.edu.au>
  *      Initial Power Macintosh COFF version.
@@ -34,7 +34,21 @@
 	.globl	__start
 __start:
 #endif
-#ifdef CONFIG_4xx
+
+	## Flush and invalidate the caches for the range in memory covering
+	## the .text section of the boot loader
+	
+	lis	r9,_start@h		# r9 = &_start
+	lis	r8,_etext@ha		# 
+	addi	r8,r8,_etext@l		# r8 = &_etext
+3:	dcbf	r0,r9			# Flush the data cache
+	icbi	r0,r9			# Invalidate the instruction cache
+	addi	r9,r9,0x10		# Increment by one cache line
+	cmplw	cr0,r9,r8		# Are we at the end yet?
+	blt	3b			# No, keep flushing and invalidating
+	sync				# sync ; isync after flushing the icache
+	isync
+
 	## Clear out the BSS as per ANSI C requirements
 
 	lis	r7,_end@ha
@@ -53,21 +67,7 @@
 	li	r0,0			# r0 = 0
 1:	stwu	r0,4(r8)		# Clear out a word
 	bdnz	1b			# If we are not done yet, keep clearing
-#endif
-
-	## Flush and invalidate the caches for the range in memory covering
-	## the .text section of the boot loader
-	
-2:	lis	r9,_start@h		# r9 = &_start
-	lis	r8,_etext@ha		# 
-	addi	r8,r8,_etext@l		# r8 = &_etext
-3:	dcbf	r0,r9			# Flush the data cache
-	icbi	r0,r9			# Invalidate the instruction cache
-	addi	r9,r9,0x10		# Increment by one cache line
-	cmplw	cr0,r9,r8		# Are we at the end yet?
-	blt	3b			# No, keep flushing and invalidating
-	sync				# sync ; isync after flushing the icache
-	isync
+2:
 
 #ifdef CONFIG_4xx
 	## Set up the stack
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/common/misc-common.c linux/arch/ppc/boot/common/misc-common.c
--- v2.4.9/linux/arch/ppc/boot/common/misc-common.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/boot/common/misc-common.c	Tue Aug 28 06:58:33 2001
@@ -31,9 +31,10 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <stdarg.h>	/* for va_ bits */
 #include <linux/config.h>
 #include "zlib.h"
-#include <linux/pci.h>
+#include "nonstdio.h"
 
 /* If we're on a ALL_PPC, assume we have a keyboard controller
  * Also note, if we're not ALL_PPC, we assume you are a serial
@@ -71,14 +72,15 @@
 void gunzip(void *, int, unsigned char *, int *);
 static int _cvt(unsigned long val, char *buf, long radix, char *digits);
 
-void _vprintk(void(*)(const char), const char *, va_list);
+void _vprintk(void(*putc)(const char), const char *fmt0, va_list ap);
+unsigned char *ISA_io = NULL;
 
 #if defined(CONFIG_SERIAL_CONSOLE)
 extern unsigned long com_port;
 
-extern int serial_tstc(volatile unsigned long com_port);
-extern unsigned char serial_getc(volatile unsigned long com_port);
-extern void serial_putc(volatile unsigned long com_port, unsigned char c);
+extern int serial_tstc(unsigned long com_port);
+extern unsigned char serial_getc(unsigned long com_port);
+extern void serial_putc(unsigned long com_port, unsigned char c);
 #endif
 
 void pause(void)
@@ -301,7 +303,6 @@
 
 #define FALSE 0
 #define TRUE  1
-#include <stdarg.h>
 
 void
 _printk(char const *fmt, ...)
@@ -528,6 +529,28 @@
 {
 	_printk("\n");
 	_dump_buf_with_offset(p, s, 0);
+}
+
+/* Very simple inb/outb routines.  We declare ISA_io to be 0 above, and
+ * then modify it on platforms which need to.  We do it like this
+ * because on some platforms we give inb/outb an exact location, and
+ * on others it's an offset from a given location. -- Tom
+ */
+
+void
+outb(int port, unsigned char val)
+{
+	/* Ensure I/O operations complete */
+	__asm__ volatile("eieio");
+	ISA_io[port] = val;
+}
+
+unsigned char
+inb(int port)
+{
+	/* Ensure I/O operations complete */
+	__asm__ volatile("eieio");
+	return (ISA_io[port]);
 }
 
 /*
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/common/misc-simple.c linux/arch/ppc/boot/common/misc-simple.c
--- v2.4.9/linux/arch/ppc/boot/common/misc-simple.c	Thu May 24 15:02:06 2001
+++ linux/arch/ppc/boot/common/misc-simple.c	Tue Aug 28 06:58:33 2001
@@ -26,6 +26,7 @@
 #include <asm/processor.h>
 #include <asm/mmu.h>
 
+#include "nonstdio.h"
 #include "zlib.h"
 
 unsigned long com_port;
@@ -47,16 +48,8 @@
 char *zimage_start;
 int zimage_size;
 
-extern void puts(const char *);
-extern void putc(const char c);
-extern void puthex(unsigned long val);
-extern void *memcpy(void * __dest, __const void * __src,
-			    __kernel_size_t __n);
 extern void gunzip(void *, int, unsigned char *, int *);
-extern void udelay(long delay);
-extern int tstc(void);
-extern int getc(void);
-extern volatile unsigned long serial_init(int chan);
+extern unsigned long serial_init(int chan);
 
 void
 decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/common/ns16550.c linux/arch/ppc/boot/common/ns16550.c
--- v2.4.9/linux/arch/ppc/boot/common/ns16550.c	Thu May 24 15:02:06 2001
+++ linux/arch/ppc/boot/common/ns16550.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.ns16550.c 1.7 05/18/01 06:20:29 patch
+ * BK Id: SCCS/s.ns16550.c 1.9 07/30/01 17:19:40 trini
  */
 /*
  * COM1 NS16550 support
@@ -10,12 +10,9 @@
 #include <linux/serial_reg.h>
 #include <asm/serial.h>
 
-/* Some machines, such as ones with a PReP memory map, initally have
- * their serial port at an offset of 0x80000000 from where they are
- * in <asm/serial.h>.  This tries to take that into account. */
-#ifndef IOOFFSET
-#define IOOFFSET 0
-#endif
+extern void outb(int port, unsigned char val);
+extern unsigned char inb(int port);
+extern unsigned long ISA_io;
 
 static struct serial_state rs_table[RS_TABLE_SIZE] = {
 	SERIAL_PORT_DFNS	/* Defined in <asm/serial.h> */
@@ -23,58 +20,67 @@
 
 static int shift;
 
-volatile unsigned long serial_init(int chan) {
+unsigned long serial_init(int chan) {
 	unsigned long com_port;
 
-	/* Get the base, and add any offset we need to deal with. */
-	com_port = rs_table[chan].port + IOOFFSET;
+	/* We need to find out which type io we're expecting.  If it's
+	 * 'SERIAL_IO_PORT', we get an offset from the isa_io_base.
+	 * If it's 'SERIAL_IO_MEM', we can the exact location.  -- Tom */
+	switch (rs_table[chan].io_type) {
+		case SERIAL_IO_PORT:
+			com_port = rs_table[chan].port;
+			break;
+		case SERIAL_IO_MEM:
+			com_port = (unsigned long)rs_table[chan].iomem_base;
+			break;
+		default:
+			/* We can't deal with it. */
+			return -1;
+	}
 
 	/* How far apart the registers are. */
 	shift = rs_table[chan].iomem_reg_shift;
 
 	/* See if port is present */
-	*((unsigned char *)com_port + (UART_LCR << shift)) = 0x00;
-	*((unsigned char *)com_port + (UART_IER << shift)) = 0x00;
+	outb(com_port + (UART_LCR << shift), 0x00);
+	outb(com_port + (UART_IER << shift), 0x00);
 	/* Access baud rate */
-	*((unsigned char *)com_port + (UART_LCR << shift)) = 0x00;
+	outb(com_port + (UART_LCR << shift), 0x80);
 #ifdef CONFIG_SERIAL_CONSOLE_NONSTD
 	/* Input clock. */
-	*((unsigned char *)com_port + (UART_DLL << shift)) = 
-			(BASE_BAUD / CONFIG_SERIAL_CONSOLE_BAUD);
-	*((unsigned char *)com_port + (UART_DLM << shift)) = 
-		(BASE_BAUD / CONFIG_SERIAL_CONSOLE_BAUD) >> 8;
+	outb(com_port + (UART_DLL << shift), 
+			(BASE_BAUD / CONFIG_SERIAL_CONSOLE_BAUD));
+	outb(com_port + (UART_DLM << shift), 
+		(BASE_BAUD / CONFIG_SERIAL_CONSOLE_BAUD) >> 8);
 #endif
 	 /* 8 data, 1 stop, no parity */
-	*((unsigned char *)com_port + (UART_LCR << shift)) = 0x03;
+	outb(com_port + (UART_LCR << shift), 0x03);
 	/* RTS/DTR */
-	*((unsigned char *)com_port + (UART_MCR << shift)) = 0x03;
+	outb(com_port + (UART_MCR << shift), 0x03);
 	/* Clear & enable FIFOs */
-	*((unsigned char *)com_port + (UART_FCR << shift)) = 0x07;
+	outb(com_port + (UART_FCR << shift), 0x07);
 
 	return (com_port);
 }
 
 void
-serial_putc(volatile unsigned long com_port, unsigned char c)
+serial_putc(unsigned long com_port, unsigned char c)
 {
-	while ((*((volatile unsigned char *)com_port + (UART_LSR << shift)) &
-				UART_LSR_THRE) == 0)
+	while ((inb(com_port + (UART_LSR << shift)) & UART_LSR_THRE) == 0)
 		;
-	*(volatile unsigned char *)com_port = c;
+	outb(com_port, c);
 }
 
 unsigned char
-serial_getc(volatile unsigned long com_port)
+serial_getc(unsigned long com_port)
 {
-	while ((*((volatile unsigned char *)com_port + (UART_LSR << shift))
-			& UART_LSR_DR) == 0)
+	while ((inb(com_port + (UART_LSR << shift)) & UART_LSR_DR) == 0)
 		;
-	return (*(volatile unsigned char *)com_port);
+	return inb(com_port);
 }
 
 int
-serial_tstc(volatile unsigned long com_port)
+serial_tstc(unsigned long com_port)
 {
-	return ((*((volatile unsigned char *)com_port + (UART_LSR << shift))
-				& UART_LSR_DR) != 0);
+	return ((inb(com_port + (UART_LSR << shift)) & UART_LSR_DR) != 0);
 }
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/common/ofcommon.c linux/arch/ppc/boot/common/ofcommon.c
--- v2.4.9/linux/arch/ppc/boot/common/ofcommon.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/boot/common/ofcommon.c	Tue Aug 28 06:58:33 2001
@@ -0,0 +1,171 @@
+/*
+ * BK Id: SCCS/s.ofcommon.c 1.1 07/27/01 20:24:18 trini
+ *
+ * Copyright (C) Paul Mackerras 1997.
+ *
+ * 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 "zlib.h"
+#include "nonstdio.h"
+#include <asm/bootinfo.h>
+#include <asm/page.h>
+
+extern int strcmp(const char *s1, const char *s2);
+extern char *avail_ram, *avail_high;
+extern char *end_avail;
+extern void claim(unsigned int virt, unsigned int size, unsigned int align);
+extern void pause(void);
+
+unsigned int heap_use, heap_max;
+
+struct memchunk {
+    unsigned int size;
+    struct memchunk *next;
+};
+
+static struct memchunk *freechunks;
+
+static void *zalloc(void *x, unsigned items, unsigned size)
+{
+    void *p;
+    struct memchunk **mpp, *mp;
+
+    size *= items;
+    size = (size + 7) & -8;
+    heap_use += size;
+    if (heap_use > heap_max)
+	heap_max = heap_use;
+    for (mpp = &freechunks; (mp = *mpp) != 0; mpp = &mp->next) {
+	if (mp->size == size) {
+	    *mpp = mp->next;
+	    return mp;
+	}
+    }
+    p = avail_ram;
+    avail_ram += size;
+    if (avail_ram > avail_high)
+	avail_high = avail_ram;
+    if (avail_ram > end_avail) {
+	printf("oops... out of memory\n\r");
+	pause();
+    }
+    return p;
+}
+
+static void zfree(void *x, void *addr, unsigned nb)
+{
+    struct memchunk *mp = addr;
+
+    nb = (nb + 7) & -8;
+    heap_use -= nb;
+    if (avail_ram == addr + nb) {
+	avail_ram = addr;
+	return;
+    }
+    mp->size = nb;
+    mp->next = freechunks;
+    freechunks = mp;
+}
+
+#define HEAD_CRC	2
+#define EXTRA_FIELD	4
+#define ORIG_NAME	8
+#define COMMENT		0x10
+#define RESERVED	0xe0
+
+#define DEFLATED	8
+
+void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
+{
+    z_stream s;
+    int r, i, flags;
+
+    /* skip header */
+    i = 10;
+    flags = src[3];
+    if (src[2] != DEFLATED || (flags & RESERVED) != 0) {
+	printf("bad gzipped data\n\r");
+	exit();
+    }
+    if ((flags & EXTRA_FIELD) != 0)
+	i = 12 + src[10] + (src[11] << 8);
+    if ((flags & ORIG_NAME) != 0)
+	while (src[i++] != 0)
+	    ;
+    if ((flags & COMMENT) != 0)
+	while (src[i++] != 0)
+	    ;
+    if ((flags & HEAD_CRC) != 0)
+	i += 2;
+    if (i >= *lenp) {
+	printf("gunzip: ran out of data in header\n\r");
+	exit();
+    }
+
+    s.zalloc = zalloc;
+    s.zfree = zfree;
+    r = inflateInit2(&s, -MAX_WBITS);
+    if (r != Z_OK) {
+	printf("inflateInit2 returned %d\n\r", r);
+	exit();
+    }
+    s.next_in = src + i;
+    s.avail_in = *lenp - i;
+    s.next_out = dst;
+    s.avail_out = dstlen;
+    r = inflate(&s, Z_FINISH);
+    if (r != Z_OK && r != Z_STREAM_END) {
+	printf("inflate returned %d msg: %s\n\r", r, s.msg);
+	exit();
+    }
+    *lenp = s.next_out - (unsigned char *) dst;
+    inflateEnd(&s);
+}
+
+/* Make a bi_rec in OF.  We need to be passed a name for BI_BOOTLOADER_ID, 
+ * a machine type for BI_MACHTYPE, and the location where the end of the
+ * bootloader is (PROG_START + PROG_SIZE)
+ */
+void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
+		unsigned long progend)
+{
+	struct bi_record *rec;
+
+	/* leave a 1MB gap then align to the next 1MB boundary */
+	addr = _ALIGN(addr+ (1<<20) - 1, (1<<20));
+	/* oldworld machine seem very unhappy about this. -- Tom */
+	if (addr >= progend)
+		claim(addr, 0x1000, 0);
+
+	rec = (struct bi_record *)addr;
+	rec->tag = BI_FIRST;
+	rec->size = sizeof(struct bi_record);
+	rec = (struct bi_record *)((unsigned long)rec + rec->size);
+
+	rec->tag = BI_BOOTLOADER_ID;
+	sprintf( (char *)rec->data, name);
+	rec->size = sizeof(struct bi_record) + strlen(name) + 1;
+	rec = (struct bi_record *)((unsigned long)rec + rec->size);
+	    
+	rec->tag = BI_MACHTYPE;
+	rec->data[0] = mach;
+	rec->data[1] = 1;
+	rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
+	rec = (struct bi_record *)((unsigned long)rec + rec->size);
+
+#ifdef SYSMAP_OFFSET
+	rec->tag = BI_SYSMAP;
+	rec->data[0] = SYSMAP_OFFSET;
+	rec->data[1] = SYSMAP_SIZE;
+	rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
+	rec = (struct bi_record *)((unsigned long)rec + rec->size);
+#endif /* SYSMAP_OFFSET */
+	
+	rec->tag = BI_LAST;
+	rec->size = sizeof(struct bi_record);
+	rec = (struct bi_record *)((unsigned long)rec + rec->size);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/include/nonstdio.h linux/arch/ppc/boot/include/nonstdio.h
--- v2.4.9/linux/arch/ppc/boot/include/nonstdio.h	Thu May 24 15:02:06 2001
+++ linux/arch/ppc/boot/include/nonstdio.h	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.nonstdio.h 1.7 05/18/01 15:17:23 cort
+ * BK Id: SCCS/s.nonstdio.h 1.9 07/25/01 18:13:07 trini
  */
 /*
  * Copyright (C) Paul Mackerras 1997.
@@ -8,14 +8,31 @@
  * 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 is sort of a catchall for I/O related functions.  Stuff that
+ * wouldn't be in 'stdio.h' normally is here, and it's 'nonstdio.h'
+ * for a reason.  -- Tom
  */
-typedef int	FILE;
+typedef int FILE;
 extern FILE *stdin, *stdout;
-#define NULL	((void *)0)
-#define EOF	(-1)
-#define fopen(n, m)	NULL
-#define fflush(f)	0
-#define fclose(f)	0
-extern char *fgets();
+#define NULL ((void *)0)
+#define EOF (-1)
+#define fopen(n, m) NULL
+#define fflush(f) 0
+#define fclose(f) 0
+#define perror(s) printf("%s: no files!\n", (s))
 
-#define perror(s)	printf("%s: no files!\n", (s))
+extern int getc(void);
+extern int printf(const char *format, ...);
+extern int strlen(const char *s);
+extern int sprintf(char *str, const char *format, ...);
+extern int tstc(void);
+extern void exit(void);
+extern void *memcpy(void *dest, const void *src, int n);
+extern void *memmove(void *dest, const void *src, int n);
+extern void outb(int port, unsigned char val);
+extern void putc(const char c);
+extern void puthex(unsigned long val);
+extern void puts(const char *);
+extern void udelay(long delay);
+extern unsigned char inb(int port);
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/mbx/misc.c linux/arch/ppc/boot/mbx/misc.c
--- v2.4.9/linux/arch/ppc/boot/mbx/misc.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/boot/mbx/misc.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.misc.c 1.11 07/18/01 15:46:50 trini
+ * BK Id: SCCS/s.misc.c 1.13 07/27/01 11:44:37 trini
  */
 /*
  * Adapted for PowerPC by Gary Thomas
@@ -23,6 +23,8 @@
 #include <asm/mpc8260.h>
 #endif
 
+#include "nonstdio.h"
+
 /*
  * The following references are needed to cause the linker to pull in the
  * gzimage.o and rdimage.o files.  These object files are special,
@@ -75,14 +77,7 @@
 char *zimage_start;
 int zimage_size;
 
-extern void puts(const char *);
-extern void putc(const char c);
-extern void udelay(long x);
-extern void puthex(unsigned long val);
-extern void * memcpy(void * __dest, __const void * __src, __kernel_size_t __n);
 extern void gunzip(void *, int, unsigned char *, int *);
-extern int tstc(void);
-extern int getc(void);
 
 unsigned long
 decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *bp)
@@ -267,33 +262,4 @@
 	puts("done.\n");
 	puts("Now booting the kernel\n");
 	return (unsigned long)hold_residual;
-}
-
-/*
- * PCI/ISA I/O support
- */
-
-volatile unsigned char *ISA_io  = (unsigned char *)0x80000000;
-volatile unsigned char *ISA_mem = (unsigned char *)0xC0000000;
-
-void
-outb(int port, char val)
-{
-	/* Ensure I/O operations complete */
-	__asm__ volatile("eieio");
-	ISA_io[port] = val;
-}
-
-unsigned char
-inb(int port)
-{
-	/* Ensure I/O operations complete */
-	__asm__ volatile("eieio");
-	return (ISA_io[port]);
-}
-
-unsigned long
-local_to_PCI(unsigned long addr)
-{
-	return ((addr & 0x7FFFFFFF) | 0x80000000);
 }
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/pmac/Makefile linux/arch/ppc/boot/pmac/Makefile
--- v2.4.9/linux/arch/ppc/boot/pmac/Makefile	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/boot/pmac/Makefile	Tue Aug 28 06:58:33 2001
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.12 07/19/01 09:11:28 trini
+# BK Id: SCCS/s.Makefile 1.14 07/27/01 20:24:17 trini
 #
 # Makefile for making XCOFF bootable images for booting on PowerMacs
 # using Open Firmware.
@@ -12,12 +12,10 @@
 COFF_LD_ARGS = -e _start -T ld.script -Ttext 500000 -Tdata 510000 -Bstatic
 CHRP_LD_ARGS = -Ttext 0x01000000
 
-COMMONOBJS = start.o misc.o ../common/string.o image.o
+COMMONOBJS = start.o misc.o ../common/string.o image.o ../common/ofcommon.o
 COFFOBJS = ../common/coffcrt0.o $(COMMONOBJS) coffmain.o
 CHRPOBJS = ../common/crt0.o $(COMMONOBJS) chrpmain.o
 LIBS = $(TOPDIR)/lib/lib.a ../lib/zlib.a
-
-CFLAGS += -fno-builtin
 
 MKNOTE := ../utils/mknote
 SIZE := ../utils/size
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/pmac/chrpmain.c linux/arch/ppc/boot/pmac/chrpmain.c
--- v2.4.9/linux/arch/ppc/boot/pmac/chrpmain.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/ppc/boot/pmac/chrpmain.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.chrpmain.c 1.12 06/12/01 16:42:26 paulus
+ * BK Id: SCCS/s.chrpmain.c 1.16 07/27/01 20:24:18 trini
  */
 /*
  * Copyright (C) Paul Mackerras 1997.
@@ -11,21 +11,26 @@
  */
 #include "nonstdio.h"
 #include "zlib.h"
-#include <asm/bootinfo.h>
 #include <asm/processor.h>
-#include <asm/page.h>
 
-extern void *finddevice(const char *);
+extern char _end[];
+extern char image_data[], initrd_data[];
+extern int image_len, initrd_len;
 extern int getprop(void *, const char *, void *, int);
+extern unsigned int heap_max;
 extern void *claim(unsigned int, unsigned int, unsigned int);
+extern void *finddevice(const char *);
+extern void flush_cache(void *start, unsigned int len);
+extern void gunzip(void *, int, unsigned char *, int *);
+extern void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
+		unsigned int progend);
+extern void pause(void);
 extern void release(void *ptr, unsigned int len);
-void make_bi_recs(unsigned long);
-void gunzip(void *, int, unsigned char *, int *);
-void stop_imac_ethernet(void);
-void stop_imac_usb(void);
 
-#define get_16be(x)	(*(unsigned short *)(x))
-#define get_32be(x)	(*(unsigned *)(x))
+char *avail_ram;
+char *begin_avail, *end_avail;
+char *avail_high;
+
 
 #define RAM_END		(16 << 20)
 
@@ -34,36 +39,22 @@
 
 #define SCRATCH_SIZE	(128 << 10)
 
-char *avail_ram;
-char *begin_avail, *end_avail;
-char *avail_high;
-unsigned int heap_use;
-unsigned int heap_max;
-
-extern char _end[];
-extern char image_data[];
-extern int image_len;
-extern char initrd_data[];
-extern int initrd_len;
-
-
-boot(int a1, int a2, void *prom)
+void boot(int a1, int a2, void *prom)
 {
-    int ns, oh, i;
     unsigned sa, len;
     void *dst;
     unsigned char *im;
     unsigned initrd_start, initrd_size;
     extern char _start;
     
-    printf("chrpboot starting: loaded at 0x%x\n", &_start);
+    printf("chrpboot starting: loaded at 0x%p\n", &_start);
     if (initrd_len) {
 	initrd_size = initrd_len;
 	initrd_start = (RAM_END - initrd_size) & ~0xFFF;
 	a1 = initrd_start;
 	a2 = initrd_size;
 	claim(initrd_start, RAM_END - initrd_start, 0);
-	printf("initial ramdisk moving 0x%x <- 0x%x (%x bytes)\n", initrd_start,
+	printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n", initrd_start,
 	       initrd_data,initrd_size);
 	memcpy((char *)initrd_start, initrd_data, initrd_size);
     }
@@ -77,8 +68,8 @@
 	avail_ram = (char *) claim(0, SCRATCH_SIZE, 0x10);
 	begin_avail = avail_high = avail_ram;
 	end_avail = avail_ram + SCRATCH_SIZE;
-	printf("heap at 0x%x\n", avail_ram);
-	printf("gunzipping (0x%x <- 0x%x:0x%0x)...", dst, im, im+len);
+	printf("heap at 0x%p\n", avail_ram);
+	printf("gunzipping (0x%p <- 0x%p:0x%p)...", dst, im, im+len);
 	gunzip(dst, PROG_SIZE, im, &len);
 	printf("done %u bytes\n", len);
 	printf("%u bytes of heap consumed, max in use %u\n",
@@ -89,7 +80,8 @@
     }
 
     flush_cache(dst, len);
-    make_bi_recs((unsigned long) dst + len);
+    make_bi_recs(((unsigned long) dst + len), "chrpboot", _MACH_Pmac,
+		    (PROG_START + PROG_SIZE));
 
     sa = (unsigned long)PROG_START;
     printf("start address = 0x%x\n", sa);
@@ -99,199 +91,4 @@
     printf("returned?\n");
 
     pause();
-}
-
-void make_bi_recs(unsigned long addr)
-{
-	struct bi_record *rec;
-
-	/* leave a 1MB gap then align to the next 1MB boundary */
-	addr = _ALIGN(addr+ (1<<20) - 1, (1<<20));
-	if (addr >= PROG_START + PROG_SIZE)
-		claim(addr, 0x1000, 0);
-
-	rec = (struct bi_record *)addr;
-	rec->tag = BI_FIRST;
-	rec->size = sizeof(struct bi_record);
-	rec = (struct bi_record *)((unsigned long)rec + rec->size);
-
-	rec->tag = BI_BOOTLOADER_ID;
-	sprintf( (char *)rec->data, "coffboot");
-	rec->size = sizeof(struct bi_record) + strlen("coffboot") + 1;
-	rec = (struct bi_record *)((unsigned long)rec + rec->size);
-	    
-	rec->tag = BI_MACHTYPE;
-	rec->data[0] = _MACH_Pmac;
-	rec->data[1] = 1;
-	rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
-	rec = (struct bi_record *)((unsigned long)rec + rec->size);
-
-#ifdef SYSMAP_OFFSET
-	rec->tag = BI_SYSMAP;
-	rec->data[0] = SYSMAP_OFFSET;
-	rec->data[1] = SYSMAP_SIZE;
-	rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
-	rec = (struct bi_record *)((unsigned long)rec + rec->size);
-#endif /* SYSMAP_OFFSET */
-	
-	rec->tag = BI_LAST;
-	rec->size = sizeof(struct bi_record);
-	rec = (struct bi_record *)((unsigned long)rec + rec->size);
-}
-
-#if 0
-#define eieio()	asm volatile("eieio");
-
-void stop_imac_ethernet(void)
-{
-    void *macio, *enet;
-    unsigned int macio_addr[5], enet_reg[6];
-    int len;
-    volatile unsigned int *dbdma;
-
-    macio = finddevice("/pci/mac-io");
-    enet = finddevice("/pci/mac-io/ethernet");
-    if (macio == NULL || enet == NULL)
-	return;
-    len = getprop(macio, "assigned-addresses", macio_addr, sizeof(macio_addr));
-    if (len != sizeof(macio_addr))
-	return;
-    len = getprop(enet, "reg", enet_reg, sizeof(enet_reg));
-    if (len != sizeof(enet_reg))
-	return;
-    printf("macio base %x, dma at %x & %x\n",
-	   macio_addr[2], enet_reg[2], enet_reg[4]);
-
-    /* hope this is mapped... */
-    dbdma = (volatile unsigned int *) (macio_addr[2] + enet_reg[2]);
-    *dbdma = 0x80;	/* clear the RUN bit */
-    eieio();
-    dbdma = (volatile unsigned int *) (macio_addr[2] + enet_reg[4]);
-    *dbdma = 0x80;	/* clear the RUN bit */
-    eieio();
-}
-
-void stop_imac_usb(void)
-{
-    void *usb;
-    unsigned int usb_addr[5];
-    int len;
-    volatile unsigned int *usb_ctrl;
-
-    usb = finddevice("/pci/usb");
-    if (usb == NULL)
-	return;
-    len = getprop(usb, "assigned-addresses", usb_addr, sizeof(usb_addr));
-    if (len != sizeof(usb_addr))
-	return;
-    printf("usb base %x\n", usb_addr[2]);
-
-    usb_ctrl = (volatile unsigned int *) (usb_addr[2] + 8);
-    *usb_ctrl = 0x01000000;	/* cpu_to_le32(1) */
-    eieio();
-}
-#endif
-
-struct memchunk {
-    unsigned int size;
-    struct memchunk *next;
-};
-
-static struct memchunk *freechunks;
-
-void *zalloc(void *x, unsigned items, unsigned size)
-{
-    void *p;
-    struct memchunk **mpp, *mp;
-
-    size *= items;
-    size = (size + 7) & -8;
-    heap_use += size;
-    if (heap_use > heap_max)
-	heap_max = heap_use;
-    for (mpp = &freechunks; (mp = *mpp) != 0; mpp = &mp->next) {
-	if (mp->size == size) {
-	    *mpp = mp->next;
-	    return mp;
-	}
-    }
-    p = avail_ram;
-    avail_ram += size;
-    if (avail_ram > avail_high)
-	avail_high = avail_ram;
-    if (avail_ram > end_avail) {
-	printf("oops... out of memory\n");
-	pause();
-    }
-    return p;
-}
-
-void zfree(void *x, void *addr, unsigned nb)
-{
-    struct memchunk *mp = addr;
-
-    nb = (nb + 7) & -8;
-    heap_use -= nb;
-    if (avail_ram == addr + nb) {
-	avail_ram = addr;
-	return;
-    }
-    mp->size = nb;
-    mp->next = freechunks;
-    freechunks = mp;
-}
-
-#define HEAD_CRC	2
-#define EXTRA_FIELD	4
-#define ORIG_NAME	8
-#define COMMENT		0x10
-#define RESERVED	0xe0
-
-#define DEFLATED	8
-
-void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
-{
-    z_stream s;
-    int r, i, flags;
-
-    /* skip header */
-    i = 10;
-    flags = src[3];
-    if (src[2] != DEFLATED || (flags & RESERVED) != 0) {
-	printf("bad gzipped data\n");
-	exit();
-    }
-    if ((flags & EXTRA_FIELD) != 0)
-	i = 12 + src[10] + (src[11] << 8);
-    if ((flags & ORIG_NAME) != 0)
-	while (src[i++] != 0)
-	    ;
-    if ((flags & COMMENT) != 0)
-	while (src[i++] != 0)
-	    ;
-    if ((flags & HEAD_CRC) != 0)
-	i += 2;
-    if (i >= *lenp) {
-	printf("gunzip: ran out of data in header\n");
-	exit();
-    }
-
-    s.zalloc = zalloc;
-    s.zfree = zfree;
-    r = inflateInit2(&s, -MAX_WBITS);
-    if (r != Z_OK) {
-	printf("inflateInit2 returned %d\n", r);
-	exit();
-    }
-    s.next_in = src + i;
-    s.avail_in = *lenp - i;
-    s.next_out = dst;
-    s.avail_out = dstlen;
-    r = inflate(&s, Z_FINISH);
-    if (r != Z_OK && r != Z_STREAM_END) {
-	printf("inflate returned %d msg: %s\n", r, s.msg);
-	exit();
-    }
-    *lenp = s.next_out - (unsigned char *) dst;
-    inflateEnd(&s);
 }
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/pmac/coffmain.c linux/arch/ppc/boot/pmac/coffmain.c
--- v2.4.9/linux/arch/ppc/boot/pmac/coffmain.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/ppc/boot/pmac/coffmain.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.coffmain.c 1.12 06/12/01 16:42:26 paulus
+ * BK Id: SCCS/s.coffmain.c 1.14 07/27/01 20:24:18 trini
  */
 /*
  * Copyright (C) Paul Mackerras 1997.
@@ -11,18 +11,25 @@
  */
 #include "nonstdio.h"
 #include "zlib.h"
-#include <asm/bootinfo.h>
 #include <asm/processor.h>
-#include <asm/page.h>
 
-extern void *finddevice(const char *);
-extern int getprop(void *, const char *, void *, int);
+extern char _start[], _end[];
 extern char *claim(unsigned, unsigned, unsigned);
-void make_bi_recs(unsigned long);
-void gunzip(void *, int, unsigned char *, int *);
+extern char image_data[], initrd_data[];
+extern int initrd_len, image_len;
+extern int getprop(void *, const char *, void *, int);
+extern unsigned int heap_max;
+extern void *finddevice(const char *);
+extern void flush_cache(void *start, unsigned int len);
+extern void gunzip(void *, int, unsigned char *, int *);
+extern void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
+		unsigned int progend);
+extern void pause(void);
+extern void setup_bats(unsigned long start);
 
-#define get_16be(x)	(*(unsigned short *)(x))
-#define get_32be(x)	(*(unsigned *)(x))
+char *avail_ram;
+char *begin_avail, *end_avail;
+char *avail_high;
 
 #define RAM_START	0
 #define RAM_END		(RAM_START + 0x800000)	/* only 8M mapped with BATs */
@@ -32,29 +39,16 @@
 
 #define SCRATCH_SIZE	(128 << 10)
 
-char *avail_ram;
-char *begin_avail, *end_avail;
-char *avail_high;
-unsigned int heap_use;
-unsigned int heap_max;
-
-extern char _start[], _end[];
-extern char image_data[];
-extern int image_len;
-extern char initrd_data[];
-extern int initrd_len;
+static char heap[SCRATCH_SIZE];
 
-char heap[SCRATCH_SIZE];
-
-boot(int a1, int a2, void *prom)
+void boot(int a1, int a2, void *prom)
 {
-    int ns, oh, i;
     unsigned sa, len;
     void *dst;
     unsigned char *im;
     unsigned initrd_start, initrd_size;
     
-    printf("coffboot starting: loaded at 0x%x\n", _start);
+    printf("coffboot starting: loaded at 0x%p\n", &_start);
     setup_bats(RAM_START);
     if (initrd_len) {
 	initrd_size = initrd_len;
@@ -62,21 +56,21 @@
 	a1 = initrd_start;
 	a2 = initrd_size;
 	claim(initrd_start - RAM_START, RAM_END - initrd_start, 0);
-	printf("initial ramdisk moving 0x%x <- 0x%x (%x bytes)\n",
+	printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n",
 	       initrd_start, initrd_data, initrd_size);
 	memcpy((char *)initrd_start, initrd_data, initrd_size);
     }
     im = image_data;
     len = image_len;
-    /* claim 3MB starting at 0 */
+    /* claim 4MB starting at 0 */
     claim(0, PROG_SIZE, 0);
     dst = (void *) RAM_START;
     if (im[0] == 0x1f && im[1] == 0x8b) {
 	/* set up scratch space */
 	begin_avail = avail_high = avail_ram = heap;
 	end_avail = heap + sizeof(heap);
-	printf("heap at 0x%x\n", avail_ram);
-	printf("gunzipping (0x%x <- 0x%x:0x%0x)...", dst, im, im+len);
+	printf("heap at 0x%p\n", avail_ram);
+	printf("gunzipping (0x%p <- 0x%p:0x%p)...", dst, im, im+len);
 	gunzip(dst, PROG_SIZE, im, &len);
 	printf("done %u bytes\n", len);
 	printf("%u bytes of heap consumed, max in use %u\n",
@@ -86,8 +80,9 @@
     }
 
     flush_cache(dst, len);
-    make_bi_recs((unsigned long)dst + len);
-    
+    make_bi_recs(((unsigned long) dst + len), "coffboot", _MACH_Pmac,
+		    (PROG_START + PROG_SIZE));
+
     sa = (unsigned long)PROG_START;
     printf("start address = 0x%x\n", sa);
 
@@ -96,139 +91,4 @@
     printf("returned?\n");
 
     pause();
-}
-
-void make_bi_recs(unsigned long addr)
-{
-	struct bi_record *rec;
-
-	addr = _ALIGN(addr+ (1<<20) - 1, (1<<20));
-#if 0
-	if (addr >= PROG_START + PROG_SIZE)
-		claim(addr, 0x1000, 0);
-#endif
-
-	rec = (struct bi_record *)addr;
-	rec->tag = BI_FIRST;
-	rec->size = sizeof(struct bi_record);
-	rec = (struct bi_record *)((unsigned long)rec + rec->size);
-
-	rec->tag = BI_BOOTLOADER_ID;
-	sprintf( (char *)rec->data, "coffboot");
-	rec->size = sizeof(struct bi_record) + strlen("coffboot") + 1;
-	rec = (struct bi_record *)((unsigned long)rec + rec->size);
-
-	rec->tag = BI_MACHTYPE;
-	rec->data[0] = _MACH_Pmac;
-	rec->data[1] = 1;
-	rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
-	rec = (struct bi_record *)((unsigned long)rec + rec->size);
-
-	rec->tag = BI_LAST;
-	rec->size = sizeof(struct bi_record);
-	rec = (struct bi_record *)((unsigned long)rec + rec->size);
-}
-
-struct memchunk {
-    unsigned int size;
-    struct memchunk *next;
-};
-
-static struct memchunk *freechunks;
-
-void *zalloc(void *x, unsigned items, unsigned size)
-{
-    void *p;
-    struct memchunk **mpp, *mp;
-
-    size *= items;
-    size = (size + 7) & -8;
-    heap_use += size;
-    if (heap_use > heap_max)
-	heap_max = heap_use;
-    for (mpp = &freechunks; (mp = *mpp) != 0; mpp = &mp->next) {
-	if (mp->size == size) {
-	    *mpp = mp->next;
-	    return mp;
-	}
-    }
-    p = avail_ram;
-    avail_ram += size;
-    if (avail_ram > avail_high)
-	avail_high = avail_ram;
-    if (avail_ram > end_avail) {
-	printf("oops... out of memory\n");
-	pause();
-    }
-    return p;
-}
-
-void zfree(void *x, void *addr, unsigned nb)
-{
-    struct memchunk *mp = addr;
-
-    nb = (nb + 7) & -8;
-    heap_use -= nb;
-    if (avail_ram == addr + nb) {
-	avail_ram = addr;
-	return;
-    }
-    mp->size = nb;
-    mp->next = freechunks;
-    freechunks = mp;
-}
-
-#define HEAD_CRC	2
-#define EXTRA_FIELD	4
-#define ORIG_NAME	8
-#define COMMENT		0x10
-#define RESERVED	0xe0
-
-#define DEFLATED	8
-
-void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
-{
-    z_stream s;
-    int r, i, flags;
-
-    /* skip header */
-    i = 10;
-    flags = src[3];
-    if (src[2] != DEFLATED || (flags & RESERVED) != 0) {
-	printf("bad gzipped data\n");
-	exit();
-    }
-    if ((flags & EXTRA_FIELD) != 0)
-	i = 12 + src[10] + (src[11] << 8);
-    if ((flags & ORIG_NAME) != 0)
-	while (src[i++] != 0)
-	    ;
-    if ((flags & COMMENT) != 0)
-	while (src[i++] != 0)
-	    ;
-    if ((flags & HEAD_CRC) != 0)
-	i += 2;
-    if (i >= *lenp) {
-	printf("gunzip: ran out of data in header\n");
-	exit();
-    }
-
-    s.zalloc = zalloc;
-    s.zfree = zfree;
-    r = inflateInit2(&s, -MAX_WBITS);
-    if (r != Z_OK) {
-	printf("inflateInit2 returned %d\n", r);
-	exit();
-    }
-    s.next_in = src + i;
-    s.avail_in = *lenp - i;
-    s.next_out = dst;
-    s.avail_out = dstlen;
-    r = inflate(&s, Z_FINISH);
-    if (r != Z_OK && r != Z_STREAM_END) {
-	printf("inflate returned %d msg: %s\n", r, s.msg);
-	exit();
-    }
-    *lenp = s.next_out - (unsigned char *) dst;
-    inflateEnd(&s);
 }
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/pmac/start.c linux/arch/ppc/boot/pmac/start.c
--- v2.4.9/linux/arch/ppc/boot/pmac/start.c	Thu May 24 15:02:07 2001
+++ linux/arch/ppc/boot/pmac/start.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.start.c 1.8 05/18/01 15:17:15 cort
+ * BK Id: SCCS/s.start.c 1.10 07/25/01 18:13:07 trini
  */
 /*
  * Copyright (C) Paul Mackerras 1997.
@@ -11,6 +11,9 @@
  */
 #include <stdarg.h>
 
+extern int strlen(const char *s);
+extern void boot(int a1, int a2, void *prom);
+
 int (*prom)();
 
 void *chosen_handle;
@@ -109,7 +112,7 @@
 }
 
 void
-exit()
+exit(void)
 {
     struct prom_args {
 	char *service;
@@ -122,7 +125,7 @@
 }
 
 void
-pause()
+pause(void)
 {
     struct prom_args {
 	char *service;
@@ -243,7 +246,7 @@
 }
 
 int
-readchar()
+readchar(void)
 {
     char ch;
 
@@ -263,7 +266,7 @@
 static int lineleft;
 
 int
-getchar()
+getchar(void)
 {
     int c;
 
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/prep/Makefile linux/arch/ppc/boot/prep/Makefile
--- v2.4.9/linux/arch/ppc/boot/prep/Makefile	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/boot/prep/Makefile	Tue Aug 28 06:58:33 2001
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.19 07/19/01 09:11:28 trini
+# BK Id: SCCS/s.Makefile 1.24 08/01/01 13:25:40 trini
 #
 # arch/ppc/boot/Makefile
 #
@@ -17,8 +17,6 @@
 
 USE_STANDARD_AS_RULE		:= true
 
-CFLAGS				+= -fno-builtin
-
 ifeq ($(CONFIG_SMP),y)
 TFTPIMAGE			= /tftpboot/zImage.prep.smp
 else
@@ -32,7 +30,7 @@
 OBJCOPY_ARGS			= -O elf32-powerpc
 LIBS 				= ../lib/zlib.a
 
-obj-$(CONFIG_SERIAL_CONSOLE)	+= ns16550.o
+obj-$(CONFIG_SERIAL_CONSOLE)	+= ../common/ns16550.o
 obj-$(CONFIG_VGA_CONSOLE)	+= vreset.o kbd.o
 
 # Tools
@@ -45,9 +43,6 @@
 misc.o: misc.c
 	$(CC) $(CFLAGS) -DINITRD_OFFSET=0 -DINITRD_SIZE=0 -DZIMAGE_OFFSET=0 \
 		-DZIMAGE_SIZE=0 -c -o $@ $*.c
-
-ns16550.o: ../common/ns16550.c
-	$(CC) $(CFLAGS) -DIOOFFSET=0x80000000 -c -o $@ ../common/$*.c
 
 zvmlinux.initrd: zvmlinux ../images/vmlinux.gz
 	$(LD) $(ZLINKFLAGS) -o $@.tmp $(obj-y) $(LIBS)
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/prep/head.S linux/arch/ppc/boot/prep/head.S
--- v2.4.9/linux/arch/ppc/boot/prep/head.S	Thu May 24 15:02:07 2001
+++ linux/arch/ppc/boot/prep/head.S	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.head.S 1.8 05/18/01 06:20:29 patch
+ * BK Id: SCCS/s.head.S 1.11 07/31/01 16:36:06 trini
  */
 #include "../../kernel/ppc_defs.h"
 #include "../../kernel/ppc_asm.tmpl"
@@ -95,6 +95,11 @@
 	subi	r1,r1,256
 	li	r2,0x000F		/* Mask pointer to 16-byte boundary */
 	andc	r1,r1,r2
+/* Setup ISA_io */
+	lis	r3,ISA_io@h
+	ori	r3,r3,ISA_io@l
+	lis	r4,0x8000
+	stw	r4,0(r3)
 /* Run loader */
 	mr	r3,r8			/* Load point */
 	mr	r4,r7			/* Program length */
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/prep/misc.c linux/arch/ppc/boot/prep/misc.c
--- v2.4.9/linux/arch/ppc/boot/prep/misc.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/ppc/boot/prep/misc.c	Tue Aug 28 06:58:33 2001
@@ -1,8 +1,7 @@
 /*
- * BK Id: SCCS/s.misc.c 1.14 06/16/01 20:43:20 trini
- */
-/*
- * misc.c
+ * BK Id: SCCS/s.misc.c 1.18 07/30/01 17:19:40 trini
+ *
+ * arch/ppc/boot/prep/misc.c
  *
  * Adapted for PowerPC by Gary Thomas
  *
@@ -11,7 +10,6 @@
  */
 
 #include <linux/types.h>
-#include "zlib.h"
 #include <asm/residual.h>
 #include <linux/config.h>
 #include <linux/threads.h>
@@ -22,9 +20,8 @@
 #include <asm/bootinfo.h>
 #include <asm/mmu.h>
 #include <asm/byteorder.h>
-#if defined(CONFIG_SERIAL_CONSOLE)
-unsigned long com_port;
-#endif /* CONFIG_SERIAL_CONSOLE */
+#include "nonstdio.h"
+#include "zlib.h"
 
 /*
  * Please send me load/board info and such data for hardware not
@@ -53,26 +50,28 @@
 char *zimage_start;
 int zimage_size;
 
+#if defined(CONFIG_SERIAL_CONSOLE)
+unsigned long com_port;
+#endif /* CONFIG_SERIAL_CONSOLE */
+#ifdef CONFIG_VGA_CONSOLE
 char *vidmem = (char *)0xC00B8000;
-int lines, cols;
-int orig_x, orig_y;
+int lines = 25, cols = 80;
+int orig_x, orig_y = 24;
+#endif /* CONFIG_VGA_CONSOLE */
 
-extern void puts(const char *);
-extern void putc(const char c);
-extern int tstc(void);
-extern int getc(void);
-extern void puthex(unsigned long val);
-extern void * memcpy(void * __dest, __const void * __src, __kernel_size_t __n);
 extern int CRT_tstc(void);
 extern void of_init(void *handler);
 extern int of_finddevice(const char *device_specifier, int *phandle);
 extern int of_getprop(int phandle, const char *name, void *buf, int buflen, 
 		int *size);
-extern __kernel_size_t strlen(const char *s);
 extern int vga_init(unsigned char *ISA_mem);
-extern void udelay(long x);
-void gunzip(void *, int, unsigned char *, int *);
-unsigned char inb(int);
+extern void gunzip(void *, int, unsigned char *, int *);
+
+extern void _put_HID0(unsigned int val);
+extern void _put_MSR(unsigned int val);
+extern unsigned int _get_HID0(void);
+extern unsigned int _get_MSR(void);
+extern unsigned long serial_init(int chan);
 
 void
 writel(unsigned int val, unsigned int address)
@@ -105,7 +104,7 @@
 
 #ifdef CONFIG_VGA_CONSOLE
 void
-scroll()
+scroll(void)
 {
 	int i;
 
@@ -120,7 +119,7 @@
  * Motorola dual processor platforms.  
  */
 void
-park_cpus()
+park_cpus(void)
 {
 	volatile void (*go)(RESIDUAL *, int, int, char *, int);
 	unsigned int i;
@@ -154,11 +153,6 @@
 	unsigned char base_mod;
 	int start_multi = 0;
 	unsigned int pci_viddid, pci_did, tulip_pci_base, tulip_base;
-
-	lines = 25;
-	cols = 80;
-	orig_x = 0;
-	orig_y = 24;
 	
 	/*
 	 * IBM's have the MMU on, so we have to disable it or
@@ -438,28 +432,8 @@
 /*
  * PCI/ISA I/O support
  */
-
-volatile unsigned char *ISA_io  = (unsigned char *)0x80000000;
-volatile unsigned char *ISA_mem = (unsigned char *)0xC0000000;
-
-void
-outb(int port, char val)
-{
-	/* Ensure I/O operations complete */
-	__asm__ volatile("eieio");
-	ISA_io[port] = val;
-}
-
-unsigned char
-inb(int port)
-{
-	/* Ensure I/O operations complete */
-	__asm__ volatile("eieio");
-	return (ISA_io[port]);
-}
-
 unsigned long
 local_to_PCI(unsigned long addr)
 {
-	return ((addr & 0x7FFFFFFF) | 0x80000000);
+	return (addr | 0x80000000);
 }
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/boot/prep/vreset.c linux/arch/ppc/boot/prep/vreset.c
--- v2.4.9/linux/arch/ppc/boot/prep/vreset.c	Thu May 24 15:02:07 2001
+++ linux/arch/ppc/boot/prep/vreset.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.vreset.c 1.9 05/18/01 06:20:29 patch
+ * BK Id: SCCS/s.vreset.c 1.11 07/25/01 18:13:07 trini
  */
 /*
  * vreset.c
@@ -22,12 +22,10 @@
  */
 
 #include "iso_font.h"
+#include "nonstdio.h"
 
 extern char *vidmem;
 extern int lines, cols;
-extern void udelay(long x);
-extern void outb(int port, char val);
-extern unsigned char inb(int port);
 struct VaRegs;
 
 /*
@@ -43,7 +41,7 @@
 void unlockVideo(int slot);
 void setTextRegs(struct VgaRegs *svp);
 void setTextCLUT(int shift);
-void clearVideoMemory();
+void clearVideoMemory(void);
 void loadFont(unsigned char *ISA_mem);
 
 static void mdelay(int ms)
@@ -59,100 +57,100 @@
 #define NREGS 54
 #define ENDMK  0xFFFF  /* End marker */
 
-#define S3Vendor        0x5333
+#define S3Vendor	0x5333
 #define CirrusVendor    0x1013
 #define DiamondVendor   0x100E
 #define MatroxVendor    0x102B
 #define ParadiseVendor  0x101C
 
 struct VgaRegs GenVgaTextRegs[NREGS+1] = {
-/*      port    index   value  */
-  /* SR Regs */
-        0x3c4,  0x1,    0x0,
-        0x3c4,  0x2,    0x3,
-        0x3c4,  0x3,    0x0,
-        0x3c4,  0x4,    0x2,
-   /* CR Regs */
-        0x3d4,  0x0,    0x5f,
-        0x3d4,  0x1,    0x4f,
-        0x3d4,  0x2,    0x50,
-        0x3d4,  0x3,    0x82,
-        0x3d4,  0x4,    0x55,
-        0x3d4,  0x5,    0x81,
-        0x3d4,  0x6,    0xbf,
-        0x3d4,  0x7,    0x1f,
-        0x3d4,  0x8,    0x00,
-        0x3d4,  0x9,    0x4f,
-        0x3d4,  0xa,    0x0d,
-        0x3d4,  0xb,    0x0e,
-        0x3d4,  0xc,    0x00,
-        0x3d4,  0xd,    0x00,
-        0x3d4,  0xe,    0x00,
-        0x3d4,  0xf,    0x00,
-        0x3d4,  0x10,   0x9c,
-        0x3d4,  0x11,   0x8e,
-        0x3d4,  0x12,   0x8f,
-        0x3d4,  0x13,   0x28,
-        0x3d4,  0x14,   0x1f,
-        0x3d4,  0x15,   0x96,
-        0x3d4,  0x16,   0xb9,
-        0x3d4,  0x17,   0xa3,
-   /* GR Regs */
-        0x3ce,  0x0,    0x0,
-        0x3ce,  0x1,    0x0,
-        0x3ce,  0x2,    0x0,
-        0x3ce,  0x3,    0x0,
-        0x3ce,  0x4,    0x0,
-        0x3ce,  0x5,    0x10,
-        0x3ce,  0x6,    0xe,
-        0x3ce,  0x7,    0x0,
-        0x3ce,  0x8,    0xff,
-        ENDMK
+	/* port		index	value  */
+	/* SR Regs */
+	{ 0x3c4,	0x1,	0x0 },
+	{ 0x3c4,	0x2,	0x3 },
+	{ 0x3c4,	0x3,	0x0 },
+	{ 0x3c4,	0x4,	0x2 },
+	 /* CR Regs */
+	{ 0x3d4,	0x0,	0x5f },
+	{ 0x3d4,	0x1,	0x4f },
+	{ 0x3d4,	0x2,	0x50 },
+	{ 0x3d4,	0x3,	0x82 },
+	{ 0x3d4,	0x4,	0x55 },
+	{ 0x3d4,	0x5,	0x81 },
+	{ 0x3d4,	0x6,	0xbf },
+	{ 0x3d4,	0x7,	0x1f },
+	{ 0x3d4,	0x8,	0x00 },
+	{ 0x3d4,	0x9,	0x4f },
+	{ 0x3d4,	0xa,	0x0d },
+	{ 0x3d4,	0xb,	0x0e },
+	{ 0x3d4,	0xc,	0x00 },
+	{ 0x3d4,	0xd,	0x00 },
+	{ 0x3d4,	0xe,	0x00 },
+	{ 0x3d4,	0xf,	0x00 },
+	{ 0x3d4,	0x10,	0x9c },
+	{ 0x3d4,	0x11,	0x8e },
+	{ 0x3d4,	0x12,	0x8f },
+	{ 0x3d4,	0x13,	0x28 },
+	{ 0x3d4,	0x14,	0x1f },
+	{ 0x3d4,	0x15,	0x96 },
+	{ 0x3d4,	0x16,	0xb9 },
+	{ 0x3d4,	0x17,	0xa3 },
+	 /* GR Regs */
+	{ 0x3ce,	0x0,	0x0 },
+	{ 0x3ce,	0x1,	0x0 },
+	{ 0x3ce,	0x2,	0x0 },
+	{ 0x3ce,	0x3,	0x0 },
+	{ 0x3ce,	0x4,	0x0 },
+	{ 0x3ce,	0x5,	0x10 },
+	{ 0x3ce,	0x6,	0xe },
+	{ 0x3ce,	0x7,	0x0 },
+	{ 0x3ce,	0x8,	0xff },
+	{ ENDMK }
 };
 
 struct VgaRegs S3TextRegs[NREGS+1] = {
-/*	port	index	value  */
-  /* SR Regs */
-	0x3c4,	0x1,	0x0,
-	0x3c4,	0x2,	0x3,
-	0x3c4,	0x3,	0x0,
-	0x3c4,	0x4,	0x2,
-   /* CR Regs */
-	0x3d4,	0x0,	0x5f,
-	0x3d4,	0x1,	0x4f,
-	0x3d4,	0x2,	0x50,
-	0x3d4,	0x3,	0x82,
-	0x3d4,	0x4,	0x55,
-	0x3d4,	0x5,	0x81,
-	0x3d4,	0x6,	0xbf,
-	0x3d4,	0x7,	0x1f,
-	0x3d4,	0x8,	0x00,
-	0x3d4,	0x9,	0x4f,
-	0x3d4,	0xa,	0x0d,
-	0x3d4,	0xb,	0x0e,
-	0x3d4,	0xc,	0x00,
-	0x3d4,	0xd,	0x00,
-	0x3d4,	0xe,	0x00,
-	0x3d4,	0xf,	0x00,
-	0x3d4,	0x10,	0x9c,
-	0x3d4,	0x11,	0x8e,
-	0x3d4,	0x12,	0x8f,
-	0x3d4,	0x13,	0x28,
-	0x3d4,	0x14,	0x1f,
-	0x3d4,	0x15,	0x96,
-	0x3d4,	0x16,	0xb9,
-	0x3d4,	0x17,	0xa3,
-   /* GR Regs */
-	0x3ce,	0x0,	0x0,
-	0x3ce,	0x1,	0x0,
-	0x3ce,	0x2,	0x0,
-	0x3ce,	0x3,	0x0,
-	0x3ce,	0x4,	0x0,
-	0x3ce,	0x5,	0x10,
-	0x3ce,	0x6,	0xe,
-	0x3ce,	0x7,	0x0,
-	0x3ce,	0x8,	0xff,
-        ENDMK
+	/* port		index	value */
+	/* SR Regs */
+	{ 0x3c4,	0x1,	0x0 },
+	{ 0x3c4,	0x2,	0x3 },
+	{ 0x3c4,	0x3,	0x0 },
+	{ 0x3c4,	0x4,	0x2 },
+	/* CR Regs */
+	{ 0x3d4,	0x0,	0x5f },
+	{ 0x3d4,	0x1,	0x4f },
+	{ 0x3d4,	0x2,	0x50 },
+	{ 0x3d4,	0x3,	0x82 },
+	{ 0x3d4,	0x4,	0x55 },
+	{ 0x3d4,	0x5,	0x81 },
+	{ 0x3d4,	0x6,	0xbf },
+	{ 0x3d4,	0x7,	0x1f },
+	{ 0x3d4,	0x8,	0x00 },
+	{ 0x3d4,	0x9,	0x4f },
+	{ 0x3d4,	0xa,	0x0d },
+	{ 0x3d4,	0xb,	0x0e },
+	{ 0x3d4,	0xc,	0x00 },
+	{ 0x3d4,	0xd,	0x00 },
+	{ 0x3d4,	0xe,	0x00 },
+	{ 0x3d4,	0xf,	0x00 },
+	{ 0x3d4,	0x10,	0x9c },
+	{ 0x3d4,	0x11,	0x8e },
+	{ 0x3d4,	0x12,	0x8f },
+	{ 0x3d4,	0x13,	0x28 },
+	{ 0x3d4,	0x14,	0x1f },
+	{ 0x3d4,	0x15,	0x96 },
+	{ 0x3d4,	0x16,	0xb9 },
+	{ 0x3d4,	0x17,	0xa3 },
+	/* GR Regs */
+	{ 0x3ce,	0x0,	0x0 },
+	{ 0x3ce,	0x1,	0x0 },
+	{ 0x3ce,	0x2,	0x0 },
+	{ 0x3ce,	0x3,	0x0 },
+	{ 0x3ce,	0x4,	0x0 },
+	{ 0x3ce,	0x5,	0x10 },
+	{ 0x3ce,	0x6,	0xe },
+	{ 0x3ce,	0x7,	0x0 },
+	{ 0x3ce,	0x8,	0xff },
+	{ ENDMK }
 };
 
 struct RGBColors
@@ -167,262 +165,262 @@
  */
 struct RGBColors TextCLUT[256] = 
 {
-  /*	red	green	blue  */
-	0x0,	0x0,	0x0,
-	0x0,	0x0,	0x2a,
-	0x0,	0x2a,	0x0,
-	0x0,	0x2a,	0x2a,
-	0x2a,	0x0,	0x0,
-	0x2a,	0x0,	0x2a,
-	0x2a,	0x2a,	0x0,
-	0x2a,	0x2a,	0x2a,
-	0x0,	0x0,	0x15,
-	0x0,	0x0,	0x3f,
-	0x0,	0x2a,	0x15,
-	0x0,	0x2a,	0x3f,
-	0x2a,	0x0,	0x15,
-	0x2a,	0x0,	0x3f,
-	0x2a,	0x2a,	0x15,
-	0x2a,	0x2a,	0x3f,
-	0x0,	0x15,	0x0,
-	0x0,	0x15,	0x2a,
-	0x0,	0x3f,	0x0,
-	0x0,	0x3f,	0x2a,
-	0x2a,	0x15,	0x0,
-	0x2a,	0x15,	0x2a,
-	0x2a,	0x3f,	0x0,
-	0x2a,	0x3f,	0x2a,
-	0x0,	0x15,	0x15,
-	0x0,	0x15,	0x3f,
-	0x0,	0x3f,	0x15,
-	0x0,	0x3f,	0x3f,
-	0x2a,	0x15,	0x15,
-	0x2a,	0x15,	0x3f,
-	0x2a,	0x3f,	0x15,
-	0x2a,	0x3f,	0x3f,
-	0x15,	0x0,	0x0,
-	0x15,	0x0,	0x2a,
-	0x15,	0x2a,	0x0,
-	0x15,	0x2a,	0x2a,
-	0x3f,	0x0,	0x0,
-	0x3f,	0x0,	0x2a,
-	0x3f,	0x2a,	0x0,
-	0x3f,	0x2a,	0x2a,
-	0x15,	0x0,	0x15,
-	0x15,	0x0,	0x3f,
-	0x15,	0x2a,	0x15,
-	0x15,	0x2a,	0x3f,
-	0x3f,	0x0,	0x15,
-	0x3f,	0x0,	0x3f,
-	0x3f,	0x2a,	0x15,
-	0x3f,	0x2a,	0x3f,
-	0x15,	0x15,	0x0,
-	0x15,	0x15,	0x2a,
-	0x15,	0x3f,	0x0,
-	0x15,	0x3f,	0x2a,
-	0x3f,	0x15,	0x0,
-	0x3f,	0x15,	0x2a,
-	0x3f,	0x3f,	0x0,
-	0x3f,	0x3f,	0x2a,
-	0x15,	0x15,	0x15,
-	0x15,	0x15,	0x3f,
-	0x15,	0x3f,	0x15,
-	0x15,	0x3f,	0x3f,
-	0x3f,	0x15,	0x15,
-	0x3f,	0x15,	0x3f,
-	0x3f,	0x3f,	0x15,
-	0x3f,	0x3f,	0x3f,
-	0x39,	0xc,	0x5,
-	0x15,	0x2c,	0xf,
-	0x26,	0x10,	0x3d,
-	0x29,	0x29,	0x38,
-	0x4,	0x1a,	0xe,
-	0x2,	0x1e,	0x3a,
-	0x3c,	0x25,	0x33,
-	0x3c,	0xc,	0x2c,
-	0x3f,	0x3,	0x2b,
-	0x1c,	0x9,	0x13,
-	0x25,	0x2a,	0x35,
-	0x1e,	0xa,	0x38,
-	0x24,	0x8,	0x3,
-	0x3,	0xe,	0x36,
-	0xc,	0x6,	0x2a,
-	0x26,	0x3,	0x32,
-	0x5,	0x2f,	0x33,
-	0x3c,	0x35,	0x2f,
-	0x2d,	0x26,	0x3e,
-	0xd,	0xa,	0x10,
-	0x25,	0x3c,	0x11,
-	0xd,	0x4,	0x2e,
-	0x5,	0x19,	0x3e,
-	0xc,	0x13,	0x34,
-	0x2b,	0x6,	0x24,
-	0x4,	0x3,	0xd,
-	0x2f,	0x3c,	0xc,
-	0x2a,	0x37,	0x1f,
-	0xf,	0x12,	0x38,
-	0x38,	0xe,	0x2a,
-	0x12,	0x2f,	0x19,
-	0x29,	0x2e,	0x31,
-	0x25,	0x13,	0x3e,
-	0x33,	0x3e,	0x33,
-	0x1d,	0x2c,	0x25,
-	0x15,	0x15,	0x5,
-	0x32,	0x25,	0x39,
-	0x1a,	0x7,	0x1f,
-	0x13,	0xe,	0x1d,
-	0x36,	0x17,	0x34,
-	0xf,	0x15,	0x23,
-	0x2,	0x35,	0xd,
-	0x15,	0x3f,	0xc,
-	0x14,	0x2f,	0xf,
-	0x19,	0x21,	0x3e,
-	0x27,	0x11,	0x2f,
-	0x38,	0x3f,	0x3c,
-	0x36,	0x2d,	0x15,
-	0x16,	0x17,	0x2,
-	0x1,	0xa,	0x3d,
-	0x1b,	0x11,	0x3f,
-	0x21,	0x3c,	0xd,
-	0x1a,	0x39,	0x3d,
-	0x8,	0xe,	0xe,
-	0x22,	0x21,	0x23,
-	0x1e,	0x30,	0x5,
-	0x1f,	0x22,	0x3d,
-	0x1e,	0x2f,	0xa,
-	0x0,	0x1c,	0xe,
-	0x0,	0x1c,	0x15,
-	0x0,	0x1c,	0x1c,
-	0x0,	0x15,	0x1c,
-	0x0,	0xe,	0x1c,
-	0x0,	0x7,	0x1c,
-	0xe,	0xe,	0x1c,
-	0x11,	0xe,	0x1c,
-	0x15,	0xe,	0x1c,
-	0x18,	0xe,	0x1c,
-	0x1c,	0xe,	0x1c,
-	0x1c,	0xe,	0x18,
-	0x1c,	0xe,	0x15,
-	0x1c,	0xe,	0x11,
-	0x1c,	0xe,	0xe,
-	0x1c,	0x11,	0xe,
-	0x1c,	0x15,	0xe,
-	0x1c,	0x18,	0xe,
-	0x1c,	0x1c,	0xe,
-	0x18,	0x1c,	0xe,
-	0x15,	0x1c,	0xe,
-	0x11,	0x1c,	0xe,
-	0xe,	0x1c,	0xe,
-	0xe,	0x1c,	0x11,
-	0xe,	0x1c,	0x15,
-	0xe,	0x1c,	0x18,
-	0xe,	0x1c,	0x1c,
-	0xe,	0x18,	0x1c,
-	0xe,	0x15,	0x1c,
-	0xe,	0x11,	0x1c,
-	0x14,	0x14,	0x1c,
-	0x16,	0x14,	0x1c,
-	0x18,	0x14,	0x1c,
-	0x1a,	0x14,	0x1c,
-	0x1c,	0x14,	0x1c,
-	0x1c,	0x14,	0x1a,
-	0x1c,	0x14,	0x18,
-	0x1c,	0x14,	0x16,
-	0x1c,	0x14,	0x14,
-	0x1c,	0x16,	0x14,
-	0x1c,	0x18,	0x14,
-	0x1c,	0x1a,	0x14,
-	0x1c,	0x1c,	0x14,
-	0x1a,	0x1c,	0x14,
-	0x18,	0x1c,	0x14,
-	0x16,	0x1c,	0x14,
-	0x14,	0x1c,	0x14,
-	0x14,	0x1c,	0x16,
-	0x14,	0x1c,	0x18,
-	0x14,	0x1c,	0x1a,
-	0x14,	0x1c,	0x1c,
-	0x14,	0x1a,	0x1c,
-	0x14,	0x18,	0x1c,
-	0x14,	0x16,	0x1c,
-	0x0,	0x0,	0x10,
-	0x4,	0x0,	0x10,
-	0x8,	0x0,	0x10,
-	0xc,	0x0,	0x10,
-	0x10,	0x0,	0x10,
-	0x10,	0x0,	0xc,
-	0x10,	0x0,	0x8,
-	0x10,	0x0,	0x4,
-	0x10,	0x0,	0x0,
-	0x10,	0x4,	0x0,
-	0x10,	0x8,	0x0,
-	0x10,	0xc,	0x0,
-	0x10,	0x10,	0x0,
-	0xc,	0x10,	0x0,
-	0x8,	0x10,	0x0,
-	0x4,	0x10,	0x0,
-	0x0,	0x10,	0x0,
-	0x0,	0x10,	0x4,
-	0x0,	0x10,	0x8,
-	0x0,	0x10,	0xc,
-	0x0,	0x10,	0x10,
-	0x0,	0xc,	0x10,
-	0x0,	0x8,	0x10,
-	0x0,	0x4,	0x10,
-	0x8,	0x8,	0x10,
-	0xa,	0x8,	0x10,
-	0xc,	0x8,	0x10,
-	0xe,	0x8,	0x10,
-	0x10,	0x8,	0x10,
-	0x10,	0x8,	0xe,
-	0x10,	0x8,	0xc,
-	0x10,	0x8,	0xa,
-	0x10,	0x8,	0x8,
-	0x10,	0xa,	0x8,
-	0x10,	0xc,	0x8,
-	0x10,	0xe,	0x8,
-	0x10,	0x10,	0x8,
-	0xe,	0x10,	0x8,
-	0xc,	0x10,	0x8,
-	0xa,	0x10,	0x8,
-	0x8,	0x10,	0x8,
-	0x8,	0x10,	0xa,
-	0x8,	0x10,	0xc,
-	0x8,	0x10,	0xe,
-	0x8,	0x10,	0x10,
-	0x8,	0xe,	0x10,
-	0x8,	0xc,	0x10,
-	0x8,	0xa,	0x10,
-	0xb,	0xb,	0x10,
-	0xc,	0xb,	0x10,
-	0xd,	0xb,	0x10,
-	0xf,	0xb,	0x10,
-	0x10,	0xb,	0x10,
-	0x10,	0xb,	0xf,
-	0x10,	0xb,	0xd,
-	0x10,	0xb,	0xc,
-	0x10,	0xb,	0xb,
-	0x10,	0xc,	0xb,
-	0x10,	0xd,	0xb,
-	0x10,	0xf,	0xb,
-	0x10,	0x10,	0xb,
-	0xf,	0x10,	0xb,
-	0xd,	0x10,	0xb,
-	0xc,	0x10,	0xb,
-	0xb,	0x10,	0xb,
-	0xb,	0x10,	0xc,
-	0xb,	0x10,	0xd,
-	0xb,	0x10,	0xf,
-	0xb,	0x10,	0x10,
-	0xb,	0xf,	0x10,
-	0xb,	0xd,	0x10,
-	0xb,	0xc,	0x10,
-	0x0,	0x0,	0x0,
-	0x0,	0x0,	0x0,
-	0x0,	0x0,	0x0,
-	0x0,	0x0,	0x0,
-	0x0,	0x0,	0x0,
-	0x0,	0x0,	0x0,
-	0x0,	0x0,	0x0
+	/* red	green	blue  */
+	{ 0x0,	0x0,	0x0 },
+	{ 0x0,	0x0,	0x2a },
+	{ 0x0,	0x2a,	0x0 },
+	{ 0x0,	0x2a,	0x2a },
+	{ 0x2a,	0x0,	0x0 },
+	{ 0x2a,	0x0,	0x2a },
+	{ 0x2a,	0x2a,	0x0 },
+	{ 0x2a,	0x2a,	0x2a },
+	{ 0x0,	0x0,	0x15 },
+	{ 0x0,	0x0,	0x3f },
+	{ 0x0,	0x2a,	0x15 },
+	{ 0x0,	0x2a,	0x3f },
+	{ 0x2a,	0x0,	0x15 },
+	{ 0x2a,	0x0,	0x3f },
+	{ 0x2a,	0x2a,	0x15 },
+	{ 0x2a,	0x2a,	0x3f },
+	{ 0x0,	0x15,	0x0 },
+	{ 0x0,	0x15,	0x2a },
+	{ 0x0,	0x3f,	0x0 },
+	{ 0x0,	0x3f,	0x2a },
+	{ 0x2a,	0x15,	0x0 },
+	{ 0x2a,	0x15,	0x2a },
+	{ 0x2a,	0x3f,	0x0 },
+	{ 0x2a,	0x3f,	0x2a },
+	{ 0x0,	0x15,	0x15 },
+	{ 0x0,	0x15,	0x3f },
+	{ 0x0,	0x3f,	0x15 },
+	{ 0x0,	0x3f,	0x3f },
+	{ 0x2a,	0x15,	0x15 },
+	{ 0x2a,	0x15,	0x3f },
+	{ 0x2a,	0x3f,	0x15 },
+	{ 0x2a,	0x3f,	0x3f },
+	{ 0x15,	0x0,	0x0 },
+	{ 0x15,	0x0,	0x2a },
+	{ 0x15,	0x2a,	0x0 },
+	{ 0x15,	0x2a,	0x2a },
+	{ 0x3f,	0x0,	0x0 },
+	{ 0x3f,	0x0,	0x2a },
+	{ 0x3f,	0x2a,	0x0 },
+	{ 0x3f,	0x2a,	0x2a },
+	{ 0x15,	0x0,	0x15 },
+	{ 0x15,	0x0,	0x3f },
+	{ 0x15,	0x2a,	0x15 },
+	{ 0x15,	0x2a,	0x3f },
+	{ 0x3f,	0x0,	0x15 },
+	{ 0x3f,	0x0,	0x3f },
+	{ 0x3f,	0x2a,	0x15 },
+	{ 0x3f,	0x2a,	0x3f },
+	{ 0x15,	0x15,	0x0 },
+	{ 0x15,	0x15,	0x2a },
+	{ 0x15,	0x3f,	0x0 },
+	{ 0x15,	0x3f,	0x2a },
+	{ 0x3f,	0x15,	0x0 },
+	{ 0x3f,	0x15,	0x2a },
+	{ 0x3f,	0x3f,	0x0 },
+	{ 0x3f,	0x3f,	0x2a },
+	{ 0x15,	0x15,	0x15 },
+	{ 0x15,	0x15,	0x3f },
+	{ 0x15,	0x3f,	0x15 },
+	{ 0x15,	0x3f,	0x3f },
+	{ 0x3f,	0x15,	0x15 },
+	{ 0x3f,	0x15,	0x3f },
+	{ 0x3f,	0x3f,	0x15 },
+	{ 0x3f,	0x3f,	0x3f },
+	{ 0x39,	0xc,	0x5 },
+	{ 0x15,	0x2c,	0xf },
+	{ 0x26,	0x10,	0x3d },
+	{ 0x29,	0x29,	0x38 },
+	{ 0x4,	0x1a,	0xe },
+	{ 0x2,	0x1e,	0x3a },
+	{ 0x3c,	0x25,	0x33 },
+	{ 0x3c,	0xc,	0x2c },
+	{ 0x3f,	0x3,	0x2b },
+	{ 0x1c,	0x9,	0x13 },
+	{ 0x25,	0x2a,	0x35 },
+	{ 0x1e,	0xa,	0x38 },
+	{ 0x24,	0x8,	0x3 },
+	{ 0x3,	0xe,	0x36 },
+	{ 0xc,	0x6,	0x2a },
+	{ 0x26,	0x3,	0x32 },
+	{ 0x5,	0x2f,	0x33 },
+	{ 0x3c,	0x35,	0x2f },
+	{ 0x2d,	0x26,	0x3e },
+	{ 0xd,	0xa,	0x10 },
+	{ 0x25,	0x3c,	0x11 },
+	{ 0xd,	0x4,	0x2e },
+	{ 0x5,	0x19,	0x3e },
+	{ 0xc,	0x13,	0x34 },
+	{ 0x2b,	0x6,	0x24 },
+	{ 0x4,	0x3,	0xd },
+	{ 0x2f,	0x3c,	0xc },
+	{ 0x2a,	0x37,	0x1f },
+	{ 0xf,	0x12,	0x38 },
+	{ 0x38,	0xe,	0x2a },
+	{ 0x12,	0x2f,	0x19 },
+	{ 0x29,	0x2e,	0x31 },
+	{ 0x25,	0x13,	0x3e },
+	{ 0x33,	0x3e,	0x33 },
+	{ 0x1d,	0x2c,	0x25 },
+	{ 0x15,	0x15,	0x5 },
+	{ 0x32,	0x25,	0x39 },
+	{ 0x1a,	0x7,	0x1f },
+	{ 0x13,	0xe,	0x1d },
+	{ 0x36,	0x17,	0x34 },
+	{ 0xf,	0x15,	0x23 },
+	{ 0x2,	0x35,	0xd },
+	{ 0x15,	0x3f,	0xc },
+	{ 0x14,	0x2f,	0xf },
+	{ 0x19,	0x21,	0x3e },
+	{ 0x27,	0x11,	0x2f },
+	{ 0x38,	0x3f,	0x3c },
+	{ 0x36,	0x2d,	0x15 },
+	{ 0x16,	0x17,	0x2 },
+	{ 0x1,	0xa,	0x3d },
+	{ 0x1b,	0x11,	0x3f },
+	{ 0x21,	0x3c,	0xd },
+	{ 0x1a,	0x39,	0x3d },
+	{ 0x8,	0xe,	0xe },
+	{ 0x22,	0x21,	0x23 },
+	{ 0x1e,	0x30,	0x5 },
+	{ 0x1f,	0x22,	0x3d },
+	{ 0x1e,	0x2f,	0xa },
+	{ 0x0,	0x1c,	0xe },
+	{ 0x0,	0x1c,	0x15 },
+	{ 0x0,	0x1c,	0x1c },
+	{ 0x0,	0x15,	0x1c },
+	{ 0x0,	0xe,	0x1c },
+	{ 0x0,	0x7,	0x1c },
+	{ 0xe,	0xe,	0x1c },
+	{ 0x11,	0xe,	0x1c },
+	{ 0x15,	0xe,	0x1c },
+	{ 0x18,	0xe,	0x1c },
+	{ 0x1c,	0xe,	0x1c },
+	{ 0x1c,	0xe,	0x18 },
+	{ 0x1c,	0xe,	0x15 },
+	{ 0x1c,	0xe,	0x11 },
+	{ 0x1c,	0xe,	0xe },
+	{ 0x1c,	0x11,	0xe },
+	{ 0x1c,	0x15,	0xe },
+	{ 0x1c,	0x18,	0xe },
+	{ 0x1c,	0x1c,	0xe },
+	{ 0x18,	0x1c,	0xe },
+	{ 0x15,	0x1c,	0xe },
+	{ 0x11,	0x1c,	0xe },
+	{ 0xe,	0x1c,	0xe },
+	{ 0xe,	0x1c,	0x11 },
+	{ 0xe,	0x1c,	0x15 },
+	{ 0xe,	0x1c,	0x18 },
+	{ 0xe,	0x1c,	0x1c },
+	{ 0xe,	0x18,	0x1c },
+	{ 0xe,	0x15,	0x1c },
+	{ 0xe,	0x11,	0x1c },
+	{ 0x14,	0x14,	0x1c },
+	{ 0x16,	0x14,	0x1c },
+	{ 0x18,	0x14,	0x1c },
+	{ 0x1a,	0x14,	0x1c },
+	{ 0x1c,	0x14,	0x1c },
+	{ 0x1c,	0x14,	0x1a },
+	{ 0x1c,	0x14,	0x18 },
+	{ 0x1c,	0x14,	0x16 },
+	{ 0x1c,	0x14,	0x14 },
+	{ 0x1c,	0x16,	0x14 },
+	{ 0x1c,	0x18,	0x14 },
+	{ 0x1c,	0x1a,	0x14 },
+	{ 0x1c,	0x1c,	0x14 },
+	{ 0x1a,	0x1c,	0x14 },
+	{ 0x18,	0x1c,	0x14 },
+	{ 0x16,	0x1c,	0x14 },
+	{ 0x14,	0x1c,	0x14 },
+	{ 0x14,	0x1c,	0x16 },
+	{ 0x14,	0x1c,	0x18 },
+	{ 0x14,	0x1c,	0x1a },
+	{ 0x14,	0x1c,	0x1c },
+	{ 0x14,	0x1a,	0x1c },
+	{ 0x14,	0x18,	0x1c },
+	{ 0x14,	0x16,	0x1c },
+	{ 0x0,	0x0,	0x10 },
+	{ 0x4,	0x0,	0x10 },
+	{ 0x8,	0x0,	0x10 },
+	{ 0xc,	0x0,	0x10 },
+	{ 0x10,	0x0,	0x10 },
+	{ 0x10,	0x0,	0xc },
+	{ 0x10,	0x0,	0x8 },
+	{ 0x10,	0x0,	0x4 },
+	{ 0x10,	0x0,	0x0 },
+	{ 0x10,	0x4,	0x0 },
+	{ 0x10,	0x8,	0x0 },
+	{ 0x10,	0xc,	0x0 },
+	{ 0x10,	0x10,	0x0 },
+	{ 0xc,	0x10,	0x0 },
+	{ 0x8,	0x10,	0x0 },
+	{ 0x4,	0x10,	0x0 },
+	{ 0x0,	0x10,	0x0 },
+	{ 0x0,	0x10,	0x4 },
+	{ 0x0,	0x10,	0x8 },
+	{ 0x0,	0x10,	0xc },
+	{ 0x0,	0x10,	0x10 },
+	{ 0x0,	0xc,	0x10 },
+	{ 0x0,	0x8,	0x10 },
+	{ 0x0,	0x4,	0x10 },
+	{ 0x8,	0x8,	0x10 },
+	{ 0xa,	0x8,	0x10 },
+	{ 0xc,	0x8,	0x10 },
+	{ 0xe,	0x8,	0x10 },
+	{ 0x10,	0x8,	0x10 },
+	{ 0x10,	0x8,	0xe },
+	{ 0x10,	0x8,	0xc },
+	{ 0x10,	0x8,	0xa },
+	{ 0x10,	0x8,	0x8 },
+	{ 0x10,	0xa,	0x8 },
+	{ 0x10,	0xc,	0x8 },
+	{ 0x10,	0xe,	0x8 },
+	{ 0x10,	0x10,	0x8 },
+	{ 0xe,	0x10,	0x8 },
+	{ 0xc,	0x10,	0x8 },
+	{ 0xa,	0x10,	0x8 },
+	{ 0x8,	0x10,	0x8 },
+	{ 0x8,	0x10,	0xa },
+	{ 0x8,	0x10,	0xc },
+	{ 0x8,	0x10,	0xe },
+	{ 0x8,	0x10,	0x10 },
+	{ 0x8,	0xe,	0x10 },
+	{ 0x8,	0xc,	0x10 },
+	{ 0x8,	0xa,	0x10 },
+	{ 0xb,	0xb,	0x10 },
+	{ 0xc,	0xb,	0x10 },
+	{ 0xd,	0xb,	0x10 },
+	{ 0xf,	0xb,	0x10 },
+	{ 0x10,	0xb,	0x10 },
+	{ 0x10,	0xb,	0xf },
+	{ 0x10,	0xb,	0xd },
+	{ 0x10,	0xb,	0xc },
+	{ 0x10,	0xb,	0xb },
+	{ 0x10,	0xc,	0xb },
+	{ 0x10,	0xd,	0xb },
+	{ 0x10,	0xf,	0xb },
+	{ 0x10,	0x10,	0xb },
+	{ 0xf,	0x10,	0xb },
+	{ 0xd,	0x10,	0xb },
+	{ 0xc,	0x10,	0xb },
+	{ 0xb,	0x10,	0xb },
+	{ 0xb,	0x10,	0xc },
+	{ 0xb,	0x10,	0xd },
+	{ 0xb,	0x10,	0xf },
+	{ 0xb,	0x10,	0x10 },
+	{ 0xb,	0xf,	0x10 },
+	{ 0xb,	0xd,	0x10 },
+	{ 0xb,	0xc,	0x10 },
+	{ 0x0,	0x0,	0x0 },
+	{ 0x0,	0x0,	0x0 },
+	{ 0x0,	0x0,	0x0 },
+	{ 0x0,	0x0,	0x0 },
+	{ 0x0,	0x0,	0x0 },
+	{ 0x0,	0x0,	0x0 },
+	{ 0x0,	0x0,	0x0 }
 };
 
 unsigned char AC[21] = {
@@ -721,7 +719,7 @@
 }
 
 void
-clearVideoMemory()
+clearVideoMemory(void)
 {
 	int i, j;
 	for (i = 0;  i < lines;  i++) {
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/config.in linux/arch/ppc/config.in
--- v2.4.9/linux/arch/ppc/config.in	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/config.in	Tue Aug 28 07:11:33 2001
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.config.in 1.34 07/08/01 11:39:11 trini
+# BK Id: SCCS/s.config.in 1.40 08/24/01 20:31:47 paulus
 #
 # For a description of the syntax of this configuration file,
 # see Documentation/kbuild/config-language.txt.
@@ -26,6 +26,7 @@
 mainmenu_option next_comment
 comment 'Platform support'
 define_bool CONFIG_PPC y
+define_bool CONFIG_PPC32 y
 choice 'Processor Type'	\
 	"6xx/7xx/74xx/8260	CONFIG_6xx	\
 	 4xx			CONFIG_4xx	\
@@ -42,6 +43,11 @@
   define_bool CONFIG_ALL_PPC y
 fi
 
+if [ "$CONFIG_6xx" = "y" -o "$CONFIG_POWER3" = "y" -o \
+     "$CONFIG_POWER4" = "y" ]; then
+  define_bool CONFIG_PPC_STD_MMU y
+fi
+
 if [ "$CONFIG_8260" = "y" ]; then
   define_bool CONFIG_SERIAL_CONSOLE y
   bool 'Support for EST8260' CONFIG_EST8260
@@ -93,7 +99,8 @@
   bool 'Workarounds for PPC601 bugs' CONFIG_PPC601_SYNC_FIX
 fi
 
-if [ "$CONFIG_8xx" = "y" -o "$CONFIG_8260" = "y" ]; then
+if [ "$CONFIG_POWER3" = "n" -a "$CONFIG_POWER4" = "n" -a \
+	"$CONFIG_6xx" = "n" ]; then
   define_bool CONFIG_ALL_PPC n
 fi
 
@@ -104,6 +111,11 @@
 
 if [ "$CONFIG_6xx" = "y" -a "$CONFIG_8260" = "n" ];then
   bool 'AltiVec Support' CONFIG_ALTIVEC
+  bool 'Thermal Management Support' CONFIG_TAU
+  if [ "$CONFIG_TAU" = "y" ]; then
+    bool '    Interrupt driven TAU driver (DANGEROUS)' CONFIG_TAU_INT
+    bool '    Average high and low temp' CONFIG_TAU_AVERAGE
+  fi
 fi
 
 if [ "$CONFIG_4xx" = "y" -o "$CONFIG_8xx" = "y" ]; then
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/IVMS8_defconfig linux/arch/ppc/configs/IVMS8_defconfig
--- v2.4.9/linux/arch/ppc/configs/IVMS8_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/IVMS8_defconfig	Tue Aug 28 06:58:33 2001
@@ -21,6 +21,7 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 # CONFIG_6xx is not set
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/SM850_defconfig linux/arch/ppc/configs/SM850_defconfig
--- v2.4.9/linux/arch/ppc/configs/SM850_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/SM850_defconfig	Tue Aug 28 06:58:33 2001
@@ -21,6 +21,7 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 # CONFIG_6xx is not set
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/SPD823TS_defconfig linux/arch/ppc/configs/SPD823TS_defconfig
--- v2.4.9/linux/arch/ppc/configs/SPD823TS_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/SPD823TS_defconfig	Tue Aug 28 06:58:33 2001
@@ -21,6 +21,7 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 # CONFIG_6xx is not set
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/TQM823L_defconfig linux/arch/ppc/configs/TQM823L_defconfig
--- v2.4.9/linux/arch/ppc/configs/TQM823L_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/TQM823L_defconfig	Tue Aug 28 06:58:33 2001
@@ -21,6 +21,7 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 # CONFIG_6xx is not set
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/TQM850L_defconfig linux/arch/ppc/configs/TQM850L_defconfig
--- v2.4.9/linux/arch/ppc/configs/TQM850L_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/TQM850L_defconfig	Tue Aug 28 06:58:33 2001
@@ -21,6 +21,7 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 # CONFIG_6xx is not set
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/TQM860L_defconfig linux/arch/ppc/configs/TQM860L_defconfig
--- v2.4.9/linux/arch/ppc/configs/TQM860L_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/TQM860L_defconfig	Tue Aug 28 06:58:33 2001
@@ -21,6 +21,7 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 # CONFIG_6xx is not set
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/apus_defconfig linux/arch/ppc/configs/apus_defconfig
--- v2.4.9/linux/arch/ppc/configs/apus_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/apus_defconfig	Tue Aug 28 06:58:33 2001
@@ -21,18 +21,21 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 CONFIG_6xx=y
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
 # CONFIG_POWER4 is not set
 # CONFIG_8xx is not set
 # CONFIG_8260 is not set
+CONFIG_PPC_STD_MMU=y
 # CONFIG_ALL_PPC is not set
 CONFIG_APUS=y
 # CONFIG_GEMINI is not set
 # CONFIG_PPC601_SYNC_FIX is not set
 # CONFIG_SMP is not set
 # CONFIG_ALTIVEC is not set
+# CONFIG_TAU is not set
 
 #
 # General setup
@@ -746,8 +749,10 @@
 CONFIG_SOUND=y
 CONFIG_DMASOUND_PAULA=m
 CONFIG_DMASOUND=m
+# CONFIG_SOUND_BT878 is not set
 # CONFIG_SOUND_CMPCI is not set
 # CONFIG_SOUND_EMU10K1 is not set
+# CONFIG_MIDI_EMU10K1 is not set
 # CONFIG_SOUND_FUSION is not set
 # CONFIG_SOUND_CS4281 is not set
 # CONFIG_SOUND_ES1370 is not set
@@ -756,6 +761,7 @@
 # CONFIG_SOUND_MAESTRO is not set
 # CONFIG_SOUND_MAESTRO3 is not set
 # CONFIG_SOUND_ICH is not set
+# CONFIG_SOUND_RME96XX is not set
 # CONFIG_SOUND_SONICVIBES is not set
 # CONFIG_SOUND_TRIDENT is not set
 # CONFIG_SOUND_MSNDCLAS is not set
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/bseip_defconfig linux/arch/ppc/configs/bseip_defconfig
--- v2.4.9/linux/arch/ppc/configs/bseip_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/bseip_defconfig	Tue Aug 28 06:58:33 2001
@@ -19,6 +19,7 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 # CONFIG_6xx is not set
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/common_defconfig linux/arch/ppc/configs/common_defconfig
--- v2.4.9/linux/arch/ppc/configs/common_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/common_defconfig	Tue Aug 28 06:58:33 2001
@@ -21,18 +21,23 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 CONFIG_6xx=y
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
 # CONFIG_POWER4 is not set
 # CONFIG_8xx is not set
 # CONFIG_8260 is not set
+CONFIG_PPC_STD_MMU=y
 CONFIG_ALL_PPC=y
 # CONFIG_APUS is not set
 # CONFIG_GEMINI is not set
 CONFIG_PPC601_SYNC_FIX=y
 # CONFIG_SMP is not set
 CONFIG_ALTIVEC=y
+CONFIG_TAU=y
+# CONFIG_TAU_INT is not set
+# CONFIG_TAU_AVERAGE is not set
 
 #
 # General setup
@@ -228,6 +233,7 @@
 CONFIG_BLK_DEV_IDEPCI=y
 CONFIG_IDEPCI_SHARE_IRQ=y
 CONFIG_BLK_DEV_IDEDMA_PCI=y
+CONFIG_BLK_DEV_ADMA=y
 # CONFIG_BLK_DEV_OFFBOARD is not set
 CONFIG_IDEDMA_PCI_AUTO=y
 CONFIG_BLK_DEV_IDEDMA=y
@@ -237,8 +243,8 @@
 # CONFIG_AEC62XX_TUNING is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
 # CONFIG_WDC_ALI15X3 is not set
-# CONFIG_BLK_DEV_AMD7409 is not set
-# CONFIG_AMD7409_OVERRIDE is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_AMD74XX_OVERRIDE is not set
 CONFIG_BLK_DEV_CMD64X=y
 # CONFIG_BLK_DEV_CY82C693 is not set
 # CONFIG_BLK_DEV_CS5530 is not set
@@ -249,7 +255,8 @@
 # CONFIG_BLK_DEV_OPTI621 is not set
 # CONFIG_BLK_DEV_PDC202XX is not set
 # CONFIG_PDC202XX_BURST is not set
-# CONFIG_BLK_DEV_OSB4 is not set
+# CONFIG_PDC202XX_FORCE is not set
+# CONFIG_BLK_DEV_SVWKS is not set
 # CONFIG_BLK_DEV_SIS5513 is not set
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
@@ -769,8 +776,10 @@
 CONFIG_SOUND=m
 CONFIG_DMASOUND_AWACS=m
 CONFIG_DMASOUND=m
+# CONFIG_SOUND_BT878 is not set
 # CONFIG_SOUND_CMPCI is not set
 # CONFIG_SOUND_EMU10K1 is not set
+# CONFIG_MIDI_EMU10K1 is not set
 # CONFIG_SOUND_FUSION is not set
 # CONFIG_SOUND_CS4281 is not set
 # CONFIG_SOUND_ES1370 is not set
@@ -779,6 +788,7 @@
 # CONFIG_SOUND_MAESTRO is not set
 # CONFIG_SOUND_MAESTRO3 is not set
 # CONFIG_SOUND_ICH is not set
+# CONFIG_SOUND_RME96XX is not set
 # CONFIG_SOUND_SONICVIBES is not set
 # CONFIG_SOUND_TRIDENT is not set
 # CONFIG_SOUND_MSNDCLAS is not set
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/est8260_defconfig linux/arch/ppc/configs/est8260_defconfig
--- v2.4.9/linux/arch/ppc/configs/est8260_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/est8260_defconfig	Tue Aug 28 06:58:33 2001
@@ -19,16 +19,17 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 CONFIG_6xx=y
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
 # CONFIG_POWER4 is not set
 # CONFIG_8xx is not set
 CONFIG_8260=y
+CONFIG_PPC_STD_MMU=y
 CONFIG_SERIAL_CONSOLE=y
 CONFIG_EST8260=y
 CONFIG_PPC601_SYNC_FIX=y
-# CONFIG_ALL_PPC is not set
 # CONFIG_SMP is not set
 
 #
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/gemini_defconfig linux/arch/ppc/configs/gemini_defconfig
--- v2.4.9/linux/arch/ppc/configs/gemini_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/gemini_defconfig	Tue Aug 28 06:58:33 2001
@@ -21,18 +21,23 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 CONFIG_6xx=y
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
 # CONFIG_POWER4 is not set
 # CONFIG_8xx is not set
 # CONFIG_8260 is not set
+CONFIG_PPC_STD_MMU=y
 # CONFIG_ALL_PPC is not set
 # CONFIG_APUS is not set
 CONFIG_GEMINI=y
 # CONFIG_PPC601_SYNC_FIX is not set
 # CONFIG_SMP is not set
 CONFIG_ALTIVEC=y
+CONFIG_TAU=y
+# CONFIG_TAU_INT is not set
+# CONFIG_TAU_AVERAGE is not set
 
 #
 # General setup
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/ibmchrp_defconfig linux/arch/ppc/configs/ibmchrp_defconfig
--- v2.4.9/linux/arch/ppc/configs/ibmchrp_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/ibmchrp_defconfig	Tue Aug 28 06:58:33 2001
@@ -21,18 +21,21 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 CONFIG_6xx=y
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
 # CONFIG_POWER4 is not set
 # CONFIG_8xx is not set
 # CONFIG_8260 is not set
+CONFIG_PPC_STD_MMU=y
 CONFIG_ALL_PPC=y
 # CONFIG_APUS is not set
 # CONFIG_GEMINI is not set
 # CONFIG_PPC601_SYNC_FIX is not set
 # CONFIG_SMP is not set
 # CONFIG_ALTIVEC is not set
+# CONFIG_TAU is not set
 
 #
 # General setup
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/mbx_defconfig linux/arch/ppc/configs/mbx_defconfig
--- v2.4.9/linux/arch/ppc/configs/mbx_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/mbx_defconfig	Tue Aug 28 06:58:33 2001
@@ -19,6 +19,7 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 # CONFIG_6xx is not set
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/oak_defconfig linux/arch/ppc/configs/oak_defconfig
--- v2.4.9/linux/arch/ppc/configs/oak_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/oak_defconfig	Tue Aug 28 06:58:33 2001
@@ -21,6 +21,7 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 # CONFIG_6xx is not set
 CONFIG_4xx=y
 # CONFIG_POWER3 is not set
@@ -29,6 +30,7 @@
 CONFIG_OAK=y
 # CONFIG_WALNUT is not set
 CONFIG_PPC601_SYNC_FIX=y
+# CONFIG_ALL_PPC is not set
 # CONFIG_SMP is not set
 # CONFIG_MATH_EMULATION is not set
 
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/power3_defconfig linux/arch/ppc/configs/power3_defconfig
--- v2.4.9/linux/arch/ppc/configs/power3_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/power3_defconfig	Tue Aug 28 06:58:33 2001
@@ -21,6 +21,7 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 # CONFIG_6xx is not set
 # CONFIG_4xx is not set
 CONFIG_POWER3=y
@@ -28,6 +29,7 @@
 # CONFIG_8xx is not set
 CONFIG_PPC64BRIDGE=y
 CONFIG_ALL_PPC=y
+CONFIG_PPC_STD_MMU=y
 CONFIG_SMP=y
 # CONFIG_IRQ_ALL_CPUS is not set
 
@@ -640,8 +642,10 @@
 #
 CONFIG_SOUND=y
 # CONFIG_DMASOUND_AWACS is not set
+# CONFIG_SOUND_BT878 is not set
 # CONFIG_SOUND_CMPCI is not set
 # CONFIG_SOUND_EMU10K1 is not set
+# CONFIG_MIDI_EMU10K1 is not set
 # CONFIG_SOUND_FUSION is not set
 # CONFIG_SOUND_CS4281 is not set
 # CONFIG_SOUND_ES1370 is not set
@@ -650,6 +654,7 @@
 # CONFIG_SOUND_MAESTRO is not set
 # CONFIG_SOUND_MAESTRO3 is not set
 # CONFIG_SOUND_ICH is not set
+# CONFIG_SOUND_RME96XX is not set
 # CONFIG_SOUND_SONICVIBES is not set
 # CONFIG_SOUND_TRIDENT is not set
 # CONFIG_SOUND_MSNDCLAS is not set
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/rpxcllf_defconfig linux/arch/ppc/configs/rpxcllf_defconfig
--- v2.4.9/linux/arch/ppc/configs/rpxcllf_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/rpxcllf_defconfig	Tue Aug 28 06:58:33 2001
@@ -19,6 +19,7 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 # CONFIG_6xx is not set
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/rpxlite_defconfig linux/arch/ppc/configs/rpxlite_defconfig
--- v2.4.9/linux/arch/ppc/configs/rpxlite_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/rpxlite_defconfig	Tue Aug 28 06:58:33 2001
@@ -19,6 +19,7 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 # CONFIG_6xx is not set
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/configs/walnut_defconfig linux/arch/ppc/configs/walnut_defconfig
--- v2.4.9/linux/arch/ppc/configs/walnut_defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/configs/walnut_defconfig	Tue Aug 28 06:58:33 2001
@@ -21,6 +21,7 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 # CONFIG_6xx is not set
 CONFIG_4xx=y
 # CONFIG_POWER3 is not set
@@ -29,6 +30,7 @@
 # CONFIG_OAK is not set
 CONFIG_WALNUT=y
 CONFIG_PPC601_SYNC_FIX=y
+# CONFIG_ALL_PPC is not set
 # CONFIG_SMP is not set
 # CONFIG_MATH_EMULATION is not set
 
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/defconfig linux/arch/ppc/defconfig
--- v2.4.9/linux/arch/ppc/defconfig	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/defconfig	Tue Aug 28 06:58:33 2001
@@ -21,18 +21,23 @@
 # Platform support
 #
 CONFIG_PPC=y
+CONFIG_PPC32=y
 CONFIG_6xx=y
 # CONFIG_4xx is not set
 # CONFIG_POWER3 is not set
 # CONFIG_POWER4 is not set
 # CONFIG_8xx is not set
 # CONFIG_8260 is not set
+CONFIG_PPC_STD_MMU=y
 CONFIG_ALL_PPC=y
 # CONFIG_APUS is not set
 # CONFIG_GEMINI is not set
 CONFIG_PPC601_SYNC_FIX=y
 # CONFIG_SMP is not set
 CONFIG_ALTIVEC=y
+CONFIG_TAU=y
+# CONFIG_TAU_INT is not set
+# CONFIG_TAU_AVERAGE is not set
 
 #
 # General setup
@@ -228,6 +233,7 @@
 CONFIG_BLK_DEV_IDEPCI=y
 CONFIG_IDEPCI_SHARE_IRQ=y
 CONFIG_BLK_DEV_IDEDMA_PCI=y
+CONFIG_BLK_DEV_ADMA=y
 # CONFIG_BLK_DEV_OFFBOARD is not set
 CONFIG_IDEDMA_PCI_AUTO=y
 CONFIG_BLK_DEV_IDEDMA=y
@@ -237,8 +243,8 @@
 # CONFIG_AEC62XX_TUNING is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
 # CONFIG_WDC_ALI15X3 is not set
-# CONFIG_BLK_DEV_AMD7409 is not set
-# CONFIG_AMD7409_OVERRIDE is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_AMD74XX_OVERRIDE is not set
 CONFIG_BLK_DEV_CMD64X=y
 # CONFIG_BLK_DEV_CY82C693 is not set
 # CONFIG_BLK_DEV_CS5530 is not set
@@ -249,7 +255,8 @@
 # CONFIG_BLK_DEV_OPTI621 is not set
 # CONFIG_BLK_DEV_PDC202XX is not set
 # CONFIG_PDC202XX_BURST is not set
-# CONFIG_BLK_DEV_OSB4 is not set
+# CONFIG_PDC202XX_FORCE is not set
+# CONFIG_BLK_DEV_SVWKS is not set
 # CONFIG_BLK_DEV_SIS5513 is not set
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
@@ -769,8 +776,10 @@
 CONFIG_SOUND=m
 CONFIG_DMASOUND_AWACS=m
 CONFIG_DMASOUND=m
+# CONFIG_SOUND_BT878 is not set
 # CONFIG_SOUND_CMPCI is not set
 # CONFIG_SOUND_EMU10K1 is not set
+# CONFIG_MIDI_EMU10K1 is not set
 # CONFIG_SOUND_FUSION is not set
 # CONFIG_SOUND_CS4281 is not set
 # CONFIG_SOUND_ES1370 is not set
@@ -779,6 +788,7 @@
 # CONFIG_SOUND_MAESTRO is not set
 # CONFIG_SOUND_MAESTRO3 is not set
 # CONFIG_SOUND_ICH is not set
+# CONFIG_SOUND_RME96XX is not set
 # CONFIG_SOUND_SONICVIBES is not set
 # CONFIG_SOUND_TRIDENT is not set
 # CONFIG_SOUND_MSNDCLAS is not set
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/Makefile linux/arch/ppc/kernel/Makefile
--- v2.4.9/linux/arch/ppc/kernel/Makefile	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/kernel/Makefile	Tue Aug 28 06:58:33 2001
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.24 07/10/01 12:12:22 trini
+# BK Id: SCCS/s.Makefile 1.32 08/24/01 20:07:37 paulus
 #
 #
 # Makefile for the linux kernel.
@@ -29,12 +29,13 @@
 
 O_TARGET := kernel.o
 
-export-objs			:= ppc_ksyms.o prep_setup.o 
+export-objs			:= ppc_ksyms.o prep_setup.o time.o
 
 obj-y				:= entry.o traps.o irq.o idle.o time.o misc.o \
 					process.o signal.o ptrace.o \
 					ppc_htab.o semaphore.o syscalls.o  \
-					align.o setup.o
+					align.o setup.o cputable.o
+obj-$(CONFIG_6xx)		+= l2cr.o
 obj-$(CONFIG_MODULES)		+= ppc_ksyms.o
 obj-$(CONFIG_POWER4)		+= xics.o
 obj-$(CONFIG_PCI)		+= pci.o pci-dma.o
@@ -43,6 +44,7 @@
 obj-$(CONFIG_4xx)		+= ppc4xx_pic.o
 obj-$(CONFIG_OAK)		+= oak_setup.o
 obj-$(CONFIG_WALNUT)		+= walnut_setup.o
+obj-$(CONFIG_TAU)		+= temp.o
 ifeq ($(CONFIG_WALNUT),y)
 obj-$(CONFIG_PCI)		+= galaxy_pci.o
 endif
@@ -71,12 +73,17 @@
 obj-$(CONFIG_GEMINI)		+= gemini_prom.o gemini_pci.o gemini_setup.o \
 					open_pic.o
 obj-$(CONFIG_8260)		+= m8260_setup.o ppc8260_pic.o
+obj-$(CONFIG_BOOTX_TEXT)	+= btext.o
 
+ifeq ($(CONFIG_SMP),y)
+obj-$(CONFIG_ALL_PPC)		+= pmac_smp.o chrp_smp.o
+endif
 
 include $(TOPDIR)/Rules.make
 
 entry.o: entry.S ppc_defs.h
 misc.o: misc.S ppc_defs.h
+l2cr.o: l2cr.S ppc_defs.h
 head.o: head.S ppc_defs.h
 head_4xx.o: head_4xx.S ppc_defs.h
 head_8xx.o: head_8xx.S ppc_defs.h
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/apus_pci.c linux/arch/ppc/kernel/apus_pci.c
--- v2.4.9/linux/arch/ppc/kernel/apus_pci.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/kernel/apus_pci.c	Sat Sep  8 12:38:41 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.apus_pci.c 1.4 07/06/01 09:19:28 trini
+ * BK Id: SCCS/s.apus_pci.c 1.5 09/08/01 15:47:42 paulus
  */
 /*
  * Copyright (C) Michel Dänzer <michdaen@iiic.ethz.ch>
@@ -21,7 +21,6 @@
 #include <linux/delay.h>
 #include <linux/string.h>
 
-#include <asm/init.h>
 #include <asm/io.h>
 #include <asm/pci-bridge.h>
 #include <asm/machdep.h>
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/apus_setup.c linux/arch/ppc/kernel/apus_setup.c
--- v2.4.9/linux/arch/ppc/kernel/apus_setup.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/kernel/apus_setup.c	Sat Sep  8 12:38:41 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.apus_setup.c 1.14 07/06/01 09:19:28 trini
+ * BK Id: SCCS/s.apus_setup.c 1.20 09/08/01 15:47:42 paulus
  */
 /*
  *  linux/arch/ppc/kernel/apus_setup.c
@@ -76,7 +76,6 @@
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/machdep.h>
-#include <asm/init.h>
 
 #include "local_irq.h"
 
@@ -611,32 +610,8 @@
 /*
  * IDE stuff.
  */
-void ide_insw(ide_ioreg_t port, void *buf, int ns);
-void ide_outsw(ide_ioreg_t port, void *buf, int ns);
-void
-apus_ide_insw(ide_ioreg_t port, void *buf, int ns)
-{
-	ide_insw(port, buf, ns);
-}
-
-void
-apus_ide_outsw(ide_ioreg_t port, void *buf, int ns)
-{
-	ide_outsw(port, buf, ns);
-}
-
-int
-apus_ide_default_irq(ide_ioreg_t base)
-{
-        return 0;
-}
-
-ide_ioreg_t
-apus_ide_default_io_base(int index)
-{
-        return 0;
-}
 
+#if 0	/* no longer used  -- paulus */
 void
 apus_ide_fix_driveid(struct hd_driveid *id)
 {
@@ -682,6 +657,7 @@
       }
    }
 }
+#endif /* 0 */
 
 __init
 void apus_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port, 
@@ -1039,6 +1015,15 @@
 	return total;
 }
 
+static void __init
+apus_map_io(void)
+{
+	/* Map PPC exception vectors. */
+	io_block_mapping(0xfff00000, 0xfff00000, 0x00020000, _PAGE_KERNEL);
+	/* Map chip and ZorroII memory */
+	io_block_mapping(zTwoBase,   0x00000000, 0x01000000, _PAGE_IO);
+}
+
 __init
 void apus_init_IRQ(void)
 {
@@ -1061,8 +1046,8 @@
 }
 
 __init
-void apus_init(unsigned long r3, unsigned long r4, unsigned long r5,
-	       unsigned long r6, unsigned long r7)
+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+		   unsigned long r6, unsigned long r7)
 {
 	extern int parse_bootinfo(const struct bi_record *);
 	extern char _end[];
@@ -1113,6 +1098,7 @@
 	ppc_md.calibrate_decr = apus_calibrate_decr;
 
 	ppc_md.find_end_of_memory = apus_find_end_of_memory;
+	ppc_md.setup_io_mappings = apus_map_io;
 
 	ppc_md.nvram_read_val = NULL;
 	ppc_md.nvram_write_val = NULL;
@@ -1130,14 +1116,7 @@
 #endif
 
 #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
-        ppc_ide_md.insw = apus_ide_insw;
-        ppc_ide_md.outsw = apus_ide_outsw;
-        ppc_ide_md.default_irq = apus_ide_default_irq;
-        ppc_ide_md.default_io_base = apus_ide_default_io_base;
-        ppc_ide_md.fix_driveid = apus_ide_fix_driveid;
         ppc_ide_md.ide_init_hwif = apus_ide_init_hwif_ports;
-
-        ppc_ide_md.io_base = _IO_BASE;
 #endif		
 }
 
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/btext.c linux/arch/ppc/kernel/btext.c
--- v2.4.9/linux/arch/ppc/kernel/btext.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/kernel/btext.c	Sat Sep  8 12:38:41 2001
@@ -0,0 +1,868 @@
+/*
+ * BK Id: %F% %I% %G% %U% %#%
+ */
+/*
+ * Procedures for drawing on the screen early on in the boot process.
+ *
+ * Benjamin Herrenschmidt <benh@kernel.crashing.org>
+ */
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/init.h>
+#include <linux/version.h>
+
+#include <asm/sections.h>
+#include <asm/bootx.h>
+#include <asm/btext.h>
+#include <asm/prom.h>
+#include <asm/page.h>
+#include <asm/mmu.h>
+#include <asm/pgtable.h>
+#include <asm/io.h>
+#include <asm/processor.h>
+
+#define NO_SCROLL
+
+#ifndef NO_SCROLL
+static void scrollscreen(void);
+#endif
+
+static void draw_byte(unsigned char c, long locX, long locY);
+static void draw_byte_32(unsigned char *bits, unsigned long *base, int rb);
+static void draw_byte_16(unsigned char *bits, unsigned long *base, int rb);
+static void draw_byte_8(unsigned char *bits, unsigned long *base, int rb);
+
+static int g_loc_X;
+static int g_loc_Y;
+static int g_max_loc_X;
+static int g_max_loc_Y;
+
+unsigned long disp_BAT[2] __initdata = {0, 0};
+
+#define cmapsz	(16*256)
+
+static unsigned char vga_font[cmapsz];
+
+int boot_text_mapped = 1;
+
+boot_infos_t *disp_bi;
+boot_infos_t fake_bi;
+
+extern char *klimit;
+
+/*
+ * Powermac can use btext_* after boot for xmon,
+ * chrp only uses it during early boot.
+ */
+#ifdef CONFIG_XMON
+#define BTEXT	__pmac
+#define BTDATA	__pmacdata
+#else
+#define BTEXT	__init
+#define BTDATA	__initdata
+#endif /* CONFIG_XMON */
+
+/*
+ * This is called only when we are booted via BootX.
+ */
+void __init
+btext_init(boot_infos_t *bi)
+{
+	unsigned long offset = reloc_offset();
+
+	RELOC(g_loc_X) = 0;
+	RELOC(g_loc_Y) = 0;
+	RELOC(g_max_loc_X) = (bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) / 8;
+	RELOC(g_max_loc_Y) = (bi->dispDeviceRect[3] - bi->dispDeviceRect[1]) / 16;
+	RELOC(disp_bi) = PTRUNRELOC(bi);
+}
+
+void __init
+btext_welcome(boot_infos_t* bi)
+{
+	unsigned long offset = reloc_offset();
+	unsigned long flags;
+	unsigned long pvr;
+	
+	btext_drawstring(RELOC("Welcome to Linux, kernel " UTS_RELEASE "\n"));
+	btext_drawstring(RELOC("\nlinked at        : 0x"));
+	btext_drawhex(KERNELBASE);
+	btext_drawstring(RELOC("\nframe buffer at  : 0x"));
+	btext_drawhex((unsigned long)bi->dispDeviceBase);
+	btext_drawstring(RELOC(" (phys), 0x"));
+	btext_drawhex((unsigned long)bi->logicalDisplayBase);
+	btext_drawstring(RELOC(" (log)"));
+	btext_drawstring(RELOC("\nklimit           : 0x"));
+	btext_drawhex((unsigned long)RELOC(klimit));
+	btext_drawstring(RELOC("\nMSR              : 0x"));
+	__asm__ __volatile__ ("mfmsr %0" : "=r" (flags));
+	btext_drawhex(flags);
+	__asm__ __volatile__ ("mfspr %0, 287" : "=r" (pvr));
+	pvr >>= 16;
+	if (pvr > 1) {
+	    btext_drawstring(RELOC("\nHID0             : 0x"));
+	    __asm__ __volatile__ ("mfspr %0, 1008" : "=r" (flags));
+	    btext_drawhex(flags);
+	}
+	if (pvr == 8 || pvr == 12 || pvr == 0x800c) {
+	    btext_drawstring(RELOC("\nICTC             : 0x"));
+	    __asm__ __volatile__ ("mfspr %0, 1019" : "=r" (flags));
+	    btext_drawhex(flags);
+	}
+	btext_drawstring(RELOC("\n\n"));
+}
+
+/* Calc BAT values for mapping the display and store them
+ * in disp_BAT.  Those values are then used from head.S to map
+ * the display during identify_machine() and MMU_Init()
+ * 
+ * The display is mapped to virtual address 0xD0000000, rather
+ * than 1:1, because some some CHRP machines put the frame buffer
+ * in the region starting at 0xC0000000 (KERNELBASE).
+ * This mapping is temporary and will disappear as soon as the
+ * setup done by MMU_Init() is applied.
+ * 
+ * For now, we align the BAT and then map 8Mb on 601 and 16Mb
+ * on other PPCs. This may cause trouble if the framebuffer
+ * is really badly aligned, but I didn't encounter this case
+ * yet.
+ */
+void __init
+btext_prepare_BAT(void)
+{
+	unsigned long offset = reloc_offset();
+	boot_infos_t* bi = PTRRELOC(RELOC(disp_bi));
+	unsigned long addr = (unsigned long)bi->dispDeviceBase;
+	unsigned long vaddr = KERNELBASE + 0x10000000;
+	unsigned long lowbits;
+
+	if (!RELOC(disp_bi)) {
+		RELOC(boot_text_mapped) = 0;
+		return;
+	}
+	if (PVR_VER(mfspr(PVR)) != 1) {
+		/* 603, 604, G3, G4, ... */
+		lowbits = addr & ~0xFF000000UL;
+		addr &= 0xFF000000UL;
+		RELOC(disp_BAT[0]) = vaddr | (BL_16M<<2) | 2;
+		RELOC(disp_BAT[1]) = addr | (_PAGE_NO_CACHE | _PAGE_GUARDED | BPP_RW);		
+	} else {
+		/* 601 */
+		lowbits = addr & ~0xFF800000UL;
+		addr &= 0xFF800000UL;
+		RELOC(disp_BAT[0]) = vaddr | (_PAGE_NO_CACHE | PP_RWXX) | 4;
+		RELOC(disp_BAT[1]) = addr | BL_8M | 0x40;
+	}
+	bi->logicalDisplayBase = (void *) (vaddr + lowbits);
+}
+
+/* This function will enable the early boot text when doing OF booting. This
+ * way, xmon output should work too
+ */
+void __init
+btext_setup_display(int width, int height, int depth, int pitch,
+		    unsigned long address)
+{
+	unsigned long offset = reloc_offset();
+	boot_infos_t* bi;
+
+	RELOC(disp_bi) = &fake_bi;
+	bi = PTRRELOC((&fake_bi));
+	RELOC(g_loc_X) = 0;
+	RELOC(g_loc_Y) = 0;
+	RELOC(g_max_loc_X) = width / 8;
+	RELOC(g_max_loc_Y) = height / 16;
+	bi->logicalDisplayBase = (unsigned char *)address;
+	bi->dispDeviceBase = (unsigned char *)address;
+	bi->dispDeviceRowBytes = pitch;
+	bi->dispDeviceDepth = depth;
+	bi->dispDeviceRect[0] = bi->dispDeviceRect[1] = 0;
+	bi->dispDeviceRect[2] = width;
+	bi->dispDeviceRect[3] = height;
+}
+
+/* Here's a small text engine to use during early boot
+ * or for debugging purposes
+ * 
+ * todo:
+ * 
+ *  - build some kind of vgacon with it to enable early printk
+ *  - move to a separate file
+ *  - add a few video driver hooks to keep in sync with display
+ *    changes.
+ */
+
+void __openfirmware
+map_boot_text(void)
+{
+	unsigned long base, offset, size;
+	if (disp_bi == 0)
+		return;
+	base = ((unsigned long) disp_bi->dispDeviceBase) & 0xFFFFF000UL;
+	offset = ((unsigned long) disp_bi->dispDeviceBase) - base;
+	size = disp_bi->dispDeviceRowBytes * disp_bi->dispDeviceRect[3] + offset
+		+ disp_bi->dispDeviceRect[0];
+	disp_bi->logicalDisplayBase = ioremap(base, size);
+	if (disp_bi->logicalDisplayBase == 0)
+		return;
+	disp_bi->logicalDisplayBase += offset;
+	boot_text_mapped = 1;
+}
+
+/* Calc the base address of a given point (x,y) */
+static unsigned char * BTEXT
+calc_base(boot_infos_t *bi, int x, int y)
+{
+	unsigned char *base;
+
+	base = bi->logicalDisplayBase;
+	if (base == 0)
+		base = bi->dispDeviceBase;
+	base += (x + bi->dispDeviceRect[0]) * (bi->dispDeviceDepth >> 3);
+	base += (y + bi->dispDeviceRect[1]) * bi->dispDeviceRowBytes;
+	return base;
+}
+
+/* Adjust the display to a new resolution */
+void
+btext_update_display(unsigned long phys, int width, int height,
+		     int depth, int pitch)
+{
+	if (disp_bi == 0)
+		return;
+	/* check it's the same frame buffer (within 64MB) */
+	if ((phys ^ (unsigned long)disp_bi->dispDeviceBase) & 0xfc000000) {
+		return;
+	}
+
+	disp_bi->dispDeviceBase = (__u8 *) phys;
+	disp_bi->dispDeviceRect[0] = 0;
+	disp_bi->dispDeviceRect[1] = 0;
+	disp_bi->dispDeviceRect[2] = width;
+	disp_bi->dispDeviceRect[3] = height;
+	disp_bi->dispDeviceDepth = depth;
+	disp_bi->dispDeviceRowBytes = pitch;
+	if (boot_text_mapped) {
+		iounmap(disp_bi->logicalDisplayBase);
+		boot_text_mapped = 0;
+	}
+	map_boot_text();
+	g_loc_X = 0;
+	g_loc_Y = 0;
+	g_max_loc_X = width / 8;
+	g_max_loc_Y = height / 16;
+}
+
+void BTEXT btext_clearscreen(void)
+{
+	unsigned long offset	= reloc_offset();
+	boot_infos_t* bi	= PTRRELOC(RELOC(disp_bi));
+	unsigned long *base	= (unsigned long *)calc_base(bi, 0, 0);
+	unsigned long width 	= ((bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) *
+					(bi->dispDeviceDepth >> 3)) >> 2;
+	int i,j;
+	
+	for (i=0; i<(bi->dispDeviceRect[3] - bi->dispDeviceRect[1]); i++)
+	{
+		unsigned long *ptr = base;
+		for(j=width; j; --j)
+			*(ptr++) = 0;
+		base += (bi->dispDeviceRowBytes >> 2);
+	}
+}
+
+__inline__ void dcbst(const void* addr)
+{
+	__asm__ __volatile__ ("dcbst 0,%0" :: "r" (addr));
+}
+
+void BTEXT btext_flushscreen(void)
+{
+	unsigned long offset	= reloc_offset();
+	boot_infos_t* bi	= PTRRELOC(RELOC(disp_bi));
+	unsigned long *base	= (unsigned long *)calc_base(bi, 0, 0);
+	unsigned long width 	= ((bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) *
+					(bi->dispDeviceDepth >> 3)) >> 2;
+	int i,j;
+	
+	for (i=0; i<(bi->dispDeviceRect[3] - bi->dispDeviceRect[1]); i++)
+	{
+		unsigned long *ptr = base;
+		for(j=width; j>0; j-=8) {
+			dcbst(ptr);
+			ptr += 8;
+		}
+		base += (bi->dispDeviceRowBytes >> 2);
+	}
+}
+
+#ifndef NO_SCROLL
+static BTEXT void
+scrollscreen(void)
+{
+	unsigned long offset		= reloc_offset();
+	boot_infos_t* bi		= PTRRELOC(RELOC(disp_bi));
+	unsigned long *src		= (unsigned long *)calc_base(bi,0,16);
+	unsigned long *dst		= (unsigned long *)calc_base(bi,0,0);
+	unsigned long width		= ((bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) *
+						(bi->dispDeviceDepth >> 3)) >> 2;
+	int i,j;
+	
+#ifdef CONFIG_ADB_PMU
+	pmu_suspend();	/* PMU will not shut us down ! */
+#endif
+	for (i=0; i<(bi->dispDeviceRect[3] - bi->dispDeviceRect[1] - 16); i++)
+	{
+		unsigned long *src_ptr = src;
+		unsigned long *dst_ptr = dst;
+		for(j=width; j; --j)
+			*(dst_ptr++) = *(src_ptr++);
+		src += (bi->dispDeviceRowBytes >> 2);
+		dst += (bi->dispDeviceRowBytes >> 2);
+	}
+	for (i=0; i<16; i++)
+	{
+		unsigned long *dst_ptr = dst;
+		for(j=width; j; --j)
+			*(dst_ptr++) = 0;
+		dst += (bi->dispDeviceRowBytes >> 2);
+	}
+#ifdef CONFIG_ADB_PMU
+	pmu_resume();	/* PMU will not shut us down ! */
+#endif
+}
+#endif /* ndef NO_SCROLL */
+
+void BTEXT btext_drawchar(char c)
+{
+	unsigned long offset = reloc_offset();
+	int cline = 0, x;
+
+	if (!RELOC(boot_text_mapped))
+		return;
+
+	switch (c) {
+	case '\b':
+		if (RELOC(g_loc_X) > 0)
+			--RELOC(g_loc_X);
+		break;
+	case '\t':
+		RELOC(g_loc_X) = (RELOC(g_loc_X) & -8) + 8;
+		break;
+	case '\r':
+		RELOC(g_loc_X) = 0;
+		break;
+	case '\n':
+		RELOC(g_loc_X) = 0;
+		RELOC(g_loc_Y)++;
+		cline = 1;
+		break;
+	default:
+		draw_byte(c, RELOC(g_loc_X)++, RELOC(g_loc_Y));
+	}
+	if (RELOC(g_loc_X) >= RELOC(g_max_loc_X)) {
+		RELOC(g_loc_X) = 0;
+		RELOC(g_loc_Y)++;
+		cline = 1;
+	}
+#ifndef NO_SCROLL
+	while (RELOC(g_loc_Y) >= RELOC(g_max_loc_Y)) {
+		scrollscreen();
+		RELOC(g_loc_Y)--;
+	}
+#else
+	/* wrap around from bottom to top of screen so we don't
+	   waste time scrolling each line.  -- paulus. */
+	if (RELOC(g_loc_Y) >= RELOC(g_max_loc_Y))
+		RELOC(g_loc_Y) = 0;
+	if (cline) {
+		for (x = 0; x < RELOC(g_max_loc_X); ++x)
+			draw_byte(' ', x, RELOC(g_loc_Y));
+	}
+#endif
+}
+
+void BTEXT
+btext_drawstring(const char *c)
+{
+	unsigned long offset	= reloc_offset();
+
+	if (!RELOC(boot_text_mapped))
+		return;
+	while (*c)
+		btext_drawchar(*c++);
+}
+
+void BTEXT
+btext_drawhex(unsigned long v)
+{
+	static char hex_table[] = "0123456789abcdef";
+	unsigned long offset	= reloc_offset();
+	
+	if (!RELOC(boot_text_mapped))
+		return;
+	btext_drawchar(RELOC(hex_table)[(v >> 28) & 0x0000000FUL]);
+	btext_drawchar(RELOC(hex_table)[(v >> 24) & 0x0000000FUL]);
+	btext_drawchar(RELOC(hex_table)[(v >> 20) & 0x0000000FUL]);
+	btext_drawchar(RELOC(hex_table)[(v >> 16) & 0x0000000FUL]);
+	btext_drawchar(RELOC(hex_table)[(v >> 12) & 0x0000000FUL]);
+	btext_drawchar(RELOC(hex_table)[(v >>  8) & 0x0000000FUL]);
+	btext_drawchar(RELOC(hex_table)[(v >>  4) & 0x0000000FUL]);
+	btext_drawchar(RELOC(hex_table)[(v >>  0) & 0x0000000FUL]);
+	btext_drawchar(' ');
+}
+
+static void BTEXT
+draw_byte(unsigned char c, long locX, long locY)
+{
+	unsigned long offset	= reloc_offset();
+	boot_infos_t* bi	= PTRRELOC(RELOC(disp_bi));
+	unsigned char *base	= calc_base(bi, locX << 3, locY << 4);
+	unsigned char *font	= &RELOC(vga_font)[((unsigned long)c) * 16];
+	int rb			= bi->dispDeviceRowBytes;
+	
+	switch(bi->dispDeviceDepth) {
+	case 32:
+		draw_byte_32(font, (unsigned long *)base, rb);
+		break;
+	case 16:
+		draw_byte_16(font, (unsigned long *)base, rb);
+		break;
+	case 8:
+		draw_byte_8(font, (unsigned long *)base, rb);
+		break;
+	}
+}
+
+static unsigned long expand_bits_8[16] BTDATA = {
+	0x00000000,
+	0x000000ff,
+	0x0000ff00,
+	0x0000ffff,
+	0x00ff0000,
+	0x00ff00ff,
+	0x00ffff00,
+	0x00ffffff,
+	0xff000000,
+	0xff0000ff,
+	0xff00ff00,
+	0xff00ffff,
+	0xffff0000,
+	0xffff00ff,
+	0xffffff00,
+	0xffffffff
+};
+
+static unsigned long expand_bits_16[4] BTDATA = {
+	0x00000000,
+	0x0000ffff,
+	0xffff0000,
+	0xffffffff
+};
+
+
+static void BTEXT
+draw_byte_32(unsigned char *font, unsigned long *base, int rb)
+{
+	int l, bits;	
+	int fg = 0xFFFFFFFFUL;
+	int bg = 0x00000000UL;
+	
+	for (l = 0; l < 16; ++l)
+	{
+		bits = *font++;
+		base[0] = (-(bits >> 7) & fg) ^ bg;
+		base[1] = (-((bits >> 6) & 1) & fg) ^ bg;
+		base[2] = (-((bits >> 5) & 1) & fg) ^ bg;
+		base[3] = (-((bits >> 4) & 1) & fg) ^ bg;
+		base[4] = (-((bits >> 3) & 1) & fg) ^ bg;
+		base[5] = (-((bits >> 2) & 1) & fg) ^ bg;
+		base[6] = (-((bits >> 1) & 1) & fg) ^ bg;
+		base[7] = (-(bits & 1) & fg) ^ bg;
+		base = (unsigned long *) ((char *)base + rb);
+	}
+}
+
+static void BTEXT
+draw_byte_16(unsigned char *font, unsigned long *base, int rb)
+{
+	int l, bits;	
+	int fg = 0xFFFFFFFFUL;
+	int bg = 0x00000000UL;
+	unsigned long offset = reloc_offset();
+	unsigned long *eb = RELOC(expand_bits_16);
+
+	for (l = 0; l < 16; ++l)
+	{
+		bits = *font++;
+		base[0] = (eb[bits >> 6] & fg) ^ bg;
+		base[1] = (eb[(bits >> 4) & 3] & fg) ^ bg;
+		base[2] = (eb[(bits >> 2) & 3] & fg) ^ bg;
+		base[3] = (eb[bits & 3] & fg) ^ bg;
+		base = (unsigned long *) ((char *)base + rb);
+	}
+}
+
+static void BTEXT
+draw_byte_8(unsigned char *font, unsigned long *base, int rb)
+{
+	int l, bits;	
+	int fg = 0x0F0F0F0FUL;
+	int bg = 0x00000000UL;
+	unsigned long offset = reloc_offset();
+	unsigned long *eb = RELOC(expand_bits_8);
+
+	for (l = 0; l < 16; ++l)
+	{
+		bits = *font++;
+		base[0] = (eb[bits >> 4] & fg) ^ bg;
+		base[1] = (eb[bits & 0xf] & fg) ^ bg;
+		base = (unsigned long *) ((char *)base + rb);
+	}
+}
+
+static unsigned char vga_font[cmapsz] BTDATA = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, 
+0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xff, 
+0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 
+0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 
+0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 
+0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 
+0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, 
+0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1e, 0x0e, 
+0x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30, 
+0x30, 0x70, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x63, 
+0x7f, 0x63, 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, 
+0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0e, 
+0x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 
+0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xdb, 
+0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6, 
+0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 
+0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 
+0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x24, 0x66, 0xff, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, 
+0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 
+0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 
+0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c, 
+0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, 
+0x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 
+0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 
+0x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 
+0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xce, 0xde, 0xf6, 0xe6, 0xc6, 0xc6, 0x7c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 
+0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe, 
+0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, 
+0xc0, 0xc0, 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18, 
+0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 
+0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 
+0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 
+0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 
+0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xde, 0xde, 
+0xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 
+0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 
+0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6c, 
+0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 
+0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 
+0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 
+0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xe7, 
+0xff, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 
+0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 
+0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c, 
+0x0c, 0x0e, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 
+0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 
+0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xff, 0xdb, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 
+0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 
+0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x66, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18, 
+0x3c, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 
+0xc3, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc1, 0xc3, 0xff, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 
+0x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 
+0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c, 
+0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 
+0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 
+0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x60, 
+0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 
+0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 
+0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00, 0x00, 0x00, 0xe0, 0x60, 
+0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, 
+0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0xe0, 0x60, 
+0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff, 0xdb, 
+0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 
+0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 
+0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30, 
+0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3, 
+0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 
+0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18, 
+0x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 
+0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 
+0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x0c, 0x06, 0x7c, 0x00, 0x00, 
+0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe, 
+0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 
+0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xcc, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c, 
+0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 
+0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c, 0x0c, 0x06, 
+0x3c, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, 
+0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 
+0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x38, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x66, 
+0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 
+0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 0x00, 
+0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 
+0x18, 0x30, 0x60, 0x00, 0xfe, 0x66, 0x60, 0x7c, 0x60, 0x60, 0x66, 0xfe, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b, 
+0x7e, 0xd8, 0xdc, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x6c, 
+0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 
+0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 
+0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x30, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0xcc, 0xcc, 0xcc, 
+0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 
+0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00, 
+0x00, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 
+0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 
+0xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff, 0x18, 
+0xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 
+0x7c, 0x62, 0x66, 0x6f, 0x66, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x0e, 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0xd8, 0x70, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0c, 0x7c, 
+0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 
+0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x18, 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, 0xcc, 0xcc, 
+0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 
+0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 
+0x76, 0xdc, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, 
+0x38, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, 
+0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xce, 0x9b, 0x06, 
+0x0c, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 
+0x66, 0xce, 0x96, 0x3e, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 
+0x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36, 
+0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x44, 0x11, 0x44, 
+0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 
+0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 
+0x55, 0xaa, 0x55, 0xaa, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 
+0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 
+0x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36, 
+0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0xf8, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 
+0x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
+0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
+0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6, 
+0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
+0x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 
+0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
+0x36, 0x37, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 
+0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
+0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 
+0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 
+0x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xff, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36, 
+0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x1f, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 
+0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
+0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 
+0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 
+0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 
+0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x76, 0xdc, 0xd8, 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xd8, 0xcc, 0xc6, 0xc6, 0xc6, 0xcc, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0, 
+0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xc6, 0xfe, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8, 
+0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66, 
+0x66, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 
+0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x6c, 0x6c, 0xee, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66, 
+0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x7e, 0xdb, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x03, 0x06, 0x7e, 0xdb, 0xdb, 0xf3, 0x7e, 0x60, 0xc0, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x30, 0x60, 0x60, 0x7c, 0x60, 
+0x60, 0x60, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 
+0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 
+0x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 
+0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x00, 0x7e, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x1b, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, 
+0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, 
+0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x6c, 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 
+};
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/chrp_pci.c linux/arch/ppc/kernel/chrp_pci.c
--- v2.4.9/linux/arch/ppc/kernel/chrp_pci.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/kernel/chrp_pci.c	Sat Sep  8 12:38:41 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.chrp_pci.c 1.20 08/08/01 16:35:43 paulus
+ * BK Id: SCCS/s.chrp_pci.c 1.22 09/08/01 15:47:42 paulus
  */
 /*
  * CHRP pci routines.
@@ -21,7 +21,7 @@
 #include <asm/prom.h>
 #include <asm/gg2.h>
 #include <asm/machdep.h>
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/pci-bridge.h>
 
 #include "open_pic.h"
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/chrp_setup.c linux/arch/ppc/kernel/chrp_setup.c
--- v2.4.9/linux/arch/ppc/kernel/chrp_setup.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/kernel/chrp_setup.c	Sat Sep  8 12:38:41 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.chrp_setup.c 1.22 07/18/01 22:56:39 paulus
+ * BK Id: SCCS/s.chrp_setup.c 1.36 09/08/01 15:47:42 paulus
  */
 /*
  *  linux/arch/ppc/kernel/setup.c
@@ -51,8 +51,9 @@
 #include <asm/irq.h>
 #include <asm/hydra.h>
 #include <asm/keyboard.h>
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/time.h>
+#include <asm/btext.h>
 
 #include "local_irq.h"
 #include "i8259.h"
@@ -68,7 +69,7 @@
 void chrp_event_scan(void);
 void rtas_display_progress(char *, unsigned short);
 void rtas_indicator_progress(char *, unsigned short);
-void bootx_text_progress(char *, unsigned short);
+void btext_progress(char *, unsigned short);
 
 extern unsigned long pmac_find_end_of_memory(void);
 extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
@@ -79,14 +80,7 @@
 extern void pckbd_leds(unsigned char leds);
 extern void pckbd_init_hw(void);
 extern unsigned char pckbd_sysrq_xlate[128];
-extern int mackbd_setkeycode(unsigned int scancode, unsigned int keycode);
-extern int mackbd_getkeycode(unsigned int scancode);
-extern int mackbd_translate(unsigned char scancode, unsigned char *keycode,
-			    char raw_mode);
-extern char mackbd_unexpected_up(unsigned char keycode);
-extern void mackbd_leds(unsigned char leds);
-extern void mackbd_init_hw(void);
-extern unsigned char mackbd_sysrq_xlate[128];
+extern void select_adb_keyboard(void);
 
 extern kdev_t boot_dev;
 
@@ -94,9 +88,13 @@
 extern unsigned long Hash_size, Hash_mask;
 extern int probingmem;
 extern unsigned long loops_per_jiffy;
-extern int bootx_text_mapped;
 static int max_width;
 
+#ifdef CONFIG_SMP
+extern struct smp_ops_t chrp_smp_ops;
+extern struct smp_ops_t xics_smp_ops;
+#endif
+
 static const char *gg2_memtypes[4] = {
 	"FPM", "SDRAM", "EDO", "BEDO"
 };
@@ -248,9 +246,6 @@
 	chrp_find_bridges();
 
 #ifndef CONFIG_PPC64BRIDGE
-	/* PCI bridge config space access area -
-	 * appears to be not in devtree on longtrail. */
-	ioremap(GG2_PCI_CONFIG_BASE, 0x80000);
 	/*
 	 *  Temporary fixes for PCI devices.
 	 *  -- Geert
@@ -259,7 +254,6 @@
 
 #endif /* CONFIG_PPC64BRIDGE */
 
-#ifndef CONFIG_POWER4
 	/* Some IBM machines don't have the hydra -- Cort */
 	if (!OpenPIC_Addr) {
 		struct device_node *root;
@@ -276,7 +270,6 @@
 			OpenPIC_Addr = ioremap(opprop[n-1], 0x40000);
 		}
 	}
-#endif
 
 	/*
 	 *  Fix the Super I/O configuration
@@ -401,9 +394,6 @@
 void __init
 chrp_init2(void)
 {
-#if defined(CONFIG_VT) && defined(CONFIG_ADB_KEYBOARD)
-	struct device_node *kbd;
-#endif
 #ifdef CONFIG_NVRAM  
 	pmac_nvram_init();
 #endif
@@ -418,87 +408,35 @@
 	if (ppc_md.progress)
 		ppc_md.progress("  Have fun!    ", 0x7777);
 
-#if defined(CONFIG_VT) && defined(CONFIG_ADB_KEYBOARD)
+#if defined(CONFIG_VT) && (defined(CONFIG_ADB_KEYBOARD) || defined(CONFIG_INPUT))
 	/* see if there is a keyboard in the device tree
 	   with a parent of type "adb" */
-	for (kbd = find_devices("keyboard"); kbd; kbd = kbd->next)
-		if (kbd->parent && kbd->parent->type
-		    && strcmp(kbd->parent->type, "adb") == 0)
-			break;
-	if (kbd) {
-		ppc_md.kbd_setkeycode    = mackbd_setkeycode;
-		ppc_md.kbd_getkeycode    = mackbd_getkeycode;
-		ppc_md.kbd_translate     = mackbd_translate;
-		ppc_md.kbd_unexpected_up = mackbd_unexpected_up;
-		ppc_md.kbd_leds          = mackbd_leds;
-		ppc_md.kbd_init_hw       = mackbd_init_hw;
-#ifdef CONFIG_MAGIC_SYSRQ
-		ppc_md.ppc_kbd_sysrq_xlate	 = mackbd_sysrq_xlate;
-		SYSRQ_KEY = 0x69;
-#endif /* CONFIG_MAGIC_SYSRQ */
+	{
+		struct device_node *kbd;
+
+		for (kbd = find_devices("keyboard"); kbd; kbd = kbd->next) {
+			if (kbd->parent && kbd->parent->type
+			    && strcmp(kbd->parent->type, "adb") == 0) {
+				select_adb_keyboard();
+				break;
+			}
+		}
 	}
-#endif /* CONFIG_VT && CONFIG_ADB_KEYBOARD */
+#endif /* CONFIG_VT && (CONFIG_ADB_KEYBOARD || CONFIG_INPUT) */
 }
 
 #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
 /*
  * IDE stuff.
  */
-unsigned int chrp_ide_irq = 0;
-int chrp_ide_ports_known = 0;
-ide_ioreg_t chrp_ide_regbase[MAX_HWIFS];
-ide_ioreg_t chrp_idedma_regbase;
-
-void __chrp
-chrp_ide_probe(void)
-{
-        struct pci_dev *pdev = pci_find_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, NULL);
-
-        chrp_ide_ports_known = 1;
-
-        if(pdev) {
-                chrp_ide_regbase[0]=pdev->resource[0].start;
-                chrp_ide_regbase[1]=pdev->resource[2].start;
-                chrp_idedma_regbase=pdev->resource[4].start;
-                chrp_ide_irq=pdev->irq;
-        }
-}
 
-void __chrp
-chrp_ide_insw(ide_ioreg_t port, void *buf, int ns)
-{
-	ide_insw(port+_IO_BASE, buf, ns);
-}
-
-void __chrp
-chrp_ide_outsw(ide_ioreg_t port, void *buf, int ns)
-{
-	ide_outsw(port+_IO_BASE, buf, ns);
-}
-
-int __chrp
-chrp_ide_default_irq(ide_ioreg_t base)
-{
-        if (chrp_ide_ports_known == 0)
-	        chrp_ide_probe();
-	return chrp_ide_irq;
-}
-
-ide_ioreg_t __chrp
-chrp_ide_default_io_base(int index)
-{
-        if (chrp_ide_ports_known == 0)
-	        chrp_ide_probe();
-	return chrp_ide_regbase[index];
-}
-
-int __chrp
+static int __chrp
 chrp_ide_check_region(ide_ioreg_t from, unsigned int extent)
 {
         return check_region(from, extent);
 }
 
-void __chrp
+static void __chrp
 chrp_ide_request_region(ide_ioreg_t from,
 			unsigned int extent,
 			const char *name)
@@ -506,14 +444,14 @@
         request_region(from, extent, name);
 }
 
-void __chrp
+static void __chrp
 chrp_ide_release_region(ide_ioreg_t from,
 			unsigned int extent)
 {
         release_region(from, extent);
 }
 
-void __chrp
+static void __chrp
 chrp_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
 {
 	ide_ioreg_t reg = data_port;
@@ -523,20 +461,42 @@
 		hw->io_ports[i] = reg;
 		reg += 1;
 	}
-	if (ctrl_port) {
-		hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
+	hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
+}
+#endif
+
+/*
+ * One of the main thing these mappings are needed for is so that
+ * xmon can get to the serial port early on.  We probably should
+ * handle the machines with the mpc106 as well as the python (F50)
+ * and the GG2 (longtrail).  Actually we should look in the device
+ * tree and do the right thing.
+ */
+static void __init
+chrp_map_io(void)
+{
+	char *name;
+
+	/*
+	 * The code below tends to get removed, please don't take it out.
+	 * The F50 needs this mapping and it you take it out I'll track you
+	 * down and slap your hands.  If it causes problems please email me.
+	 *  -- Cort <cort@fsmlabs.com>
+	 */
+	name = get_property(find_path_device("/"), "name", NULL);
+	if (name && strncmp(name, "IBM-70", 6) == 0
+	    && strstr(name, "-F50")) {
+		io_block_mapping(0x80000000, 0x80000000, 0x10000000, _PAGE_IO);
+		io_block_mapping(0x90000000, 0x90000000, 0x10000000, _PAGE_IO);
+		return;
 	} else {
-		hw->io_ports[IDE_CONTROL_OFFSET] = 0;
+		io_block_mapping(0xf8000000, 0xf8000000, 0x04000000, _PAGE_IO);
 	}
-	if (irq != NULL)
-		hw->irq = chrp_ide_irq;
 }
 
-#endif
-
 void __init
-	   chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
-		     unsigned long r6, unsigned long r7)
+chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
+	  unsigned long r6, unsigned long r7)
 {
 #ifdef CONFIG_BLK_DEV_INITRD
 	/* take care of initrd if we have one */
@@ -576,6 +536,7 @@
 	ppc_md.calibrate_decr = chrp_calibrate_decr;
 
 	ppc_md.find_end_of_memory = pmac_find_end_of_memory;
+	ppc_md.setup_io_mappings = chrp_map_io;
 
 #ifdef CONFIG_VT
 	/* these are adjusted in chrp_init2 if we have an ADB keyboard */
@@ -608,22 +569,23 @@
 		}
 	}
 #ifdef CONFIG_BOOTX_TEXT
-	if (ppc_md.progress == NULL && bootx_text_mapped)
-		ppc_md.progress = bootx_text_progress;
+	if (ppc_md.progress == NULL && boot_text_mapped)
+		ppc_md.progress = btext_progress;
 #endif
 
+#ifdef CONFIG_SMP
+#ifndef CONFIG_POWER4
+	ppc_md.smp_ops = &chrp_smp_ops;
+#else
+	ppc_md.smp_ops = &xics_smp_ops;
+#endif /* CONFIG_POWER4 */
+#endif /* CONFIG_SMP */
+
 #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
-        ppc_ide_md.insw = chrp_ide_insw;
-        ppc_ide_md.outsw = chrp_ide_outsw;
-        ppc_ide_md.default_irq = chrp_ide_default_irq;
-        ppc_ide_md.default_io_base = chrp_ide_default_io_base;
         ppc_ide_md.ide_check_region = chrp_ide_check_region;
         ppc_ide_md.ide_request_region = chrp_ide_request_region;
         ppc_ide_md.ide_release_region = chrp_ide_release_region;
-        ppc_ide_md.fix_driveid = ppc_generic_ide_fix_driveid;
         ppc_ide_md.ide_init_hwif = chrp_ide_init_hwif_ports;
-
-        ppc_ide_md.io_base = _IO_BASE;
 #endif
 
 	/*
@@ -668,7 +630,7 @@
 
 #ifdef CONFIG_BOOTX_TEXT
 void
-bootx_text_progress(char *s, unsigned short hex)
+btext_progress(char *s, unsigned short hex)
 {
 	prom_print(s);
 	prom_print("\n");
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/chrp_smp.c linux/arch/ppc/kernel/chrp_smp.c
--- v2.4.9/linux/arch/ppc/kernel/chrp_smp.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/kernel/chrp_smp.c	Sat Sep  8 12:38:41 2001
@@ -0,0 +1,149 @@
+/*
+ * BK Id: %F% %I% %G% %U% %#%
+ */
+/*
+ * Smp support for CHRP machines.
+ *
+ * Written by Cort Dougan (cort@cs.nmt.edu) borrowing a great
+ * deal of code from the sparc and intel versions.
+ *
+ * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/smp.h>
+#include <linux/smp_lock.h>
+#include <linux/interrupt.h>
+#include <linux/kernel_stat.h>
+#include <linux/delay.h>
+#define __KERNEL_SYSCALLS__
+#include <linux/unistd.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+
+#include <asm/ptrace.h>
+#include <asm/atomic.h>
+#include <asm/irq.h>
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/hardirq.h>
+#include <asm/softirq.h>
+#include <asm/sections.h>
+#include <asm/io.h>
+#include <asm/prom.h>
+#include <asm/smp.h>
+#include <asm/residual.h>
+#include <asm/feature.h>
+#include <asm/time.h>
+
+#include "open_pic.h"
+
+extern unsigned long smp_chrp_cpu_nr;
+
+static int __init
+smp_chrp_probe(void)
+{
+	if (smp_chrp_cpu_nr > 1)
+		openpic_request_IPIs();
+
+	return smp_chrp_cpu_nr;
+}
+
+static void __init
+smp_chrp_kick_cpu(int nr)
+{
+	*(unsigned long *)KERNELBASE = nr;
+	asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory");
+}
+
+static void __init
+smp_chrp_setup_cpu(int cpu_nr)
+{
+	static atomic_t ready = ATOMIC_INIT(1);
+	static volatile int frozen = 0;
+
+	if (cpu_nr == 0) {
+		/* wait for all the others */
+		while (atomic_read(&ready) < smp_num_cpus)
+			barrier();
+		atomic_set(&ready, 1);
+		/* freeze the timebase */
+		call_rtas("freeze-time-base", 0, 1, NULL);
+		mb();
+		frozen = 1;
+		/* XXX assumes this is not a 601 */
+		set_tb(0, 0);
+		last_jiffy_stamp(0) = 0;
+		while (atomic_read(&ready) < smp_num_cpus)
+			barrier();
+		/* thaw the timebase again */
+		call_rtas("thaw-time-base", 0, 1, NULL);
+		mb();
+		frozen = 0;
+		smp_tb_synchronized = 1;
+	} else {
+		atomic_inc(&ready);
+		while (!frozen)
+			barrier();
+		set_tb(0, 0);
+		last_jiffy_stamp(0) = 0;
+		mb();
+		atomic_inc(&ready);
+		while (frozen)
+			barrier();
+	}
+
+	if (OpenPIC_Addr)
+		do_openpic_setup_cpu();
+}
+
+#ifdef CONFIG_POWER4
+static void __chrp
+smp_xics_message_pass(int target, int msg, unsigned long data, int wait)
+{
+	/* for now, only do reschedule messages
+	   since we only have one IPI */
+	if (msg != PPC_MSG_RESCHEDULE)
+		return;
+	for (i = 0; i < smp_num_cpus; ++i) {
+		if (target == MSG_ALL || target == i
+		    || (target == MSG_ALL_BUT_SELF
+			&& i != smp_processor_id()))
+			xics_cause_IPI(i);
+	}
+}
+
+static int __chrp
+smp_xics_probe(void)
+{
+	return smp_chrp_cpu_nr;
+}
+
+static void __chrp
+smp_xics_setup_cpu(int cpu_nr)
+{
+	if (cpu_nr > 0)
+		xics_setup_cpu();
+}
+#endif /* CONFIG_POWER4 */
+
+/* CHRP with openpic */
+struct smp_ops_t chrp_smp_ops __chrpdata = {
+	smp_openpic_message_pass,
+	smp_chrp_probe,
+	smp_chrp_kick_cpu,
+	smp_chrp_setup_cpu,
+};
+
+#ifdef CONFIG_POWER4
+/* CHRP with new XICS interrupt controller */
+struct smp_ops_t xics_smp_ops __chrpdata = {
+	smp_xics_message_pass,
+	smp_xics_probe,
+	smp_chrp_kick_cpu,
+	smp_xics_setup_cpu,
+};
+#endif /* CONFIG_POWER4 */
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/chrp_time.c linux/arch/ppc/kernel/chrp_time.c
--- v2.4.9/linux/arch/ppc/kernel/chrp_time.c	Mon May 21 17:04:46 2001
+++ linux/arch/ppc/kernel/chrp_time.c	Sat Sep  8 12:38:41 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.chrp_time.c 1.7 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.chrp_time.c 1.10 09/08/01 15:47:42 paulus
  */
 /*
  *  linux/arch/i386/kernel/time.c
@@ -29,7 +29,7 @@
 #include <asm/processor.h>
 #include <asm/nvram.h>
 #include <asm/prom.h>
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/time.h>
 
 extern spinlock_t rtc_lock;
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/cputable.c linux/arch/ppc/kernel/cputable.c
--- v2.4.9/linux/arch/ppc/kernel/cputable.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/kernel/cputable.c	Tue Aug 28 06:58:33 2001
@@ -0,0 +1,283 @@
+/*
+ * BK Id: %F% %I% %G% %U% %#%
+ */
+/*
+ *  arch/ppc/kernel/cputable.c
+ *
+ *  Copyright (C) 2001 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.
+ */
+
+#include <linux/config.h>
+#include <linux/string.h>
+#include <linux/sched.h>
+#include <linux/threads.h>
+#include <linux/init.h>
+#include <asm/cputable.h>
+
+struct cpu_spec* cur_cpu_spec[NR_CPUS];
+
+extern void __setup_cpu_601(int cpu_nr);
+extern void __setup_cpu_603(int cpu_nr);
+extern void __setup_cpu_604(int cpu_nr);
+extern void __setup_cpu_750(int cpu_nr);
+extern void __setup_cpu_7400(int cpu_nr);
+extern void __setup_cpu_7450(int cpu_nr);
+extern void __setup_cpu_power3(int cpu_nr);
+extern void __setup_cpu_power4(int cpu_nr);
+extern void __setup_cpu_8xx(int cpu_nr);
+extern void __setup_cpu_generic(int cpu_nr);
+
+#define CLASSIC_PPC (!defined(CONFIG_8xx) && 	 \
+		     !defined(CONFIG_4xx) && !defined(CONFIG_POWER3) &&  \
+		     !defined(CONFIG_POWER4) && !defined(CONFIG_PPC_ISERIES))
+
+/* This table only contains "desktop" CPUs, it need to be filled with embedded
+ * ones as well...
+ */
+#define COMMON_PPC	(PPC_FEATURE_32 | PPC_FEATURE_HAS_FPU | \
+			 PPC_FEATURE_HAS_MMU)
+
+/* We only set the altivec features if the kernel was compiled with altivec
+ * support
+ */
+#ifdef CONFIG_ALTIVEC
+#define CPU_FTR_ALTIVEC_COMP	CPU_FTR_ALTIVEC
+#else
+#define CPU_FTR_ALTIVEC_COMP	0
+#endif
+
+struct cpu_spec	cpu_specs[] = {
+#if CLASSIC_PPC
+    { 	/* 601 */
+	0xffff0000, 0x00010000, "601",
+	CPU_FTR_601 | CPU_FTR_HPTE_TABLE,
+	COMMON_PPC | PPC_FEATURE_601_INSTR | PPC_FEATURE_UNIFIED_CACHE,
+	32, 32,
+	__setup_cpu_601
+    },
+    {	/* 603 */
+    	0xffff0000, 0x00030000, "603",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB,
+	COMMON_PPC,
+    	32, 32,
+	__setup_cpu_603
+    },
+    {	/* 603e */
+    	0xffff0000, 0x00060000, "603e",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB,
+	COMMON_PPC,
+	32, 32,
+	__setup_cpu_603
+    },
+    {	/* 603ev */
+    	0xffff0000, 0x00070000, "603ev",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB,
+	COMMON_PPC,
+	32, 32,
+	__setup_cpu_603
+    },
+    {	/* 604 */
+    	0xffff0000, 0x00040000, "604",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON |
+	CPU_FTR_HPTE_TABLE,
+	COMMON_PPC,
+	32, 32,
+	__setup_cpu_604
+    },
+    {	/* 604e */
+    	0xfffff000, 0x00090000, "604e",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON |
+	CPU_FTR_HPTE_TABLE,
+	COMMON_PPC,
+	32, 32,
+	__setup_cpu_604
+    },
+    {	/* 604r */
+    	0xffff0000, 0x00090000, "604r",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON |
+	CPU_FTR_HPTE_TABLE,
+	COMMON_PPC,
+	32, 32,
+	__setup_cpu_604
+    },
+    {	/* 604ev */
+    	0xffff0000, 0x000a0000, "604ev",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON |
+	CPU_FTR_HPTE_TABLE,
+	COMMON_PPC,
+	32, 32,
+	__setup_cpu_604
+    },
+    {	/* 750 (0x4202, don't support TAU ?) */
+    	0xffffffff, 0x00084202, "750",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
+	CPU_FTR_L2CR | CPU_FTR_HPTE_TABLE,
+	COMMON_PPC,
+	32, 32,
+	__setup_cpu_750
+    },
+    {	/* 750CX */
+    	0xffffff00, 0x00082200, "750CX",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
+	CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE,
+	COMMON_PPC,
+	32, 32,
+	__setup_cpu_750
+    },
+    {	/* 740/750 (L2CR bit need fixup for 740) */
+    	0xffff0000, 0x00080000, "740/750",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
+	CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE,
+	COMMON_PPC,
+	32, 32,
+	__setup_cpu_750
+    },
+    {	/* 7400 rev 1.1 ? (no TAU) */
+    	0xffffffff, 0x000c1101, "7400 (1.1)",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
+	CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE,
+	COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
+	32, 32,
+	__setup_cpu_7400
+    },
+    {	/* 7400 */
+    	0xffff0000, 0x000c0000, "7400",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
+	CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE,
+	COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
+	32, 32,
+	__setup_cpu_7400
+    },
+    {	/* 7410 */
+    	0xffff0000, 0x800c0000, "7410",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
+	CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE,
+	COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
+	32, 32,
+	__setup_cpu_7400
+    },
+    {	/* 7450 */
+    	0xffff0000, 0x80000000, "7450",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
+	CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP |
+	CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450,
+	COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
+	32, 32,
+	__setup_cpu_7450
+    },
+    {	/* 82xx (8240, 8245, 8260 are all 603e cores) */
+	0xffff0000, 0x00810000, "82xx",
+	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB,
+	COMMON_PPC,
+	32, 32,
+	__setup_cpu_603
+    },
+    {	/* default match, we assume split I/D cache & TB (non-601)... */
+    	0x00000000, 0x00000000, "(generic PPC)",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE,
+	COMMON_PPC,
+	32, 32,
+	__setup_cpu_generic
+    },
+#endif /* CLASSIC_PPC */    
+#ifdef CONFIG_PPC64BRIDGE
+    {	/* Power3 */
+    	0xffff0000, 0x00400000, "Power3 (630)",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE,
+    	COMMON_PPC | PPC_FEATURE_64,
+	128, 128,
+	__setup_cpu_power3
+    },
+    {	/* Power3+ */
+    	0xffff0000, 0x00410000, "Power3 (630+)",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE,
+    	COMMON_PPC | PPC_FEATURE_64,
+	128, 128,
+	__setup_cpu_power3
+    },
+	{	/* I-star */
+		0xffff0000, 0x00360000, "I-star",
+		CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE,
+		COMMON_PPC | PPC_FEATURE_64,
+		128, 128,
+		__setup_cpu_power3
+	},
+	{	/* S-star */
+		0xffff0000, 0x00370000, "S-star",
+		CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE,
+		COMMON_PPC | PPC_FEATURE_64,
+		128, 128,
+		__setup_cpu_power3
+	},
+#endif /* CONFIG_PPC64BRIDGE */    
+#ifdef CONFIG_POWER4
+    {	/* Power4 */
+    	0xffff0000, 0x00350000, "Power4",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE,
+    	COMMON_PPC | PPC_FEATURE_64,
+	128, 128,
+	__setup_cpu_power4
+    },
+#endif /* CONFIG_POWER4 */    
+#ifdef CONFIG_8xx
+    {	/* 8xx */
+    	0xffff0000, 0x00500000, "8xx",
+		/* CPU_FTR_CAN_DOZE is possible, if the 8xx code is there.... */
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB,
+    	PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
+ 	16, 16,
+	0, __setup_cpu_8xx
+    },
+#endif /* CONFIG_8xx */
+#ifdef CONFIG_4xx
+    {	/* 403GC */
+    	0xffffff00, 0x00200200, "403GC",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB,
+    	PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
+	16, 16,
+	0, /*__setup_cpu_403 */
+    },
+    {	/* 403GCX */
+    	0xffffff00, 0x00201400, "403GCX",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB,
+    	PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
+	16, 16,
+	0, /*__setup_cpu_403 */
+    },
+    {	/* 403G ?? */
+    	0xffff0000, 0x00200000, "403G ??",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB,
+    	PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
+	16, 16,
+	0, /*__setup_cpu_403 */
+    },
+    {	/* 405GP */
+    	0xffff0000, 0x40110000, "405GP",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB,
+    	PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
+	32, 32,
+	0, /*__setup_cpu_405 */
+    },
+    {	/* STB 03xxx */
+    	0xffff0000, 0x40130000, "STB03xxx",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB,
+    	PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
+	32, 32,
+	0, /*__setup_cpu_405 */
+    },
+#endif /* CONFIG_4xx */
+#if !CLASSIC_PPC
+    {	/* default match */
+    	0x00000000, 0x00000000, "(generic PPC)",
+    	0,
+    	PPC_FEATURE_32,
+	32, 32,
+	0,
+    }
+#endif /* !CLASSIC_PPC */
+};
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/entry.S linux/arch/ppc/kernel/entry.S
--- v2.4.9/linux/arch/ppc/kernel/entry.S	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/kernel/entry.S	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.entry.S 1.20 07/19/01 23:02:48 paulus
+ * BK Id: SCCS/s.entry.S 1.22 08/15/01 22:43:06 paulus
  */
 /*
  *  PowerPC version 
@@ -23,12 +23,14 @@
  */
 
 #include "ppc_asm.h"
+#include <linux/config.h>
+#include <linux/errno.h>
+#include <linux/sys.h>
+#include <linux/threads.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <linux/errno.h>
-#include <linux/sys.h>
-#include <linux/config.h>
+#include <asm/cputable.h>
 
 #undef SHOW_SYSCALLS
 #undef SHOW_SYSCALLS_TASK
@@ -217,7 +219,9 @@
 	mfmsr	r22
 	li	r0,MSR_FP	/* Disable floating-point */
 #ifdef CONFIG_ALTIVEC
-	oris	r0,r0,MSR_VEC@h
+BEGIN_FTR_SECTION
+	oris	r0,r0,MSR_VEC@h	/* Disable altivec */
+END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
 #endif /* CONFIG_ALTIVEC */
 	andc	r22,r22,r0
 	mtmsr	r22
@@ -238,21 +242,6 @@
 	tophys(r0,r4)
 	CLR_TOP32(r0)
 	mtspr	SPRG3,r0	/* Update current THREAD phys addr */
-#ifdef CONFIG_8xx
-	/* XXX it would be nice to find a SPRGx for this on 6xx,7xx too */
-	lwz	r9,PGDIR(r4)	/* cache the page table root */
-        tophys(r9,r9)		/* convert to phys addr */
-#ifdef CONFIG_8xx_CPU6
-	lis	r6, cpu6_errata_word@h
-	ori	r6, r6, cpu6_errata_word@l
-	li	r5, 0x3980
-	stw	r5, 8(r6)
-	lwz	r5, 8(r6)
-#endif
-        mtspr   M_TWB,r9	/* Update MMU base address */
-	tlbia
-	sync
-#endif /* CONFIG_8xx */
 	lwz	r1,KSP(r4)	/* Load new stack pointer */
 	/* save the old current 'last' for return value */
 	mr	r3,r2
@@ -328,19 +317,16 @@
 	andi.	r0,r0,MSR_PR
 	beq+	1f
 #ifdef CONFIG_ALTIVEC
-	mfpvr	r8			/* check if we are on a G4 */
-	srwi	r8,r8,16
-	cmpwi	r8,PVR_7400@h
-	bne	2f
+BEGIN_FTR_SECTION
 	lwz	r0,THREAD+THREAD_VRSAVE(r2)
-	mtspr	SPRN_VRSAVE,r0		/* if so, restore VRSAVE reg */
-2:
+	mtspr	SPRN_VRSAVE,r0		/* if G4, restore VRSAVE reg */
+END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
 #endif /* CONFIG_ALTIVEC */
 	addi	r0,r1,INT_FRAME_SIZE	/* size of frame */
 	stw	r0,THREAD+KSP(r2)	/* save kernel stack pointer */
 	tophys(r8,r1)
 	CLR_TOP32(r8)
-	mtspr	SPRG2,r8		/* phys exception stack pointer */	
+	mtspr	SPRG2,r8		/* phys exception stack pointer */
 1:
 	lwz	r3,_CTR(r1)
 	lwz	r0,_LINK(r1)
@@ -348,15 +334,32 @@
 	mtlr	r0
 	REST_4GPRS(3, r1)
 	REST_2GPRS(7, r1)
+
+	/* We have to "dummy" load from the context save area in case
+	 * these instructions cause an MMU fault.  If this happens
+	 * after we load SRR0/SRR1, our return context is hosed.  -- Dan
+	 */
+	lwz	r0,GPR0(r1)
+	lwz	r0,GPR2(r1)
+	lwz	r0,GPR1(r1)
+
+	/* We re-use r3,r4 here (the load above was to cause the MMU
+	 * fault if necessary).  Using r3,r4 removes the need to "dummy"
+	 * load the CCR and NIP.  Since we load them we may as well
+	 * use them.
+	 */
+	lwz	r3,_CCR(r1)
+	lwz	r4,_NIP(r1)
+
 	lwz	r0,_MSR(r1)
 	FIX_SRR1(r0,r2)
 	mtspr	SRR1,r0
-	lwz	r2,_CCR(r1)
-	mtcrf	0xFF,r2
-	lwz	r2,_NIP(r1)
-	mtspr	SRR0,r2
+	mtcrf	0xFF,r3
+	mtspr	SRR0,r4
 	lwz	r0,GPR0(r1)
 	lwz	r2,GPR2(r1)
+	lwz	r3,GPR3(r1)
+	lwz	r4,GPR4(r1)
 	lwz	r1,GPR1(r1)
 	SYNC
 	RFI
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/feature.c linux/arch/ppc/kernel/feature.c
--- v2.4.9/linux/arch/ppc/kernel/feature.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/kernel/feature.c	Sat Sep  8 12:38:41 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.feature.c 1.16 07/06/01 14:42:47 trini
+ * BK Id: SCCS/s.feature.c 1.21 09/08/01 15:47:42 paulus
  */
 /*
  *  arch/ppc/kernel/feature.c
@@ -20,7 +20,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/spinlock.h>
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/errno.h>
 #include <asm/ohare.h>
 #include <asm/heathrow.h>
@@ -38,11 +38,15 @@
 #define FREG(c,r)			(&(((c)->reg)[(r)>>2]))
 
 /* Keylargo reg. access. */
-#define KL_FCR(r)	(keylargo_base + ((r) >> 2))
-#define KL_IN(r)	(in_le32(KL_FCR(r)))
-#define KL_OUT(r,v)	(out_le32(KL_FCR(r), (v)))
-#define KL_BIS(r,v)	(KL_OUT((r), KL_IN(r) | (v)))
-#define KL_BIC(r,v)	(KL_OUT((r), KL_IN(r) & ~(v)))
+#define KL_FCR(r)		(keylargo_base + ((r) >> 2))
+#define KL_IN(r)		(in_le32(KL_FCR(r)))
+#define KL_OUT(r,v)		(out_le32(KL_FCR(r), (v)))
+#define KL_BIS(r,v)		(KL_OUT((r), KL_IN(r) | (v)))
+#define KL_BIC(r,v)		(KL_OUT((r), KL_IN(r) & ~(v)))
+#define KL_GPIO_IN(r)		(in_8(((volatile u8 *)keylargo_base)+(r)))
+#define KL_GPIO_OUT(r,v)	(out_8(((volatile u8 *)keylargo_base)+(r), (v)))
+#define KL_LOCK()		spin_lock_irqsave(&keylargo->lock, flags)
+#define KL_UNLOCK()		spin_unlock_irqrestore(&keylargo->lock, flags)
 
 /* Uni-N reg. access. Note that Uni-N regs are big endian */
 #define UN_REG(r)	(uninorth_base + ((r) >> 2))
@@ -259,15 +263,29 @@
 static int				uninorth_rev;
 static int				keylargo_rev;
 static u32				board_features;
-static u8				airport_pwr_regs[5];
 static int				airport_pwr_state;
 static struct device_node*		airport_dev;
+static struct device_node*		uninorth_fw;
 
+/* Feature bits for Apple motherboards */
 #define FTR_NEED_OPENPIC_TWEAK		0x00000001
 #define FTR_CAN_NAP			0x00000002
 #define FTR_HAS_FW_POWER		0x00000004
 #define FTR_CAN_SLEEP			0x00000008
 
+/* This table currently lacks most oldworld machines, but
+ * they currently don't need it so...
+ * 
+ * Todo: The whole feature_xxx mecanism need to be redone
+ * some way to be able to handle the new kind of features
+ * exposed by core99. At this point, the main "tables" will
+ * probably be in this table, which will have to be filled with
+ * all known machines
+ */
+/* Warning: Don't change ordering of entries as some machines
+ * adverstise beeing compatible with several models. In those
+ * case, the "highest" has to be first
+ */
 static struct board_features_t {
 	char*	compatible;
 	u32	features;
@@ -283,17 +301,21 @@
   {	"PowerMac3,1",		FTR_NEED_OPENPIC_TWEAK		}, /* Sawtooth (G4) */
   {	"PowerMac3,2",		0				}, /* G4/Dual G4 */
   {	"PowerMac3,3",		FTR_NEED_OPENPIC_TWEAK		}, /* G4/Dual G4 */
-  {	"PowerMac5,1",		0				}, /* Cube */
+  {	"PowerMac3,4",		0				}, /* QuickSilver G4 */
+  {	"PowerMac3,5",		0				}, /* QuickSilver G4 */
+  {	"PowerMac5,1",		FTR_CAN_NAP			}, /* Cube */
   {	"AAPL,3400/2400",	FTR_CAN_SLEEP			}, /* 2400/3400 PowerBook */
   {	"AAPL,3500",		FTR_CAN_SLEEP			}, /* 3500 PowerBook (G3) */
   {	"AAPL,PowerBook1998",	FTR_CAN_SLEEP			}, /* Wallstreet PowerBook */
   {	"PowerBook1,1",		FTR_CAN_SLEEP			}, /* 101 (Lombard) PowerBook */
+  {	"PowerBook4,1",		FTR_CAN_NAP|FTR_CAN_SLEEP|	   /* New polycarbonate iBook */
+  				0/*FTR_HAS_FW_POWER*/		}, 
   {	"PowerBook2,1",		FTR_CAN_SLEEP 			}, /* iBook */
-  {	"PowerBook4,1",		FTR_CAN_NAP|FTR_CAN_SLEEP	}, /* iBook Dual USB */
   {	"PowerBook2,2",		FTR_CAN_SLEEP /*| FTR_CAN_NAP*/	}, /* iBook FireWire */
   {	"PowerBook3,1",		FTR_CAN_SLEEP|FTR_CAN_NAP|	   /* PowerBook 2000 (Pismo) */
   				FTR_HAS_FW_POWER		}, 
-  {	"PowerBook3,2",		FTR_CAN_NAP|FTR_CAN_SLEEP	}, /* PowerBook Titanium */
+  {	"PowerBook3,2",		FTR_CAN_NAP|FTR_CAN_SLEEP|	   /* PowerBook Titanium */
+  				0/*FTR_HAS_FW_POWER*/		},
   {	NULL, 0 }
 };
 
@@ -305,15 +327,25 @@
 	struct device_node *np;
 	u32 *rev;
 	int i;
-
+	char* model;
+	
 	if (_machine != _MACH_Pmac)
 		return;
 
-	/* Figure out motherboard type & options */
-	for(i=0;board_features_datas[i].compatible;i++) {
-		if (machine_is_compatible(board_features_datas[i].compatible)) {
-			board_features = board_features_datas[i].features;
-			break;
+	np = find_path_device("/");
+	if (!np) {
+		printk(KERN_ERR "feature.c: Can't find device-tree root !\n");
+		return;
+	}
+	model = (char*)get_property(np, "model", NULL);
+	if (model) {
+		printk("PowerMac model: %s\n", model);
+		/* Figure out motherboard type & options */
+		for(i=0;board_features_datas[i].compatible;i++) {
+			if (!strcmp(board_features_datas[i].compatible, model)) {
+				board_features = board_features_datas[i].features;
+				break;
+			}
 		}
 	}
 
@@ -382,8 +414,9 @@
 		printk("Uninorth at 0x%08x\n", np->addrs[0].address);
 	}
 	if (uninorth_base && keylargo_base)
-		printk("Uni-N revision: %d, KeyLargo revision: %d\n",
-			uninorth_rev, keylargo_rev);
+		printk("Uni-N revision: %d, KeyLargo revision: %d %s\n",
+			uninorth_rev, keylargo_rev,
+			(keylargo_rev & KL_PANGEA_REV) ? "(Pangea chipset)" : "");
 
 	if (uninorth_base)
 		uninorth_init();
@@ -402,6 +435,25 @@
 		feature_clear(controllers[0].device, FEATURE_Sound_CLK_enable);
 	}
 #endif
+
+#ifdef CONFIG_PMAC_PBOOK
+	/* On PowerBooks, we disable the serial ports by default, they
+	 * will be re-enabled by the driver
+	 */
+#ifndef CONFIG_XMON
+	if (controller_count && find_devices("via-pmu") != NULL) {
+		feature_set_modem_power(NULL, 0);
+		feature_clear(controllers[0].device, FEATURE_Serial_IO_A);
+		feature_clear(controllers[0].device, FEATURE_Serial_IO_B);
+		feature_clear(controllers[0].device, FEATURE_Serial_enable);
+		if (controller_count > 1) {
+			feature_clear(controllers[1].device, FEATURE_Serial_IO_A);
+			feature_clear(controllers[1].device, FEATURE_Serial_IO_B);
+			feature_clear(controllers[1].device, FEATURE_Serial_enable);
+		}
+	}
+#endif
+#endif
 }
 
 static struct feature_controller __init *
@@ -588,12 +640,16 @@
 	/* TODO: Handle save/restore of PCI config space here
 	 */
 
-	spin_lock_irqsave(&keylargo->lock, flags);
+	/* XXX We use the keylargo spinlock, but we never
+	 * have uninorth without keylargo, so...
+	 */
+	KL_LOCK();
 	if (power)
 		UN_BIS(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_GMAC);
 	else
 		UN_BIC(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_GMAC);
-	spin_unlock_irqrestore(&keylargo->lock, flags);
+	(void)UN_IN(UNI_N_CLOCK_CNTL);
+	KL_UNLOCK();
 	udelay(20);
 }
 
@@ -605,17 +661,16 @@
 	if (!keylargo_base || !keylargo)
 		return;
 		
-	spin_lock_irqsave(&keylargo->lock, flags);
-	out_8((volatile u8 *)KL_FCR(KL_GPIO_ETH_PHY_RESET),
-		KEYLARGO_GPIO_OUTPUT_ENABLE);
-	(void)in_8((volatile u8 *)KL_FCR(KL_GPIO_ETH_PHY_RESET));
-	spin_unlock_irqrestore(&keylargo->lock, flags);
+	KL_LOCK();
+	KL_GPIO_OUT(KL_GPIO_ETH_PHY_RESET, KEYLARGO_GPIO_OUTPUT_ENABLE);
+	(void)KL_GPIO_IN(KL_GPIO_ETH_PHY_RESET);
+	KL_UNLOCK();
 	mdelay(10);
-	spin_lock_irqsave(&keylargo->lock, flags);
-	out_8((volatile u8 *)KL_FCR(KL_GPIO_ETH_PHY_RESET),
+	KL_LOCK();
+	KL_GPIO_OUT(KL_GPIO_ETH_PHY_RESET,
 		KEYLARGO_GPIO_OUTPUT_ENABLE | KEYLARGO_GPIO_OUTOUT_DATA);
-	(void)in_8((volatile u8 *)KL_FCR(KL_GPIO_ETH_PHY_RESET));
-	spin_unlock_irqrestore(&keylargo->lock, flags);
+	(void)KL_GPIO_IN(KL_GPIO_ETH_PHY_RESET);
+	KL_UNLOCK();
 	mdelay(10);
 }
 
@@ -642,17 +697,23 @@
 	else
 		return;
 
-	spin_lock_irqsave(&keylargo->lock, flags);
+	KL_LOCK();
 	if (power) {
 		/* Turn ON */
 			
 		if (number == 0) {
 			KL_BIC(KEYLARGO_FCR0, (KL0_USB0_PAD_SUSPEND0 | KL0_USB0_PAD_SUSPEND1));
+			(void)KL_IN(KEYLARGO_FCR0);
+			KL_UNLOCK();
 			mdelay(1);
+			KL_LOCK();
 			KL_BIS(KEYLARGO_FCR0, KL0_USB0_CELL_ENABLE);
 		} else {
 			KL_BIC(KEYLARGO_FCR0, (KL0_USB1_PAD_SUSPEND0 | KL0_USB1_PAD_SUSPEND1));
+			KL_UNLOCK();
+			(void)KL_IN(KEYLARGO_FCR0);
 			mdelay(1);
+			KL_LOCK();
 			KL_BIS(KEYLARGO_FCR0, KL0_USB1_CELL_ENABLE);
 		}
 		reg = KL_IN(KEYLARGO_FCR4);
@@ -689,7 +750,7 @@
 		}
 		udelay(1);
 	}
-	spin_unlock_irqrestore(&keylargo->lock, flags);
+	KL_UNLOCK();
 }
 
 void  __pmac
@@ -697,18 +758,25 @@
 {
 	unsigned long flags;
 
-	/* TODO: Handle save/restore of PCI config space here
+	/* TODO: should probably handle save/restore of PCI config space here
 	 */
 		
+	if (!uninorth_fw || (device && uninorth_fw != device))
+		return;
 	if (!uninorth_base)
 		return;
-	spin_lock_irqsave(&keylargo->lock, flags);
+
+	/* XXX We use the keylargo spinlock, but we never
+	 * have uninorth without keylargo, so...
+	 */
+	KL_LOCK();
 	if (power)
 		UN_BIS(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_FW);
 	else
 		UN_BIC(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_FW);
+	(void)UN_IN(UNI_N_CLOCK_CNTL);
+	KL_UNLOCK();
 	udelay(20);
-	spin_unlock_irqrestore(&keylargo->lock, flags);
 }
 
 /* Warning: will kill the PHY.. */
@@ -717,79 +785,159 @@
 {
 	unsigned long flags;
 	u8 gpioValue = power ? 0 : 4;
-	
+
+	if (!uninorth_fw || (device && uninorth_fw != device))
+		return;
 	if (!keylargo_base || !(board_features & FTR_HAS_FW_POWER))
 		return;
-	spin_lock_irqsave(&keylargo->lock, flags);
-	out_8((volatile u8 *)KL_FCR(KL_GPIO_FW_CABLE_POWER), gpioValue);
-	(void)in_8((volatile u8 *)KL_FCR(KL_GPIO_FW_CABLE_POWER));
-	spin_unlock_irqrestore(&keylargo->lock, flags);		
+	KL_LOCK();
+	KL_GPIO_OUT(KL_GPIO_FW_CABLE_POWER, gpioValue);
+	(void)KL_GPIO_IN(KL_GPIO_FW_CABLE_POWER);
+	KL_UNLOCK();		
+}
+
+void
+feature_set_modem_power(struct device_node* device, int power)
+{
+	unsigned long flags;
+
+	if (!device) {
+		device = find_devices("ch-a");
+		while(device && !device_is_compatible(device, "cobalt"))
+			device = device->next;
+		if (!device)
+			return;
+	}
+	if (keylargo && (keylargo_rev & KL_PANGEA_REV)) {
+		KL_LOCK();
+		if (power) {
+			/* Assert modem reset */
+			KL_GPIO_OUT(KL_GPIO_MODEM_RESET, KEYLARGO_GPIO_OUTPUT_ENABLE);
+			(void)KL_GPIO_IN(KL_GPIO_MODEM_RESET);
+			udelay(10);
+			/* Power up modem */
+			KL_GPIO_OUT(KL_GPIO_MODEM_POWER, KEYLARGO_GPIO_OUTPUT_ENABLE);
+			(void)KL_GPIO_IN(KL_GPIO_MODEM_POWER);
+			udelay(10);
+			/* Release modem reset */
+			KL_GPIO_OUT(KL_GPIO_MODEM_RESET,
+				KEYLARGO_GPIO_OUTPUT_ENABLE | KEYLARGO_GPIO_OUTOUT_DATA);
+			(void)KL_GPIO_IN(KL_GPIO_MODEM_RESET);
+		} else {
+			/* Power down modem */
+			KL_GPIO_OUT(KL_GPIO_MODEM_POWER,
+				KEYLARGO_GPIO_OUTPUT_ENABLE | KEYLARGO_GPIO_OUTOUT_DATA);
+			(void)KL_GPIO_IN(KL_GPIO_MODEM_POWER);
+		}
+		KL_UNLOCK();
+	} else {
+		if (power) {
+			mdelay(300);
+			feature_set(device, FEATURE_Modem_power);
+	   		mdelay(5);
+			feature_clear(device, FEATURE_Modem_power);
+	   		mdelay(10);
+			feature_set(device, FEATURE_Modem_power);
+		} else {
+			feature_clear(device, FEATURE_Modem_power);
+			mdelay(10);
+		}
+	}
 }
 
 #ifdef CONFIG_SMP
 void __pmac
 feature_core99_kick_cpu(int cpu_nr)
 {
-#if 1 /* New way */
 	const int reset_lines[] = {	KL_GPIO_RESET_CPU0,
 					KL_GPIO_RESET_CPU1,
 					KL_GPIO_RESET_CPU2,
 					KL_GPIO_RESET_CPU3 };
-	volatile u8* reset_io;
-
+	int reset_io;
+	unsigned long flags;
+	
 	if (!keylargo_base || cpu_nr > 3)
 		return;
-	reset_io = (volatile u8*)KL_FCR(reset_lines[cpu_nr]);
-	out_8(reset_io, KEYLARGO_GPIO_OUTPUT_ENABLE);
-	udelay(1);
-	out_8(reset_io, KEYLARGO_GPIO_OUTPUT_ENABLE | KEYLARGO_GPIO_OUTOUT_DATA);
-#else
-	out_8((volatile u8 *)KL_FCR(KL_GPIO_EXTINT_CPU1), KL_GPIO_EXTINT_CPU1_ASSERT);
+	reset_io = reset_lines[cpu_nr];
+	
+	KL_LOCK();
+	KL_GPIO_OUT(reset_io, KEYLARGO_GPIO_OUTPUT_ENABLE);
+	(void)KL_GPIO_IN(reset_io);
 	udelay(1);
-	out_8((volatile u8 *)KL_FCR(KL_GPIO_EXTINT_CPU1), KL_GPIO_EXTINT_CPU1_RELEASE);
-#endif	
+	KL_GPIO_OUT(reset_io, KEYLARGO_GPIO_OUTPUT_ENABLE | KEYLARGO_GPIO_OUTOUT_DATA);
+	(void)KL_GPIO_IN(reset_io);
+	KL_UNLOCK();
 }
 #endif /* CONFIG_SMP */
 
 void __pmac
 feature_set_airport_power(struct device_node* device, int power)
 {
+	unsigned long flags;
+	
 	if (!keylargo_base || !airport_dev || airport_dev != device)
 		return;
 	if (airport_pwr_state == power)
-		return;
+		return;	
 	if (power) {
-		/* Some if this is from Darwin code, some is from tracing of
-		 * MacOS driver with Macsbug. Some real bit definitions would
-		 * really help here...
+		/* This code is a reproduction of OF enable-cardslot
+		 * and init-wireless methods, slightly hacked until
+		 * I got it working.
 		 */
-		out_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_0), airport_pwr_regs[0]);
-		out_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_1), airport_pwr_regs[1]);
-		out_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_2), airport_pwr_regs[2]);
-		out_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_3), airport_pwr_regs[3]);
-		out_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_4), airport_pwr_regs[4]);
-		udelay(20);
-		out_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_4), 5);
-		udelay(20);
-		out_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_4), 4);
-		mdelay(20);
+		KL_LOCK();
+		KL_GPIO_OUT(KEYLARGO_GPIO_0+0xf, 5);
+		(void)KL_GPIO_IN(KEYLARGO_GPIO_0+0xf);
+		KL_UNLOCK();
+		mdelay(10);
+		KL_LOCK();
+		KL_GPIO_OUT(KEYLARGO_GPIO_0+0xf, 4);
+		(void)KL_GPIO_IN(KEYLARGO_GPIO_0+0xf);
+		KL_UNLOCK();
+
+		mdelay(10);
+
+		KL_LOCK();
 		KL_BIC(KEYLARGO_FCR2, KL2_AIRPORT_RESET_N);
+		(void)KL_IN(KEYLARGO_FCR2);
+		udelay(10);
+		KL_GPIO_OUT(KEYLARGO_GPIO_EXTINT_0+0xb, 0);
+		(void)KL_GPIO_IN(KEYLARGO_GPIO_EXTINT_0+0xb);
+		udelay(10);
+		KL_GPIO_OUT(KEYLARGO_GPIO_EXTINT_0+0xa, 0x28);
+		(void)KL_GPIO_IN(KEYLARGO_GPIO_EXTINT_0+0xa);
+		udelay(10);
+		KL_GPIO_OUT(KEYLARGO_GPIO_EXTINT_0+0xd, 0x28);
+		(void)KL_GPIO_IN(KEYLARGO_GPIO_EXTINT_0+0xd);
+		udelay(10);
+		KL_GPIO_OUT(KEYLARGO_GPIO_0+0xd, 0x28);
+		(void)KL_GPIO_IN(KEYLARGO_GPIO_0+0xd);
+		udelay(10);
+		KL_GPIO_OUT(KEYLARGO_GPIO_0+0xe, 0x28);
+		(void)KL_GPIO_IN(KEYLARGO_GPIO_0+0xe);
+		KL_UNLOCK();
 		udelay(10);
+		KL_OUT(0x1c000, 0);
+		
+		mdelay(1);
 		out_8((volatile u8*)KL_FCR(0x1a3e0), 0x41);
+		(void)in_8((volatile u8*)KL_FCR(0x1a3e0));
 		udelay(10);
+		KL_LOCK();
 		KL_BIS(KEYLARGO_FCR2, KL2_AIRPORT_RESET_N);
-		udelay(10);
+		(void)KL_IN(KEYLARGO_FCR2);
+		KL_UNLOCK();
+		mdelay(100);
 	} else {
-		airport_pwr_regs[0] = in_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_0));
-		airport_pwr_regs[1] = in_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_1));
-		airport_pwr_regs[2] = in_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_2));
-		airport_pwr_regs[3] = in_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_3));
-		airport_pwr_regs[4] = in_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_4));
-		out_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_0), 0);
-		out_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_1), 0);
-		out_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_2), 0);
-		out_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_3), 0);
-		out_8((volatile u8*)KL_FCR(KL_GPIO_AIRPORT_4), 0);
+		KL_LOCK();
+		KL_BIC(KEYLARGO_FCR2, KL2_AIRPORT_RESET_N);
+		(void)KL_IN(KEYLARGO_FCR2);
+		KL_GPIO_OUT(KL_GPIO_AIRPORT_0, 0);
+		KL_GPIO_OUT(KL_GPIO_AIRPORT_1, 0);
+		KL_GPIO_OUT(KL_GPIO_AIRPORT_2, 0);
+		KL_GPIO_OUT(KL_GPIO_AIRPORT_3, 0);
+		KL_GPIO_OUT(KL_GPIO_AIRPORT_4, 0);
+		(void)KL_GPIO_IN(KL_GPIO_AIRPORT_4);
+		KL_UNLOCK();
 	}
 	airport_pwr_state = power;	
 }
@@ -826,8 +974,11 @@
 	/* Enable FW before PCI probe. Will be disabled later on
 	 */
 	fw = find_devices("firewire");
-	if (fw && device_is_compatible(fw, "pci106b,18"))
+	if (fw && (device_is_compatible(fw, "pci106b,18") || 
+			device_is_compatible(fw, "pci106b,30"))) {
+		uninorth_fw = fw;
 		feature_set_firewire_power(fw, 1);
+	}
 }
 
 /* Initialize the Core99 KeyLargo ASIC. 
@@ -864,7 +1015,7 @@
 		device_is_compatible(ctrler->device, "gatwick"))
 		ctrler = &controllers[1];
 
-	if (ctrler->bits == feature_bits_heathrow ||
+	if (ctrler->bits == feature_bits_wallstreet ||
 		ctrler->bits == feature_bits_paddington) {
 		heathrow_prepare_for_sleep(ctrler);
 		return;
@@ -884,7 +1035,7 @@
 		device_is_compatible(ctrler->device, "gatwick"))
 		ctrler = &controllers[1];
 	
-	if (ctrler->bits == feature_bits_heathrow ||
+	if (ctrler->bits == feature_bits_wallstreet ||
 		ctrler->bits == feature_bits_paddington) {
 		heathrow_wakeup(ctrler);
 		return;
@@ -929,15 +1080,10 @@
 {
 	u32 temp;
 
-	/* For now, suspending the USB ref cause the machine to die on
-	 * wakeup -- BenH
-	 */
-#if 0
 	mdelay(1);
 	KL_BIS(KEYLARGO_FCR0, KL0_USB_REF_SUSPEND);
 	(void)KL_IN(KEYLARGO_FCR0);
-	mdelay(1500);
-#endif
+	mdelay(100);
 
 	KL_BIC(KEYLARGO_FCR0,	KL0_SCCA_ENABLE | KL0_SCCB_ENABLE |
 				KL0_SCC_CELL_ENABLE |
@@ -1014,7 +1160,7 @@
 core99_prepare_for_sleep(struct feature_controller* ctrler)
 {
 	int i;
-	u8* base8;
+	volatile u8* base8;
 	
 	/*
 	 * Save various bits of KeyLargo
@@ -1026,15 +1172,19 @@
 	feature_set_airport_power(airport_dev, 0);
 
 	/* We power off the FW cable. Should be done by the driver... */
+	feature_set_firewire_power(NULL, 0);
 	feature_set_firewire_cable_power(NULL, 0);
+
+	/* We make sure int. modem is off (in case driver lost it) */
+	feature_set_modem_power(NULL, 0);
 	 
 	/* Save the state of the various GPIOs */
 	save_gpio_levels[0] = KL_IN(KEYLARGO_GPIO_LEVELS0);
 	save_gpio_levels[1] = KL_IN(KEYLARGO_GPIO_LEVELS1);
-	base8 = (u8 *)KL_FCR(KEYLARGO_GPIO_EXTINT_0);
+	base8 = ((volatile u8 *)keylargo_base) + KEYLARGO_GPIO_EXTINT_0;
 	for (i=0; i<KEYLARGO_GPIO_EXTINT_CNT; i++)
 		save_gpio_extint[i] = in_8(base8+i);
-	base8 = (u8 *)KL_FCR(KEYLARGO_GPIO_0);
+	base8 = ((volatile u8 *)keylargo_base) + KEYLARGO_GPIO_0;
 	for (i=0; i<KEYLARGO_GPIO_CNT; i++)
 		save_gpio_normal[i] = in_8(base8+i);
 
@@ -1089,7 +1239,7 @@
 core99_wake_up(struct feature_controller* ctrler)
 {
 	int i;
-	u8* base8;
+	volatile u8* base8;
 
 	/*
 	 * Wakeup the host bridge
@@ -1131,10 +1281,10 @@
 
 	KL_OUT(KEYLARGO_GPIO_LEVELS0, save_gpio_levels[0]);
 	KL_OUT(KEYLARGO_GPIO_LEVELS1, save_gpio_levels[1]);
-	base8 = (u8 *)KL_FCR(KEYLARGO_GPIO_EXTINT_0);
+	base8 = ((volatile u8 *)keylargo_base) + KEYLARGO_GPIO_EXTINT_0;
 	for (i=0; i<KEYLARGO_GPIO_EXTINT_CNT; i++)
 		out_8(base8+i, save_gpio_extint[i]);
-	base8 = (u8 *)KL_FCR(KEYLARGO_GPIO_0);
+	base8 = ((volatile u8 *)keylargo_base) + KEYLARGO_GPIO_0;
 	for (i=0; i<KEYLARGO_GPIO_CNT; i++)
 		out_8(base8+i, save_gpio_normal[i]);
 
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/gemini_setup.c linux/arch/ppc/kernel/gemini_setup.c
--- v2.4.9/linux/arch/ppc/kernel/gemini_setup.c	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/gemini_setup.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.gemini_setup.c 1.7 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.gemini_setup.c 1.11 08/20/01 14:34:41 paulus
  */
 /*
  *  linux/arch/ppc/kernel/setup.c
@@ -54,17 +54,6 @@
 	0, 0, 14, 0, 0, 13, 5, 9, 6, 11, 8, 10, 0, 12, 7, 0
 };
 
-int chrp_get_irq(struct pt_regs *);
-void chrp_post_irq(struct pt_regs* regs, int);
-
-static inline unsigned long _get_HID1(void)
-{
-	unsigned long val;
-
-	__asm__ __volatile__("mfspr %0,1009" : "=r" (val));
-	return val;
-}
-
 /*
  * prom_init is the Gemini version of prom.c:prom_init.  We only need
  * the BSS clearing code, so I copied that out of prom.c.  This is a
@@ -208,10 +197,11 @@
 int
 gemini_get_clock_speed(void)
 {
-	unsigned long hid1, pvr = _get_PVR();
+	unsigned long hid1, pvr;
 	int clock;
 
-	hid1 = (_get_HID1() >> 28) & 0xf;
+	pvr = mfspr(PVR);
+	hid1 = (mfspr(HID1) >> 28) & 0xf;
 	if (PVR_VER(pvr) == 8 ||
 	    PVR_VER(pvr) == 12)
 		hid1 = cpu_7xx[hid1];
@@ -241,11 +231,12 @@
 {
         unsigned char reg, brev, fam, creg;
         unsigned long cache;
-        unsigned long pvr = _get_PVR();
+        unsigned long pvr;
 
         reg = readb(GEMINI_L2CFG);
         brev = readb(GEMINI_BREV);
         fam = readb(GEMINI_FEAT);
+        pvr = mfspr(PVR);
 
         switch(PVR_VER(pvr)) {
 
@@ -486,11 +477,60 @@
 	return total;
 }
 
-void __init gemini_init(unsigned long r3, unsigned long r4, unsigned long r5,
-			unsigned long r6, unsigned long r7)
+static void __init
+gemini_map_io(void)
+{
+	io_block_mapping(0xf0000000, 0xf0000000, 0x10000000, _PAGE_IO);
+	io_block_mapping(0x80000000, 0x80000000, 0x10000000, _PAGE_IO);
+}
+
+#ifdef CONFIG_SMP
+static int
+smp_gemini_probe(void)
+{
+	int i, nr;
+
+        nr = (readb(GEMINI_CPUSTAT) & GEMINI_CPU_COUNT_MASK) >> 2;
+	if (nr == 0)
+		nr = 4;
+
+	if (nr > 1) {
+		openpic_request_IPIs();
+		for (i = 1; i < nr; ++i)
+			smp_hw_index[i] = i;
+	}
+
+	return nr;
+}
+
+static void
+smp_gemini_kick_cpu(int nr)
+{
+	openpic_init_processor( 1<<nr );
+	openpic_init_processor( 0 );
+}
+
+static void
+smp_gemini_setup_cpu(int cpu_nr)
+{
+	if (OpenPIC_Addr)
+		do_openpic_setup_cpu();
+	if (cpu_nr > 0)
+		gemini_init_l2();
+}
+
+static struct smp_ops_t gemini_smp_ops = {
+	smp_openpic_message_pass,
+	smp_gemini_probe,
+	smp_gemini_kick_cpu,
+	smp_gemini_setup_cpu,
+};
+#endif /* CONFIG_SMP */
+
+void __init platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+			  unsigned long r6, unsigned long r7)
 {
 	int i;
-	int chrp_get_irq( struct pt_regs * );
 
 	for(i = 0; i < GEMINI_LEDS; i++)
 		gemini_led_off(i);
@@ -525,6 +565,7 @@
 	ppc_md.calibrate_decr = gemini_calibrate_decr;
 
 	ppc_md.find_end_of_memory = gemini_find_end_of_memory;
+	ppc_md.setup_io_mappings = gemini_map_io;
 
 	/* no keyboard/mouse/video stuff yet.. */
 	ppc_md.kbd_setkeycode = NULL;
@@ -537,4 +578,8 @@
 	ppc_md.ppc_kbd_sysrq_xlate = NULL;
 #endif
 	ppc_md.pcibios_fixup_bus = gemini_pcibios_fixup;
+
+#ifdef CONFIG_SMP
+	ppc_md.smp_ops = &gemini_smp_ops;
+#endif /* CONFIG_SMP */
 }
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/head.S linux/arch/ppc/kernel/head.S
--- v2.4.9/linux/arch/ppc/kernel/head.S	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/kernel/head.S	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.head.S 1.25 07/07/01 17:08:44 paulus
+ * BK Id: SCCS/s.head.S 1.29 08/19/01 22:43:23 paulus
  */
 /*
  *  PowerPC version 
@@ -31,6 +31,7 @@
 #include <asm/page.h>
 #include <asm/mmu.h>
 #include <asm/pgtable.h>
+#include <asm/cputable.h>
 
 #ifdef CONFIG_APUS
 #include <asm/amigappc.h>
@@ -153,7 +154,7 @@
 
 #ifndef CONFIG_GEMINI
 /* Switch MMU off, clear BATs and flush TLB. At this point, r3 contains
- * the physical address we are running at, returned by prom_init()
+ * the physical address we are running at, returned by early_init()
  */
  	bl	mmu_off
 __after_mmu_off:
@@ -761,12 +762,10 @@
 	addi	r24,r1,STACK_FRAME_OVERHEAD
 	stw	r24,PT_REGS(r23)
 #ifdef CONFIG_ALTIVEC
-	mfpvr	r24			/* check if we are on a G4 */
-	srwi	r24,r24,16
-	cmpwi	r24,PVR_7400@h
-	bne	2f
-	mfspr	r22,SPRN_VRSAVE		/* if so, save vrsave register value */
+BEGIN_FTR_SECTION
+	mfspr	r22,SPRN_VRSAVE		/* if G4, save vrsave register value */
 	stw	r22,THREAD_VRSAVE(r23)
+END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
 #endif /* CONFIG_ALTIVEC */
 2:	addi	r2,r23,-THREAD		/* set r2 to current */
 	tovirt(r2,r2)
@@ -1280,10 +1279,13 @@
 	SYNC
 	MTMSRD(r0)
 	isync
-#else
-	bl	enable_caches
 #endif
 
+	lis	r3,-KERNELBASE@h
+	mr	r4,r24
+	bl	identify_cpu
+	bl	call_setup_cpu		/* Call setup_cpu for this CPU */
+
 	/* get current */
 	lis	r2,current_set@h
 	ori	r2,r2,current_set@l
@@ -1322,54 +1324,87 @@
 /*
  * Enable caches and 604-specific features if necessary.
  */
-enable_caches:
-	mfspr	r9,PVR
-	rlwinm	r9,r9,16,16,31
-	cmpi	0,r9,1
-	beq	6f			/* not needed for 601 */
+_GLOBAL(__setup_cpu_601)
+	blr
+_GLOBAL(__setup_cpu_603)
+	b	setup_common_caches
+_GLOBAL(__setup_cpu_604)
+	mflr	r4
+	bl	setup_common_caches
+	bl	setup_604_hid0
+	mtlr	r4
+	blr
+_GLOBAL(__setup_cpu_750)
+	mflr	r4
+	bl	setup_common_caches
+	bl	setup_750_7400_hid0
+	mtlr	r4
+	blr
+_GLOBAL(__setup_cpu_7400)
+	mflr	r4
+	bl	setup_common_caches
+	bl	setup_750_7400_hid0
+	mtlr	r4
+	blr
+_GLOBAL(__setup_cpu_7450)
+	blr
+_GLOBAL(__setup_cpu_power3)
+	blr
+_GLOBAL(__setup_cpu_power4)
+	blr
+_GLOBAL(__setup_cpu_generic)
+	blr
+
+/* Enable caches for 603's, 604, 750 & 7400 */
+setup_common_caches:
 	mfspr	r11,HID0
 	andi.	r0,r11,HID0_DCE
 	ori	r11,r11,HID0_ICE|HID0_DCE
 	ori	r8,r11,HID0_ICFI
-	bne	3f			/* don't invalidate the D-cache */
+	bne	1f			/* don't invalidate the D-cache */
 	ori	r8,r8,HID0_DCI		/* unless it wasn't enabled */
-3:
-	sync
+1:	sync
 	mtspr	HID0,r8			/* enable and invalidate caches */
 	sync
 	mtspr	HID0,r11		/* enable caches */
 	sync
 	isync
-	cmpi	0,r9,4			/* check for 604 */
-	cmpi	1,r9,9			/* or 604e */
-	cmpi	2,r9,10			/* or mach5 / 604r */
-	cmpi	3,r9,8			/* check for 750 (G3) */
-	cmpi	4,r9,12			/* or 7400 (G4) */
-	cror	2,2,6
-	cror	2,2,10
-	bne	4f
-	ori	r11,r11,HID0_SIED|HID0_BHTE /* for 604[e|r], enable */
-	bne	2,5f
-	ori	r11,r11,HID0_BTCD	/* superscalar exec & br history tbl */
-	b	5f
-4:
-	cror	14,14,18
-	bne	3,6f
-	/* for G3/G4:
-	 * enable Store Gathering (SGE), Address Brodcast (ABE),
-	 * Branch History Table (BHTE), Branch Target ICache (BTIC)
-	 */
+	blr
+
+/* 604, 604e, 604ev, ...
+ * Enable superscalar execution & branch history table
+ */
+setup_604_hid0:
+	mfspr	r11,HID0
+	ori	r11,r11,HID0_SIED|HID0_BHTE
+	ori	r8,r11,HID0_BTCD
+	sync
+	mtspr	HID0,r8		/* flush branch target address cache */
+	sync			/* on 604e/604r */
+	mtspr	HID0,r11
+	sync
+	isync
+	blr
+
+/* 740/750/7400/7410
+ * Enable Store Gathering (SGE), Address Brodcast (ABE),
+ * Branch History Table (BHTE), Branch Target ICache (BTIC)
+ * Dynamic Power Management (DPM), Speculative (SPD)
+ * Clear Instruction cache throttling (ICTC)
+ */
+setup_750_7400_hid0:
+	mfspr	r11,HID0
 	ori	r11,r11,HID0_SGE | HID0_ABE | HID0_BHTE | HID0_BTIC
 	oris	r11,r11,HID0_DPM@h	/* enable dynamic power mgmt */
 	li	r3,HID0_SPD
 	andc	r11,r11,r3		/* clear SPD: enable speculative */
  	li	r3,0
  	mtspr	ICTC,r3			/* Instruction Cache Throttling off */
-5:	isync
+	isync
 	mtspr	HID0,r11
 	sync
 	isync
-6:	blr
+	blr
 
 /*
  * Load stuff into the MMU.  Intended to be called with
@@ -1414,9 +1449,10 @@
  * This is where the main kernel code starts.
  */
 start_here:
-#ifndef CONFIG_PPC64BRIDGE
-	bl	enable_caches
-#endif
+	/* Call setup_cpu for CPU 0 */
+	li	r3,0		/* data offset */
+	li	r24,0		/* cpu# */
+	bl	call_setup_cpu
 
 	/* ptr to current */
 	lis	r2,init_task_union@h
@@ -1435,14 +1471,15 @@
 	li	r0,0
 	stwu	r0,-STACK_FRAME_OVERHEAD(r1)
 /*
- * Decide what sort of machine this is and initialize the MMU.
+ * Do early bootinfo parsing, platform-specific initialization,
+ * and set up the MMU.
  */
 	mr	r3,r31
 	mr	r4,r30
 	mr	r5,r29
 	mr	r6,r28
 	mr	r7,r27
-	bl	identify_machine
+	bl	machine_init
 	bl	MMU_init
 
 #ifdef CONFIG_APUS
@@ -1475,12 +1512,10 @@
 /* Load up the kernel context */
 2:
 	sync			/* Force all PTE updates to finish */
+	ISYNC_601
 	tlbia			/* Clear all TLB entries */
 	sync			/* wait for tlbia/tlbie to finish */
-#ifdef CONFIG_SMP
-	tlbsync			/* ... on all CPUs */
-	sync
-#endif
+	TLBSYNC			/* ... on all CPUs */
 
 	bl	load_up_mmu
 /* Now turn on the MMU for real! */
@@ -1500,7 +1535,7 @@
 	mulli	r3,r3,897	/* multiply context by skew factor */
 	rlwinm	r3,r3,4,8,27	/* VSID = (context & 0xfffff) << 4 */
 	addis	r3,r3,0x6000	/* Set Ks, Ku bits */
-	li	r0,12		/* TASK_SIZE / SEGMENT_SIZE */
+	li	r0,NUM_USER_SEGMENTS
 	mtctr	r0
 	li	r4,0
 3:
@@ -1512,7 +1547,8 @@
 	rlwinm	r3,r3,0,8,3	/* clear out any overflow from VSID field */
 	addis	r4,r4,0x1000	/* address of next segment */
 	bdnz	3b
-	SYNC
+	SYNC_601
+	isync
 	blr
 
 /* 
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/head_8xx.S linux/arch/ppc/kernel/head_8xx.S
--- v2.4.9/linux/arch/ppc/kernel/head_8xx.S	Tue Jul  3 17:08:18 2001
+++ linux/arch/ppc/kernel/head_8xx.S	Wed Aug 29 20:49:36 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.head_8xx.S 1.14 06/28/01 15:50:16 paulus
+ * BK Id: SCCS/s.head_8xx.S 1.21 08/28/01 16:27:27 trini
  */
 /*
  *  arch/ppc/kernel/except_8xx.S
@@ -31,6 +31,7 @@
 #include <asm/mmu.h>
 #include <asm/cache.h>
 #include <asm/pgtable.h>
+#include <asm/cputable.h>
 
 	.text
 	.globl	_stext
@@ -87,70 +88,10 @@
 	mr	r27,r7
 	li	r24,0			/* cpu # */
 
-	tlbia			/* Invalidate all TLB entries */
-	li	r8, 0
-	mtspr	MI_CTR, r8	/* Set instruction control to zero */
-	lis	r8, MD_RESETVAL@h
-#ifndef CONFIG_8xx_COPYBACK
-	oris	r8, r8, MD_WTDEF@h
-#endif
-	mtspr	MD_CTR, r8	/* Set data TLB control */
-
-	/* Now map the lower 8 Meg into the TLBs.  For this quick hack,
-	 * we can load the instruction and data TLB registers with the
-	 * same values.
-	 */
-	lis	r8, KERNELBASE@h	/* Create vaddr for TLB */
-	ori	r8, r8, MI_EVALID	/* Mark it valid */
-	mtspr	MI_EPN, r8
-	mtspr	MD_EPN, r8
-	li	r8, MI_PS8MEG		/* Set 8M byte page */
-	ori	r8, r8, MI_SVALID	/* Make it valid */
-	mtspr	MI_TWC, r8
-	mtspr	MD_TWC, r8
-	li	r8, MI_BOOTINIT		/* Create RPN for address 0 */
-	mtspr	MI_RPN, r8		/* Store TLB entry */
-	mtspr	MD_RPN, r8
-	lis	r8, MI_Kp@h		/* Set the protection mode */
-	mtspr	MI_AP, r8
-	mtspr	MD_AP, r8
-
-	/* Map another 8 MByte at the IMMR to get the processor
-	 * internal registers (among other things).
+	/* We have to turn on the MMU right away so we get cache modes
+	 * set correctly.
 	 */
-	mfspr	r9, 638			/* Get current IMMR */
-	andis.	r9, r9, 0xff80		/* Get 8Mbyte boundary */
-
-	mr	r8, r9			/* Create vaddr for TLB */
-	ori	r8, r8, MD_EVALID	/* Mark it valid */
-	mtspr	MD_EPN, r8
-	li	r8, MD_PS8MEG		/* Set 8M byte page */
-	ori	r8, r8, MD_SVALID	/* Make it valid */
-	mtspr	MD_TWC, r8
-	mr	r8, r9			/* Create paddr for TLB */
-	ori	r8, r8, MI_BOOTINIT|0x2 /* Inhibit cache -- Cort */
-	mtspr	MD_RPN, r8
-
-	/* Since the cache is enabled according to the information we
-	 * just loaded into the TLB, invalidate and enable the caches here.
-	 * We should probably check/set other modes....later.
-	 */
-	lis	r8, IDC_INVALL@h
-	mtspr	IC_CST, r8
-	mtspr	DC_CST, r8
-	lis	r8, IDC_ENABLE@h
-	mtspr	IC_CST, r8
-#ifdef CONFIG_8xx_COPYBACK
-	mtspr	DC_CST, r8
-#else
-	/* For a debug option, I left this here to easily enable
-	 * the write through cache mode
-	 */
-	lis	r8, DC_SFWT@h
-	mtspr	DC_CST, r8
-	lis	r8, IDC_ENABLE@h
-	mtspr	DC_CST, r8
-#endif
+	bl	initial_mmu
 
 /* We now have the lower 8 Meg mapped into TLB entries, and the caches
  * ready to work.
@@ -513,6 +454,7 @@
 #else
 	li	r21, 0x00f0
 	rlwimi	r20, r21, 0, 24, 28
+
 #endif
 #ifdef CONFIG_8xx_CPU6
 	li	r3, 0x3d80
@@ -721,131 +663,34 @@
 giveup_fpu:
 	blr
 
-/*
- * This code is jumped to from the startup code to copy
- * the kernel image to physical address 0.
- */
-relocate_kernel:
-	lis	r9,0x426f		/* if booted from BootX, don't */
-	addi	r9,r9,0x6f58		/* translate source addr */
-	cmpw	r31,r9			/* (we have to on chrp) */
-	beq	7f
-	rlwinm	r4,r4,0,8,31		/* translate source address */
-	add	r4,r4,r3		/* to region mapped with BATs */
-7:	addis	r9,r26,klimit@ha	/* fetch klimit */
-	lwz	r25,klimit@l(r9)
-	addis	r25,r25,-KERNELBASE@h
-	li	r6,0			/* Destination offset */
-	li	r5,0x4000		/* # bytes of memory to copy */
-	bl	copy_and_flush		/* copy the first 0x4000 bytes */
-	addi	r0,r3,4f@l		/* jump to the address of 4f */
-	mtctr	r0			/* in copy and do the rest. */
-	bctr				/* jump to the copy */
-4:	mr	r5,r25
-	bl	copy_and_flush		/* copy the rest */
-	b	turn_on_mmu
-
-/*
- * Copy routine used to copy the kernel to start at physical address 0
- * and flush and invalidate the caches as needed.
- * r3 = dest addr, r4 = source addr, r5 = copy limit, r6 = start offset
- * on exit, r3, r4, r5 are unchanged, r6 is updated to be >= r5.
- */
-copy_and_flush:
-	addi	r5,r5,-4
-	addi	r6,r6,-4
-4:	li	r0,CACHE_LINE_SIZE/4
-	mtctr	r0
-3:	addi	r6,r6,4			/* copy a cache line */
-	lwzx	r0,r6,r4
-	stwx	r0,r6,r3
-	bdnz	3b
-	dcbst	r6,r3			/* write it to memory */
-	sync
-	icbi	r6,r3			/* flush the icache line */
-	cmplw	0,r6,r5
-	blt	4b
-	isync
-	addi	r5,r5,4
-	addi	r6,r6,4
+/* Maybe someday.......
+*/
+_GLOBAL(__setup_cpu_8xx)
 	blr
 
-#ifdef CONFIG_SMP
-	.globl	__secondary_start_psurge
-__secondary_start_psurge:
-	li	r24,1			/* cpu # */
-	b	__secondary_start
-
-	.globl	__secondary_hold
-__secondary_hold:
-	/* tell the master we're here */
-	lis	r5,0x4@h
-	ori	r5,r5,0x4@l
-	stw	r3,0(r5)
-	dcbf	0,r5
-100:
-	lis	r5,0
-	dcbi	0,r5
-	lwz	r4,0(r5)
-	/* wait until we're told to start */
-	cmp	0,r4,r3
-	bne	100b
-	/* our cpu # was at addr 0 - go */
-	lis	r5,__secondary_start@h
-	ori	r5,r5,__secondary_start@l
-	tophys(r5,r5)
-	mtlr	r5
-	mr	r24,r3			/* cpu # */
-	blr
-#endif /* CONFIG_SMP */
-	
 /*
  * This is where the main kernel code starts.
  */
 start_here:
-#ifdef CONFIG_SMP
-	/* if we're the second cpu stack and r2 are different
-	* and we want to not clear the bss -- Cort */
-	lis	r5,first_cpu_booted@h
-	ori	r5,r5,first_cpu_booted@l
-	lwz	r5,0(r5)
-	cmpi	0,r5,0
-	beq	99f
-
-	/* get current */
-	lis	r2,current_set@h
-	ori	r2,r2,current_set@l
-	slwi	r24,r24,2			/* cpu # to current_set[cpu#] */
-	add	r2,r2,r24
-	lwz	r2,0(r2)
-	b	10f
-99:	
-#endif /* CONFIG_SMP */
+
 	/* ptr to current */
 	lis	r2,init_task_union@h
 	ori	r2,r2,init_task_union@l
-	/* Clear out the BSS */
-	lis	r11,_end@ha
-	addi	r11,r11,_end@l
-	lis	r8,__bss_start@ha
-	addi	r8,r8,__bss_start@l
-	subf	r11,r8,r11
-	addi	r11,r11,3
-	rlwinm.	r11,r11,30,2,31
-	beq	2f
-	addi	r8,r8,-4
-	mtctr	r11
-	li	r0,0
-3:	stwu	r0,4(r8)
-	bdnz	3b
-2:
-#ifdef CONFIG_SMP	
-10:
-#endif /* CONFIG_SMP */
+
+	/* ptr to phys current thread */
+	tophys(r4,r2)
+	addi	r4,r4,THREAD	/* init task's THREAD */
+	mtspr	SPRG3,r4
+	li	r3,0
+	mtspr	SPRG2,r3	/* 0 => r1 has kernel sp */
+
 	/* stack */
 	addi	r1,r2,TASK_UNION_SIZE
 	li	r0,0
 	stwu	r0,-STACK_FRAME_OVERHEAD(r1)
+
+	bl	early_init	/* We have to do this with MMU on */
+
 /*
  * Decide what sort of machine this is and initialize the MMU.
  */
@@ -854,12 +699,11 @@
 	mr	r5,r29
 	mr	r6,r28
 	mr	r7,r27
-	bl	identify_machine
+	bl	machine_init
 	bl	MMU_init
 
 /*
  * Go back to running unmapped so we can load up new values
- * for SDR1 (hash table pointer) and the segment registers
  * and change to using our exception vectors.
  * On the 8xx, all we have to do is invalidate the TLB to clear
  * the old 8M byte TLB mappings and load the page table base register.
@@ -869,8 +713,8 @@
 	 * easier......until someone changes init's static structures.
 	 */
 	lis	r6, swapper_pg_dir@h
-	tophys(r6,r6)
 	ori	r6, r6, swapper_pg_dir@l
+	tophys(r6,r6)
 #ifdef CONFIG_8xx_CPU6
 	lis	r4, cpu6_errata_word@h
 	ori	r4, r4, cpu6_errata_word@l
@@ -891,65 +735,117 @@
 	SYNC			/* Force all PTE updates to finish */
 	tlbia			/* Clear all TLB entries */
 	sync			/* wait for tlbia/tlbie to finish */
-#ifdef CONFIG_SMP
-	tlbsync			/* ... on all CPUs */
-	sync
-#endif
-/* Set up for using our exception vectors */
-	/* ptr to phys current thread */
-	tophys(r4,r2)
-	addi	r4,r4,THREAD	/* init task's THREAD */
-	mtspr	SPRG3,r4
-	li	r3,0
-	mtspr	SPRG2,r3	/* 0 => r1 has kernel sp */
+	TLBSYNC			/* ... on all CPUs */
+
+	/* set up the PTE pointers for the Abatron bdiGDB.
+	*/
+	tovirt(r6,r6)
+	lis	r5, abatron_pteptrs@h
+	ori	r5, r5, abatron_pteptrs@l
+	stw	r5, 0xf0(r0)	/* Must match your Abatron config file */
+	tophys(r5,r5)
+	stw	r6, 0(r5)
+
 /* Now turn on the MMU for real! */
 	li	r4,MSR_KERNEL
 	lis	r3,start_kernel@h
 	ori	r3,r3,start_kernel@l
-#ifdef CONFIG_SMP
-	/* the second time through here we go to
-	 * start_secondary(). -- Cort
-	 */
-	lis	r5,first_cpu_booted@h
-	ori	r5,r5,first_cpu_booted@l
-	tophys(r5,r5)
-	lwz	r5,0(r5)
-	cmpi	0,r5,0
-	beq	10f
-	lis	r3,start_secondary@h
-	ori	r3,r3,start_secondary@l
-10:	
-#endif /* CONFIG_SMP */
 	mtspr	SRR0,r3
 	mtspr	SRR1,r4
 	rfi			/* enable MMU and jump to start_kernel */
 
+/* Set up the initial MMU state so we can do the first level of
+ * kernel initialization.  This maps the first 8 MBytes of memory 1:1
+ * virtual to physical.  Also, set the cache mode since that is defined
+ * by TLB entries and perform any additional mapping (like of the IMMR).
+ */
+initial_mmu:
+	tlbia			/* Invalidate all TLB entries */
+	li	r8, 0
+	mtspr	MI_CTR, r8	/* Set instruction control to zero */
+	lis	r8, MD_RESETVAL@h
+#ifndef CONFIG_8xx_COPYBACK
+	oris	r8, r8, MD_WTDEF@h
+#endif
+	mtspr	MD_CTR, r8	/* Set data TLB control */
+
+	/* Now map the lower 8 Meg into the TLBs.  For this quick hack,
+	 * we can load the instruction and data TLB registers with the
+	 * same values.
+	 */
+	lis	r8, KERNELBASE@h	/* Create vaddr for TLB */
+	ori	r8, r8, MI_EVALID	/* Mark it valid */
+	mtspr	MI_EPN, r8
+	mtspr	MD_EPN, r8
+	li	r8, MI_PS8MEG		/* Set 8M byte page */
+	ori	r8, r8, MI_SVALID	/* Make it valid */
+	mtspr	MI_TWC, r8
+	mtspr	MD_TWC, r8
+	li	r8, MI_BOOTINIT		/* Create RPN for address 0 */
+	mtspr	MI_RPN, r8		/* Store TLB entry */
+	mtspr	MD_RPN, r8
+	lis	r8, MI_Kp@h		/* Set the protection mode */
+	mtspr	MI_AP, r8
+	mtspr	MD_AP, r8
+
+	/* Map another 8 MByte at the IMMR to get the processor
+	 * internal registers (among other things).
+	 */
+	mfspr	r9, 638			/* Get current IMMR */
+	andis.	r9, r9, 0xff80		/* Get 8Mbyte boundary */
+
+	mr	r8, r9			/* Create vaddr for TLB */
+	ori	r8, r8, MD_EVALID	/* Mark it valid */
+	mtspr	MD_EPN, r8
+	li	r8, MD_PS8MEG		/* Set 8M byte page */
+	ori	r8, r8, MD_SVALID	/* Make it valid */
+	mtspr	MD_TWC, r8
+	mr	r8, r9			/* Create paddr for TLB */
+	ori	r8, r8, MI_BOOTINIT|0x2 /* Inhibit cache -- Cort */
+	mtspr	MD_RPN, r8
+
+	/* Since the cache is enabled according to the information we
+	 * just loaded into the TLB, invalidate and enable the caches here.
+	 * We should probably check/set other modes....later.
+	 */
+	lis	r8, IDC_INVALL@h
+	mtspr	IC_CST, r8
+	mtspr	DC_CST, r8
+	lis	r8, IDC_ENABLE@h
+	mtspr	IC_CST, r8
+#ifdef CONFIG_8xx_COPYBACK
+	mtspr	DC_CST, r8
+#else
+	/* For a debug option, I left this here to easily enable
+	 * the write through cache mode
+	 */
+	lis	r8, DC_SFWT@h
+	mtspr	DC_CST, r8
+	lis	r8, IDC_ENABLE@h
+	mtspr	DC_CST, r8
+#endif
+	blr
+
+
 /*
  * Set up to use a given MMU context.
+ * r3 is context number, r4 is PGD pointer.
  *
- * The MPC8xx has something that currently happens "automagically."
- * Unshared user space address translations are subject to ASID (context)
- * match.  During each task switch, the ASID is incremented.  We can
- * guarantee (I hope :-) that no entries currently match this ASID
- * because every task will cause at least a TLB entry to be loaded for
- * the first instruction and data access, plus the kernel running will
- * have displaced several more TLBs.  The MMU contains 32 entries for
- * each TLB, and there are 16 contexts, so we just need to make sure
- * two pages get replaced for every context switch, which currently
- * happens.  There are other TLB management techniques that I will
- * eventually implement, but this is the easiest for now.  -- Dan
- *
- * On the MPC8xx, we place the physical address of the new task
- * page directory loaded into the MMU base register, and set the
- * ASID compare register with the new "context".
+ * We place the physical address of the new task page directory loaded
+ * into the MMU base register, and set the ASID compare register with
+ * the new "context."
  */
 _GLOBAL(set_context)
-	/* fetch the pgd from the context_mm array */
-	lis	r5, context_mm@ha
-	slwi	r6, r3, 2
-	add	r5, r5, r6
-	lwz	r5, context_mm@l(r5)	/* get the mm */
-	lwz	r4, MM_PGD(r5)		/* get the pgd from the mm */
+
+#ifdef CONFIG_BDI_SWITCH
+	/* Context switch the PTE pointer for the Abatron BDI2000.
+	 * The PGDIR is passed as second argument.
+	 */
+	lis	r5, KERNELBASE@h
+	lwz	r5, 0xf0(r5)
+	stw	r4, 0x4(r5)
+#endif
+
 #ifdef CONFIG_8xx_CPU6
 	lis	r6, cpu6_errata_word@h
 	ori	r6, r6, cpu6_errata_word@l
@@ -967,7 +863,6 @@
 	tophys	(r4, r4)
 	mtspr	M_TWB, r4		/* and pgd */
 #endif
-        tlbia
 	SYNC
 	blr
 
@@ -1012,6 +907,12 @@
 	.globl	cmd_line
 cmd_line:
 	.space	512
+
+/* Room for two PTE table poiners, usually the kernel and current user
+ * pointer to their respective root page table (pgdir).
+ */
+abatron_pteptrs:
+	.space	8
 
 #ifdef CONFIG_8xx_CPU6
 	.globl	cpu6_errata_word
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/idle.c linux/arch/ppc/kernel/idle.c
--- v2.4.9/linux/arch/ppc/kernel/idle.c	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/idle.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.idle.c 1.11 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.idle.c 1.14 08/15/01 22:43:06 paulus
  */
 /*
  * Idle daemon for PowerPC.  Idle daemon will handle any action
@@ -31,12 +31,11 @@
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/cache.h>
+#include <asm/cputable.h>
 
 void zero_paged(void);
 void power_save(void);
-void inline htab_reclaim(void);
 
-unsigned long htab_reclaim_on = 0;
 unsigned long zero_paged_on = 0;
 unsigned long powersave_nap = 0;
 
@@ -50,27 +49,30 @@
 {
 	int do_power_save = 0;
 
-	/* only sleep on the 603-family/750 processors */
-	switch (_get_PVR() >> 16) {
-	case 3:			/* 603 */
-	case 6:			/* 603e */
-	case 7:			/* 603ev */
-	case 8:			/* 750 */
-	case 12:		/* 7400 */
-	case 0x800c:		/* 7410 */
+	if (cur_cpu_spec[smp_processor_id()]->cpu_features & CPU_FTR_CAN_DOZE)
 		do_power_save = 1;
-	}
 
 	/* endless loop with no priority at all */
 	current->nice = 20;
 	current->counter = -100;
-	init_idle();	
-	for (;;)
-	{
-		/*if ( !current->need_resched && zero_paged_on )
-			zero_paged();*/
-		if (!current->need_resched && htab_reclaim_on)
-			htab_reclaim();
+	init_idle();
+	for (;;) {
+#ifdef CONFIG_SMP
+		int oldval;
+
+		if (!do_power_save) {
+			/*
+			 * Deal with another CPU just having chosen a thread to
+			 * run here:
+			 */
+			oldval = xchg(&current->need_resched, -1);
+
+			if (!oldval) {
+				while(current->need_resched == -1)
+					; /* Do Nothing */
+			}
+		}
+#endif
 		if (do_power_save && !current->need_resched)
 			power_save();
 
@@ -92,68 +94,6 @@
 	return 0; 
 }
 
-/*
- * Mark 'zombie' pte's in the hash table as invalid.
- * This improves performance for the hash table reload code
- * a bit since we don't consider unused pages as valid.
- *  -- Cort
- */
-PTE *reclaim_ptr = 0;
-void inline htab_reclaim(void)
-{
-#ifndef CONFIG_8xx		
-#if 0	
-	PTE *ptr, *start;
-	static int dir = 1;
-#endif	
-	struct task_struct *p;
-	unsigned long valid = 0;
-	extern PTE *Hash, *Hash_end;
-	extern unsigned long Hash_size;
-
-	/* if we don't have a htab */
-	if ( Hash_size == 0 )
-		return;
-#if 0	
-	/* find a random place in the htab to start each time */
-	start = &Hash[jiffies%(Hash_size/sizeof(PTE))];
-	/* go a different direction each time */
-	dir *= -1;
-        for ( ptr = start;
-	      !current->need_resched && (ptr != Hash_end) && (ptr != Hash);
-	      ptr += dir)
-	{
-#else
-	if ( !reclaim_ptr ) reclaim_ptr = Hash;
-	while ( !current->need_resched )
-	{
-		reclaim_ptr++;
-		if ( reclaim_ptr == Hash_end ) reclaim_ptr = Hash;
-#endif	  
-		if (!reclaim_ptr->v)
-			continue;
-		valid = 0;
-		for_each_task(p)
-		{
-			if ( current->need_resched )
-				goto out;
-			/* if this vsid/context is in use */
-			if ( (reclaim_ptr->vsid >> 4) == p->mm->context )
-			{
-				valid = 1;
-				break;
-			}
-		}
-		if ( valid )
-			continue;
-		/* this pte isn't used */
-		reclaim_ptr->v = 0;
-	}
-out:
-	if ( current->need_resched ) printk("need_resched: %lx\n", current->need_resched);
-#endif /* CONFIG_8xx */
-}
-
 #if 0
 /*
  * Returns a pre-zero'd page from the list otherwise returns
@@ -287,7 +227,7 @@
 		atomic_inc((atomic_t *)&zero_cache_total);
 	}
 }
-#endif
+#endif /* 0 */
 
 void power_save(void)
 {
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/indirect_pci.c linux/arch/ppc/kernel/indirect_pci.c
--- v2.4.9/linux/arch/ppc/kernel/indirect_pci.c	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/indirect_pci.c	Sat Sep  8 12:38:41 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.indirect_pci.c 1.7 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.indirect_pci.c 1.10 09/08/01 15:47:42 paulus
  */
 /*
  * Support for indirect PCI bridges.
@@ -19,7 +19,6 @@
 #include <linux/init.h>
 #include <linux/bootmem.h>
 
-#include <asm/init.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/pci-bridge.h>
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/irq.c linux/arch/ppc/kernel/irq.c
--- v2.4.9/linux/arch/ppc/kernel/irq.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/kernel/irq.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.irq.c 1.30 07/19/01 16:51:32 paulus
+ * BK Id: SCCS/s.irq.c 1.32 08/24/01 20:07:37 paulus
  */
 /*
  *  arch/ppc/kernel/irq.c
@@ -93,6 +93,11 @@
 static struct irqaction malloc_cache[IRQ_KMALLOC_ENTRIES];
 extern int mem_init_done;
 
+#if defined(CONFIG_TAU_INT)
+extern int tau_interrupts(unsigned long cpu);
+extern int tau_initialized;
+#endif
+
 void *irq_kmalloc(size_t size, int pri)
 {
 	unsigned int i;
@@ -402,12 +407,14 @@
 		}
 		len += sprintf(buf+len, "\n");
 	}
-#ifdef CONFIG_TAU
-	len += sprintf(buf+len, "TAU: ");
-	for (j = 0; j < smp_num_cpus; j++)
-		len += sprintf(buf+len, "%10u ",
-				tau_interrupts(j));
-	len += sprintf(buf+len, "\n");
+#ifdef CONFIG_TAU_INT
+	if (tau_initialized){
+		len += sprintf(buf+len, "TAU: ");
+		for (j = 0; j < smp_num_cpus; j++)
+			len += sprintf(buf+len, "%10u ",
+					tau_interrupts(j));
+		len += sprintf(buf+len, "  PowerPC             Thermal Assist (cpu temp)\n");
+	}
 #endif
 #ifdef CONFIG_SMP
 	/* should this be per processor send/receive? */
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/l2cr.S linux/arch/ppc/kernel/l2cr.S
--- v2.4.9/linux/arch/ppc/kernel/l2cr.S	Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/kernel/l2cr.S	Tue Aug 28 06:58:33 2001
@@ -0,0 +1,201 @@
+/*
+	L2CR functions
+	Copyright © 1997-1998 by PowerLogix R & D, Inc.
+	
+	This program is free software; you can redistribute it and/or modify
+	it under the terms of the GNU General Public License as published by
+	the Free Software Foundation; either version 2 of the License, or
+	(at your option) any later version.
+	
+	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.
+*/
+/*
+	Thur, Dec. 12, 1998.
+	- First public release, contributed by PowerLogix.
+	***********
+	Sat, Aug. 7, 1999.
+	- Terry: Made sure code disabled interrupts before running. (Previously
+			it was assumed interrupts were already disabled).
+	- Terry: Updated for tentative G4 support.  4MB of memory is now flushed
+			instead of 2MB.  (Prob. only 3 is necessary).
+	- Terry: Updated for workaround to HID0[DPM] processor bug
+			during global invalidates.
+	***********
+	Thu, July 13, 2000.
+	- Terry: Added isync to correct for an errata.
+	
+	Author:	Terry Greeniaus (tgree@phys.ualberta.ca)
+	Please e-mail updates to this file to me, thanks!
+*/
+#include <asm/processor.h>
+#include <asm/cputable.h>
+#include "ppc_asm.h"
+
+/* Usage:
+	
+	When setting the L2CR register, you must do a few special
+	things.  If you are enabling the cache, you must perform a
+	global invalidate.  If you are disabling the cache, you must
+	flush the cache contents first.  This routine takes care of
+	doing these things.  When first enabling the cache, make sure
+	you pass in the L2CR you want, as well as passing in the
+	global invalidate bit set.  A global invalidate will only be
+	performed if the L2I bit is set in applyThis.  When enabling
+	the cache, you should also set the L2E bit in applyThis.  If
+	you want to modify the L2CR contents after the cache has been
+	enabled, the recommended procedure is to first call
+	__setL2CR(0) to disable the cache and then call it again with
+	the new values for L2CR.  Examples:
+
+	_setL2CR(0)		- disables the cache
+	_setL2CR(0xB3A04000)	- enables my G3 upgrade card:
+				- L2E set to turn on the cache
+				- L2SIZ set to 1MB
+				- L2CLK set to 1:1
+				- L2RAM set to pipelined synchronous late-write
+				- L2I set to perform a global invalidation
+				- L2OH set to 0.5 nS
+				- L2DF set because this upgrade card
+				  requires it
+
+	A similar call should work for your card.  You need to know
+	the correct setting for your card and then place them in the
+	fields I have outlined above.  Other fields support optional
+	features, such as L2DO which caches only data, or L2TS which
+	causes cache pushes from the L1 cache to go to the L2 cache
+	instead of to main memory.
+*/
+/*
+ * Summary: this procedure ignores the L2I bit in the value passed in,
+ * flushes the cache if it was already enabled, always invalidates the
+ * cache, then enables the cache if the L2E bit is set in the value
+ * passed in.
+ *   -- paulus.
+ */
+_GLOBAL(_set_L2CR)
+	/* Make sure this is a 750 or 7400 chip */
+BEGIN_FTR_SECTION
+	li	r3,-1
+	blr
+END_FTR_SECTION_IFCLR(CPU_FTR_L2CR)
+
+	/* Turn off interrupts and data relocation. */
+	mfmsr	r7		/* Save MSR in r7 */
+	rlwinm	r4,r7,0,17,15
+	rlwinm	r4,r4,0,28,26	/* Turn off DR bit */
+	sync
+	mtmsr	r4
+	isync
+
+	/* Get the current enable bit of the L2CR into r4 */
+	mfspr	r4,L2CR
+	
+	/* Tweak some bits */
+	rlwinm	r5,r3,0,0,0		/* r5 contains the new enable bit */
+	rlwinm	r3,r3,0,11,9		/* Turn off the invalidate bit */
+	rlwinm	r3,r3,0,1,31		/* Turn off the enable bit */
+
+	/* Check to see if we need to flush */
+	rlwinm.	r4,r4,0,0,0
+	beq	2f
+
+	/* Flush the cache. First, read the first 4MB of memory (physical) to
+	 * put new data in the cache.  (Actually we only need
+	 * the size of the L2 cache plus the size of the L1 cache, but 4MB will
+	 * cover everything just to be safe).
+	 */
+		
+	 /**** Might be a good idea to set L2DO here - to prevent instructions
+	       from getting into the cache.  But since we invalidate
+	       the next time we enable the cache it doesn't really matter.
+	  ****/
+
+	lis	r4,0x0002
+	mtctr	r4
+	li	r4,0
+1:
+	lwzx	r0,r0,r4
+	addi	r4,r4,32		/* Go to start of next cache line */
+	bdnz	1b
+	
+	/* Now, flush the first 4MB of memory */
+	lis	r4,0x0002
+	mtctr	r4
+	li	r4,0
+	sync
+1:
+	dcbf	r0,r4
+	addi	r4,r4,32		/* Go to start of next cache line */
+	bdnz	1b
+
+2:
+	/* Set up the L2CR configuration bits (and switch L2 off) */
+	sync
+	mtspr	L2CR,r3
+	sync
+
+	/* Before we perform the global invalidation, we must disable dynamic
+	 * power management via HID0[DPM] to work around a processor bug where
+	 * DPM can possibly interfere with the state machine in the processor
+	 * that invalidates the L2 cache tags.
+	 */
+	mfspr	r8,HID0			/* Save HID0 in r8 */
+	rlwinm	r4,r8,0,12,10		/* Turn off HID0[DPM] */
+	sync
+	mtspr	HID0,r4			/* Disable DPM */
+	sync
+
+	/* Perform a global invalidation */
+	oris	r3,r3,0x0020
+	sync
+	mtspr	L2CR,r3
+	sync
+	isync				/* For errata */
+
+	/* Wait for the invalidation to complete */
+3:	mfspr	r3,L2CR
+	rlwinm.	r4,r3,0,31,31
+	bne	3b
+	
+	rlwinm	r3,r3,0,11,9		/* Turn off the L2I bit */
+	sync
+	mtspr	L2CR,r3
+	sync
+	
+	/* Restore HID0[DPM] to whatever it was before */
+	sync
+	mtspr	1008,r8
+	sync
+
+	/* See if we need to enable the cache */
+	cmplwi	r5,0
+	beq	4f
+
+	/* Enable the cache */
+	oris	r3,r3,0x8000
+	mtspr	L2CR,r3
+	sync
+
+	/* Restore MSR (restores EE and DR bits to original state) */
+4:	SYNC
+	mtmsr	r7
+	isync
+	blr
+
+_GLOBAL(_get_L2CR)
+	/* Return the L2CR contents */
+	li	r3,0
+BEGIN_FTR_SECTION
+	mfspr	r3,L2CR
+END_FTR_SECTION_IFSET(CPU_FTR_L2CR)
+	blr
+
+/* --- End of PowerLogix code ---
+ */
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/m8260_setup.c linux/arch/ppc/kernel/m8260_setup.c
--- v2.4.9/linux/arch/ppc/kernel/m8260_setup.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/kernel/m8260_setup.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.m8260_setup.c 1.20 07/18/01 22:56:39 paulus
+ * BK Id: SCCS/s.m8260_setup.c 1.24 08/20/01 15:25:16 paulus
  */
 /*
  *  linux/arch/ppc/kernel/setup.c
@@ -52,17 +52,6 @@
 unsigned long m8260_get_rtc_time(void);
 void m8260_calibrate_decr(void);
 
-#if 0
-extern int mackbd_setkeycode(unsigned int scancode, unsigned int keycode);
-extern int mackbd_getkeycode(unsigned int scancode);
-extern int mackbd_pretranslate(unsigned char scancode, char raw_mode);
-extern int mackbd_translate(unsigned char scancode, unsigned char *keycode,
-			   char raw_mode);
-extern char mackbd_unexpected_up(unsigned char keycode);
-extern void mackbd_leds(unsigned char leds);
-extern void mackbd_init_hw(void);
-#endif
-
 extern unsigned long loops_per_jiffy;
 
 unsigned char __res[sizeof(bd_t)];
@@ -72,10 +61,6 @@
 extern unsigned long find_available_memory(void);
 extern void m8260_cpm_reset(void);
 
-void __init adbdev_init(void)
-{
-}
-
 void __init
 m8260_setup_arch(void)
 {
@@ -102,7 +87,7 @@
 	bd_t	*binfo = (bd_t *)__res;
 	int freq, divisor;
 
-	freq = (binfo->bi_busfreq * 1000000);
+	freq = binfo->bi_busfreq;
         divisor = 4;
         tb_ticks_per_jiffy = freq / HZ / divisor;
 	tb_to_us = mulhwu_scale_factor(freq / divisor, 1000000);
@@ -111,7 +96,8 @@
 /* The 8260 has an internal 1-second timer update register that
  * we should use for this purpose.
  */
-static uint	rtc_time;
+static uint rtc_time;
+
 static int
 m8260_set_rtc_time(unsigned long time)
 {
@@ -145,7 +131,7 @@
 			startaddr = simple_strtoul(&cmd[10], NULL, 0);
 	}
 
-	m8260_gorom((uint)__pa(__res), startaddr);
+	m8260_gorom((unsigned int)__pa(__res), startaddr);
 }
 
 void
@@ -171,9 +157,9 @@
 	len += sprintf(len+buffer,"core clock\t: %d MHz\n"
 		       "CPM  clock\t: %d MHz\n"
 		       "bus  clock\t: %d MHz\n",
-		       bp->bi_intfreq /*/ 1000000*/,
-		       bp->bi_cpmfreq /*/ 1000000*/,
-		       bp->bi_busfreq /*/ 1000000*/);
+		       bp->bi_intfreq / 1000000,
+		       bp->bi_cpmfreq / 1000000,
+		       bp->bi_busfreq / 1000000);
 
 	return len;
 }
@@ -219,9 +205,21 @@
 	return binfo->bi_memsize;
 }
 
+/* Map the IMMR, plus anything else we can cover
+ * in that upper space according to the memory controller
+ * chip select mapping.  Grab another bunch of space
+ * below that for stuff we can't cover in the upper.
+ */
+static void __init
+m8260_map_io(void)
+{
+	io_block_mapping(0xf0000000, 0xf0000000, 0x10000000, _PAGE_IO);
+	io_block_mapping(0xe0000000, 0xe0000000, 0x10000000, _PAGE_IO);
+}
+
 void __init
-m8260_init(unsigned long r3, unsigned long r4, unsigned long r5,
-	 unsigned long r6, unsigned long r7)
+platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+	      unsigned long r6, unsigned long r7)
 {
 
 	if ( r3 )
@@ -261,6 +259,7 @@
 	ppc_md.calibrate_decr = m8260_calibrate_decr;
 
 	ppc_md.find_end_of_memory = m8260_find_end_of_memory;
+	ppc_md.setup_io_mappings = m8260_map_io;
 
 	ppc_md.kbd_setkeycode    = NULL;
 	ppc_md.kbd_getkeycode    = NULL;
@@ -273,51 +272,11 @@
 #endif
 
 #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
-        ppc_ide_md.insw = m8xx_ide_insw;
-        ppc_ide_md.outsw = m8xx_ide_outsw;
         ppc_ide_md.default_irq = m8xx_ide_default_irq;
         ppc_ide_md.default_io_base = m8xx_ide_default_io_base;
-        ppc_ide_md.fix_driveid = ppc_generic_ide_fix_driveid;
         ppc_ide_md.ide_init_hwif = m8xx_ide_init_hwif_ports;
         ppc_ide_md.ide_request_irq = m8xx_ide_request_irq;
-
-        ppc_ide_md.io_base = _IO_BASE;
 #endif		
-}
-
-/*
- * Copied from prom.c so I don't have include all of that crap.
- *				-- Dan
- *
- * prom_init() is called very early on, before the kernel text
- * and data have been mapped to KERNELBASE.  At this point the code
- * is running at whatever address it has been loaded at, so
- * references to extern and static variables must be relocated
- * explicitly.  The procedure reloc_offset() returns the address
- * we're currently running at minus the address we were linked at.
- * (Note that strings count as static variables.)
- */
-extern unsigned long reloc_offset(void);
-#define PTRRELOC(x)	((typeof(x))((unsigned long)(x) + offset))
-
-__init
-unsigned long
-prom_init(uint r3, uint r4, uint r5, uint r6)
-{
-	unsigned long offset = reloc_offset();
- 	unsigned long phys;
-	extern char __bss_start, _end;
-
-	/* First zero the BSS -- use memset, some arches don't have
-	 * caches on yet */
-	memset_io(PTRRELOC(&__bss_start),0 , &_end - &__bss_start);
-
- 	/* Default */
- 	phys = offset + KERNELBASE;
-
-	/* We are done.
-	*/
-	return phys;
 }
 
 /* Mainly for ksyms.
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/m8xx_setup.c linux/arch/ppc/kernel/m8xx_setup.c
--- v2.4.9/linux/arch/ppc/kernel/m8xx_setup.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/kernel/m8xx_setup.c	Sat Sep  8 12:39:33 2001
@@ -1,7 +1,6 @@
 /*
- * BK Id: SCCS/s.m8xx_setup.c 1.23 07/18/01 22:56:39 paulus
- */
-/*
+ * BK Id: SCCS/s.m8xx_setup.c 1.29 08/30/01 09:01:04 trini
+ *
  *  linux/arch/ppc/kernel/setup.c
  *
  *  Copyright (C) 1995  Linus Torvalds
@@ -172,8 +171,7 @@
 	machine_restart(NULL);
 }
 
-/* A place holder for time base interrupts, if they are ever enabled.
-*/
+/* A place holder for time base interrupts, if they are ever enabled. */
 void timebase_interrupt(int irq, void * dev, struct pt_regs * regs)
 {
 	printk ("timebase_interrupt()\n");
@@ -188,13 +186,11 @@
 	bd_t	*binfo = (bd_t *)__res;
 	int freq, fp, divisor;
 
-	/* Unlock the SCCR.
-	*/
+	/* Unlock the SCCR. */
 	((volatile immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk = ~KAPWR_KEY;
 	((volatile immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk = KAPWR_KEY;
 
-	/* Force all 8xx processors to use divide by 16 processor clock.
-	*/
+	/* Force all 8xx processors to use divide by 16 processor clock. */
 	((volatile immap_t *)IMAP_ADDR)->im_clkrst.car_sccr |= 0x02000000;
 
 	/* Processor frequency is MHz.
@@ -224,15 +220,17 @@
 	 */
 	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_tbscrk = ~KAPWR_KEY;
 	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_rtcsck = ~KAPWR_KEY;
-	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_tbk = ~KAPWR_KEY;
+	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_tbk    = ~KAPWR_KEY;
 	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_tbscrk = KAPWR_KEY;
 	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_rtcsck = KAPWR_KEY;
-	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_tbk = KAPWR_KEY;
+	((volatile immap_t *)IMAP_ADDR)->im_sitk.sitk_tbk    = KAPWR_KEY;
 
-	/* Disable the RTC one second and alarm interrupts.
-	*/
+	/* Disable the RTC one second and alarm interrupts. */
 	((volatile immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc &=
 						~(RTCSC_SIE | RTCSC_ALE);
+	/* Enable the RTC */
+	((volatile immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc |=
+						(RTCSC_RTF | RTCSC_RTE);
 
 	/* Enabling the decrementer also enables the timebase interrupts
 	 * (or from the other point of view, to get decrementer interrupts
@@ -260,15 +258,14 @@
 	return(0);
 }
 
-unsigned long
+static unsigned long
 m8xx_get_rtc_time(void)
 {
-	/* Get time from the RTC.
-	*/
+	/* Get time from the RTC. */
 	return((unsigned long)(((immap_t *)IMAP_ADDR)->im_sit.sit_rtc));
 }
 
-void
+static void
 m8xx_restart(char *cmd)
 {
 	__volatile__ unsigned char dummy;
@@ -288,20 +285,21 @@
 	while(1);
 }
 
-void
+static void
 m8xx_power_off(void)
 {
    m8xx_restart(NULL);
 }
 
-void
+static void
 m8xx_halt(void)
 {
    m8xx_restart(NULL);
 }
 
 
-int m8xx_setup_residual(char *buffer)
+static int
+m8xx_setup_residual(char *buffer)
 {
         int     len = 0;
 	bd_t	*bp;
@@ -322,7 +320,7 @@
  * External interrupts can be either edge or level triggered, and
  * need to be initialized by the appropriate driver.
  */
-void __init
+static void __init
 m8xx_init_IRQ(void)
 {
 	int i;
@@ -353,32 +351,12 @@
  * IDE stuff.
  */
 #ifdef CONFIG_BLK_DEV_MPC8xx_IDE
-void ide_interrupt_handler (void *dev)
+static void ide_interrupt_handler (void *dev)
 {
 }
 #endif
 
-void
-m8xx_ide_insw(ide_ioreg_t port, void *buf, int ns)
-{
-#ifdef CONFIG_BLK_DEV_MPC8xx_IDE
-	ide_insw(port, buf, ns);
-#else
-	_insw_ns((unsigned short *)(port+_IO_BASE), buf, ns);
-#endif
-}
-
-void
-m8xx_ide_outsw(ide_ioreg_t port, void *buf, int ns)
-{
-#ifdef CONFIG_BLK_DEV_MPC8xx_IDE
-	ide_outsw(port, buf, ns);
-#else
-	_outsw_ns((unsigned short *)(port+_IO_BASE), buf, ns);
-#endif
-}
-
-int
+static int
 m8xx_ide_default_irq(ide_ioreg_t base)
 {
 #ifdef CONFIG_BLK_DEV_MPC8xx_IDE
@@ -391,13 +369,13 @@
 #endif
 }
 
-ide_ioreg_t
+static ide_ioreg_t
 m8xx_ide_default_io_base(int index)
 {
         return index;
 }
 
-int
+static int
 m8xx_ide_request_irq(unsigned int irq,
 		       void (*handler)(int, void *, struct pt_regs *),
 		       unsigned long flags, 
@@ -412,8 +390,9 @@
  *
  * See include/linux/ide.h for definition of hw_regs_t (p, base)
  */
-void m8xx_ide_init_hwif_ports(hw_regs_t *hw,
-	ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
+static void
+m8xx_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, 
+		ide_ioreg_t ctrl_port, int *irq)
 {
 	int i;
 #ifdef CONFIG_BLK_DEV_MPC8xx_IDE
@@ -479,7 +458,7 @@
 # endif	/* CONFIG_SPD823TS, CONFIG_IVMS8 */
 
 	for (i = 0; i < IDE_NR_PORTS; ++i) {
-	 	*p++ = base + ioport_dsc[data_port].reg_off[i];
+		*p++ = base + ioport_dsc[data_port].reg_off[i] - _IO_BASE;
 	}
 
 	if (irq) {
@@ -585,7 +564,8 @@
  * functions in the image just to get prom_init, all we really need right
  * now is the initialization of the physical memory region.
  */
-unsigned long __init m8xx_find_end_of_memory(void)
+static unsigned long __init
+m8xx_find_end_of_memory(void)
 {
 	bd_t	*binfo;
 	extern unsigned char __res[];
@@ -595,11 +575,47 @@
 	return binfo->bi_memsize;
 }
 
-void __init
-m8xx_init(unsigned long r3, unsigned long r4, unsigned long r5,
-	 unsigned long r6, unsigned long r7)
+/*
+ * Now map in some of the I/O space that is generically needed
+ * or shared with multiple devices.
+ * All of this fits into the same 4Mbyte region, so it only
+ * requires one page table page.  (or at least it used to  -- paulus)
+ */
+static void __init
+m8xx_map_io(void)
 {
+        io_block_mapping(IMAP_ADDR, IMAP_ADDR, IMAP_SIZE, _PAGE_IO);
+#ifdef CONFIG_MBX
+        io_block_mapping(NVRAM_ADDR, NVRAM_ADDR, NVRAM_SIZE, _PAGE_IO);
+        io_block_mapping(MBX_CSR_ADDR, MBX_CSR_ADDR, MBX_CSR_SIZE, _PAGE_IO);
+        io_block_mapping(PCI_CSR_ADDR, PCI_CSR_ADDR, PCI_CSR_SIZE, _PAGE_IO);
+
+	/* Map some of the PCI/ISA I/O space to get the IDE interface.
+	*/
+        io_block_mapping(PCI_ISA_IO_ADDR, PCI_ISA_IO_ADDR, 0x4000, _PAGE_IO);
+        io_block_mapping(PCI_IDE_ADDR, PCI_IDE_ADDR, 0x4000, _PAGE_IO);
+#endif
+#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC)
+	io_block_mapping(RPX_CSR_ADDR, RPX_CSR_ADDR, RPX_CSR_SIZE, _PAGE_IO);
+#if !defined(CONFIG_PCI)
+	io_block_mapping(_IO_BASE,_IO_BASE,_IO_BASE_SIZE, _PAGE_IO);
+#endif
+#endif
+#ifdef CONFIG_HTDMSOUND
+	io_block_mapping(HIOX_CSR_ADDR, HIOX_CSR_ADDR, HIOX_CSR_SIZE, _PAGE_IO);
+#endif
+#ifdef CONFIG_FADS
+	io_block_mapping(BCSR_ADDR, BCSR_ADDR, BCSR_SIZE, _PAGE_IO);
+#endif
+#ifdef CONFIG_PCI
+        io_block_mapping(PCI_CSR_ADDR, PCI_CSR_ADDR, PCI_CSR_SIZE, _PAGE_IO);
+#endif
+}
 
+void __init
+platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+		unsigned long r6, unsigned long r7)
+{
 	if ( r3 )
 		memcpy( (void *)__res,(void *)(r3+KERNELBASE), sizeof(bd_t) );
 	
@@ -617,8 +633,7 @@
 #endif /* CONFIG_BLK_DEV_INITRD */
 	/* take care of cmd line */
 	if ( r6 )
-	{
-		
+	{	
 		*(char *)(r7+KERNELBASE) = 0;
 		strcpy(cmd_line, (char *)(r6+KERNELBASE));
 	}
@@ -641,6 +656,7 @@
 	ppc_md.calibrate_decr = m8xx_calibrate_decr;
 
 	ppc_md.find_end_of_memory = m8xx_find_end_of_memory;
+	ppc_md.setup_io_mappings = m8xx_map_io;
 
 	ppc_md.kbd_setkeycode    = NULL;
 	ppc_md.kbd_getkeycode    = NULL;
@@ -653,13 +669,8 @@
 #endif
 
 #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
-        ppc_ide_md.insw = m8xx_ide_insw;
-        ppc_ide_md.outsw = m8xx_ide_outsw;
         ppc_ide_md.default_irq = m8xx_ide_default_irq;
         ppc_ide_md.default_io_base = m8xx_ide_default_io_base;
-        ppc_ide_md.fix_driveid = ppc_generic_ide_fix_driveid;
         ppc_ide_md.ide_init_hwif = m8xx_ide_init_hwif_ports;
-
-        ppc_ide_md.io_base = _IO_BASE;
 #endif		
 }
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/misc.S linux/arch/ppc/kernel/misc.S
--- v2.4.9/linux/arch/ppc/kernel/misc.S	Sun Aug 12 13:27:58 2001
+++ linux/arch/ppc/kernel/misc.S	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.misc.S 1.21 07/07/01 17:00:08 paulus
+ * BK Id: SCCS/s.misc.S 1.28 08/24/01 20:07:37 paulus
  */
 /*
  * This file contains miscellaneous low-level functions.
@@ -22,6 +22,7 @@
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/cache.h>
+#include <asm/cputable.h>
 #include "ppc_asm.h"
 
 	.text
@@ -49,6 +50,97 @@
 	mtlr	r0
 	blr
 
+/*
+ * identify_cpu,
+ * called with r3 = data offset and r4 = CPU number
+ * doesn't change r3
+ */
+_GLOBAL(identify_cpu)
+	addis	r8,r3,cpu_specs@ha
+	addi	r8,r8,cpu_specs@l
+	mfpvr	r7
+1:
+	lwz	r5,CPU_SPEC_PVR_MASK(r8)
+	and	r5,r5,r7
+	lwz	r6,CPU_SPEC_PVR_VALUE(r8)
+	cmplw	0,r6,r5
+	beq	1f
+	addi	r8,r8,CPU_SPEC_ENTRY_SIZE
+	b	1b
+1:
+	addis	r6,r3,cur_cpu_spec@ha
+	addi	r6,r6,cur_cpu_spec@l
+	slwi	r4,r4,2
+	sub	r8,r8,r3
+	stwx	r8,r4,r6
+	blr
+
+/*
+ * do_cpu_ftr_fixups - goes through the list of CPU feature fixups
+ * and writes nop's over sections of code that don't apply for this cpu.
+ * r3 = data offset (not changed)
+ */
+_GLOBAL(do_cpu_ftr_fixups)
+	/* Get CPU 0 features */
+	addis	r6,r3,cur_cpu_spec@ha
+	addi	r6,r6,cur_cpu_spec@l
+	lwz	r4,0(r6)
+	add	r4,r4,r3
+	lwz	r4,CPU_SPEC_FEATURES(r4)
+
+	/* Get the fixup table */
+	addis	r6,r3,__start___ftr_fixup@ha
+	addi	r6,r6,__start___ftr_fixup@l
+	addis	r7,r3,__stop___ftr_fixup@ha
+	addi	r7,r7,__stop___ftr_fixup@l
+
+	/* Do the fixup */
+1:	cmplw	0,r6,r7
+	bgelr
+	addi	r6,r6,16
+	lwz	r8,-16(r6)	/* mask */
+	and	r8,r8,r4
+	lwz	r9,-12(r6)	/* value */
+	cmplw	0,r8,r9
+	beq	1b
+	lwz	r8,-8(r6)	/* section begin */
+	lwz	r9,-4(r6)	/* section end */
+	subf.	r9,r8,r9
+	beq	1b
+	/* write nops over the section of code */
+	/* todo: if large section, add a branch at the start of it */
+	srwi	r9,r9,2
+	mtctr	r9
+	add	r8,r8,r3
+	lis	r0,0x60000000@h	/* nop */
+3:	stw	r0,0(r8)
+	andi.	r10,r4,CPU_FTR_SPLIT_ID_CACHE@l
+	beq	2f
+	dcbst	0,r8		/* suboptimal, but simpler */
+	sync
+	icbi	0,r8
+2:	addi	r8,r8,4
+	bdnz	3b
+	sync			/* additional sync needed on g4 */
+	isync
+	b	1b
+
+/*
+ * call_setup_cpu - call the setup_cpu function for this cpu
+ * r3 = data offset, r24 = cpu number
+ */
+_GLOBAL(call_setup_cpu)
+	addis	r5,r3,cur_cpu_spec@ha
+	addi	r5,r5,cur_cpu_spec@l
+	slwi	r4,r24,2
+	lwzx	r5,r4,r5
+	add	r5,r5,r3
+	lwz	r6,CPU_SPEC_SETUP(r5)
+	add	r6,r6,r3
+	mtctr	r6
+	mr	r3,r24
+	bctr
+
 /* void __save_flags_ptr(unsigned long *flags) */
 _GLOBAL(__save_flags_ptr)
 	mfmsr	r4
@@ -185,7 +277,7 @@
 _GLOBAL(_nmask_and_or_msr)
 	mfmsr	r0		/* Get current msr */
 	andc	r0,r0,r3	/* And off the bits set in r3 (first parm) */
-	or	r0,r0,r4		/* Or on the bits in r4 (second parm) */
+	or	r0,r0,r4	/* Or on the bits in r4 (second parm) */
 	SYNC			/* Some chip revs have problems here... */
 	mtmsr	r0		/* Update machine state */
 	isync
@@ -216,8 +308,7 @@
 	tlbia
 	sync
 #ifdef CONFIG_SMP
-	tlbsync
-	sync
+	TLBSYNC
 	li	r0,0
 	stw	r0,0(r9)		/* clear hash_table_lock */
 	mtmsr	r10
@@ -249,8 +340,7 @@
 	tlbie	r3
 	sync
 #ifdef CONFIG_SMP
-	tlbsync
-	sync
+	TLBSYNC
 	li	r0,0
 	stw	r0,0(r9)		/* clear hash_table_lock */
 	mtmsr	r10
@@ -314,26 +404,70 @@
 	sync				/* additional sync needed on g4 */
 	isync
 	blr
+/*
+ * Write any modified data cache blocks out to memory.
+ * Does not invalidate the corresponding cache lines (especially for
+ * any corresponding instruction cache).
+ *
+ * clean_dcache_range(unsigned long start, unsigned long stop)
+ */
+_GLOBAL(clean_dcache_range)
+	li	r5,CACHE_LINE_SIZE-1
+	andc	r3,r3,r5
+	subf	r4,r3,r4
+	add	r4,r4,r5
+	srwi.	r4,r4,LG_CACHE_LINE_SIZE
+	beqlr
+	mtctr	r4
+
+1:	dcbst	0,r3
+	addi	r3,r3,CACHE_LINE_SIZE
+	bdnz	1b
+	sync				/* wait for dcbst's to get to ram */
+	blr
 
 /*
- * Like above, but only do the D-cache.
+ * Write any modified data cache blocks out to memory
+ * and invalidate the corresponding instruction cache blocks.
  *
  * flush_dcache_range(unsigned long start, unsigned long stop)
  */
 _GLOBAL(flush_dcache_range)
-       li      r5,CACHE_LINE_SIZE-1
-       andc    r3,r3,r5
-       subf    r4,r3,r4
-       add     r4,r4,r5
-       srwi.   r4,r4,LG_CACHE_LINE_SIZE
-       beqlr
-       mtctr   r4
-
-1:     dcbst   0,r3
-       addi    r3,r3,CACHE_LINE_SIZE
-       bdnz    1b
-       sync                            /* wait for dcbst's to get to ram */
-       blr
+	li	r5,CACHE_LINE_SIZE-1
+	andc	r3,r3,r5
+	subf	r4,r3,r4
+	add	r4,r4,r5
+	srwi.	r4,r4,LG_CACHE_LINE_SIZE
+	beqlr
+	mtctr	r4
+
+1:	dcbf	0,r3
+	addi	r3,r3,CACHE_LINE_SIZE
+	bdnz	1b
+	sync				/* wait for dcbst's to get to ram */
+	blr
+
+/*
+ * Like above, but invalidate the D-cache.  This is used by the 8xx
+ * to invalidate the cache so the PPC core doesn't get stale data
+ * from the CPM (no cache snooping here :-).
+ *
+ * invalidate_dcache_range(unsigned long start, unsigned long stop)
+ */
+_GLOBAL(invalidate_dcache_range)
+	li	r5,CACHE_LINE_SIZE-1
+	andc	r3,r3,r5
+	subf	r4,r3,r4
+	add	r4,r4,r5
+	srwi.	r4,r4,LG_CACHE_LINE_SIZE
+	beqlr
+	mtctr	r4
+
+1:	dcbi	0,r3
+	addi	r3,r3,CACHE_LINE_SIZE
+	bdnz	1b
+	sync				/* wait for dcbi's to get to ram */
+	blr
 
 /*
  * Flush a particular page from the data cache to RAM.
@@ -481,94 +615,9 @@
 	blr
 
 /*
- * Try to acquire a spinlock.
- * Only does the stwcx. if the load returned 0 - the Programming
- * Environments Manual suggests not doing unnecessary stcwx.'s
- * since they may inhibit forward progress by other CPUs in getting
- * a lock.
- */
-_GLOBAL(__spin_trylock)
-	mr	r4,r3
-	eieio			/* prevent reordering of stores */
-	li	r5,-1
-	lwarx	r3,0,r4		/* fetch old value, establish reservation */
-	cmpwi	0,r3,0		/* is it 0? */
-	bnelr-			/* return failure if not */
-	stwcx.	r5,0,r4		/* try to update with new value */
-	bne-	1f		/* if we failed */
-	eieio			/* prevent reordering of stores */
-	blr
-1:	li	r3,1		/* return non-zero for failure */
-	blr
-
-/*
- * Atomic add/sub/inc/dec operations
- *
- * void atomic_add(int c, int *v)
- * void atomic_sub(int c, int *v)
- * void atomic_inc(int *v)
- * void atomic_dec(int *v)
- * int atomic_dec_and_test(int *v)
- * int atomic_inc_return(int *v)
- * int atomic_dec_return(int *v)
  * void atomic_clear_mask(atomic_t mask, atomic_t *addr)
  * void atomic_set_mask(atomic_t mask, atomic_t *addr);
  */
-#if 0 /* now inline - paulus */
-_GLOBAL(atomic_add)
-10:	lwarx	r5,0,r4		/* Fetch old value & reserve */
-	add	r5,r5,r3	/* Perform 'add' operation */
-	stwcx.	r5,0,r4		/* Update with new value */
-	bne-	10b		/* Retry if "reservation" (i.e. lock) lost */
-	blr
-_GLOBAL(atomic_add_return)
-10:	lwarx	r5,0,r4		/* Fetch old value & reserve */
-	add	r5,r5,r3	/* Perform 'add' operation */
-	stwcx.	r5,0,r4		/* Update with new value */
-	bne-	10b		/* Retry if "reservation" (i.e. lock) lost */
-	mr	r3,r5
-	blr
-_GLOBAL(atomic_sub)
-10:	lwarx	r5,0,r4		/* Fetch old value & reserve */
-	sub	r5,r5,r3	/* Perform 'add' operation */
-	stwcx.	r5,0,r4		/* Update with new value */
-	bne-	10b		/* Retry if "reservation" (i.e. lock) lost */
-	blr
-_GLOBAL(atomic_inc)
-10:	lwarx	r5,0,r3		/* Fetch old value & reserve */
-	addi	r5,r5,1		/* Perform 'add' operation */
-	stwcx.	r5,0,r3		/* Update with new value */
-	bne-	10b		/* Retry if "reservation" (i.e. lock) lost */
-	blr
-_GLOBAL(atomic_inc_return)
-10:	lwarx	r5,0,r3		/* Fetch old value & reserve */
-	addi	r5,r5,1		/* Perform 'add' operation */
-	stwcx.	r5,0,r3		/* Update with new value */
-	bne-	10b		/* Retry if "reservation" (i.e. lock) lost */
-	mr	r3,r5		/* Return new value */
-	blr
-_GLOBAL(atomic_dec)
-10:	lwarx	r5,0,r3		/* Fetch old value & reserve */
-	subi	r5,r5,1		/* Perform 'add' operation */
-	stwcx.	r5,0,r3		/* Update with new value */
-	bne-	10b		/* Retry if "reservation" (i.e. lock) lost */
-	blr
-_GLOBAL(atomic_dec_return)
-10:	lwarx	r5,0,r3		/* Fetch old value & reserve */
-	subi	r5,r5,1		/* Perform 'add' operation */
-	stwcx.	r5,0,r3		/* Update with new value */
-	bne-	10b		/* Retry if "reservation" (i.e. lock) lost */
-	mr	r3,r5		/* Return new value */
-	blr
-_GLOBAL(atomic_dec_and_test)
-10:	lwarx	r5,0,r3		/* Fetch old value & reserve */
-	subi	r5,r5,1		/* Perform 'add' operation */
-	stwcx.	r5,0,r3		/* Update with new value */
-	bne-	10b		/* Retry if "reservation" (i.e. lock) lost */
-	cntlzw	r3,r5
-	srwi	r3,r3,5
-	blr
-#endif /* 0 */
 _GLOBAL(atomic_clear_mask)
 10:	lwarx	r5,0,r4
 	andc	r5,r5,r3
@@ -768,281 +817,7 @@
 _GLOBAL(_get_SP)
 	mr	r3,r1		/* Close enough */
 	blr
-
-#if 0
-/* isn't it just easier to use the mtspr/mfspr inline macros?? --Troy */
-_GLOBAL(_get_THRM1)
-	mfspr	r3,THRM1
-	blr
-
-_GLOBAL(_get_THRM2)
-	mfspr	r3,THRM2
-	blr
-
-_GLOBAL(_get_THRM3)
-	mfspr	r3,THRM3
-	blr
-		
-_GLOBAL(_set_THRM1)
-	mtspr	THRM1,r3
-	blr
-
-_GLOBAL(_set_THRM2)
-	mtspr	THRM2,r3
-	blr
-
-_GLOBAL(_set_THRM3)
-	mtspr	THRM3,r3
-	blr
-#endif
-	
-_GLOBAL(_get_PVR)
-	mfspr	r3,PVR
-	blr
-
-#ifdef CONFIG_8xx
-_GLOBAL(_get_IMMR)
-	mfspr	r3, 638
-	blr
-#endif
 	
-_GLOBAL(_get_HID0)
-	mfspr	r3,HID0
-	blr
-
-_GLOBAL(_set_HID0)
-	sync
-	mtspr	HID0, r3
-	SYNC		/* Handle errata in some cases */
-	blr
-
-_GLOBAL(_get_ICTC)
-	mfspr	r3,ICTC
-	blr
-
-_GLOBAL(_set_ICTC)
-	mtspr	ICTC,r3
-	blr
-
-/*
-	L2CR functions
-	Copyright © 1997-1998 by PowerLogix R & D, Inc.
-	
-	This program is free software; you can redistribute it and/or modify
-	it under the terms of the GNU General Public License as published by
-	the Free Software Foundation; either version 2 of the License, or
-	(at your option) any later version.
-	
-	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.
-*/
-/*
-	Thur, Dec. 12, 1998.
-	- First public release, contributed by PowerLogix.
-	***********
-	Sat, Aug. 7, 1999.
-	- Terry: Made sure code disabled interrupts before running. (Previously
-			it was assumed interrupts were already disabled).
-	- Terry: Updated for tentative G4 support.  4MB of memory is now flushed
-			instead of 2MB.  (Prob. only 3 is necessary).
-	- Terry: Updated for workaround to HID0[DPM] processor bug
-			during global invalidates.
-	***********
-	Thu, July 13, 2000.
-	- Terry: Added isync to correct for an errata.
-	
-	Author:	Terry Greeniaus (tgree@phys.ualberta.ca)
-	Please e-mail updates to this file to me, thanks!
-*/
-/* Usage:
-	
-	When setting the L2CR register, you must do a few special
-	things.  If you are enabling the cache, you must perform a
-	global invalidate.  If you are disabling the cache, you must
-	flush the cache contents first.  This routine takes care of
-	doing these things.  When first enabling the cache, make sure
-	you pass in the L2CR you want, as well as passing in the
-	global invalidate bit set.  A global invalidate will only be
-	performed if the L2I bit is set in applyThis.  When enabling
-	the cache, you should also set the L2E bit in applyThis.  If
-	you want to modify the L2CR contents after the cache has been
-	enabled, the recommended procedure is to first call
-	__setL2CR(0) to disable the cache and then call it again with
-	the new values for L2CR.  Examples:
-
-	_setL2CR(0)		- disables the cache
-	_setL2CR(0xB3A04000)	- enables my G3 upgrade card:
-				- L2E set to turn on the cache
-				- L2SIZ set to 1MB
-				- L2CLK set to 1:1
-				- L2RAM set to pipelined synchronous late-write
-				- L2I set to perform a global invalidation
-				- L2OH set to 0.5 nS
-				- L2DF set because this upgrade card
-				  requires it
-
-	A similar call should work for your card.  You need to know
-	the correct setting for your card and then place them in the
-	fields I have outlined above.  Other fields support optional
-	features, such as L2DO which caches only data, or L2TS which
-	causes cache pushes from the L1 cache to go to the L2 cache
-	instead of to main memory.
-*/
-/*
- * Summary: this procedure ignores the L2I bit in the value passed in,
- * flushes the cache if it was already enabled, always invalidates the
- * cache, then enables the cache if the L2E bit is set in the value
- * passed in.
- *   -- paulus.
- */
-_GLOBAL(_set_L2CR)
-	/* Make sure this is a 750 or 7400 chip */
-	mfspr	r4,PVR
-	rlwinm	r4,r4,16,16,31
-	cmpwi	r4,0x0008
-	cmpwi	cr1,r4,0x000c
-	cror	2,2,4*cr1+2
-	bne	99f
-
-	/* Turn off interrupts and data relocation. */
-	mfmsr	r7		/* Save MSR in r7 */
-	rlwinm	r4,r7,0,17,15
-	rlwinm	r4,r4,0,28,26	/* Turn off DR bit */
-	sync
-	mtmsr	r4
-	isync
-
-	/* Get the current enable bit of the L2CR into r4 */
-	mfspr	r4,L2CR
-	
-	/* Tweak some bits */
-	rlwinm	r5,r3,0,0,0		/* r5 contains the new enable bit */
-	rlwinm	r3,r3,0,11,9		/* Turn off the invalidate bit */
-	rlwinm	r3,r3,0,1,31		/* Turn off the enable bit */
-
-	/* Check to see if we need to flush */
-	rlwinm.	r4,r4,0,0,0
-	beq	2f
-
-	/* Flush the cache. First, read the first 4MB of memory (physical) to
-	 * put new data in the cache.  (Actually we only need
-	 * the size of the L2 cache plus the size of the L1 cache, but 4MB will
-	 * cover everything just to be safe).
-	 */
-		
-	 /**** Might be a good idea to set L2DO here - to prevent instructions
-	       from getting into the cache.  But since we invalidate
-	       the next time we enable the cache it doesn't really matter.
-	  ****/
-
-	lis	r4,0x0002
-	mtctr	r4
-	li	r4,0
-1:
-	lwzx	r0,r0,r4
-	addi	r4,r4,32		/* Go to start of next cache line */
-	bdnz	1b
-	
-	/* Now, flush the first 4MB of memory */
-	lis	r4,0x0002
-	mtctr	r4
-	li	r4,0
-	sync
-1:
-	dcbf	r0,r4
-	addi	r4,r4,32		/* Go to start of next cache line */
-	bdnz	1b
-
-2:
-	/* Set up the L2CR configuration bits (and switch L2 off) */
-	sync
-	mtspr	L2CR,r3
-	sync
-
-	/* Before we perform the global invalidation, we must disable dynamic
-	 * power management via HID0[DPM] to work around a processor bug where
-	 * DPM can possibly interfere with the state machine in the processor
-	 * that invalidates the L2 cache tags.
-	 */
-	mfspr	r8,HID0			/* Save HID0 in r8 */
-	rlwinm	r4,r8,0,12,10		/* Turn off HID0[DPM] */
-	sync
-	mtspr	HID0,r4			/* Disable DPM */
-	sync
-
-	/* Perform a global invalidation */
-	oris	r3,r3,0x0020
-	sync
-	mtspr	L2CR,r3
-	sync
-	isync				/* For errata */
-
-	/* Wait for the invalidation to complete */
-3:	mfspr	r3,L2CR
-	rlwinm.	r4,r3,0,31,31
-	bne	3b
-	
-	rlwinm	r3,r3,0,11,9		/* Turn off the L2I bit */
-	sync
-	mtspr	L2CR,r3
-	sync
-	
-	/* Restore HID0[DPM] to whatever it was before */
-	sync
-	mtspr	1008,r8
-	sync
-
-	/* See if we need to enable the cache */
-	cmplwi	r5,0
-	beq	4f
-
-	/* Enable the cache */
-	oris	r3,r3,0x8000
-	mtspr	L2CR,r3
-	sync
-
-	/* Restore MSR (restores EE and DR bits to original state) */
-4:	SYNC
-	mtmsr	r7
-	isync
-	blr
-
-99:	li	r3,-1
-	blr
-
-_GLOBAL(_get_L2CR)
-	/* Make sure this is a 750 chip */
-	mfspr	r3,PVR
-	srwi	r3,r3,16
-	cmpwi	r3,0x0008
-	cmpwi	cr1,r3,0x000c
-	li	r3,0
-	cror	2,2,4*cr1+2
-	bnelr
-	/* Return the L2CR contents */
-	mfspr	r3,L2CR
-	blr
-
-/* --- End of PowerLogix code ---
- */
-
-/*
-_GLOBAL(_get_L2CR)
-	mfspr	r3,L2CR
-	blr
-
-_GLOBAL(_set_L2CR)
-	mtspr	L2CR,r3
-	blr
-		
-*/
-
 /*
  * These are used in the alignment trap handler when emulating
  * single-precision loads and stores.
@@ -1099,7 +874,7 @@
 	mr	r3,r4	        /* load arg and call fn */
 	blrl
 	li	r0,__NR_exit	/* exit after child exits */
-        li	r3,0
+	li	r3,0
 	sc
 
 /*
@@ -1279,7 +1054,7 @@
 	.long sys_setfsuid
 	.long sys_setfsgid
 	.long sys_llseek	/* 140 */
-        .long sys_getdents
+	.long sys_getdents
 	.long ppc_select
 	.long sys_flock
 	.long sys_msync
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/mk_defs.c linux/arch/ppc/kernel/mk_defs.c
--- v2.4.9/linux/arch/ppc/kernel/mk_defs.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/ppc/kernel/mk_defs.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.mk_defs.c 1.8 06/28/01 15:50:16 paulus
+ * BK Id: SCCS/s.mk_defs.c 1.11 08/19/01 22:43:23 paulus
  */
 /*
  * This program is used to generate definitions needed by
@@ -26,6 +26,7 @@
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/processor.h>
+#include <asm/cputable.h>
 
 #define DEFINE(sym, val) \
 	asm volatile("\n#define\t" #sym "\t%0" : : "i" (val))
@@ -118,5 +119,14 @@
 	DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap));
 	DEFINE(CLONE_VM, CLONE_VM);
 	DEFINE(MM_PGD, offsetof(struct mm_struct, pgd));
+
+	/* About the CPU features table */
+	DEFINE(CPU_SPEC_ENTRY_SIZE, sizeof(struct cpu_spec));
+	DEFINE(CPU_SPEC_PVR_MASK, offsetof(struct cpu_spec, pvr_mask));
+	DEFINE(CPU_SPEC_PVR_VALUE, offsetof(struct cpu_spec, pvr_value));
+	DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features));
+	DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup));
+
+	DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
 	return 0;
 }
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/oak_setup.c linux/arch/ppc/kernel/oak_setup.c
--- v2.4.9/linux/arch/ppc/kernel/oak_setup.c	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/oak_setup.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.oak_setup.c 1.5 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.oak_setup.c 1.8 08/15/01 21:48:38 paulus
  */
 /*
  *
@@ -74,8 +74,8 @@
  *
  */
 void __init
-oak_init(unsigned long r3, unsigned long r4, unsigned long r5, 
-	 unsigned long r6, unsigned long r7)
+platform_init(unsigned long r3, unsigned long r4, unsigned long r5, 
+	      unsigned long r6, unsigned long r7)
 {
 	/*
 	 * If we were passed in a board information, copy it into the
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/open_pic.c linux/arch/ppc/kernel/open_pic.c
--- v2.4.9/linux/arch/ppc/kernel/open_pic.c	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/open_pic.c	Sat Sep  8 12:38:41 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.open_pic.c 1.20 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.open_pic.c 1.28 09/08/01 15:47:42 paulus
  */
 /*
  *  arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling
@@ -17,11 +17,13 @@
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/irq.h>
+#include <linux/init.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 "local_irq.h"
 #include "open_pic.h"
@@ -47,8 +49,6 @@
 
 /* Global Operations */
 static void openpic_disable_8259_pass_through(void);
-static u_int openpic_irq(void);
-static void openpic_eoi(void);
 static void openpic_set_priority(u_int pri);
 static void openpic_set_spurious(u_int vector);
 
@@ -73,8 +73,8 @@
  * These functions are not used but the code is kept here
  * for completeness and future reference.
  */
-#ifdef notused
 static void openpic_reset(void);
+#ifdef notused
 static void openpic_enable_8259_pass_through(void);
 static u_int openpic_get_priority(void);
 static u_int openpic_get_spurious(void);
@@ -412,13 +412,16 @@
 #endif
 }
 
-#ifdef notused
 static void openpic_reset(void)
 {
 	openpic_setfield(&OpenPIC->Global.Global_Configuration0,
 			 OPENPIC_CONFIG_RESET);
+	while (openpic_readfield(&OpenPIC->Global.Global_Configuration0,
+				 OPENPIC_CONFIG_RESET))
+		mb();
 }
 
+#ifdef notused
 static void openpic_enable_8259_pass_through(void)
 {
 	openpic_clearfield(&OpenPIC->Global.Global_Configuration0,
@@ -435,7 +438,7 @@
 /*
  *  Find out the current interrupt
  */
-static u_int openpic_irq(void)
+u_int openpic_irq(void)
 {
 	u_int vec;
 	DECL_THIS_CPU;
@@ -446,7 +449,7 @@
 	return vec;
 }
 
-static void openpic_eoi(void)
+void openpic_eoi(void)
 {
 	DECL_THIS_CPU;
 
@@ -518,6 +521,8 @@
 		      physmask(cpumask));
 }
 
+static spinlock_t openpic_setup_lock = SPIN_LOCK_UNLOCKED;
+
 #ifdef CONFIG_SMP
 /*
  *  Initialize an interprocessor interrupt (and disable it)
@@ -583,7 +588,6 @@
  * Get IPI's working and start taking interrupts.
  *   -- Cort
  */
-static spinlock_t openpic_setup_lock __initdata = SPIN_LOCK_UNLOCKED;
 
 void __init do_openpic_setup_cpu(void)
 {
@@ -802,11 +806,87 @@
 #endif
 		openpic_eoi();
         }
-	if (irq == OPENPIC_VEC_SPURIOUS + open_pic_irq_offset) {
+	if (irq == OPENPIC_VEC_SPURIOUS + open_pic_irq_offset)
 		irq = -1;
-		/* That's not SMP safe ... but who cares ? */
-		ppc_spurious_interrupts++;
-	}
 	return irq;
 }
 
+#ifdef CONFIG_SMP
+void
+smp_openpic_message_pass(int target, int msg, unsigned long data, int wait)
+{
+	/* make sure we're sending something that translates to an IPI */
+	if (msg > 0x3) {
+		printk("SMP %d: smp_message_pass: unknown msg %d\n",
+		       smp_processor_id(), msg);
+		return;
+	}
+	switch (target) {
+	case MSG_ALL:
+		openpic_cause_IPI(msg, 0xffffffff);
+		break;
+	case MSG_ALL_BUT_SELF:
+		openpic_cause_IPI(msg,
+				  0xffffffff & ~(1 << smp_processor_id()));
+		break;
+	default:
+		openpic_cause_IPI(msg, 1<<target);
+		break;
+	}
+}
+#endif /* CONFIG_SMP */
+
+#ifdef CONFIG_PMAC_PBOOK
+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];
+
+void __pmac
+openpic_sleep_save_intrs(void)
+{
+	int	i;
+	unsigned long flags;
+	
+	spin_lock_irqsave(&openpic_setup_lock, flags);
+
+	for (i=0; i<NumProcessors; i++) {
+		save_cpu_task_pri[i] = openpic_read(&OpenPIC->Processor[i].Current_Task_Priority);
+		openpic_writefield(&OpenPIC->Processor[i].Current_Task_Priority,
+				   OPENPIC_CURRENT_TASK_PRIORITY_MASK, 0xf);
+	}
+
+	for (i=0; i<OPENPIC_NUM_IPI; i++)
+		save_ipi_vp[i] = openpic_read(&OpenPIC->Global.IPI_Vector_Priority(i));
+	for (i=0; i<NumSources; i++) {
+		save_irq_src_vp[i] = openpic_read(&OpenPIC->Source[i].Vector_Priority)
+			& ~OPENPIC_ACTIVITY;
+		save_irq_src_dest[i] = openpic_read(&OpenPIC->Source[i].Destination);
+	}
+	spin_unlock_irqrestore(&openpic_setup_lock, flags);
+}
+
+void __pmac
+openpic_sleep_restore_intrs(void)
+{
+	int		i;
+	unsigned long	flags;
+
+	spin_lock_irqsave(&openpic_setup_lock, flags);
+	
+	openpic_reset();
+
+	for (i=0; i<OPENPIC_NUM_IPI; i++)
+		openpic_write(&OpenPIC->Global.IPI_Vector_Priority(i), save_ipi_vp[i]);
+	for (i=0; i<NumSources; i++) {
+		openpic_write(&OpenPIC->Source[i].Vector_Priority, save_irq_src_vp[i]);
+		openpic_write(&OpenPIC->Source[i].Destination, save_irq_src_dest[i]);
+	}
+	openpic_set_spurious(OPENPIC_VEC_SPURIOUS+open_pic_irq_offset);
+	openpic_disable_8259_pass_through();
+	for (i=0; i<NumProcessors; i++)
+		openpic_write(&OpenPIC->Processor[i].Current_Task_Priority, save_cpu_task_pri[i]);
+
+	spin_unlock_irqrestore(&openpic_setup_lock, flags);
+}
+#endif /* CONFIG_PMAC_PBOOK */
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/open_pic.h linux/arch/ppc/kernel/open_pic.h
--- v2.4.9/linux/arch/ppc/kernel/open_pic.h	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/open_pic.h	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.open_pic.h 1.8 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.open_pic.h 1.12 08/20/01 22:33:28 paulus
  */
 /*
  *  arch/ppc/kernel/open_pic.h -- OpenPIC Interrupt Handling
@@ -19,6 +19,14 @@
 
 #define OPENPIC_SIZE	0x40000
 
+/*
+ *  Non-offset'ed vector numbers
+ */
+
+#define OPENPIC_VEC_TIMER	64	/* and up */
+#define OPENPIC_VEC_IPI		72	/* and up */
+#define OPENPIC_VEC_SPURIOUS	127
+
 /* OpenPIC IRQ controller structure */
 extern struct hw_interrupt_type open_pic;
 
@@ -33,16 +41,28 @@
 
 /* Exported functions */
 extern void openpic_init(int, int, unsigned char *, int);
+extern u_int openpic_irq(void);
+extern void openpic_eoi(void);
 extern void openpic_request_IPIs(void);
 extern void do_openpic_setup_cpu(void);
 extern int openpic_get_irq(struct pt_regs *regs);
 extern void openpic_init_processor(u_int cpumask);
 extern void openpic_setup_ISU(int isu_num, unsigned long addr);
 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 inline int openpic_to_irq(int irq)
 {
-	return irq += NUM_8259_INTERRUPTS;
+	/* IRQ 0 usually means 'disabled'.. don't mess with it 
+	 * exceptions to this (sandpoint maybe?) 
+	 * shouldn't use openpic_to_irq 
+	 */
+	if (irq != 0){
+		return irq += NUM_8259_INTERRUPTS;
+	} else {
+		return 0;
+	}
 }
 /*extern int open_pic_irq_offset;*/
 #endif /* _PPC_KERNEL_OPEN_PIC_H */
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/open_pic_defs.h linux/arch/ppc/kernel/open_pic_defs.h
--- v2.4.9/linux/arch/ppc/kernel/open_pic_defs.h	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/open_pic_defs.h	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.open_pic_defs.h 1.7 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.open_pic_defs.h 1.8 08/20/01 22:33:28 paulus
  */
 /*
  *  linux/openpic.h -- OpenPIC definitions
@@ -44,14 +44,6 @@
 #define OPENPIC_NUM_PRI		16
 #define OPENPIC_NUM_VECTORS	256
 
-
-    /*
-     *  Non-offset'ed vector numbers
-     */
-
-#define OPENPIC_VEC_TIMER       64    /* and up */
-#define OPENPIC_VEC_IPI         72    /* and up */
-#define OPENPIC_VEC_SPURIOUS    127
 
 
     /*
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/pmac_backlight.c linux/arch/ppc/kernel/pmac_backlight.c
--- v2.4.9/linux/arch/ppc/kernel/pmac_backlight.c	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/pmac_backlight.c	Sat Sep  8 12:38:41 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.pmac_backlight.c 1.5 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.pmac_backlight.c 1.8 09/08/01 15:47:42 paulus
  */
 /*
  * Miscellaneous procedures for dealing with the PowerMac hardware.
@@ -14,7 +14,7 @@
 #include <linux/stddef.h>
 #include <linux/reboot.h>
 #include <linux/nvram.h>
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/ptrace.h>
 #include <asm/io.h>
 #include <asm/pgtable.h>
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/pmac_nvram.c linux/arch/ppc/kernel/pmac_nvram.c
--- v2.4.9/linux/arch/ppc/kernel/pmac_nvram.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/kernel/pmac_nvram.c	Sat Sep  8 12:38:41 2001
@@ -1,17 +1,18 @@
 /*
- * BK Id: SCCS/s.pmac_nvram.c 1.10 08/08/01 16:23:35 paulus
+ * BK Id: SCCS/s.pmac_nvram.c 1.15 09/08/01 15:47:42 paulus
  */
 /*
  * Miscellaneous procedures for dealing with the PowerMac hardware.
  */
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>
 #include <linux/nvram.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/prom.h>
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/pmac_pci.c linux/arch/ppc/kernel/pmac_pci.c
--- v2.4.9/linux/arch/ppc/kernel/pmac_pci.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/kernel/pmac_pci.c	Sat Sep  8 12:38:41 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.pmac_pci.c 1.22 08/08/01 16:35:43 paulus
+ * BK Id: SCCS/s.pmac_pci.c 1.27 09/08/01 15:47:42 paulus
  */
 /*
  * Support for PCI bridges found on Power Macintoshes.
@@ -22,7 +22,7 @@
 #include <linux/init.h>
 #include <linux/bootmem.h>
 
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/pci-bridge.h>
@@ -528,6 +528,7 @@
 pmac_pci_enable_device_hook(struct pci_dev *dev, int initial)
 {
 	struct device_node* node;
+	int updatecfg = 0;
 
 	node = pci_device_to_OF_node(dev);
 
@@ -538,14 +539,40 @@
 	    && dev->device == PCI_DEVICE_ID_APPLE_KL_USB && !node)
 		return -EINVAL;
 		
-	/* Firewire was disabled after PCI probe, the driver is claiming it,
-	 * so we must re-enable it now, at least until the driver can do it
-	 * itself.
+	/* Firewire & GMAC were disabled after PCI probe, the driver is
+	 * claiming them, we must re-enable them now.
 	 */
 	if (node && !strcmp(node->name, "firewire") && 
-	    device_is_compatible(node, "pci106b,18")) {
+	    (device_is_compatible(node, "pci106b,18") || 
+	     device_is_compatible(node, "pci106b,30"))) {
 		feature_set_firewire_cable_power(node, 1);
 		feature_set_firewire_power(node, 1);
+		updatecfg = 1;
+	}
+	if (node && !strcmp(node->name, "ethernet") && 
+	    device_is_compatible(node, "gmac")) {
+		feature_set_gmac_power(node, 1);
+		updatecfg = 1;
+	}
+
+	if (updatecfg) {
+		u16 cmd;
+		
+		/*
+		 * Make sure PCI is correctly configured
+		 *
+		 * We use old pci_bios versions of the function since, by
+		 * default, gmac is not powered up, and so will be absent
+		 * from the kernel initial PCI lookup. 
+		 * 
+		 * Should be replaced by 2.4 new PCI mecanisms and really
+		 * regiser the device.
+		 */
+		pci_read_config_word(dev, PCI_COMMAND, &cmd);
+		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);
 	}
 	
 	return 0;
@@ -580,7 +607,8 @@
 
 	nd = find_devices("firewire");
 	while (nd) {
-		if (nd->parent && device_is_compatible(nd, "pci106b,18")
+		if (nd->parent && (device_is_compatible(nd, "pci106b,18") ||
+					device_is_compatible(nd, "pci106b,30"))
 		    && device_is_compatible(nd->parent, "uni-north")) {
 			feature_set_firewire_power(nd, 0);
 			feature_set_firewire_cable_power(nd, 0);
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/pmac_pic.c linux/arch/ppc/kernel/pmac_pic.c
--- v2.4.9/linux/arch/ppc/kernel/pmac_pic.c	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/pmac_pic.c	Sat Sep  8 12:38:42 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.pmac_pic.c 1.14 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.pmac_pic.c 1.20 09/08/01 15:47:42 paulus
  */
 #include <linux/config.h>
 #include <linux/stddef.h>
@@ -8,7 +8,7 @@
 #include <linux/signal.h>
 #include <linux/pci.h>
 
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/io.h>
 #include <asm/smp.h>
 #include <asm/prom.h>
@@ -35,7 +35,6 @@
 
 static int max_irqs;
 static int max_real_irqs;
-static int pmac_has_openpic;
 
 spinlock_t pmac_pic_lock = SPIN_LOCK_UNLOCKED;
 
@@ -291,17 +290,16 @@
  * controller.  If we find this second ohare, set it up and fix the
  * interrupt value in the device tree for the ethernet chip.
  */
-static void __init enable_second_ohare(void)
+static int __init enable_second_ohare(void)
 {
 	unsigned char bus, devfn;
 	unsigned short cmd;
         unsigned long addr;
-	int second_irq;
 	struct device_node *irqctrler = find_devices("pci106b,7");
 	struct device_node *ether;
 
 	if (irqctrler == NULL || irqctrler->n_addrs <= 0)
-		return;
+		return -1;
 	addr = (unsigned long) ioremap(irqctrler->addrs[0].address, 0x40);
 	pmac_irq_hw[1] = (volatile struct pmac_irq_hw *)(addr + 0x20);
 	max_irqs = 64;
@@ -317,11 +315,6 @@
 		}
 	}
 
-	second_irq = irqctrler->intrs[0].line;
-	printk(KERN_INFO "irq: secondary controller on irq %d\n", second_irq);
-	request_irq(second_irq, gatwick_action, SA_INTERRUPT,
-		    "interrupt cascade", 0 );
-
 	/* Fix interrupt for the modem/ethernet combo controller. The number
 	   in the device tree (27) is bogus (correct for the ethernet-only
 	   board but not the combo ethernet/modem board).
@@ -333,6 +326,9 @@
 		printk(KERN_INFO "irq: Fixed ethernet IRQ to %d\n",
 		       ether->intrs[0].line);
 	}
+
+	/* Return the interrupt number of the cascade */
+	return irqctrler->intrs[0].line;
 }
 
 void __init
@@ -341,8 +337,8 @@
         int i;
         struct device_node *irqctrler;
         unsigned long addr;
-	int second_irq = -999;
-
+	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.
 	 */
@@ -368,7 +364,6 @@
 			OpenPIC_Addr = ioremap(irqctrler->addrs[0].address,
 					       irqctrler->addrs[0].size);
 			openpic_init(1, 0, 0, nmi_irq);
-			pmac_has_openpic = 1;
 #ifdef CONFIG_XMON
 			if (nmi_irq >= 0)
 				request_irq(nmi_irq, xmon_irq, 0,
@@ -418,6 +413,9 @@
 			for (i = 2; i < 4; ++i)
 				pmac_irq_hw[i] = (volatile struct pmac_irq_hw*)
 					(addr + (4 - i) * 0x10);
+			irq_cascade = irqctrler->intrs[0].line;
+			if (device_is_compatible(irqctrler, "gatwick"))
+				pmac_fix_gatwick_interrupts(irqctrler, max_real_irqs);
 		}
 	} else {
 		/* older powermacs have a GC (grand central) or ohare at
@@ -430,23 +428,20 @@
 	   ohare chip, on the combo ethernet/modem card */
 	if (machine_is_compatible("AAPL,3400/2400")
 	     || machine_is_compatible("AAPL,3500"))
-		enable_second_ohare();
+		irq_cascade = enable_second_ohare();
 
 	/* disable all interrupts in all controllers */
 	for (i = 0; i * 32 < max_irqs; ++i)
 		out_le32(&pmac_irq_hw[i]->enable, 0);
 	
 	/* get interrupt line of secondary interrupt controller */
-	if (irqctrler) {
-		second_irq = irqctrler->intrs[0].line;
+	if (irq_cascade >= 0) {
 		printk(KERN_INFO "irq: secondary controller on irq %d\n",
-			(int)second_irq);
-		if (device_is_compatible(irqctrler, "gatwick"))
-			pmac_fix_gatwick_interrupts(irqctrler, max_real_irqs);
+			(int)irq_cascade);
 		for ( i = max_real_irqs ; i < max_irqs ; i++ )
 			irq_desc[i].handler = &gatwick_pic;
-		request_irq( second_irq, gatwick_action, SA_INTERRUPT,
-			     "gatwick cascade", 0 );
+		request_irq( irq_cascade, gatwick_action, SA_INTERRUPT,
+			     "cascade", 0 );
 	}
 	printk("System has %d possible interrupts\n", max_irqs);
 	if (max_irqs != max_real_irqs)
@@ -467,14 +462,15 @@
  */
 unsigned int sleep_save_mask[2];
 
-void
-sleep_save_intrs(int viaint)
+void __pmac
+pmac_sleep_save_intrs(int viaint)
 {
 	sleep_save_mask[0] = ppc_cached_irq_mask[0];
 	sleep_save_mask[1] = ppc_cached_irq_mask[1];
 	ppc_cached_irq_mask[0] = 0;
 	ppc_cached_irq_mask[1] = 0;
-	set_bit(viaint, ppc_cached_irq_mask);
+	if (viaint > 0)
+		set_bit(viaint, ppc_cached_irq_mask);
 	out_le32(&pmac_irq_hw[0]->enable, ppc_cached_irq_mask[0]);
 	if (max_real_irqs > 32)
 		out_le32(&pmac_irq_hw[1]->enable, ppc_cached_irq_mask[1]);
@@ -484,8 +480,8 @@
         (void)in_le32(&pmac_irq_hw[0]->enable);
 }
 
-void
-sleep_restore_intrs(void)
+void __pmac
+pmac_sleep_restore_intrs(void)
 {
 	int i;
 
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/pmac_pic.h linux/arch/ppc/kernel/pmac_pic.h
--- v2.4.9/linux/arch/ppc/kernel/pmac_pic.h	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/pmac_pic.h	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.pmac_pic.h 1.5 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.pmac_pic.h 1.9 08/19/01 22:23:04 paulus
  */
 #ifndef _PPC_KERNEL_PMAC_PIC_H
 #define _PPC_KERNEL_PMAC_PIC_H
@@ -10,6 +10,5 @@
 
 void pmac_pic_init(void);
 int pmac_get_irq(struct pt_regs *regs);
-void pmac_post_irq(int);
 
 #endif /* _PPC_KERNEL_PMAC_PIC_H */
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/pmac_setup.c linux/arch/ppc/kernel/pmac_setup.c
--- v2.4.9/linux/arch/ppc/kernel/pmac_setup.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/kernel/pmac_setup.c	Sat Sep  8 12:38:42 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.pmac_setup.c 1.24 07/06/01 14:49:51 trini
+ * BK Id: SCCS/s.pmac_setup.c 1.39 09/08/01 15:47:42 paulus
  */
 /*
  *  linux/arch/ppc/kernel/setup.c
@@ -51,7 +51,7 @@
 #include <linux/pmu.h>
 
 #include <asm/processor.h>
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/prom.h>
 #include <asm/system.h>
 #include <asm/pgtable.h>
@@ -65,6 +65,8 @@
 #include <asm/keyboard.h>
 #include <asm/dma.h>
 #include <asm/bootx.h>
+#include <asm/cputable.h>
+#include <asm/btext.h>
 
 #include <asm/time.h>
 #include "local_irq.h"
@@ -133,13 +135,16 @@
 sys_ctrler_t sys_ctrler = SYS_CTRLER_UNKNOWN;
 
 #ifdef CONFIG_SMP
+extern struct smp_ops_t psurge_smp_ops;
+extern struct smp_ops_t core99_smp_ops;
+
 volatile static long int core99_l2_cache;
-void __pmac
+void __init
 core99_init_l2(void)
 {
 	int cpu = smp_processor_id();
 
-	if ( (_get_PVR() >> 16) != 8 && (_get_PVR() >> 16) != 12 )
+	if (!(cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR))
 		return;
 
 	if (cpu == 0){
@@ -277,6 +282,9 @@
 {
 	struct device_node *cpu;
 	int *fp;
+	unsigned long pvr;
+	
+	pvr = PVR_VER(mfspr(PVR));
 
 	/* Set loops_per_jiffy to a half-way reasonable value,
 	   for use until calibrate_delay gets called. */
@@ -284,18 +292,12 @@
 	if (cpu != 0) {
 		fp = (int *) get_property(cpu, "clock-frequency", NULL);
 		if (fp != 0) {
-			switch (_get_PVR() >> 16) {
-			case 4:		/* 604 */
-			case 8:		/* G3 */
-			case 9:		/* 604e */
-			case 10:	/* mach V (604ev5) */
-			case 12:	/* G4 */
-			case 20:	/* 620 */
+			if (pvr == 4 || pvr >= 8)
+				/* 604, G3, G4 etc. */
 				loops_per_jiffy = *fp / HZ;
-				break;
-			default:	/* 601, 603, etc. */
+			else
+				/* 601, 603, etc. */
 				loops_per_jiffy = *fp / (2*HZ);
-			}
 		} else
 			loops_per_jiffy = 50000000 / HZ;
 	}
@@ -303,14 +305,13 @@
 	/* this area has the CPU identification register
 	   and some registers used by smp boards */
 	sysctrl_regs = (volatile u32 *) ioremap(0xf8000000, 0x1000);
-	__ioremap(0xffc00000, 0x400000, pgprot_val(PAGE_READONLY));
 	ohare_init();
 
 	/* Lookup PCI hosts */
 	pmac_find_bridges();
 	
 	/* Checks "l2cr-value" property in the registry */
-	if ( (_get_PVR() >> 16) == 8 || (_get_PVR() >> 16) == 12 ) {
+	if (cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR) {
 		struct device_node *np = find_devices("cpus");		
 		if (np == 0)
 			np = find_type_devices("cpu");		
@@ -342,9 +343,19 @@
 
 #ifdef CONFIG_ADB_CUDA
 	find_via_cuda();
+#else
+	if (find_devices("via-cuda")) {
+		printk("WARNING ! Your machine is Cuda based but your kernel\n");
+		printk("          wasn't compiled with CONFIG_ADB_CUDA option !\n");
+	}
 #endif	
 #ifdef CONFIG_ADB_PMU
 	find_via_pmu();
+#else
+	if (find_devices("via-pmu")) {
+		printk("WARNING ! Your machine is PMU based but your kernel\n");
+		printk("          wasn't compiled with CONFIG_ADB_PMU option !\n");
+	}
 #endif	
 #ifdef CONFIG_NVRAM
 	pmac_nvram_init();
@@ -361,6 +372,14 @@
 	else
 #endif
 		ROOT_DEV = to_kdev_t(DEFAULT_ROOT_DEVICE);
+
+#ifdef CONFIG_SMP
+	/* Check for Core99 */
+	if (find_devices("uni-n"))
+		ppc_md.smp_ops = &core99_smp_ops;
+	else
+		ppc_md.smp_ops = &psurge_smp_ops;
+#endif /* CONFIG_SMP */
 }
 
 static void __init ohare_init(void)
@@ -475,9 +494,11 @@
 	static int found_boot = 0;
 	char *p;
 
-	/* Do nothing if the root has been set already. */
+	/* Do nothing if the root has been mounted already. */
+	if (init_task.fs->rootmnt != NULL)
+		return;
 	if ((goodness <= current_root_goodness) &&
-		(ROOT_DEV != to_kdev_t(DEFAULT_ROOT_DEVICE)))
+	    (ROOT_DEV != to_kdev_t(DEFAULT_ROOT_DEVICE)))
 		return;
 	p = strstr(saved_command_line, "root=");
 	if (p != NULL && (p == saved_command_line || p[-1] == ' '))
@@ -563,41 +584,7 @@
 /*
  * IDE stuff.
  */
-void __pmac
-pmac_ide_insw(ide_ioreg_t port, void *buf, int ns)
-{
-	_insw_ns((unsigned short *)(port+_IO_BASE), buf, ns);
-}
-
-void __pmac
-pmac_ide_outsw(ide_ioreg_t port, void *buf, int ns)
-{
-	_outsw_ns((unsigned short *)(port+_IO_BASE), buf, ns);
-}
-
-int __pmac
-pmac_ide_default_irq(ide_ioreg_t base)
-{
-#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
-	extern int pmac_ide_get_irq(ide_ioreg_t base);
-        return pmac_ide_get_irq(base);
-#else
-	return 0;
-#endif
-}
-
-ide_ioreg_t __pmac
-pmac_ide_default_io_base(int index)
-{
-#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
-	extern ide_ioreg_t pmac_ide_get_base(int index);
-        return pmac_ide_get_base(index);
-#else
-	return 0;
-#endif
-}
-
-int __pmac
+static int __pmac
 pmac_ide_check_region(ide_ioreg_t from, unsigned int extent)
 {
 	/*
@@ -606,11 +593,11 @@
 	 * register, it should be OK.
 	 */
 	if (from < ~_IO_BASE)
-		return 0;
-	return check_region(from, extent);
+		return check_region(from, extent);
+	return 0;
 }
 
-void __pmac
+static void __pmac
 pmac_ide_request_region(ide_ioreg_t from,
 			unsigned int extent,
 			const char *name)
@@ -619,7 +606,7 @@
 		request_region(from, extent, name);
 }
 
-void __pmac
+static void __pmac
 pmac_ide_release_region(ide_ioreg_t from,
 			unsigned int extent)
 {
@@ -627,21 +614,24 @@
 		release_region(from, extent);
 }
 
-#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
-/* This is declared in drivers/block/ide-pmac.c */
-void __pmac
-pmac_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq);
-#else
 /*
- * This registers the standard ports for this architecture with the IDE
- * driver.
+ * This is only used if we have a PCI IDE controller, not
+ * for the IDE controller in the ohare/paddington/heathrow/keylargo.
  */
-void __pmac
-pmac_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
+static void __pmac
+pmac_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port,
+		ide_ioreg_t ctrl_port, int *irq)
 {
+	ide_ioreg_t reg = data_port;
+	int i;
+
+	for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
+		hw->io_ports[i] = reg;
+		reg += 1;
+	}
+	hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
 }
 #endif
-#endif
 
 /*
  * Read in a property describing some pieces of memory.
@@ -728,39 +718,8 @@
 }
 
 void __init
-pmac_init(unsigned long r3, unsigned long r4, unsigned long r5,
-	  unsigned long r6, unsigned long r7)
+select_adb_keyboard(void)
 {
-	/* isa_io_base gets set in pmac_find_bridges */
-	isa_mem_base = PMAC_ISA_MEM_BASE;
-	pci_dram_offset = PMAC_PCI_DRAM_OFFSET;
-	ISA_DMA_THRESHOLD = ~0L;
-	DMA_MODE_READ = 1;
-	DMA_MODE_WRITE = 2;
-
-	ppc_md.setup_arch     = pmac_setup_arch;
-	ppc_md.setup_residual = NULL;
-	ppc_md.get_cpuinfo    = pmac_get_cpuinfo;
-	ppc_md.irq_cannonicalize = NULL;
-	ppc_md.init_IRQ       = pmac_pic_init;
-	ppc_md.get_irq        = pmac_get_irq; /* Changed later on ... */
-	ppc_md.init           = pmac_init2;
-	
-	ppc_md.pcibios_fixup  = pmac_pcibios_fixup;
-	ppc_md.pcibios_enable_device_hook = pmac_pci_enable_device_hook;
-	ppc_md.pcibios_after_init = pmac_pcibios_after_init;
-
-	ppc_md.restart        = pmac_restart;
-	ppc_md.power_off      = pmac_power_off;
-	ppc_md.halt           = pmac_halt;
-
-	ppc_md.time_init      = pmac_time_init;
-	ppc_md.set_rtc_time   = pmac_set_rtc_time;
-	ppc_md.get_rtc_time   = pmac_get_rtc_time;
-	ppc_md.calibrate_decr = pmac_calibrate_decr;
-
-	ppc_md.find_end_of_memory = pmac_find_end_of_memory;
-
 #ifdef CONFIG_VT
 #ifdef CONFIG_INPUT
 	ppc_md.kbd_init_hw       = mac_hid_init_hw;
@@ -768,6 +727,7 @@
 	ppc_md.kbd_unexpected_up = mac_hid_kbd_unexpected_up;
 	ppc_md.kbd_setkeycode    = 0;
 	ppc_md.kbd_getkeycode    = 0;
+	ppc_md.kbd_leds		 = 0;
 #ifdef CONFIG_MAGIC_SYSRQ
 #ifdef CONFIG_MAC_ADBKEYCODES
 	if (!keyboard_sends_linux_keycodes) {
@@ -793,21 +753,55 @@
 #endif /* CONFIG_MAGIC_SYSRQ */
 #endif /* CONFIG_INPUT_ADBHID/CONFIG_ADB_KEYBOARD */
 #endif /* CONFIG_VT */
+}
+
+void __init
+pmac_init(unsigned long r3, unsigned long r4, unsigned long r5,
+	  unsigned long r6, unsigned long r7)
+{
+	/* isa_io_base gets set in pmac_find_bridges */
+	isa_mem_base = PMAC_ISA_MEM_BASE;
+	pci_dram_offset = PMAC_PCI_DRAM_OFFSET;
+	ISA_DMA_THRESHOLD = ~0L;
+	DMA_MODE_READ = 1;
+	DMA_MODE_WRITE = 2;
+
+	ppc_md.setup_arch     = pmac_setup_arch;
+	ppc_md.setup_residual = NULL;
+	ppc_md.get_cpuinfo    = pmac_get_cpuinfo;
+	ppc_md.irq_cannonicalize = NULL;
+	ppc_md.init_IRQ       = pmac_pic_init;
+	ppc_md.get_irq        = pmac_get_irq; /* Changed later on ... */
+	ppc_md.init           = pmac_init2;
+	
+	ppc_md.pcibios_fixup  = pmac_pcibios_fixup;
+	ppc_md.pcibios_enable_device_hook = pmac_pci_enable_device_hook;
+	ppc_md.pcibios_after_init = pmac_pcibios_after_init;
+
+	ppc_md.restart        = pmac_restart;
+	ppc_md.power_off      = pmac_power_off;
+	ppc_md.halt           = pmac_halt;
+
+	ppc_md.time_init      = pmac_time_init;
+	ppc_md.set_rtc_time   = pmac_set_rtc_time;
+	ppc_md.get_rtc_time   = pmac_get_rtc_time;
+	ppc_md.calibrate_decr = pmac_calibrate_decr;
+
+	ppc_md.find_end_of_memory = pmac_find_end_of_memory;
+
+	select_adb_keyboard();
 
 #if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
-        ppc_ide_md.insw			= pmac_ide_insw;
-        ppc_ide_md.outsw		= pmac_ide_outsw;
-        ppc_ide_md.default_irq		= pmac_ide_default_irq;
-        ppc_ide_md.default_io_base	= pmac_ide_default_io_base;
         ppc_ide_md.ide_check_region	= pmac_ide_check_region;
         ppc_ide_md.ide_request_region	= pmac_ide_request_region;
         ppc_ide_md.ide_release_region	= pmac_ide_release_region;
-        ppc_ide_md.fix_driveid		= ppc_generic_ide_fix_driveid;
         ppc_ide_md.ide_init_hwif	= pmac_ide_init_hwif_ports;
 #endif /* CONFIG_BLK_DEV_IDE && CONFIG_BLK_DEV_IDE_PMAC */
+
 #ifdef CONFIG_BOOTX_TEXT
 	ppc_md.progress = pmac_progress;
 #endif /* CONFIG_BOOTX_TEXT */
+
 	if (ppc_md.progress) ppc_md.progress("pmac_init(): exit", 0);
 	
 }
@@ -821,7 +815,7 @@
 {
 	if (disp_bi == 0)
 		return;
-	prom_drawstring(s);
-	prom_drawchar('\n');
+	btext_drawstring(s);
+	btext_drawchar('\n');
 }
 #endif /* CONFIG_BOOTX_TEXT */
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/pmac_smp.c linux/arch/ppc/kernel/pmac_smp.c
--- v2.4.9/linux/arch/ppc/kernel/pmac_smp.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/kernel/pmac_smp.c	Sat Sep  8 12:38:42 2001
@@ -0,0 +1,489 @@
+/*
+ * BK Id: %F% %I% %G% %U% %#%
+ */
+/*
+ * SMP support for power macintosh.
+ *
+ * We support both the old "powersurge" SMP architecture
+ * and the current Core99 (G4 PowerMac) machines.
+ *
+ * Support Macintosh G4 SMP by Troy Benjegerdes (hozer@drgw.net)
+ * and Ben Herrenschmidt <benh@kernel.crashing.org>.
+ *
+ * Support for DayStar quad CPU cards
+ * Copyright (C) XLR8, Inc. 1994-2000
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ */
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/smp.h>
+#include <linux/smp_lock.h>
+#include <linux/interrupt.h>
+#include <linux/kernel_stat.h>
+#include <linux/delay.h>
+#define __KERNEL_SYSCALLS__
+#include <linux/unistd.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+
+#include <asm/ptrace.h>
+#include <asm/atomic.h>
+#include <asm/irq.h>
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/hardirq.h>
+#include <asm/softirq.h>
+#include <asm/sections.h>
+#include <asm/io.h>
+#include <asm/prom.h>
+#include <asm/smp.h>
+#include <asm/residual.h>
+#include <asm/feature.h>
+#include <asm/time.h>
+#include <asm/gemini.h>
+
+#include "open_pic.h"
+
+/*
+ * Powersurge (old powermac SMP) support.
+ */
+
+extern void __secondary_start_psurge(void);
+extern void __secondary_start_psurge2(void);	/* Temporary horrible hack */
+extern void __secondary_start_psurge3(void);	/* Temporary horrible hack */
+
+/* Addresses for powersurge registers */
+#define HAMMERHEAD_BASE		0xf8000000
+#define HHEAD_CONFIG		0x90
+#define HHEAD_SEC_INTR		0xc0
+
+/* register for interrupting the primary processor on the powersurge */
+/* N.B. this is actually the ethernet ROM! */
+#define PSURGE_PRI_INTR		0xf3019000
+
+/* register for storing the start address for the secondary processor */
+/* N.B. this is the PCI config space address register for the 1st bridge */
+#define PSURGE_START		0xf2800000
+
+/* Daystar/XLR8 4-CPU card */
+#define PSURGE_QUAD_REG_ADDR	0xf8800000
+
+#define PSURGE_QUAD_IRQ_SET	0
+#define PSURGE_QUAD_IRQ_CLR	1
+#define PSURGE_QUAD_IRQ_PRIMARY	2
+#define PSURGE_QUAD_CKSTOP_CTL	3
+#define PSURGE_QUAD_PRIMARY_ARB	4
+#define PSURGE_QUAD_BOARD_ID	6
+#define PSURGE_QUAD_WHICH_CPU	7
+#define PSURGE_QUAD_CKSTOP_RDBK	8
+#define PSURGE_QUAD_RESET_CTL	11
+
+#define PSURGE_QUAD_OUT(r, v)	(out_8(quad_base + ((r) << 4) + 4, (v)))
+#define PSURGE_QUAD_IN(r)	(in_8(quad_base + ((r) << 4) + 4) & 0x0f)
+#define PSURGE_QUAD_BIS(r, v)	(PSURGE_QUAD_OUT((r), PSURGE_QUAD_IN(r) | (v)))
+#define PSURGE_QUAD_BIC(r, v)	(PSURGE_QUAD_OUT((r), PSURGE_QUAD_IN(r) & ~(v)))
+
+/* virtual addresses for the above */
+static volatile u8 *hhead_base;
+static volatile u8 *quad_base;
+static volatile u32 *psurge_pri_intr;
+static volatile u8 *psurge_sec_intr;
+static volatile u32 *psurge_start;
+
+/* what sort of powersurge board we have */
+static int psurge_type;
+
+/* values for psurge_type */
+#define PSURGE_DUAL		0
+#define PSURGE_QUAD_OKEE	1
+#define PSURGE_QUAD_COTTON	2
+#define PSURGE_QUAD_ICEGRASS	3
+
+/* l2 cache stuff for dual G4 macs */
+extern void core99_init_l2(void);
+
+/*
+ * Set and clear IPIs for powersurge.
+ */
+static inline void psurge_set_ipi(int cpu)
+{
+	if (cpu == 0)
+		in_be32(psurge_pri_intr);
+	else if (psurge_type == PSURGE_DUAL)
+		out_8(psurge_sec_intr, 0);
+	else
+		PSURGE_QUAD_OUT(PSURGE_QUAD_IRQ_SET, 1 << cpu);
+}
+
+static inline void psurge_clr_ipi(int cpu)
+{
+	if (cpu > 0) {
+		if (psurge_type == PSURGE_DUAL)
+			out_8(psurge_sec_intr, ~0);
+		else
+			PSURGE_QUAD_OUT(PSURGE_QUAD_IRQ_CLR, 1 << cpu);
+	}
+}
+
+/*
+ * On powersurge (old SMP powermac architecture) we don't have
+ * separate IPIs for separate messages like openpic does.  Instead
+ * we have a bitmap for each processor, where a 1 bit means that
+ * the corresponding message is pending for that processor.
+ * Ideally each cpu's entry would be in a different cache line.
+ *  -- paulus.
+ */
+static unsigned long psurge_smp_message[NR_CPUS];
+
+void __pmac
+psurge_smp_message_recv(struct pt_regs *regs)
+{
+	int cpu = smp_processor_id();
+	int msg;
+
+	/* clear interrupt */
+	psurge_clr_ipi(cpu);
+
+	if (smp_num_cpus < 2)
+		return;
+
+	/* make sure there is a message there */
+	for (msg = 0; msg < 4; msg++)
+		if (test_and_clear_bit(msg, &psurge_smp_message[cpu]))
+			smp_message_recv(msg, regs);
+}
+
+void __pmac
+psurge_primary_intr(int irq, void *d, struct pt_regs *regs)
+{
+	psurge_smp_message_recv(regs);
+}
+
+static void __pmac
+smp_psurge_message_pass(int target, int msg, unsigned long data, int wait)
+{
+	int i;
+
+	if (smp_num_cpus < 2)
+		return;
+
+	for (i = 0; i < smp_num_cpus; i++) {
+		if (target == MSG_ALL
+		    || (target == MSG_ALL_BUT_SELF && i != smp_processor_id())
+		    || target == i) {
+			set_bit(msg, &psurge_smp_message[i]);
+			psurge_set_ipi(i);
+		}
+	}
+}
+
+/*
+ * Determine a quad card presence. We read the board ID register, we
+ * force the data bus to change to something else, and we read it again.
+ * It it's stable, then the register probably exist (ugh !)
+ */
+static int __init psurge_quad_probe(void)
+{
+	int type;
+	unsigned int i;
+
+	type = PSURGE_QUAD_IN(PSURGE_QUAD_BOARD_ID);
+	if (type < PSURGE_QUAD_OKEE || type > PSURGE_QUAD_ICEGRASS
+	    || type != PSURGE_QUAD_IN(PSURGE_QUAD_BOARD_ID))
+		return PSURGE_DUAL;
+
+	/* looks OK, try a slightly more rigorous test */
+	/* bogus is not necessarily cacheline-aligned,
+	   though I don't suppose that really matters.  -- paulus */
+	for (i = 0; i < 100; i++) {
+		volatile u32 bogus[8];
+		bogus[(0+i)%8] = 0x00000000;
+		bogus[(1+i)%8] = 0x55555555;
+		bogus[(2+i)%8] = 0xFFFFFFFF;
+		bogus[(3+i)%8] = 0xAAAAAAAA;
+		bogus[(4+i)%8] = 0x33333333;
+		bogus[(5+i)%8] = 0xCCCCCCCC;
+		bogus[(6+i)%8] = 0xCCCCCCCC;
+		bogus[(7+i)%8] = 0x33333333;
+		wmb();
+		asm volatile("dcbf 0,%0" : : "r" (bogus) : "memory");
+		mb();
+		if (type != PSURGE_QUAD_IN(PSURGE_QUAD_BOARD_ID))
+			return PSURGE_DUAL;
+	}
+	return type;
+}
+
+static void __init psurge_quad_init(void)
+{
+	int procbits;
+
+	if (ppc_md.progress) ppc_md.progress("psurge_quad_init", 0x351);
+	procbits = ~PSURGE_QUAD_IN(PSURGE_QUAD_WHICH_CPU);
+	if (psurge_type == PSURGE_QUAD_ICEGRASS)
+		PSURGE_QUAD_BIS(PSURGE_QUAD_RESET_CTL, procbits);
+	else
+		PSURGE_QUAD_BIC(PSURGE_QUAD_CKSTOP_CTL, procbits);
+	mdelay(33);
+	out_8(psurge_sec_intr, ~0);
+	PSURGE_QUAD_OUT(PSURGE_QUAD_IRQ_CLR, procbits);
+	PSURGE_QUAD_BIS(PSURGE_QUAD_RESET_CTL, procbits);
+	if (psurge_type != PSURGE_QUAD_ICEGRASS)
+		PSURGE_QUAD_BIS(PSURGE_QUAD_CKSTOP_CTL, procbits);
+	PSURGE_QUAD_BIC(PSURGE_QUAD_PRIMARY_ARB, procbits);
+	mdelay(33);
+	PSURGE_QUAD_BIC(PSURGE_QUAD_RESET_CTL, procbits);
+	mdelay(33);
+	PSURGE_QUAD_BIS(PSURGE_QUAD_PRIMARY_ARB, procbits);
+	mdelay(33);
+}
+
+static int __init smp_psurge_probe(void)
+{
+	int i, ncpus;
+
+	/* We don't do SMP on the PPC601 -- paulus */
+	if (PVR_VER(mfspr(PVR)) == 1)
+		return 1;
+
+	/*
+	 * The powersurge cpu board can be used in the generation
+	 * of powermacs that have a socket for an upgradeable cpu card,
+	 * including the 7500, 8500, 9500, 9600.
+	 * The device tree doesn't tell you if you have 2 cpus because
+	 * OF doesn't know anything about the 2nd processor.
+	 * Instead we look for magic bits in magic registers,
+	 * in the hammerhead memory controller in the case of the
+	 * dual-cpu powersurge board.  -- paulus.
+	 */
+	if (find_devices("hammerhead") == NULL)
+		return 1;
+
+	hhead_base = ioremap(HAMMERHEAD_BASE, 0x800);
+	quad_base = ioremap(PSURGE_QUAD_REG_ADDR, 1024);
+	psurge_sec_intr = hhead_base + HHEAD_SEC_INTR;
+
+	psurge_type = psurge_quad_probe();
+	if (psurge_type != PSURGE_DUAL) {
+		psurge_quad_init();
+		/* All released cards using this HW design have 4 CPUs */
+		ncpus = 4;
+	} else {
+		iounmap((void *) quad_base);
+		if ((in_8(hhead_base + HHEAD_CONFIG) & 0x02) == 0) {
+			/* not a dual-cpu card */
+			iounmap((void *) hhead_base);
+			return 1;
+		}
+		ncpus = 2;
+	}
+
+	psurge_start = ioremap(PSURGE_START, 4);
+	psurge_pri_intr = ioremap(PSURGE_PRI_INTR, 4);
+
+	/* this is not actually strictly necessary -- paulus. */
+	for (i = 1; i < ncpus; ++i)
+		smp_hw_index[i] = i;
+
+	if (ppc_md.progress) ppc_md.progress("smp_psurge_probe - done", 0x352);
+
+	return ncpus;
+}
+
+static void __init smp_psurge_kick_cpu(int nr)
+{
+	void (*start)(void) = __secondary_start_psurge;
+	unsigned long a;
+
+	/* may need to flush here if secondary bats aren't setup */
+	for (a = KERNELBASE; a < KERNELBASE + 0x800000; a += 32)
+		asm volatile("dcbf 0,%0" : : "r" (a) : "memory");
+	asm volatile("sync");
+
+	if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu", 0x353);
+
+	/* setup entry point of secondary processor */
+	switch (nr) {
+	case 2:
+		start = __secondary_start_psurge2;
+		break;
+	case 3:
+		start = __secondary_start_psurge3;
+		break;
+	}
+
+	out_be32(psurge_start, __pa(start));
+	mb();
+
+	psurge_set_ipi(nr);
+	udelay(10);
+	psurge_clr_ipi(nr);
+
+	if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu - done", 0x354);
+}
+
+/*
+ * With the dual-cpu powersurge board, the decrementers and timebases
+ * of both cpus are frozen after the secondary cpu is started up,
+ * until we give the secondary cpu another interrupt.  This routine
+ * uses this to get the timebases synchronized.
+ *  -- paulus.
+ */
+static void __init psurge_dual_sync_tb(int cpu_nr)
+{
+	static volatile int sec_tb_reset = 0;
+	int t;
+
+	set_dec(tb_ticks_per_jiffy);
+	set_tb(0, 0);
+	last_jiffy_stamp(cpu_nr) = 0;
+
+	if (cpu_nr > 0) {
+		mb();
+		sec_tb_reset = 1;
+		return;
+	}
+
+	/* wait for the secondary to have reset its TB before proceeding */
+	for (t = 10000000; t > 0 && !sec_tb_reset; --t)
+		;
+
+	/* now interrupt the secondary, starting both TBs */
+	psurge_set_ipi(1);
+
+	smp_tb_synchronized = 1;
+}
+
+static void __init
+smp_psurge_setup_cpu(int cpu_nr)
+{
+
+	if (cpu_nr == 0) {
+		if (smp_num_cpus < 2)
+			return;
+		/* reset the entry point so if we get another intr we won't
+		 * try to startup again */
+		out_be32(psurge_start, 0x100);
+		if (request_irq(30, psurge_primary_intr, 0, "primary IPI", 0))
+			printk(KERN_ERR "Couldn't get primary IPI interrupt");
+	}
+
+	if (psurge_type == PSURGE_DUAL)
+		psurge_dual_sync_tb(cpu_nr);
+}
+
+static int __init
+smp_core99_probe(void)
+{
+	struct device_node *cpus;
+	int i, ncpus = 1;
+
+	if (ppc_md.progress) ppc_md.progress("smp_core99_probe", 0x345);
+	cpus = find_type_devices("cpu");
+	if (cpus)
+		while ((cpus = cpus->next) != NULL)
+			++ncpus;
+	printk("smp_core99_probe: found %d cpus\n", ncpus);
+	if (ncpus > 1) {
+		openpic_request_IPIs();
+		for (i = 1; i < ncpus; ++i)
+			smp_hw_index[i] = i;
+	}
+
+	return ncpus;
+}
+
+static void __init
+smp_core99_kick_cpu(int nr)
+{
+	unsigned long save_vector, new_vector;
+	unsigned long flags;
+#if 1 /* New way... */
+	volatile unsigned long *vector
+		 = ((volatile unsigned long *)(KERNELBASE+0x100));
+	if (nr < 1 || nr > 3)
+		return;
+#else
+	volatile unsigned long *vector
+		 = ((volatile unsigned long *)(KERNELBASE+0x500));
+	if (nr != 1)
+		return;
+#endif
+	if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu", 0x346);
+
+	local_irq_save(flags);
+	local_irq_disable();
+	
+	/* Save reset vector */
+	save_vector = *vector;
+	
+	/* Setup fake reset vector that does	  
+	 *   b __secondary_start_psurge - KERNELBASE
+	 */  
+	switch(nr) {
+		case 1:
+			new_vector = (unsigned long)__secondary_start_psurge;
+			break;
+		case 2:
+			new_vector = (unsigned long)__secondary_start_psurge2;
+			break;
+		case 3:
+			new_vector = (unsigned long)__secondary_start_psurge3;
+			break;
+	}
+	*vector = 0x48000002 + new_vector - KERNELBASE;
+	
+	/* flush data cache and inval instruction cache */
+	flush_icache_range((unsigned long) vector, (unsigned long) vector + 4);
+	
+	/* Put some life in our friend */
+	feature_core99_kick_cpu(nr);
+	
+	/* FIXME: We wait a bit for the CPU to take the exception, I should
+	 * instead wait for the entry code to set something for me. Well,
+	 * ideally, all that crap will be done in prom.c and the CPU left
+	 * in a RAM-based wait loop like CHRP.
+	 */
+	mdelay(1);
+	
+	/* Restore our exception vector */
+	*vector = save_vector;
+	flush_icache_range((unsigned long) vector, (unsigned long) vector + 4);
+	
+	local_irq_restore(flags);
+	if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu done", 0x347);
+}
+
+static void __init
+smp_core99_setup_cpu(int cpu_nr)
+{
+	/* Setup openpic */
+	do_openpic_setup_cpu();
+
+	/* Setup L2 */
+	if (cpu_nr != 0)
+		core99_init_l2();
+	else
+		if (ppc_md.progress) ppc_md.progress("core99_setup_cpu 0 done", 0x349);
+}
+
+/* PowerSurge-style Macs */
+struct smp_ops_t psurge_smp_ops __pmacdata = {
+	smp_psurge_message_pass,
+	smp_psurge_probe,
+	smp_psurge_kick_cpu,
+	smp_psurge_setup_cpu,
+};
+
+/* Core99 Macs (dual G4s) */
+struct smp_ops_t core99_smp_ops __pmacdata = {
+	smp_openpic_message_pass,
+	smp_core99_probe,
+	smp_core99_kick_cpu,
+	smp_core99_setup_cpu,
+};
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/pmac_time.c linux/arch/ppc/kernel/pmac_time.c
--- v2.4.9/linux/arch/ppc/kernel/pmac_time.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/kernel/pmac_time.c	Sat Sep  8 12:38:42 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.pmac_time.c 1.11 07/06/01 15:46:39 trini
+ * BK Id: SCCS/s.pmac_time.c 1.16 09/08/01 15:47:42 paulus
  */
 /*
  * Support for periodic interrupts (100 per second) and for getting
@@ -22,7 +22,7 @@
 #include <linux/cuda.h>
 #include <linux/pmu.h>
 
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/prom.h>
 #include <asm/system.h>
 #include <asm/io.h>
@@ -260,8 +260,13 @@
 	pmu_register_sleep_notifier(&time_sleep_notifier);
 #endif /* CONFIG_PMAC_PBOOK */
 
-	if (via_calibrate_decr())
-		return;
+	/* We assume MacRISC2 machines have correct device-tree
+	 * calibration. That's better since the VIA itself seems
+	 * to be slightly off. --BenH
+	 */
+	if (!machine_is_compatible("MacRISC2"))
+		if (via_calibrate_decr())
+			return;
 
 	/*
 	 * The cpu node should have a timebase-frequency property
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/ppc_asm.h linux/arch/ppc/kernel/ppc_asm.h
--- v2.4.9/linux/arch/ppc/kernel/ppc_asm.h	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/kernel/ppc_asm.h	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.ppc_asm.h 1.14 07/02/01 22:08:05 paulus
+ * BK Id: SCCS/s.ppc_asm.h 1.16 08/15/01 22:43:06 paulus
  */
 /*
  * arch/ppc/kernel/ppc_asm.h
@@ -70,20 +70,35 @@
 #define REST_32VR(n,b,base)	REST_16VR(n,b,base); REST_16VR(n+16,b,base)
 
 #ifdef CONFIG_PPC601_SYNC_FIX
-#define SYNC \
-	sync; \
-	isync
+#define SYNC				\
+BEGIN_FTR_SECTION			\
+	sync;				\
+	isync;				\
+END_FTR_SECTION_IFSET(CPU_FTR_601)
+#define SYNC_601			\
+BEGIN_FTR_SECTION			\
+	sync;				\
+END_FTR_SECTION_IFSET(CPU_FTR_601)
+#define ISYNC_601			\
+BEGIN_FTR_SECTION			\
+	isync;				\
+END_FTR_SECTION_IFSET(CPU_FTR_601)
 #else
 #define	SYNC
+#define SYNC_601
+#define ISYNC_601
 #endif
 
 #ifndef CONFIG_SMP
 #define TLBSYNC
 #else /* CONFIG_SMP */
+/* tlbsync is not implemented on 601 */
 #define TLBSYNC				\
+BEGIN_FTR_SECTION			\
 	tlbsync;			\
-	sync
-#endif /* CONFIG_SMP */
+	sync;				\
+END_FTR_SECTION_IFCLR(CPU_FTR_601)
+#endif
 
 /*
  * This instruction is not implemented on the PPC 603 or 601; however, on
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/ppc_htab.c linux/arch/ppc/kernel/ppc_htab.c
--- v2.4.9/linux/arch/ppc/kernel/ppc_htab.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/ppc/kernel/ppc_htab.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.ppc_htab.c 1.11 06/28/01 15:50:16 paulus
+ * BK Id: SCCS/s.ppc_htab.c 1.17 08/20/01 22:59:41 paulus
  */
 /*
  * PowerPC hash table management proc entry.  Will show information
@@ -20,6 +20,7 @@
 #include <linux/stat.h>
 #include <linux/sysctl.h>
 #include <linux/ctype.h>
+#include <linux/threads.h>
 
 #include <asm/uaccess.h>
 #include <asm/bitops.h>
@@ -28,6 +29,8 @@
 #include <asm/residual.h>
 #include <asm/io.h>
 #include <asm/pgtable.h>
+#include <asm/cputable.h>
+#include <asm/system.h>
 
 static ssize_t ppc_htab_read(struct file * file, char * buf,
 			     size_t count, loff_t *ppos);
@@ -67,7 +70,7 @@
         write:          ppc_htab_write,
 };
 
-char *pmc1_lookup(unsigned long mmcr0)
+static char *pmc1_lookup(unsigned long mmcr0)
 {
 	switch ( mmcr0 & (0x7f<<7) )
 	{
@@ -84,7 +87,7 @@
 	}
 }	
 
-char *pmc2_lookup(unsigned long mmcr0)
+static char *pmc2_lookup(unsigned long mmcr0)
 {
 	switch ( mmcr0 & 0x3f )
 	{
@@ -121,11 +124,7 @@
 	if (count < 0)
 		return -EINVAL;
 
-	switch ( _get_PVR()>>16 )
-	{
-	case 4:  /* 604 */
-	case 9:  /* 604e */
-	case 10: /* 604ev5 */
+	if (cur_cpu_spec[0]->cpu_features & CPU_FTR_604_PERF_MON) {
 		asm volatile ("mfspr %0,952 \n\t"
 		    "mfspr %1,953 \n\t"
 		    "mfspr %2,954 \n\t"
@@ -141,12 +140,9 @@
 			      "PMC2\t\t: %08lx (%s)\n",
 			      pmc1, pmc1_lookup(mmcr0),
 			      pmc2, pmc2_lookup(mmcr0));
-		break;
-	default:
-		break;
 	}
 
-	
+#ifdef CONFIG_PPC_STD_MMU
 	/* if we don't have a htab */
 	if ( Hash_size == 0 )
 	{
@@ -154,7 +150,6 @@
 		goto return_string;
 	}
 
-#if !defined(CONFIG_8xx) && !defined(CONFIG_4xx)
 	for ( ptr = Hash ; ptr < Hash_end ; ptr++)
 	{
 		unsigned int ctx, mctx, vsid;
@@ -211,7 +206,7 @@
 		      "Evicts\t\t: %lu\n",
 		      htab_reloads, htab_preloads, htab_hash_searches,
 		      primary_pteg_full, htab_evicts);
-#endif /* !8xx && !4xx */
+#endif /* CONFIG_PPC_STD_MMU */
 	
 return_string:
 	n += sprintf( buffer + n,
@@ -235,7 +230,7 @@
 static ssize_t ppc_htab_write(struct file * file, const char * buffer,
 			      size_t count, loff_t *ppos)
 {
-#ifndef CONFIG_8xx
+#ifdef CONFIG_PPC_STD_MMU
 	unsigned long tmp;
 	if ( current->uid != 0 )
 		return -EACCES;
@@ -246,37 +241,22 @@
 	/* turn off performance monitoring */
 	if ( !strncmp( buffer, "off", 3) )
 	{
-		switch ( _get_PVR()>>16 )
-		{
-		case 4:  /* 604 */
-		case 9:  /* 604e */
-		case 10: /* 604ev5 */
+		if (cur_cpu_spec[0]->cpu_features & CPU_FTR_604_PERF_MON) {
 			asm volatile ("mtspr %0, %3 \n\t"
 			    "mtspr %1, %3 \n\t"
 			    "mtspr %2, %3 \n\t"			    
 			    :: "i" (MMCR0), "i" (PMC1), "i" (PMC2), "r" (0));
-			break;
-		default:
-			break;
 		}
-			
 	}
 
 	if ( !strncmp( buffer, "reset", 5) )
 	{
-		switch ( _get_PVR()>>16 )
-		{
-		case 4:  /* 604 */
-		case 9:  /* 604e */
-		case 10: /* 604ev5 */
+		if (cur_cpu_spec[0]->cpu_features & CPU_FTR_604_PERF_MON) {
 			/* reset PMC1 and PMC2 */
 			asm volatile (
 				"mtspr 953, %0 \n\t"
 				"mtspr 954, %0 \n\t"
 				:: "r" (0));
-			break;
-		default:
-			break;
 		}
 		htab_reloads = 0;
 		htab_evicts = 0;
@@ -286,11 +266,7 @@
 
 	if ( !strncmp( buffer, "user", 4) )
 	{
-		switch ( _get_PVR()>>16 )
-		{
-		case 4:  /* 604 */
-		case 9:  /* 604e */
-		case 10: /* 604ev5 */
+		if (cur_cpu_spec[0]->cpu_features & CPU_FTR_604_PERF_MON) {
 			/* setup mmcr0 and clear the correct pmc */
 			asm("mfspr %0,%1\n\t"  : "=r" (tmp) : "i" (MMCR0));
 			tmp &= ~(0x60000000);
@@ -301,19 +277,12 @@
 				"mtspr %5,%4 \n\t"    /* reset the pmc2 */
 				:: "r" (tmp), "i" (MMCR0), "i" (0),
 				"i" (PMC1),  "r" (0), "i"(PMC2) );
-			break;
-		default:
-			break;
 		}
 	}
 
 	if ( !strncmp( buffer, "kernel", 6) )
 	{
-		switch ( _get_PVR()>>16 )
-		{
-		case 4:  /* 604 */
-		case 9:  /* 604e */
-		case 10: /* 604ev5 */
+		if (cur_cpu_spec[0]->cpu_features & CPU_FTR_604_PERF_MON) {
 			/* setup mmcr0 and clear the correct pmc */
 			asm("mfspr %0,%1\n\t"  : "=r" (tmp) : "i" (MMCR0));
 			tmp &= ~(0x60000000);
@@ -324,20 +293,13 @@
 				"mtspr %5,%4 \n\t"    /* reset the pmc2 */
 				:: "r" (tmp), "i" (MMCR0), "i" (0),
 				"i" (PMC1),  "r" (0), "i"(PMC2) );
-			break;
-		default:
-			break;
 		}
 	}
 	
 	/* PMC1 values */
 	if ( !strncmp( buffer, "dtlb", 4) )
 	{
-		switch ( _get_PVR()>>16 )
-		{
-		case 4:  /* 604 */
-		case 9:  /* 604e */
-		case 10: /* 604ev5 */
+		if (cur_cpu_spec[0]->cpu_features & CPU_FTR_604_PERF_MON) {
 			/* setup mmcr0 and clear the correct pmc */
 			asm("mfspr %0,%1\n\t"  : "=r" (tmp) : "i" (MMCR0));
 			tmp &= ~(0x7f<<7);
@@ -352,11 +314,7 @@
 
 	if ( !strncmp( buffer, "ic miss", 7) )
 	{
-		switch ( _get_PVR()>>16 )
-		{
-		case 4:  /* 604 */
-		case 9:  /* 604e */
-		case 10: /* 604ev5 */
+		if (cur_cpu_spec[0]->cpu_features & CPU_FTR_604_PERF_MON) {
 			/* setup mmcr0 and clear the correct pmc */
 			asm("mfspr %0,%1\n\t"  : "=r" (tmp) : "i" (MMCR0));
 			tmp &= ~(0x7f<<7);
@@ -372,11 +330,7 @@
 	/* PMC2 values */
 	if ( !strncmp( buffer, "load miss time", 14) )
 	{
-		switch ( _get_PVR()>>16 )
-		{
-		case 4:  /* 604 */
-		case 9:  /* 604e */
-		case 10: /* 604ev5 */
+		if (cur_cpu_spec[0]->cpu_features & CPU_FTR_604_PERF_MON) {
 			/* setup mmcr0 and clear the correct pmc */
 		       asm volatile(
 			       "mfspr %0,%1\n\t"     /* get current mccr0 */
@@ -392,11 +346,7 @@
 	
 	if ( !strncmp( buffer, "itlb", 4) )
 	{
-		switch ( _get_PVR()>>16 )
-		{
-		case 4:  /* 604 */
-		case 9:  /* 604e */
-		case 10: /* 604ev5 */
+		if (cur_cpu_spec[0]->cpu_features & CPU_FTR_604_PERF_MON) {
 			/* setup mmcr0 and clear the correct pmc */
 		       asm volatile(
 			       "mfspr %0,%1\n\t"     /* get current mccr0 */
@@ -412,11 +362,7 @@
 
 	if ( !strncmp( buffer, "dc miss", 7) )
 	{
-		switch ( _get_PVR()>>16 )
-		{
-		case 4:  /* 604 */
-		case 9:  /* 604e */
-		case 10: /* 604ev5 */
+		if (cur_cpu_spec[0]->cpu_features & CPU_FTR_604_PERF_MON) {
 			/* setup mmcr0 and clear the correct pmc */
 		       asm volatile(
 			       "mfspr %0,%1\n\t"     /* get current mccr0 */
@@ -472,9 +418,9 @@
 	reset_SDR1();
 #endif	
 	return count;
-#else /* CONFIG_8xx */
+#else /* CONFIG_PPC_STD_MMU */
 	return 0;
-#endif /* CONFIG_8xx */
+#endif /* CONFIG_PPC_STD_MMU */
 }
 
 
@@ -516,7 +462,7 @@
 		"0.5", "1.0", "(reserved2)", "(reserved3)"
 	};
 
-	if ( ((_get_PVR() >> 16) != 8) && ((_get_PVR() >> 16) != 12))
+	if (!(cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR))
 		return -EFAULT;
 	
 	if ( /*!table->maxlen ||*/ (filp->f_pos && !write)) {
@@ -526,7 +472,7 @@
 	
 	vleft = table->maxlen / sizeof(int);
 	left = *lenp;
-	
+
 	for (; left /*&& vleft--*/; first=0) {
 		if (write) {
 			while (left) {
@@ -556,7 +502,6 @@
 			buffer += len;
 			left -= len;
 			_set_L2CR(val);
-			  
 		} else {
 			p = buf;
 			if (!first)
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/ppc_ksyms.c linux/arch/ppc/kernel/ppc_ksyms.c
--- v2.4.9/linux/arch/ppc/kernel/ppc_ksyms.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/kernel/ppc_ksyms.c	Sun Sep 16 21:22:50 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.ppc_ksyms.c 1.38 07/23/01 15:35:53 trini
+ * BK Id: SCCS/s.ppc_ksyms.c 1.51 08/24/01 17:05:47 paulus
  */
 #include <linux/config.h>
 #include <linux/module.h>
@@ -48,6 +48,8 @@
 #include <asm/smp.h>
 #endif /* CONFIG_SMP */
 #include <asm/time.h>
+#include <asm/cputable.h>
+#include <asm/btext.h>
 
 #ifdef  CONFIG_8xx
 #include "../8xx_io/commproc.h"
@@ -73,6 +75,8 @@
 int abs(int);
 extern unsigned long ret_to_user_hook;
 
+extern unsigned long mm_ptov (unsigned long paddr);
+
 EXPORT_SYMBOL(clear_page);
 EXPORT_SYMBOL(do_signal);
 EXPORT_SYMBOL(syscall_trace);
@@ -157,16 +161,10 @@
 EXPORT_SYMBOL(ioremap);
 EXPORT_SYMBOL(__ioremap);
 EXPORT_SYMBOL(iounmap);
+EXPORT_SYMBOL(iopa);
+EXPORT_SYMBOL(mm_ptov);
 
-EXPORT_SYMBOL(ide_insw);
-EXPORT_SYMBOL(ide_outsw);
 EXPORT_SYMBOL(ppc_ide_md);
-#ifdef CONFIG_BLK_DEV_IDE_MODULE
-EXPORT_SYMBOL(chrp_ide_irq);
-EXPORT_SYMBOL(chrp_ide_ports_known);
-EXPORT_SYMBOL(chrp_ide_regbase);
-EXPORT_SYMBOL(chrp_ide_probe);
-#endif
 
 #ifdef CONFIG_PCI
 EXPORT_SYMBOL_NOVERS(isa_io_base);
@@ -183,10 +181,10 @@
 /*EXPORT_SYMBOL(_disable_interrupts);
   EXPORT_SYMBOL(_enable_interrupts);*/
 EXPORT_SYMBOL(flush_instruction_cache);
-EXPORT_SYMBOL(_get_PVR);
 EXPORT_SYMBOL(giveup_fpu);
 EXPORT_SYMBOL(enable_kernel_fp);
 EXPORT_SYMBOL(flush_icache_range);
+EXPORT_SYMBOL(flush_dcache_range);
 EXPORT_SYMBOL(xchg_u32);
 #ifdef CONFIG_ALTIVEC
 EXPORT_SYMBOL(last_task_used_altivec);
@@ -200,6 +198,7 @@
 EXPORT_SYMBOL(__global_sti);
 EXPORT_SYMBOL(__global_save_flags);
 EXPORT_SYMBOL(__global_restore_flags);
+#ifdef SPINLOCK_DEBUG
 EXPORT_SYMBOL(_spin_lock);
 EXPORT_SYMBOL(_spin_unlock);
 EXPORT_SYMBOL(spin_trylock);
@@ -207,6 +206,7 @@
 EXPORT_SYMBOL(_read_unlock);
 EXPORT_SYMBOL(_write_lock);
 EXPORT_SYMBOL(_write_unlock);
+#endif
 EXPORT_SYMBOL(smp_call_function);
 EXPORT_SYMBOL(smp_hw_index);
 EXPORT_SYMBOL(smp_num_cpus);
@@ -226,17 +226,6 @@
 EXPORT_SYMBOL(cuda_request);
 EXPORT_SYMBOL(cuda_poll);
 #endif /* CONFIG_ADB_CUDA */
-#ifdef CONFIG_ADB_PMU
-EXPORT_SYMBOL(pmu_request);
-EXPORT_SYMBOL(pmu_poll);
-EXPORT_SYMBOL(pmu_suspend);
-EXPORT_SYMBOL(pmu_resume);
-#endif /* CONFIG_ADB_PMU */
-#ifdef CONFIG_PMAC_PBOOK
-EXPORT_SYMBOL(pmu_register_sleep_notifier);
-EXPORT_SYMBOL(pmu_unregister_sleep_notifier);
-EXPORT_SYMBOL(pmu_enable_irled);
-#endif /* CONFIG_PMAC_PBOOK */
 #ifdef CONFIG_PMAC_BACKLIGHT
 EXPORT_SYMBOL(get_backlight_level);
 EXPORT_SYMBOL(set_backlight_level);
@@ -245,7 +234,6 @@
 #endif /* CONFIG_PMAC_BACKLIGHT */
 #if defined(CONFIG_ALL_PPC)
 EXPORT_SYMBOL(_machine);
-EXPORT_SYMBOL_NOVERS(have_of);
 EXPORT_SYMBOL_NOVERS(sys_ctrler);
 EXPORT_SYMBOL(find_devices);
 EXPORT_SYMBOL(find_type_devices);
@@ -273,10 +261,11 @@
 EXPORT_SYMBOL(feature_set_usb_power);
 EXPORT_SYMBOL(feature_set_firewire_power);
 EXPORT_SYMBOL(feature_set_firewire_cable_power);
+EXPORT_SYMBOL(feature_set_modem_power);
 EXPORT_SYMBOL(feature_set_airport_power);
 #endif /* defined(CONFIG_ALL_PPC) */
 #if defined(CONFIG_BOOTX_TEXT)
-EXPORT_SYMBOL(bootx_update_display);
+EXPORT_SYMBOL(btext_update_display);
 #endif
 #if defined(CONFIG_SCSI) && defined(CONFIG_ALL_PPC)
 EXPORT_SYMBOL(note_scsi_host);
@@ -303,7 +292,7 @@
 
 EXPORT_SYMBOL(abs);
 
-#ifdef CONFIG_VT
+#ifdef CONFIG_VGA_CONSOLE
 EXPORT_SYMBOL(screen_info);
 #endif
 
@@ -325,7 +314,6 @@
 EXPORT_SYMBOL(tb_ticks_per_jiffy);
 EXPORT_SYMBOL(get_wchan);
 EXPORT_SYMBOL(console_drivers);
-EXPORT_SYMBOL(console_lock);
 #ifdef CONFIG_XMON
 EXPORT_SYMBOL(xmon);
 #endif
@@ -367,3 +355,4 @@
 #endif
 extern long *ret_from_intercept;
 EXPORT_SYMBOL(ret_from_intercept);
+EXPORT_SYMBOL(cur_cpu_spec);
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/prep_nvram.c linux/arch/ppc/kernel/prep_nvram.c
--- v2.4.9/linux/arch/ppc/kernel/prep_nvram.c	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/prep_nvram.c	Sat Sep  8 12:38:42 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.prep_nvram.c 1.9 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.prep_nvram.c 1.12 09/08/01 15:47:42 paulus
  */
 /*
  *  linux/arch/ppc/kernel/prep_nvram.c
@@ -12,7 +12,7 @@
 #include <linux/slab.h>
 #include <linux/ioport.h>
 
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/segment.h>
 #include <asm/io.h>
 #include <asm/processor.h>
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/prep_pci.c linux/arch/ppc/kernel/prep_pci.c
--- v2.4.9/linux/arch/ppc/kernel/prep_pci.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/kernel/prep_pci.c	Sat Sep  8 12:38:42 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.prep_pci.c 1.22 08/05/01 16:18:54 trini
+ * BK Id: SCCS/s.prep_pci.c 1.26 09/08/01 15:47:42 paulus
  */
 /*
  * PReP pci functions.
@@ -15,7 +15,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/byteorder.h>
 #include <asm/io.h>
 #include <asm/ptrace.h>
@@ -172,7 +172,7 @@
 	0,	/* Slot 7  - unused */
 	0,	/* Slot 8  - unused */
 	0,	/* Slot 9  - unused */
-	0,	/* Slot 10 - unxued */
+	0,	/* Slot 10 - unused */
 	0,	/* Slot 11 - unused */
 	0,	/* Slot 12 - unused */
 	0,	/* Slot 13 - unused */
@@ -200,7 +200,7 @@
 	0,      /* Slot 7  - unused */
 	0,      /* Slot 8  - unused */
 	0,      /* Slot 9  - unused */
-	0,      /* Slot 10 - unxued */
+	0,      /* Slot 10 - unused */
 	0,      /* Slot 11 - unused */
 	0,      /* Slot 12 - unused */
 	0,      /* Slot 13 - unused */
@@ -322,8 +322,8 @@
 	3,	/* Slot 12 - unused */
 	0,	/* Slot 13 - unused */
 	2,	/* Slot 14 - SCSI */
-	0,	/* Slot 15 - graphics on 3600 */
-	9,	/* Slot 16 - PMC */
+	0,	/* Slot 15 - unused */
+	9,	/* Slot 16 - PMC 1 */
 	12,	/* Slot 17 - pci */
 	11,	/* Slot 18 - pci */
 	10,	/* Slot 19 - pci */
@@ -511,6 +511,44 @@
         13      /* Line 4 */
 };
 
+/*
+ * IBM RS/6000 43p/140  -- paulus
+ * XXX we should get all this from the residual data
+ */
+static char ibm43p_pci_IRQ_map[23] __prepdata = {
+        0, /* Slot 0  - unused */
+        0, /* Slot 1  - unused */
+        0, /* Slot 2  - unused */
+        0, /* Slot 3  - unused */
+        0, /* Slot 4  - unused */
+        0, /* Slot 5  - unused */
+        0, /* Slot 6  - unused */
+        0, /* Slot 7  - unused */
+        0, /* Slot 8  - unused */
+        0, /* Slot 9  - unused */
+        0, /* Slot 10 - unused */
+        0, /* Slot 11 - FireCoral ISA bridge */
+        6, /* Slot 12 - Ethernet  */
+        0, /* Slot 13 - openpic */
+        0, /* Slot 14 - unused */
+        0, /* Slot 15 - unused */
+        7, /* Slot 16 - NCR58C825a onboard scsi */
+        0, /* Slot 17 - unused */
+        2, /* Slot 18 - PCI Slot 2 PCIINTx# (See below) */
+        0, /* Slot 19 - unused */
+        0, /* Slot 20 - unused */
+        0, /* Slot 21 - unused */
+        1, /* Slot 22 - PCI slot 1 PCIINTx# (See below) */
+};
+
+static char ibm43p_pci_IRQ_routes[] __prepdata = {
+        0,      /* Line 0 - unused */
+        15,     /* Line 1 */
+        15,     /* Line 2 */
+        15,     /* Line 3 */
+        15,     /* Line 4 */
+};
+
 /* Motorola PowerPlus architecture PCI IRQ tables */
 /* Interrupt line values for INTA-D on primary/secondary MPIC inputs */
 
@@ -767,7 +805,52 @@
 	{0x000, 0x00, 0x00, "",					NULL,			NULL, NULL, NULL, 0x00}
 };
 
-unsigned long __init prep_route_pci_interrupts(void)
+void ibm_prep_init(void)
+{
+	u32 addr;
+#ifdef CONFIG_PREP_RESIDUAL
+	PPC_DEVICE *mpic;
+#endif
+
+	if (inb(0x0852) == 0xd5) {
+		/* This is for the 43p-140 */
+		early_read_config_dword(0, 0, PCI_DEVFN(13, 0),
+					PCI_BASE_ADDRESS_0, &addr);
+		if (addr != 0xffffffff
+		    && !(addr & PCI_BASE_ADDRESS_SPACE_IO)
+		    && (addr &= PCI_BASE_ADDRESS_MEM_MASK) != 0) {
+			addr += PREP_ISA_MEM_BASE;
+			OpenPIC_Addr = ioremap(addr, 0x40000);
+			ppc_md.get_irq = openpic_get_irq;
+		}
+	}
+
+#ifdef CONFIG_PREP_RESIDUAL
+	mpic = residual_find_device(-1, NULL, SystemPeripheral,
+				    ProgrammableInterruptController, MPIC, 0);
+	if (mpic != NULL) {
+		printk("mpic = %p\n", mpic);
+	}
+#endif
+}
+
+void
+ibm43p_pci_map_non0(struct pci_dev *dev)
+{
+	unsigned char intpin;
+	static unsigned char bridge_intrs[4] = { 3, 4, 5, 8 };
+
+	if (dev == NULL)
+		return;
+	pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &intpin);
+	if (intpin < 1 || intpin > 4)
+		return;
+	intpin = (PCI_SLOT(dev->devfn) + intpin - 1) & 3;
+	dev->irq = openpic_to_irq(bridge_intrs[intpin]);
+	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
+}
+
+void __init prep_route_pci_interrupts(void)
 {
 	unsigned char *ibc_pirq = (unsigned char *)0x80800860;
 	unsigned char *ibc_pcicon = (unsigned char *)0x80800840;
@@ -856,7 +939,13 @@
 			Motherboard_map_name = "IBM 6015";
 			Motherboard_map = ibm6015_pci_IRQ_map;
 			Motherboard_routes = ibm6015_pci_IRQ_routes;
-			break;			
+			break;
+		case 0xd5:
+			Motherboard_map_name = "IBM 43p/140";
+			Motherboard_map = ibm43p_pci_IRQ_map;
+			Motherboard_routes = ibm43p_pci_IRQ_routes;
+			Motherboard_non0 = ibm43p_pci_map_non0;
+			break;
 		default:
 			Motherboard_map_name = "IBM 8xx (Carolina)";
 			Motherboard_map = ibm8xx_pci_IRQ_map;
@@ -878,7 +967,7 @@
 	else
 	{
 		printk("No known machine pci routing!\n");
-		return -1;
+		return;
 	}
 	
 	/* Set up mapping from slots */
@@ -888,16 +977,15 @@
 	}
 	/* Enable PCI interrupts */
 	*ibc_pcicon |= 0x20;
-	return 0;
 }
 
 void __init
 prep_pib_init(void)
 {
-unsigned char   reg;
-unsigned short  short_reg;
+	unsigned char   reg;
+	unsigned short  short_reg;
 
-struct pci_dev *dev = NULL;
+	struct pci_dev *dev = NULL;
 
 	if (( _prep_type == _PREP_Motorola) && (OpenPIC_Addr)) {
 		/*
@@ -910,43 +998,47 @@
 			 * PPCBUG does not set the enable bits
 			 * for the IDE device. Force them on here.
 			 */
-			pcibios_read_config_byte(dev->bus->number, 
-					dev->devfn, 0x40, &reg);
+			pci_read_config_byte(dev, 0x40, &reg);
 
 			reg |= 0x03; /* IDE: Chip Enable Bits */
-			pcibios_write_config_byte(dev->bus->number, 
-					dev->devfn, 0x40, reg);
-
-			/* Force correct IDE function interrupt */
-			dev->irq = 14;
-			pcibios_write_config_byte(dev->bus->number,
-					dev->devfn,
+			pci_write_config_byte(dev, 0x40, reg);
+		}
+		if ((dev = pci_find_device(PCI_VENDOR_ID_VIA,
+						PCI_DEVICE_ID_VIA_82C586_2,
+						dev)) && (dev->devfn = 0x5a)) {
+			/* Force correct USB interrupt */
+			dev->irq = 11;
+			pci_write_config_byte(dev,
 					PCI_INTERRUPT_LINE,
 					dev->irq);
-
-		} else if ((dev = pci_find_device(PCI_VENDOR_ID_WINBOND, 
+		}
+		if ((dev = pci_find_device(PCI_VENDOR_ID_WINBOND,
 					PCI_DEVICE_ID_WINBOND_83C553, dev))) {
-			/*
-			 * Clear the PCI Interrupt Routing Control Register.
-			 */
+			 /* Clear PCI Interrupt Routing Control Register. */
 			short_reg = 0x0000;
 			pci_write_config_word(dev, 0x44, short_reg);
 			if (OpenPIC_Addr){
-				/*
-				 * Route both IDE interrupts to IRQ 14
-				 */
+				/* Route IDE interrupts to IRQ 14 */
 				reg = 0xEE;
-				pci_write_config_byte(dev, 0x44, reg);
+				pci_write_config_byte(dev, 0x43, reg);
 			}
 		}
 	}
+
 	if ((dev = pci_find_device(PCI_VENDOR_ID_WINBOND,
 				   PCI_DEVICE_ID_WINBOND_82C105, dev))){
 		if (OpenPIC_Addr){
-			/* Disable LEGIRQ mode so PCI INTs are routed to
-			   the 8259 */
-			printk("Set winbond IDE to native mode\n");
-			pci_write_config_dword(dev, 0x40, 0x10ff00a1);
+			/*
+			 * Disable LEGIRQ mode so PCI INTS are routed
+			 * directly to the 8259 and enable both channels
+			 */
+			pci_write_config_dword(dev, 0x40, 0x10ff0033);
+
+			/* Force correct IDE interrupt */
+			dev->irq = 14;
+			pci_write_config_byte(dev,
+					PCI_INTERRUPT_LINE,
+					dev->irq);
 		}else{
 			/* Enable LEGIRQ for PCI INT -> 8259 IRQ routing */
 			pci_write_config_dword(dev, 0x40, 0x10ff08a1);
@@ -1106,6 +1198,19 @@
 	}
 }
 
+static void __init
+prep_init_resource(struct resource *res, unsigned long start,
+		   unsigned long end, int flags)
+{
+	res->flags = flags;
+	res->start = start;
+	res->end = end;
+	res->name = "PCI host bridge";
+	res->parent = NULL;
+	res->sibling = NULL;
+	res->child = NULL;
+}
+
 void __init
 prep_find_bridges(void)
 {
@@ -1119,6 +1224,9 @@
 	hose->last_busno = 0xff;
 	hose->pci_mem_offset = PREP_ISA_MEM_BASE;
 	hose->io_base_virt = (void *)PREP_ISA_IO_BASE;
+	prep_init_resource(&hose->io_resource, 0, 0x0fffffff, IORESOURCE_IO);
+	prep_init_resource(&hose->mem_resources[0], 0xc0000000, 0xfeffffff,
+			   IORESOURCE_MEM);
 	
 	printk("PReP architecture\n");
 	{
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/prep_setup.c linux/arch/ppc/kernel/prep_setup.c
--- v2.4.9/linux/arch/ppc/kernel/prep_setup.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/kernel/prep_setup.c	Sat Sep  8 12:38:42 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.prep_setup.c 1.26 08/05/01 16:18:54 trini
+ * BK Id: SCCS/s.prep_setup.c 1.36 09/08/01 15:47:42 paulus
  */
 /*
  *  linux/arch/ppc/kernel/setup.c
@@ -7,6 +7,9 @@
  *  Copyright (C) 1995  Linus Torvalds
  *  Adapted from 'alpha' version by Gary Thomas
  *  Modified by Cort Dougan (cort@cs.nmt.edu)
+ *
+ * Support for PReP (Motorola MTX/MVME)
+ * by Troy Benjegerdes (hozer@drgw.net)
  */
 
 /*
@@ -38,7 +41,7 @@
 #include <linux/pci.h>
 #include <linux/ide.h>
 
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/mmu.h>
 #include <asm/processor.h>
 #include <asm/residual.h>
@@ -78,6 +81,7 @@
 extern unsigned char rs_nvram_read_val(int addr);
 extern void rs_nvram_write_val(int addr,
 				 unsigned char val);
+extern void ibm_prep_init(void);
 
 extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
 extern int pckbd_getkeycode(unsigned int scancode);
@@ -329,13 +333,20 @@
 
 	/*print_residual_device_info();*/
 
-	raven_init();
+	switch (_prep_type) {
+	case _PREP_Motorola:
+		raven_init();
+		break;
+	case _PREP_IBM:
+		ibm_prep_init();
+		break;
+	}
 
 #ifdef CONFIG_VGA_CONSOLE
 	/* remap the VGA memory */
 	vgacon_remap_base = 0xf0000000;
 	/*vgacon_remap_base = ioremap(0xc0000000, 0xba000);*/
-        conswitchp = &vga_con;
+	conswitchp = &vga_con;
 #elif defined(CONFIG_DUMMY_CONSOLE)
 	conswitchp = &dummy_con;
 #endif
@@ -662,23 +673,6 @@
 	}
 }
 
-#if 0
-void __prep
-prep_do_IRQ(struct pt_regs *regs, int cpu)
-{
-        int irq;
-
-	if ( (irq = i8259_irq(0)) < 0 )
-	{
-		printk(KERN_DEBUG "Bogus interrupt from PC = %lx\n",
-		       regs->nip);
-		ppc_spurious_interrupts++;
-		return;
-	}
-        ppc_irq_dispatch_handler( regs, irq );
-}
-#endif
-
 int __prep
 prep_get_irq(struct pt_regs *regs)
 {
@@ -701,18 +695,6 @@
 /*
  * IDE stuff.
  */
-void __prep
-prep_ide_insw(ide_ioreg_t port, void *buf, int ns)
-{
-	_insw((unsigned short *)((port)+_IO_BASE), buf, ns);
-}
-
-void __prep
-prep_ide_outsw(ide_ioreg_t port, void *buf, int ns)
-{
-	_outsw((unsigned short *)((port)+_IO_BASE), buf, ns);
-}
-
 int __prep
 prep_ide_default_irq(ide_ioreg_t base)
 {
@@ -721,8 +703,9 @@
 		case 0x170: return 13;
 		case 0x1e8: return 11;
 		case 0x168: return 10;
-		default:
-                        return 0;
+		case 0xfff0: return 14;		/* MCP(N)750 ide0 */
+		case 0xffe0: return 15;		/* MCP(N)750 ide1 */
+		default: return 0;
 	}
 }
 
@@ -780,6 +763,45 @@
 }
 #endif
 
+#ifdef CONFIG_SMP
+/* PReP (MTX) support */
+static int
+smp_prep_probe(void)
+{
+	extern int mot_multi;
+
+	if (mot_multi) {
+		openpic_request_IPIs();
+		smp_hw_index[1] = 1;
+		return 2;
+	}
+
+	return 1;
+}
+
+static void
+smp_prep_kick_cpu(int nr)
+{
+	*(unsigned long *)KERNELBASE = nr;
+	asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory");
+	printk("CPU1 reset, waiting\n");
+}
+
+static void
+smp_prep_setup_cpu(int cpu_nr)
+{
+	if (OpenPIC_Addr)
+		do_openpic_setup_cpu();
+}
+
+static struct smp_ops_t prep_smp_ops = {
+	smp_openpic_message_pass,
+	smp_prep_probe,
+	smp_prep_kick_cpu,
+	smp_prep_setup_cpu,
+};
+#endif /* CONFIG_SMP */
+
 /*
  * This finds the amount of physical ram and does necessary
  * setup for prep.  This is pretty architecture specific so
@@ -788,29 +810,39 @@
  */
 unsigned long __init prep_find_end_of_memory(void)
 {
-	unsigned long total;
+	unsigned long total = 0;
+	extern unsigned int boot_mem_size;
+
 #ifdef CONFIG_PREP_RESIDUAL	
 	total = res->TotalMemory;
-#else
-	total = 0;
 #endif	
 
-	if (total == 0 )
-	{
+	if (total == 0 && boot_mem_size != 0)
+		total = boot_mem_size;
+
+	if (total == 0) {
 		/*
 		 * I need a way to probe the amount of memory if the residual
 		 * data doesn't contain it. -- Cort
 		 */
-		printk("Ramsize from residual data was 0 -- Probing for value\n");
 		total = 0x02000000;
-		printk("Ramsize default to be %ldM\n", total>>20);
+		printk(KERN_INFO "Ramsize from residual data was 0"
+		       " -- defaulting to %ldM\n", total>>20);
 	}
 
 	return (total);
 }
 
-unsigned long *MotSave_SmpIar;
-unsigned char *MotSave_CpusState[2];
+/*
+ * Setup the bat mappings we're going to load that cover
+ * the io areas.  RAM was mapped by mapin_ram().
+ * -- Cort
+ */
+void __init prep_map_io(void)
+{
+	io_block_mapping(0x80000000, 0x80000000, 0x10000000, _PAGE_IO);
+	io_block_mapping(0xf0000000, 0xc0000000, 0x08000000, _PAGE_IO);
+}
 
 void __init
 prep_init2(void)
@@ -838,13 +870,6 @@
 	{
 		memcpy((void *)res,(void *)(r3+KERNELBASE),
 		       sizeof(RESIDUAL));
-
-		/* These need to be saved for the Motorola Prep 
-		 * MVME4600 and Dual MTX boards.
-		 */
-		MotSave_SmpIar = &old_res->VitalProductData.SmpIar;
-		MotSave_CpusState[0] = &old_res->Cpus[0].CpuState;
-		MotSave_CpusState[1] = &old_res->Cpus[1].CpuState;
 	}
 #endif
 
@@ -912,19 +937,16 @@
 	}
 
 	ppc_md.find_end_of_memory = prep_find_end_of_memory;
+	ppc_md.setup_io_mappings = prep_map_io;
 
 #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
-        ppc_ide_md.insw = prep_ide_insw;
-        ppc_ide_md.outsw = prep_ide_outsw;
         ppc_ide_md.default_irq = prep_ide_default_irq;
         ppc_ide_md.default_io_base = prep_ide_default_io_base;
         ppc_ide_md.ide_check_region = prep_ide_check_region;
         ppc_ide_md.ide_request_region = prep_ide_request_region;
         ppc_ide_md.ide_release_region = prep_ide_release_region;
-        ppc_ide_md.fix_driveid = NULL;
         ppc_ide_md.ide_init_hwif = prep_ide_init_hwif_ports;
-#endif		
-        ppc_ide_md.io_base = _IO_BASE;
+#endif
 
 #ifdef CONFIG_VT
 	ppc_md.kbd_setkeycode    = pckbd_setkeycode;
@@ -938,4 +960,8 @@
 	SYSRQ_KEY = 0x54;
 #endif
 #endif
+
+#ifdef CONFIG_SMP
+	ppc_md.smp_ops		 = &prep_smp_ops;
+#endif /* CONFIG_SMP */
 }
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/prep_time.c linux/arch/ppc/kernel/prep_time.c
--- v2.4.9/linux/arch/ppc/kernel/prep_time.c	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/prep_time.c	Sat Sep  8 12:38:42 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.prep_time.c 1.7 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.prep_time.c 1.10 09/08/01 15:47:42 paulus
  */
 /*
  *  linux/arch/i386/kernel/time.c
@@ -23,7 +23,7 @@
 #include <linux/kernel_stat.h>
 #include <linux/init.h>
 
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/segment.h>
 #include <asm/io.h>
 #include <asm/processor.h>
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/process.c linux/arch/ppc/kernel/process.c
--- v2.4.9/linux/arch/ppc/kernel/process.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/kernel/process.c	Mon Sep 17 15:29:09 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.process.c 1.23 07/19/01 23:02:48 paulus
+ * BK Id: SCCS/s.process.c 1.27 08/28/01 22:01:21 paulus
  */
 /*
  *  linux/arch/ppc/kernel/process.c
@@ -48,7 +48,6 @@
 
 struct task_struct *last_task_used_math = NULL;
 struct task_struct *last_task_used_altivec = NULL;
-static struct vm_area_struct init_mmap = INIT_MMAP;
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
 static struct signal_struct init_signals = INIT_SIGNALS;
@@ -59,8 +58,6 @@
 };
 /* only used to get secondary processor up */
 struct task_struct *current_set[NR_CPUS] = {&init_task, };
-char *sysmap = NULL; 
-unsigned long sysmap_size = 0;
 
 #undef SHOW_TASK_SWITCHES
 #undef CHECK_STACK
@@ -324,7 +321,6 @@
 	    unsigned long unused,
 	    struct task_struct *p, struct pt_regs *regs)
 {
-	unsigned long msr;
 	struct pt_regs *childregs, *kregs;
 	extern void ret_from_fork(void);
 	unsigned long sp = (unsigned long)p + sizeof(union task_union);
@@ -362,11 +358,12 @@
 	 * copy fpu info - assume lazy fpu switch now always
 	 *  -- Cort
 	 */
-	if (regs->msr & MSR_FP)
+	if (regs->msr & MSR_FP) {
 		giveup_fpu(current);
+		childregs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1);
+	}
 	memcpy(&p->thread.fpr, &current->thread.fpr, sizeof(p->thread.fpr));
 	p->thread.fpscr = current->thread.fpscr;
-	childregs->msr &= ~MSR_FP;
 
 #ifdef CONFIG_ALTIVEC
 	/*
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/prom.c linux/arch/ppc/kernel/prom.c
--- v2.4.9/linux/arch/ppc/kernel/prom.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/kernel/prom.c	Sat Sep  8 12:38:42 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.prom.c 1.35 07/25/01 14:11:37 trini
+ * BK Id: SCCS/s.prom.c 1.42 09/08/01 15:47:42 paulus
  */
 /*
  * Procedures for interfacing to the Open Firmware PROM on
@@ -20,7 +20,7 @@
 #include <linux/threads.h>
 #include <linux/spinlock.h>
 
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/prom.h>
 #include <asm/page.h>
 #include <asm/processor.h>
@@ -33,6 +33,7 @@
 #include <asm/pgtable.h>
 #include <asm/bitops.h>
 #include <asm/bootinfo.h>
+#include <asm/btext.h>
 #include "open_pic.h"
 
 #ifdef CONFIG_FB
@@ -99,6 +100,7 @@
 #define FB_MAX	8
 #endif
 char *prom_display_paths[FB_MAX] __initdata = { 0, };
+phandle prom_display_nodes[FB_MAX] __initdata;
 unsigned int prom_num_displays __initdata = 0;
 char *of_stdout_device __initdata = 0;
 ihandle prom_disp_node __initdata = 0;
@@ -125,40 +127,6 @@
 
 static struct device_node *allnodes;
 
-#ifdef CONFIG_BOOTX_TEXT
-
-#define NO_SCROLL
-
-static void clearscreen(void);
-static void flushscreen(void);
-
-#ifndef NO_SCROLL
-static void scrollscreen(void);
-#endif
-
-static void prepare_disp_BAT(void);
-
-static void draw_byte(unsigned char c, long locX, long locY);
-static void draw_byte_32(unsigned char *bits, unsigned long *base, int rb);
-static void draw_byte_16(unsigned char *bits, unsigned long *base, int rb);
-static void draw_byte_8(unsigned char *bits, unsigned long *base, int rb);
-
-static int g_loc_X;
-static int g_loc_Y;
-static int g_max_loc_X;
-static int g_max_loc_Y;
-
-unsigned long disp_BAT[2] __initdata = {0, 0};
-
-#define cmapsz	(16*256)
-
-static unsigned char vga_font[cmapsz];
-
-int bootx_text_mapped = 1;
-
-#endif /* CONFIG_BOOTX_TEXT */
-
-
 static void *call_prom(const char *service, int nargs, int nret, ...);
 static void prom_exit(void);
 static unsigned long copy_device_tree(unsigned long, unsigned long);
@@ -174,7 +142,6 @@
 
 #ifdef CONFIG_BOOTX_TEXT
 static void setup_disp_fake_bi(ihandle dp);
-static void prom_welcome(boot_infos_t* bi, unsigned long phys);
 #endif
 
 extern void enter_rtas(void *);
@@ -182,10 +149,6 @@
 
 extern char cmd_line[512];	/* XXX */
 boot_infos_t *boot_infos;
-#ifdef CONFIG_BOOTX_TEXT
-boot_infos_t *disp_bi;
-boot_infos_t fake_bi;
-#endif
 unsigned long dev_tree_size;
 
 #define ALIGN(x) (((x) + sizeof(unsigned long)-1) & -sizeof(unsigned long))
@@ -257,13 +220,7 @@
 	unsigned long offset = reloc_offset();
 
 	if (RELOC(prom_stdout) == 0)
-	{
-#ifdef CONFIG_BOOTX_TEXT
-		if (RELOC(disp_bi) != 0)
-			prom_drawstring(msg);
-#endif
 		return;
-	}
 
 	for (p = msg; *p != 0; p = q) {
 		for (q = p; *q != 0 && *q != '\n'; ++q)
@@ -399,26 +356,21 @@
 		bi->logicalDisplayBase = 0;
 
 #ifdef CONFIG_BOOTX_TEXT
-	RELOC(g_loc_X) = 0;
-	RELOC(g_loc_Y) = 0;
-	RELOC(g_max_loc_X) = (bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) / 8;
-	RELOC(g_max_loc_Y) = (bi->dispDeviceRect[3] - bi->dispDeviceRect[1]) / 16;
-	RELOC(disp_bi) = PTRUNRELOC(bi);
-		
-	clearscreen();
+	btext_init(bi);
 
-	/* Test if boot-info is compatible. Done only in config CONFIG_BOOTX_TEXT since
-	   there is nothing much we can do with an incompatible version, except display
-	   a message and eventually hang the processor...
-		   
-	   I'll try to keep enough of boot-info compatible in the future to always allow
-	   display of this message;
-	*/
-	if (!BOOT_INFO_IS_COMPATIBLE(bi))
-		prom_print(RELOC(" !!! WARNING - Incompatible version of BootX !!!\n\n\n"));
-		
-	prom_welcome(bi, phys);
-	flushscreen();
+	/*
+	 * Test if boot-info is compatible.  Done only in config
+	 * CONFIG_BOOTX_TEXT since there is nothing much we can do
+	 * with an incompatible version, except display a message
+	 * and eventually hang the processor...
+	 *
+	 * I'll try to keep enough of boot-info compatible in the
+	 * future to always allow display of this message;
+	 */
+	if (!BOOT_INFO_IS_COMPATIBLE(bi)) {
+		btext_drawstring(RELOC(" !!! WARNING - Incompatible version of BootX !!!\n\n\n"));
+		btext_flushscreen();
+	}
 #endif	/* CONFIG_BOOTX_TEXT */	
 		
 	/* New BootX enters kernel with MMU off, i/os are not allowed
@@ -461,10 +413,13 @@
 	}
 		
 #ifdef CONFIG_BOOTX_TEXT
-	prepare_disp_BAT();
-	prom_drawstring(RELOC("booting...\n"));
-	flushscreen();
-	RELOC(bootx_text_mapped) = 1;
+	/*
+	 * Note that after we call prepare_disp_BAT, we can't do
+	 * prom_draw*, flushscreen or clearscreen until we turn the MMU
+	 * on, since prepare_disp_BAT sets disp_bi->logicalDisplayBase
+	 * to a virtual address.
+	 */
+	btext_prepare_BAT();
 #endif
 }
 
@@ -591,13 +546,11 @@
 unsigned long __init
 prom_init(int r3, int r4, prom_entry pp)
 {
-	int chrp = 0;
 	unsigned long mem;
-	ihandle prom_mmu, prom_op;
+	ihandle prom_mmu;
 	unsigned long offset = reloc_offset();
 	int l;
 	char *p, *d;
-	int prom_version = 0;
  	unsigned long phys;
 
  	/* Default */
@@ -622,31 +575,6 @@
 	RELOC(of_stdout_device) = PTRUNRELOC(p);
 	mem += strlen(p) + 1;
 
-	/* Find the OF version */
-	prom_op = call_prom(RELOC("finddevice"), 1, 1, RELOC("/openprom"));
-	prom_version = 0;
-	if (prom_op != (void*)-1) {
-		char model[64];
-		int sz;
-		sz = (int)call_prom(RELOC("getprop"), 4, 1, prom_op,
-				    RELOC("model"), model, 64);
-		if (sz > 0) {
-			char *c;
-			/* hack to skip the ibm chrp firmware # */
-			if ( strncmp(model,RELOC("IBM"),3) ) {
-				for (c = model; *c; c++)
-					if (*c >= '0' && *c <= '9') {
-						prom_version = *c - '0';
-						break;
-					}
-			}
-			else
-				chrp = 1;
-		}
-	}
-	if (prom_version >= 3)
-		prom_print(RELOC("OF Version 3 detected.\n"));
-
 	/* Get the boot device and translate it to a full OF pathname. */
 	p = (char *) mem;
 	l = (int) call_prom(RELOC("getprop"), 4, 1, RELOC(prom_chosen),
@@ -725,22 +653,14 @@
 	call_prom(RELOC("quiesce"), 0, 0);
 
 #ifdef CONFIG_BOOTX_TEXT
-	if (!chrp && RELOC(disp_bi)) {
-		RELOC(prom_stdout) = 0; /* stop OF output */
-		clearscreen();
-		prepare_disp_BAT();
-		prom_welcome(PTRRELOC(RELOC(disp_bi)), phys);
-		prom_drawstring(RELOC("booting...\n"));
-		RELOC(bootx_text_mapped) = 1;
-	} else {
-		RELOC(bootx_text_mapped) = 0;
-	}
+	btext_prepare_BAT();
 #endif
 
 	prom_print(RELOC("returning "));
 	prom_print_hex(phys);
 	prom_print(RELOC(" from prom_init\n"));
 	RELOC(prom_stdout) = 0;
+
 	return phys;
 }
 
@@ -767,82 +687,6 @@
 	rtas(&u, RELOC(rtas_data));
 }
 
-#ifdef CONFIG_BOOTX_TEXT
-static void __init
-prom_welcome(boot_infos_t* bi, unsigned long phys)
-{
-	unsigned long offset = reloc_offset();
-	unsigned long flags;
-	unsigned long pvr;
-	
-	prom_drawstring(RELOC("Welcome to Linux, kernel " UTS_RELEASE "\n"));
-	prom_drawstring(RELOC("\nstarted at       : 0x"));
-	prom_drawhex(phys);
-	prom_drawstring(RELOC("\nlinked at        : 0x"));
-	prom_drawhex(KERNELBASE);
-	prom_drawstring(RELOC("\nframe buffer at  : 0x"));
-	prom_drawhex((unsigned long)bi->dispDeviceBase);
-	prom_drawstring(RELOC(" (phys), 0x"));
-	prom_drawhex((unsigned long)bi->logicalDisplayBase);
-	prom_drawstring(RELOC(" (log)"));
-	prom_drawstring(RELOC("\nklimit           : 0x"));
-	prom_drawhex((unsigned long)RELOC(klimit));
-	prom_drawstring(RELOC("\nMSR              : 0x"));
-	__asm__ __volatile__ ("mfmsr %0" : "=r" (flags));
-	prom_drawhex(flags);
-	__asm__ __volatile__ ("mfspr %0, 287" : "=r" (pvr));
-	pvr >>= 16;
-	if (pvr > 1) {
-	    prom_drawstring(RELOC("\nHID0             : 0x"));
-	    __asm__ __volatile__ ("mfspr %0, 1008" : "=r" (flags));
-	    prom_drawhex(flags);
-	}
-	if (pvr == 8 || pvr == 12 || pvr == 0x800c) {
-	    prom_drawstring(RELOC("\nICTC             : 0x"));
-	    __asm__ __volatile__ ("mfspr %0, 1019" : "=r" (flags));
-	    prom_drawhex(flags);
-	}
-	prom_drawstring(RELOC("\n\n"));
-}
-
-/* Calc BAT values for mapping the display and store them
- * in disp_BAT.  Those values are then used from head.S to map
- * the display during identify_machine() and MMU_Init()
- * 
- * For now, the display is mapped in place (1:1). This should
- * be changed if the display physical address overlaps
- * KERNELBASE, which is fortunately not the case on any machine
- * I know of. This mapping is temporary and will disappear as
- * soon as the setup done by MMU_Init() is applied
- * 
- * For now, we align the BAT and then map 8Mb on 601 and 16Mb
- * on other PPCs. This may cause trouble if the framebuffer
- * is really badly aligned, but I didn't encounter this case
- * yet.
- */
-static void __init
-prepare_disp_BAT(void)
-{
-	unsigned long offset = reloc_offset();
-	boot_infos_t* bi = PTRRELOC(RELOC(disp_bi));
-	unsigned long addr = (unsigned long)bi->dispDeviceBase;
-	
-	if ((_get_PVR() >> 16) != 1) {
-		/* 603, 604, G3, G4, ... */
-		addr &= 0xFF000000UL;
-		RELOC(disp_BAT[0]) = addr | (BL_16M<<2) | 2;
-		RELOC(disp_BAT[1]) = addr | (_PAGE_NO_CACHE | _PAGE_GUARDED | BPP_RW);		
-	} else {
-		/* 601 */
-		addr &= 0xFF800000UL;
-		RELOC(disp_BAT[0]) = addr | (_PAGE_NO_CACHE | PP_RWXX) | 4;
-		RELOC(disp_BAT[1]) = addr | BL_8M | 0x40;
-	}
-	bi->logicalDisplayBase = bi->dispDeviceBase;
-}
-
-#endif
-
 static int __init
 prom_set_color(ihandle ih, int i, int r, int g, int b)
 {
@@ -920,17 +764,22 @@
 		i = RELOC(prom_num_displays)++;
 		if (RELOC(of_stdout_device) != 0 && i > 0
 		    && strcmp(PTRRELOC(RELOC(of_stdout_device)), path) == 0) {
-			for (; i > 0; --i)
+			for (; i > 0; --i) {
 				RELOC(prom_display_paths[i])
 					= RELOC(prom_display_paths[i-1]);
+				RELOC(prom_display_nodes[i])
+					= RELOC(prom_display_nodes[i-1]);
+			}
 		}
 		RELOC(prom_display_paths[i]) = PTRUNRELOC(path);
+		RELOC(prom_display_nodes[i]) = node;
 		if (i == 0)
 			RELOC(prom_disp_node) = node;
 		if (RELOC(prom_num_displays) >= FB_MAX)
 			break;
 	}
 
+try_again:
 	/*
 	 * Open the first display and set its colormap.
 	 */
@@ -941,6 +790,15 @@
 		ih = call_prom(RELOC("open"), 1, 1, path);
 		if (ih == 0 || ih == (ihandle) -1) {
 			prom_print(RELOC("... failed\n"));
+			for (i=1; i<RELOC(prom_num_displays); i++) {
+				RELOC(prom_display_paths[i-1]) = RELOC(prom_display_paths[i]);
+				RELOC(prom_display_nodes[i-1]) = RELOC(prom_display_nodes[i]);
+			}	
+			if (--RELOC(prom_num_displays) > 0)
+				RELOC(prom_disp_node) = RELOC(prom_display_nodes[0]);
+			else
+				RELOC(prom_disp_node) = NULL;
+			goto try_again;
 		} else {
 			prom_print(RELOC("... ok\n"));
 			/*
@@ -977,7 +835,6 @@
 {
 	int width = 640, height = 480, depth = 8, pitch;
 	unsigned address;
-	boot_infos_t* bi;
 	unsigned long offset = reloc_offset();
 	struct pci_reg_property addrs[8];
 	int i, naddrs;
@@ -1025,20 +882,8 @@
 	/* kludge for valkyrie */
 	if (strcmp(name, RELOC("valkyrie")) == 0) 
 		address += 0x1000;
- 
-	RELOC(disp_bi) = &fake_bi;
-	bi = PTRRELOC((&fake_bi));
-	RELOC(g_loc_X) = 0;
-	RELOC(g_loc_Y) = 0;
-	RELOC(g_max_loc_X) = width / 8;
-	RELOC(g_max_loc_Y) = height / 16;
-	bi->logicalDisplayBase = (unsigned char *)address;
-	bi->dispDeviceBase = (unsigned char *)address;
-	bi->dispDeviceRowBytes = pitch;
-	bi->dispDeviceDepth = depth;
-	bi->dispDeviceRect[0] = bi->dispDeviceRect[1] = 0;
-	bi->dispDeviceRect[2] = width;
-	bi->dispDeviceRect[3] = height;
+
+	btext_setup_display(width, height, depth, pitch, address);
 }
 #endif
 
@@ -1147,8 +992,7 @@
 		prev_propp = &pp->next;
 		namep = (char *) (pp + 1);
 		pp->name = PTRUNRELOC(namep);
-		/* Work around a GCC3 bug */
-		memcpy(namep, RELOC("linux,phandle"), sizeof("linux,phandle"));
+		strcpy(namep, RELOC("linux,phandle"));
 		mem_start = ALIGN((unsigned long)namep + strlen(namep) + 1);
 		pp->value = (unsigned char *) PTRUNRELOC(&np->node);
 		pp->length = sizeof(np->node);
@@ -1213,15 +1057,21 @@
 		 * np->name has not been set yet.  -- paulus
 		 */
 		int n = 0;
-		char *name;
+		char *name, *ic;
+		int iclen;
 
 		for (np = allnodes; np != NULL; np = np->allnext) {
-			if ((name = get_property(np, "name", NULL)) == NULL
-			    || strcmp(name, "interrupt-controller") != 0)
-				continue;
-			if (n == 0)
-				dflt_interrupt_controller = np;
-			++n;
+			ic = get_property(np, "interrupt-controller", &iclen);
+			name = get_property(np, "name", NULL);
+			/* checking iclen makes sure we don't get a false
+			   match on /chosen.interrupt_controller */
+			if ((name != NULL
+			     && strcmp(name, "interrupt-controller") == 0)
+			    || (ic != NULL && iclen == 0)) {
+				if (n == 0)
+					dflt_interrupt_controller = np;
+				++n;
+			}
 		}
 		num_interrupt_controllers = n;
 	}
@@ -1559,7 +1409,7 @@
 	}
 }
 
-int __init
+int
 prom_n_addr_cells(struct device_node* np)
 {
 	int* ip;
@@ -1574,7 +1424,7 @@
 	return 1;
 }
 
-int __init
+int
 prom_n_size_cells(struct device_node* np)
 {
 	int* ip;
@@ -1890,7 +1740,7 @@
 /*
  * Returns all nodes linked together
  */
-struct device_node __openfirmware *
+struct device_node * __openfirmware
 find_all_nodes(void)
 {
 	struct device_node *head, **prevp, *np;
@@ -1983,7 +1833,7 @@
 /*
  * Find the device_node with a given phandle.
  */
-static struct device_node __init *
+static struct device_node * __init
 find_phandle(phandle ph)
 {
 	struct device_node *np;
@@ -2111,6 +1961,12 @@
 		u.words[i+3] = va_arg(list, unsigned long);
 	va_end(list);
 
+	/* Shouldn't we enable kernel FP here ? enter_rtas will play
+	 * with MSR_FE0|MSR_FE1|MSR_FP so I assume rtas might use
+	 * floating points. If that's the case, then we need to make
+	 * sure any lazy FP context is backed up
+	 * --BenH
+	 */
 	spin_lock_irqsave(&rtas_lock, s);
 	enter_rtas((void *)__pa(&u));
 	spin_unlock_irqrestore(&rtas_lock, s);
@@ -2130,694 +1986,3 @@
 	for (;;)
 		prom_exit();
 }
-
-#ifdef CONFIG_BOOTX_TEXT
-
-/* Here's a small text engine to use during early boot or for debugging purposes
- * 
- * todo:
- * 
- *  - build some kind of vgacon with it to enable early printk
- *  - move to a separate file
- *  - add a few video driver hooks to keep in sync with display
- *    changes.
- */
-
-void
-map_bootx_text(void)
-{
-	unsigned long base, offset, size;
-	if (disp_bi == 0)
-		return;
-	base = ((unsigned long) disp_bi->dispDeviceBase) & 0xFFFFF000UL;
-	offset = ((unsigned long) disp_bi->dispDeviceBase) - base;
-	size = disp_bi->dispDeviceRowBytes * disp_bi->dispDeviceRect[3] + offset
-		+ disp_bi->dispDeviceRect[0];
-	disp_bi->logicalDisplayBase = ioremap(base, size);
-	if (disp_bi->logicalDisplayBase == 0)
-		return;
-	disp_bi->logicalDisplayBase += offset;
-	bootx_text_mapped = 1;
-}
-
-/* Calc the base address of a given point (x,y) */
-static unsigned char * __pmac
-calc_base(boot_infos_t *bi, int x, int y)
-{
-	unsigned char *base;
-
-	base = bi->logicalDisplayBase;
-	if (base == 0)
-		base = bi->dispDeviceBase;
-	base += (x + bi->dispDeviceRect[0]) * (bi->dispDeviceDepth >> 3);
-	base += (y + bi->dispDeviceRect[1]) * bi->dispDeviceRowBytes;
-	return base;
-}
-
-/* Adjust the display to a new resolution */
-void __openfirmware
-bootx_update_display(unsigned long phys, int width, int height,
-		     int depth, int pitch)
-{
-	if (disp_bi == 0)
-		return;
-	/* check it's the same frame buffer (within 64MB) */
-	if ((phys ^ (unsigned long)disp_bi->dispDeviceBase) & 0xfc000000) {
-		return;
-	}
-
-	disp_bi->dispDeviceBase = (__u8 *) phys;
-	disp_bi->dispDeviceRect[0] = 0;
-	disp_bi->dispDeviceRect[1] = 0;
-	disp_bi->dispDeviceRect[2] = width;
-	disp_bi->dispDeviceRect[3] = height;
-	disp_bi->dispDeviceDepth = depth;
-	disp_bi->dispDeviceRowBytes = pitch;
-	if (bootx_text_mapped) {
-		iounmap(disp_bi->logicalDisplayBase);
-		bootx_text_mapped = 0;
-	}
-	map_bootx_text();
-	g_loc_X = 0;
-	g_loc_Y = 0;
-	g_max_loc_X = width / 8;
-	g_max_loc_Y = height / 16;
-}
-
-static void __pmac
-clearscreen(void)
-{
-	unsigned long offset	= reloc_offset();
-	boot_infos_t* bi	= PTRRELOC(RELOC(disp_bi));
-	unsigned long *base	= (unsigned long *)calc_base(bi, 0, 0);
-	unsigned long width 	= ((bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) *
-					(bi->dispDeviceDepth >> 3)) >> 2;
-	int i,j;
-	
-	for (i=0; i<(bi->dispDeviceRect[3] - bi->dispDeviceRect[1]); i++)
-	{
-		unsigned long *ptr = base;
-		for(j=width; j; --j)
-			*(ptr++) = 0;
-		base += (bi->dispDeviceRowBytes >> 2);
-	}
-}
-
-__inline__ void dcbst(const void* addr)
-{
-	__asm__ __volatile__ ("dcbst 0,%0" :: "r" (addr));
-}
-
-static void __pmac
-flushscreen(void)
-{
-	unsigned long offset	= reloc_offset();
-	boot_infos_t* bi	= PTRRELOC(RELOC(disp_bi));
-	unsigned long *base	= (unsigned long *)calc_base(bi, 0, 0);
-	unsigned long width 	= ((bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) *
-					(bi->dispDeviceDepth >> 3)) >> 2;
-	int i,j;
-	
-	for (i=0; i<(bi->dispDeviceRect[3] - bi->dispDeviceRect[1]); i++)
-	{
-		unsigned long *ptr = base;
-		for(j=width; j>0; j-=8) {
-			dcbst(ptr);
-			ptr += 8;
-		}
-		base += (bi->dispDeviceRowBytes >> 2);
-	}
-}
-
-#ifndef NO_SCROLL
-static void __pmac
-scrollscreen(void)
-{
-	unsigned long offset		= reloc_offset();
-	boot_infos_t* bi		= PTRRELOC(RELOC(disp_bi));
-	unsigned long *src		= (unsigned long *)calc_base(bi,0,16);
-	unsigned long *dst		= (unsigned long *)calc_base(bi,0,0);
-	unsigned long width		= ((bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) *
-						(bi->dispDeviceDepth >> 3)) >> 2;
-	int i,j;
-	
-#ifdef CONFIG_ADB_PMU
-	pmu_suspend();	/* PMU will not shut us down ! */
-#endif
-	for (i=0; i<(bi->dispDeviceRect[3] - bi->dispDeviceRect[1] - 16); i++)
-	{
-		unsigned long *src_ptr = src;
-		unsigned long *dst_ptr = dst;
-		for(j=width; j; --j)
-			*(dst_ptr++) = *(src_ptr++);
-		src += (bi->dispDeviceRowBytes >> 2);
-		dst += (bi->dispDeviceRowBytes >> 2);
-	}
-	for (i=0; i<16; i++)
-	{
-		unsigned long *dst_ptr = dst;
-		for(j=width; j; --j)
-			*(dst_ptr++) = 0;
-		dst += (bi->dispDeviceRowBytes >> 2);
-	}
-#ifdef CONFIG_ADB_PMU
-	pmu_resume();	/* PMU will not shut us down ! */
-#endif
-}
-#endif /* ndef NO_SCROLL */
-
-void __pmac
-prom_drawchar(char c)
-{
-	unsigned long offset = reloc_offset();
-	int cline = 0, x;
-
-	if (!RELOC(bootx_text_mapped))
-		return;
-
-	switch (c) {
-	case '\b':
-		if (RELOC(g_loc_X) > 0)
-			--RELOC(g_loc_X);
-		break;
-	case '\t':
-		RELOC(g_loc_X) = (RELOC(g_loc_X) & -8) + 8;
-		break;
-	case '\r':
-		RELOC(g_loc_X) = 0;
-		break;
-	case '\n':
-		RELOC(g_loc_X) = 0;
-		RELOC(g_loc_Y)++;
-		cline = 1;
-		break;
-	default:
-		draw_byte(c, RELOC(g_loc_X)++, RELOC(g_loc_Y));
-	}
-	if (RELOC(g_loc_X) >= RELOC(g_max_loc_X)) {
-		RELOC(g_loc_X) = 0;
-		RELOC(g_loc_Y)++;
-		cline = 1;
-	}
-#ifndef NO_SCROLL
-	while (RELOC(g_loc_Y) >= RELOC(g_max_loc_Y)) {
-		scrollscreen();
-		RELOC(g_loc_Y)--;
-	}
-#else
-	/* wrap around from bottom to top of screen so we don't
-	   waste time scrolling each line.  -- paulus. */
-	if (RELOC(g_loc_Y) >= RELOC(g_max_loc_Y))
-		RELOC(g_loc_Y) = 0;
-	if (cline) {
-		for (x = 0; x < RELOC(g_max_loc_X); ++x)
-			draw_byte(' ', x, RELOC(g_loc_Y));
-	}
-#endif
-}
-
-void __pmac
-prom_drawstring(const char *c)
-{
-	unsigned long offset	= reloc_offset();
-
-	if (!RELOC(bootx_text_mapped))
-		return;
-	while (*c)
-		prom_drawchar(*c++);
-}
-
-void __pmac
-prom_drawhex(unsigned long v)
-{
-	static char hex_table[] = "0123456789abcdef";
-	unsigned long offset	= reloc_offset();
-	
-	if (!RELOC(bootx_text_mapped))
-		return;
-	prom_drawchar(RELOC(hex_table)[(v >> 28) & 0x0000000FUL]);
-	prom_drawchar(RELOC(hex_table)[(v >> 24) & 0x0000000FUL]);
-	prom_drawchar(RELOC(hex_table)[(v >> 20) & 0x0000000FUL]);
-	prom_drawchar(RELOC(hex_table)[(v >> 16) & 0x0000000FUL]);
-	prom_drawchar(RELOC(hex_table)[(v >> 12) & 0x0000000FUL]);
-	prom_drawchar(RELOC(hex_table)[(v >>  8) & 0x0000000FUL]);
-	prom_drawchar(RELOC(hex_table)[(v >>  4) & 0x0000000FUL]);
-	prom_drawchar(RELOC(hex_table)[(v >>  0) & 0x0000000FUL]);
-}
-
-static void __pmac
-draw_byte(unsigned char c, long locX, long locY)
-{
-	unsigned long offset	= reloc_offset();
-	boot_infos_t* bi	= PTRRELOC(RELOC(disp_bi));
-	unsigned char *base	= calc_base(bi, locX << 3, locY << 4);
-	unsigned char *font	= &RELOC(vga_font)[((unsigned long)c) * 16];
-	int rb			= bi->dispDeviceRowBytes;
-	
-	switch(bi->dispDeviceDepth) {
-		case 32:
-			draw_byte_32(font, (unsigned long *)base, rb);
-			break;
-		case 16:
-			draw_byte_16(font, (unsigned long *)base, rb);
-			break;
-		case 8:
-			draw_byte_8(font, (unsigned long *)base, rb);
-			break;
-		default:
-			break;
-	}
-}
-
-static unsigned long expand_bits_8[16] __pmacdata  = {
-	0x00000000,
-	0x000000ff,
-	0x0000ff00,
-	0x0000ffff,
-	0x00ff0000,
-	0x00ff00ff,
-	0x00ffff00,
-	0x00ffffff,
-	0xff000000,
-	0xff0000ff,
-	0xff00ff00,
-	0xff00ffff,
-	0xffff0000,
-	0xffff00ff,
-	0xffffff00,
-	0xffffffff
-};
-
-static unsigned long expand_bits_16[4] __pmacdata = {
-	0x00000000,
-	0x0000ffff,
-	0xffff0000,
-	0xffffffff
-};
-
-static void __pmac
-draw_byte_32(unsigned char *font, unsigned long *base, int rb)
-{
-	int l, bits;	
-	int fg = 0xFFFFFFFFUL;
-	int bg = 0x00000000UL;
-	
-	for (l = 0; l < 16; ++l)
-	{
-		bits = *font++;
-		base[0] = (-(bits >> 7) & fg) ^ bg;
-		base[1] = (-((bits >> 6) & 1) & fg) ^ bg;
-		base[2] = (-((bits >> 5) & 1) & fg) ^ bg;
-		base[3] = (-((bits >> 4) & 1) & fg) ^ bg;
-		base[4] = (-((bits >> 3) & 1) & fg) ^ bg;
-		base[5] = (-((bits >> 2) & 1) & fg) ^ bg;
-		base[6] = (-((bits >> 1) & 1) & fg) ^ bg;
-		base[7] = (-(bits & 1) & fg) ^ bg;
-		base = (unsigned long *) ((char *)base + rb);
-	}
-}
-
-static void __pmac
-draw_byte_16(unsigned char *font, unsigned long *base, int rb)
-{
-	int l, bits;	
-	int fg = 0xFFFFFFFFUL;
-	int bg = 0x00000000UL;
-	unsigned long offset = reloc_offset();
-	unsigned long *eb = RELOC(expand_bits_16);
-
-	for (l = 0; l < 16; ++l)
-	{
-		bits = *font++;
-		base[0] = (eb[bits >> 6] & fg) ^ bg;
-		base[1] = (eb[(bits >> 4) & 3] & fg) ^ bg;
-		base[2] = (eb[(bits >> 2) & 3] & fg) ^ bg;
-		base[3] = (eb[bits & 3] & fg) ^ bg;
-		base = (unsigned long *) ((char *)base + rb);
-	}
-}
-
-static void __pmac
-draw_byte_8(unsigned char *font, unsigned long *base, int rb)
-{
-	int l, bits;	
-	int fg = 0x0F0F0F0FUL;
-	int bg = 0x00000000UL;
-	unsigned long offset = reloc_offset();
-	unsigned long *eb = RELOC(expand_bits_8);
-
-	for (l = 0; l < 16; ++l)
-	{
-		bits = *font++;
-		base[0] = (eb[bits >> 4] & fg) ^ bg;
-		base[1] = (eb[bits & 0xf] & fg) ^ bg;
-		base = (unsigned long *) ((char *)base + rb);
-	}
-}
-
-static unsigned char vga_font[cmapsz] __pmacdata = {
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, 
-0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xff, 
-0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 
-0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 
-0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 
-0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 
-0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, 
-0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1e, 0x0e, 
-0x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30, 
-0x30, 0x70, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x63, 
-0x7f, 0x63, 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, 
-0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0e, 
-0x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 
-0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xdb, 
-0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6, 
-0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 
-0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
-0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 
-0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x24, 0x66, 0xff, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, 
-0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 
-0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 
-0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c, 
-0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, 
-0x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 
-0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 
-0x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 
-0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 
-0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xce, 0xde, 0xf6, 0xe6, 0xc6, 0xc6, 0x7c, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 
-0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe, 
-0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, 
-0xc0, 0xc0, 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18, 
-0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 
-0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 
-0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 
-0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 
-0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xde, 0xde, 
-0xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 
-0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 
-0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6c, 
-0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 
-0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 
-0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0c, 
-0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 
-0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xe7, 
-0xff, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 
-0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 
-0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c, 
-0x0c, 0x0e, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 
-0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 
-0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0xff, 0xdb, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 
-0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 
-0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x66, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18, 
-0x3c, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 
-0xc3, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc1, 0xc3, 0xff, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 
-0x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 
-0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c, 
-0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 
-0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 
-0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x60, 
-0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 
-0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 
-0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00, 0x00, 0x00, 0xe0, 0x60, 
-0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, 
-0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0xe0, 0x60, 
-0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff, 0xdb, 
-0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 
-0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 
-0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30, 
-0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3, 
-0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 
-0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 
-0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18, 
-0x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 
-0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 
-0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x0c, 0x06, 0x7c, 0x00, 0x00, 
-0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe, 
-0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 
-0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0xcc, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c, 
-0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 
-0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c, 0x0c, 0x06, 
-0x3c, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, 
-0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 
-0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x38, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x66, 
-0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 
-0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 0x00, 
-0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 
-0x18, 0x30, 0x60, 0x00, 0xfe, 0x66, 0x60, 0x7c, 0x60, 0x60, 0x66, 0xfe, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b, 
-0x7e, 0xd8, 0xdc, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x6c, 
-0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 
-0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 
-0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x30, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0xcc, 0xcc, 0xcc, 
-0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 
-0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00, 
-0x00, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 
-0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 
-0xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff, 0x18, 
-0xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 
-0x7c, 0x62, 0x66, 0x6f, 0x66, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x0e, 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 
-0xd8, 0x70, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0c, 0x7c, 
-0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 
-0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x18, 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, 0xcc, 0xcc, 
-0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 
-0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 
-0x76, 0xdc, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, 
-0x38, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, 
-0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xce, 0x9b, 0x06, 
-0x0c, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 
-0x66, 0xce, 0x96, 0x3e, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 
-0x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36, 
-0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x44, 0x11, 0x44, 
-0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 
-0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 
-0x55, 0xaa, 0x55, 0xaa, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 
-0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0x18, 0x18, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, 
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 
-0x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36, 
-0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0xf8, 
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 
-0x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
-0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
-0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6, 
-0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
-0x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 
-0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
-0x36, 0x37, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 
-0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
-0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 
-0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 
-0x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
-0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0xff, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36, 
-0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 
-0x18, 0x1f, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 
-0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
-0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 
-0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 
-0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 
-0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 
-0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x76, 0xdc, 0xd8, 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xd8, 0xcc, 0xc6, 0xc6, 0xc6, 0xcc, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0, 
-0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xc6, 0xfe, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8, 
-0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66, 
-0x66, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 
-0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x6c, 0x6c, 0xee, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66, 
-0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x7e, 0xdb, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x03, 0x06, 0x7e, 0xdb, 0xdb, 0xf3, 0x7e, 0x60, 0xc0, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x30, 0x60, 0x60, 0x7c, 0x60, 
-0x60, 0x60, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 
-0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 
-0x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 
-0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x00, 0x7e, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x1b, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
-0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, 
-0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, 
-0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0c, 0x0c, 
-0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x6c, 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-0x00, 0x00, 0x00, 0x00, 
-};
-
-#endif /* CONFIG_BOOTX_TEXT */
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/ptrace.c linux/arch/ppc/kernel/ptrace.c
--- v2.4.9/linux/arch/ppc/kernel/ptrace.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/ppc/kernel/ptrace.c	Tue Sep 18 16:56:19 2001
@@ -89,6 +89,17 @@
 		regs->msr &= ~MSR_SE;
 }
 
+/*
+ * Called by kernel/ptrace.c when detaching..
+ *
+ * Make sure single step bits etc are not set.
+ */
+void ptrace_disable(struct task_struct *child)
+{
+	/* make sure the single step bit is not set. */
+	clear_single_step(child);
+}
+
 int sys_ptrace(long request, long pid, long addr, long data)
 {
 	struct task_struct *child;
@@ -249,23 +260,9 @@
 		break;
 	}
 
-	case PTRACE_DETACH: { /* detach a process that was attached. */
-		ret = -EIO;
-		if ((unsigned long) data > _NSIG)
-			break;
-		child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
-		child->exit_code = data;
-		write_lock_irq(&tasklist_lock);
-		REMOVE_LINKS(child);
-		child->p_pptr = child->p_opptr;
-		SET_LINKS(child);
-		write_unlock_irq(&tasklist_lock);
-		/* make sure the single step bit is not set. */
-		clear_single_step(child);
-		wake_up_process(child);
-		ret = 0;
+	case PTRACE_DETACH:
+		ret = ptrace_detach(child, data);
 		break;
-	}
 
 	default:
 		ret = -EIO;
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/residual.c linux/arch/ppc/kernel/residual.c
--- v2.4.9/linux/arch/ppc/kernel/residual.c	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/residual.c	Sat Sep  8 12:38:42 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.residual.c 1.7 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.residual.c 1.11 09/08/01 15:47:42 paulus
  */
 /*
  * Code to deal with the PReP residual data.
@@ -44,7 +44,7 @@
 #include <linux/pci.h>
 #include <linux/ide.h>
 
-#include <asm/init.h>
+#include <asm/sections.h>
 #include <asm/mmu.h>
 #include <asm/processor.h>
 #include <asm/io.h>
@@ -55,7 +55,7 @@
 unsigned char __res[sizeof(RESIDUAL)] __prepdata = {0,};
 RESIDUAL *res = (RESIDUAL *)&__res;
 
-const char * PnP_BASE_TYPES[] __initdata = {
+char * PnP_BASE_TYPES[] __initdata = {
   "Reserved",
   "MassStorageDevice",
   "NetworkInterfaceController",
@@ -71,7 +71,7 @@
 
 /* Device Sub Type Codes */
 
-const unsigned char * PnP_SUB_TYPES[] __initdata = {
+unsigned char * PnP_SUB_TYPES[] __initdata = {
   "\001\000SCSIController",
   "\001\001IDEController",
   "\001\002FloppyController",
@@ -128,7 +128,7 @@
 
 /* Device Interface Type Codes */
 
-const  unsigned char * PnP_INTERFACES[] __initdata = {
+unsigned char * PnP_INTERFACES[] __initdata = {
   "\000\000\000General",
   "\001\000\000GeneralSCSI",
   "\001\001\000GeneralIDE",
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/setup.c linux/arch/ppc/kernel/setup.c
--- v2.4.9/linux/arch/ppc/kernel/setup.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/kernel/setup.c	Sat Sep  8 12:38:42 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.setup.c 1.46 07/26/01 14:18:18 trini
+ * BK Id: SCCS/s.setup.c 1.57 09/08/01 15:47:42 paulus
  */
 /*
  * Common prep/pmac/chrp boot and setup code.
@@ -17,7 +17,6 @@
 #include <linux/tty.h>
 #include <linux/bootmem.h>
 
-#include <asm/init.h>
 #include <asm/residual.h>
 #include <asm/io.h>
 #include <asm/prom.h>
@@ -28,6 +27,7 @@
 #include <asm/amigappc.h>
 #include <asm/smp.h>
 #include <asm/elf.h>
+#include <asm/cputable.h>
 #ifdef CONFIG_8xx
 #include <asm/mpc8xx.h>
 #include <asm/8xx_immap.h>
@@ -40,55 +40,18 @@
 #include <asm/ppc4xx.h>
 #endif
 #include <asm/bootx.h>
+#include <asm/btext.h>
 #include <asm/machdep.h>
 #include <asm/feature.h>
 #include <asm/uaccess.h>
+#include <asm/system.h>
 
-
-extern void apus_init(unsigned long r3,
-                      unsigned long r4,
-                      unsigned long r5,
-                      unsigned long r6,
-                      unsigned long r7);
-
-extern void chrp_init(unsigned long r3,
-                      unsigned long r4,
-                      unsigned long r5,
-                      unsigned long r6,
-                      unsigned long r7);
-
-extern void gemini_init(unsigned long r3,
-                      unsigned long r4,
-                      unsigned long r5,
-                      unsigned long r6,
-                      unsigned long r7);
-
-extern void m8xx_init(unsigned long r3,
-		     unsigned long r4,
-		     unsigned long r5,
-		     unsigned long r6,
-		     unsigned long r7);
-
-extern void m8260_init(unsigned long r3,
-		     unsigned long r4,
-		     unsigned long r5,
-		     unsigned long r6,
-		     unsigned long r7);
-
-extern void pmac_init(unsigned long r3,
-                      unsigned long r4,
-                      unsigned long r5,
-                      unsigned long r6,
-                      unsigned long r7);
-
-extern void prep_init(unsigned long r3,
-                      unsigned long r4,
-                      unsigned long r5,
-                      unsigned long r6,
-                      unsigned long r7);
-
+extern void platform_init(unsigned long r3, unsigned long r4,
+		unsigned long r5, unsigned long r6, unsigned long r7);
 extern void bootx_init(unsigned long r4, unsigned long phys);
 extern unsigned long reloc_offset(void);
+extern void identify_cpu(unsigned long offset, unsigned long cpu);
+extern void do_cpu_ftr_fixups(unsigned long offset);
 
 #ifdef CONFIG_XMON
 extern void xmon_map_scc(void);
@@ -98,6 +61,13 @@
 char saved_command_line[256];
 unsigned char aux_device_present;
 struct ide_machdep_calls ppc_ide_md;
+char *sysmap;
+unsigned long sysmap_size;
+
+/* Used with the BI_MEMSIZE bootinfo parameter to store the memory
+   size value reported by the boot loader. */ 
+unsigned int boot_mem_size;
+
 int parse_bootinfo(void);
 
 unsigned long ISA_DMA_THRESHOLD;
@@ -105,7 +75,13 @@
 
 #ifdef CONFIG_ALL_PPC
 int _machine = 0;
-int have_of = 0;
+
+extern void prep_init(unsigned long r3, unsigned long r4,
+		unsigned long r5, unsigned long r6, unsigned long r7);
+extern void pmac_init(unsigned long r3, unsigned long r4,
+		unsigned long r5, unsigned long r6, unsigned long r7);
+extern void chrp_init(unsigned long r3, unsigned long r4,
+		unsigned long r5, unsigned long r6, unsigned long r7);
 #endif /* CONFIG_ALL_PPC */
 
 #ifdef CONFIG_MAGIC_SYSRQ
@@ -126,15 +102,7 @@
 int icache_bsize;
 int ucache_bsize;
 
-/*
- * Perhaps we can put the pmac screen_info[] here
- * on pmac as well so we don't need the ifdef's.
- * Until we get multiple-console support in here
- * that is.  -- Cort
- * Maybe tie it to serial consoles, since this is really what
- * these processors use on existing boards.  -- Dan
- */ 
-#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx) && !defined(CONFIG_8260)
+#ifdef CONFIG_VGA_CONSOLE
 struct screen_info screen_info = {
 	0, 25,			/* orig-x, orig-y */
 	0,			/* unused */
@@ -146,35 +114,7 @@
 	1,			/* orig-video-isVGA */
 	16			/* orig-video-points */
 };
-
-/*
- * I really need to add multiple-console support... -- Cort
- */
-int __init pmac_display_supported(char *name)
-{
-	return 0;
-}
-void __init pmac_find_display(void)
-{
-}
-
-#else /* CONFIG_4xx || CONFIG_8xx */
-
-/* We need this to satisfy some external references until we can
- * strip the kernel down.
- */
-struct screen_info screen_info = {
-	0, 25,			/* orig-x, orig-y */
-	0,			/* unused */
-	0,			/* orig-video-page */
-	0,			/* orig-video-mode */
-	80,			/* orig-video-cols */
-	0,0,0,			/* ega_ax, ega_bx, ega_cx */
-	25,			/* orig-video-lines */
-	0,			/* orig-video-isVGA */
-	16			/* orig-video-points */
-};
-#endif /* !CONFIG_4xx && !CONFIG_8xx */
+#endif /* CONFIG_VGA_CONSOLE */
 
 void machine_restart(char *cmd)
 {
@@ -190,35 +130,11 @@
 {
 	ppc_md.halt();
 }
-  
-unsigned long cpu_temp(void)
-{
-	unsigned char thres = 0;
-	
-#if 0
-	/* disable thrm2 */
-	_set_THRM2( 0 );
-	/* threshold 0 C, tid: exceeding threshold, tie: don't generate interrupt */
-	_set_THRM1( THRM1_V );
-
-	/* we need 20us to do the compare - assume 300MHz processor clock */
-	_set_THRM3(0);
-	_set_THRM3(THRM3_E | (300*30)<<18 );
-
-	udelay(100);
-	/* wait for the compare to complete */
-	/*while ( !(_get_THRM1() & THRM1_TIV) ) ;*/
-	if ( !(_get_THRM1() & THRM1_TIV) )
-		printk("no tiv\n");
-	if ( _get_THRM1() & THRM1_TIN )
-		printk("crossed\n");
-	/* turn everything off */
-	_set_THRM3(0);
-	_set_THRM1(0);
-#endif
-		
-	return thres;
-}
+
+#ifdef CONFIG_TAU
+extern u32 cpu_temp(unsigned long cpu);
+extern u32 cpu_temp_both(unsigned long cpu);
+#endif /* CONFIG_TAU */
 
 int get_cpuinfo(char *buffer)
 {
@@ -227,7 +143,7 @@
 	unsigned long i;
 	unsigned int pvr;
 	unsigned short maj, min;
-	
+
 #ifdef CONFIG_SMP
 #define CPU_PRESENT(x) (cpu_callin_map[(x)])
 #define GET_PVR ((long int)(cpu_data[i].pvr))
@@ -235,7 +151,7 @@
 #else
 #define CPU_PRESENT(x) ((x)==0)
 #define smp_num_cpus 1
-#define GET_PVR ((long int)_get_PVR())
+#define GET_PVR (mfspr(PVR))
 #define CD(x) (x)
 #endif	
 
@@ -249,90 +165,31 @@
 		len += sprintf(len+buffer,"cpu\t\t: ");
 
 		pvr = GET_PVR;
-	
-		switch (PVR_VER(pvr))
-		{
-		case 0x0001:
-			len += sprintf(len+buffer, "601\n");
-			break;
-		case 0x0003:
-			len += sprintf(len+buffer, "603\n");
-			break;
-		case 0x0004:
-			len += sprintf(len+buffer, "604\n");
-			break;
-		case 0x0006:
-			len += sprintf(len+buffer, "603e\n");
-			break;
-		case 0x0007:
-			len += sprintf(len+buffer, "603");
-			if (((pvr >> 12) & 0xF) == 1) {
-				pvr ^= 0x00001000;	/* revision fix-up */
-				len += sprintf(len+buffer, "r\n");
-			} else {
-				len += sprintf(len+buffer, "ev\n");
-			}
-			break;
-		case 0x0008:		/* 740/750(P) */
-		case 0x1008:
-			len += sprintf(len+buffer, "750%s\n",
-				       PVR_VER(pvr) == 0x1008 ? "P" : "");
-			len += sprintf(len+buffer, "temperature \t: %lu C\n",
-				       cpu_temp());
-			break;
-		case 0x0009:		/* 604e/604r */
-		case 0x000A:
-			len += sprintf(len+buffer, "604");
-
-			if (PVR_VER(pvr) == 0x000A ||
-			    ((pvr >> 12) & 0xF) != 0) {
-				pvr &= ~0x00003000;	/* revision fix-up */
-				len += sprintf(len+buffer, "r\n");
-			} else {
-				len += sprintf(len+buffer, "e\n");
-			}
-			break;
-		case 0x000C:
-			len += sprintf(len+buffer, "7400 (G4");
+
+		if (cur_cpu_spec[i]->pvr_mask)
+			len += sprintf(len+buffer, "%s", cur_cpu_spec[i]->cpu_name);
+		else
+			len += sprintf(len+buffer, "unknown (%08x)", pvr);
 #ifdef CONFIG_ALTIVEC
+		if (cur_cpu_spec[i]->cpu_features & CPU_FTR_ALTIVEC)
 			len += sprintf(len+buffer, ", altivec supported");
-#endif /* CONFIG_ALTIVEC */
-			len += sprintf(len+buffer, ")\n");
-			break;
-		case 0x0020:
-			len += sprintf(len+buffer, "403G");
-			switch ((pvr >> 8) & 0xFF) {
-			case 0x02:
-				len += sprintf(len+buffer, "C\n");    
-				break;				      
-			case 0x14:
-				len += sprintf(len+buffer, "CX\n");
-				break;
-			}
-			break;
-		case 0x0035:
-			len += sprintf(len+buffer, "POWER4\n");
-			break;
-		case 0x0040:
-			len += sprintf(len+buffer, "POWER3 (630)\n");
-			break;
-		case 0x0041:
-			len += sprintf(len+buffer, "POWER3 (630+)\n");
-			break;
-		case 0x0050:
-			len += sprintf(len+buffer, "8xx\n");
-			break;
-		case 0x0081:
-			len += sprintf(len+buffer, "82xx\n");
-			break;
-		case 0x4011:
-			len += sprintf(len+buffer, "405GP\n");
-			break;
-		default:
-			len += sprintf(len+buffer, "unknown (%08x)\n", pvr);
-			break;
+#endif		
+		len += sprintf(len+buffer, "\n");
+#ifdef CONFIG_TAU
+		if (cur_cpu_spec[i]->cpu_features & CPU_FTR_TAU) {
+#ifdef CONFIG_TAU_AVERAGE	/* more straightforward, but potentially misleading */
+			len += sprintf(len+buffer, "temperature \t: %u C (uncalibrated)\n",
+				       cpu_temp(i));
+#else
+			/* show the actual temp sensor range */
+			u32 temp;
+			temp = cpu_temp_both(i);
+			len += sprintf(len+buffer, "temperature \t: %u-%u C (uncalibrated)\n",
+					temp & 0xff, temp >> 16);
+#endif
 		}
-		
+#endif
+
 		/*
 		 * Assume here that all clock rates are the same in a
 		 * smp system.  -- Cort
@@ -394,7 +251,7 @@
 	}
 
 #ifdef CONFIG_SMP
-	if ( i )
+	if ( i && smp_num_cpus > 1)
 		len += sprintf(buffer+len, "\n");
 	len += sprintf(buffer+len,"total bogomips\t: %lu.%02lu\n",
 		       bogosum/(500000/HZ),
@@ -423,31 +280,6 @@
 	return len;
 }
 
-#ifdef CONFIG_ALL_PPC
-void __init
-intuit_machine_type(void)
-{
-	char *model;
-	struct device_node *root;
-			
-	/* ask the OF info if we're a chrp or pmac */
-	root = find_path_device("/");
-	if (root != 0) {
-		/* assume pmac unless proven to be chrp -- Cort */
-		_machine = _MACH_Pmac;
-		model = get_property(root, "device_type", NULL);
-		if (model && !strncmp("chrp", model, 4))
-			_machine = _MACH_chrp;
-		else {
-			model = get_property(root, "model", NULL);
-			if (model && !strncmp(model, "IBM", 3))
-				_machine = _MACH_chrp;
-		}
-	}
-}
-#endif /* CONFIG_ALL_PPC */
-
-#if defined(CONFIG_6xx) || defined(CONFIG_PPC64BRIDGE)
 /*
  * We're called here very early in the boot.  We determine the machine
  * type and call the appropriate low-level setup functions.
@@ -472,6 +304,13 @@
 	 * caches on yet */
 	memset_io(PTRRELOC(&__bss_start), 0, &_end - &__bss_start);
 
+	/*
+	 * Identify the CPU type and fix up code sections
+	 * that depend on which cpu we have.
+	 */
+	identify_cpu(offset, 0);
+	do_cpu_ftr_fixups(offset);
+
 #if defined(CONFIG_ALL_PPC)
 	/* If we came here from BootX, clear the screen,
 	 * set up some pointers and return. */
@@ -493,78 +332,105 @@
 
 	return phys;
 }
-#endif /* CONFIG_6xx || CONFIG_PPC64BRIDGE */
+
+#ifdef CONFIG_ALL_PPC
+void __init
+intuit_machine_type(void)
+{
+	char *model;
+	struct device_node *root;
+			
+	/* ask the OF info if we're a chrp or pmac */
+	root = find_path_device("/");
+	if (root != 0) {
+		/* assume pmac unless proven to be chrp -- Cort */
+		_machine = _MACH_Pmac;
+		model = get_property(root, "device_type", NULL);
+		if (model && !strncmp("chrp", model, 4))
+			_machine = _MACH_chrp;
+		else {
+			model = get_property(root, "model", NULL);
+			if (model && !strncmp(model, "IBM", 3))
+				_machine = _MACH_chrp;
+		}
+	}
+}
 
 /*
- * Find out what kind of machine we're on and save any data we need
- * from the early boot process (devtree is copied on pmac by prom_init() )
+ * The ALL_PPC version of platform_init...
  */
-unsigned long __init
-identify_machine(unsigned long r3, unsigned long r4, unsigned long r5,
-		 unsigned long r6, unsigned long r7)
+void __init
+platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+	      unsigned long r6, unsigned long r7)
 {
-#ifdef CONFIG_CMDLINE
-	strcpy(cmd_line, CONFIG_CMDLINE);
-#endif /* CONFIG_CMDLINE */
+#ifdef CONFIG_BOOTX_TEXT
+	extern boot_infos_t *disp_bi;
 
-	parse_bootinfo();
+	if (disp_bi) {
+		btext_clearscreen();
+		btext_welcome(disp_bi);
+	}
+#endif	
 
-	if ( ppc_md.progress ) ppc_md.progress("id mach(): start", 0x100);
-	
-#ifdef CONFIG_ALL_PPC
 	/* if we didn't get any bootinfo telling us what we are... */
-	if ( _machine == 0 )
-	{
+	if (_machine == 0) {
 		/* prep boot loader tells us if we're prep or not */
 		if ( *(unsigned long *)(KERNELBASE) == (0xdeadc0de) )
-		{
 			_machine = _MACH_prep;
-		} else
-			have_of = 1;
 	}
 
-	if ( have_of )
-	{
-		/* prom_init has already been called from __start */
-		if (boot_infos)
-			relocate_nodes();
-		/* we need to set _machine before calling finish_device_tree */
-		if (_machine == 0)
-			intuit_machine_type();
-		finish_device_tree();
-		/*
-		 * If we were booted via quik, r3 points to the physical
-		 * address of the command-line parameters.
-		 * If we were booted from an xcoff image (i.e. netbooted or
-		 * booted from floppy), we get the command line from the
-		 * bootargs property of the /chosen node.
-		 * If an initial ramdisk is present, r3 and r4
-		 * are used for initrd_start and initrd_size,
-		 * otherwise they contain 0xdeadbeef.  
-		 */
-		if (r3 >= 0x4000 && r3 < 0x800000 && r4 == 0) {
-			strncpy(cmd_line, (char *)r3 + KERNELBASE,
+	/* not much more to do here, if prep */
+	if (_machine == _MACH_prep) {
+		prep_init(r3, r4, r5, r6, r7);
+		return;
+	}
+
+	/* prom_init has already been called from __start */
+	if (boot_infos)
+		relocate_nodes();
+
+	/* If we aren't PReP, we can find out if we're Pmac
+	 * or CHRP with this. */
+	if (_machine == 0)
+		intuit_machine_type();
+
+	/* finish_device_tree may need _machine defined. */
+	finish_device_tree();
+
+	/*
+	 * If we were booted via quik, r3 points to the physical
+	 * address of the command-line parameters.
+	 * If we were booted from an xcoff image (i.e. netbooted or
+	 * booted from floppy), we get the command line from the
+	 * bootargs property of the /chosen node.
+	 * If an initial ramdisk is present, r3 and r4
+	 * are used for initrd_start and initrd_size,
+	 * otherwise they contain 0xdeadbeef.  
+	 */
+	if (r3 >= 0x4000 && r3 < 0x800000 && r4 == 0) {
+		cmd_line[0] = 0;
+		strncpy(cmd_line, (char *)r3 + KERNELBASE,
+			sizeof(cmd_line));
+	} else if (boot_infos != 0) {
+		/* booted by BootX - check for ramdisk */
+		if (boot_infos->kernelParamsOffset != 0)
+			strncpy(cmd_line, (char *) boot_infos
+				+ boot_infos->kernelParamsOffset,
 				sizeof(cmd_line));
-		} else if (boot_infos != 0) {
-			/* booted by BootX - check for ramdisk */
- 			if (boot_infos->kernelParamsOffset != 0)
-				strncpy(cmd_line, (char *) boot_infos
-					+ boot_infos->kernelParamsOffset,
-					sizeof(cmd_line));
 #ifdef CONFIG_BLK_DEV_INITRD
-			if (boot_infos->ramDisk) {
-				initrd_start = (unsigned long) boot_infos
-					+ boot_infos->ramDisk;
-				initrd_end = initrd_start + boot_infos->ramDiskSize;
-				initrd_below_start_ok = 1;
-			}
+		if (boot_infos->ramDisk) {
+			initrd_start = (unsigned long) boot_infos
+				+ boot_infos->ramDisk;
+			initrd_end = initrd_start + boot_infos->ramDiskSize;
+			initrd_below_start_ok = 1;
+		}
 #endif
-		} else {
-			struct device_node *chosen;
-			char *p;
+	} else {
+		struct device_node *chosen;
+		char *p;
 			
 #ifdef CONFIG_BLK_DEV_INITRD
-			if (r3 && r4 && r4 != 0xdeadbeef)
+		if (r3 && r4 && r4 != 0xdeadbeef)
 			{
 				if (r3 < KERNELBASE)
 					r3 += KERNELBASE;
@@ -574,92 +440,32 @@
 				initrd_below_start_ok = 1;
 			}
 #endif
-			chosen = find_devices("chosen");
-			if (chosen != NULL) {
-				p = get_property(chosen, "bootargs", NULL);
-				if (p && *p) {
-					cmd_line[0] = 0;
-					strncpy(cmd_line, p, sizeof(cmd_line));
-				}
+		chosen = find_devices("chosen");
+		if (chosen != NULL) {
+			p = get_property(chosen, "bootargs", NULL);
+			if (p && *p) {
+				cmd_line[0] = 0;
+				strncpy(cmd_line, p, sizeof(cmd_line));
 			}
 		}
-		cmd_line[sizeof(cmd_line) - 1] = 0;
 	}
-#endif /* CONFIG_ALL_PPC */
+	cmd_line[sizeof(cmd_line) - 1] = 0;
 
-#if defined(CONFIG_ALL_PPC)
-	switch (_machine)
-	{
+	switch (_machine) {
 	case _MACH_Pmac:
-                pmac_init(r3, r4, r5, r6, r7);
-		break;
-	case _MACH_prep:
-                prep_init(r3, r4, r5, r6, r7);
+		pmac_init(r3, r4, r5, r6, r7);
 		break;
 	case _MACH_chrp:
-                chrp_init(r3, r4, r5, r6, r7);
+		chrp_init(r3, r4, r5, r6, r7);
 		break;
-	default:
-		printk("Unknown machine type in identify_machine!\n");
-	}
-#elif defined(CONFIG_APUS)
-	apus_init(r3, r4, r5, r6, r7);
-#elif defined(CONFIG_GEMINI)
-	gemini_init(r3, r4, r5, r6, r7);
-#elif defined(CONFIG_4xx)
-	oak_init(r3, r4, r5, r6, r7);
-#elif defined(CONFIG_8xx)
-        m8xx_init(r3, r4, r5, r6, r7);
-#elif defined(CONFIG_8260)
-        m8260_init(r3, r4, r5, r6, r7);
-#else
-#error "No board type has been defined for identify_machine()!"
-#endif
-
-#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx) && !defined(CONFIG_8260)
-	/* Check for nobats option (used in mapin_ram). */
-	if (strstr(cmd_line, "nobats")) {
-		extern int __map_without_bats;
-		__map_without_bats = 1;
-	}
-#endif /* !CONFIG_4xx && !CONFIG_8xx && !CONFIG_8260 */
-
-	/* Look for mem= option on command line */
-	if (strstr(cmd_line, "mem=")) {
-		char *p, *q;
-		unsigned long maxmem = 0;
-		extern unsigned long __max_memory;
-
-		for (q = cmd_line; (p = strstr(q, "mem=")) != 0; ) {
-			q = p + 4;
-			if (p > cmd_line && p[-1] != ' ')
-				continue;
-			maxmem = simple_strtoul(q, &q, 0);
-			if (*q == 'k' || *q == 'K') {
-				maxmem <<= 10;
-				++q;
-			} else if (*q == 'm' || *q == 'M') {
-				maxmem <<= 20;
-				++q;
-			}
-		}
-		__max_memory = maxmem;
 	}
-
-	/* this is for modules since _machine can be a define -- Cort */
-	ppc_md.ppc_machine = _machine;
-
-	if ( ppc_md.progress ) ppc_md.progress("id mach(): done", 0x200);
-
-	return 0;
 }
+#endif /* CONFIG_ALL_PPC */
 
 int parse_bootinfo(void)
 {
 	struct bi_record *rec;
 	extern char __bss_start[];
-	extern char *sysmap;
-	extern unsigned long sysmap_size;
 
 	rec = (struct bi_record *)_ALIGN((ulong)__bss_start+(1<<20)-1,(1<<20));
 	if ( rec->tag != BI_FIRST )
@@ -696,20 +502,43 @@
 #ifdef CONFIG_ALL_PPC
 		case BI_MACHTYPE:
 			_machine = data[0];
-			have_of = data[1];
 			break;
 #endif /* CONFIG_ALL_PPC */
+		case BI_MEMSIZE:
+			boot_mem_size = data[0];
+			break;
 		}
 	}
 
 	return 0;
 }
 
+/*
+ * Find out what kind of machine we're on and save any data we need
+ * from the early boot process (devtree is copied on pmac by prom_init()).
+ * This is called very early on the boot process, after a minimal
+ * MMU environment has been set up but before MMU_init is called.
+ */
+void __init
+machine_init(unsigned long r3, unsigned long r4, unsigned long r5,
+	     unsigned long r6, unsigned long r7)
+{
+#ifdef CONFIG_CMDLINE
+	strcpy(cmd_line, CONFIG_CMDLINE);
+#endif /* CONFIG_CMDLINE */
+
+	parse_bootinfo();
+
+	platform_init(r3, r4, r5, r6, r7);
+
+	if (ppc_md.progress)
+		ppc_md.progress("id mach(): done", 0x200);
+}
+
 /* Checks "l2cr=xxxx" command-line option */
-int ppc_setup_l2cr(char *str)
+int __init ppc_setup_l2cr(char *str)
 {
-	if ( ((_get_PVR() >> 16) == 8) || ((_get_PVR() >> 16) == 12) )
-	{
+	if (cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR) {
 		unsigned long val = simple_strtoul(str, NULL, 0);
 		printk(KERN_INFO "l2cr set to %lx\n", val);
                 _set_L2CR(0);           /* force invalidate by disable cache */
@@ -761,18 +590,13 @@
 	 * Systems with OF can look in the properties on the cpu node(s)
 	 * for a possibly more accurate value.
 	 */
-	dcache_bsize = icache_bsize = 32;	/* most common value */
-	switch (_get_PVR() >> 16) {
-	case 1:		/* 601, with unified cache */
-		ucache_bsize = 32;
-		break;
-	/* XXX need definitions in here for 8xx etc. */
-	case 0x40:
-	case 0x41:
-	case 0x35:	/* 64-bit POWER3, POWER3+, POWER4 */
-		dcache_bsize = icache_bsize = 128;
-		break;
-	}
+	if (cur_cpu_spec[0]->cpu_features & CPU_FTR_SPLIT_ID_CACHE) {
+		dcache_bsize = cur_cpu_spec[0]->dcache_bsize;
+		icache_bsize = cur_cpu_spec[0]->icache_bsize;
+		ucache_bsize = 0;
+	} else
+		ucache_bsize = dcache_bsize = icache_bsize
+			= cur_cpu_spec[0]->dcache_bsize;
 
 	/* reboot on panic */
 	panic_timeout = 180;
@@ -813,6 +637,9 @@
 
 	paging_init();
 	sort_exception_table();
+
+	/* this is for modules since _machine can be a define -- Cort */
+	ppc_md.ppc_machine = _machine;
 }
 
 /* Convert the shorts/longs in hd_driveid from little to big endian;
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/sleep.S linux/arch/ppc/kernel/sleep.S
--- v2.4.9/linux/arch/ppc/kernel/sleep.S	Tue Jul  3 17:08:18 2001
+++ linux/arch/ppc/kernel/sleep.S	Tue Aug 28 06:58:33 2001
@@ -1,10 +1,10 @@
 /*
- * BK Id: SCCS/s.sleep.S 1.10 06/28/01 15:50:17 paulus
+ * BK Id: SCCS/s.sleep.S 1.13 08/19/01 22:23:04 paulus
  */
 /*
  * This file contains sleep low-level functions for PowerBook G3.
  *    Copyright (C) 1999 Benjamin Herrenschmidt (benh@kernel.crashing.org)
- *    and Paul Mackerras (paulus@cs.anu.edu.au).
+ *    and Paul Mackerras (paulus@samba.org).
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -45,7 +45,13 @@
 #define tovirt(rd,rs)	addis	rd,rs,KERNELBASE@h
 
 	.text
+	.align	5
 
+/* This gets called by via-pmu.c late during the sleep process.
+ * The PMU was already send the sleep command and will shut us down
+ * soon. We need to save all that is needed and setup the wakeup
+ * vector that will be called by the ROM on wakeup
+ */
 _GLOBAL(low_sleep_handler)
 	mflr	r0
 	stw	r0,4(r1)
@@ -53,13 +59,14 @@
 	stw	r2,SL_R2(r1)
 	stmw	r12,SL_R12(r1)
 
-	/* Save MSR, SDR1, TB  */
+	/* Save MSR & SDR1 */
 	mfmsr	r4
 	stw	r4,SL_MSR(r1)
 	mfsdr1	r4
 	stw	r4,SL_SDR1(r1)
-1:	
-	mftbu	r4
+
+	/* Get a stable timebase and save it */
+1:	mftbu	r4
 	stw	r4,SL_TB(r1)
 	mftb	r5
 	stw	r5,SL_TB+4(r1)
@@ -114,10 +121,19 @@
 	/* Save HID0 */
 	mfspr	r4,HID0
 	stw	r4,SL_HID0(r1)
-
-	/* Set up stuff at address 0 */
-	lis	r5,wake_up@ha
-	addi	r5,r5,wake_up@l
+	
+	/* The ROM can wake us up via 2 different vectors:
+	 *  - On wallstreet & lombard, we must write a magic
+	 *    value 'Lars' at address 4 and a pointer to a
+	 *    memory location containing the PC to resume from
+	 *    at address 0.
+	 *  - On Core99, we must store the wakeup vector at
+	 *    address 0x80 and eventually it's parameters
+	 *    at address 0x84. I've have some trouble with those
+	 *    parameters however and I no longer use them.
+	 */
+	lis	r5,grackle_wake_up@ha
+	addi	r5,r5,grackle_wake_up@l
 	tophys(r5,r5)
 	stw	r5,SL_PC(r1)
 	lis	r4,KERNELBASE@h
@@ -127,22 +143,35 @@
 	addi	r6,r6,MAGIC@l
 	stw	r5,0(r4)
 	stw	r6,4(r4)
+	/* Setup stuffs at 0x80-0x84 for Core99 */
+	lis	r3,core99_wake_up@ha
+	addi	r3,r3,core99_wake_up@l
+	tophys(r3,r3)
+	stw	r3,0x80(r4)
+	stw	r5,0x84(r4)
+	/* Store a pointer to our backup storage into
+	 * a kernel global
+	 */
+	lis r3,sleep_storage@ha
+	addi r3,r3,sleep_storage@l
+	stw r5,0(r3)
+
 
 /*
- * Flush the L1 data cache by reading the first 64kB of RAM
+ * Flush the L1 data cache by reading the first 128kB of RAM
  * and then flushing the same area with the dcbf instruction.
  * The L2 cache has already been disabled.
  */
-	li	r4,0x0800	/* 64kB / 32B */
+	li	r4,0x1000	/* 128kB / 32B */
 	mtctr	r4
 	lis	r4,KERNELBASE@h
 1:
 	lwz	r0,0(r4)
-	addi	r4,r4,0x0020		/* Go to start of next cache line */
+	addi	r4,r4,0x0020	/* Go to start of next cache line */
 	bdnz	1b
 	sync
 	
-	li	r4,0x0800	/* 64k */
+	li	r4,0x1000	/* 128kB / 32B */
 	mtctr	r4
 	lis	r4,KERNELBASE@h
 1:
@@ -160,7 +189,13 @@
 	sync
 	mtspr	HID0,r2
 	sync
-	
+
+/* This loop puts us back to sleep in case we have a spurrious
+ * wakeup so that the host bridge properly stays asleep. The
+ * CPU will be turned off, either after a known time (about 1
+ * second) on wallstreet & lombard, or as soon as the CPU enters
+ * SLEEP mode on core99
+ */
 	mfmsr	r2
 	oris	r2,r2,MSR_POW@h
 1:	sync
@@ -170,22 +205,66 @@
 
 /* 
  * Here is the resume code.
+ */
+
+
+/*
+ * Core99 machines resume here
+ * r4 has the physical address of SL_PC(sp) (unused)
+ */
+_GLOBAL(core99_wake_up)
+	/* Make sure HID0 no longer contains any sleep bit */
+	mfspr	r3,HID0
+	rlwinm	r3,r3,0,11,7		/* clear SLEEP, NAP, DOZE bits */
+	mtspr	HID0,r3
+	sync
+	isync
+
+	/* Won't that cause problems on CPU that doesn't support it ? */
+	lis	r3, 0
+	mtspr	SPRN_MMCR0, r3
+	
+	/* sanitize MSR */
+	mfmsr	r3
+	ori	r3,r3,MSR_EE|MSR_IP
+	xori	r3,r3,MSR_EE|MSR_IP
+	sync
+	isync
+	mtmsr	r3
+	sync
+	isync
+
+	/* Recover sleep storage */
+	lis	r3,sleep_storage@ha
+	addi	r3,r3,sleep_storage@l
+	tophys(r3,r3)
+	lwz	r1,0(r3)
+
+	/* Pass thru to older resume code ... */
+/* 
+ * Here is the resume code for older machines.
  * r1 has the physical address of SL_PC(sp).
  */
 	
-wake_up:
-	/* Flash inval the instruction cache */
+grackle_wake_up:
+	/* Enable and then Flash inval the instruction & data cache */
 	mfspr	r3,HID0
-	ori	r3,r3, HID0_ICFI
-	mtspr	HID0,r3
+	ori	r3,r3, HID0_ICE|HID0_ICFI|HID0_DCE|HID0_DCI
+	sync
 	isync
-	/* Restore the HID0 register.  This turns on the L1 caches. */
+	mtspr	HID0,r3
+	xori	r3,r3, HID0_ICFI|HID0_DCI
+	mtspr	HID0,r3
+	sync
+	
+	/* Restore the remaining bits of the HID0 register. */
 	subi	r1,r1,SL_PC
 	lwz	r3,SL_HID0(r1)
 	sync
 	isync
 	mtspr	HID0,r3
 	sync
+	isync
 
 	/* Restore the kernel's segment registers, the
 	   BATs, and SDR1.  Then we can turn on the MMU. */
@@ -242,6 +321,13 @@
 	lwz	r4,SL_IBAT3+4(r1)
 	mtibatl	3,r4
 
+	/* Flush all TLBs */
+	lis	r4,0x1000
+1:	addic.	r4,r4,-0x1000
+	tlbie	r4
+	blt	1b
+	sync
+
 	/* restore the MSR and turn on the MMU */
 	lwz	r3,SL_MSR(r1)
 	bl	turn_on_mmu	
@@ -250,6 +336,8 @@
 	tovirt(r1,r1)
 
 	/* Restore TB */
+	li	r3,0
+	mttbl	r3
 	lwz	r3,SL_TB(r1)
 	lwz	r4,SL_TB+4(r1)
 	mttbu	r3
@@ -269,4 +357,10 @@
 	mtsrr0	r4
 	mtsrr1	r3
 	sync
+	isync
 	rfi
+
+	.data
+	.globl sleep_storage
+sleep_storage:
+	.long 0
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/smp.c linux/arch/ppc/kernel/smp.c
--- v2.4.9/linux/arch/ppc/kernel/smp.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/ppc/kernel/smp.c	Sat Sep  8 12:38:42 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.smp.c 1.25 05/23/01 00:38:42 cort
+ * BK Id: SCCS/s.smp.c 1.31 09/08/01 15:47:42 paulus
  */
 /*
  * Smp support for ppc.
@@ -9,11 +9,6 @@
  *
  * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
  *
- * Support for PReP (Motorola MTX/MVME) and Macintosh G4 SMP 
- * by Troy Benjegerdes (hozer@drgw.net)
- *
- * Support for DayStar quad CPU cards
- * Copyright (C) XLR8, Inc. 1994-2000
  */
 
 #include <linux/config.h>
@@ -36,16 +31,15 @@
 #include <asm/pgtable.h>
 #include <asm/hardirq.h>
 #include <asm/softirq.h>
-#include <asm/init.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/smp.h>
 #include <asm/residual.h>
 #include <asm/feature.h>
 #include <asm/time.h>
-#include <asm/gemini.h>
 
 #include "open_pic.h"
+
 int smp_threads_ready;
 volatile int smp_commenced;
 int smp_num_cpus = 1;
@@ -54,13 +48,14 @@
 struct klock_info_struct klock_info = { KLOCK_CLEAR, 0 };
 atomic_t ipi_recv;
 atomic_t ipi_sent;
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned = SPIN_LOCK_UNLOCKED;
 unsigned int prof_multiplier[NR_CPUS];
 unsigned int prof_counter[NR_CPUS];
 cycles_t cacheflush_time;
 static int max_cpus __initdata = NR_CPUS;
 unsigned long cpu_online_map;
 int smp_hw_index[NR_CPUS];
+static struct smp_ops_t *smp_ops;
 
 /* all cpu mappings are 1-1 -- Cort */
 volatile unsigned long cpu_callin_map[NR_CPUS];
@@ -74,60 +69,6 @@
 void smp_call_function_interrupt(void);
 void smp_message_pass(int target, int msg, unsigned long data, int wait);
 
-extern void __secondary_start_psurge(void);
-extern void __secondary_start_psurge2(void);	/* Temporary horrible hack */
-extern void __secondary_start_psurge3(void);	/* Temporary horrible hack */
-
-/* Addresses for powersurge registers */
-#define HAMMERHEAD_BASE		0xf8000000
-#define HHEAD_CONFIG		0x90
-#define HHEAD_SEC_INTR		0xc0
-
-/* register for interrupting the primary processor on the powersurge */
-/* N.B. this is actually the ethernet ROM! */
-#define PSURGE_PRI_INTR		0xf3019000
-
-/* register for storing the start address for the secondary processor */
-/* N.B. this is the PCI config space address register for the 1st bridge */
-#define PSURGE_START		0xf2800000
-
-/* Daystar/XLR8 4-CPU card */
-#define PSURGE_QUAD_REG_ADDR	0xf8800000
-
-#define PSURGE_QUAD_IRQ_SET	0
-#define PSURGE_QUAD_IRQ_CLR	1
-#define PSURGE_QUAD_IRQ_PRIMARY	2
-#define PSURGE_QUAD_CKSTOP_CTL	3
-#define PSURGE_QUAD_PRIMARY_ARB	4
-#define PSURGE_QUAD_BOARD_ID	6
-#define PSURGE_QUAD_WHICH_CPU	7
-#define PSURGE_QUAD_CKSTOP_RDBK	8
-#define PSURGE_QUAD_RESET_CTL	11
-
-#define PSURGE_QUAD_OUT(r, v)	(out_8(quad_base + ((r) << 4) + 4, (v)))
-#define PSURGE_QUAD_IN(r)	(in_8(quad_base + ((r) << 4) + 4) & 0x0f)
-#define PSURGE_QUAD_BIS(r, v)	(PSURGE_QUAD_OUT((r), PSURGE_QUAD_IN(r) | (v)))
-#define PSURGE_QUAD_BIC(r, v)	(PSURGE_QUAD_OUT((r), PSURGE_QUAD_IN(r) & ~(v)))
-
-/* virtual addresses for the above */
-static volatile u8 *hhead_base;
-static volatile u8 *quad_base;
-static volatile u32 *psurge_pri_intr;
-static volatile u8 *psurge_sec_intr;
-static volatile u32 *psurge_start;
-
-/* what sort of powersurge board we have */
-static int psurge_type;
-
-/* values for psurge_type */
-#define PSURGE_DUAL		0
-#define PSURGE_QUAD_OKEE	1
-#define PSURGE_QUAD_COTTON	2
-#define PSURGE_QUAD_ICEGRASS	3
-
-/* l2 cache stuff for dual G4 macs */
-extern void core99_init_l2(void);
-
 /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
  * 
  * Make sure this matches openpic_request_IPIs in open_pic.c, or what shows up
@@ -137,621 +78,12 @@
 #define PPC_MSG_INVALIDATE_TLB	2
 #define PPC_MSG_XMON_BREAK	3
 
-static inline void set_tb(unsigned int upper, unsigned int lower)
-{
-	mtspr(SPRN_TBWL, 0);
-	mtspr(SPRN_TBWU, upper);
-	mtspr(SPRN_TBWL, lower);
-}
-
-/*
- * Set and clear IPIs for powersurge.
- */
-static inline void psurge_set_ipi(int cpu)
-{
-	if (cpu == 0)
-		in_be32(psurge_pri_intr);
-	else if (psurge_type == PSURGE_DUAL)
-		out_8(psurge_sec_intr, 0);
-	else
-		PSURGE_QUAD_OUT(PSURGE_QUAD_IRQ_SET, 1 << cpu);
-}
-
-static inline void psurge_clr_ipi(int cpu)
-{
-	if (cpu > 0) {
-		if (psurge_type == PSURGE_DUAL)
-			out_8(psurge_sec_intr, ~0);
-		else
-			PSURGE_QUAD_OUT(PSURGE_QUAD_IRQ_CLR, 1 << cpu);
-	}
-}
-
-/*
- * On powersurge (old SMP powermac architecture) we don't have
- * separate IPIs for separate messages like openpic does.  Instead
- * we have a bitmap for each processor, where a 1 bit means that
- * the corresponding message is pending for that processor.
- * Ideally each cpu's entry would be in a different cache line.
- *  -- paulus.
- */
-static unsigned long psurge_smp_message[NR_CPUS];
-
-void psurge_smp_message_recv(struct pt_regs *regs)
-{
-	int cpu = smp_processor_id();
-	int msg;
-
-	/* clear interrupt */
-	psurge_clr_ipi(cpu);
-
-	if (smp_num_cpus < 2)
-		return;
-
-	/* make sure there is a message there */
-	for (msg = 0; msg < 4; msg++)
-		if (test_and_clear_bit(msg, &psurge_smp_message[cpu]))
-			smp_message_recv(msg, regs);
-}
-
-void
-psurge_primary_intr(int irq, void *d, struct pt_regs *regs)
-{
-	psurge_smp_message_recv(regs);
-}
-
-static void
-smp_psurge_message_pass(int target, int msg, unsigned long data, int wait)
-{
-	int i;
-
-	if (smp_num_cpus < 2)
-		return;
-
-	for (i = 0; i < smp_num_cpus; i++) {
-		if (target == MSG_ALL
-		    || (target == MSG_ALL_BUT_SELF && i != smp_processor_id())
-		    || target == i) {
-			set_bit(msg, &psurge_smp_message[i]);
-			psurge_set_ipi(i);
-		}
-	}
-}
-
-/*
- * Determine a quad card presence. We read the board ID register, we
- * force the data bus to change to something else, and we read it again.
- * It it's stable, then the register probably exist (ugh !)
- */
-static int __init psurge_quad_probe(void)
-{
-	int type;
-	unsigned int i;
-
-	type = PSURGE_QUAD_IN(PSURGE_QUAD_BOARD_ID);
-	if (type < PSURGE_QUAD_OKEE || type > PSURGE_QUAD_ICEGRASS
-	    || type != PSURGE_QUAD_IN(PSURGE_QUAD_BOARD_ID))
-		return PSURGE_DUAL;
-
-	/* looks OK, try a slightly more rigorous test */
-	/* bogus is not necessarily cacheline-aligned,
-	   though I don't suppose that really matters.  -- paulus */
-	for (i = 0; i < 100; i++) {
-		volatile u32 bogus[8];
-		bogus[(0+i)%8] = 0x00000000;
-		bogus[(1+i)%8] = 0x55555555;
-		bogus[(2+i)%8] = 0xFFFFFFFF;
-		bogus[(3+i)%8] = 0xAAAAAAAA;
-		bogus[(4+i)%8] = 0x33333333;
-		bogus[(5+i)%8] = 0xCCCCCCCC;
-		bogus[(6+i)%8] = 0xCCCCCCCC;
-		bogus[(7+i)%8] = 0x33333333;
-		wmb();
-		asm volatile("dcbf 0,%0" : : "r" (bogus) : "memory");
-		mb();
-		if (type != PSURGE_QUAD_IN(PSURGE_QUAD_BOARD_ID))
-			return PSURGE_DUAL;
-	}
-	return type;
-}
-
-static void __init psurge_quad_init(void)
-{
-	int procbits;
-
-	if (ppc_md.progress) ppc_md.progress("psurge_quad_init", 0x351);
-	procbits = ~PSURGE_QUAD_IN(PSURGE_QUAD_WHICH_CPU);
-	if (psurge_type == PSURGE_QUAD_ICEGRASS)
-		PSURGE_QUAD_BIS(PSURGE_QUAD_RESET_CTL, procbits);
-	else
-		PSURGE_QUAD_BIC(PSURGE_QUAD_CKSTOP_CTL, procbits);
-	mdelay(33);
-	out_8(psurge_sec_intr, ~0);
-	PSURGE_QUAD_OUT(PSURGE_QUAD_IRQ_CLR, procbits);
-	PSURGE_QUAD_BIS(PSURGE_QUAD_RESET_CTL, procbits);
-	if (psurge_type != PSURGE_QUAD_ICEGRASS)
-		PSURGE_QUAD_BIS(PSURGE_QUAD_CKSTOP_CTL, procbits);
-	PSURGE_QUAD_BIC(PSURGE_QUAD_PRIMARY_ARB, procbits);
-	mdelay(33);
-	PSURGE_QUAD_BIC(PSURGE_QUAD_RESET_CTL, procbits);
-	mdelay(33);
-	PSURGE_QUAD_BIS(PSURGE_QUAD_PRIMARY_ARB, procbits);
-	mdelay(33);
-}
-
-static int __init smp_psurge_probe(void)
-{
-	int i, ncpus;
-
-	/* We don't do SMP on the PPC601 -- paulus */
-	if ((_get_PVR() >> 16) == 1)
-		return 1;
-
-	/*
-	 * The powersurge cpu board can be used in the generation
-	 * of powermacs that have a socket for an upgradeable cpu card,
-	 * including the 7500, 8500, 9500, 9600.
-	 * The device tree doesn't tell you if you have 2 cpus because
-	 * OF doesn't know anything about the 2nd processor.
-	 * Instead we look for magic bits in magic registers,
-	 * in the hammerhead memory controller in the case of the
-	 * dual-cpu powersurge board.  -- paulus.
-	 */
-	if (find_devices("hammerhead") == NULL)
-		return 1;
-
-	hhead_base = ioremap(HAMMERHEAD_BASE, 0x800);
-	quad_base = ioremap(PSURGE_QUAD_REG_ADDR, 1024);
-	psurge_sec_intr = hhead_base + HHEAD_SEC_INTR;
-
-	psurge_type = psurge_quad_probe();
-	if (psurge_type != PSURGE_DUAL) {
-		psurge_quad_init();
-		/* All released cards using this HW design have 4 CPUs */
-		ncpus = 4;
-	} else {
-		iounmap((void *) quad_base);
-		if ((in_8(hhead_base + HHEAD_CONFIG) & 0x02) == 0) {
-			/* not a dual-cpu card */
-			iounmap((void *) hhead_base);
-			return 1;
-		}
-		ncpus = 2;
-	}
-
-	psurge_start = ioremap(PSURGE_START, 4);
-	psurge_pri_intr = ioremap(PSURGE_PRI_INTR, 4);
-
-	/* this is not actually strictly necessary -- paulus. */
-	for (i = 1; i < ncpus; ++i)
-		smp_hw_index[i] = i;
-
-	if (ppc_md.progress) ppc_md.progress("smp_psurge_probe - done", 0x352);
-
-	return ncpus;
-}
-
-static void __init smp_psurge_kick_cpu(int nr)
-{
-	void (*start)(void) = __secondary_start_psurge;
-
-	if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu", 0x353);
-
-	/* setup entry point of secondary processor */
-	switch (nr) {
-	case 2:
-		start = __secondary_start_psurge2;
-		break;
-	case 3:
-		start = __secondary_start_psurge3;
-		break;
-	}
-
-	out_be32(psurge_start, __pa(start));
-	mb();
-
-	psurge_set_ipi(nr);
-	udelay(10);
-	psurge_clr_ipi(nr);
-
-	if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu - done", 0x354);
-}
-
-/*
- * With the dual-cpu powersurge board, the decrementers and timebases
- * of both cpus are frozen after the secondary cpu is started up,
- * until we give the secondary cpu another interrupt.  This routine
- * uses this to get the timebases synchronized.
- *  -- paulus.
- */
-static void __init psurge_dual_sync_tb(int cpu_nr)
-{
-	static volatile int sec_tb_reset = 0;
-	int t;
-
-	set_dec(tb_ticks_per_jiffy);
-	set_tb(0, 0);
-	last_jiffy_stamp(cpu_nr) = 0;
-
-	if (cpu_nr > 0) {
-		mb();
-		sec_tb_reset = 1;
-		return;
-	}
-
-	/* wait for the secondary to have reset its TB before proceeding */
-	for (t = 10000000; t > 0 && !sec_tb_reset; --t)
-		;
-
-	/* now interrupt the secondary, starting both TBs */
-	psurge_set_ipi(1);
-
-	smp_tb_synchronized = 1;
-}
-
-static void
-smp_psurge_setup_cpu(int cpu_nr)
-{
-
-	if (cpu_nr == 0) {
-		if (smp_num_cpus < 2)
-			return;
-		/* reset the entry point so if we get another intr we won't
-		 * try to startup again */
-		out_be32(psurge_start, 0x100);
-		if (request_irq(30, psurge_primary_intr, 0, "primary IPI", 0))
-			printk(KERN_ERR "Couldn't get primary IPI interrupt");
-	}
-
-	if (psurge_type == PSURGE_DUAL)
-		psurge_dual_sync_tb(cpu_nr);
-}
-
-
-static void
-smp_openpic_message_pass(int target, int msg, unsigned long data, int wait)
-{
-	/* make sure we're sending something that translates to an IPI */
-	if ( msg > 0x3 ){
-		printk("SMP %d: smp_message_pass: unknown msg %d\n",
-		       smp_processor_id(), msg);
-		return;
-	}
-	switch ( target )
-	{
-	case MSG_ALL:
-		openpic_cause_IPI(msg, 0xffffffff);
-		break;
-	case MSG_ALL_BUT_SELF:
-		openpic_cause_IPI(msg,
-				  0xffffffff & ~(1 << smp_processor_id()));
-		break;
-	default:
-		openpic_cause_IPI(msg, 1<<target);
-		break;
-	}
-}
-
-static int
-smp_core99_probe(void)
-{
-	struct device_node *cpus;
-	int i, ncpus = 1;
-
-	if (ppc_md.progress) ppc_md.progress("smp_core99_probe", 0x345);
-	cpus = find_type_devices("cpu");
-	if (cpus)
-		while ((cpus = cpus->next) != NULL)
-			++ncpus;
-	printk("smp_core99_probe: found %d cpus\n", ncpus);
-	if (ncpus > 1) {
-		openpic_request_IPIs();
-		for (i = 1; i < ncpus; ++i)
-			smp_hw_index[i] = i;
-	}
-
-	return ncpus;
-}
-
-static void
-smp_core99_kick_cpu(int nr)
-{
-	unsigned long save_vector, new_vector;
-	unsigned long flags;
-#if 1 /* New way... */
-	volatile unsigned long *vector
-		 = ((volatile unsigned long *)(KERNELBASE+0x100));
-	if (nr < 1 || nr > 3)
-		return;
-#else
-	volatile unsigned long *vector
-		 = ((volatile unsigned long *)(KERNELBASE+0x500));
-	if (nr != 1)
-		return;
-#endif
-	if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu", 0x346);
-
-	local_irq_save(flags);
-	local_irq_disable();
-	
-	/* Save reset vector */
-	save_vector = *vector;
-	
-	/* Setup fake reset vector that does	  
-	 *   b __secondary_start_psurge - KERNELBASE
-	 */  
-	switch(nr) {
-		case 1:
-			new_vector = (unsigned long)__secondary_start_psurge;
-			break;
-		case 2:
-			new_vector = (unsigned long)__secondary_start_psurge2;
-			break;
-		case 3:
-			new_vector = (unsigned long)__secondary_start_psurge3;
-			break;
-	}
-	*vector = 0x48000002 + new_vector - KERNELBASE;
-	
-	/* flush data cache and inval instruction cache */
-	flush_icache_range((unsigned long) vector, (unsigned long) vector + 4);
-	
-	/* Put some life in our friend */
-	feature_core99_kick_cpu(nr);
-	
-	/* FIXME: We wait a bit for the CPU to take the exception, I should
-	 * instead wait for the entry code to set something for me. Well,
-	 * ideally, all that crap will be done in prom.c and the CPU left
-	 * in a RAM-based wait loop like CHRP.
-	 */
-	mdelay(1);
-	
-	/* Restore our exception vector */
-	*vector = save_vector;
-	flush_icache_range((unsigned long) vector, (unsigned long) vector + 4);
-	
-	local_irq_restore(flags);
-	if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu done", 0x347);
-}
-
-static void
-smp_core99_setup_cpu(int cpu_nr)
-{
-	/* Setup openpic */
-	do_openpic_setup_cpu();
-
-	/* Setup L2 */
-	if (cpu_nr != 0)
-		core99_init_l2();
-	else
-		if (ppc_md.progress) ppc_md.progress("core99_setup_cpu 0 done", 0x349);
-}
-
-static int
-smp_chrp_probe(void)
-{
-	extern unsigned long smp_chrp_cpu_nr;
-
-	if (smp_chrp_cpu_nr > 1)
-		openpic_request_IPIs();
-
-	return smp_chrp_cpu_nr;
-}
-
-static void
-smp_chrp_kick_cpu(int nr)
-{
-	*(unsigned long *)KERNELBASE = nr;
-	asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory");
-}
-
-static void
-smp_chrp_setup_cpu(int cpu_nr)
-{
-	static atomic_t ready = ATOMIC_INIT(1);
-	static volatile int frozen = 0;
-
-	if (cpu_nr == 0) {
-		/* wait for all the others */
-		while (atomic_read(&ready) < smp_num_cpus)
-			barrier();
-		atomic_set(&ready, 1);
-		/* freeze the timebase */
-		call_rtas("freeze-time-base", 0, 1, NULL);
-		mb();
-		frozen = 1;
-		/* XXX assumes this is not a 601 */
-		set_tb(0, 0);
-		last_jiffy_stamp(0) = 0;
-		while (atomic_read(&ready) < smp_num_cpus)
-			barrier();
-		/* thaw the timebase again */
-		call_rtas("thaw-time-base", 0, 1, NULL);
-		mb();
-		frozen = 0;
-		smp_tb_synchronized = 1;
-	} else {
-		atomic_inc(&ready);
-		while (!frozen)
-			barrier();
-		set_tb(0, 0);
-		last_jiffy_stamp(0) = 0;
-		mb();
-		atomic_inc(&ready);
-		while (frozen)
-			barrier();
-	}
-
-	if (OpenPIC_Addr)
-		do_openpic_setup_cpu();
-}
-
-#ifdef CONFIG_POWER4
-static void
-smp_xics_message_pass(int target, int msg, unsigned long data, int wait)
-{
-	/* for now, only do reschedule messages
-	   since we only have one IPI */
-	if (msg != PPC_MSG_RESCHEDULE)
-		return;
-	for (i = 0; i < smp_num_cpus; ++i) {
-		if (target == MSG_ALL || target == i
-		    || (target == MSG_ALL_BUT_SELF
-			&& i != smp_processor_id()))
-			xics_cause_IPI(i);
-	}
-}
-
-static int
-smp_xics_probe(void)
-{
-	return smp_chrp_cpu_nr;
-}
-
-static void
-smp_xics_setup_cpu(int cpu_nr)
-{
-	if (cpu_nr > 0)
-		xics_setup_cpu();
-}
-#endif /* CONFIG_POWER4 */
-
-static int
-smp_prep_probe(void)
-{
-	extern int mot_multi;
-
-	if (mot_multi) {
-		openpic_request_IPIs();
-		smp_hw_index[1] = 1;
-		return 2;
-	}
-
-	return 1;
-}
-
-static void
-smp_prep_kick_cpu(int nr)
-{
-	extern unsigned long *MotSave_SmpIar;
-	extern unsigned char *MotSave_CpusState[2];
-
-	*MotSave_SmpIar = (unsigned long)__secondary_start_psurge - KERNELBASE;
-	*MotSave_CpusState[1] = CPU_GOOD;
-	printk("CPU1 reset, waiting\n");
-}
-
-static void
-smp_prep_setup_cpu(int cpu_nr)
-{
-	if (OpenPIC_Addr)
-		do_openpic_setup_cpu();
-}
-
-#ifdef CONFIG_GEMINI	
-static int
-smp_gemini_probe(void)
-{
-	int i, nr;
-
-        nr = (readb(GEMINI_CPUSTAT) & GEMINI_CPU_COUNT_MASK) >> 2;
-	if (nr == 0)
-		nr = 4;
-
-	if (nr > 1) {
-		openpic_request_IPIs();
-		for (i = 1; i < nr; ++i)
-			smp_hw_index[i] = i;
-	}
-
-	return nr;
-}
-
-static void
-smp_gemini_kick_cpu(int nr)
-{
-	openpic_init_processor( 1<<nr );
-	openpic_init_processor( 0 );
-}
-
-static void
-smp_gemini_setup_cpu(int cpu_nr)
-{
-	if (OpenPIC_Addr)
-		do_openpic_setup_cpu();
-	if (cpu_nr > 0)
-		gemini_init_l2();
-}
-#endif /* CONFIG_GEMINI */
-
-
-static struct smp_ops_t {
-	void  (*message_pass)(int target, int msg, unsigned long data, int wait);
-	int   (*probe)(void);
-	void  (*kick_cpu)(int nr);
-	void  (*setup_cpu)(int nr);
-
-} *smp_ops;
-
 #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)
 
-
-/* PowerSurge-style Macs */
-static struct smp_ops_t psurge_smp_ops = {
-	smp_psurge_message_pass,
-	smp_psurge_probe,
-	smp_psurge_kick_cpu,
-	smp_psurge_setup_cpu,
-};
-
-/* Core99 Macs (dual G4s) */
-static struct smp_ops_t core99_smp_ops = {
-	smp_openpic_message_pass,
-	smp_core99_probe,
-	smp_core99_kick_cpu,
-	smp_core99_setup_cpu,
-};
-
-/* CHRP with openpic */
-static struct smp_ops_t chrp_smp_ops = {
-	smp_openpic_message_pass,
-	smp_chrp_probe,
-	smp_chrp_kick_cpu,
-	smp_chrp_setup_cpu,
-};
-
-#ifdef CONFIG_POWER4
-/* CHRP with new XICS interrupt controller */
-static struct smp_ops_t xics_smp_ops = {
-	smp_xics_message_pass,
-	smp_xics_probe,
-	smp_chrp_kick_cpu,
-	smp_xics_setup_cpu,
-};
-#endif /* CONFIG_POWER4 */
-
-/* PReP (MTX) */
-static struct smp_ops_t prep_smp_ops = {
-	smp_openpic_message_pass,
-	smp_prep_probe,
-	smp_prep_kick_cpu,
-	smp_prep_setup_cpu,
-};
-
-#ifdef CONFIG_GEMINI	
-/* Gemini */
-static struct smp_ops_t gemini_smp_ops = {
-	smp_openpic_message_pass,
-	smp_gemini_probe,
-	smp_gemini_kick_cpu,
-	smp_gemini_setup_cpu,
-};
-#endif /* CONFIG_GEMINI	*/
-
 /* 
  * Common functions
  */
@@ -798,7 +130,7 @@
  */
 void smp_send_tlb_invalidate(int cpu)
 {
-	if ( (_get_PVR()>>16) == 8 )
+	if ( PVR_VER(mfspr(PVR)) == 8 )
 		smp_message_pass(MSG_ALL_BUT_SELF, PPC_MSG_INVALIDATE_TLB, 0, 0);
 }
 
@@ -947,7 +279,6 @@
 	extern struct task_struct *current_set[NR_CPUS];
 	int i, cpu_nr;
 	struct task_struct *p;
-	unsigned long a;
 
 	printk("Entering SMP Mode...\n");
 	smp_num_cpus = 1;
@@ -973,35 +304,12 @@
 	 */
 	cacheflush_time = 5 * 1024;
 
-	/* To be later replaced by some arch-specific routine */
-	switch(_machine) {
-	case _MACH_Pmac:
-		/* Check for Core99 */
-		if (find_devices("uni-n"))
-			smp_ops = &core99_smp_ops;
-		else
-			smp_ops = &psurge_smp_ops;
-		break;
-	case _MACH_chrp:
-#ifndef CONFIG_POWER4
-		smp_ops = &chrp_smp_ops;
-#else
-		smp_ops = &xics_smp_ops;
-#endif /* CONFIG_POWER4 */
-		break;
-	case _MACH_prep:
-		smp_ops = &prep_smp_ops;
-		break;
-#ifdef CONFIG_GEMINI		
-	case _MACH_gemini:
-		smp_ops = &gemini_smp_ops;
-		break;
-#endif /* CONFIG_GEMINI	*/
-	default:
+	smp_ops = ppc_md.smp_ops;
+	if (smp_ops == NULL) {
 		printk("SMP not supported on this machine.\n");
 		return;
 	}
-	
+
 	/* Probe arch for CPUs */
 	cpu_nr = smp_ops->probe();
 
@@ -1044,10 +352,12 @@
 		p->has_cpu = 1;
 		current_set[i] = p;
 
-		/* need to flush here since secondary bats aren't setup */
-		for (a = KERNELBASE; a < KERNELBASE + 0x800000; a += 32)
-			asm volatile("dcbf 0,%0" : : "r" (a) : "memory");
-		asm volatile("sync");
+		/*
+		 * There was a cache flush loop here to flush the cache
+		 * to memory for the first 8MB of RAM.  The cache flush
+		 * has been pushed into the kick_cpu function for those
+		 * platforms that need it.
+		 */
 
 		/* wake up cpus */
 		smp_ops->kick_cpu(i);
@@ -1155,7 +465,6 @@
 	/* so time.c doesn't get confused */
 	set_dec(tb_ticks_per_jiffy);
 	last_jiffy_stamp(cpu) = 0;
-	cpu_callin_map[cpu] = 1;
 }
 
 void __init smp_commence(void)
@@ -1247,7 +556,7 @@
 
 	/* assume bogomips are same for everything */
         c->loops_per_jiffy = loops_per_jiffy;
-        c->pvr = _get_PVR();
+        c->pvr = mfspr(PVR);
 }
 
 static int __init maxcpus(char *str)
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/temp.c linux/arch/ppc/kernel/temp.c
--- v2.4.9/linux/arch/ppc/kernel/temp.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/kernel/temp.c	Tue Aug 28 06:58:33 2001
@@ -0,0 +1,278 @@
+/*
+ * temp.c	Thermal management for cpu's with Thermal Assist Units
+ *
+ * Written by Troy Benjegerdes <hozer@drgw.net>
+ *
+ * TODO:
+ * dynamic power management to limit peak CPU temp (using ICTC)
+ * calibration???
+ * 
+ * Silly, crazy ideas: use cpu load (from scheduler) and ICTC to extend battery
+ * life in portables, and add a 'performance/watt' metric somewhere in /proc
+ */
+
+#include <linux/config.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/param.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/interrupt.h>
+#include <linux/init.h>
+
+#include <asm/segment.h>
+#include <asm/io.h>
+#include <asm/processor.h>
+#include <asm/nvram.h>
+#include <asm/cache.h>
+#include <asm/8xx_immap.h>
+#include <asm/machdep.h>
+
+static struct tau_temp
+{
+	int interrupts;
+	unsigned char low;
+	unsigned char high;
+	unsigned char grew;
+} tau[NR_CPUS];
+
+struct timer_list tau_timer;
+
+#undef DEBUG
+
+/* TODO: put these in a /proc interface, with some sanity checks, and maybe
+ * dynamic adjustment to minimize # of interrupts */
+/* configurable values for step size and how much to expand the window when
+ * we get an interrupt. These are based on the limit that was out of range */
+#define step_size		2	/* step size when temp goes out of range */
+#define window_expand		1	/* expand the window by this much */
+/* configurable values for shrinking the window */
+#define shrink_timer	2*HZ	/* period between shrinking the window */
+#define min_window	2	/* minimum window size, degrees C */
+
+void set_thresholds(unsigned long cpu)
+{
+#ifdef CONFIG_TAU_INT
+	/*
+	 * setup THRM1,
+	 * threshold, valid bit, enable interrupts, interrupt when below threshold
+	 */
+	mtspr(SPRN_THRM1, THRM1_THRES(tau[cpu].low) | THRM1_V | THRM1_TIE | THRM1_TID);
+
+	/* setup THRM2,
+	 * threshold, valid bit, enable interrupts, interrupt when above threshhold
+	 */
+	mtspr (SPRN_THRM2, THRM1_THRES(tau[cpu].high) | THRM1_V | THRM1_TIE);
+#else
+	/* same thing but don't enable interrupts */
+	mtspr(SPRN_THRM1, THRM1_THRES(tau[cpu].low) | THRM1_V | THRM1_TID);
+	mtspr(SPRN_THRM2, THRM1_THRES(tau[cpu].high) | THRM1_V);
+#endif
+}
+
+void TAUupdate(int cpu)
+{
+	unsigned thrm;
+
+#ifdef DEBUG
+	printk("TAUupdate ");
+#endif
+
+	/* if both thresholds are crossed, the step_sizes cancel out
+	 * and the window winds up getting expanded twice. */
+	if((thrm = mfspr(SPRN_THRM1)) & THRM1_TIV){ /* is valid? */
+		if(thrm & THRM1_TIN){ /* crossed low threshold */
+			if (tau[cpu].low >= step_size){
+				tau[cpu].low -= step_size;
+				tau[cpu].high -= (step_size - window_expand);
+			}
+			tau[cpu].grew = 1;
+#ifdef DEBUG
+			printk("low threshold crossed ");
+#endif
+		}
+	}
+	if((thrm = mfspr(SPRN_THRM2)) & THRM1_TIV){ /* is valid? */
+		if(thrm & THRM1_TIN){ /* crossed high threshold */
+			if (tau[cpu].high <= 127-step_size){
+				tau[cpu].low += (step_size - window_expand);
+				tau[cpu].high += step_size;
+			}
+			tau[cpu].grew = 1;
+#ifdef DEBUG
+			printk("high threshold crossed ");
+#endif
+		}
+	}
+
+#ifdef DEBUG
+	printk("grew = %d\n", tau[cpu].grew);
+#endif
+
+#ifndef CONFIG_TAU_INT /* tau_timeout will do this if not using interrupts */
+	set_thresholds(cpu);	
+#endif
+
+}
+
+#ifdef CONFIG_TAU_INT
+/*
+ * TAU interrupts - called when we have a thermal assist unit interrupt
+ * with interrupts disabled
+ */
+
+void TAUException(struct pt_regs * regs)
+{
+	unsigned long cpu = smp_processor_id();
+
+	hardirq_enter(cpu);
+	tau[cpu].interrupts++;
+	
+	TAUupdate(cpu);
+
+	hardirq_exit(cpu);
+	return;
+}
+#endif /* CONFIG_TAU_INT */
+
+static void tau_timeout(void * info)
+{
+	unsigned long cpu = smp_processor_id();
+	unsigned long flags;
+	int size;
+	int shrink;
+ 
+	/* disabling interrupts *should* be okay */
+	save_flags(flags); cli();
+
+#ifndef CONFIG_TAU_INT
+	TAUupdate(cpu);
+#endif
+	
+	size = tau[cpu].high - tau[cpu].low;
+	if (size > min_window && ! tau[cpu].grew) {
+		/* do an exponential shrink of half the amount currently over size */
+		shrink = (2 + size - min_window) / 4;
+		if (shrink) {
+			tau[cpu].low += shrink;
+			tau[cpu].high -= shrink;
+		} else { /* size must have been min_window + 1 */
+			tau[cpu].low += 1;
+#if 1 /* debug */
+			if ((tau[cpu].high - tau[cpu].low) != min_window){
+				printk(KERN_ERR "temp.c: line %d, logic error\n", __LINE__);
+			}
+#endif
+		}
+	}
+
+	tau[cpu].grew = 0;
+	
+	set_thresholds(cpu);
+
+	/*
+	 * Do the enable every time, since otherwise a bunch of (relatively)
+	 * complex sleep code needs to be added. One mtspr every time
+	 * tau_timeout is called is probably not a big deal.
+	 * 
+	 * Enable thermal sensor and set up sample interval timer
+	 * need 20 us to do the compare.. until a nice 'cpu_speed' function
+	 * call is implemented, just assume a 500 mhz clock. It doesn't really
+	 * matter if we take too long for a compare since it's all interrupt 
+	 * driven anyway. 
+	 *
+	 * use a extra long time.. (60 us @ 500 mhz)
+	 */
+	mtspr(SPRN_THRM3, THRM3_SITV(500*60) | THRM3_E);
+
+	restore_flags(flags);
+}
+
+static void tau_timeout_smp(unsigned long unused)
+{
+
+	/* schedule ourselves to be run again */
+	mod_timer(&tau_timer, jiffies + shrink_timer) ;
+#ifdef CONFIG_SMP
+	smp_call_function(tau_timeout, NULL, 1, 0);
+#endif
+	tau_timeout(NULL);
+}
+
+/*
+ * setup the TAU
+ * 
+ * Set things up to use THRM1 as a temperature lower bound, and THRM2 as an upper bound.
+ * Start off at zero
+ */
+
+int tau_initialized = 0;
+
+void __init TAU_init_smp(void * info)
+{
+	unsigned long cpu = smp_processor_id();
+	
+	/* set these to a reasonable value and let the timer shrink the
+	 * window */
+	tau[cpu].low = 5;
+	tau[cpu].high = 120;
+
+	set_thresholds(cpu);
+}
+
+int __init TAU_init(void)
+{
+	/* We assume in SMP that if one CPU has TAU support, they
+	 * all have it --BenH
+	 */
+	if (!(cur_cpu_spec[0]->cpu_features & CPU_FTR_TAU)) {
+		printk("Thermal assist unit not available\n");
+		tau_initialized = 0;
+		return 1;
+	}
+
+
+	/* first, set up the window shrinking timer */
+	init_timer(&tau_timer);
+	tau_timer.function = tau_timeout_smp;
+	tau_timer.expires = jiffies + shrink_timer;
+	add_timer(&tau_timer);
+	
+#ifdef CONFIG_SMP
+	smp_call_function(TAU_init_smp, NULL, 1, 0);
+#endif
+	TAU_init_smp(NULL);
+	
+	printk("Thermal assist unit ");
+#ifdef CONFIG_TAU_INT
+	printk("using interrupts, ");
+#else
+	printk("using timers, ");
+#endif
+	printk("shrink_timer: %d jiffies\n", shrink_timer); 
+	tau_initialized = 1;
+
+	return 0;
+}
+
+__initcall(TAU_init);
+
+/*
+ * return current temp
+ */
+
+u32 cpu_temp_both(unsigned long cpu)
+{
+	return ((tau[cpu].high << 16) | tau[cpu].low);
+}
+
+int cpu_temp(unsigned long cpu)
+{
+	return ((tau[cpu].high + tau[cpu].low) / 2);
+}
+
+int tau_interrupts(unsigned long cpu)
+{
+	return (tau[cpu].interrupts);
+}
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/time.c linux/arch/ppc/kernel/time.c
--- v2.4.9/linux/arch/ppc/kernel/time.c	Tue Jul  3 17:08:18 2001
+++ linux/arch/ppc/kernel/time.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.time.c 1.18 06/06/01 22:33:09 paulus
+ * BK Id: SCCS/s.time.c 1.21 08/20/01 22:08:08 paulus
  */
 /*
  * Common time routines among all ppc machines.
@@ -72,11 +72,6 @@
 
 unsigned long disarm_decr[NR_CPUS];
 
-#ifdef CONFIG_SMP
-extern void smp_local_timer_interrupt(struct pt_regs *);
-extern int smp_tb_synchronized;
-#endif /* CONFIG_SMP */
-
 extern int do_sys_settimeofday(struct timeval *tv, struct timezone *tz);
 
 /* keep track of when we need to update the rtc */
@@ -321,27 +316,30 @@
 	 * makes things more complex. Repeatedly read the RTC until the
 	 * next second boundary to try to achieve some precision...
 	 */
-	stamp = get_native_tbl();
-	sec = ppc_md.get_rtc_time();
-	elapsed = 0;
-	do {
-		old_stamp = stamp; 
-		old_sec = sec;
+	if (ppc_md.get_rtc_time) {
 		stamp = get_native_tbl();
-		if (__USE_RTC() && stamp < old_stamp) old_stamp -= 1000000000;
-		elapsed += stamp - old_stamp;
 		sec = ppc_md.get_rtc_time();
-	} while ( sec == old_sec && elapsed < 2*HZ*tb_ticks_per_jiffy);
-	if (sec==old_sec) {
-		printk("Warning: real time clock seems stuck!\n");
+		elapsed = 0;
+		do {
+			old_stamp = stamp; 
+			old_sec = sec;
+			stamp = get_native_tbl();
+			if (__USE_RTC() && stamp < old_stamp) old_stamp -= 1000000000;
+			elapsed += stamp - old_stamp;
+			sec = ppc_md.get_rtc_time();
+		} while ( sec == old_sec && elapsed < 2*HZ*tb_ticks_per_jiffy);
+		if (sec==old_sec) {
+			printk("Warning: real time clock seems stuck!\n");
+		}
+		write_lock_irqsave(&xtime_lock, flags);
+		xtime.tv_sec = sec;
+		last_jiffy_stamp(0) = tb_last_stamp = stamp;
+		xtime.tv_usec = 0;
+		/* No update now, we just read the time from the RTC ! */
+		last_rtc_update = xtime.tv_sec;
+		write_unlock_irqrestore(&xtime_lock, flags);
 	}
-	write_lock_irqsave(&xtime_lock, flags);
-	xtime.tv_sec = sec;
-	last_jiffy_stamp(0) = tb_last_stamp = stamp;
-	xtime.tv_usec = 0;
-	/* No update now, we just read the time from the RTC ! */
-	last_rtc_update = xtime.tv_sec;
-	write_unlock_irqrestore(&xtime_lock, flags);
+
 	/* Not exact, but the timer interrupt takes care of this */
 	set_dec(tb_ticks_per_jiffy);
 
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/kernel/traps.c linux/arch/ppc/kernel/traps.c
--- v2.4.9/linux/arch/ppc/kernel/traps.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/kernel/traps.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.traps.c 1.16 07/31/01 10:53:34 trini
+ * BK Id: SCCS/s.traps.c 1.19 08/24/01 20:07:37 paulus
  */
 /*
  *  linux/arch/ppc/kernel/traps.c
@@ -244,7 +244,7 @@
 	 */
 	if ((instword & INST_MFSPR_PVR_MASK) == INST_MFSPR_PVR) {
 		rd = (instword >> 21) & 0x1f;
-		regs->gpr[rd] = _get_PVR();
+		regs->gpr[rd] = mfspr(PVR);
 		retval = 0;
 	}
 	if (retval == 0)
@@ -372,12 +372,14 @@
 }
 #endif
 
+#if !defined(CONFIG_TAU_INT)
 void
 TAUException(struct pt_regs *regs)
 {
 	printk("TAU trap at PC: %lx, SR: %lx, vector=%lx\n",
 	       regs->nip, regs->msr, regs->trap);
 }
+#endif /* CONFIG_INT_TAU */
 
 void __init trap_init(void)
 {
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/lib/checksum.S linux/arch/ppc/lib/checksum.S
--- v2.4.9/linux/arch/ppc/lib/checksum.S	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/lib/checksum.S	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.checksum.S 1.5 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.checksum.S 1.8 08/20/01 22:09:34 paulus
  */
 /*
  * This file contains assembly-language implementations
@@ -122,12 +122,30 @@
 	addc	r0,r0,r6
 	srwi.	r6,r5,2		/* # words to do */
 	beq	3f
-1:	mtctr	r6
-82:	lwzu	r6,4(r3)	/* the bdnz has zero overhead, so it should */
-92:	stwu	r6,4(r4)	/* be unnecessary to unroll this loop */
+1:	srwi.	r6,r5,4		/* # groups of 4 words to do */
+	beq	10f
+	mtctr	r6
+71:	lwz	r6,4(r3)
+72:	lwz	r9,8(r3)
+73:	lwz	r10,12(r3)
+74:	lwzu	r11,16(r3)
 	adde	r0,r0,r6
+75:	stw	r6,4(r4)
+	adde	r0,r0,r9
+76:	stw	r9,8(r4)
+	adde	r0,r0,r10
+77:	stw	r10,12(r4)
+	adde	r0,r0,r11
+78:	stwu	r11,16(r4)
+	bdnz	71b
+10:	rlwinm.	r6,r5,30,30,31	/* # words left to do */
+	beq	13f
+	mtctr	r6
+82:	lwzu	r9,4(r3)
+92:	stwu	r9,4(r4)
+	adde	r0,r0,r9
 	bdnz	82b
-	andi.	r5,r5,3
+13:	andi.	r5,r5,3
 3:	cmpi	0,r5,2
 	blt+	4f
 83:	lhz	r6,4(r3)
@@ -148,12 +166,16 @@
 /* These shouldn't go in the fixup section, since that would
    cause the ex_table addresses to get out of order. */
 
+src_error_4:
+	mfctr	r6		/* update # bytes remaining from ctr */
+	rlwimi	r5,r6,4,0,27
+	b	79f
 src_error_1:
 	li	r6,0
 	subi	r5,r5,2
 95:	sth	r6,4(r4)
 	addi	r4,r4,2
-	srwi.	r6,r5,2
+79:	srwi.	r6,r5,2
 	beq	3f
 	mtctr	r6
 src_error_2:
@@ -187,6 +209,14 @@
 .section __ex_table,"a"
 	.long	81b,src_error_1
 	.long	91b,dst_error
+	.long	71b,src_error_4
+	.long	72b,src_error_4
+	.long	73b,src_error_4
+	.long	74b,src_error_4
+	.long	75b,dst_error
+	.long	76b,dst_error
+	.long	77b,dst_error
+	.long	78b,dst_error
 	.long	82b,src_error_2
 	.long	92b,dst_error
 	.long	83b,src_error_3
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/lib/locks.c linux/arch/ppc/lib/locks.c
--- v2.4.9/linux/arch/ppc/lib/locks.c	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/lib/locks.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.locks.c 1.8 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.locks.c 1.11 08/19/01 22:27:32 paulus
  */
 /*
  * Locks for smp ppc 
@@ -16,29 +16,53 @@
 #include <asm/system.h>
 #include <asm/io.h>
 
-#define DEBUG_LOCKS 1
+#ifdef SPINLOCK_DEBUG
 
 #undef INIT_STUCK
 #define INIT_STUCK 200000000 /*0xffffffff*/
 
+/*
+ * Try to acquire a spinlock.
+ * Only does the stwcx. if the load returned 0 - the Programming
+ * Environments Manual suggests not doing unnecessary stcwx.'s
+ * since they may inhibit forward progress by other CPUs in getting
+ * a lock.
+ */
+static unsigned long __spin_trylock(volatile unsigned long *lock)
+{
+	unsigned long ret;
+
+	__asm__ __volatile__ ("\n\
+1:	lwarx	%0,0,%1\n\
+	cmpwi	0,%0,0\n\
+	bne	2f\n\
+	stwcx.	%2,0,%1\n\
+	bne-	1b\n\
+	isync\n\
+2:"
+	: "=&r"(ret)
+	: "r"(lock), "r"(1)
+	: "cr0", "memory");
+
+	return ret;
+}
+
 void _spin_lock(spinlock_t *lock)
 {
 	int cpu = smp_processor_id();
-#ifdef DEBUG_LOCKS
 	unsigned int stuck = INIT_STUCK;
-#endif /* DEBUG_LOCKS */
 	while (__spin_trylock(&lock->lock)) {
-#ifdef DEBUG_LOCKS
-		if(!--stuck) {
-			printk("_spin_lock(%p) CPU#%d NIP %p"
-			       " holder: cpu %ld pc %08lX\n",
-			       lock, cpu, __builtin_return_address(0),
-			       lock->owner_cpu,lock->owner_pc);
-			stuck = INIT_STUCK;
-			/* steal the lock */
-			/*xchg_u32((void *)&lock->lock,0);*/
+		while ((unsigned volatile long)lock->lock != 0) {
+			if (!--stuck) {
+				printk("_spin_lock(%p) CPU#%d NIP %p"
+				       " holder: cpu %ld pc %08lX\n",
+				       lock, cpu, __builtin_return_address(0),
+				       lock->owner_cpu,lock->owner_pc);
+				stuck = INIT_STUCK;
+				/* steal the lock */
+				/*xchg_u32((void *)&lock->lock,0);*/
+			}
 		}
-#endif /* DEBUG_LOCKS */
 	}
 	lock->owner_pc = (unsigned long)__builtin_return_address(0);
 	lock->owner_cpu = cpu;
@@ -53,11 +77,8 @@
 	return 1;
 }
 
-
-
 void _spin_unlock(spinlock_t *lp)
 {
-#ifdef DEBUG_LOCKS
   	if ( !lp->lock )
 		printk("_spin_unlock(%p): no lock cpu %d curr PC %p %s/%d\n",
 		       lp, smp_processor_id(), __builtin_return_address(0),
@@ -66,13 +87,12 @@
 		printk("_spin_unlock(%p): cpu %d trying clear of cpu %d pc %lx val %lx\n",
 		      lp, smp_processor_id(), (int)lp->owner_cpu,
 		      lp->owner_pc,lp->lock);
-#endif /* DEBUG_LOCKS */
 	lp->owner_pc = lp->owner_cpu = 0;
 	wmb();
 	lp->lock = 0;
-	wmb();
 }
 
+
 /*
  * Just like x86, implement read-write locks as a 32-bit counter
  * with the high bit (sign) being the "write" bit.
@@ -80,14 +100,11 @@
  */
 void _read_lock(rwlock_t *rw)
 {
-#ifdef DEBUG_LOCKS
 	unsigned long stuck = INIT_STUCK;
 	int cpu = smp_processor_id();
-#endif /* DEBUG_LOCKS */		  
 
 again:	
 	/* get our read lock in there */
-	wmb();
 	atomic_inc((atomic_t *) &(rw)->lock);
 	if ( (signed long)((rw)->lock) < 0) /* someone has a write lock */
 	{
@@ -96,13 +113,11 @@
 		/* wait for the write lock to go away */
 		while ((signed long)((rw)->lock) < 0)
 		{
-#ifdef DEBUG_LOCKS
 			if(!--stuck)
 			{
 				printk("_read_lock(%p) CPU#%d\n", rw, cpu);
 				stuck = INIT_STUCK;
 			}
-#endif /* DEBUG_LOCKS */
 		}
 		/* try to get the read lock again */
 		goto again;
@@ -112,38 +127,30 @@
 
 void _read_unlock(rwlock_t *rw)
 {
-#ifdef DEBUG_LOCKS
 	if ( rw->lock == 0 )
 		printk("_read_unlock(): %s/%d (nip %08lX) lock %lx\n",
 		       current->comm,current->pid,current->thread.regs->nip,
 		      rw->lock);
-#endif /* DEBUG_LOCKS */
 	wmb();
 	atomic_dec((atomic_t *) &(rw)->lock);
-	wmb();
 }
 
 void _write_lock(rwlock_t *rw)
 {
-#ifdef DEBUG_LOCKS
 	unsigned long stuck = INIT_STUCK;
 	int cpu = smp_processor_id();
-#endif /* DEBUG_LOCKS */		  
 
 again:
-	wmb();
 	if ( test_and_set_bit(31,&(rw)->lock) ) /* someone has a write lock */
 	{
 		while ( (rw)->lock & (1<<31) ) /* wait for write lock */
 		{
-#ifdef DEBUG_LOCKS
 			if(!--stuck)
 			{
 				printk("write_lock(%p) CPU#%d lock %lx)\n",
 				       rw, cpu,rw->lock);
 				stuck = INIT_STUCK;
 			}
-#endif /* DEBUG_LOCKS */		  
 			barrier();
 		}
 		goto again;
@@ -155,14 +162,12 @@
 		clear_bit(31,&(rw)->lock);
 		while ( (rw)->lock & ~(1<<31) )
 		{
-#ifdef DEBUG_LOCKS
 			if(!--stuck)
 			{
 				printk("write_lock(%p) 2 CPU#%d lock %lx)\n",
 				       rw, cpu,rw->lock);
 				stuck = INIT_STUCK;
 			}
-#endif /* DEBUG_LOCKS */
 			barrier();
 		}
 		goto again;
@@ -172,79 +177,12 @@
 
 void _write_unlock(rwlock_t *rw)
 {
-#ifdef DEBUG_LOCKS
 	if ( !(rw->lock & (1<<31)) )
 		printk("_write_lock(): %s/%d (nip %08lX) lock %lx\n",
 		      current->comm,current->pid,current->thread.regs->nip,
 		      rw->lock);
-#endif /* DEBUG_LOCKS */
 	wmb();
 	clear_bit(31,&(rw)->lock);
-	wmb();
-}
-
-void __lock_kernel(struct task_struct *task)
-{
-#ifdef DEBUG_LOCKS
-	unsigned long stuck = INIT_STUCK;
-	
-	if ( (signed long)(task->lock_depth) < 0 )
-	{
-		printk("__lock_kernel(): %s/%d (nip %08lX) lock depth %x\n",
-		      task->comm,task->pid,task->thread.regs->nip,
-		      task->lock_depth);
-	}
-#endif /* DEBUG_LOCKS */
-
-	if (atomic_inc_return((atomic_t *) &task->lock_depth) != 1)
-		return;
-	/* mine! */
-	while (__spin_trylock(&klock_info.kernel_flag)) {
-#ifdef DEBUG_LOCKS
-		if(!--stuck) {
-			printk("_lock_kernel() CPU#%d NIP %p\n",
-			       smp_processor_id(),
-			       __builtin_return_address(0));
-			stuck = INIT_STUCK;
-		}
-#endif /* DEBUG_LOCKS */
-	}
-	
-	klock_info.akp = smp_processor_id();
-	/* my kernel mode! mine!!! */
 }
 
-void __unlock_kernel(struct task_struct *task)
-{
-#ifdef DEBUG_LOCKS
- 	if ((task->lock_depth == 0) || (klock_info.kernel_flag != KLOCK_HELD))
-	{
-		printk("__unlock_kernel(): %s/%d (nip %08lX) "
-		       "lock depth %x flags %lx\n",
-		       task->comm,task->pid,task->thread.regs->nip,
-		       task->lock_depth, klock_info.kernel_flag);
-		klock_info.akp = NO_PROC_ID;		
-		klock_info.kernel_flag = 0;
-		return;
-	}
-#endif /* DEBUG_LOCKS */
-	if (atomic_dec_and_test((atomic_t *) &task->lock_depth))
-	{
-		wmb();
-		klock_info.akp = NO_PROC_ID;
-		wmb();
-		klock_info.kernel_flag = KLOCK_CLEAR;
-		wmb();
-	}
-}	
-
-void reacquire_kernel_lock(struct task_struct *task, int cpu,int depth)
-{
-	if (depth)
-	{
-		__cli();
-		__lock_kernel(task);
-		task->lock_depth = depth;
-		__sti();
-	}
-}
+#endif
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/mm/4xx_mmu.c linux/arch/ppc/mm/4xx_mmu.c
--- v2.4.9/linux/arch/ppc/mm/4xx_mmu.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/mm/4xx_mmu.c	Tue Aug 28 06:58:33 2001
@@ -0,0 +1,98 @@
+/*
+ * BK Id: %F% %I% %G% %U% %#%
+ */
+/*
+ * This file contains the routines for initializing the MMU
+ * on the 4xx series of chips.
+ *  -- paulus
+ * 
+ *  Derived from arch/ppc/mm/init.c:
+ *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
+ *
+ *  Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
+ *  and Cort Dougan (PReP) (cort@cs.nmt.edu)
+ *    Copyright (C) 1996 Paul Mackerras
+ *  Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
+ *
+ *  Derived from "arch/i386/mm/init.c"
+ *    Copyright (C) 1991, 1992, 1993, 1994  Linus Torvalds
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/signal.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/types.h>
+#include <linux/ptrace.h>
+#include <linux/mman.h>
+#include <linux/mm.h>
+#include <linux/swap.h>
+#include <linux/stddef.h>
+#include <linux/vmalloc.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/bootmem.h>
+#include <linux/highmem.h>
+
+#include <asm/pgalloc.h>
+#include <asm/prom.h>
+#include <asm/io.h>
+#include <asm/mmu_context.h>
+#include <asm/pgtable.h>
+#include <asm/mmu.h>
+#include <asm/uaccess.h>
+#include <asm/smp.h>
+#include <asm/bootx.h>
+#include <asm/machdep.h>
+#include <asm/setup.h>
+
+/* Used by the 4xx TLB replacement exception handler.
+ * Just needed it declared someplace (and initialized to zero).
+ */
+unsigned int tlb_4xx_index;
+
+/*
+ * MMU_init_hw does the chip-specific initialization of the MMU hardware.
+ */
+void __init MMU_init_hw(void)
+{
+	/*
+	 * The Zone Protection Register (ZPR) defines how protection will
+	 * be applied to every page which is a member of a given zone. At
+	 * present, we utilize only two of the 4xx's zones.
+	 * The zone index bits (of ZSEL) in the PTE are used for software
+	 * indicators, except the LSB.  For user access, zone 15 is used,
+	 * for kernel access, zone 14 is used.  We set all but zone 15
+	 * to zero, allowing only kernel access as indicated in the PTE.
+	 * For zone 15, we set a 01 binary (a value of 10 will not work)
+	 * to allow user access as indicated in the PTE.  This also allows
+	 * kernel access as indicated in the PTE.
+	 */
+
+        mtspr(SPRN_ZPR, 0x00000001);
+
+	flush_instruction_cache();
+
+	/*
+	 * Set up the real-mode cache parameters for the exception vector
+	 * handlers (which are run in real-mode).
+	 */
+
+        mtspr(SPRN_DCWR, 0x00000000);	/* All caching is write-back */
+
+        /*
+	 * Cache instruction and data space where the exception
+	 * vectors and the kernel live in real-mode.
+	 */
+
+        mtspr(SPRN_DCCR, 0x80000000);	/* 128 MB of data space at 0x0. */
+        mtspr(SPRN_ICCR, 0x80000000);	/* 128 MB of instr. space at 0x0. */
+}
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/mm/Makefile linux/arch/ppc/mm/Makefile
--- v2.4.9/linux/arch/ppc/mm/Makefile	Tue Jul  3 17:08:18 2001
+++ linux/arch/ppc/mm/Makefile	Tue Aug 28 06:58:33 2001
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.6 06/28/01 15:50:17 paulus
+# BK Id: SCCS/s.Makefile 1.8 08/16/01 17:25:47 paulus
 #
 #
 # Makefile for the linux ppc-specific parts of the memory manager.
@@ -15,15 +15,13 @@
 EXTRA_AFLAGS		:= -Wa,-mppc64bridge
 endif
 
-O_TARGET		:= mm.o
-obj-y			:= fault.o init.o mem_pieces.o extable.o
+O_TARGET			:= mm.o
+obj-y				:= fault.o init.o mem_pieces.o extable.o \
+					mmu_context.o pgtable.o
 
-ifneq ($(CONFIG_8xx),y)
-ifneq ($(CONFIG_4xx),y)
-obj-y			+= hashtable.o
-endif
-endif
-
-obj-$(CONFIG_4xx)	+= 4xx_tlb.o
+obj-$(CONFIG_PPC_STD_MMU)	+= hashtable.o ppc_mmu.o tlb.o
+obj-$(CONFIG_PPC_ISERIES)	+= iSeries_hashtable.o iSeries_mmu.o tlb.o
+obj-$(CONFIG_4xx)		+= cachemap.o 4xx_mmu.o
+obj-$(CONFIG_8xx)		+= cachemap.o
 
 include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/mm/cachemap.c linux/arch/ppc/mm/cachemap.c
--- v2.4.9/linux/arch/ppc/mm/cachemap.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/mm/cachemap.c	Tue Aug 28 06:58:33 2001
@@ -0,0 +1,163 @@
+/*
+ * BK Id: %F% %I% %G% %U% %#%
+ *
+ *  PowerPC version derived from arch/arm/mm/consistent.c
+ *    Copyright (C) 2001 Dan Malek (dmalek@jlc.net)
+ *
+ *  linux/arch/arm/mm/consistent.c
+ *
+ *  Copyright (C) 2000 Russell King
+ *
+ * Consistent memory allocators.  Used for DMA devices that want to
+ * share uncached memory with the processor core.  The function return
+ * is the virtual address and 'dma_handle' is the physical address.
+ * Mostly stolen from the ARM port, with some changes for PowerPC.
+ *						-- Dan
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/signal.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/types.h>
+#include <linux/ptrace.h>
+#include <linux/mman.h>
+#include <linux/mm.h>
+#include <linux/swap.h>
+#include <linux/stddef.h>
+#include <linux/vmalloc.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/bootmem.h>
+#include <linux/highmem.h>
+#include <linux/pci.h>
+
+#include <asm/pgalloc.h>
+#include <asm/prom.h>
+#include <asm/io.h>
+#include <asm/hardirq.h>
+#include <asm/mmu_context.h>
+#include <asm/pgtable.h>
+#include <asm/mmu.h>
+#include <asm/uaccess.h>
+#include <asm/smp.h>
+#include <asm/machdep.h>
+
+void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle)
+{
+	int order, rsize;
+	unsigned long page;
+	void *ret;
+	pte_t	*pte;
+
+	if (in_interrupt())
+		BUG();
+
+	/* Only allocate page size areas.
+	*/
+	size = PAGE_ALIGN(size);
+	order = get_order(size);
+
+	page = __get_free_pages(gfp, order);
+	if (!page) {
+		BUG();
+		return NULL;
+	}
+
+	/*
+	 * we need to ensure that there are no cachelines in use,
+	 * or worse dirty in this area.
+	 */
+	invalidate_dcache_range(page, page + size);
+
+	ret = (void *)page;
+	*dma_handle = virt_to_bus(ret);
+
+	/* Chase down all of the PTEs and mark them uncached.
+	*/
+	rsize = (int)size;
+	while (rsize > 0) {
+		if (get_pteptr(&init_mm, page, &pte)) {
+			pte_val(*pte) |= _PAGE_NO_CACHE | _PAGE_GUARDED;
+			flush_tlb_page(find_vma(&init_mm,page),page);
+		}
+		else {
+			BUG();
+			return NULL;
+		}
+		page += PAGE_SIZE;
+		rsize -= PAGE_SIZE;
+	}
+
+	return ret;
+}
+
+/*
+ * free page(s) as defined by the above mapping.
+ * The caller has to tell us the size so we can free the proper number
+ * of pages.  We can't vmalloc() a new space for these pages and simply
+ * call vfree() like some other architectures because we could end up
+ * with aliased cache lines (or at least a cache line with the wrong
+ * attributes).  This can happen when the PowerPC speculative loads
+ * across page boundaries.
+ */
+void consistent_free(void *vaddr, size_t size)
+{
+	int order, rsize;
+	unsigned long addr;
+	pte_t	*pte;
+
+	if (in_interrupt())
+		BUG();
+
+	size = PAGE_ALIGN(size);
+	order = get_order(size);
+
+	/* Chase down all of the PTEs and mark them cached again.
+	*/
+	addr = (unsigned long)vaddr;
+	rsize = (int)size;
+	while (rsize > 0) {
+		if (get_pteptr(&init_mm, addr, &pte)) {
+			pte_val(*pte) &= ~(_PAGE_NO_CACHE | _PAGE_GUARDED);
+			flush_tlb_page(find_vma(&init_mm,addr),addr);
+		}
+		else {
+			BUG();
+			return;
+		}
+		addr += PAGE_SIZE;
+		rsize -= PAGE_SIZE;
+	}
+	free_pages((unsigned long)vaddr, order);
+}
+
+/*
+ * make an area consistent.
+ */
+void consistent_sync(void *vaddr, size_t size, int direction)
+{
+	unsigned long start = (unsigned long)vaddr;
+	unsigned long end   = start + size;
+
+	switch (direction) {
+	case PCI_DMA_NONE:
+		BUG();
+	case PCI_DMA_FROMDEVICE:	/* invalidate only */
+		invalidate_dcache_range(start, end);
+		break;
+	case PCI_DMA_TODEVICE:		/* writeback only */
+		clean_dcache_range(start, end);
+		break;
+	case PCI_DMA_BIDIRECTIONAL:	/* writeback and invalidate */
+		flush_dcache_range(start, end);
+		break;
+	}
+}
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/mm/hashtable.S linux/arch/ppc/mm/hashtable.S
--- v2.4.9/linux/arch/ppc/mm/hashtable.S	Tue Jul  3 17:08:18 2001
+++ linux/arch/ppc/mm/hashtable.S	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.hashtable.S 1.16 06/29/01 08:51:52 paulus
+ * BK Id: SCCS/s.hashtable.S 1.18 08/15/01 22:43:07 paulus
  */
 /*
  *  arch/ppc/kernel/hashtable.S
@@ -31,6 +31,7 @@
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
+#include <asm/cputable.h>
 
 #ifdef CONFIG_SMP
 	.comm	hash_table_lock,4
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/mm/init.c linux/arch/ppc/mm/init.c
--- v2.4.9/linux/arch/ppc/mm/init.c	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/mm/init.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.init.c 1.30 07/06/01 09:19:29 trini
+ * BK Id: SCCS/s.init.c 1.34 08/20/01 22:12:43 paulus
  */
 /*
  *  PowerPC version 
@@ -21,20 +21,14 @@
  */
 
 #include <linux/config.h>
-#include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/types.h>
-#include <linux/ptrace.h>
-#include <linux/mman.h>
 #include <linux/mm.h>
-#include <linux/swap.h>
 #include <linux/stddef.h>
-#include <linux/vmalloc.h>
 #include <linux/init.h>
-#include <linux/delay.h>
 #include <linux/bootmem.h>
 #include <linux/highmem.h>
 #ifdef CONFIG_BLK_DEV_INITRD
@@ -47,138 +41,49 @@
 #include <asm/mmu_context.h>
 #include <asm/pgtable.h>
 #include <asm/mmu.h>
-#include <asm/uaccess.h>
-#ifdef CONFIG_8xx
-#include <asm/8xx_immap.h>
-#include <asm/mpc8xx.h>
-#endif
-#ifdef CONFIG_8260
-#include <asm/immap_8260.h>
-#include <asm/mpc8260.h>
-#endif
 #include <asm/smp.h>
-#include <asm/bootx.h>
 #include <asm/machdep.h>
-#include <asm/setup.h>
-#include <asm/amigahw.h>
-#include <asm/gemini.h>
+#include <asm/btext.h>
 
 #include "mem_pieces.h"
+#include "mmu_decl.h"
 
-#if defined(CONFIG_4xx)
-#include "4xx_tlb.h"
-#endif
-
-#define MAX_LOW_MEM	(512 << 20)
+#define MAX_LOW_MEM	(0xF0000000UL - KERNELBASE)
 
-#define	PGTOKB(pages)	(((pages) * PAGE_SIZE) >> 10)
-
-mm_context_t next_mmu_context;
-unsigned long context_map[(LAST_CONTEXT+1) / (8*sizeof(unsigned long))];
-#ifdef FEW_CONTEXTS
-atomic_t nr_free_contexts;
-struct mm_struct *context_mm[LAST_CONTEXT+1];
-void steal_context(void);
-#endif /* FEW_CONTEXTS */
-
-int prom_trashed;
-unsigned long *end_of_DRAM;
+void *end_of_DRAM;
 unsigned long total_memory;
 unsigned long total_lowmem;
-unsigned long ram_phys_base;
+
 int mem_init_done;
 int init_bootmem_done;
 int boot_mapsize;
 unsigned long totalram_pages;
 unsigned long totalhigh_pages;
-extern pgd_t swapper_pg_dir[];
-extern char _start[], _end[];
+
+extern char _end[];
 extern char etext[], _stext[];
 extern char __init_begin, __init_end;
 extern char __prep_begin, __prep_end;
 extern char __chrp_begin, __chrp_end;
 extern char __pmac_begin, __pmac_end;
 extern char __openfirmware_begin, __openfirmware_end;
-unsigned long ioremap_base;
-unsigned long ioremap_bot;
-unsigned long avail_start;
-extern int num_memory;
-extern struct mem_info memory[];
-extern boot_infos_t *boot_infos;
-extern unsigned int rtas_data, rtas_size;
-#ifndef CONFIG_SMP
-struct pgtable_cache_struct quicklists;
-#endif
+
 #ifdef CONFIG_HIGHMEM
 pte_t *kmap_pte;
 pgprot_t kmap_prot;
 #endif
 
 void MMU_init(void);
-void *early_get_page(void);
-static void mapin_ram(void);
-int map_page(unsigned long va, unsigned long pa, int flags);
 void set_phys_avail(unsigned long total_ram);
-extern void die_if_kernel(char *,struct pt_regs *,long);
 
-extern char _start[], _end[];
-extern char _stext[], etext[];
+/* XXX should be in current.h  -- paulus */
 extern struct task_struct *current_set[NR_CPUS];
 
 char *klimit = _end;
 struct mem_pieces phys_avail;
 
-PTE *Hash, *Hash_end;
-unsigned long Hash_size, Hash_mask;
-#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
-unsigned long _SDR1;
-static void hash_init(void);
-
-union ubat {			/* BAT register values to be loaded */
-	BAT	bat;
-#ifdef CONFIG_PPC64BRIDGE
-	u64	word[2];
-#else
-	u32	word[2];
-#endif	
-} BATS[4][2];			/* 4 pairs of IBAT, DBAT */
-
-struct batrange {		/* stores address ranges mapped by BATs */
-	unsigned long start;
-	unsigned long limit;
-	unsigned long phys;
-} bat_addrs[4];
-
-/*
- * Return PA for this VA if it is mapped by a BAT, or 0
- */
-static inline unsigned long v_mapped_by_bats(unsigned long va)
-{
-	int b;
-	for (b = 0; b < 4; ++b)
-		if (va >= bat_addrs[b].start && va < bat_addrs[b].limit)
-			return bat_addrs[b].phys + (va - bat_addrs[b].start);
-	return 0;
-}
-
-/*
- * Return VA for a given PA or 0 if not mapped
- */
-static inline unsigned long p_mapped_by_bats(unsigned long pa)
-{
-	int b;
-	for (b = 0; b < 4; ++b)
-		if (pa >= bat_addrs[b].phys
-	    	    && pa < (bat_addrs[b].limit-bat_addrs[b].start)
-		              +bat_addrs[b].phys)
-			return bat_addrs[b].start+(pa-bat_addrs[b].phys);
-	return 0;
-}
-
-#else /* CONFIG_4xx || CONFIG_8xx */
-#define v_mapped_by_bats(x)	(0UL)
-#define p_mapped_by_bats(x)	(0UL)
-#endif /* !CONFIG_4xx && !CONFIG_8xx */
+extern char *sysmap; 
+extern unsigned long sysmap_size;
 
 /*
  * this tells the system to map all of ram with the segregs
@@ -298,421 +203,7 @@
 	val->mem_unit = PAGE_SIZE;
 }
 
-void *
-ioremap(unsigned long addr, unsigned long size)
-{
-	return __ioremap(addr, size, _PAGE_NO_CACHE);
-}
-
-void *
-__ioremap(unsigned long addr, unsigned long size, unsigned long flags)
-{
-	unsigned long p, v, i;
-	int err;
-
-	/*
-	 * Choose an address to map it to.
-	 * Once the vmalloc system is running, we use it.
-	 * Before then, we map addresses >= ioremap_base
-	 * virt == phys; for addresses below this we use
-	 * space going down from ioremap_base (ioremap_bot
-	 * records where we're up to).
-	 */
-	p = addr & PAGE_MASK;
-	size = PAGE_ALIGN(addr + size) - p;
-
-	/*
-	 * If the address lies within the first 16 MB, assume it's in ISA
-	 * memory space
-	 */
-	if ( p < 16*1024*1024 )
-		p += _ISA_MEM_BASE;
-
-	/*
-	 * Don't allow anybody to remap normal RAM that we're using.
-	 * mem_init() sets high_memory so only do the check after that.
-	 */
-	if ( mem_init_done && (p < virt_to_phys(high_memory)) )
-	{
-		printk("__ioremap(): phys addr %0lx is RAM lr %p\n", p,
-		       __builtin_return_address(0));
-		return NULL;
-	}
-
-	if (size == 0)
-		return NULL;
-
-	/*
-	 * Is it already mapped?  Perhaps overlapped by a previous
-	 * BAT mapping.  If the whole area is mapped then we're done,
-	 * otherwise remap it since we want to keep the virt addrs for
-	 * each request contiguous.
-	 *
-	 * We make the assumption here that if the bottom and top
-	 * of the range we want are mapped then it's mapped to the
-	 * same virt address (and this is contiguous).
-	 *  -- Cort
-	 */
-	if ((v = p_mapped_by_bats(p)) /*&& p_mapped_by_bats(p+size-1)*/ )
-		goto out;
-	
-	if (mem_init_done) {
-		struct vm_struct *area;
-		area = get_vm_area(size, VM_IOREMAP);
-		if (area == 0)
-			return NULL;
-		v = VMALLOC_VMADDR(area->addr);
-	} else {
-#ifndef CONFIG_HIGHMEM
-		if (p >= ioremap_base)
-#else
-		if (p >= ioremap_base && p < PKMAP_BASE)
-#endif /* CONFIG_HIGHMEM */
-			v = p;
-		else
-			v = (ioremap_bot -= size);
-	}
-
-	if ((flags & _PAGE_PRESENT) == 0)
-		flags |= pgprot_val(PAGE_KERNEL);
-	if (flags & (_PAGE_NO_CACHE | _PAGE_WRITETHRU))
-		flags |= _PAGE_GUARDED;
-
-	/*
-	 * Should check if it is a candidate for a BAT mapping
-	 */
-
-	err = 0;
-	for (i = 0; i < size && err == 0; i += PAGE_SIZE)
-		err = map_page(v+i, p+i, flags);
-	if (err) {
-		if (mem_init_done)
-			vfree((void *)v);
-		return NULL;
-	}
-
-out:
-	return (void *) (v + (addr & ~PAGE_MASK));
-}
-
-void iounmap(void *addr)
-{
-	if (addr > high_memory && (unsigned long) addr < ioremap_bot)
-		vfree((void *) (PAGE_MASK & (unsigned long) addr));
-}
-
-unsigned long iopa(unsigned long addr)
-{
-	unsigned long pa;
-	pmd_t *pd;
-	pte_t *pg;
-
-	/* Check the BATs */
-	pa = v_mapped_by_bats(addr);
-	if (pa)
-		return pa;
-
-	/* Do we have a page table? */
-	if (init_mm.pgd == NULL)
-		return 0;
-
-	/* Use upper 10 bits of addr to index the first level map */
-	pd = (pmd_t *) (init_mm.pgd + (addr >> PGDIR_SHIFT));
-	if (pmd_none(*pd))
-		return 0;
-
-	/* Use middle 10 bits of addr to index the second-level map */
-	pg = pte_offset(pd, addr);
-	return (pte_val(*pg) & PAGE_MASK) | (addr & ~PAGE_MASK);
-}
-
-int
-map_page(unsigned long va, unsigned long pa, int flags)
-{
-	pmd_t *pd;
-	pte_t *pg;
-	int err = -ENOMEM;
-
-	spin_lock(&init_mm.page_table_lock);
-	/* Use upper 10 bits of VA to index the first level map */
-	pd = pmd_offset(pgd_offset_k(va), va);
-	/* Use middle 10 bits of VA to index the second-level map */
-	pg = pte_alloc(&init_mm, pd, va);
-	if (pg != 0) {
-		err = 0;
-		set_pte(pg, mk_pte_phys(pa & PAGE_MASK, __pgprot(flags)));
-#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
-		if (mem_init_done && Hash != 0)
-			flush_hash_page(0, va, pg);
-#endif /* !4xx && !8xx */
-	}
-	spin_unlock(&init_mm.page_table_lock);
-	return err;
-}
-
-#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
-/*
- * TLB flushing:
- *
- *  - flush_tlb_all() flushes all processes TLBs
- *  - flush_tlb_mm(mm) flushes the specified mm context TLB's
- *  - flush_tlb_page(vma, vmaddr) flushes one page
- *  - flush_tlb_range(mm, start, end) flushes a range of pages
- *
- * since the hardware hash table functions as an extension of the
- * tlb as far as the linux tables are concerned, flush it too.
- *    -- Cort
- */
-
-/*
- * Flush all tlb/hash table entries (except perhaps for those
- * mapping RAM starting at PAGE_OFFSET, since they never change).
- */
-void
-local_flush_tlb_all(void)
-{
-	/* aargh!!! */
-	/* just flush the kernel part of the address space, that's
-	   all that the current callers of this require.  -- paulus. */
-	local_flush_tlb_range(&init_mm, TASK_SIZE, ~0UL);
-
-#ifdef CONFIG_SMP
-	smp_send_tlb_invalidate(0);
-#endif /* CONFIG_SMP */
-}
-
-/*
- * Flush all the (user) entries for the address space described
- * by mm.  We can't rely on mm->mmap describing all the entries
- * that might be in the hash table.
- */
-void
-local_flush_tlb_mm(struct mm_struct *mm)
-{
-	if (Hash == 0) {
-		_tlbia();
-		return;
-	}
-
-	if (mm->map_count) {
-		struct vm_area_struct *mp;
-		for (mp = mm->mmap; mp != NULL; mp = mp->vm_next)
-			local_flush_tlb_range(mm, mp->vm_start, mp->vm_end);
-	} else
-		local_flush_tlb_range(mm, 0, TASK_SIZE);
-
-#ifdef CONFIG_SMP
-	smp_send_tlb_invalidate(0);
-#endif	
-}
-
-void
-local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
-{
-	struct mm_struct *mm;
-	pmd_t *pmd;
-	pte_t *pte;
-
-	if (Hash == 0) {
-		_tlbie(vmaddr);
-		return;
-	}
-	mm = (vmaddr < TASK_SIZE)? vma->vm_mm: &init_mm;
-	pmd = pmd_offset(pgd_offset(mm, vmaddr), vmaddr);
-	if (!pmd_none(*pmd)) {
-		pte = pte_offset(pmd, vmaddr);
-		if (pte_val(*pte) & _PAGE_HASHPTE)
-			flush_hash_page(mm->context, vmaddr, pte);
-	}
-#ifdef CONFIG_SMP
-	smp_send_tlb_invalidate(0);
-#endif	
-}
-
-
-/*
- * For each address in the range, find the pte for the address
- * and check _PAGE_HASHPTE bit; if it is set, find and destroy
- * the corresponding HPTE.
- */
-void
-local_flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end)
-{
-	pmd_t *pmd;
-	pte_t *pte;
-	unsigned long pmd_end;
-	unsigned int ctx = mm->context;
-
-	if (Hash == 0) {
-		_tlbia();
-		return;
-	}
-	start &= PAGE_MASK;
-	if (start >= end)
-		return;
-	pmd = pmd_offset(pgd_offset(mm, start), start);
-	do {
-		pmd_end = (start + PGDIR_SIZE) & PGDIR_MASK;
-		if (!pmd_none(*pmd)) {
-			if (!pmd_end || pmd_end > end)
-				pmd_end = end;
-			pte = pte_offset(pmd, start);
-			do {
-				if ((pte_val(*pte) & _PAGE_HASHPTE) != 0)
-					flush_hash_page(ctx, start, pte);
-				start += PAGE_SIZE;
-				++pte;
-			} while (start && start < pmd_end);
-		} else {
-			start = pmd_end;
-		}
-		++pmd;
-	} while (start && start < end);
-
-#ifdef CONFIG_SMP
-	smp_send_tlb_invalidate(0);
-#endif	
-}
-
-/*
- * Set up one of the I/D BAT (block address translation) register pairs.
- * The parameters are not checked; in particular size must be a power
- * of 2 between 128k and 256M.
- */
-void __init setbat(int index, unsigned long virt, unsigned long phys,
-       unsigned int size, int flags)
-{
-	unsigned int bl;
-	int wimgxpp;
-	union ubat *bat = BATS[index];
-
-	bl = (size >> 17) - 1;
-	if ((_get_PVR() >> 16) != 1) {
-		/* 603, 604, etc. */
-		/* Do DBAT first */
-		wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE
-				   | _PAGE_COHERENT | _PAGE_GUARDED);
-		wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX;
-		bat[1].word[0] = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */
-		bat[1].word[1] = phys | wimgxpp;
-#ifndef CONFIG_KGDB /* want user access for breakpoints */
-		if (flags & _PAGE_USER)
-#endif
-			bat[1].bat.batu.vp = 1;
-		if (flags & _PAGE_GUARDED) {
-			/* G bit must be zero in IBATs */
-			bat[0].word[0] = bat[0].word[1] = 0;
-		} else {
-			/* make IBAT same as DBAT */
-			bat[0] = bat[1];
-		}
-	} else {
-		/* 601 cpu */
-		if (bl > BL_8M)
-			bl = BL_8M;
-		wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE
-				   | _PAGE_COHERENT);
-		wimgxpp |= (flags & _PAGE_RW)?
-			((flags & _PAGE_USER)? PP_RWRW: PP_RWXX): PP_RXRX;
-		bat->word[0] = virt | wimgxpp | 4;	/* Ks=0, Ku=1 */
-		bat->word[1] = phys | bl | 0x40;	/* V=1 */
-	}
-
-	bat_addrs[index].start = virt;
-	bat_addrs[index].limit = virt + ((bl + 1) << 17) - 1;
-	bat_addrs[index].phys = phys;
-}
-
-#define IO_PAGE	(_PAGE_NO_CACHE | _PAGE_GUARDED | _PAGE_RW)
-#ifdef CONFIG_SMP
-#define RAM_PAGE (_PAGE_RW|_PAGE_COHERENT)
-#else
-#define RAM_PAGE (_PAGE_RW)
-#endif
-#endif /* CONFIG_8xx */
-
-/*
- * Map in all of physical memory starting at KERNELBASE.
- */
-static void __init mapin_ram(void)
-{
-	unsigned long v, p, s, f;
-
-#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx) && !defined(CONFIG_POWER4)
-	if (!__map_without_bats) {
-		unsigned long tot, bl, done;
-		unsigned long max_size = (256<<20);
-		unsigned long align;
-
-		/* Set up BAT2 and if necessary BAT3 to cover RAM. */
-
-		/* Make sure we don't map a block larger than the
-		   smallest alignment of the physical address. */
-		/* alignment of ram_phys_base */
-		align = ~(ram_phys_base-1) & ram_phys_base;
-		/* set BAT block size to MIN(max_size, align) */
-		if (align && align < max_size)
-			max_size = align;
-
-		tot = total_lowmem;
-		for (bl = 128<<10; bl < max_size; bl <<= 1) {
-			if (bl * 2 > tot)
-				break;
-		}
-
-		setbat(2, KERNELBASE, ram_phys_base, bl, RAM_PAGE);
-		done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1;
-		if ((done < tot) && !bat_addrs[3].limit) {
-			/* use BAT3 to cover a bit more */
-			tot -= done;
-			for (bl = 128<<10; bl < max_size; bl <<= 1)
-				if (bl * 2 > tot)
-					break;
-			setbat(3, KERNELBASE+done, ram_phys_base+done, bl, 
-			       RAM_PAGE);
-		}
-	}
-#endif /* !CONFIG_4xx && !CONFIG_8xx && !CONFIG_POWER4 */
-
-	v = KERNELBASE;
-	p = ram_phys_base;
-	for (s = 0; s < total_lowmem; s += PAGE_SIZE) {
-		/* On the MPC8xx, we want the page shared so we
-		 * don't get ASID compares on kernel space.
-		 */
-		f = _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_SHARED;
-#if defined(CONFIG_KGDB) || defined(CONFIG_XMON)
-		/* Allows stub to set breakpoints everywhere */
-		f |= _PAGE_RW | _PAGE_DIRTY;
-#else
-		if ((char *) v < _stext || (char *) v >= etext)
-			f |= _PAGE_RW | _PAGE_DIRTY;
-#ifndef CONFIG_8xx
-		else
-			/* On the powerpc (not 8xx), no user access
-			   forces R/W kernel access */
-			f |= _PAGE_USER;
-#endif /* CONFIG_8xx */
-#endif /* CONFIG_KGDB */
-		map_page(v, p, f);
-		v += PAGE_SIZE;
-		p += PAGE_SIZE;
-	}
-}
-
-/* This is only called until mem_init is done. */
-void __init *early_get_page(void)
-{
-	void *p;
-
-	if (init_bootmem_done) {
-		p = alloc_bootmem_pages(PAGE_SIZE);
-	} else {
-		p = mem_pieces_find(PAGE_SIZE, PAGE_SIZE);
-	}
-	return p;
-}
-
+/* Free up now-unused memory */
 static void free_sec(unsigned long start, unsigned long end, const char *name)
 {
 	unsigned long cnt = 0;
@@ -725,7 +216,7 @@
 		start += PAGE_SIZE;
  	}
 	if (cnt) {
-		printk(" %ldk %s", PGTOKB(cnt), name);
+		printk(" %ldk %s", cnt << (PAGE_SHIFT - 10), name);
 		totalram_pages += cnt;
 	}
 }
@@ -766,110 +257,54 @@
 #endif
 
 /*
- * Initialize the context management stuff.
+ * Check for command-line options that affect what MMU_init will do.
  */
-static void mmu_context_init(void)
+void MMU_setup(void)
 {
-	context_map[0] = 1;	/* init_mm uses context 0 */
-	next_mmu_context = 1;
-#ifdef FEW_CONTEXTS
-	atomic_set(&nr_free_contexts, LAST_CONTEXT);
-	context_mm[0] = &init_mm;
-#endif /* FEW_CONTEXTS */
-}
-
-#ifdef FEW_CONTEXTS
-/*
- * Steal a context from a task that has one at the moment.
- * This is only used on 8xx and 4xx and we presently assume that
- * they don't do SMP.  If they do then this will have to check
- * whether the MM we steal is in use.
- * We also assume that this is only used on systems that don't
- * use an MMU hash table - this is true for 8xx and 4xx.
- * This isn't an LRU system, it just frees up each context in
- * turn (sort-of pseudo-random replacement :).  This would be the
- * place to implement an LRU scheme if anyone was motivated to do it.
- *  -- paulus
- */
-void steal_context(void)
-{
-	struct mm_struct *mm;
-
-	/* free up context `next_mmu_context' */
-	/* if we shouldn't free context 0, don't... */
-#ifdef CONFIG_4xx
-	if (next_mmu_context == 0)
-		next_mmu_context = 1;
-#endif /* CONFIG_4xx */
-	mm = context_mm[next_mmu_context];
-	flush_tlb_mm(mm);
-	destroy_context(mm);
+	/* Check for nobats option (used in mapin_ram). */
+	if (strstr(cmd_line, "nobats")) {
+		__map_without_bats = 1;
+	}
+
+	/* Look for mem= option on command line */
+	if (strstr(cmd_line, "mem=")) {
+		char *p, *q;
+		unsigned long maxmem = 0;
+
+		for (q = cmd_line; (p = strstr(q, "mem=")) != 0; ) {
+			q = p + 4;
+			if (p > cmd_line && p[-1] != ' ')
+				continue;
+			maxmem = simple_strtoul(q, &q, 0);
+			if (*q == 'k' || *q == 'K') {
+				maxmem <<= 10;
+				++q;
+			} else if (*q == 'm' || *q == 'M') {
+				maxmem <<= 20;
+				++q;
+			}
+		}
+		__max_memory = maxmem;
+	}
 }
-#endif /* FEW_CONTEXTS */
-
-extern boot_infos_t *disp_bi;
 
 /*
- * Do very early mm setup such as finding the size of memory
- * and setting up the hash table.
- * A lot of this is prep/pmac specific but a lot of it could
- * still be merged.
- * -- Cort
+ * MMU_init sets up the basic memory mappings for the kernel,
+ * including both RAM and possibly some I/O regions,
+ * and sets up the page tables and the MMU hardware ready to go.
  */
-#if defined(CONFIG_4xx)
-void __init
-MMU_init(void)
+void __init MMU_init(void)
 {
-	/*
-	 * The Zone Protection Register (ZPR) defines how protection will
-	 * be applied to every page which is a member of a given zone. At
-	 * present, we utilize only two of the 4xx's zones.
-	 * The zone index bits (of ZSEL) in the PTE are used for software
-	 * indicators, except the LSB.  For user access, zone 15 is used,
-	 * for kernel access, zone 14 is used.  We set all but zone 15
-	 * to zero, allowing only kernel access as indicated in the PTE.
-	 * For zone 15, we set a 10 binary (I guess a 01 would work too)
-	 * to allow user access as indicated in the PTE.  This also allows
-	 * kernel access as indicated in the PTE.
-	 */
+	if (ppc_md.progress)
+		ppc_md.progress("MMU:enter", 0x111);
 
-        mtspr(SPRN_ZPR, 0x00000002);
-
-	flush_instruction_cache();
+	/* parse args from command line */
+	MMU_setup();
 
 	/*
-	 * Find the top of physical memory and map all of it in starting
-	 * at KERNELBASE.
+	 * Figure out how much memory we have, how much
+	 * is lowmem, and how much is highmem.
 	 */
-
-        total_memory = total_lowmem = ppc_md.find_end_of_memory();
-	end_of_DRAM = __va(total_lowmem);
-	set_phys_avail(total_lowmem);
-        mapin_ram();
-
-	/*
-	 * Set up the real-mode cache parameters for the exception vector
-	 * handlers (which are run in real-mode).
-	 */
-
-        mtspr(SPRN_DCWR, 0x00000000);	/* All caching is write-back */
-
-        /*
-	 * Cache instruction and data space where the exception
-	 * vectors and the kernel live in real-mode.
-	 */
-
-        mtspr(SPRN_DCCR, 0x80000000);	/* 128 MB of data space at 0x0. */
-        mtspr(SPRN_ICCR, 0x80000000);	/* 128 MB of instr. space at 0x0. */
-
-	mmu_context_init();
-}
-
-#else /* !CONFIG_4xx */
-void __init MMU_init(void)
-{
-	if ( ppc_md.progress ) ppc_md.progress("MMU:enter", 0x111);
-
 	total_memory = ppc_md.find_end_of_memory();
 
 	if (__max_memory && total_memory > __max_memory)
@@ -884,114 +319,54 @@
 	end_of_DRAM = __va(total_lowmem);
 	set_phys_avail(total_lowmem);
 
-#if !defined(CONFIG_8xx)
-	if ( ppc_md.progress ) ppc_md.progress("MMU:hash init", 0x300);
-        hash_init();
-#ifndef CONFIG_PPC64BRIDGE
-        _SDR1 = __pa(Hash) | (Hash_mask >> 10);
-#endif
-	
-	ioremap_base = 0xf8000000;
-#endif /* CONFIG_8xx */
+	/* Initialize the MMU hardware */
+	if (ppc_md.progress)
+		ppc_md.progress("MMU:hw init", 0x300);
+	MMU_init_hw();
 
-	if ( ppc_md.progress ) ppc_md.progress("MMU:mapin", 0x301);
 	/* Map in all of RAM starting at KERNELBASE */
+	if (ppc_md.progress)
+		ppc_md.progress("MMU:mapin", 0x301);
 	mapin_ram();
 
-#if defined(CONFIG_8xx)
-        /* Now map in some of the I/O space that is generically needed
-         * or shared with multiple devices.
-         * All of this fits into the same 4Mbyte region, so it only
-         * requires one page table page.
-         */
-        ioremap(IMAP_ADDR, IMAP_SIZE);
-#ifdef CONFIG_MBX
-        ioremap(NVRAM_ADDR, NVRAM_SIZE);
-        ioremap(MBX_CSR_ADDR, MBX_CSR_SIZE);
-        ioremap(PCI_CSR_ADDR, PCI_CSR_SIZE);
-
-	/* Map some of the PCI/ISA I/O space to get the IDE interface.
-	*/
-        ioremap(PCI_ISA_IO_ADDR, 0x4000);
-        ioremap(PCI_IDE_ADDR, 0x4000);
-#endif
-#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC)
-	ioremap(RPX_CSR_ADDR, RPX_CSR_SIZE);
-#if !defined(CONFIG_PCI)
-	ioremap(_IO_BASE,_IO_BASE_SIZE);
-#endif
-#endif
-#ifdef CONFIG_HTDMSOUND
-	ioremap(HIOX_CSR_ADDR, HIOX_CSR_SIZE);
-#endif
-#ifdef CONFIG_FADS
-	ioremap(BCSR_ADDR, BCSR_SIZE);
-#endif
-#ifdef CONFIG_PCI
-        ioremap(PCI_CSR_ADDR, PCI_CSR_SIZE);
-#endif
-#else /* !CONFIG_8xx */
-	/*
-	 * Setup the bat mappings we're going to load that cover
-	 * the io areas.  RAM was mapped by mapin_ram().
-	 * -- Cort
-	 */
-	if ( ppc_md.progress ) ppc_md.progress("MMU:setbat", 0x302);
-	switch (_machine) {
-	case _MACH_prep:
-		setbat(0, 0x80000000, 0x80000000, 0x10000000, IO_PAGE);
-		setbat(1, 0xf0000000, 0xc0000000, 0x08000000, IO_PAGE);
-		ioremap_base = 0xf0000000;
-		break;
-	case _MACH_chrp:
-		/*
-		 * The code below tends to get removed, please don't take it out.
-		 * The F50 needs this mapping and it you take it out I'll track you
-		 * down and slap your hands.  If it causes problems please email me.
-		 *  -- Cort <cort@fsmlabs.com>
-		 */
-#ifndef CONFIG_POWER3
-		setbat(0, 0x80000000, 0x80000000, 0x10000000, IO_PAGE);
-		setbat(1, 0x90000000, 0x90000000, 0x10000000, IO_PAGE);
-#endif
-		break;
-	case _MACH_Pmac:
-		ioremap_base = 0xfe000000;
-		break;
-	case _MACH_apus:
-		/* Map PPC exception vectors. */
-		setbat(0, 0xfff00000, 0xfff00000, 0x00020000, RAM_PAGE);
-		/* Map chip and ZorroII memory */
-		setbat(1, zTwoBase,   0x00000000, 0x01000000, IO_PAGE);
-		break;
-	case _MACH_gemini:
-		setbat(0, 0xf0000000, 0xf0000000, 0x10000000, IO_PAGE);
-		setbat(1, 0x80000000, 0x80000000, 0x10000000, IO_PAGE);
-		break;
-	case _MACH_8260:
-		/* Map the IMMR, plus anything else we can cover
-		 * in that upper space according to the memory controller
-		 * chip select mapping.  Grab another bunch of space
-		 * below that for stuff we can't cover in the upper.
-		 */
-		setbat(0, 0xf0000000, 0xf0000000, 0x10000000, IO_PAGE);
-		setbat(1, 0xe0000000, 0xe0000000, 0x10000000, IO_PAGE);
-		ioremap_base = 0xe0000000;
-		break;
-	}
+#ifdef CONFIG_HIGHMEM
+	ioremap_base = PKMAP_BASE;
+#else
+	ioremap_base = 0xfe000000UL;	/* for now, could be 0xfffff000 */
+#endif /* CONFIG_HIGHMEM */
 	ioremap_bot = ioremap_base;
-#endif /* CONFIG_8xx */
 
-	if ( ppc_md.progress ) ppc_md.progress("MMU:exit", 0x211);
+	/* Map in I/O resources */
+	if (ppc_md.progress)
+		ppc_md.progress("MMU:setio", 0x302);
+	if (ppc_md.setup_io_mappings)
+		ppc_md.setup_io_mappings();
+
+	/* Initialize the context management stuff */
+	mmu_context_init();
+
+	if (ppc_md.progress)
+		ppc_md.progress("MMU:exit", 0x211);
+
 #ifdef CONFIG_BOOTX_TEXT
 	/* Must be done last, or ppc_md.progress will die */
-	if (_machine == _MACH_Pmac || _machine == _MACH_chrp)
-		map_bootx_text();
+	if (have_of)
+		map_boot_text();
 #endif
+}
 
-	mmu_context_init();
+/* This is only called until mem_init is done. */
+void __init *early_get_page(void)
+{
+	void *p;
+
+	if (init_bootmem_done) {
+		p = alloc_bootmem_pages(PAGE_SIZE);
+	} else {
+		p = mem_pieces_find(PAGE_SIZE, PAGE_SIZE);
+	}
+	return p;
 }
-#endif /* CONFIG_4xx */
 
 /*
  * Initialize the bootmem system and give it all the memory we
@@ -1068,8 +443,6 @@
 
 void __init mem_init(void)
 {
-	extern char *sysmap; 
-	extern unsigned long sysmap_size;
 	unsigned long addr;
 	int codepages = 0;
 	int datapages = 0;
@@ -1094,7 +467,7 @@
 	   make sure the ramdisk pages aren't reserved. */
 	if (initrd_start) {
 		for (addr = initrd_start; addr < initrd_end; addr += PAGE_SIZE)
-			clear_bit(PG_reserved, &virt_to_page(addr)->flags);
+			ClearPageReserved(virt_to_page(addr));
 	}
 #endif /* CONFIG_BLK_DEV_INITRD */
 
@@ -1106,7 +479,7 @@
 		     addr += PAGE_SIZE)
 			SetPageReserved(virt_to_page(addr));
 #endif /* defined(CONFIG_ALL_PPC) */
-	if ( sysmap_size )
+	if ( sysmap )
 		for (addr = (unsigned long)sysmap;
 		     addr < PAGE_ALIGN((unsigned long)sysmap+sysmap_size) ;
 		     addr += PAGE_SIZE)
@@ -1147,133 +520,12 @@
 	       codepages<< (PAGE_SHIFT-10), datapages<< (PAGE_SHIFT-10),
 	       initpages<< (PAGE_SHIFT-10),
 	       (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)));
+	if (sysmap)
+		printk("System.map loaded at 0x%08x for debugger, size: %ld bytes\n",
+			(unsigned int)sysmap, sysmap_size);
 	mem_init_done = 1;
 }
 
-#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
-/*
- * Initialize the hash table and patch the instructions in hashtable.S.
- */
-static void __init hash_init(void)
-{
-	int Hash_bits, mb, mb2;
-	unsigned int hmask, h;
-
-	extern unsigned int hash_page_patch_A[];
-	extern unsigned int hash_page_patch_B[], hash_page_patch_C[];
-	extern unsigned int hash_page[];
-	extern unsigned int flush_hash_patch_A[], flush_hash_patch_B[];
-
-#ifdef CONFIG_PPC64BRIDGE
-	/* The hash table has already been allocated and initialized
-	   in prom.c */
-	Hash_mask = (Hash_size >> 7) - 1;
-	hmask = Hash_mask >> 9;
-	Hash_bits = __ilog2(Hash_size) - 7;
-	mb = 25 - Hash_bits;
-	if (Hash_bits > 16)
-		Hash_bits = 16;
-	mb2 = 25 - Hash_bits;
-
-#else /* CONFIG_PPC64BRIDGE */
-
-	if ( ppc_md.progress ) ppc_md.progress("hash:enter", 0x105);
-	/*
-	 * Allow 64k of hash table for every 16MB of memory,
-	 * up to a maximum of 2MB.
-	 */
-	for (h = 64<<10; h < total_memory / 256 && h < (2<<20); h *= 2)
-		;
-	Hash_size = h;
-	Hash_mask = (h >> 6) - 1;
-	hmask = Hash_mask >> 10;
-	Hash_bits = __ilog2(h) - 6;
-	mb = 26 - Hash_bits;
-	if (Hash_bits > 16)
-		Hash_bits = 16;
-	mb2 = 26 - Hash_bits;
-
-	/* shrink the htab since we don't use it on 603's -- Cort */
-	switch (_get_PVR()>>16) {
-	case 3: /* 603 */
-	case 6: /* 603e */
-	case 7: /* 603ev */
-	case 0x0081: /* 82xx */
-		Hash_size = 0;
-		Hash_mask = 0;
-		break;
-	default:
-	        /* on 601/4 let things be */
-		break;
- 	}
-	
-	if ( ppc_md.progress ) ppc_md.progress("hash:find piece", 0x322);
-	/* Find some memory for the hash table. */
-	if ( Hash_size ) {
-		Hash = mem_pieces_find(Hash_size, Hash_size);
-		cacheable_memzero(Hash, Hash_size);
-		_SDR1 = __pa(Hash) | (Hash_mask >> 10);
-	} else
-		Hash = 0;
-#endif /* CONFIG_PPC64BRIDGE */
-
-	printk("Total memory = %ldMB; using %ldkB for hash table (at %p)\n",
-	       total_memory >> 20, Hash_size >> 10, Hash);
-	if ( Hash_size )
-	{
-		if ( ppc_md.progress ) ppc_md.progress("hash:patch", 0x345);
-		Hash_end = (PTE *) ((unsigned long)Hash + Hash_size);
-
-		/*
-		 * Patch up the instructions in hashtable.S:create_hpte
-		 */
-		hash_page_patch_A[0] = (hash_page_patch_A[0] & ~0xffff)
-			| ((unsigned int)(Hash) >> 16);
-		hash_page_patch_A[1] = (hash_page_patch_A[1] & ~0x7c0)
-			| (mb << 6);
-		hash_page_patch_A[2] = (hash_page_patch_A[2] & ~0x7c0)
-			| (mb2 << 6);
-		hash_page_patch_B[0] = (hash_page_patch_B[0] & ~0xffff)
-			| hmask;
-		hash_page_patch_C[0] = (hash_page_patch_C[0] & ~0xffff)
-			| hmask;
-		/*
-		 * Ensure that the locations we've patched have been written
-		 * out from the data cache and invalidated in the instruction
-		 * cache, on those machines with split caches.
-		 */
-		flush_icache_range((unsigned long) &hash_page_patch_A[0],
-				   (unsigned long) &hash_page_patch_C[1]);
-		/*
-		 * Patch up the instructions in hashtable.S:flush_hash_page
-		 */
-		flush_hash_patch_A[0] = (flush_hash_patch_A[0] & ~0xffff)
-			| ((unsigned int)(Hash) >> 16);
-		flush_hash_patch_A[1] = (flush_hash_patch_A[1] & ~0x7c0)
-			| (mb << 6);
-		flush_hash_patch_A[2] = (flush_hash_patch_A[2] & ~0x7c0)
-			| (mb2 << 6);
-		flush_hash_patch_B[0] = (flush_hash_patch_B[0] & ~0xffff)
-			| hmask;
-		flush_icache_range((unsigned long) &flush_hash_patch_A[0],
-				   (unsigned long) &flush_hash_patch_B[1]);
-	}
-	else {
-		Hash_end = 0;
-		/*
-		 * Put a blr (procedure return) instruction at the
-		 * start of hash_page, since we can still get DSI
-		 * exceptions on a 603.
-		 */
-		hash_page[0] = 0x4e800020;
-		flush_icache_range((unsigned long) &hash_page[0],
-				   (unsigned long) &hash_page[1]);
-	}
-
-	if ( ppc_md.progress ) ppc_md.progress("hash:done", 0x205);
-}
-#endif /* !CONFIG_4xx && !CONFIG_8xx */
-
 /*
  * Set phys_avail to the amount of physical memory,
  * less the kernel text/data/bss.
@@ -1314,12 +566,16 @@
 	/* remove the RTAS pages from the available memory */
 	if (rtas_data)
 		mem_pieces_remove(&phys_avail, rtas_data, rtas_size, 1);
+	/* remove the sysmap pages from the available memory */
+	if (sysmap)
+		mem_pieces_remove(&phys_avail, __pa(sysmap), sysmap_size, 1);
 #endif /* CONFIG_ALL_PPC */
-#ifdef CONFIG_PPC64BRIDGE
-	/* Remove the hash table from the available memory */
-	if (Hash)
-		mem_pieces_remove(&phys_avail, __pa(Hash), Hash_size, 1);
-#endif /* CONFIG_PPC64BRIDGE */
+}
+
+/* Mark some memory as reserved by removing it from phys_avail. */
+void __init reserve_phys_mem(unsigned long start, unsigned long size)
+{
+	mem_pieces_remove(&phys_avail, start, size, 1);
 }
 
 void flush_page_to_ram(struct page *page)
@@ -1328,32 +584,6 @@
 	__flush_page_to_ram(vaddr);
 	kunmap(page);
 }
-
-#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
-/*
- * This is called at the end of handling a user page fault, when the
- * fault has been handled by updating a PTE in the linux page tables.
- * We use it to preload an HPTE into the hash table corresponding to
- * the updated linux PTE.
- */
-void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
-		      pte_t pte)
-{
-	struct mm_struct *mm;
-	pmd_t *pmd;
-	pte_t *ptep;
-	static int nopreload;
-
-	if (Hash == 0 || nopreload)
-		return;
-	mm = (address < TASK_SIZE)? vma->vm_mm: &init_mm;
-	pmd = pmd_offset(pgd_offset(mm, address), address);
-	if (!pmd_none(*pmd)) {
-		ptep = pte_offset(pmd, address);
-		add_hash_page(mm->context, address, ptep);
-	}
-}
-#endif /* !4xx && !8xx */
 
 /*
  * set_pte stores a linux PTE into the linux page table.
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/mm/mmu_context.c linux/arch/ppc/mm/mmu_context.c
--- v2.4.9/linux/arch/ppc/mm/mmu_context.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/mm/mmu_context.c	Tue Aug 28 06:58:33 2001
@@ -0,0 +1,89 @@
+/*
+ * BK Id: %F% %I% %G% %U% %#%
+ */
+/*
+ * This file contains the routines for handling the MMU on those
+ * PowerPC implementations where the MMU substantially follows the
+ * architecture specification.  This includes the 6xx, 7xx, 7xxx,
+ * 8260, and POWER3 implementations but excludes the 8xx and 4xx.
+ * Although the iSeries hardware does comply with the architecture
+ * specification, the need to work through the hypervisor makes
+ * things sufficiently different that it is handled elsewhere.
+ *  -- paulus
+ * 
+ *  Derived from arch/ppc/mm/init.c:
+ *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
+ *
+ *  Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
+ *  and Cort Dougan (PReP) (cort@cs.nmt.edu)
+ *    Copyright (C) 1996 Paul Mackerras
+ *  Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
+ *
+ *  Derived from "arch/i386/mm/init.c"
+ *    Copyright (C) 1991, 1992, 1993, 1994  Linus Torvalds
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+
+#include <asm/mmu_context.h>
+
+mm_context_t next_mmu_context;
+unsigned long context_map[(LAST_CONTEXT+1) / (8*sizeof(unsigned long))];
+#ifdef FEW_CONTEXTS
+atomic_t nr_free_contexts;
+struct mm_struct *context_mm[LAST_CONTEXT+1];
+void steal_context(void);
+#endif /* FEW_CONTEXTS */
+
+/*
+ * Initialize the context management stuff.
+ */
+void __init mmu_context_init(void)
+{
+	/*
+	 * Some processors have too few contexts to reserve one for
+	 * init_mm, and require using context 0 for a normal task.
+	 * Other processors reserve the use of context zero for the kernel.
+	 * This code assumes FIRST_CONTEXT < 32.
+	 */
+	context_map[0] = (1 << FIRST_CONTEXT) - 1;
+	next_mmu_context = FIRST_CONTEXT;
+#ifdef FEW_CONTEXTS
+	atomic_set(&nr_free_contexts, LAST_CONTEXT);
+#endif /* FEW_CONTEXTS */
+}
+
+#ifdef FEW_CONTEXTS
+/*
+ * Steal a context from a task that has one at the moment.
+ * This is only used on 8xx and 4xx and we presently assume that
+ * they don't do SMP.  If they do then this will have to check
+ * whether the MM we steal is in use.
+ * We also assume that this is only used on systems that don't
+ * use an MMU hash table - this is true for 8xx and 4xx.
+ * This isn't an LRU system, it just frees up each context in
+ * turn (sort-of pseudo-random replacement :).  This would be the
+ * place to implement an LRU scheme if anyone was motivated to do it.
+ *  -- paulus
+ */
+void steal_context(void)
+{
+	struct mm_struct *mm;
+
+	/* free up context `next_mmu_context' */
+	/* if we shouldn't free context 0, don't... */
+	if (next_mmu_context < FIRST_CONTEXT)
+		next_mmu_context = FIRST_CONTEXT;
+	mm = context_mm[next_mmu_context];
+	flush_tlb_mm(mm);
+	destroy_context(mm);
+}
+#endif /* FEW_CONTEXTS */
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/mm/mmu_decl.h linux/arch/ppc/mm/mmu_decl.h
--- v2.4.9/linux/arch/ppc/mm/mmu_decl.h	Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/mm/mmu_decl.h	Tue Aug 28 06:58:33 2001
@@ -0,0 +1,73 @@
+/*
+ * BK Id: %F% %I% %G% %U% %#%
+ */
+/*
+ * Declarations of procedures and variables shared between files
+ * in arch/ppc/mm/.
+ * 
+ *  Derived from arch/ppc/mm/init.c:
+ *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
+ *
+ *  Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
+ *  and Cort Dougan (PReP) (cort@cs.nmt.edu)
+ *    Copyright (C) 1996 Paul Mackerras
+ *  Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
+ *
+ *  Derived from "arch/i386/mm/init.c"
+ *    Copyright (C) 1991, 1992, 1993, 1994  Linus Torvalds
+ *
+ *  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.
+ *
+ */
+
+extern void mapin_ram(void);
+extern void bat_mapin_ram(void);
+extern int map_page(unsigned long va, unsigned long pa, int flags);
+extern void setbat(int index, unsigned long virt, unsigned long phys,
+		   unsigned int size, int flags);
+extern void reserve_phys_mem(unsigned long start, unsigned long size);
+
+extern int __map_without_bats;
+extern void *end_of_DRAM;
+extern unsigned long ioremap_base;
+extern unsigned long ioremap_bot;
+extern unsigned int rtas_data, rtas_size;
+
+extern unsigned long total_memory;
+extern unsigned long total_lowmem;
+extern unsigned long ram_phys_base;
+extern int mem_init_done;
+
+extern PTE *Hash, *Hash_end;
+extern unsigned long Hash_size, Hash_mask;
+
+/* ...and now those things that may be slightly different between processor
+ * architectures.  -- Dan
+ */
+#if defined(CONFIG_8xx)
+#define flush_HPTE(X, va, pg)	_tlbie(va)
+#define MMU_init_hw()		do { } while(0)
+
+#elif defined(CONFIG_4xx)
+#define flush_HPTE(X, va, pg)	_tlbie(va)
+
+#else
+/* anything except 4xx or 8xx */
+extern void MMU_init_hw(void);
+
+/* Be careful....this needs to be updated if we ever encounter 603 SMPs,
+ * which includes all new 82xx processors.  We need tlbie/tlbsync here
+ * in that case (I think). -- Dan.
+ */
+static inline void flush_HPTE(unsigned context, unsigned long va, pte_t *pg)
+{
+	if ((Hash != 0) &&
+	    (cur_cpu_spec[0]->cpu_features & CPU_FTR_HPTE_TABLE))
+		flush_hash_page(0, va, pg);
+	else
+		_tlbie(va);
+}
+#endif
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/mm/pgtable.c linux/arch/ppc/mm/pgtable.c
--- v2.4.9/linux/arch/ppc/mm/pgtable.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/mm/pgtable.c	Tue Aug 28 06:58:33 2001
@@ -0,0 +1,360 @@
+/*
+ * BK Id: %F% %I% %G% %U% %#%
+ */
+/*
+ * This file contains the routines setting up the linux page tables.
+ *  -- paulus
+ * 
+ *  Derived from arch/ppc/mm/init.c:
+ *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
+ *
+ *  Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
+ *  and Cort Dougan (PReP) (cort@cs.nmt.edu)
+ *    Copyright (C) 1996 Paul Mackerras
+ *  Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
+ *
+ *  Derived from "arch/i386/mm/init.c"
+ *    Copyright (C) 1991, 1992, 1993, 1994  Linus Torvalds
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/vmalloc.h>
+#include <linux/init.h>
+
+#include <asm/pgtable.h>
+#include <asm/pgalloc.h>
+#include <asm/io.h>
+
+#include "mmu_decl.h"
+
+unsigned long ram_phys_base;
+
+unsigned long ioremap_base;
+unsigned long ioremap_bot;
+int io_bat_index;
+
+#ifndef CONFIG_SMP
+struct pgtable_cache_struct quicklists;
+#endif
+
+#if defined(CONFIG_6xx) || defined(CONFIG_POWER3)
+#define HAVE_BATS	1
+#endif
+
+extern char etext[], _stext[];
+
+#ifdef HAVE_BATS
+extern unsigned long v_mapped_by_bats(unsigned long va);
+extern unsigned long p_mapped_by_bats(unsigned long pa);
+void setbat(int index, unsigned long virt, unsigned long phys,
+	    unsigned int size, int flags);
+
+#else /* !HAVE_BATS */
+#define v_mapped_by_bats(x)	(0UL)
+#define p_mapped_by_bats(x)	(0UL)
+#endif /* HAVE_BATS */
+
+#ifndef CONFIG_PPC_ISERIES
+void *
+ioremap(unsigned long addr, unsigned long size)
+{
+	return __ioremap(addr, size, _PAGE_NO_CACHE);
+}
+
+void *
+__ioremap(unsigned long addr, unsigned long size, unsigned long flags)
+{
+	unsigned long p, v, i;
+	int err;
+
+	/*
+	 * Choose an address to map it to.
+	 * Once the vmalloc system is running, we use it.
+	 * Before then, we use space going down from ioremap_base
+	 * (ioremap_bot records where we're up to).
+	 */
+	p = addr & PAGE_MASK;
+	size = PAGE_ALIGN(addr + size) - p;
+
+	/*
+	 * If the address lies within the first 16 MB, assume it's in ISA
+	 * memory space
+	 */
+	if (p < 16*1024*1024)
+		p += _ISA_MEM_BASE;
+
+	/*
+	 * Don't allow anybody to remap normal RAM that we're using.
+	 * mem_init() sets high_memory so only do the check after that.
+	 */
+	if ( mem_init_done && (p < virt_to_phys(high_memory)) )
+	{
+		printk("__ioremap(): phys addr %0lx is RAM lr %p\n", p,
+		       __builtin_return_address(0));
+		return NULL;
+	}
+
+	if (size == 0)
+		return NULL;
+
+	/*
+	 * Is it already mapped?  Perhaps overlapped by a previous
+	 * BAT mapping.  If the whole area is mapped then we're done,
+	 * otherwise remap it since we want to keep the virt addrs for
+	 * each request contiguous.
+	 *
+	 * We make the assumption here that if the bottom and top
+	 * of the range we want are mapped then it's mapped to the
+	 * same virt address (and this is contiguous).
+	 *  -- Cort
+	 */
+	if ((v = p_mapped_by_bats(p)) /*&& p_mapped_by_bats(p+size-1)*/ )
+		goto out;
+	
+	if (mem_init_done) {
+		struct vm_struct *area;
+		area = get_vm_area(size, VM_IOREMAP);
+		if (area == 0)
+			return NULL;
+		v = VMALLOC_VMADDR(area->addr);
+	} else {
+		v = (ioremap_bot -= size);
+	}
+
+	if ((flags & _PAGE_PRESENT) == 0)
+		flags |= _PAGE_KERNEL;
+	if (flags & _PAGE_NO_CACHE)
+		flags |= _PAGE_GUARDED;
+
+	/*
+	 * Should check if it is a candidate for a BAT mapping
+	 */
+
+	err = 0;
+	for (i = 0; i < size && err == 0; i += PAGE_SIZE)
+		err = map_page(v+i, p+i, flags);
+	if (err) {
+		if (mem_init_done)
+			vfree((void *)v);
+		return NULL;
+	}
+
+out:
+	return (void *) (v + (addr & ~PAGE_MASK));
+}
+
+void iounmap(void *addr)
+{
+	/*
+	 * If mapped by BATs then there is nothing to do.
+	 * Calling vfree() generates a benign warning.
+	 */
+	if (v_mapped_by_bats((unsigned long)addr)) return;
+
+	if (addr > high_memory && (unsigned long) addr < ioremap_bot)
+		vfree((void *) (PAGE_MASK & (unsigned long) addr));
+}
+#endif /* CONFIG_PPC_ISERIES */
+
+int
+map_page(unsigned long va, unsigned long pa, int flags)
+{
+	pmd_t *pd;
+	pte_t *pg;
+	int err = -ENOMEM;
+
+	spin_lock(&init_mm.page_table_lock);
+	/* Use upper 10 bits of VA to index the first level map */
+	pd = pmd_offset(pgd_offset_k(va), va);
+	/* Use middle 10 bits of VA to index the second-level map */
+	pg = pte_alloc(&init_mm, pd, va);
+	if (pg != 0) {
+		err = 0;
+		set_pte(pg, mk_pte_phys(pa & PAGE_MASK, __pgprot(flags)));
+		if (mem_init_done)
+			flush_HPTE(0, va, pg);
+	}
+	spin_unlock(&init_mm.page_table_lock);
+	return err;
+}
+
+/*
+ * Map in all of physical memory starting at KERNELBASE.
+ */
+void __init mapin_ram(void)
+{
+	unsigned long v, p, s, f;
+
+#ifdef HAVE_BATS
+	if (!__map_without_bats)
+		bat_mapin_ram();
+#endif /* HAVE_BATS */
+
+	v = KERNELBASE;
+	p = ram_phys_base;
+	for (s = 0; s < total_lowmem; s += PAGE_SIZE) {
+		/* On the MPC8xx, we want the page shared so we
+		 * don't get ASID compares on kernel space.
+		 */
+		f = _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_SHARED;
+#if defined(CONFIG_KGDB) || defined(CONFIG_XMON)
+		/* Allows stub to set breakpoints everywhere */
+		f |= _PAGE_RW | _PAGE_DIRTY;
+#else
+		if ((char *) v < _stext || (char *) v >= etext)
+			f |= _PAGE_RW | _PAGE_DIRTY;
+#ifndef CONFIG_8xx
+		else
+			/* On the powerpc (not 8xx), no user access
+			   forces R/W kernel access */
+			f |= _PAGE_USER;
+#endif /* CONFIG_8xx */
+#endif /* CONFIG_KGDB */
+		map_page(v, p, f);
+		v += PAGE_SIZE;
+		p += PAGE_SIZE;
+	}
+}
+
+/* is x a power of 2? */
+#define is_power_of_2(x)	((x) != 0 && (((x) & ((x) - 1)) == 0))
+
+/*
+ * Set up a mapping for a block of I/O.
+ * virt, phys, size must all be page-aligned.
+ * This should only be called before ioremap is called.
+ */
+void __init io_block_mapping(unsigned long virt, unsigned long phys,
+			     unsigned int size, int flags)
+{
+	int i;
+
+	if (virt > KERNELBASE && virt < ioremap_bot)
+		ioremap_bot = ioremap_base = virt;
+
+#ifdef HAVE_BATS
+	/*
+	 * Use a BAT for this if possible...
+	 */
+	if (io_bat_index < 2 && is_power_of_2(size)
+	    && (virt & (size - 1)) == 0 && (phys & (size - 1)) == 0) {
+		setbat(io_bat_index, virt, phys, size, flags);
+		++io_bat_index;
+		return;
+	}
+#endif /* HAVE_BATS */
+
+	/* No BATs available, put it in the page tables. */
+	for (i = 0; i < size; i += PAGE_SIZE)
+		map_page(virt + i, phys + i, flags);
+}
+
+/* Scan the real Linux page tables and return a PTE pointer for
+ * a virtual address in a context.
+ * Returns true (1) if PTE was found, zero otherwise.  The pointer to
+ * the PTE pointer is unmodified if PTE is not found.
+ */
+int
+get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep)
+{
+        pgd_t	*pgd;
+        pmd_t	*pmd;
+        pte_t	*pte;
+        int     retval = 0;
+
+        pgd = pgd_offset(mm, addr & PAGE_MASK);
+        if (pgd) {
+                pmd = pmd_offset(pgd, addr & PAGE_MASK);
+                if (pmd_present(*pmd)) {
+                        pte = pte_offset(pmd, addr & PAGE_MASK);
+                        if (pte) {
+				retval = 1;
+				*ptep = pte;
+                        }
+                }
+        }
+        return(retval);
+}
+
+/* Find physical address for this virtual address.  Normally used by
+ * I/O functions, but anyone can call it.
+ */
+unsigned long iopa(unsigned long addr)
+{
+	unsigned long pa;
+
+	/* I don't know why this won't work on PMacs or CHRP.  It
+	 * appears there is some bug, or there is some implicit
+	 * mapping done not properly represented by BATs or in page
+	 * tables.......I am actively working on resolving this, but
+	 * can't hold up other stuff.  -- Dan
+	 */
+	pte_t *pte;
+	struct mm_struct *mm;
+
+	/* Check the BATs */
+	pa = v_mapped_by_bats(addr);
+	if (pa)
+		return pa;
+
+	/* Allow mapping of user addresses (within the thread)
+	 * for DMA if necessary.
+	 */
+	if (addr < TASK_SIZE)
+		mm = current->mm;
+	else
+		mm = &init_mm;
+	
+	pa = 0;
+	if (get_pteptr(mm, addr, &pte))
+		pa = (pte_val(*pte) & PAGE_MASK) | (addr & ~PAGE_MASK);
+
+	return(pa);
+}
+
+/* This is will find the virtual address for a physical one....
+ * Swiped from APUS, could be dangerous :-).
+ * This is only a placeholder until I really find a way to make this
+ * work.  -- Dan
+ */
+unsigned long
+mm_ptov (unsigned long paddr)
+{
+	unsigned long ret;
+#if 0
+	if (paddr < 16*1024*1024)
+		ret = ZTWO_VADDR(paddr);
+	else {
+		int i;
+
+		for (i = 0; i < kmap_chunk_count;){
+			unsigned long phys = kmap_chunks[i++];
+			unsigned long size = kmap_chunks[i++];
+			unsigned long virt = kmap_chunks[i++];
+			if (paddr >= phys
+			    && paddr < (phys + size)){
+				ret = virt + paddr - phys;
+				goto exit;
+			}
+		}
+		
+		ret = (unsigned long) __va(paddr);
+	}
+exit:
+#ifdef DEBUGPV
+	printk ("PTOV(%lx)=%lx\n", paddr, ret);
+#endif
+#else
+	ret = (unsigned long)paddr + KERNELBASE;
+#endif
+	return ret;
+}
+
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/mm/ppc_mmu.c linux/arch/ppc/mm/ppc_mmu.c
--- v2.4.9/linux/arch/ppc/mm/ppc_mmu.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/mm/ppc_mmu.c	Tue Aug 28 06:58:33 2001
@@ -0,0 +1,313 @@
+/*
+ * BK Id: %F% %I% %G% %U% %#%
+ */
+/*
+ * This file contains the routines for handling the MMU on those
+ * PowerPC implementations where the MMU substantially follows the
+ * architecture specification.  This includes the 6xx, 7xx, 7xxx,
+ * 8260, and POWER3 implementations but excludes the 8xx and 4xx.
+ * Although the iSeries hardware does comply with the architecture
+ * specification, the need to work through the hypervisor makes
+ * things sufficiently different that it is handled elsewhere.
+ *  -- paulus
+ * 
+ *  Derived from arch/ppc/mm/init.c:
+ *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
+ *
+ *  Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
+ *  and Cort Dougan (PReP) (cort@cs.nmt.edu)
+ *    Copyright (C) 1996 Paul Mackerras
+ *  Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
+ *
+ *  Derived from "arch/i386/mm/init.c"
+ *    Copyright (C) 1991, 1992, 1993, 1994  Linus Torvalds
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+
+#include <asm/prom.h>
+#include <asm/mmu.h>
+#include <asm/machdep.h>
+
+#include "mmu_decl.h"
+#include "mem_pieces.h"
+
+PTE *Hash, *Hash_end;
+unsigned long Hash_size, Hash_mask;
+unsigned long _SDR1;
+
+union ubat {			/* BAT register values to be loaded */
+	BAT	bat;
+#ifdef CONFIG_PPC64BRIDGE
+	u64	word[2];
+#else
+	u32	word[2];
+#endif	
+} BATS[4][2];			/* 4 pairs of IBAT, DBAT */
+
+struct batrange {		/* stores address ranges mapped by BATs */
+	unsigned long start;
+	unsigned long limit;
+	unsigned long phys;
+} bat_addrs[4];
+
+/*
+ * Return PA for this VA if it is mapped by a BAT, or 0
+ */
+unsigned long v_mapped_by_bats(unsigned long va)
+{
+	int b;
+	for (b = 0; b < 4; ++b)
+		if (va >= bat_addrs[b].start && va < bat_addrs[b].limit)
+			return bat_addrs[b].phys + (va - bat_addrs[b].start);
+	return 0;
+}
+
+/*
+ * Return VA for a given PA or 0 if not mapped
+ */
+unsigned long p_mapped_by_bats(unsigned long pa)
+{
+	int b;
+	for (b = 0; b < 4; ++b)
+		if (pa >= bat_addrs[b].phys
+	    	    && pa < (bat_addrs[b].limit-bat_addrs[b].start)
+		              +bat_addrs[b].phys)
+			return bat_addrs[b].start+(pa-bat_addrs[b].phys);
+	return 0;
+}
+
+void __init bat_mapin_ram(void)
+{
+	unsigned long tot, bl, done;
+	unsigned long max_size = (256<<20);
+	unsigned long align;
+
+	/* Set up BAT2 and if necessary BAT3 to cover RAM. */
+
+	/* Make sure we don't map a block larger than the
+	   smallest alignment of the physical address. */
+	/* alignment of ram_phys_base */
+	align = ~(ram_phys_base-1) & ram_phys_base;
+	/* set BAT block size to MIN(max_size, align) */
+	if (align && align < max_size)
+		max_size = align;
+
+	tot = total_lowmem;
+	for (bl = 128<<10; bl < max_size; bl <<= 1) {
+		if (bl * 2 > tot)
+			break;
+	}
+
+	setbat(2, KERNELBASE, ram_phys_base, bl, _PAGE_KERNEL);
+	done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1;
+	if ((done < tot) && !bat_addrs[3].limit) {
+		/* use BAT3 to cover a bit more */
+		tot -= done;
+		for (bl = 128<<10; bl < max_size; bl <<= 1)
+			if (bl * 2 > tot)
+				break;
+		setbat(3, KERNELBASE+done, ram_phys_base+done, bl, 
+		       _PAGE_KERNEL);
+	}
+}
+
+/*
+ * Set up one of the I/D BAT (block address translation) register pairs.
+ * The parameters are not checked; in particular size must be a power
+ * of 2 between 128k and 256M.
+ */
+void __init setbat(int index, unsigned long virt, unsigned long phys,
+		   unsigned int size, int flags)
+{
+	unsigned int bl;
+	int wimgxpp;
+	union ubat *bat = BATS[index];
+
+#ifdef CONFIG_SMP
+	if ((flags & _PAGE_NO_CACHE) == 0)
+		flags |= _PAGE_COHERENT;
+#endif
+	bl = (size >> 17) - 1;
+	if (PVR_VER(mfspr(PVR)) != 1) {
+		/* 603, 604, etc. */
+		/* Do DBAT first */
+		wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE
+				   | _PAGE_COHERENT | _PAGE_GUARDED);
+		wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX;
+		bat[1].word[0] = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */
+		bat[1].word[1] = phys | wimgxpp;
+#ifndef CONFIG_KGDB /* want user access for breakpoints */
+		if (flags & _PAGE_USER)
+#endif
+			bat[1].bat.batu.vp = 1;
+		if (flags & _PAGE_GUARDED) {
+			/* G bit must be zero in IBATs */
+			bat[0].word[0] = bat[0].word[1] = 0;
+		} else {
+			/* make IBAT same as DBAT */
+			bat[0] = bat[1];
+		}
+	} else {
+		/* 601 cpu */
+		if (bl > BL_8M)
+			bl = BL_8M;
+		wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE
+				   | _PAGE_COHERENT);
+		wimgxpp |= (flags & _PAGE_RW)?
+			((flags & _PAGE_USER)? PP_RWRW: PP_RWXX): PP_RXRX;
+		bat->word[0] = virt | wimgxpp | 4;	/* Ks=0, Ku=1 */
+		bat->word[1] = phys | bl | 0x40;	/* V=1 */
+	}
+
+	bat_addrs[index].start = virt;
+	bat_addrs[index].limit = virt + ((bl + 1) << 17) - 1;
+	bat_addrs[index].phys = phys;
+}
+
+/*
+ * Initialize the hash table and patch the instructions in hashtable.S.
+ */
+void __init MMU_init_hw(void)
+{
+	int Hash_bits, mb, mb2;
+	unsigned int hmask;
+
+	extern unsigned int hash_page_patch_A[];
+	extern unsigned int hash_page_patch_B[], hash_page_patch_C[];
+	extern unsigned int hash_page[];
+	extern unsigned int flush_hash_patch_A[], flush_hash_patch_B[];
+
+#ifdef CONFIG_PPC64BRIDGE
+	/* The hash table has already been allocated and initialized
+	   in prom.c */
+	Hash_mask = (Hash_size >> 7) - 1;
+	hmask = Hash_mask >> 9;
+	Hash_bits = __ilog2(Hash_size) - 7;
+	mb = 25 - Hash_bits;
+	if (Hash_bits > 16)
+		Hash_bits = 16;
+	mb2 = 25 - Hash_bits;
+
+	/* Remove the hash table from the available memory */
+	if (Hash)
+		reserve_phys_mem(__pa(Hash), Hash_size);
+
+#else /* CONFIG_PPC64BRIDGE */
+	unsigned int h;
+
+	if ((cur_cpu_spec[0]->cpu_features & CPU_FTR_HPTE_TABLE) == 0)
+		return;
+	if ( ppc_md.progress ) ppc_md.progress("hash:enter", 0x105);
+	/*
+	 * Allow 64k of hash table for every 16MB of memory,
+	 * up to a maximum of 2MB.
+	 */
+	for (h = 64<<10; h < total_memory / 256 && h < (2<<20); h *= 2)
+		;
+	Hash_size = h;
+	Hash_mask = (h >> 6) - 1;
+	hmask = Hash_mask >> 10;
+	Hash_bits = __ilog2(h) - 6;
+	mb = 26 - Hash_bits;
+	if (Hash_bits > 16)
+		Hash_bits = 16;
+	mb2 = 26 - Hash_bits;
+
+	if ( ppc_md.progress ) ppc_md.progress("hash:find piece", 0x322);
+	/* Find some memory for the hash table. */
+	if ( Hash_size ) {
+		Hash = mem_pieces_find(Hash_size, Hash_size);
+		cacheable_memzero(Hash, Hash_size);
+		_SDR1 = __pa(Hash) | (Hash_mask >> 10);
+	} else
+		Hash = 0;
+#endif /* CONFIG_PPC64BRIDGE */
+
+	printk("Total memory = %ldMB; using %ldkB for hash table (at %p)\n",
+	       total_memory >> 20, Hash_size >> 10, Hash);
+	if (Hash_size) {
+		if ( ppc_md.progress ) ppc_md.progress("hash:patch", 0x345);
+		Hash_end = (PTE *) ((unsigned long)Hash + Hash_size);
+
+		/*
+		 * Patch up the instructions in hashtable.S:create_hpte
+		 */
+		hash_page_patch_A[0] = (hash_page_patch_A[0] & ~0xffff)
+			| ((unsigned int)(Hash) >> 16);
+		hash_page_patch_A[1] = (hash_page_patch_A[1] & ~0x7c0)
+			| (mb << 6);
+		hash_page_patch_A[2] = (hash_page_patch_A[2] & ~0x7c0)
+			| (mb2 << 6);
+		hash_page_patch_B[0] = (hash_page_patch_B[0] & ~0xffff)
+			| hmask;
+		hash_page_patch_C[0] = (hash_page_patch_C[0] & ~0xffff)
+			| hmask;
+		/*
+		 * Ensure that the locations we've patched have been written
+		 * out from the data cache and invalidated in the instruction
+		 * cache, on those machines with split caches.
+		 */
+		flush_icache_range((unsigned long) &hash_page_patch_A[0],
+				   (unsigned long) &hash_page_patch_C[1]);
+		/*
+		 * Patch up the instructions in hashtable.S:flush_hash_page
+		 */
+		flush_hash_patch_A[0] = (flush_hash_patch_A[0] & ~0xffff)
+			| ((unsigned int)(Hash) >> 16);
+		flush_hash_patch_A[1] = (flush_hash_patch_A[1] & ~0x7c0)
+			| (mb << 6);
+		flush_hash_patch_A[2] = (flush_hash_patch_A[2] & ~0x7c0)
+			| (mb2 << 6);
+		flush_hash_patch_B[0] = (flush_hash_patch_B[0] & ~0xffff)
+			| hmask;
+		flush_icache_range((unsigned long) &flush_hash_patch_A[0],
+				   (unsigned long) &flush_hash_patch_B[1]);
+	}
+	else {
+		Hash_end = 0;
+		/*
+		 * Put a blr (procedure return) instruction at the
+		 * start of hash_page, since we can still get DSI
+		 * exceptions on a 603.
+		 */
+		hash_page[0] = 0x4e800020;
+		flush_icache_range((unsigned long) &hash_page[0],
+				   (unsigned long) &hash_page[1]);
+	}
+
+	if ( ppc_md.progress ) ppc_md.progress("hash:done", 0x205);
+}
+
+/*
+ * This is called at the end of handling a user page fault, when the
+ * fault has been handled by updating a PTE in the linux page tables.
+ * We use it to preload an HPTE into the hash table corresponding to
+ * the updated linux PTE.
+ */
+void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
+		      pte_t pte)
+{
+	struct mm_struct *mm;
+	pmd_t *pmd;
+	pte_t *ptep;
+	static int nopreload;
+
+	if (Hash == 0 || nopreload)
+		return;
+	mm = (address < TASK_SIZE)? vma->vm_mm: &init_mm;
+	pmd = pmd_offset(pgd_offset(mm, address), address);
+	if (!pmd_none(*pmd)) {
+		ptep = pte_offset(pmd, address);
+		add_hash_page(mm->context, address, ptep);
+	}
+}
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/mm/tlb.c linux/arch/ppc/mm/tlb.c
--- v2.4.9/linux/arch/ppc/mm/tlb.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/mm/tlb.c	Tue Aug 28 06:58:33 2001
@@ -0,0 +1,162 @@
+/*
+ * BK Id: %F% %I% %G% %U% %#%
+ */
+/*
+ * This file contains the routines for TLB flushing.
+ * On machines where the MMU uses a hash table to store virtual to
+ * physical translations, these routines flush entries from the the
+ * hash table also.
+ *  -- paulus
+ * 
+ *  Derived from arch/ppc/mm/init.c:
+ *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
+ *
+ *  Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
+ *  and Cort Dougan (PReP) (cort@cs.nmt.edu)
+ *    Copyright (C) 1996 Paul Mackerras
+ *  Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
+ *
+ *  Derived from "arch/i386/mm/init.c"
+ *    Copyright (C) 1991, 1992, 1993, 1994  Linus Torvalds
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+
+#include "mmu_decl.h"
+
+/*
+ * TLB flushing:
+ *
+ *  - flush_tlb_all() flushes all processes TLBs
+ *  - flush_tlb_mm(mm) flushes the specified mm context TLB's
+ *  - flush_tlb_page(vma, vmaddr) flushes one page
+ *  - flush_tlb_range(mm, start, end) flushes a range of pages
+ *
+ * since the hardware hash table functions as an extension of the
+ * tlb as far as the linux tables are concerned, flush it too.
+ *    -- Cort
+ */
+
+/*
+ * Flush all tlb/hash table entries (except perhaps for those
+ * mapping RAM starting at PAGE_OFFSET, since they never change).
+ */
+void
+local_flush_tlb_all(void)
+{
+	/* aargh!!! */
+	/*
+	 * Just flush the kernel part of the address space, that's
+	 * all that the current callers of this require.
+	 * Eventually I hope to persuade the powers that be that
+	 * we can and should dispense with flush_tlb_all().
+	 *  -- paulus.
+	 */
+	local_flush_tlb_range(&init_mm, TASK_SIZE, ~0UL);
+
+#ifdef CONFIG_SMP
+	smp_send_tlb_invalidate(0);
+#endif /* CONFIG_SMP */
+}
+
+/*
+ * Flush all the (user) entries for the address space described
+ * by mm.  We can't rely on mm->mmap describing all the entries
+ * that might be in the hash table.
+ */
+void
+local_flush_tlb_mm(struct mm_struct *mm)
+{
+	if (Hash == 0) {
+		_tlbia();
+		return;
+	}
+
+	if (mm->map_count) {
+		struct vm_area_struct *mp;
+		for (mp = mm->mmap; mp != NULL; mp = mp->vm_next)
+			local_flush_tlb_range(mm, mp->vm_start, mp->vm_end);
+	} else
+		local_flush_tlb_range(mm, 0, TASK_SIZE);
+
+#ifdef CONFIG_SMP
+	smp_send_tlb_invalidate(0);
+#endif	
+}
+
+void
+local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
+{
+	struct mm_struct *mm;
+	pmd_t *pmd;
+	pte_t *pte;
+
+	if (Hash == 0) {
+		_tlbie(vmaddr);
+		return;
+	}
+	mm = (vmaddr < TASK_SIZE)? vma->vm_mm: &init_mm;
+	pmd = pmd_offset(pgd_offset(mm, vmaddr), vmaddr);
+	if (!pmd_none(*pmd)) {
+		pte = pte_offset(pmd, vmaddr);
+		if (pte_val(*pte) & _PAGE_HASHPTE)
+			flush_hash_page(mm->context, vmaddr, pte);
+	}
+#ifdef CONFIG_SMP
+	smp_send_tlb_invalidate(0);
+#endif	
+}
+
+
+/*
+ * For each address in the range, find the pte for the address
+ * and check _PAGE_HASHPTE bit; if it is set, find and destroy
+ * the corresponding HPTE.
+ */
+void
+local_flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end)
+{
+	pmd_t *pmd;
+	pte_t *pte;
+	unsigned long pmd_end;
+	unsigned int ctx = mm->context;
+
+	if (Hash == 0) {
+		_tlbia();
+		return;
+	}
+	start &= PAGE_MASK;
+	if (start >= end)
+		return;
+	pmd = pmd_offset(pgd_offset(mm, start), start);
+	do {
+		pmd_end = (start + PGDIR_SIZE) & PGDIR_MASK;
+		if (!pmd_none(*pmd)) {
+			if (!pmd_end || pmd_end > end)
+				pmd_end = end;
+			pte = pte_offset(pmd, start);
+			do {
+				if ((pte_val(*pte) & _PAGE_HASHPTE) != 0)
+					flush_hash_page(ctx, start, pte);
+				start += PAGE_SIZE;
+				++pte;
+			} while (start && start < pmd_end);
+		} else {
+			start = pmd_end;
+		}
+		++pmd;
+	} while (start && start < end);
+
+#ifdef CONFIG_SMP
+	smp_send_tlb_invalidate(0);
+#endif	
+}
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/vmlinux.lds linux/arch/ppc/vmlinux.lds
--- v2.4.9/linux/arch/ppc/vmlinux.lds	Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/vmlinux.lds	Tue Aug 28 06:58:33 2001
@@ -70,6 +70,10 @@
   __ksymtab : { *(__ksymtab) }
   __stop___ksymtab = .;
 
+  __start___ftr_fixup = .;
+  __ftr_fixup : { *(__ftr_fixup) }
+  __stop___ftr_fixup = .;
+
   . = ALIGN(32);
   .data.cacheline_aligned : { *(.data.cacheline_aligned) }
 
diff -u --recursive --new-file v2.4.9/linux/arch/ppc/xmon/start.c linux/arch/ppc/xmon/start.c
--- v2.4.9/linux/arch/ppc/xmon/start.c	Mon May 21 17:04:47 2001
+++ linux/arch/ppc/xmon/start.c	Tue Aug 28 06:58:33 2001
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.start.c 1.12 05/21/01 21:39:13 paulus
+ * BK Id: SCCS/s.start.c 1.16 08/20/01 22:17:58 paulus
  */
 /*
  * Copyright (C) 1996 Paul Mackerras.
@@ -18,6 +18,7 @@
 #include <asm/feature.h>
 #include <asm/processor.h>
 #include <asm/delay.h>
+#include <asm/btext.h>
 #ifdef CONFIG_SMP
 #include <asm/bitops.h>
 #endif
@@ -25,8 +26,6 @@
 static volatile unsigned char *sccc, *sccd;
 unsigned long TXRDY, RXRDY;
 extern void xmon_printf(const char *fmt, ...);
-extern void prom_drawchar(char);
-extern void prom_drawstring(const char *str);
 static int xmon_expect(const char *str, unsigned int timeout);
 
 static int console;
@@ -56,6 +55,7 @@
 void
 xmon_map_scc(void)
 {
+#ifdef CONFIG_ALL_PPC
 	volatile unsigned char *base;
 
 	use_screen = 0;
@@ -85,14 +85,34 @@
 				use_screen = 1;
 #endif
 		}
-		prom_drawstring("xmon uses ");
+		if (!use_screen && (np = find_devices("escc")) != NULL) {
+			/*
+			 * look for the device node for the serial port
+			 * we're using and see if it says it has a modem
+			 */
+			char *name = xmon_use_sccb? "ch-b": "ch-a";
+			char *slots;
+			int l;
+
+			np = np->child;
+			while (np != NULL && strcmp(np->name, name) != 0)
+				np = np->sibling;
+			if (np != NULL) {
+				/* XXX should parse this properly */
+				slots = get_property(np, "slot-names", &l);
+				if (slots != NULL && l >= 10
+				    && strcmp(slots+4, "Modem") == 0)
+					via_modem = 1;
+			}
+		}
+		btext_drawstring("xmon uses ");
 		if (use_screen)
-			prom_drawstring("screen and keyboard\n");
+			btext_drawstring("screen and keyboard\n");
 		else {
 			if (via_modem)
-				prom_drawstring("modem on ");
-			prom_drawstring(xmon_use_sccb? "printer": "modem");
-			prom_drawstring(" port\n");
+				btext_drawstring("modem on ");
+			btext_drawstring(xmon_use_sccb? "printer": "modem");
+			btext_drawstring(" port\n");
 		}
 
 #endif /* CONFIG_BOOTX_TEXT */
@@ -114,15 +134,6 @@
 		sccc = base + (addr & ~PAGE_MASK);
 		sccd = sccc + 0x10;
 	}
-	else if ( _machine & _MACH_gemini )
-	{
-		/* should already be mapped by the kernel boot */
-		sccc = (volatile unsigned char *) 0xffeffb0d;
-		sccd = (volatile unsigned char *) 0xffeffb08;
-		TXRDY = 0x20;
-		RXRDY = 1;
-		console = 1;
-	}
 	else
 	{
 		/* should already be mapped by the kernel boot */
@@ -135,6 +146,14 @@
 		TXRDY = 0x20;
 		RXRDY = 1;
 	}
+#elif defined(CONFIG_GEMINI)
+	/* should already be mapped by the kernel boot */
+	sccc = (volatile unsigned char *) 0xffeffb0d;
+	sccd = (volatile unsigned char *) 0xffeffb08;
+	TXRDY = 0x20;
+	RXRDY = 1;
+	console = 1;
+#endif /* platform */
 }
 
 static int scc_initialized = 0;
@@ -175,7 +194,7 @@
 	if (use_screen) {
 		/* write it on the screen */
 		for (i = 0; i < nb; ++i)
-			prom_drawchar(*p++);
+			btext_drawchar(*p++);
 		goto out;
 	}
 #endif
@@ -216,7 +235,7 @@
 
 static unsigned char xmon_keytab[128] =
 	"asdfhgzxcv\000bqwer"				/* 0x00 - 0x0f */
-	"yt123465=97-80o]"				/* 0x10 - 0x1f */
+	"yt123465=97-80]o"				/* 0x10 - 0x1f */
 	"u[ip\rlj'k;\\,/nm."				/* 0x20 - 0x2f */
 	"\t `\177\0\033\0\0\0\0\0\0\0\0\0\0"		/* 0x30 - 0x3f */
 	"\0.\0*\0+\0\0\0\0\0/\r\0-\0"			/* 0x40 - 0x4f */
@@ -224,7 +243,7 @@
 
 static unsigned char xmon_shift_keytab[128] =
 	"ASDFHGZXCV\000BQWER"				/* 0x00 - 0x0f */
-	"YT!@#$^%+(&=*)}O"				/* 0x10 - 0x1f */
+	"YT!@#$^%+(&_*)}O"				/* 0x10 - 0x1f */
 	"U{IP\rLJ\"K:|<?NM>"				/* 0x20 - 0x2f */
 	"\t ~\177\0\033\0\0\0\0\0\0\0\0\0\0"		/* 0x30 - 0x3f */
 	"\0.\0*\0+\0\0\0\0\0/\r\0-\0"			/* 0x40 - 0x4f */
@@ -243,15 +262,15 @@
 		do {
 			if (--t < 0) {
 				on = 1 - on;
-				prom_drawchar(on? 0xdb: 0x20);
-				prom_drawchar('\b');
+				btext_drawchar(on? 0xdb: 0x20);
+				btext_drawchar('\b');
 				t = 200000;
 			}
 			do_poll_adb();
 		} while (xmon_adb_keycode == -1);
 		k = xmon_adb_keycode;
 		if (on)
-			prom_drawstring(" \b");
+			btext_drawstring(" \b");
 
 		/* test for shift keys */
 		if ((k & 0x7f) == 0x38 || (k & 0x7f) == 0x7b) {
@@ -544,7 +563,9 @@
 xmon_enter(void)
 {
 #ifdef CONFIG_ADB_PMU
-	pmu_suspend();
+	if (_machine == _MACH_Pmac) {
+		pmu_suspend();
+	}
 #endif
 }
 
@@ -552,6 +573,8 @@
 xmon_leave(void)
 {
 #ifdef CONFIG_ADB_PMU
-	pmu_resume();
+	if (_machine == _MACH_Pmac) {
+		pmu_resume();
+	}
 #endif
 }
diff -u --recursive --new-file v2.4.9/linux/arch/s390/kernel/init_task.c linux/arch/s390/kernel/init_task.c
--- v2.4.9/linux/arch/s390/kernel/init_task.c	Fri May 12 11:41:44 2000
+++ linux/arch/s390/kernel/init_task.c	Mon Sep 17 15:29:09 2001
@@ -12,7 +12,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct vm_area_struct init_mmap = INIT_MMAP;
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
 static struct signal_struct init_signals = INIT_SIGNALS;
diff -u --recursive --new-file v2.4.9/linux/arch/s390/kernel/ptrace.c linux/arch/s390/kernel/ptrace.c
--- v2.4.9/linux/arch/s390/kernel/ptrace.c	Wed Jul 25 17:10:18 2001
+++ linux/arch/s390/kernel/ptrace.c	Tue Sep 18 16:58:03 2001
@@ -202,6 +202,17 @@
 	return(0);
 }
 
+/*
+ * Called by kernel/ptrace.c when detaching..
+ *
+ * Make sure single step bits etc are not set.
+ */
+void ptrace_disable(struct task_struct *child)
+{
+	/* make sure the single step bit is not set. */
+	clear_single_step(child);
+}
+
 asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 {
 	struct task_struct *child;
@@ -327,20 +338,7 @@
 		break;
 
 	case PTRACE_DETACH:  /* detach a process that was attached. */
-		ret = -EIO;
-		if ((unsigned long) data >= _NSIG)
-			break;
-		child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
-		child->exit_code = data;
-		write_lock_irqsave(&tasklist_lock, flags);
-		REMOVE_LINKS(child);
-		child->p_pptr = child->p_opptr;
-		SET_LINKS(child);
-		write_unlock_irqrestore(&tasklist_lock, flags);
-		/* make sure the single step bit is not set. */
-		clear_single_step(child);
-		wake_up_process(child);
-		ret = 0;
+		ret = ptrace_detach(child, data);
 		break;
 	case PTRACE_PEEKUSR_AREA:
 	case PTRACE_POKEUSR_AREA:
diff -u --recursive --new-file v2.4.9/linux/arch/s390/mm/init.c linux/arch/s390/mm/init.c
--- v2.4.9/linux/arch/s390/mm/init.c	Thu Apr 26 14:10:16 2001
+++ linux/arch/s390/mm/init.c	Thu Sep 20 20:02:03 2001
@@ -35,6 +35,9 @@
 #include <asm/pgalloc.h>
 #include <asm/dma.h>
 #include <asm/lowcore.h>
+#include <asm/tlb.h>
+
+mmu_gather_t mmu_gathers[NR_CPUS];
 
 static unsigned long totalram_pages;
 
diff -u --recursive --new-file v2.4.9/linux/arch/s390x/kernel/init_task.c linux/arch/s390x/kernel/init_task.c
--- v2.4.9/linux/arch/s390x/kernel/init_task.c	Tue Feb 13 14:13:44 2001
+++ linux/arch/s390x/kernel/init_task.c	Mon Sep 17 15:29:09 2001
@@ -12,7 +12,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
-static struct vm_area_struct init_mmap = INIT_MMAP;
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
 static struct signal_struct init_signals = INIT_SIGNALS;
diff -u --recursive --new-file v2.4.9/linux/arch/s390x/kernel/ptrace.c linux/arch/s390x/kernel/ptrace.c
--- v2.4.9/linux/arch/s390x/kernel/ptrace.c	Wed Jul 25 17:10:19 2001
+++ linux/arch/s390x/kernel/ptrace.c	Tue Sep 18 16:56:19 2001
@@ -216,6 +216,17 @@
 	return(0);
 }
 
+/*
+ * Called by kernel/ptrace.c when detaching..
+ *
+ * Make sure single step bits etc are not set.
+ */
+void ptrace_disable(struct task_struct *child)
+{
+	/* make sure the single step bit is not set. */
+	clear_single_step(child);
+}
+
 asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 {
 	struct task_struct *child;
@@ -341,21 +352,9 @@
 		break;
 
 	case PTRACE_DETACH:  /* detach a process that was attached. */
-		ret = -EIO;
-		if ((unsigned long) data >= _NSIG)
-			break;
-		child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
-		child->exit_code = data;
-		write_lock_irqsave(&tasklist_lock, flags);
-		REMOVE_LINKS(child);
-		child->p_pptr = child->p_opptr;
-		SET_LINKS(child);
-		write_unlock_irqrestore(&tasklist_lock, flags);
-		/* make sure the single step bit is not set. */
-		clear_single_step(child);
-		wake_up_process(child);
-		ret = 0;
+		ret = ptrace_detach(child, data);
 		break;
+
 	case PTRACE_PEEKUSR_AREA:
 	case PTRACE_POKEUSR_AREA:
 		if((ret=copy_from_user(&parea,(void *)addr,sizeof(parea)))==0)  
diff -u --recursive --new-file v2.4.9/linux/arch/s390x/mm/init.c linux/arch/s390x/mm/init.c
--- v2.4.9/linux/arch/s390x/mm/init.c	Thu Apr 26 14:10:16 2001
+++ linux/arch/s390x/mm/init.c	Thu Sep 20 20:02:03 2001
@@ -35,6 +35,9 @@
 #include <asm/pgalloc.h>
 #include <asm/dma.h>
 #include <asm/lowcore.h>
+#include <asm/tlb.h>
+ 
+mmu_gather_t mmu_gathers[NR_CPUS];
 
 static unsigned long totalram_pages;
 
diff -u --recursive --new-file v2.4.9/linux/arch/sh/Makefile linux/arch/sh/Makefile
--- v2.4.9/linux/arch/sh/Makefile	Fri Dec 29 14:07:20 2000
+++ linux/arch/sh/Makefile	Sat Sep  8 12:29:09 2001
@@ -75,6 +75,11 @@
 
 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_GENERIC)$(CONFIG_SH_STB1_HARP)$(CONFIG_SH_STB1_OVERDRIVE),)
+SUBDIRS += arch/sh/stboards
+CORE_FILES += arch/sh/stboards/stboards.o
+endif
+
 vmlinux: arch/sh/vmlinux.lds
 
 arch/sh/vmlinux.lds: arch/sh/vmlinux.lds.S FORCE
@@ -93,6 +98,7 @@
 archclean:
 	@$(MAKEBOOT) clean
 	$(MAKE) -C arch/$(ARCH)/kernel clean
+	$(MAKE) -C arch/$(ARCH)/stboards clean
 #	$(MAKE) -C arch/$(ARCH)/tools clean
 
 archmrproper:
diff -u --recursive --new-file v2.4.9/linux/arch/sh/config.in linux/arch/sh/config.in
--- v2.4.9/linux/arch/sh/config.in	Tue Jul  3 17:08:18 2001
+++ linux/arch/sh/config.in	Sat Sep  8 12:29:09 2001
@@ -42,6 +42,7 @@
 	 CAT68701		CONFIG_SH_CAT68701		\
 	 BigSur			CONFIG_SH_BIGSUR		\
 	 SH2000			CONFIG_SH_SH2000		\
+	 ADX			CONFIG_SH_ADX			\
 	 BareCPU		CONFIG_SH_UNKNOWN" Generic
 
 # The SH7750 RTC module is disabled in the Dreamcast
@@ -88,24 +89,40 @@
    define_bool CONFIG_CPU_SH4 y
 fi
 bool 'Little Endian' CONFIG_CPU_LITTLE_ENDIAN
+# Platform-specific memory start and size definitions
 if [ "$CONFIG_SH_SOLUTION_ENGINE" = "y" -o "$CONFIG_SH_HP600" = "y" -o \
      "$CONFIG_SH_BIGSUR" = "y" -o "$CONFIG_SH_7751_SOLUTION_ENGINE" = "y" -o \
      "$CONFIG_SH_DREAMCAST" = "y" -o "$CONFIG_SH_SH2000" = "y" ]; then
-  define_hex CONFIG_MEMORY_START 0c000000
-else
-  if [ "$CONFIG_CPU_SUBTYPE_ST40STB1" = "y" ]; then
-    bool 'Memory on LMI' CONFIG_ST40_LMI_MEMORY
-    if [ "$CONFIG_ST40_LMI_MEMORY" = "y" ] ; then
+   define_hex CONFIG_MEMORY_START 0c000000
+   define_hex CONFIG_MEMORY_SIZE 00400000
+   define_bool CONFIG_MEMORY_SET y
+fi
+if [ "$CONFIG_CPU_SUBTYPE_ST40STB1" = "y" ]; then
+   bool 'Memory on LMI' CONFIG_ST40_LMI_MEMORY
+   if [ "$CONFIG_ST40_LMI_MEMORY" = "y" ] ; then
       define_hex CONFIG_MEMORY_START 08000000
-    else
-      hex 'EMI physical memory start address' CONFIG_MEMORY_START 08000000
-    fi
-  else
-    hex 'Physical memory start address' CONFIG_MEMORY_START 08000000
-  fi
+      define_hex CONFIG_MEMORY_SIZE 00400000
+      define_bool CONFIG_MEMORY_SET y
+   fi
+fi
+if [ "$CONFIG_SH_ADX" = "y" ]; then
+   define_hex CONFIG_MEMORY_START 08000000
+   define_hex CONFIG_MEMORY_SIZE 00400000
+   define_bool CONFIG_MEMORY_SET y
+fi
+# If none of the above have set memory start/size, ask the user.
+if [ "$CONFIG_MEMORY_SET" != "y" ]; then
+   hex 'Physical memory start address' CONFIG_MEMORY_START 08000000
+   hex 'Physical memory size' CONFIG_MEMORY_SIZE 00400000
 fi
 endmenu
 
+if [ "$CONFIG_SH_HP690" = "y" ]; then
+  define_bool CONFIG_DISCONTIGMEM y
+else
+  define_bool CONFIG_DISCONTIGMEM n
+fi
+
 mainmenu_option next_comment
 comment 'General setup'
 
@@ -120,10 +137,23 @@
 bool 'Networking support' CONFIG_NET
 
 if [ "$CONFIG_SH_GENERIC" = "y" -o "$CONFIG_SH_SOLUTION_ENGINE" = "y" -o \
-     "$CONFIG_SH_UNKNOWN" = "y" -o "$CONFIG_SH_CAT68701" = "y" ]; then
+     "$CONFIG_SH_UNKNOWN" = "y" -o "$CONFIG_SH_CAT68701" = "y" -o \
+     "$CONFIG_SH_ADX" = "y" ]; then
   bool 'Compact Flash Enabler support' CONFIG_CF_ENABLER
 fi
 
+if [ "$CONFIG_CF_ENABLER" = "y" ]; then
+   choice 'Compact Flash Connection Area' \
+	"Area5 CONFIG_CF_AREA5 \
+	 Area6 CONFIG_CF_AREA6" Area6
+   if [ "$CONFIG_CF_AREA5" = "y" ]; then
+      define_hex CONFIG_CF_BASE_ADDR b4000000
+   fi
+   if [ "$CONFIG_CF_AREA6" = "y" ]; then
+      define_hex CONFIG_CF_BASE_ADDR b8000000
+   fi
+fi
+
 bool 'Hitachi HD64461 companion chip support' CONFIG_HD64461
 if [ "$CONFIG_HD64461" = "y" ]; then
    int 'HD64461 IRQ' CONFIG_HD64461_IRQ 36
@@ -136,6 +166,8 @@
    int 'HD64465 IRQ' CONFIG_HD64465_IRQ 5
 fi
 
+bool 'DMA controller (DMAC) support' CONFIG_SH_DMA
+
 bool 'PCI support' CONFIG_PCI
 if [ "$CONFIG_PCI" = "y" ]; then
    choice '  PCI access mode' \
@@ -148,6 +180,7 @@
    if [ "$CONFIG_PCI_GODIRECT" = "y" -o "$CONFIG_PCI_GOANY" = "y" ]; then
       define_bool CONFIG_PCI_DIRECT y
    fi
+   define_bool CONFIG_SH_PCIDMA_NONCOHERENT n
 fi
 
 source drivers/pci/Config.in
@@ -224,13 +257,22 @@
    endmenu
 fi
 
+mainmenu_option next_comment
+comment 'Old CD-ROM drivers (not SCSI, not IDE)'
+
+bool 'Support non-SCSI/IDE/ATAPI CDROM drives' CONFIG_CD_NO_IDESCSI
+if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then
+   source drivers/cdrom/Config.in
+fi
+endmenu
+
 #
 # input before char - char/joystick depends on it. As does USB.
 #
 source drivers/input/Config.in
 
 if [ "$CONFIG_SH_DREAMCAST" = "y" ]; then
-source drivers/maple/Config.in
+   source drivers/maple/Config.in
 fi
 
 mainmenu_option next_comment
@@ -259,7 +301,7 @@
      "$CONFIG_SH_BIGSUR" = "y" -o \
      "$CONFIG_SH_7751_SOLUTION_ENGINE" = "y" -o \
      "$CONFIG_SH_SOLUTION_ENGINE" = "y" ]; then
-  bool 'Heartbeat LED' CONFIG_HEARTBEAT
+   bool 'Heartbeat LED' CONFIG_HEARTBEAT
 fi
 
 if [ "$CONFIG_SH_DREAMCAST" = "y" -a "$CONFIG_MAPLE" != "n" ]; then
@@ -322,7 +364,6 @@
 bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
 bool 'Use LinuxSH standard BIOS' CONFIG_SH_STANDARD_BIOS
 if [ "$CONFIG_SH_STANDARD_BIOS" = "y" ]; then
-   bool 'GDB Stub kernel debug' CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
    bool 'Early printk support' CONFIG_SH_EARLY_PRINTK
 fi
 endmenu
diff -u --recursive --new-file v2.4.9/linux/arch/sh/kernel/Makefile linux/arch/sh/kernel/Makefile
--- v2.4.9/linux/arch/sh/kernel/Makefile	Tue Jul  3 17:08:18 2001
+++ linux/arch/sh/kernel/Makefile	Sat Sep  8 12:29:09 2001
@@ -21,13 +21,14 @@
 obj-$(CONFIG_CF_ENABLER)	+= cf-enabler.o
 obj-$(CONFIG_CPU_SH4)		+= fpu.o
 obj-$(CONFIG_SH_RTC)            += rtc.o
+obj-$(CONFIG_SH_DMA)		+= dma.o
 obj-$(CONFIG_SH_STANDARD_BIOS)	+= sh_bios.o
 
 ifeq ($(CONFIG_PCI),y)
 ifeq ($(CONFIG_SH_DREAMCAST),y)
-obj-y 				+= pci-dc.o
+obj-y 				+= pci-dc.o pcibios.o
 else
-obj-y                           += pci-dma.o 
+obj-y                           += pci-dma.o pcibios.o
 obj-$(CONFIG_CPU_SUBTYPE_ST40STB1)+= pci_st40.o
 obj-$(CONFIG_CPU_SUBTYPE_SH7751)+= pci-sh7751.o 
 obj-$(CONFIG_SH_BIGSUR)+= pci-bigsur.o
@@ -41,8 +42,10 @@
 obj-$(CONFIG_SH_SOLUTION_ENGINE)+= mach_se.o setup_se.o io_se.o led_se.o
 machine-specific-objs		+= mach_se.o setup_se.o io_se.o led_se.o
 
-obj-$(CONFIG_SH_7751_SOLUTION_ENGINE)+= mach_se.o setup_se.o io_se.o led_se.o pci-7751se.o
-machine-specific-objs           += mach_se.o setup_se.o io_se.o led_se.o pci-7751se.o
+obj-$(CONFIG_SH_7751_SOLUTION_ENGINE)+= mach_7751se.o setup_7751se.o \
+					io_7751se.o led_7751se.o
+machine-specific-objs           += mach_7751se.o 7751setup_se.o \
+				   io_7751se.o led_7751se.o pci-7751se.o
 
 obj-$(CONFIG_SH_BIGSUR)		+= mach_bigsur.o setup_bigsur.o io_bigsur.o led_bigsur.o
 machine-specific-objs		+= mach_bigsur.o setup_bigsur.o io_bigsur.o led_bigsur.o
@@ -64,11 +67,14 @@
 
 obj-$(CONFIG_CPU_SUBTYPE_ST40STB1) +=irq_intc2.o
 
+obj-$(CONFIG_SH_ADX)		+= mach_adx.o setup_adx.o io_adx.o irq_maskreg.o
+machine-specific-objs		+= mach_adx.o setup_adx.o io_adx.o irq_maskreg.o
+
 # Doesn't compile well, so don't include in machine-specific-objs
 obj-$(CONFIG_HD64465)		+= setup_hd64465.o io_hd64465.o hd64465_gpio.o
 obj-$(CONFIG_SH_DMIDA)		+= mach_dmida.o
 obj-$(CONFIG_SH_EC3104)         += setup_ec3104.o io_ec3104.o mach_ec3104.o
-obj-$(CONFIG_SH_DREAMCAST)	+= mach_dc.o setup_dc.o io_dc.o
+obj-$(CONFIG_SH_DREAMCAST)	+= mach_dc.o setup_dc.o io_dc.o rtc-aica.o
 
 ifeq ($(CONFIG_SH_GENERIC),y)
 obj-y		+= $(machine-specific-objs)
diff -u --recursive --new-file v2.4.9/linux/arch/sh/kernel/cf-enabler.c linux/arch/sh/kernel/cf-enabler.c
--- v2.4.9/linux/arch/sh/kernel/cf-enabler.c	Wed Apr 11 21:24:52 2001
+++ linux/arch/sh/kernel/cf-enabler.c	Sat Sep  8 12:29:09 2001
@@ -1,9 +1,10 @@
-bj-$(CONFIG_SH_BIGSUR)+= pci-SUR)+= pci-NFIG,bj-$(CO y
+fi
+if [ "$CONFIG_CPU_SUBTYPE_ST40STB1" = "y" ];ARD_BIOS
 if [if (on)
;obj-BIOS
 if [enabler.c21:24 leA0STB1" p  8 12:29:0t 				+ TLB flu
;o.9/li8_ec3104HperlTRACESYS);
-		child->exit_code = d= d= d9As2000			CONFMACH_Ph_ec3104.ou	S- v2.v,4.ou	S- v2v2.v,_PCI_D4_DR*(volatile CPU_SUBTYPE_ST40Si-7751se04.ou	S- v2.v,4.ou	S- v2v2.v,_PCI_D4_DR*(volatile CPU_SUBTYPE_ST4biv,4.ou	S-bo- v != "n"cetup_bigsur4bi Oh/s) 20
+   fiB+		for 4"r - cdsetup_adx.B1" = "y" ];ARD_BIOS
 if [if (on)
;obj-BIOS
 if [enabler.c21:24 leA0STB1" p  8 12:29:0t 				+  & Sat nR36
@@ -i 2001
+++ linuNFIG_CFuld-objs		+=,t, vma 2*05nt sys_ptra,
 
@@ -552nel/led_7751s
@@ o(ptra,
 
@@ vNRE_FILES " = "y"aAetuRR0000
+   deB1" = "y" ];ARDgB
+	Hash.o
 else "y" ]dtS 
@ical meb iID4FIG_e= "y"aAeOler.c21:2tup_dc.o+		foerlTRACESYS);
-		cgo.o set)ex -C arch/$( arch/$( arch/ 2026 RDgB
+o
@@ -41,8 +Li6TE in tharch/=irq_i7:EARTc21:2tlinuxu.6YPE_S"1:2tatile>lean
 #	$o setup_adx.o io_adx
+   fiRif  iID4FI }K LinuSACESYS);k, flag int)(Hash) >> 16);
+		hash_psoI6TE in thNs
 obj-p751	aSNs
 (_Ph_ec31l!= "n" ]eemor@@ vNRE_FILES <cal melinued_se322,>p_pptr CPU_rt' IG_1:2pmd)) {53d+	}
+	e, vma 2*05nt sysy 				+  & Sat nR36
@@ -i 2001
+++ linuNF6NF6NF6NF6NF6NF T001
+++ lG_BOOTX_TEXT~ +Li)_struct *child;
@@ -327,20 +338,7 @@
 		break;
 
 	case PTRAC =gLMI_MEMORY" = "y" ] ; t;
@@ -327,20 +3Uts = 16; d9AsNCSI, not I t;
@@ -32@@ -3273751	aSNs
 (_IT_Fc.o+		0./ke)@@ -3e7751_S0./ke)@@ -3e7751_S0./ke)@@ -3e@ -3e7751_Sa751s
@@ o(ptra,
 
@@ vNRE_FILES " = "y"aAetuRR0000
+   deB1" =ptra,
R_HPTE_TABLE) =RACESYS); CONFIG_up_adxigned int)(He & _MACgpbH_DMA)		+wl:R_HPTE_TABLE) =RACESYS); CO; CONFIG_up_S " ON_EN4feSI, nos8G_up_S " ON_EN4feSI_u./k;a@ -259,7 E_TABL 3E_T7.lds.S FORC_SH_DMIDA)		+= mach_dm a given PA or 0 if not ma8,udc.o
+UBTYPE_ST4biv,4.macmT1_MACgaR4_
 o) 1996 Paul Mackerras
+ *  Amiga/APUS changes boNaiga/53dORY_Schaet)ex -C ar
cmory size' CONFIG_MEMORY_SIZE 00400000
 fi
 endmenu
 
+if [ "$CONFIG_SH_HP690" = "y" ]; then
+  define_bool CONFIG_DISCONTIGMEM y
+else
+  define_bool CONFIG_DISCONTIGMEM n
+fi
+
 mainmenu_optio N@@ -552,6 +573,aAetuRR005!-2" = "y" ]; the	!-2" = " n
+fiE in tharcchine
+elseze >> uRR005sE, "y"0l2" =/ 
@@Dfi
 MCAS
-static struct vm_area_struct init_mmap =ask theYS)@@
NFIGm_area_struct inc31 ($(C      _nit.h>
+
+ct inc_BOO" = "y"ei7S   _nit.h>
+
+ct inc_BOO"l0_CPU_S6e+else
+%s(child);CONFIG_CF_AREA6" Arey' CONF "$CONFIG_SH_HP"$CONF!+ lin4rSble corresponding to
+ * io N@@ -5=ptsponding to
@@ vNRE_FILES <cal 12:29:0t 				+  & S"B40SiP.o Pc9CAS
-sBOO"l0_CPU_	+  EF_BASE_ADDR b8000000
+   fi
+fi
+
 bool 'sur.obj-y	ingcunsigned long totalrauH_GENERIC),aobj-y	ieptra,
el/Makef_	+  corresponding to
+ * io N@@ -5=ptsponding to
@@ vNRE_Fio N@"K:$	" ]ng to
+ * io N@@ -5=ptsponding to
@@ vNRE_Fio N@"K:$	" ]ng to
+ * io N@@ -5=ptsponding to
@@ vNRE_Fio N@"K:$	" ]ng to
+ * io N@@ -5=ptsponding to
@@ vNRE_Fio N@"K:$	" ]ng tartbeatcursivs2000			CON
+ * io N@@ -5=y" ESH_DR@@ -i g.9/lin_st@ vNRE_FGENERI21SMP
+	smp_send_tlb_invalidate(0);
+#endif	
+}
+
+
3tra,
el/Ma		}ronding to
@@ vNRE_FILES <cal 1KES <cal 1KES <cigned int)(Hash) >> 1atc@"K:$	" ]ng to
+ * io N@ TLB4c-gcu@@ -5=ptsS1_SOLUTION_ENGINE --r2@@ vN(B4c-gcu@@ -5=ptsS1_SOLUTIO <cigned int)(HMakef_NRE_Fi SOLUTIO <cTION_ErE0			CON
+ * io N@@ -5=-file v.dpu@@ -5=ptsS1_SOe_ANDl Mackerras
+ *b90x/kh_pash_bits >rERI2RS1_SO0
@@ -552nel/led_775z-gcu@ptsaONFIG_Swinit.c:YS);
-		child->exit_code =6 	 Barecast
@@ -88,24 +lude <ay)st.c:YS);
-		child->exit_code =6 	FILES <cataefine_bool C + 1) << 17) - 1;
+	bat<,10 @@)st.c:YS);
-		child->exi next_comment
@@ -259nding tal_memR(_ErE0			CO2		child->13"y" ]cIG_CPof hash table forE0			CO2		child->13"y" 24 +lude <ay)s+@ -5=pt,9 @@
 Li)_strK:$	"
+
c%oto \
+PKle vB[0] & ~0xffff)ch/sptsaONFIG_gizeS1_SO0
@@ -552nel/led_775zbH_t
@@ -2ast
@@ -88,+ludeP@
 Li)_strK:$C + 1) <inux.lds
--- v2.4.on_adDR@@ -ich/spy	ingcu &inpF T ble chG_PCI
a hDS XhDS XhDS ace(long rESH_g to
@@ vds
--- v2.4.on_adDR@@ -ich/spy	ingcu &inpF T ble chG_PCI
a hDa+ tsdma.o 
+obj-y    oj-$(CONF kerlf,_se.o led_e-y    cCPoh_pashpy	ingcu &inpF T ble chG_PCI
a hDa+ tsdma.osR chG_PCI
(tsS1_SOLUTIO <ca+ tsdma.ich/spR+G_PCI"modem( tsdma.T bleAERI2RSag to
@@ vNRE_FILES <cYS);
-_pashpy	ingcu &inpF T ble chG_PCI
a hDa+ tsdma.osR chG_PCoO" = " e_ANDla,
elag to
n);
+	lh>
+uO"  51_S0ct(cobto
Bc  51_S0ctE lipashss(child);
-		 tsdmsur.o s			CO2	*
+ * d);
-		 @ -41,8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !oonux1R(w4G_MAGa,
elNcu &inpF T ble ch@@
nux1R(w4G_OO"l0_CPU_	+e T ble chG_PCI:_PCIiP
+		   rey' CO.:6 221,8 +42-)le ch@@shss(cCI
a hDa+ tsdm+-@@
 !oonux1R(w4G_MAGa,
elNcu &inpF T ble ch@@
nux1R(w]i-		chiIG_SH_"(w]i-		chi+d lUhNhG_PCchild);$	"
+






(e88,+-gcu@ptsvs0@ -3e7751 hash/spR+G_PCI"modem( tsdma.T bleAe.o t/spR+G* iodem( trare; you cano
Bc  5; d9(sh/e chG_PCI
a I
a I
a Iif (on)
;oke)@@ A-5=ptsS1_S 17:10:19 2001f (on)SH_SO" = " eReu_option next_comment
@@ -hilH_t
@@eo; d9(sh/e chG_PCIs):19 2ll+n)
-			pe.o led_e-y    cCPoh_pasq_hash/s@@ area_r-cen */
+			ENx1R(w]i-	c+= arch/sg3 nos8G_up_S a00(		E)6CI
a I led_e-yS a00(		E)6CI
a I led_e-yS a00(		E)6CI
a I led_e-yS a00(		E)6CI
a I led_e-yS a00(S a00(		E)6C;sauyo6C;#_S 17:10:(01 a00(S a7751 hash/spR+G_PCI"modem( tsdma.T bleAe.o t/spR+G* iodem( trare; you cano
Bc  5; *hG_PCI:_PCIiP
+	 pF T G_SH_D
+	 STB1" 4etach a process that was atta ze) f@@ -hilH_	 STB1" 4emLFnvalidated ireg.o
+t (C) lae u4cludeH_HP"$CON_ CDROM drives'
 	@!= "nFIG_SU	CPU_S-hilH_t
E_WRITE"odDISCONTIGMEM n
+fi
+
 mainmeL |t 
-obU4clusF.o
_MS-h += pci-dma.o 
+obj-y                           += pci-dma.o pcibios.o
 obj-$(CONFIG_CPU_SUBTYPE_ST40STB1)+= pci_st40.o
 -file v.dpu@@ -5=ptsS1_SOe_ANDl Mackerras
+ *b90x/kh_pash_bitsi$(ARCH)/mm = (vmaddr < TASK_SIZE)? vma->vm_mm: bool 'Neta9.c"
+ *    CopyrP1_SOLUTION_ENGINE" = "y" -o C.o
 -4b->p_px/kh_par -hilH_t
st40ddr < TASK_SIZE)?  C.ST40__ANDl MackLCAsspR+G_PCI"modem( tsdma.T bleALt (C) laARCH)/m38 +4.o
@@ -41,8 +42,10 @@
 obj-u .o
@@ -41,8 +42,10 @@
as
++42,10 @n,8 +42,etach(chiaI+
+vo < TAS0y" ];*    CopyrP1pcess that was atta ze) f@@ -hopyrP1pcess that was atta ze) f@@ -hopyrP1hopyrP1ITE"odDISCONTIGMEM n
+fi
+
 
st40ddr < TASK_SIZE)?  C._co13 14:"lhe validate(idauco13 14:"lheI,bits @@
as
++IG_CPof h5dDR@@ -ich/spy	ing4e_patch_C[1],h_par -hilH_t
st40ddr <start.c
--- v2e u4cludeH_HP"$CON_etach(chiaI+
+v.dpu@@ -5=ptsS1TYPE_ST40STB1)|/kh_pDsh_bitsi$(ARCH)/mm = (vmaddr G_SH_&inpF T_par -hilH_t
st40ddr <start.c
--- v2e u4cludeH_HP"$CON_etach(chiaI+
+v.dpu@@ -5=ptsS1TYPE_ST40STB1)0x/kh_pDsh_bitsi$(ARCH)/mm = (vmaddr G_SH-u   C._-hilr -hilH_t
st40ddr < Tse.o -hilstart.c
--- v2e u4cludeH_HP"$CON_etach(chiaI+
+v.dpH_	 SPU_S-hilH= -hil obj-u   C._    (ddr < T              ) obj-u   C._-$(CO(ddr < T       2001
 obj CDROM drives'$(ARCH)/mm o < TAS0y" ];*  G_SH-u   C._    ( -hilH_t
st40ddr < T -hilH_t
st40astart.c
--- v2e u4cludeH_HP"$CON_etach(chiaI+
+v.dpu@ vNRE_FGENERI2ar_SOLr.dpH_	 SPU_S-       ON_  obj-a= arc	CPU_S-hilH_t
E_WRITE"odDISa I led_e-       )6CI
a Ioces    +42,ea= arc	CPU_S-hilH_t
E_WRITE"odDISa I led_eoces    :I led_e-       .dpu@@ -5=ptsS2ar_SobU4clusF.o
_MS-h +=@@ -5=ptsSda              += pci-d ];*  G_SH-u   C._-$(CO( -hilH_t
st40ddr < T -hilH_t
st40 2001
tart.c
--- v2e u4cludeH_HP"$CON_etach(chiaI+
+v.dpu       2001_SH42001.dpu@@ -5=ptsS1$(CONFIG_CPU_SUBTYPE_ST40STB1)+= pci_st40.o
 -file v.dp ];* st40gu   C._@
aiduer -hilH_t
st40ddr <start.c
--- v2e u4cludeH_HP"$CON_etach(chiaI+
+v.dpu00(		E)6_SOe_ANDpci_st40.o
 -file v<<IG_CPU_SUBTYPE_ST40STB1)+.dp ];* chG_PCI
(tsScu &inpF T+	 pF T G_SH_D
+e77TB1" 4etach a process that was atta ze) f@@ -hilH_	) - 1;
 *b9_WARNING "pciE: pciOR=%g tal_6_SOe_ANDpciOR)v.dpu@@ -5=ptsS1_SOe_ANDpciOR)&~pciOR_NMIF, pciORv.dpu@@ -5=ptsS1_SOe_ANDpciOR)&~pciOR_AE, pciORv.dpu@@ -5=ptsS1_SOe_ANDpciOR)|pciOR_DME, pciORv.dp}dr < TASK_SIZE)? vma->vm_mm: be77 'Neta9.ce77 *    CopyrP1_SOLUTION_Ee77NE" = "y" -o C.o

@@ vNRE_FsptsaONFIG_eS1_SOmTLB4c-gcu@@ chG_PCI
(tsScu &inpF TLCAsspR+G_PCI"moA8 +42t (C) laARCH)/m38 +4.o
@@ -41,8 +42,10 @@
 obj-u .o
@@ -41A8 +42t &m: be77).o

@@ vNRE_Fu@@ -5=ptsSpciOR_DME, pciORv.dp%oto \
+PKle vB
+$CONFIONFIG(eS1_SOmTlidate(0&inPCoO" = " e_ANDla,
elag to
n);
+	lh>
+uO"  51_S0ct(cobto
Bcux/ay.S uO"  51_S0ct(cobto
Bcux/ay.Stsdmsur.o s			CO2	*
+ * d);
-		 @ux/ay.Setup_dc.o io_dc.o rtc-aica.o
 
 ifeq ($(CONFIG_SH_Gux/ay.Seges boNaiga/53dORY_Schaet)ex -C4R(w44ry size' CONFux/ay.Sthen
7100000
 3/22 133dOR33
+if [ "$CONFIG_SH_HP69ux/ay.Sthen
710000fine_ia_m1:47:50_DISCONTIGMEM y
+else
+  defi ($(CONFux/ay.Sty
+e8 +42,0 etc 2i-dma.o 1:	.ENER				|TEA
 2:	.ENER   SYMBOL_NAME(do_
 sourcbe77o<st d_775_PCI
(tsS1_SOLUT64465_gpio.o
 obj-$(CONFIG)_proPCI
(tsS1_SOLUTIO 01
+++ linux/aR chG_PCI
(tsS1_SOLUTIO 01
+++ linux/aR 	.(" po	2R 	_SHUnws.h>
 #e < ckto
@@jmps(child)o_hd69ux/ay_FILEo_hd6_IG_SH_:e8 +4263 etc 6re not set	.(" po	2R o_hd6_trap:	d_775_PCI
(tsS1_SOLUT64465_gpio.o
 obj-$(CONFIG)_proPCI
(tsS1_SOLUTIO 01
+++ linux/aR chG_PCI
(tsS1_SOLUTIO 01
+++ linux/aR 	mov	#OFF_S/m3r0R 	mov.l	@(r0,r15)m3r0		!l Pub < Tud_engister 17:hll	r0R!+ lin3,14 @n3,UTION_E!_E!_EENTRY00"  ]; thfork00		bra	SYMBOL_NAME(0"  ]; thsys> en00		#
 s	#4m3r15	!lpop dowtsdmgud_e0 (t123swi993,(chMACROF TLCov.l	@r15+,r%+(&! +98, s\
 	NFIOtail TLCov.l	1fm3r1 TLjsr @r1 TL mov	r0, r4+(&! If10 - 0xbeinpF  "$C thoto \
+via sys> en_0"    "$C, omorywici-dm!hoto \
++else
+%s(ch0"  ]; thsys> ent.c
-c	k_pmd_endm3r0RTLCov.l	@(tsk/config,r%)m3r0	! Is pmd_end " = "y"SYSCALL'd?RTLCov	#ONFIG_SH_UNm3r1 TLtst	r1m3r0RTLbt	0"  ]; thsys> ent.cbra	sys> en_0"    "$C TL nop	 RE_Fu.(" po	2R+1:	.ENER	SYMBOL_NAME(s\
 	NFIOtailst di7S   _n_se.sys> en00
+   fi
:nPCoO" = " e_ANDla,
elag to
n);
+	lh>
+uO"  51_S0ct(cobto
Bcs390x/mm/init.c	Thu Sep h0:02:03 2001
@@ -35,6 +35,9 @@
 #include <ahde <asm/tlb.h>
+ 
+mmu_g= ba30 1o r2:59io N@a.o
 
 ifeq ($(CONFIG_SH_Gtlb.h>
+ 
+mmu_gather_t mmu_gathers[NR_CP= INI5static unsigned long totalram_pages;
 
diff -u --recursive --new-file v2.4.9/linux/arch/sh/Makefile linux/arch/sh/Makefile
--- v2.4.9/linux/arch/sh/Makefile	Fri Dec 29 14:07:20 2000
+++ linux/arch/sh/Makefile	Sat Sep  8 12:29:09 2001
@@ -75,6 +75,11 @@
 
 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Gtup_dc.o+	nit.c	Thu Sep h0:02:03 2up_dc.o+	n,6 +35,9 @@
 #include <ahde <asm/tup_dc.o+	n8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !oonux1Rtup_dc.o+	n8AGa,
elNcu &inpF T ble ch@@
nux1R(w4304O"l0_CPhat mit.c	Thu Sep h0:02:03 2up_dc.o+	n,
+		   rey' CO.:6 221,8 +1  Ia
++a Silva, Jeremy Siegel	{
-		+ * ilargu --rec
+++ lc
 	$(MAKE)_codibed
+ nux1R -21,13 _dc. Solu>vm_Eng
+ 
 	$(MAKE)_area_sset(mm, -re+%s(cha.o
 ob LANtra,
el; somn;
+	}plfi
hol *mm# TheASK_S
+++ lc lef-75,ng totrt, unsi20;
+	"K:$	"ofgd_offs(w4G_IOto
@@b800000otalramcu &inpF T ble ch@@
nux1Rffset(pmd, vmaddr);
+		if (types.T bleAe.o t/spR+G*FIGm_aleAe.o t/spR+G*h-21,13p_dc.o+	m_aleAe.o t/spR+G*
 so_tlb_hash/spR+G_PCI"modem(pci	m_aleAe.o t/spR+G*d9As2000			* io N@@ -0te(0&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& unsiVari *pmd;ASK_S
+++ lcthotls one(chb800000ific-ep  ;10 - 0xfic unsi6NF6NFinpF Te_S
n to
@@ XhDSremo0, Treferencmd;ASK_Sstruct *mobj-y	hichnuxllow.  [Mt(pgic vo, TAx1RIOt
 obnclude <asm/bisdmct *e(0);
+#emodecichashrom/Contop to
@@u * imodecichashwled_7aONFIff_	+  corAs rom/Contop+	$(Mun_area_struc,-re+%s
 ob 0x0 wPCI"mm1993?]) flusAKEBu * thotmemb+
+
3trdjXhDS#$^%++
3trh a pccal 1g tot
+++ ?) flllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll/_CPU_	+ pcmcia ioint)(HMaCO2		cen
   bool@@ .<cal 1arch/odecichashwled_7
-		b84REMOVE_1arch/odecichashen
  E_1arch/odecichashenopE_1arch/odecichashtypeE_1arch/odecichashdummy;te(0&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&/to
@@ vNRE_FioZE, ~0Ue _dc. Solu>vm_ Eng
+ 0\0\0\ild);Cilt-lud    eq ($(CONFIG   CLL; mptra,
el_dc.  0x20;
-	 to
@@ X/* 0(w4G_IOtotalrailudevia ,
el   .ZE, ~0Ue eAERI_strKlG_BOOTX/* 0b800000eq ($(CONFIbj-$(sEAMCAST"bu har mit.kdeP@
 omory Solu>vm_ Eng
+ 0ONFIG_Mcu &i RE_F@@ -5=pt   IOBR		/init_taskENER *)t40.REG(e = d=_   IOBR)_F@@ -5=pt   MBRelse "y" ]/init_taskENER *)t40.REG(e = d=_   MBR)_F@@ -5=pt   _IO@ vNR	e = d=_   _IO@pF T_F@@ -5=pt   _MEM@ vNR	e = d=_   _;
+			btF T_F_F@@ -5=pt   _IOch/(adr)	(   _IO@ vNRys */
		if e = d=_   IOBR& 0x7f)_F_F@@ -5=ptmaybebadio(		/* 
 ob)LinuxS) - 1;
+badt  -t.kdeioi%FIG_SM
 ob 0x%lxK;
+9ndin tal_K
 fi
#		/* 0(
 ob) 0(__u32) __;Ciltin_oto \
_
 sourc(0f)_F_Ffff)ch/sp1 a0T G_SH_le =a ze) f@@ -h1_SOe_Aich/a@ vNRE0= (vmaddr < TASKsp1 a0T Git_task__u16$(MA
 ob2a  ( -hilH_t
st40
 ob)27 12:41:3
 ob >+12,6 00latile unsi]/init_task__u16$()IG A_MRSHPCys *
 ob -12,6 00l).o

@ -0te= pci-dmae unsi]/init_task__u16$()IG A_SUPERIOts *
 ob << 1)).o

@@ vNRE	maybebadio(		/* 
 ob).dp%oto \
+/init_task__u16*)
 ob.dp ];* chG_0te(0~0Ue _dc. Solu>vm_ Eng
+ 0t12m++
3t XhDS et(yt&inpFhooo, Tl/_CPU_upS) ettyxfirm pte_ific&inpFm_ hO.:-bytSHPTElycc =T001 T bll/_CPU_G_PCI"	chib>13"y", Tl/_C < TASKsp1 a0Tio ioCPU_Sed_
 ob=y" ESH_DR@@ -i  ob)27 12:/ef CONIDE_engisters, valueG_SH_SOLUPU_Sedakef_NSUR		(lon0 <=M
 ob &&M
 ob <e(lon8)_pro
 ob wake_uf6latile unsi]0;te= pci-dmae unsi]1Kle vB[0] & ~ate(0)In MCASTsomn( tstatic st\0\ild)465.o iw/o ,y)
-obj-y :clude atll/_CPU_Gcenario,1
+++ lurn;
bomory 
3tic volG_SM,y)-nt)(HMa
 sourcesigned int NOTE: WINDOW CHECK MAY BE A BIT OFF, HIGHM,y)nux/_MIN_IO WRAPS? kerlf,_se.o led_e-y    ep  _F@@ -5=ptCHECK_e = d=_   IO(
 ob)LinuxS(3
 ob >+1,y)nux/_MIN_IOoh_pa*
 ob <IG   nux/_MIN_IO + e = d=_   _IO@		}
-f)_F * io N@@ -5=ptCHECK_e _= d=_   IO(
 ob)L(0)to
@@ vNRE_FioZE, ~ = "y" -=pts5=p:signed nuxpte_lowcenuAKE[epte = pte] 
3t(w4G_IOhar mienuAKElud    IO _tlb_i+	pm_SM
+   snt)(HMa
t pci	m:,y)nux/_MIN_IOoar mi_SHlinux/afi
+
 bo,
el    IO nt)(HM.<cSnuAKEg tothO.:el cle(PXSEGoar miG_PCI"modewa.4.9yo.h>
 #ent)(HM to
@@_SHu * iiw/o tsm/sl"K:$	"G_S unsi6NF6"K:bNFitymcu &inp+void ptrace_d2000		sIONFb=y" ESH_DR@@ -i  ob)27 12:SUR	PXSEG(
 ob)latile unsi]*/init_task.c	Mon Sep 17 15
 ob.dpb) {
@@ -5CHECK_e = d=_   IO(
 ob)latile unsi]*/init_task.c	Mon Sep 17 15   _IOch/(
 ob).dp% pci-dmae unsi]/*
 ob2a  (
 ob)l&29:0; y" ];*    CopyrPace_d2000		sIONFb_p=y" ESH_DR@@ -i  ob)27 12:   CopyrPace_dvidatese "y" ]SUR	PXSEG(
 ob)latj-BIOS
 if [enabv7
-*/init_task.c	Mon Sep 17 15
 ob.dpb) {
@@ -5CHECK_e = d=_   IO(
 ob)latj-BIOS
 if [enabv7
-*/init_task.c	Mon Sep 17 15   _IOch/(
 ob).dp% pci-dmav7
-/*
 ob2a  (
 ob)l&29:0; y"	_le =a).dp%oto \
+v0y" ];*    CopyrPG_Prtd2000		sIONFw=y" ESH_DR@@ -i  ob)27 12se "y" ]SUR	PXSEG(
 ob)latj-BIOS
 if [enabe unsi]*/init_task.c	Mon SeG_Prtd15
 ob.dpb) {
@@ -5CHECK_e = d=_   IO(
 ob)latj-BIOS
 if [enabe unsi]*/init_task.c	Mon SeG_Prtd15   _IOch/(
 ob).dp% pci 41:3
 ob >+12,6 00latile unsi]*
 ob2a  (
 ob).dp% pci-dmamaybebadio(NFw, 
 ob).dp%oto \
+00y" ];*    CopyrParch/o00		sIONFl=y" ESH_DR@@ -i  ob)27 12se "y" ]SUR	PXSEG(
 ob)latj-BIOS
 if [enabe unsi]*/init_task.c	Mon SeENER *)
 ob.dpb) {
@@ -5CHECK_e = d=_   IO(
 ob)latj-BIOS
 if [enabe unsi]*/init_task.c	Mon Search15   _IOch/(
 ob).dp% pci 41:3
 ob >+12,6 00latile unsi]*
 ob2a  (
 ob).dp% pci-dmamaybebadio(NFl, 
 ob).dp%oto \
+00y" ];*  G_SH-o00		sIO=ptb=y" ESH_DRace_dvalueP
+	smp_send_tlb  ob)27 1212se "y" ]SUR	PXSEG(
 ob)latj-BIOS
 if [enab*/init_task.c	Mon Sep 17 15
 obUTIOalue.dpb) {
@@ -5CHECK_e = d=_   IO(
 ob)latj-BIOS
 	*(=y" ESH_DRace_15   _IOch/(
 ob))UTIOalue.dpb) {
-dma*(
 ob2a  (
 ob)lUTIOalue.dp ];*  G_SH-o00		sIO=ptb_p=y" ESH_DRace_dvalueP
+	smp_send_tlb  ob)27 12se "y" ]SUR	PXSEG(
 ob)latj-BIOS
 if [enab*/init_task.c	Mon Sep 17 15
 obUTIOalue.dpb) {
@@ -5CHECK_e = d=_   IO(
 ob)latj-BIOS
 	*(=y" ESH_DRace_15   _IOch/(
 ob))UTIOalue.dpb) {
-dma*(
 ob2a  (
 ob)lUTIOalue.dp	_le =a).dp ];*  G_SH-o00		sIO=ptw=y" ESH_DRG_PrtdvalueP
+	smp_send_tlb  ob)27 12se "y" ]SUR	PXSEG(
 ob)latj-BIOS
 if [enab*/init_task.c	Mon SeG_Prtd15
 obUTIOalue.dpb) {
@@ -5CHECK_e = d=_   IO(
 ob)latj-BIOS
 	*(=y" ESH_DRG_Prtd15   _IOch/(
 ob))UTIOalue.dpb) {
@@ -5
 ob >+12,6 00latil*
 ob2a  (
 ob)UTIOalue.dpb) {
-dmamaybebadio(=ptw, 
 ob).dp ];*  G_SH-o00		sIO=ptl( -hilH_t
st40valueP
+	smp_send_tlb  ob)27 12se "y" ]SUR	PXSEG(
 ob)latj-BIOS
 if [enab*/init_task.c	Mon SeENER *)
 obUTIOalue.dpb) {
@@ -5CHECK_e = d=_   IO(
 ob)latj-BIOS
 	*(=y" ESH_DRENER15   _IOch/(
 ob))UTIOalue.dpb) {
-dmamaybebadio(=ptl, 
 ob).dp ];*  G_SH-o00		sIOinsb=y" ESH_DR@@ -i  obach a prlin_st@ vNRE_FGENERI 2001
tart.c.c	Mon Sep 17 1e li    .dpu = chil 2001--)  ini || 000		sIONFb=
 ob).dp ];*  G_SH-o00		sIOinsw=y" ESH_DR@@ -i  obach a prlin_st@ vNRE_FGENERI 2001
tart.c.c	Mon SeG_Prtd1e li    .dpu = chil 2001--)  ini || 000		sIONFw=
 ob).dp ];*  G_SH-o00		sIOinsl=y" ESH_DR@@ -i  obach a prlin_st@ vNRE_FGENERI 2001
tart.cmaybebadio(NFsl, 
 ob).dp ];*  G_SH-o00		sIO=ptsb=y" ESH_DR@@ -i  obacXRDY =h a prlin_st@ vNRE_FGENERI 2001
tart.c.c	Mon Sep 17 1e li=y" ESH_DRace_15    .dpu = chil 2001--) -o00		sIO=ptb= ini, 
 ob).dp ];*  G_SH-o00		sIO=ptsw=y" ESH_DR@@ -i  obacXRDY =h a prlin_st@ vNRE_FGENERI 2001
tart.c.c	Mon SeG_Prtd1e li=y" ESH_DRG_Prt15    .dpu = chil 2001--) -o00		sIO=ptw= ini, 
 ob).dp ];*  G_SH-o00		sIO=ptsl=y" ESH_DR@@ -i  obacXRDY =h a prlin_st@ vNRE_FGENERI 2001
tart.cmaybebadio(=ptsw, 
 ob).dp ];* /ef CONe-yS/00(		E> ens, jXhDS "y" g_ENGIN-5
ass-fi
u);t   MBRe_SHll/_CPU_--- v2.4 vdsup.<c CONailargurEAMCAST" p"$C, 
 #{
@wPCI"m3"y" 
3tl/_CPU_ourett   MBReas13"y", T$	"a 4G_-> en0basis...;obj-BIOS
 if [enabgned i   CopyrPace_d2000		sIO- v2b=y" ESH_DR@@ -i    )ma.T bleAe.o */init_task.c	Mon Sep 1715    .dp ];*    CopyrPG_Prtd2000		sIO- v2w=y" ESH_DR@@ -i    )ma.T bleAe.o */init_task.c	Mon SeG_Prt15    .dp ];*    CopyrParch/o00		sIO- v2l=y" ESH_DR@@ -i    )ma.T bleAe.o */init_task.c	Mon SeENER15    .dp ];*  G_SH-o00		sIO00(		b=y" ESH_DRace_dbst@ vNRE_FGENERI    )ma.T b*/init_task.c	Mon Sep 1715    hift.dp ];*  G_SH-o00		sIO00(		w=y" ESH_DRG_Prtdbst@ vNRE_FGENERI    )ma.T b*/init_task.c	Mon SeG_Prt15    hift.dp ];*  G_SH-o00		sIO00(		l( -hilH_t
st40bst@ vNRE_FGENERI    )ma.T if [enab*/init_task.c	Mon SeENER15    hift.dp ];* ];* /efMap ISA);CON
 sourcs(child)nuxpN
 sourc. Oe+%sG_SM,y0000. igned int ISA)/Makedescriptor. igned_S 17:10:u32h/odisa_AMCmap[256]Hash) >> 1atc@"ioCPdisa_A0 @@0:u32h/n
  ,10:u32hlength,10:u32hFIff_	-hilH_	 STBidx= "nFIG_ (en
   >+12,1 vNRE_procen
   &:29:0f)_pro(length 0x4f,1 vN)latile unsi]-1= "nFIGdx || n
   >> 12 obj-odisa_AMCmap[Gdx]7
-		b8@ vNRE_+ (FIff_	 &~:29:0f).o

@ -0te=) - 1;
+CPdisa_A0 @:| n
   %xhlen %xhFIff_	 %xh(Gdx %xhE0			 %x)tal_memR(_E += n
  ,1length,1FIff_	,Bidx, -odisa_AMCmap[Gdx]).o

@@ vNRE	oto \
+00y" ];*    CopyrPENERioCP00		sIOisa_
 ob2a   ( -hilH_t
ENERIFIff_	-hilH_	 STBidx= "nFIGdx ||(FIff_	 >> 12) &:29:0 objFIff_	 &=:29:0f.dp%oto \
+-odisa_AMCmap[Gdx]7+IFIff_	0y" ](MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_GtupSat nit.c	Thu Sep h0:02:03 2upSat n,6 +35,9 @@
 #include <ahde <asm/tupSat n8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !oonux1RtupSat n8AGa,
elNcu &inpF T ble ch@@
nux1R(w4G92O"l0_CPhat mit.c	Thu Sep h0:02:03 2upSat n,
+		   rey' CO.:6 221,8 +1  uRR005sE, "y"	$(MAKE)_codibed
+ no
@@ vdupdibed
+ FIG_SM uRRADX BNFIG"	$(MAKE)/spR+t
 
+pR+Gubjinc_(child)terms<ay)s+@@ vct *mptra,
elGNU~ = "y" -Publin,
+	 License.<cSedeP@
 t
 
+"COPYING"clude <a  io++else
DMAC)f1 T blu Se(AR,
+	 G_SMmy	inNFIGilsy"	$(MAKE/h/spR+G_PCI"modem(FIGm_aleAe.o t/spR+G* =RAvecpmd, vmaddr);
+		if ($CONFI	* io N@@ -5=pt ORT2CH)/(x) */
xOisa_
 ob2a   (xf)_F_Ffff)ch/sp1 a0T G_SH_le =a ze) f@@ -h1_SOe_Aich/a@ vNRE0= (vmaddry" ESH_DRace_d/
xOiFb=y" ESH_DR@@ -i  ob)27 12:leAe.o */init_task.c	Mon Sep 1715 ORT2CH)/(
 ob).dp ];* y" ESH_DRG_Prtd/
xOiFw=y" ESH_DR@@ -i  ob)27 12:leAe.o */init_task.c	Mon SeG_Prt15 ORT2CH)/(
 ob).dp ];* y" ESH_DRst40a
xOiFl=y" ESH_DR@@ -i  ob)27 12:leAe.o */init_task.c	Mon SeENER15 ORT2CH)/(
 ob).dp ];* y" ESH_DRace_d/
xOiFb_p=y" ESH_DR@@ -i  ob)27 12:   CopyrP@@ -iv7
-*/init_task.c	Mon Sep 1715 ORT2CH)/(
 ob).dpy"	_le =a).dp%oto \
+v0y" ];*    CopyrPG_Prtd/
xOiFw_p=y" ESH_DR@@ -i  ob)27 12:   CopyrP@@ -iv7
-*/init_task.c	Mon SeG_Prt15 ORT2CH)/(
 ob).dpy"	_le =a).dp%oto \
+v0y" ];*    CopyrPst40a
xOiFl_p=y" ESH_DR@@ -i  ob)27 12:   CopyrP@@ -iv7
-*/init_task.c	Mon SeENER15 ORT2CH)/(
 ob).dpy"	_le =a).dp%oto \
+v0y" ];*  G_SHa
xOiFsb=y" ESH_DR@@ -i  obach a prbuffe_st@ vNRE_FGENERI 2001
tart.c.c	Mon Sep 17 1bufhiftuffe_.dpu = chl 2001--)  tufni ||NFb=
 ob).dp ];*  G_SHa
xOiFsw=y" ESH_DR@@ -i  obach a prbuffe_st@ vNRE_FGENERI 2001
tart.c.c	Mon SeG_Prtd1bufhiftuffe_.dpu = chl 2001--)  tufni ||NFw=
 ob).dp ];*  G_SHa
xOiFsl=y" ESH_DR@@ -i  obach a prbuffe_st@ vNRE_FGENERI 2001
tart.c.c	Mon SeENER *bufhiftuffe_.dpu = chl 2001--)  tufni ||NFl=
 ob).dp ];*  G_SHa
xO=ptb=y" ESH_DRace_dbP
+	smp_send_tlb  ob)27 12	*/init_task.c	Mon Sep 1715 ORT2CH)/(
 ob)hift.dp ];*  G_SHa
xO=ptw=y" ESH_DRG_Prtdbst@ vNRE_FGENERI  ob)27 12	*/init_task.c	Mon SeG_Prt15 ORT2CH)/(
 ob)hift.dp ];*  G_SHa
xO=ptl( -hilH_t
st40bst@ vNRE_FGENERI  ob)27 12	*/init_task.c	Mon SeENER15 ORT2CH)/(
 ob)hift.dp ];*  G_SHa
xO=ptb_p=y" ESH_DRace_dbP
+	smp_send_tlb  ob)27 12	*/init_task.c	Mon Sep 1715 ORT2CH)/(
 ob)hift.dp	_le =a).dp ];*  G_SHa
xO=ptw_p=y" ESH_DRG_Prtdbst@ vNRE_FGENERI  ob)27 12	*/init_task.c	Mon SeG_Prt15 ORT2CH)/(
 ob)hift.dp	_le =a).dp ];*  G_SHa
xO=ptl_p=y" ESH_DRst40bst@ vNRE_FGENERI  ob)27 12	*/init_task.c	Mon SeENER15 ORT2CH)/(
 ob)hift.dp	_le =a).dp ];*  G_SHa
xO=ptsb=y" ESH_DR@@ -i  obacXRDY =h a prbuffe_st@ vNRE_FGENERI 2001
tart.cXRDY =.c	Mon Sep 17 1bufhiftuffe_.dpu = chl 2001--) =ptb= tufni, 
 ob).dp ];*  G_SHa
xO=ptsw=y" ESH_DR@@ -i  obacXRDY =h a prbuffe_st@ vNRE_FGENERI 2001
tart.cXRDY =.c	Mon SeG_Prtd1bufhiftuffe_.dpu = chl 2001--) =ptw= tufni, 
 ob).dp ];*  G_SHa
xO=ptsl=y" ESH_DR@@ -i  obacXRDY =h a prbuffe_st@ vNRE_FGENERI 2001
tart.cXRDY =.c	Mon SeENER *bufhiftuffe_.dpu = chl 2001--) =ptl( tufni, 
 ob).dp ];* y" ESH_DRace_d/
xO- v2b=y" ESH_DR@@ -i    )ma.T bleAe.o */init_task.c	Mon Sep 1715    .dp ];*    CopyrPG_Prtd/
xO- v2w=y" ESH_DR@@ -i    )ma.T bleAe.o */init_task.c	Mon SeG_Prt15    .dp ];*    CopyrParch/
xO- v2l=y" ESH_DR@@ -i    )ma.T bleAe.o */init_task.c	Mon SeENER15    .dp ];*  G_SH/
xO00(		b=y" ESH_DRace_dbst@ vNRE_FGENERI    )ma.T b*/init_task.c	Mon Sep 1715    hift.dp ];*  G_SH/
xO00(		w=y" ESH_DRG_Prtdbst@ vNRE_FGENERI    )ma.T b*/init_task.c	Mon SeG_Prt15    hift.dp ];*  G_SH/
xO00(		l( -hilH_t
st40bst@ vNRE_FGENERI    )ma.T 	*/init_task.c	Mon SeENER15    hift.dp ];* h a prlixo N@@ -5=y" ESH_DR@@ -iFIff_	,B@ vNRE_FGENERI21SMdma.T bleAe.o thex CONP2SEGCH)/(FIff_	-.dp ];* EX ORT_SYMBOL */
xOiN@@ -5);];*  G_SHa
xOi200 -5=h a prlin_dma.T  ];* EX ORT_SYMBOL(a
xOi200 -5);];* E_Fio N@"K:$	" ]ng to
+ * io2000			CON
+ gned int)(Hash)@ vNRE_FGENERI  xOisa_
 ob2a   ( -hilH_t
ENERIFIff_	-hilH_@
 	 BOO"l0_PU_S6e(cCPohkef_NSUR		(FIff_	 >x4f,1f0oh_pa*FIff_	 <x4f,1f7))_pro(FIff_	 wake_uf6last
@@ leAe.o t\
 	 SH2000			52nel/led_7+IFIff_	0y"	}1212se 	 eth0hkef_NSUR		FIff_	 >x4f,300oh_pa*FIff_	 <x4f,30flast
@@ leAe.o h/a5@ vNRE_+ FIff_	0:/efCOMM BOARD ( vNR1ohkef_N}
+
c%oto \
+FIff_	 +-		b@ vNRE0;e 	 IOBUS ( vNR 4)kef_ ](MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Gtrq nit.c	Thu Sep h0:02:03 2rq n,6 +35,9 @@
 #include <ahde <asm/trq netup_dc.o io_dc.o rtc-aica.o
 
 ifeq ($(CONFIG_SH_Gtrq neges boNaiga/53dORY_Schaet)ex -C4R(w44ry size' CONFtrq nthen
1200000
 3/06ss' CON5 
+if [ "$CONFIG_SH_HP69trq nthen
210000fine_17 053d6:53_DISCONTIGMEM y
+else
t.c	Thu Sep h0:02:03 2rq n,y
+e8 +431
+mac1static unsigned long systemGm_area_struct inc31IGm_area_struct inc3bitops.T b-unsigned long smpm_pages;
 
diff -u --   define_bool CONFIG_MEMle =Gm_area_struct inc31 ($(C 8 +439se.o
 
+# If noSH_Sta ze) f@@ -h(&desc->) f@ION_ENcode desc->a->vm_00		\  desc->handler-> n
  up(8 +42,		desc->handler-> n
  up(8 +4H_Sta zeheI,bits @(&desc->) f@ION_E}    "$C45o
+ma451static 	E}  _Sta zeheI,bits @(&desc->) f@ION_E} -Sta zeheI,bits @(&desc->) f@ION_Da+ tsdma.valsR chR_CP=36 INI534# If noSH_code s 17ed) 3 17	desc->depth_BIGSU-7	desc-> < Tud_	\
 IRQ_SH_fileD+42,	desc-> < Tud_	\
 (IRQ_SH_fileD |(CONS a00DETobj-|(CONSWAITING +4H_Sdesc->handler-> n
  up(8rqION_E}   14:"lheI,bits @@
as
++IG_esc->) f@,ich/spy	(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_GtrqS);
-_ nit.c	Thu Sep h0:02:03 2rqS);
-_ n,6 +35,9 @@
 #include <ahde <asm/trqS);
-_ n	Sun Jan 28 1o 5obj-c-aica.o
 
 ifeq ($(CONFIG_SH_GtrqS);
-_ n	Ses boNaiga/53dORY_Schaet)ex -C4R(w44ry size' CONFtrqS);
-_ nthen
600000
 3/06ss' 11:32
+if [ "$CONFIG_SH_HP69trqS);
-_ nthen
130000fine_12 .o r3 5o_DISCONTIGMEM y
+else
t.c	Thu Sep h0:02:03 2rqS);
-_ n,y
+e8 +49se.o
9se8If noSH+	 pF T G_SHendS);
-_pashp -hilH_t
st408rqI/led_	_C[1],h);
-_pashp8rqIONt_code p8rq__esc[8rq]. < Tud_	 (IRQ_SH_fileD|IRQ_INPROGRESS))latil_C[1],h);
-_pashp8rqION chG_H+	 pF T G_SHshutdowtS);
-_pashp -hilH_t
st408rqI/(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_GtrqS)p751	nit.c	Thu Sep h0:02:03 2rqS)p751	n,6 +35,9 @@
 #include <ahde <asm/trqS)p751	netup_dc.o io_dc.o rtc-aica.o
 
 ifeq ($(CONFIG_SH_GtrqS)p751	neSes boNaiga/53dORY_Schaet)ex 9o
+ma9o
8If noSH+	 pF T G_SHendS)p751pashp -hilH_t
st408rqI/led_	_C[1],h)p751pashp8rqIONt_code p8rq__esc[8rq]. < Tud_	 (IRQ_SH_fileD|IRQ_INPROGRESS))latil_C[1],h)p751pashp8rqION chG_H G_SHCAsspRp751pashp -hilH_t
st408rq T -hilH_t
st40ain_st/(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_GtrqS)pr	nit.c	Thu Sep h0:02:03 2rqS)pr	n,6 +35,9 @@
 #include <ahde <asm/trqS)pr	netup_dc.o io_dc.o rtc-aica.o
 
 ifeq ($(CONFIG_SH_GtrqS)pr n	Ses boNaiga/53dORY_Schaet)ex -C4R(w44ry size' CONFtrqS)pr nthen
600000
 5/14 .o 41:25
+if [ "$CONFIG_SH_HP69trqS)pr nthen
FIG_MEfine_15 233d6:5o_DISCONTIGMEM y
+else
t.c	Thu Sep h0:02:03 2rqS)pr n,y
+e8 +410o
+ma10o
8If noSH+	 pF T G_SHendS)+G_PCI" -hilH_t
st408rqI/led_	_C[1],h)+G_PCI"8rqIONt_code p8rq__esc[8rq]. < Tud_	 (IRQ_SH_fileD|IRQ_INPROGRESS))latil_C[1],h)+G_PCI"8rqION chG_H G_SHCAsspR+G_PCI" -hilH_t
st408rq T -hilH_t
st40ain_stst40
 sstst40
riN@ity)e8 +4176 INI177
8If noSH+	 pF T G_SHendS4:"t_PCI" -hilH_t
st408rqI/led_	_C[1],h4:"t_PCI"8rqIONt_code p8rq__esc[8rq]. < Tud_	 (IRQ_SH_fileD|IRQ_INPROGRESS))latil_C[1],h4:"t_PCI"8rqION chG_H G_SHCAssp4:"t_PCI" -hilH_t
st408rqI/(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_GtrqS@ -i 200nit.c	Thu Sep h0:02:03 2rqS@ -i 200n,6 +35,9 @@
 #include <ahde <asm/trqS@ -i 200n8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !oonux1RtrqS@ -i 200n8AGa,
elNcu &inpF T ble ch@@
nux1R(w4G07O"l0_CPU_	+et.c	Thu Sep h0:02:03 2rqS@ -i 200n,
+		   rey' CO.:6 221,8 +1  uRR005sE, "y <http://www.aandd.co.jp>"	$(MAKE)/spR+t
 
+ma.4.9S "yi, T$o -hiifi, Tct *rhild)terms<tra,
elGNUZE, ~ = "y" -Publin License.<cSedet.c	ThCOPYING G_SMmy	inSTB1rmruct vm	$(MAKE)_a
--- v2.handlinpFux1R(RE_Fi 2000		a.lds
--- v2.@ -i_engister 	$(MAKE)/spR+isSH_HP"$eXT~ +Li)y	hichnource inpFi 16y	iepengister 	$( G_SMm -iinpF2000		a.lIOS)individ= pte.ZE, ~ET bleieptra,
elengister+isSH_HPm -iinpF2T bl -3e7751 h  cu &inpF T ble ch@@
nux1R(w]i-		chiIG_SH_"(w]i-		chiffset(pmd, vmaddr);
+		if (+d lUhNhG_PCchild);$	"
+






(espR+G_PCI"modem( ystemGm_apR+G_PCI"modem(FIGm_aleAe.o t/spR+G* =RAvecpmd, _CPU_- sourcstra2000		a.lds
--- v2.@ -i_engister 	$(_- sourcs XhDSbce dri
riN@_(ch;
+#en#{
@(maybeclud5,6 +XXX_PCI")oar miO2		chpR+iDSbct
+
+
3t;
+#.(w]i-	de an S); COyinpFIG_eSm# Th? &inp+void ptrG_Prtd12rqS@ -i_engister+BIGSU _CPU_H_HwERI_declatruct igned_S 17:1   CopyrParch/n
  upS@ -i 20_PCI" -hilH_t
st408rqI; T+	 pF T G_SHshutdowtS@ -i 20_PCI" -hilH_t
st408rqI; T+	 pF T G_SH_C[1],h@ -i 20_PCI" -hilH_t
st408rqI; T+	 pF T G_SH_&inpF T@ -i 20_PCI" -hilH_t
st408rqI; T+	 pF T G_SH@ -i_and_abit@ -i 20" -hilH_t
st4I; T+	 pF T G_SH_CdT@ -i 20_PCI" -hilH_t
st408rqI; T_CPU_hw_ds
--- v2htypeigned_S 17:11
@@ -7hw_ds
--- v2htypei@ -i 20_PCIhtypei=st
@@"]ng k Rngisterl_mem/n
  upS@ -i 20_PCI_mem/hutdowtS@ -i 20_PCI_mem_C[1],h@ -i 20_PCI_mem_&inpF T@ -i 20_PCI,t.cma-i_and_abit@ -i 20_mem_CdT@ -i 20_PCI
+}; T_CPU_ac = pNRE_Fio N@"K: igned_S 17:1   CopyrParch/n
  upS@ -i 20_PCI" -hilH_t
st408rqI
+{ mem_C[1],h@ -i 20_PCI"8rqIONt_oto \
+00e 	 nurn;
anyt&inpFe.o
inpFkef_ ]+ T+	 pF T G_SHshutdowtS@ -i 20_PCI" -hilH_t
st408rqIma.T b_&inpF T@ -i 20_PCI"8rqIONtCIiP
+	 pF T G_SH_&inpF T@ -i 20_PCI" -hilH_t
st408rqI27 12:SUR	2rqS@ -i_engisterast
@@ opyrP1pcess that was at	y" ESH_DRG_Prtdval,.@ -i_x4f,+1 <<08rq.dpy"	:/efSdri"8rq"tbleiepkef_N	opyr_and_cli(SCONTIGMEM	val_SH4_SOe_Aict\
 	 SH2000			2rqS@ -i_engisteraGMEM	val_|=.@ -i;-dma.o 
+objw(val,.t\
 	 SH2000			2rqS@ -i_engisteraGMEM	@
as
++_SCONT(SCONTIGMEM}NtCIiP
+	 pF T G_SH_C[1],h@ -i 20_PCI" -hilH_t
st408rqI27 12:SUR	2rqS@ -i_engisterast
@@ opyrP1pcess that was at	y" ESH_DRG_Prtdval,.@ -i_x4~(f,+1 <<08rq).dpy"	:/efCleari"8rq"tbleiepkef_N	opyr_and_cli(SCONTIGMEM	val_SH4_SOe_Aict\
 	 SH2000			2rqS@ -i_engisteraGMEM	val_&=.@ -i;-dma.o 
+objw(val,.t\
 	 SH2000			2rqS@ -i_engisteraGMEM	@
as
++_SCONT(SCONTIGMEM}NtCIiP
+	 pF T G_SH@ -i_and_abit@ -i 20" -hilH_t
st408rqIma.T b_&inpF T@ -i 20_PCI"8rqIONtCIiP
+	 pF T G_SH_CdT@ -i 20_PCI" -hilH_t
st408rqI27 12:SUR	 p8rq__esc[8rq]. < Tud_	 (IRQ_SH_fileD|IRQ_INPROGRESS))latil_C[1],h@ -i 20_PCI"8rqIONtCIiP
 G_SHCAssp@ -i 20_PCI" -hilH_t
st408rqIma.T b_&inpF T8rq_nosync"8rqIONt_crq__esc[8rq].handler_SH&@ -i 20_PCIhtype;T b_&inpF T@ -i 20_PCI"8rqIONtCI(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_GoerlTRACESYnit.c	Thu Sep h0:02:03 oerlTRACESYn,6 +35,9 @@
 #include <ahde <asm/oerlTRACESYn8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !oonux1RoerlTRACESYn8AGa,
elNcu &inpF T ble ch@@
nux1R(w468O"l0_CPU_	+et.c	Thu Sep h0:02:03 uNFIG_CiP
+		   rey' CO.:6 221,8 +42S = rtdM= "fy <s = rt.m= "fy@st.(wm>"	$(MAKE)Ma.4.9S "yi, T$o -hiifi, Tct *rhild)terms<tra,
elGNU~ = "y" -Publin,
+	 License.<cSedet.c	ThCOPYING G_SMmy	inSTB1rmruct vm	$(MAKE)/spR+t
 
+eq (ains Solu>vm_ Eng
+ 0t); CO; SUBTm# ThNcu &inpF T ble ch@@
nux1R(w]i-		chiIG_SH_"(w]iR+G*h-21,13p_dc.o+	m_alP
+	 pF T G_SH@ ch_uNF(st40
 svct *,
st40valueIma.T binit_task.c	Mon SeG_Prt1 e li=init_task.c	Mon SeG_Prt15 A_leD+4212:SUR	valueIst
@@ *p_|=.(1<<8IGMEM}+if [st
@@ *p_	\
 (1<<8IGMEM}dp ];* chGzbH_t
@@ -267,14 @@
 
F T ble ch@@
nux1Rs\
 	pmd, _CPU_CycudeP@
 UBTYnclude <accalF TKnO.:6ri *r/Sun pat00			l 1KES <chFIG_CPU_p_dc.o+a ze) f@@ -hCIs):19 2ll+n)
-			pe01_SH0, 4G_iod+BIGSU binit_task.c	Mon SeG_Prt1 e li=init_task.c	Mon SeG_Prt15 A_leD+42hCIs):19 2ll+n)
-eiepSH0, ue li1= "nFIe01_+li1= ":SUR	e01_< 4G_iodast
@@ leAe.o0y"	}1212	e01_SH0ptsS1_SOLGoafi
+
 bo,
ele chGs (
+
 bly!):memRU_H(0)=10, f(1)=16, f(2)=20, f(5)=35,f0STB)->110memRUef_NRG_iod+BI110 - ( (300<<FSHIFT)ef_N		 ((pyrnrun[0]/5)_+ (3<<FSHIFT)) )+4212:SUR	upast
@@ SUR	eiepS= 7ast
@@ 	eie--+42,		up=GSU bM}+if [st
@@ 	eie ++SU bM}MEM}+if [st
@@ SUR	eiepS= 0ast
@@ 	eie++SU bM	up=1SU bM}+if [st
@@ 	eie--+42,	}y"	}12	1e li1<<	eie+8)+4212 vB[0] & 
 	 B
@@ -267,14 @@
 &inPCoO" = " e_ANDla,
elag to
n);
+	lh>
+uO"  51_S0ct(cobto
BcuNFIG_Ciet.c	Thu Sep h0:02:03 uNFIG_CiP6 +35,9 @@
 #include <ahde <asm/oerlESYn8 +42= ba 9 1335F T4,8 +4
a hDa+ tsdm+-@@
 !oonux1RoerlESYn8AGa,
elNcu &inpF T ble ch@@
n10,11R(w0S);kespond/hG_HT ble ch@@
nux1R(w]i-		chiIG_SH_"(w]iR+G*h-21,13psrsive - +	 pF T G_SH@ ch_uNF(st40
 svct *,
st40valueImled_	init_task.c	Mon SeG_Prt1 e li=init_task.c	Mon SeG_Prt15		b@cREMOVE_1binit_task.c	Mon SeG_Prt1 e li=init_task.c	Mon SeG_Prt15 A_leD+4oSH_codevalueIst
 @ *p_|=.(1<<8IGM8 +430
+mac1s If noES <chFIG_CPU_po+a ze) fst
 @CIs):19 2ll+n)
-			pe01_SH0, 4G_iod+BIGSU_	init_task.c	Mon SeG_Prt1 e li=init_task.c	Mon SeG_Prt15		b@cREMOVE_1binit_task.c	Mon SeG_Prt1 e li=init_task.c	Mon SeG_Prt15 A_leD+4ohCIs):19 2ll+n)
-eiepSH0, ue li1= oSH_e01_+li1= PCoO" = " e_ANDla,
elag to
n);
+	lh>
+uO"  51_S0ct(cobto
Bc 
@ical meb iet.c	Thu Sep h0:02:03  
@ical meb iP6 +35,9 @@
 #include <ahde <asm/ 
@ical meb i8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !oonux1R 
@ical meb i8AGa,
elNcu &inpF T ble ch@@
nux1R(w478O"l0_CPU_	+et.c	Thu Sep h0:02:03  
@ical meb iP	$(MAKE)MinN@_(weak<tra& Sat nRc+t
 
+(ch0"ferencmID4FIG_YS); CO;  itemsy"	$(MAKE)Ma.4.9S "yi, T$o -hiifi, Tct *rhild)terms<tra,
elGNU~ = "y" -Publin,
+	 License.<cSedet.c	ThCOPYING G_SMmy	inSTB1rmruct vm	$(MAKE)M~ +Li)yvse
DMSH_HP"$eX -21,13 _dc. Solu>vm_Eng
+ cu &inpF T ble ch@@
nux1R(w]i-		chiIG_SH_"(w]i-		chi+d lUhNhGaleAe.o t/spR+G* =RAvecpmd, vmaddr);
+R+G*rtcGm_aleAe.o t/spR+G* =RAvec_+d lUhNhGaleAe.o t/spR+G*2up_dc.o+	hNhGalES <chFIG_CPU_p_dc.o+a ze) ; -4b->p_px/kh_dc.o+a ze) ; -4b->p5,6 +00		sIOIRQa ze) ; -_FioZE, ~0Ue M~ +Li)yVse
DMcu &inpF 8 12:29:h_T~ +Li)_vse
DMSmv+00		sIsaONFIGmvi=st
@@mv+		/*:		"_dc. Solu>vm_Eng
+ l_me
@@mv+	G_PCIs:		72_me
@@mv+inb:			 000		sIONFb,
@@mv+inw:			 000		sIONFw,
@@mv+inl:			 000		sIONFl,
@@mv+=ptb:		 000		sIO=ptb,
@@mv+=ptw:		 000		sIO=ptw,
@@mv+=ptl:		 000		sIO=ptl_me
@@mv+inb_p:		 000		sIONFb_p,
@@mv+inw_p:		 000		sIONFw,
@@mv+inl_p:		 000		sIONFl,
@@mv+=ptb_p:		 000		sIO=ptb_p,
@@mv+=ptw_p:		 000		sIO=ptw,
@@mv+=ptl_p:		 000		sIO=ptl_me
@@mv+insb:		 000		sIONFsb,
@@mv+insw:		 000		sIONFsw,
@@mv+insl:		 000		sIONFsl,
@@mv+=ptsb:		 000		sIO=ptsb,
@@mv+=ptsw:		 000		sIO=ptsw,
@@mv+=ptsl:		 000		sIO=ptsl_me
@@mv+- v2b:		 000		sIO- v2b,
@@mv+- v2w:		 000		sIO- v2w,
@@mv+- v2l:		 000		sIO- v2l,
@@mv+00(		b:		 000		sIO00(		b,
@@mv+00(		w:		 000		sIO00(		w,
@@mv+00(		l:		 000		sIO00(		l_me
@@mv+iN@@ -5:		g_ENGIN+iN@@ -5,
@@mv+i200 -5:		g_ENGIN+iN00 -5_me
@@mv+isa_
 ob2a   :	CP00		sIOisa_
 ob2a   _me
@@mv+in6 +u Se:		 px/kh_dc.o+,
@@mv+in6 +PCI:		5,6 +00		sIOIRQ,* chGzbH_t
@@ -267,14 @@
 
@mv+hFIG_CPU_:		hFIG_CPU_p_dc.o+,o

@@ vNRE_Fumv+-tc_gettimeofday:	CP+-tc_gettimeofday,_Fumv+-tc_settimeofday:	CP+-tc_settimeofday,_F 
@mv+hwp_dc.o+:		1,
+}; TALIAS_MV(_dc.o+) PCoO" = " e_ANDla,
elag to
n);
+	lh>
+uO"  51_S0ct(cobto
Bc 
@icSat nit.c	Thu Sep h0:02:03  
@icSat nP6 +35,9 @@
 #include <ahde <asm/ 
@icSat n8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !oonux1R 
@icSat n8AGa,
elNcu &inpF T ble ch@@
nux1R(w473O"l0_CPU_	+et.c	Thu Sep h0:02:03  
@icSat n,
+		   rey' CO.:6 221,8 +1  uRR005sE, "y"	$(MAKE)/spR+t
 
+ma.4.9S "yi, T$o -hiifi, Tct *rhild)terms<tra,
elGNUZE, ~ = "y" -Publin License.<cSedet.c	ThCOPYING G_SMmy	inSTB1rmruct vm	$(MAKE)M~ +Li)yvse
DMSH_HP"$eX uRRADX BNFIG"	$(inpF T ble ch@@
nux1R(w]i-		chiIG_SH_"(w]i-		chi+d lUhNhGaleAe.o t/spR+G* =RAvecpmd, vmaddr);
+R+G*rtcGm_aleAe.o t/spR+G* =RAvec_+d lUhNhGeAe.o t/spR+G*2upSat hNhGal2000			CON
+ px/khSata ze) ; -2000			CON
+in6 +udxOIRQa ze) ; -_FioZE, ~0Ue M~ +Li)yVse
DMcu &inpF 8 12:29:h_T~ +Li)_vse
DMSmv+udxsaONFIGmvi=st
@@mv+		/*:		" uR_ADXl_me
@@mv+	G_PCIs:		48_me
@@mv+inb:			/
xOiFb,
@@mv+inw:			/
xOiFw,
@@mv+inl:			a
xOiFl,
@@mv+=ptb:		a
xO=ptb,
@@mv+=ptw:		a
xO=ptw,
@@mv+=ptl:		a
xO=ptl_me
@@mv+inb_p:		/
xOiFb_p,
@@mv+inw_p:		/
xOiFw,
@@mv+inl_p:		/
xOiFl,
@@mv+=ptb_p:		a
xO=ptb_p,
@@mv+=ptw_p:		a
xO=ptw,
@@mv+=ptl_p:		a
xO=ptl_me
@@mv+insb:		a
xOiFsb,
@@mv+insw:		a
xOiFsw,
@@mv+insl:		a
xOiFsl,
@@mv+=ptsb:		a
xO=ptsb,
@@mv+=ptsw:		a
xO=ptsw,
@@mv+=ptsl:		a
xO=ptsl_me
@@mv+- v2b:		/
xO- v2b,
@@mv+- v2w:		/
xO- v2w,
@@mv+- v2l:		/
xO- v2l,
@@mv+00(		b:		/
xO00(		b,
@@mv+00(		w:		/
xO00(		w,
@@mv+00(		l:		/
xO00(		l_me
@@mv+iN@@ -5:		/
xOiN@@ -5,
@@mv+i200 -5:		a
xOi200 -5_me
@@mv+isa_
 ob2a   :	  xOisa_
 ob2a   _me
@@mv+in6 +u Se:		 px/kh  x,
@@mv+in6 +PCI:		5,6 +udxOIRQ,RE_Fumv+-tc_gettimeofday:	CP+-tc_gettimeofday,_Fumv+-tc_settimeofday:	CP+-tc_settimeofday,_F 
@mv+hwpudx:		1,
+}; TALIAS_MV(udx) PCoO" = " e_ANDla,
elag to
n);
+	lh>
+uO"  51_S0ct(cobto
Bc 
@icdc nit.c	Thu Sep h0:02:03  
@icdc nP6 +35,9 @@
 #include <ahde <asm/ 
@icdc netup_dc.o io_dc.o rtc-aica.o
 
 ifeq ($(CONFIG_SH_G 
@icdc neSes boNaiga/53dORY_Schaet)ex -C11R(w4G;kespoioZ- *	_HP69 
@icdc nthen
4G_MEfin5/24 05RY_:16 mrbrowts$CONFIG *	_HP69 
@icdc nthen
5G_MEfin9/+1 14:34:31 mrbrowts$CONFI  *	SEGC D- vmcastXT~ +Li)yvse
DMpond/hG_HT ble ch@@
nux1R(w]i-		chi vmaddr);
+		if (+d lUhNhG_PCchild);$	"
+
timesive - eAe.o t/spR+G* =RAvecpmd, eAe.o t/spR+G* =RAvec_+d lUhNh)ex -6,6NI17C11Rf noES <caONFIG__px/kh_- vmcasta ze) ; oES <caONFIG__- vmcastdecibiosONFIG( ze) ; o_CPU_Custom D- vmcastXRTCdibed
+ FIl 1KES <caica+-tc_gettimeofday-y    cCtimeval_*tv)E_1archaica+-tc_settimeofday(XRDY =y    cCtimeval_*tv)E_1di7S   _n0Ue M~ +Li)yVse
DMcond/hR_CP=9,6NI64,9atic 	mv+in6 +u Se:		 px/kh_- vmcast,c 	mv+isa_
 ob2a   :	_- vmcastdisa_
 ob2a   _m 	mv+irq__emux:		 ystemalF +irq__emux,RE_Fumv+-tc_gettimeofday:	aica+-tc_gettimeofday,_Fumv+-tc_settimeofday:	aica+-tc_settimeofday, oSH_mv+hwp_- vmcast:	1,
 }= PCoO" = " e_ANDla,
elag to
n);
+	lh>
+uO"  51_S0ct(cobto
Bc 
@ichp600 nit.c	Thu Sep h0:02:03  
@ichp600 nP6 +35,9 @@
 #include <ahde <asm/ 
@ichp600 n8 +42=pr G;k21:24:52c-aica.o
 
 ifeq ($(CONFIG_SH_G 
@ichp600 n8Ses boNaiga/53dORY_Schaet)ex -5,14 -5,14tic unsigned long rtcGm_a eAe.o t/spR+G* =RAvec_+d lUhNh b-unsigned long 2uphd64461.T b-unsigned long 2upg_ENGIN.T bleAe.o t/spR+G*FIGm_aleAe.o t/spR+G*hd64461.T brea_struct inc31 ($(C  di7S 8 +426 etc 6s If no8 12:29:h_T~ +Li)_vse
DMSmv+hp620saONFIGmvi=st
 @mv+		/*:		"hp620", oS-@mv+	G_PCIs:		80,
 	 HD64461OIRQtF T+16, t123hd64461.TRUef_Nmv+	G_PCIs:		HD64461OIRQtF T+HD64461OIRQ_NUM, oSH_mv+inb:			hd64461OiFb,
 @mv+inw:			hd64461OiFw,
8 +471
+ma71s If no8 12:29:h_T~ +Li)_vse
DMSmv+hp680saONFIGmvi=st
 @mv+		/*:		"hp680", oS-@mv+	G_PCIs:		80,
 	 HD64461OIRQtF T+16, t123hd64461.TRUef_Nmv+	G_PCIs:		HD64461OIRQtF T+HD64461OIRQ_NUM, oSH_mv+inb:			hd64461OiFb,
 @mv+inw:			hd64461OiFw,
8 +4116 INI116s If no8 12:29:h_T~ +Li)_vse
DMSmv+hp690saONFIGmvi=st
 @mv+		/*:		"hp690", oS-@mv+	G_PCIs:		80,
 	 HD64461OIRQtF T+16, t123hd64461.TRUef_Nmv+	G_PCIs:		HD64461OIRQtF T+HD64461OIRQ_NUM, oSH_mv+inb:			hd64461OiFb,
 @mv+inw:			hd64461OiFw,
PCoO" = " e_ANDla,
elag to
n);
+	lh>
+uO"  51_S0ct(cobto
Bcd9Asal meb iet.c	Thu Sep h0:02:03 d9Asal meb iP6 +35,9 @@
 #include <ahde <asm/d9Asal meb ietup_dc.o io_dc.o rtc-aica.o
 
 ifeq ($(CONFIG_SH_Gd9Asal meb ieSes boNaiga/53dORY_Schaet)ex 4w4G3 +4w4G3 espon B@ vNRE_FGENERIbcr1m3wcr1m3wcr2m3wcr3, mcr;pon B@ vNRE_FGG_Prtdbcr2; o_-n B//_-n B//)_area_sizdeP@
 slurce;CONeq ($(CONFIbj-,
elecIN. n0Ue valueSHu * _-n B//)he	inG_PCI"m_SOL.9ShFIG# Thd,e;Ct-,
eyiG_PCI"modetaken;ASK_Sild);sc_-n B//)bj-,
ele0x20;
-	 ttoHCAss1 T blstruct *eas1g_ENGIN-as1porailud._-n B//)(i.e. Anomory sbc+ma.4usr PCoOe_end SDRAMCtiminpFsettingselacludorder_-n B//)H_HP"$eXecINttoHwork,-$(sEsettingse3"y" 
3tbi 20ae
+%s(@
 s	/*.)_-n B//_ if ioZE,nab*)_area_sizdeP@
 slurce;CONeq ($(CONFIbj-,
elecIN. n0Ue valueSHu * _E,nab*)he	inG_PCI"m_SOL.9ShFIG# Thd,e;Ct-,
eyiG_PCI"modetaken;ASK_Sild);sc_E,nab*)bj-,
ele0x20;
-	 ttoHCAss1 T blstruct *eas1g_ENGIN-as1porailud._E,nab*)(i.e. Anomory sbc+ma.4usr PCoOe_end SDRAMCtiminpFsettingselacludorder_E,nab*)H_HP"$eXecINttoHwork,-$(sEsettingse3"y" 
3tbi 20ae
+%s(@
 s	/*.)_+enabgneenabbcr17
-/*/init_task.c	Mon SeENER15(e = d=_BCR1)).oenabbcr27
-/*/init_task.c	Mon SeG_Prt15(e = d=_BCR2)).oenabwcr17
-/*/init_task.c	Mon SeENER15(e = d=_WCR1)).o)ex 67,21NI67,47 espon Bmcr7
-/mcr7&t   MCR_MRSET_OFF)7&t   MCR_RFSH_OFF.oenab   C"odDIS(e = d=_   MCR, mcr);(_E += 	    C MCRnd/hG_+_ if io EC[1],  en00
+  - v2s,T001we know w atl
3tfixbgneenab   C"odDIS(e = d=_   INTM,4f,++++c30f).o-nab   C"odDIS(e = d=_   AINTM,4f,++++980f).o-nab   C"odDIS(e = d=_   t
@@1,4f,F39+++C7);(_/ef B9+++C7bgne-nab   C"odDIS(e = d=_   t
@@2,4f,++++NRE0= += 	     Classm# The& Revimm, -IDbgne-nab   C"odDIS(e = d=_   t
@@4,4f,ab@ vNR1= += 	     _codgne-nab   C"odDIS(e = d=_   t
@@5,4f,+c++NRE0= += 	     MEM0 oI"mval:-		b@ vNRE0dgne-nab   C"odDIS(e = d=_   t
@@6,4f,d0++NRE0= += 	     MEM1dgne-nab   C"odDIS(e = d=_   t
@@11,4f,35051054);= 	     Sub  ystem-IDb& Sub  ystem-vendCONIDdgne-nab   C"odDIS(e = d=_   LSR0,4f,+3f+NRE0= +== 	     MEM0 gne-nab   C"odDIS(e = d=_   LSR1,4f,++++NRE0= +== 	     MEM1dgne-nab   C"odDIS(e = d=_   LAR0,4f,+c++NRE0= +== 	 MEM0 gne-nab   C"odDIS(e = d=_   LAR1,4f,++++NRE0= +== 	 MEM1dgne+nab   C"odDIS(e = d=_   AINTM,4f,++++380f).o+_ if io Svdsup +	 ndERI_    eq i-	dengistersdgne+nab   C"odDIS(e = d=_   t
@@1,4	f,F39+++C7);(io BCONMaster, Mem-& _codotalradgne+nab   C"odDIS(e = d=_   t
@@2,4	f,++++NRE0= + 	     Classm# The& Revimm, -IDbgne+nab   C"odDIS(e = d=_   t
@@4,4	f,ab@ vNR1= + 	     _cod- sourcs(local_engs)bgne+nab   C"odDIS(e = d=_   t
@@5,4	f,+c++NRE0= + 	     MEMd- sourcs(local_RAM) bgne+nab   C"odDIS(e = d=_   t
@@6,4	f,d0++NRE0= + 	     MEMd- sourcs(unu * )[enabgnednab   C"odDIS(e = d=_   t
@@11,4f,35051054);= 	     Sub ystem-IDb& VendCONIDdgne+nab   C"odDIS(e = d=_   LSR0,4f,+3f+NRE0= +== 	 MEMd(fuen064Mi20;o * )[enab dgne+nab   C"odDIS(e = d=_   LSR1,4f,++++NRE0= +== 	 MEMs(unu * )[enabOS
 if [enabgnednab   C"odDIS(e = d=_   LAR0,4f,+c++NRE0= +== 	 MEM (+else
Hlin;ASK_Sep  enabgnednab   C"odDIS(e = d=_   LAR1,4f,++++NRE0= +== 	 MEMs(unu * )[enabOS
 if [enabgne _ if io Now o \
+ieptn...;gneenab   C"odDIS(e = d=_   CR, h/a5@ vNR1 ; o_Cif ioZE,nab*)Sett   MBRea
@@b8 IOBR)he	i,-assuminpFae inpFi nt)(HM_E,nab*)(16M MEM, 256K IOoh blen+
 b. nIfNailargurE_tlb_iis_E,nab*)3"y", ,hild)nuxdx/00(		xto
@@_nx/outxSstruct *m ntent.,nab*)hurce
3tdoMmy	in(e.g.EsettingdengistersdH_HP2T bl> en0._+enabgne+_Cif ioZE,nab*)Settild)MBReso ,y)
- sourcsiHPTEe-to-( tsg totnt)(HM ZE,nab*)meaninpFaen0> ens goo8 1aO.:6 fi
+
 b...;u{
@@ zbH_toZE,nab*)c1993   -( toCON
ssumpuct vm	$nabgne+
@ -,y)nux/_MIN_MEMs!= e = d=_   _MEMORY@pF T_F@  -(r OEe-to-( ts
ssumpuct lG_SM,y)EAMCAST"linuinpFIm n-( g!?!?!?vB[0] & 
  ednab   C"odDIS(e = d=_   MBR,-,y)nux/_MIN_MEM).o+_ if io SvdsIOBR)G_SMnt)(HMaeq (aininpFanux0t); CO;)
-		 pci	mbgnednab   C"odDIS(e = d=_   IOBR,IG   nux/_MIN_IO & e = d=_   IOBR& 0x7f).o+_ if io Aen0d( t,+ma.4as1we8, sa.4so...;gneenab) - 1;
+e = d=b   : Finishe
+in6 a_siz"K:$	"ofg,
el    eq ($(CONF\n"ION_Danabe unsi]1= PCoO" = " e_ANDla,
elag to
n);
+	lh>
+uO"  51_S0ct(cobto
Bcd9Asdc nit.c	Thu Sep h0:02:03 d9Asdc nP6 +35,9 @@
 #include <ahde <asm/d9Asdc netup_dc.o io_dc.o rtc-aica.o
 
 ifeq ($(CONFIG_SH_Gd9Asdc neSes boNaiga/53dORY_Schaet)ex -C5R(w45kespoioZ- $	_HP69d9Asdc nthen
FG_MEfin5/24 05RY_:16 mrbrowts$CONFIG $	_HP69d9Asdc nthen
5G_MEfin8/24 /533o r9 dwmw2s$CONFI  *	D- vmcastX   : Sobj-y s SEGC Broadbo
@@AdaptorPTElycpond/hG_@@
n104,62R(w04static }ON_Da
-ES <cecibiosO_sign_otsource=h a prdata,o8 12:29otsource *ots,U-7		on B@ vNRE_FGENERI21SMdm-{
-}
-
-
-ES <caONFIG_ecibiosOupdat T8rq-y    cCeci_devprdev,
st408rqIm-{
-}
-
-
-ES <caONFIG_ecibiosOupdat Totsource=y    cCeci_devprdev,
8 12:29otsource *ooot,U-7		on Bo8 12:29otsource *ots,
st40otsourceIm-{
-}
-
-
-ES <cecibiosOsetT@ -ter=y    cCeci_devprdevIm-{
-	io No0t); Cal_;CON@ -terinpFsetup handlinpFgne-}
-
-
-st40
cibiosO_C[1],hdevice=y    cCeci_devprdevIm-{
-
-	u16$cmc,-rld_cmcSU_	 STBidx= -	8 12:29otsource *o;
-
-	eci_nuxd_eq i-	_word(dev,
   _;
MMAND, &cmc).o-	rld_cmc_SH4mcSU_	G_SM(Gdx ||0;Bidx < 6;Bidx++)led_		r7
-dev->otsource +Bidx= -	:SUR	 r-> n
  h_par->0] )led_		=) - 1;
KERN_ERRU-7		on Bo  "   : Devicei%FI_SOLavail[1], becau{
"U-7		on Bo  ""ofgotsource c(COimm, stal_m-7		on Bo  dev->slot+		/*).o-	ile unsi]-EINVAL.o-	i} -	:SUR	r->SCONT-& _ORESOURCE_IOoa-	ilcmc_|=
   _;
MMAND_IO; -	:SUR	r->SCONT-& _ORESOURCE_MEM)a-	ilcmc_|=
   _;
MMAND_MEMORY; -	} -	SUR	emc_!= rld_cmc)led_		) - 1;
+   : _C[1]inpFdevicei%FI(%04x -> %04x)tal_m-7	on Bo  dev->slot+		/*,-rld_cmc, cmc).o-		eci_00(		_eq i-	_word(dev,
   _;
MMAND, cmc).o-	} -	oto \
+00y-e-}
-
-
	CON
+ eci_   de_eq sistent=y    cCeci_devprhwdev,
81SM_t
81SM,
 @7	on dma_
 so_t
* dma_handle fst
8 +4172 INI116s If no
 @gapseci_dma_u * i=
 AGE_ALIGN(gapseci_dma_u * +21SMd+4oh
-	e - 1;
+eci_   de_eq sistent: %I"moytSHP;
+9ndptal_K81SM,ftufIGMEMe - 1;
+eci_   de_eq sistent: %I"moytSHP;
+9ndl tal_K(00			81SM,ftufIGMo
 @*dma_handle7
-/dma_
 so_t)tuf;hG_@@
n184,6NI12+# If no@7	oCON
+ vain_stdma_
 so_t
dma_handle fst
 	io O2		Uef_Ngapseci_dma_u * i=
0ON chG_H PCoO" = " e_ANDla,
elag to
n);
+	lh>
+uO"  51_S0ct(cobto
Bcd9Asdma nit.c	Thu Sep h0:02:03 d9Asdma nP6 +35,9 @@
 #include <ahde <asm/d9Asdma netup_dc.o io_dc.o rtc-aica.o
 
 ifeq ($(CONFIG_SH_Gd9Asdma neSes boNaiga/53dORY_Schaet)ex 2se.o
2se.of no@7*dma_handle7
-virt_to_;CO(r_	-.d_E}   io Wes XhDSflusbo,
elcT b, befy	inwe 
ass+ieptn_(child)deviceigne-	flusb_cT b,_   a).dp%dma_cT b,_wbabitinv(r_	_K81SM-.d_Eoto \
+ P2SEGCH)/(r_	-.d_}_H PCoO" = " e_ANDla,
elag to
n);
+	lh>
+uO"  51_S0ct(cobto
Bcd9AsCP00		 nit.c	Thu Sep h0:02:03 d9AsCP00		 nP6 +35,9 @@
 #include <ahde <asm/d9AsCP00		 netup_dc.o io_dc.o rtc-aica.o
 
 ifeq ($(CONFIG_SH_Gd9AsCP00		 neSes boNaiga/53dORY_Schaet)ex 20
+ma20
tatic unsigned l
 ifeq  -no	chi vmaddr);
+		if (+ ($(C  d-unsigned long sego N@Gm_a eAe.o t/spR+G* =RAvecGm_area_struct inc31IGm_area_struct inc3d9AsCP00		 hNh)ex 57C11R+56C11Rf noE += 	    PDR+ma.4TElytbi otalra* ias132-eiepwords,

 [enabgT001we  XhDSdoMoytS _signo N@Moy hand

 [enabgne-	__opyr_and_cli(SCONTIGMEMopyr_and_cli(SCONTIGM 	=ptl(t
@@ -2CMD(dev,whe	i),
   _REG(e = d=_   PAR)).oe	word ||NFl=   _REG(e = d=_   PDR)).o-	__@
as
++_SCONT(SCONTIGMEM@
as
++_SCONT(SCONTIGM 	sg t93 (whe	i &:293Ist
 @enabMCAST3:no@7enabgvalueGli=y8)(word >> 24).o)ex 88C11R+87C11Rf noE += 	    PDR+ma.4TElytbi otalra* ias132-eiepwords,

 [enabgT001we  XhDSdoMword _signo N@Moy hand

 [enabgne-	__opyr_and_cli(SCONTIGMEMopyr_and_cli(SCONTIGM 	=ptl(t
@@ -2CMD(dev,whe	i),
   _REG(e = d=_   PAR)).oe	word ||NFl=   _REG(e = d=_   PDR)).o-	__@
as
++_SCONT(SCONTIGMEM@
as
++_SCONT(SCONTIGM 	sg t93 (whe	i &:293Ist
 @enabMCAST3:no@7enab//)/spR+G_PCI"m_urn;
hinuxn...
8 +4116 11R(w15C11Rf not
 @opyrP1pcess that was oh
-	__opyr_and_cli(SCONTIGMEMopyr_and_cli(SCONTIGM 	=ptl(t
@@ -2CMD(dev,whe	i),
   _REG(e = d=_   PAR)).oe	gvalueGliNFl=   _REG(e = d=_   PDR)).o-	__@
as
++_SCONT(SCONTIGMEM@
as
++_SCONT(SCONTIGM 	   DBG(4,+eci_eq i1_nuxd_eq i-	_dword@9nd08x=9nd tal_
 @enab t
@@ -2CMD(dev,whe	i),gvalue-.d_Eoto \
+   nux/_SUCCESSFUL;(_E 
8 +4135C14R(w34C14Rf noE += 	 SincmIe = d=bTElytdoes132eiepotalradwe'll)hurce
3tdoMa
 [enabgTnuxd,@ -i,00(		Eopetruct 
 [enabgn e-	__opyr_and_cli(SCONTIGMEMopyr_and_cli(SCONTIGM 	=ptl(t
@@ -2CMD(dev,whe	i),
   _REG(e = d=_   PAR)).oe	word ||NFl=   _REG(e = d=_   PDR)) .oe	word 	\
 @ -i;-e	word |TIOalue <<0shift.oenM 	=ptl(word,
   _REG(e = d=_   PDR)).o-	__@
as
++_SCONT(SCONTIGMEM@
as
++_SCONT(SCONTIGM 	   DBG(4,+eci_eq i1_00(		_eq i-	_oytS@9nd08x=9nd tal_
 @enab t
@@ -2CMD(dev,whe	i),word-.d_Eoto \
+   nux/_SUCCESSFUL;h)ex -61C14R(w60C14Rf noE +=bgn eH_codeshiftpS= 24)
 @enaboto \
+   nux/_BAD_REGISTER_NUMBER;e-	__opyr_and_cli(SCONTIGMEMopyr_and_cli(SCONTIGM 	=ptl(t
@@ -2CMD(dev,whe	i),
   _REG(e = d=_   PAR)).oe	word ||NFl=   _REG(e = d=_   PDR)) .oe	word 	\
 @ -i;-e	word |TIOalue <<0shift.oenM 	=ptl(valueP
   _REG(e = d=_   PDR)).o-	__@
as
++_SCONT(SCONTIGMEM@
as
++_SCONT(SCONTIGM 	   DBG(4,+eci_eq i1_00(		_eq i-	_word@9nd08x=9nd tal_
 @enab t
@@ -2CMD(dev,whe	i),word-.d_Eoto \
+   nux/_SUCCESSFUL;h)ex -78C11R+177
11Rf not
 @opyrP1pcess that was oe-	__opyr_and_cli(SCONTIGMEMopyr_and_cli(SCONTIGM 	=ptl(t
@@ -2CMD(dev,whe	i),
   _REG(e = d=_   PAR)).oe	=ptl(valueP
   _REG(e = d=_   PDR)).o-	__@
as
++_SCONT(SCONTIGMEM@
as
++_SCONT(SCONTIGM 	   DBG(4,+eci_eq i1_00(		_eq i-	_dword@9nd08x=9nd tal_
 @enab t
@@ -2CMD(dev,whe	i),value-.d_Eoto \
+   nux/_SUCCESSFUL;t)ex 233
+ma232e.of nobgTnux/32-a
@@b8 Tnux/ handlinpcpond    _n0Ue nux/ rn;s:$	"ofg,
eleciSstruct *m iFI_SOLyetNRE_Fio N@)
-eutFIG_es leftZ- *-		 G_SMcoE_Fitenurc.  Cur_endlytan   -(r ntentbi g_ENGea@)
-atMcoE_
 
+(imeshat mi		 G_SMcoE_Fitenurc.  Cur_endlytan   -(r ntentbi g_ENGa@)
-atMcoE_
 
+(imeshaabgneenareaGzbH_t
@@ -2   _nux/t)ex 4w7,54 +4w6static 	oto \
+-tr.d_}_H -ES <
-ecibiosOupdat Totsource=y    cCeci_devprdev,
8 12:29otsource *ooot,U-7		8 12:29otsource *ots,
st40otsourceIm-{
-	u32hg t,  b,ckSU_	 STBreg;
-
-	g t ||ots-> n
  h| (ots->SCONT-&    _REGION_FLAG& 0x7f; -	SUR	otsource < 6)led_		reg =
   _pF T_CH)/ESS_E_+ 4*otsource.o-	} ) {
@@ -5otsource ==
   _ROM_RESOURCE)led_		res->SCONT-|=
   _ROM_CH)/ESS_ENfile.o-		g t |=
   _ROM_CH)/ESS_ENfile.o-		reg =
dev->oom/led__reg;
-M}+if [st
-	:/efSomebody mO.:6 hurce -i)
-a  de"K:$	"ofgaI_Sn-+	 ndERI_otsource */o-		reAe.o0y-	} -	
-	eci_00(		_eq i-	_dword(dev,
 20_hg tf; -	eci_nuxd_eq i-	_dword(dev,
 20_h& b,ckf; -	SUR	(g t ^  b,ck)7&t	(g t &
   _pF T_CH)/ESS_SPACE_IOo ?
   _pF T_CH)/ESS_IO& 0x7 :
   _pF T_CH)/ESS_MEM& 0x7f)led_		) - 1;
KERN_ERR "   : E -(r n= chiupdatingdengi$	""m-7	on Bo  "%s/%dI(%08x_!= %08x)tal_ dev->slot+		/*,-otsource_m-7	on Bo  g t,  b,ck).o-	} -}
-
-ioZ- * Wes3"y" 
3taCON
+c(COimm, ssg tot`mi -(red' VGA 
 obsZ- * a
@@omory strange ISA)hFIGwa	i,-001we alwayssganttildZ- * a sources 
3tbi a  de"K)
-		 ,
elf,+++-f,+ffdengi$	Z- * $CONFolf,400._-n*/o-ES <
-ecibiosO_sign_otsource=h a prdata,o8 12:29otsource *ots,B@ vNRE_FGENERI21SMdm-{
-	SUR	ots->SCONT-& _ORESOURCE_IOoled_		@ vNRE_FGENERI2n
  h||ots-> n
  ;
-
-	IG_ (en
   &4f,300oh{U-7		8 
  h||(en
   +ke_uff)7&t~e_uff.o-	ile s-> n
  h|| n
  .o-	i} -	}e-}
-
-
	7S   _nnnnA  de"K)Sild);ridg no
@@deviceiotsourcescond/hR_CP=93,53 +544static 	ecibiosO_ssign_otsources(-.d_}_H -st40
cibiosO_C[1],hdevice=y    cCeci_devprdevIm-{
-	u16$cmc,-rld_cmcSU_	 STBidx= -	8 12:29otsource *o;
-
-	eci_nuxd_eq i-	_word(dev,
   _;
MMAND, &cmc).o-	rld_cmc_SH4mcSU_	G_S(Gdx=0;Bidx<6;Bidx++)led_		r7
-&dev->otsource[Gdx]= -	:SUR	 r-> n
  h_par->0] )led_		=) - 1;
KERN_ERR "   : Devicei%FI_SOLavail[1], becau{
"ofgotsource c(COimm, stal_ dev->slot+		/*).o-	ile unsi]-EINVAL.o-	i} -	:SUR	r->SCONT-& _ORESOURCE_IOoa-	ilcmc_|=
   _;
MMAND_IO; -	:SUR	r->SCONT-& _ORESOURCE_MEM)a-	ilcmc_|=
   _;
MMAND_MEMORY; -	} -	SUR	dev->otsource[   _ROM_RESOURCE]. < ob)2-ilcmc_|=
   _;
MMAND_MEMORY; -	SUR	emc_!= rld_cmc)led_		) - 1;
KERN_INFO "   : EC[1]inpFdevicei%FI(%04x -> %04x)tal_ dev->		/*,-rld_cmc, cmc).o-		eci_00(		_eq i-	_word(dev,
   _;
MMAND, cmc).o-	} -	oto \
+00y-}
-
-ioZ- * nIfNwce driupgaIdeviceiG_SM;CON@ -terinp,Nwce3"y" 
3t b,ckno
@@ vdZ- * nild)l"K)ncy+(imerias1it+ma.4_SOL.9Spropetlyt vd._-n*/o- 2ll+n)
-			p
cibiosOmax_l"K)ncy+= 255;
-
-ES <cecibiosOsetT@ -ter=y    cCeci_devprdevIm-{
-	u8)l"K; -	eci_nuxd_eq i-	_oytS(dev,
   _LATENCY_TIMER, &l"Kf; -	SUR	l"K < 16)2-ill"K ||(64 <x4
cibiosOmax_l"K)ncyo ?
64 :4
cibiosOmax_l"K)ncy; -	) {
@@ -5l"K >4
cibiosOmax_l"K)ncyo2-ill"K ||
cibiosOmax_l"K)ncy; -	) {
o-		reAe.o0y-	) - 1;
KERN_INFO "   : Settingdl"K)ncy+(imeriofgdevicei%FI
3t%dtal_ dev->		/*,-l"Kf; -	eci_00(		_eq i-	_oytS(dev,
   _LATENCY_TIMER, l"Kf; -}  di7SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/di7S 
8 +4665C11R+56944ry s 	   DBG(2,"SettingdIOS)G_SMsloti%FI
3t%dtal_ dev->slot+		/*,-8rqION c 	oto \
+8rq.d-}
-
-ES <caONFIG_ecibiosOupdat T8rq-y    cCeci_devprdev,
st408rqIm-{
-	   DBG(3,"   : Updat dIOS)G_SM%HPTE08rqt%dtal_ dev->		/*,-8rqION-	eci_00(		_eq i-	_oytS(dev,
   _INTERRUPT_LINE,-8rqION } PCoO" = " e_ANDla,
elag to
n);
+	lh>
+uO"  51_S0ct(cobto
Bcd9A_st40 nit.c	Thu Sep h0:02:03 d9A_st40 nP6 +35,9 @@
 #include <ahde <asm/d9A_st40 netup_dc.o io_dc.o rtc-aica.o
 
 ifeq ($(CONFIG_SH_Gd9A_st40 neSes boNaiga/53dORY_Schaet)ex 458,91ma458static d_}_H -st40
cibiosO_C[1],hdevice=y    cCeci_devprdevIm-{
-
-	u16$cmc,-rld_cmcSU_	 STBidx= -	8 12:29otsource *o;
-
-	eci_nuxd_eq i-	_word(dev,
   _;
MMAND, &cmc).o-	rld_cmc_SH4mcSU_	G_SM(Gdx ||0;Bidx < 6;Bidx++)led_		r7
-dev->otsource +Bidx= -	:SUR	 r-> n
  h_par->0] )led_		=) - 1;
KERN_ERRU-7		on Bo  "   : Devicei%FI_SOLavail[1], becau{
"U-7		on Bo  ""ofgotsource c(COimm, stal_m-7		on Bo  dev->slot+		/*).o-	ile unsi]-EINVAL.o-	i} -	:SUR	r->SCONT-& _ORESOURCE_IOoa-	ilcmc_|=
   _;
MMAND_IO; -	:SUR	r->SCONT-& _ORESOURCE_MEM)a-	ilcmc_|=
   _;
MMAND_MEMORY; -	} -	SUR	emc_!= rld_cmc)led_		) - 1;
+   : _C[1]inpFdevicei%FI(%04x -> %04x)tal_m-7	on Bo  dev->slot+		/*,-rld_cmc, cmc).o-		eci_00(		_eq i-	_word(dev,
   _;
MMAND, cmc).o-	} -	oto \
+00y-e-}
-
 ES <caONFIG_ecibiosOfixup_;CO(y    cCeci_;CON*;COImled_}
-
-ES <cecibiosO_sign_otsource=h a prdata,o8 12:29otsource *ots,U-7		on B@ vNRE_FGENERI21SMdm-{
-}
-
-ES <caONFIG_ecibiosOupdat Totsource=y    cCeci_devprdev,U-7			n Bo8 12:29otsource *ooot,U-7			n Bo8 12:29otsource *ots,
st40otsourceIm-{
-
-	u vNRE_FGENERIwhe	i,-21SM;
-	u32hreg;
-
-	) - 1;
+   : AssigninpF%3s %08lxI
3t%stal_m-7on Bo  ots->SCONT-& _ORESOURCE_IO ?
"IO" :4"MEMl_m-7on Bo  ots-> n
  _ dev->		/*);
-
-	whe	i =
   _pF T_CH)/ESS_E_+ otsource * 4= -	8izde||ots->0]  -|ots-> n
  ;
-
-	eci_nuxd_eq i-	_dword(dev,
whe	i,-&reg).o-	reg =
(reg &I21SMdh| (((u32)R	ots-> n
  h-|ooot-> n
  ))7&t~81SM-.d-	eci_00(		_eq i-	_dword(dev,
whe	i,-reg).o-
-}
-
-
-ES <caONFIG_ecibiosOupdat T8rq-y    cCeci_devprdev,
st408rqIm-{
-	) - 1;
+   : AssigninpFIOS)%02dI
3t%stal_08rq Tdev->		/*);
-	eci_00(		_eq i-	_oytS(dev,
   _INTERRUPT_LINE,-8rqION-}
-
-ioZ- * nIfNwce driupgaIdeviceiG_SM;CON@ -terinp,Nwce3"y" 
3t b,cknild)l"K)ncyZ- * niimerias1cer(ain crappy nux/esdH_Hgetl
3t driIG_eropetly._-n*/o- 2ll+n)
-			p
cibiosOmax_l"K)ncy+= 255;
-
-ES <cecibiosOsetT@ -ter=y    cCeci_devprdevIm-{
-	u8)l"K; -	eci_nuxd_eq i-	_oytS(dev,
   _LATENCY_TIMER, &l"Kf; -	SUR	l"K < 16)2-ill"K ||(64 <x4
cibiosOmax_l"K)ncyo ?
64 :4
cibiosOmax_l"K)ncy; -	) {
@@ -5l"K >4
cibiosOmax_l"K)ncyo2-ill"K ||
cibiosOmax_l"K)ncy; -	) {
o-		reAe.o0y-	) - 1;
"   : Settingdl"K)ncy+(imeriofgdevicei%FI
3t%dtal_ dev->slot+		/*,-l"Kf; -	eci_00(		_eq i-	_oytS(dev,
   _LATENCY_TIMER, l"Kf;  } PCoO" = " e_ANDla,
elag to
n);
+	lh>
+uO"  51_S0ct(cobto
Bcd9Abios nit.c	Thu Sep h0:02:03 d9Abios nP6 +35,9 @@
 #include <ahde <asm/d9Abios n8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !oonux1Rd9Abios n8AGa,
elNcu &inpF T ble ch@@
nux1R(w4G26O"l0_CPU_	+e_HP69d9Abios nthen
1G_MEfin8/24 /533o r9 dwmw2s$CONFI	$(MAKE)u Sep h0:02:03 d9Abios nP	$(MAKE)/spR+isSGPL'"y"	$(MAKE)Provided)he	inare1g_ENGIN-rn;s:$	s<tr:IG *	ecibiosOupdat Totsource=)IG *	ecibiosO_sign_otsource=)IG *	ecibiosO_C[1],hdevice=)IG *	ecibiosOsetT@ -ter=)IG *	ecibiosOupdat TPCI")P	$(MAKE)/s#{
@struct *m are1c(COected)he	in(ch0"duceiduplie"K:$	"ofgcommonMAKE)# TheamongstP"$eXT~ny pl"KB1rmYS); CO;  b8 Tsobj-y )# The
n);sy"	$(MAKE)Pl"KB1rmYS); CO;  
n);s are1expected)(chprovide:IG *	ecibiosOfixup_;CO()IG *	ecibiosONFIG()IG *	ecibiosOsetup()IG *	ecibiosOfixup_p;CO_rangeO()IG *inpF T ble ch@@
nux1Rffset(pmd, vmaddr);
+		if (pci	mhiIG_SH_"(w]i-		chi+d lUhNhGalES <
+ecibiosOupdat Totsource=y    cCeci_devprdev,
8 12:29otsource *ooot,U+7		8 12:29otsource *ots,
st40otsourceIm@@ -hu32hg t,  b,ckSU+	 STBreg;
E_Fug t ||ots-> n
  h| (ots->SCONT-&    _REGION_FLAG& 0x7f; +	SUR	otsource < 6)led+		reg =
   _pF T_CH)/ESS_E_+ 4*otsource.o+	} ) {
@@ -5otsource ==
   _ROM_RESOURCE)led+		res->SCONT-|=
   _ROM_CH)/ESS_ENfile.o+		g t |=
   _ROM_CH)/ESS_ENfile.o+		reg =
dev->oom/led__reg;
EM}+if [st
@@ /efSomebody mO.:6 hurce -i)
-a  de"K:$	"ofgaI_Sn-+	 ndERI_otsource */o@@ leAe.o0y"	}12	MEMeci_00(		_eq i-	_dword(dev,
 20_hg tf; +	eci_nuxd_eq i-	_dword(dev,
 20_h& b,ckf; +	SUR	(g t ^  b,ck)7&t	(g t &
   _pF T_CH)/ESS_SPACE_IOo ?
   _pF T_CH)/ESS_IO& 0x7 :
   _pF T_CH)/ESS_MEM& 0x7f)led+		) - 1;
KERN_ERR "   : E -(r n= chiupdatingdengi$	""m+7	on Bo  "%s/%dI(%08x_!= %08x)tal_ dev->slot+		/*,-otsource_m+7	on Bo  g t,  b,ck).oEM}dp ];* CPU_	+eWes3"y" 
3taCON
+c(COimm, ssg tot`mi -(red' VGA 
 obsZ+ * a
@@omory strange ISA)hFIGwa	i,-001we alwayssganttildZ+ * a sources 
3tbi a  de"K)
-		 ,
elf,+++-f,+ffdengi$	Z+ * $CONFolf,400._+Il 1KES <cecibiosO_sign_otsource=h a prdata,o8 12:29otsource *ots,B@ vNRE_FGENERI21SMdm7 12:SUR	ots->SCONT-& _ORESOURCE_IOoled+		@ vNRE_FGENERI2n
  h||ots-> n
  ;
+
@@ SUR	en
   &4f,300oh{U+7		8 
  h||(en
   +ke_uff)7&t~e_uff.o+	ile s-> n
  h|| n
  .o2,	}y"	}12 ];* st40
cibiosO_C[1],hdevice=y    cCeci_devprdevIm@@ -hu16$cmc,-rld_cmcSU+	 STBidx= +	8 12:29otsource *o;
+ +	eci_nuxd_eq i-	_word(dev,
   _;
MMAND, &cmc).o+	rld_cmc_SH4mcSU+	G_S(Gdx=0;Bidx<6;Bidx++)led+		r7
-&dev->otsource[Gdx]= +	:SUR	 r-> n
  h_par->0] )led+		=) - 1;
KERN_ERR "   : Devicei%FI_SOLavail[1], becau{
"ofgotsource c(COimm, stal_ dev->slot+		/*).o+	ile unsi]-EINVAL.o2,	}y"	:SUR	r->SCONT-& _ORESOURCE_IOoa+	ilcmc_|=
   _;
MMAND_IO; +	:SUR	r->SCONT-& _ORESOURCE_MEM)a+	ilcmc_|=
   _;
MMAND_MEMORY; "	}12	SUR	dev->otsource[   _ROM_RESOURCE]. < ob)2+ilcmc_|=
   _;
MMAND_MEMORY; "	SUR	emc_!= rld_cmc)led+		) - 1;
KERN_INFO "   : EC[1]inpFdevicei%FI(%04x -> %04x)tal_ dev->		/*,-rld_cmc, cmc).o+		eci_00(		_eq i-	_word(dev,
   _;
MMAND, cmc).o"	}12	oto \
+00yp ];* CPU_	+enIfNwce driupgaIdeviceiG_SM;CON@ -terinp,Nwce3"y" 
3t b,ckno
@@ vdZ+ * nild)l"K)ncy+(imerias1it+ma.4_SOL.9Spropetlyt vd._+ &inp+void ptr			p
cibiosOmax_l"K)ncy+= 255;
+1KES <cecibiosOsetT@ -ter=y    cCeci_devprdevIm@@ -hu8)l"K; +	eci_nuxd_eq i-	_oytS(dev,
   _LATENCY_TIMER, &l"Kf; +	SUR	l"K < 16)2+ill"K ||(64 <x4
cibiosOmax_l"K)ncyo ?
64 :4
cibiosOmax_l"K)ncy; +	) {
@@ -5l"K >4
cibiosOmax_l"K)ncyo2+ill"K ||
cibiosOmax_l"K)ncy; +	) {
o@@ leAe.o0y"	) - 1;
KERN_INFO "   : Settingdl"K)ncy+(imeriofgdevicei%FI
3t%dtal_ dev->		/*,-l"Kf; +	eci_00(		_eq i-	_oytS(dev,
   _LATENCY_TIMER, l"Kf; tCIiP
 G_SHaONFIG_ecibiosOupdat T8rq-y    cCeci_devprdev,
st408rqIm@@ -heci_00(		_eq i-	_oytS(dev,
   _INTERRUPT_LINE,-8rqIONtCI(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Ge0x20;
 nit.c	Thu Sep h0:02:03 d0x20;
 nP6 +35,9 @@
 #include <ahde <asm/d0x20;
 n8 +42=pr G;k21:24:52c-aica.o
 
 ifeq ($(CONFIG_SH_Gd0x20;
 n8Ses boNaiga/53dORY_Schaet)ex -C4R(w44ry size' CONFd0x20;
 nthen
3300000
 3/25 j-$(6:15
+if [ "$CONFIG_SH_HP69d0x20;
 nthen
34G_MEfine_30a/5342:G;kDISCONTIGMEM y
+else
it.c	Thu Sep h0:02:03 d0x20;
 nPy
+e8 +41w441R(w14G3 esponE)/spR+t
 
+handlesnild)u Se(		cAe.e-dee.o
 N@Mpay s ofgd0x20;
 handlinpccpond/hG_-#defLi)y__KERNEL_SYSCALLS__d-unsigned lstdER		chi-d-unsigned l
nux1R(w]i-		chi-d-unsigned l
nux1R  -no	chi-T ble ch@@
nux1Rs\
 	pmd,-T ble ch@@
nux1Rffset(pmd,-T ble ch@@
nux1Rmm	chi-T ble ch@@
nux1Rsmp	chi-T ble ch@@
nux1Rsmp_ dek	chi-T ble ch@@
nux1Rstddef	chi-T ble ch@@
nux1Rptrace	chi-T ble ch@@
nux1Rsl[1	chi-T ble ch@@
nux1Rvma  de	chi-T ble ch@@
nux1Ru{
r	chi-T ble ch@@
nux1Ra.out	chi-T ble ch@@
nux1R -3e7751 hchi vmaddr);
+		if (unistd	chi-T ble ch@@
nux1Rdelay	chi-T ble ch@@
nux1Rreboot	chi-T ble ch@@
nux1R -it	chi-T ble ch@@
nux1R 




(eT ble ch@@
nux1Rsl[1	chi d-unsigned long uotalra.T b-unsigned long pgt[1],.T b-unsigned long  ystemGm_area_struct inc31IGm_a-unsigned long p0x20;
-	Gm_aleAe.o t/spR+G*uotalra.T b eAe.o t/spR+G* mu_eq tex@Gm_a eAe.o t/spR+G*elf	chi-T GzbH_t
@@ -2SH_STANDARD_nux/t-unsigned long  h_bios chi-T@@ vNR - +	 pF Tst40hlt_equ-3e7=GSU 
8 +471
11ma44,1.of no@cur_end->equ-3e7 ||-100ON c 	n= chi(1)led_		n= chi(!cur_end->3"y"_ots\
 	)led_		=@ -5hlt_equ-3e7)a-	il	eq tnuxe; +	:SUR	hlt_equ-3e7)led+		=SUR	eur_end->3"y"_ots\
 	)d+		=	bnuxkSU bM}+if [st
@@ 	__cli().o+	iln= chi(!cur_end->3"y"_ots\
 	)led+		=	__sti().o+	il	ong init_tas("sleep" :4:4:4"AMCAST").o+	il	__cli().o+	il}no@7	__sti().o-il	ong init_tas("sleep" :4:4:4"AMCAST").o il}no@7s\
 	uas().o il b,ck_pgt_cT b,().o)ex 84,16NI63,15atic d_ G_SH@ chLi)_@
asay (chFInE)__unu * )mled_T GzbH_t
@@ -2SH_STANDARD_nux/t-	 h_bios_shutdowt(1 ; -T@@ vNR1_SOLSR.BL=1to
@@_nvoke
- sourcs  -(r 
3tldriCPUgotsdri(manual_ensdr)bgne+	ong init_tas("ldc %0,o8r\n\t"m+7	on Bo"mov.l @%1, %0" :4:4"r" (0x1+++NRE0=,4"r" (0x80@ vNR1 -.d_}_H _ G_SH@ chLi)_halta ze) fst
_T GzbH_t
@@ -2SH_STANDARD_nux/t-	 h_bios_shutdowt(0 ; -T@@ vNR1_n= chi(1)m+7	ong init_tas("sleep" :4:4:4"AMCAST").o }_H _ G_SH@ chLi)_power_offa ze) f(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Getrace	nit.c	Thu Sep h0:02:03 dtrace	nP6 +35,9 @@
 #include <ahde <asm/dtrace	n8 +42dc.o25 17:10 r9 -aica.o
 
 ifeq ($(CONFIG_SH_Gdtrace	n8tup_boNa18
 ob56 r9 -aica)ex -C4R(w44ry size' CONFdtrace	nthen
600000
 6/08 23:44:50
+if [ "$CONFIG_SH_HP69dtrace	nthen
12G_MEfine_23 j-$(0b56kDISCONTIGMEM y
+else
t.c	Thu Sep h0:02:03 dtrace	nPy
+e8 +4122,24R(w22,39Rf not
 @.o 
+objl(nex@pc1, UBC_BARA).o i.o 
+objb(asid, UBC_BASRA).o_T G defLi)d(t
@@ -2CPU_SUBTYPE_e = 09)a-	.o 
+objl(f,+fff, UBC_BAMRA).o_T) {
o-	.o 
+objb(BAMR_12, UBC_BAMRA).o_T)@ vNR-a.o 
+objw(BBR_INST | BBR_READ, UBC_BBRA).o+	SU(UBC_TYPE_e = 29){-dma.o 
+objl(f,+fff, UBC_BAMRA).odma.o 
+objw(BBR_INST | BBR_READ | BBR_CPU, UBC_BBRA).o+	}) {
{-dma.o 
+objb(BAMR_12, UBC_BAMRA).odma.o 
+objw(BBR_INST | BBR_READ, UBC_BBRA).o+	}4oSH_codenex@pc2_!= t\
 	 SH2000			+41Ist
 @ .o 
+objl(nex@pc2, UBC_BARB).o il o 
+objb(asid, UBC_BASRB).o_T G defLi)d(t
@@ -2CPU_SUBTYPE_e = 09)a-		.o 
+objl(f,+fff, UBC_BAMRA).o_T) {
o-	a.o 
+objb(BAMR_12, UBC_BAMRB).o_T)@ vNR-aa.o 
+objw(BBR_INST | BBR_READ, UBC_BBRB); +	:SU(UBC_TYPE_e = 29){-dma	.o 
+objl(f,+fff, UBC_BAMRB); +	:a.o 
+objw(BBR_INST | BBR_READ | BBR_CPU, UBC_BBRB); +	:}) {
{-dmaa.o 
+objb(BAMR_12, UBC_BAMRB).o+	:a.o 
+objw(BBR_INST | BBR_READ, UBC_BBRB); +	:}d_E} -a.o 
+objw(BRCR_PCBA | BRCR_PCBB, UBC_BRCR).o+	SU(UBC_TYPE_e = 29)-dma.o 
+objl(BRCR_PCBA | BRCR_PCBB | BRCR_PCTE, UBC_BRCR).o+	) {
o@@ .o 
+objw(BRCR_PCBA | BRCR_PCBB, UBC_BRCR).o+ ];* CPU_	+eCa  )
-ey IG_SH_Getrace	niwhen de21,13npccp	$(MAKE)M~ke
su	inGinpFi step-eiecs tc are1_SOL vd._+ &inpES <cetrace__&inpF -y    cCt -i_y    cC*,13l) f@@ -h_SHnomoingd
3tdo..;gnee}4oSHongt.ckageTst40 ys_etrace(00		_enqu
as,GENERIpid, ENERIain_stENERIdata)M8 +4337,21NI352,9atic 		bnuxkSU_E}   -a.CASTPTRACE_DETACH: {i7S de21,1 agd0x20;
 t atlwaHP;
21,1 	p */o-		reA ||-EIO; -	:SUR	t\
 	 SH2000			+data > _NSIG)a-	ilbnuxkSU-aa.13l)->etrace+BIGSU_	a.13l)->exit_eqde+BIdataSU_	a00(		_ dekT8rq-&t -ilist_ dek).o-ilREMOVE_LINKS(,13l) SU-aa.13l)->e_petr_SH413l)->e_opetrSU-aaSET_LINKS(,13l) SU-aa00(		_un dekT8rq-&t -ilist_ dek).o-ilwAsspup_p0x20;
(,13l) SU-aareA ||VE_1b.CASTPTRACE_DETACH: 7S de21,1 agd0x20;
 t atlwaHP;
21,1 	p */o+aareA ||etrace__e21,1(,13l),Idata);c 		bnuxkSU-	}4oSH_.CASTPTRACE_SETOPTIONS:st
 @ SUR	data &TPTRACE_O_TRACESYSGOOD f(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Grtc-aica	nit.c	Thu Sep h0:02:03 rtc-aica	nP6 +35,9 @@
 #include <ahde <asm/rtc-aica	n8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !oonux1Rrtc-aica	n8AGa,
elNcu &inpF T ble ch@@
nux1R(w470O"l0_CP u Sep h0:02:03 rtc-aica	nP	$(MAKE)D- vmcastXAICAXRTCdibed
+ F.,
+		   rey' CO.:6 2c1,8 +1 M. R. Brown <mrbrowt@0xd6.org>"	$(MAKE)Releas, Tct *rhild)terms<tra,
elGNU~ PL35,90.,
+		   inpF T ble ch@@
nux1Rtimesive+bleAe.o t/spR+G*FIGm_al0_CP 0Ue AICAXRTCdhaHP;n Epo,1 tra1/1/1950,T001we  XhDSsubtract,8  years (in_ if seeq dFI
3tgettild)+	 ndERI_Unix Epo,1 when gettingdild)ti/*,-o
@@ain,8 _ if years when settingdild)ti/*p */o+#defLi)yTWENTY_YEARSR	t8  * 365LU + 5)bg 864E0=al0_CP 0Ue AICAXRTCdis_enpensdN@)
-ey ag32-bIG__peq dFIequ-3e7 as
++
-		 2
 o-bIG_ if engisters.*/o+#defLi)yAICA_RTC_SECS_H		f,a071+++No+#defLi)yAICA_RTC_SECS_L		f,a071+++4al0_CP(MAKE)uica+-tc_gettimeofday - Gettild)time;ASK_Sild)AICAXRTCMAKE)@tv:le chGern(ch0"sultingdiimeval"	$(MAKE)Grabsnild)cur_endXRTCd_peq dFIequ-3e7 o
@@aijXhDs1it+(child)Unix Epo,1._+ &inpES <caica+-tc_gettimeofday-y    cCtimeval_*tv)led+	@ vNRE_FGENERIval1, val2;
+ +	doled+		val1 ||((.o 
+NFl=AICA_RTC_SECS_H) &4f,ffff) <<016) |o+	:a(.o 
+NFl=AICA_RTC_SECS_L) &4f,ffff);
+
@@ val2 ||((.o 
+NFl=AICA_RTC_SECS_H) &4f,ffff) <<016) |o+	:a(.o 
+NFl=AICA_RTC_SECS_L) &4f,ffff);
+	} n= chi(val1 !TIOal2);
+
@@tv->tv__pe TIOal1 - TWENTY_YEARS;
+
@@PU_Can'ttgettmicro_peq dFIg totjXhDFae peq dFIequ-3e7p */o+atv->tv_u_pe TI00yp ];* CP(MAKE)uica+-tc_settimeofday - Settild)AICAXRTCd(child)cur_endXtimeMAKE)@tv:leq (ainstild)timeval_
3t dr"	$(MAKE)AijXhDs1ild)g(ARn)@tvd(child)AICAXEpo,1 o
@@ vds1ild)RTCd_peq dFIequ-3e7._+ &inparchaica+-tc_settimeofday(XRDY =y    cCtimeval_*tv)led+	@ vNRE_FGENERIval1, val2;
+	@ vNRE_FGENERI2ecs TItv->tv__pe + TWENTY_YEARS;
+
@@doled+		.o 
+objl((2ecs &4f,ffffNRE0= >> 16, AICA_RTC_SECS_H);d+		.o 
+objl((2ecs &4f,ffff), AICA_RTC_SECS_L);
+
@@ val1 ||((.o 
+NFl=AICA_RTC_SECS_H) &4f,ffff) <<016) |o+	:a(.o 
+NFl=AICA_RTC_SECS_L) &4f,ffff);
+
@@ val2 ||((.o 
+NFl=AICA_RTC_SECS_H) &4f,ffff) <<016) |o+	:a(.o 
+NFl=AICA_RTC_SECS_L) &4f,ffff);
+	} n= chi(val1 !TIOal2);
+
@@oto \
+00yp ](MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Gsetup	nit.c	Thu Sep h0:02:03 setup	nP6 +35,9 @@
 #include <ahde <asm/setup	netup_dc.o io_dc.o rtc-aica.o
 
 ifeq ($(CONFIG_SH_Gsetup	neSes boNaiga/53dORY_Schaet)ex -C4R(w44ry size' CONFsetup	nthen
F000000
 3/05 02:44:41
+if [ "$CONFIG_SH_HP69setup	nthen
31G_MEfin8/23
 ob36:40 dwmw2s$CONFI  *else
it.c	Thu Sep h0:02:03 setup	nPy
+e8 +43+# I+38
tatic unsigned long  ystemGm_area_struct inc31IGm_a unsigned long 2upg_ENGIN.T b-unsigned long  mp	chi eAe.o t/spR+G* =RAvecGm_areaGzbH_t
@@ -2SH_EARLY_PRINTKc unsigned long  h_bios chi)ex 4+# I+47,12 esponE)M~ +Li)ysetup	cpond/hG_-8 12:29:h_cpuSTB1 boot_cpu_data = {iCPU_SH_NONE,-0,-0,-0,-}; TCPU_	+e_area_sizdeloops_eer_jMAK.4as11+++NRE0 (1+++MIPS0._+eE)/spR+Oalue ntentbi u * iattild)very earlyt tageTtrasNGIal_setup	ZE, ~0Ue biggurEOalue meanFI_Sgd0xpF m._+ &inp8 12:29:h_cpuSTB1 boot_cpu_data = {iCPU_SH_NONE,-0,-1+++NRE0,-}; o8 12:29:creen_STB1 :creen_STB1; o@ vNRE_FGchFInauxhdevice_pensdN@ TI0xaaSU 
8 +4209,14 213e.of no@opyrd_eqmmand_t.ce[;
MMAND_LINE_SIZE-1] TI'\0'ON c 	AMCAST_8 
  h||(\
 	 SH2000			 AGE_OFFSET+__MEMORY@START;
-	io Defaultdis_4MoytSp */o-	AMCAST_0]  ||(\
 	 SH2000			 AGE_OFFSET+f,++4+NRE0+__MEMORY@START;
+	AMCAST_0]  ||AMCAST_8 
  h+ __MEMORY@SIZEON c 	G_SM(;;Ist
 @ 7S 8 +426+# I+271,9atic noES <caONFIG__px/khu Se(chFInE*cmdline_p fst
+T G defLi)d(t
@@ -2SH_GENERIC) || defLi)d(t
@@ -2SH_UNKNOWN)
 @2000			8 12:29:h_T~ +Li)_vse
DMSmv+unknowo0y"T@@ vNR 	8 12:29:h_T~ +Li)_vse
DMS*mvi=sNULL.o i.hFInmv+		/*[MV_NAME_SIZE] TI"";
 @opyrP1pcess thmv+i2/led_ TI00y8 +4356,6NI361C114tic udefLi)yPFN_DOWN(x)	((x) >>  AGE_SHIFT)c udefLi)yPFN_PHYS(x)	((x) <<0 AGE_SHIFT)c * chGzbH_t
@@ -2DISt
@TIGMEM
+	NODE_DATA(0)->bdata = &diseq tng_node_bdata[0]= +	NODE_DATA(1)->bdata = &diseq tng_node_bdata[1];
+
@@bootmap_8izde||in6 +bootmem_node(NODE_DATA(1), o+	il		yPFN_UP(__MEMORY@START_2ND),o+	il		yPFN_UP(__MEMORY@START_2ND),o+	il		yPFN_DOWN(__MEMORY@START_2ND+__MEMORY@SIZE_2ND));
+	free+bootmem_node(NODE_DATA(1), __MEMORY@START_2ND, __MEMORY@SIZE_2ND)GMEM@
aerve+bootmem_node(NODE_DATA(1), __MEMORY@START_2ND, bootmap_8izd)0y"T@@ vNR+   io
 @e* Findtild)hO.:es@Mpage;AS	/* numburEwe hurce vail[1],
 @e*/hR_CP377# I+394e.of no@ mi	sTst4act)  XhDSbi d( t via bootmem_a  de(0._ @e*/h @bootmap_8izde||in6 +bootmem_node(NODE_DATA(0=,48 
  _pfn,U-7				 __MEMORY@START>> AGE_SHIFT, o+	il		y__MEMORY@START>> AGE_SHIFT,no@7			ymax_low_pfnION c 	7S 8 +439se.o
4w6s8If no@7	lastdefn ||Aax_low_pfnON c 		pages TIlastdefn -)cur__pfnON-7	free+bootmem(PFN_PHYS(cur__pfn),
 FN_PHYS(pages));
+		free+bootmem_node(NODE_DATA(0),
 FN_PHYS(cur__pfn),o+	il	 
 FN_PHYS(pages));
 	}4oSH_7S 8 +4409,19o
427,19of no@ mi.CASTtraCON
cci
 N@a  y+in6 a_sizingdild)bootmem a  de"K(r ntthno@ mian@_nv_sid_RAMFanux._ @e*/h-M@
aerve+bootmem(__MEMORY@START+ AGE_SIZE,IG FN_PHYS(8 
  _pfn)h+ a-	ilbootmap_8izde+  AGE_SIZE41Is-y__MEMORY@START)GMEM@
aerve+bootmem_node(NODE_DATA(0), __MEMORY@START+ AGE_SIZE,o+	iG FN_PHYS(8 
  _pfn)+bootmap_8izd+ AGE_SIZE41I-__MEMORY@START)GM    io
 @e* @
aerve physical_page;0s-yit's a0t); Cal_nux/ page;onXT~ny boxts,U @e* _C[1]inpFclean reboots, SMPEopetruct , l"ptop@struct *m._ @e*/h-M@
aerve+bootmem(__MEMORY@START,  AGE_SIZE)GMEM@
aerve+bootmem_node(NODE_DATA(0), __MEMORY@START,  AGE_SIZE)GMnareaGzbH_t
@@ -2BLK_DEV_INITRDSH_codeLOADER_TYPEh_paINITRD@START)st
 @ SUR	INITRD@STARTe+ INITRD@SIZE <x4(Aax_low_pfn <<0 AGE_SHIFT))led_		=@
aerve+bootmem(INITRD@START+__MEMORY@START, INITRD@SIZE).o+	ile aerve+bootmem_node(NODE_DATA(0), INITRD@START+__MEMORY@START, INITRD@SIZE).oo@7	in6 rd_8 
  h|no@7		INITRD@STARTe? INITRD@STARTe+  AGE_OFFSETh+ __MEMORY@STARTe:
0ON @7	in6 rd_0]  ||in6 rd_8 
  h+ INITRD@SIZE;](MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Gsetup_al meb iet.c	Thu Sep h0:02:03 setup_al meb iP6 +35,9 @@
 #include <ahde <asm/setup_al meb i8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !oonux1Rsetup_al meb i8AGa,
elNcu &inpF T ble ch@@
nux1R(w4G36O"l0_CPhat mit.c	Thu Sep h0:02:03 setup_al meb iP
+		   rey' CO.:6 2C1,8 +0  Kazumoto KojimaP
+		   rHi21,13 Soluct *EngLi)ySobj-y cp	$(MAKE)ModCO;)
-G_SM= d=bSoluct * EngLi)ybyU_	+e_an da Silva o
@@Jeremy Siegel,ble c.	   inpF T ble ch@@
nux1R(w]i-		chi+vmaddr);
+		if (+d lUhNhG_PCchild);$	"
+
 




(ehG_PCchild);$	"
+
hdre		chi+vmaddr);
+		if (+de.T bleAe.o t/spR+G*FIGm_aleAe.o t/spR+G*hi21,13_al meb m_al0_CP	   rey]i-	u	inild)SoburE_cod,13p	   inpT G 00_CPhLeftorn;
# The
SK_Sre	ulFInSoluct * EngLi),-G_SMreOe_enc*p */o+CP 0Ue e = d=bSoluct * EngLi)yhaHP; PCoOe_end SoburIO. &inp8  pF TES <caONFIG__msc_eq i-	(st408ndex,
st40data)M@@ -hobjb_p(8ndex,
INDEX_PORT)GMEMobjb_p(data,oDATA_PORT)GME ];* 8  pF TES <caONFIG_in6 +_msca ze) f@@ -hobjb_p(t
@@ -2ENTER,_t
@@ -2 ORT)GMEMobjb_p(t
@@ -2ENTER,_t
@@ -2 ORT)GME
@@PU_FDC */o+a_msc_eq i-	(CURRENT_LDN_INDEX, LDN_FDCIGMEMomsc_eq i-	(ACTIVATE_INDEX, f,+1IGMEMomsc_eq i-	(IRQ_SELECT_INDEX, 6);= 	 IRQ6  inpF @PU_IDE1 */o+a_msc_eq i-	(CURRENT_LDN_INDEX, LDN_IDE1IGMEMomsc_eq i-	(ACTIVATE_INDEX, f,+1IGMEMomsc_eq i-	(IRQ_SELECT_INDEX, 14);= 	 IRQ14  inpF @PU_AUXIO (GPIO):d(chu{
"IDE1 */o+a_msc_eq i-	(CURRENT_LDN_INDEX, LDN_AUXIOIGMEMomsc_eq i-	(GPIO46_INDEX, f,+0= + 	 nIOROP */o+a_msc_eq i-	(GPIO47_INDEX, f,+0= + 	 nIOWOP */o+
@@PU_COM1 */o+a_msc_eq i-	(CURRENT_LDN_INDEX, LDN_COM1IGMEMomsc_eq i-	(ACTIVATE_INDEX, f,+1IGMEMomsc_eq i-	(IO_pF T_HI_INDEX, f,+3IGMEMomsc_eq i-	(IO_pF T_LO_INDEX, f,f8IGMEMomsc_eq i-	(IRQ_SELECT_INDEX, 4);= 	 IRQ4 */o+
@@PU_COM2 */o+a_msc_eq i-	(CURRENT_LDN_INDEX, LDN_COM2IGMEMomsc_eq i-	(ACTIVATE_INDEX, f,+1IGMEMomsc_eq i-	(IO_pF T_HI_INDEX, f,+2IGMEMomsc_eq i-	(IO_pF T_LO_INDEX, f,f8IGMEMomsc_eq i-	(IRQ_SELECT_INDEX, 3);= 	 IRQ3 */o+
@@PU_RTCd*/o+a_msc_eq i-	(CURRENT_LDN_INDEX, LDN_RTCIGMEMomsc_eq i-	(ACTIVATE_INDEX, f,+1IGMEMomsc_eq i-	(IRQ_SELECT_INDEX, 8);= 	 IRQ8 */o+
@@PU_XXX:  AR ORT, KBD,-o
@@MOUSE ntentco/* he	i...;gneEMobjb_p(t
@@ -2EXIT,_t
@@ -2 ORT)GME}y"T@@ vNR+ TCPU_	+e_area_sizdeIOS)setting_+ &inpES <caONFIG_in6 +al mebOIRQa ze) f@@ -_ ifCPhLeurceoI"mSoluct * EngLi)y# The		 G_SMreOe_enc*p */o+T G defLi)d(t
@@ -2SH_SOLUTION2ENGINE)
@@PU
@@b*)SoburE_cod(JXhDSmim;  b8):
@@b*) 1: keyboard
@@b*) 3:asNGIal_0
@@b*) 4:asNGIal_1
@@b*) 5:b) - 1er_E@b*) 6: floppy_E@b*) 8: rtc_E@b*)&in mou{
o@@b*)&4:a+de0
@@b*neEMCAss_iprT8rq-14, BCR_ILCRA,bl, f,+f-14);eEMCAss_iprT8rq-12, BCR_ILCRA,b1, f,+f-12IG eEMCAss_iprT8rq- 8, BCR_ILCRB,b1, f,+f- 8);=eEMCAss_iprT8rq- 6, BCR_ILCRC, 3, f,+f- 6);eEMCAss_iprT8rq- 5, BCR_ILCRC, l, f,+f- 5);eEMCAss_iprT8rq- 4, BCR_ILCRC, 1, f,+f- 4);eEMCAss_iprT8rq- 3, BCR_ILCRC, 0, f,+f- 3);eEMCAss_iprT8rq- 1, BCR_ILCRD, 3, f,+f- 1)GME
@@CAss_iprT8rq-10, BCR_ILCRD, 1, f,+f-10= + 	 LAN */o+
@@CAss_iprT8rq- 0, BCR_ILCRE, 3, f,+f- 0= + 	    RQ3 */o+@CAss_iprT8rq-11, BCR_ILCRE, l, f,+f-11= + 	    RQ2 */o+@CAss_iprT8rq- 9, BCR_ILCRE, 1, f,+f- 9= + 	    RQ1 */o+@CAss_iprT8rq- 7, BCR_ILCRE, 0, f,+f- 7= + 	    RQ0 */o+
@@PU_#l, #13 are1a  de"K)
-G_SMSLOTeIOS)#1to
@@#2 (G_SMnow)bgne+	io NOTE:@#2 o
@@#13 are1_SOLu * io
+   */o+@CAss_iprT8rq-13, BCR_ILCRG, 1, f,+f-13);= 	 SLOT RQ2 */o+@CAss_iprT8rq- 2, BCR_ILCRG, 0, f,+f- 2);= 	 SLOT RQ1  inpF Tel G defLi)d(t
@@ -2SH_= d=_SOLUTION2ENGINE)
@o+@CAss_iprT8rq-13, BCR_ILCRD, 3, 2)GME
@@PU_Ad@@ainict *an0> ens (chCAss_iprT8rq-)4as1drirn;s are1added
@@b*)o
@@tesK)
.
@@b*neET@@ vNR+ T ];*  TCPU_	+e_area_sizdeild)board
@ &inpES <caONFIG_setup_al meba ze) f@@ -h/+eCa  _in6 +_msca)_enplacio N@l
3t driup SoburIO. &inp@PU_XXX: RTCd_pttingdco/*s)he	in&inp ](MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Gsetup_adx iet.c	Thu Sep h0:02:03 setup_adx iP6 +35,9 @@
 #include <ahde <asm/setup_adx i8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !oonux1Rsetup_adx i8AGa,
elNcu &inpF T ble ch@@
nux1R(w440O"l0_CPhat mit.c	Thu Sep h0:02:03 setup_adx iP
+		   rey' CO.:6 2C1,8 +1 A&Drey., Lt"y"	$(MAKE)_codibed
+  o
@@ vdup ibed
+ F-G_SMA&DrADX Board
@ &_+eE)/spR+t
 
+pR+Gubjse
H(child)terms<o
@@eq dit:$	s<tra,
elGNU~ _ENGal PubliiP
+	 Liceneb  ,
edeild)t
 
+"COPYING"-		 ,
elmain +else
AST"tra,
is)u Se(veMAKE)G_SMmy	in_e21ils.,
+		   inpF T ble ch@@R+G*FIGm_aleAe.o t/spR+G* =RAvecGm_a T ble ch@@R+G*F




(eT ble ch@@
nux1R$CONFeUhNhGalES < setup_adxa ze) f@@ -h/+enomoingd
3tdotjXhDFyetN*/o+CP	) - 1;
"setup_adxa)\n"IO&inp ]GalES < in6 +adxOIRQa ze) f@@ -	 STBi;*  TCP	) - 1;
"in6 +adxOIRQa)\n"IO&inph/+e vdup F

T@ -k_engister &inp@F

T@ -k_engister ||(\
 	 SH20sh-y )*)0xa6+NRE08GME
@@PU_corn;
a  _2000		a _in3e7751 Fanux0bT"liskengT8rq_typ
o@@b*)(Actua  y,-8rq15tdoesn'ttexist)
@@b*neEMG_SM(G ||0;Bi < 16;Bi++)led+		CAss_liskengT8rq(i).o+	i_&inpF T8rq(i).o+	}np ](MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Gsetup_bigsur iet.c	Thu Sep h0:02:03 setup_bigsur iP6 +35,9 @@
 #include <ahde <asm/setup_bigsur ietup_dc.o io_dc.o r9c-aica.o
 
 ifeq ($(CONFIG_SH_Gsetup_bigsur ieSes boNaiga/53dORY_Schaet)ex -81C11R+181C12 espo8  pF TES <c@@ _bigsurT8rq(+void ptr			p8rqImst
    	DPRINTK("@@ _bigsurT8rqFIOS)%dtal_08rqf; -	SU(8rqF>= BIGSUROIRQ_LOWh_pa8rqF< BIGSUROIRQ_HIGH)	
-		_C[1],hbigsurTl18rq(irqf; -	) {
o-	a_C[1],hbigsurTl28rq(irqf; +	SUR	!(irq_desc[irq]. < tus &4(IRQ_DISfileD|IRQ_INPROG/ESS)f)led+		SU(8rqF>= BIGSUROIRQ_LOWh_pa8rqF< BIGSUROIRQ_HIGH)	
+	il_C[1],hbigsurTl18rq(irqf; +	i) {
o@@ a_C[1],hbigsurTl28rq(irqf; +	}ee}4oSH8  pF T+void ptr			p8 
  up_bigsurT8rq(+void ptr			p8rqIm(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Gsetup_cqreek iet.c	Thu Sep h0:02:03 setup_cqreek iP6 +35,9 @@
 #include <ahde <asm/setup_cqreek i8 +42=pr G;k21:24:52c-aica.o
 
 ifeq ($(CONFIG_SH_Gsetup_cqreek i8Ses boNaiga/53dORY_Schaet)ex -C4R(w44ry size' CONFsetup_cqreek ithen
600001/02/14 09b36:42
+if [ "$CONFIG_SH_HP69setup_cqreek ithen
9G_MEfine_30a/5343:28kDISCONTIGMEM y
+else
u Sep h0:02:03 setup_cqreek iPy
+e8 +485,15a+85,1tatic 	\
 	 SH20sh-y )8  p_j-y )= cqreekT8rq_data[irq]. < t_j-y ;c 	\
 	 SH20sh-y )bIG_= cqreekT8rq_data[irq].bIGs oe-	inw( < t_j-y ).oo@_&inpF TcqreekT8rq(irqf;   io ClearFIOS)(it+mO.:6 ONTedg nIOS)bgne+	inw( < t_j-y ).oo@objw_p(bIG,  < t_j-y ).oo}4oSH8  pF TES <c@@ _cqreekT8rq(+void ptr			p8rqImst
-a_C[1],hcqreekT8rq(irqf; +	SUR	!(irq_desc[irq]. < tus &4(IRQ_DISfileD|IRQ_INPROG/ESS)f) +	i)C[1],hcqreekT8rq(irqf; e}4oSH8  pF T+void ptr			p8 
  up_cqreekT8rq(+void ptr			p8rqIm)ex -56C16NI157,9atic e*/h ES <caONFIG_setup_cqreeka ze) fst
_@2000			ES <c_&inpF Thlta ze) .oo@ STBi;*= 	 udelay iFI_SOLavail[1], aG_setup)time;yet...;gne udefLi)yDELAYa)_doleG_SM(G=0;Bi<1+++N;Bi++)l.o 
+NFw(f,a0++NRE0=;} n= ch(0)
-
-	ioZ-@b*)XXX: I d( 'ttknow ,
elnuxst , eutFIG_beco/*s)so;AS	g
 
+ntthn-@b*)"sleep",T001we 3"y" 
3tstop@sleepinpcp-@e*/h-M_&inpF Thlta)GM    SUR	tNFw (BRIDGE_FEATURE) &41f)le io WeshurceIDE_in3e7face */o 	@objw_p(0, BRIDGE_IDE_INTR_LVL);
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Gsetup_dc iet.c	Thu Sep h0:02:03 setup_dc iP6 +35,9 @@
 #include <ahde <asm/setup_dc ietup_dc.o io_dc.o r9c-aica.o
 
 ifeq ($(CONFIG_SH_Gsetup_dc ieSes boNaiga/53dORY_Schaet)ex 8,14 8s8If no
+else
Releas, Tct *rhild)terms<tra,
elGNU~ PL35,90.,ond  -eE)/spR+t
 
+oCO.ina  y+bo	inild)/*ssage: -eE	_HP69setup_dc ithen
5G_MEfin5/24 05RY_:16Nmrbrowts$CONFI	$()/spR+t
 
+oCO.ina  y+bo	inild)/*ssage (g totebleos, -$):IG *	HP69setup_dc ithen
5G_MEfin5/24 05RY_:16Nmrbrowts$CO,ond	SEGC)D- vmcastXsobj-y pond/hG_8 +470,21NI70,29atic io D&inpF tild)hFIGwa	i ev N@Moy liskingdiecsbIG_indiecsEMRnd/hG+	 pF Tstline	ES <c_&inpF T ystemasicT8rq(+void ptr			p8rqImst
+@opyrP1pcess that was oh__u32hemr ||EMR_pF T + (LEVEL(irqf <<04) + (LEVEL(irqf <<02)s oh__u32h@ -i;-+MEMopyr_and_cli(SCONTIGM 	@ -i ||NFl=emrIGM 	@ -i 	\
 (1 <<0EVENT_BIT(irqf).oe	=ptl(@ -i, emrIGMEM@
as
++_SCONT(SCONTIGM }  di7S EC[1] tild)hFIGwa	i ev N@Moy _pttingdiecsbIG_indiecsEMRnd/hG+	 pF Tstline	ES <c)C[1],h ystemasicT8rq(+void ptr			p8rqImst
+@opyrP1pcess that was oh__u32hemr ||EMR_pF T + (LEVEL(irqf <<04) + (LEVEL(irqf <<02)s oh__u32h@ -i;-+MEMopyr_and_cli(SCONTIGM 	@ -i ||NFl=emrIGM 	@ -i |||(1 <<0EVENT_BIT(irqf).oe	=ptl(@ -i, emrIGMEM@
as
++_SCONT(SCONTIGM }  di7S Acknowledg na)hFIGwa	i ev N@Moy 00(	ingdiecsbIG_babi 
3tiecsESRe*/hR_CP9+# I+106s8If no7S Af3e7 oFIOS)haHPbeen abi'd<o
@@@
apondy" 
3,FIG_3"y"s 
3tbi r)C[1],dnd/hG+	 pF TES <c@@ _ ystemasicT8rq(+void ptr			p8rqImst
-a_C[1],h ystemasicT8rq(irqf; +	SUR	!(irq_desc[irq]. < tus &4(IRQ_DISfileD|IRQ_INPROG/ESS)f) +	i)C[1],h ystemasicT8rq(irqf; e}4oSH8  pF T+void ptr			p8 
  up_ ystemasicT8rq(+void ptr			p8rqIm(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Gsetup_ec3104 iet.c	Thu Sep h0:02:03 setup_ec3104 iP6 +35,9 @@
 #include <ahde <asm/setup_ec3104 i	Sun May 20a/5311:3tc-aica.o
 
 ifeq ($(CONFIG_SH_Gsetup_ec3104 i	Ses boNaiga/53dORY_Schaet)ex -67# I+-67#8atic no+	 pF TES <c@@ _ec3104T8rq(+void ptr			p8rqImst
-aun@ -k_ec3104T8rq(irqf; +	SUR	!(irq_desc[irq]. < tus &4(IRQ_DISfileD|IRQ_INPROG/ESS)f) +	iun@ -k_ec3104T8rq(irqf; e}4oSH8  pF T+void ptr			p8 
  up_ec3104T8rq(+void ptr			p8rqIm(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Gsetup_hd64461 iet.c	Thu Sep h0:02:03 setup_hd64461 iP6 +35,9 @@
 #include <ahde <asm/setup_hd64461 i8 +42=pr G;k21:24:52c-aica.o
 
 ifeq ($(CONFIG_SH_Gsetup_hd64461 i8Ses boNaiga/53dORY_Schaet)ex -C5R(w45If no7S -eE	_HP69setup_hd64461 ithen
1G_ME0
 6/10k21:45 rtcyaegashis$CONFI	$(	_HP69setup_hd64461 ithen
9G_MEfine_15a23:26b56kDISCONTIGMEM y
+	ey' CO.:6 2C1,8 +0 YAEGCSHI Takeshi y
+	Hi21,13 HD64461McoE_ant * ,13pXsobj-y pond/hR_CP=7# I+57#8atic no+	 pF TES <c@@ _hd64461T8rq(+void ptr			p8rqImst
-a_C[1],hhd64461T8rq(irqf; +	SUR	!(irq_desc[irq]. < tus &4(IRQ_DISfileD|IRQ_INPROG/ESS)f) +	i)C[1],hhd64461T8rq(irqf; e}4oSHm(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Gsetup_hd64465 iet.c	Thu Sep h0:02:03 setup_hd64465 iP6 +35,9 @@
 #include <ahde <asm/setup_hd64465 i8 +42=pr G;k21:24:52c-aica.o
 
 ifeq ($(CONFIG_SH_Gsetup_hd64465 i8Ses boNaiga/53dORY_Schaet)ex -C5R(w45If no7S -eE _HP69setup_hd64465	nthen
300001/02/07o_dc52:53o+	u
  _menefys$CONFI	$()_HP69setup_hd64465	nthen
4G_MEfine_15a23:26b56kDISCONTIGMEM y
+,ond Setup)o
@@IOS)handlinp
# The
orhild)HD64465McoE_ant * ,13p.,ond oy Greg Banks <gbanks@pocketpenguins.coE>_8 +470,7NI70,8atic no+	 pF TES <c@@ _hd64465T8rq(+void ptr			p8rqImst
-a_C[1],hhd64465T8rq(irqf; +	SUR	!(irq_desc[irq]. < tus &4(IRQ_DISfileD|IRQ_INPROG/ESS)f) +	i)C[1],hhd64465T8rq(irqf; e}4oSHm(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Gsh_ksym
 nit.c	Thu Sep h0:02:03 sh_ksym
 nP6 +35,9 @@
 #include <ahde <asm/sh_ksym
 netup_dc.o io_dc.o r9c-aica.o
 
 ifeq ($(CONFIG_SH_Gsh_ksym
 neSes boNaiga/53dORY_Schaet)ex 9,6NI9e.of noT ble ch@@
nux1R -3e7751 hchi vmaddr);
+		if (smp_ dek	chi T ble ch@@
nux1Rvma  de	chi vmaddr);
+		if (pci	mhi c unsigned long  emaph
++	chi eAe.o t/spR+G*p0x20;
-	Gm_a)ex -8# I+-9
tatic unsigned long hFIGF




( unsigned long delay	chi eAe.o t/spR+G*pga  de	chi-T ble ch@@R+G*pci	mhi _PCchild);$	"
+
 




( c 2000			ES <c_ump_thnuxd-y    cCet_engs *,o8 12:29u{
r *);
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Gsys_sh nit.c	Thu Sep h0:02:03 sys_sh nP6 +35,9 @@
 #include <ahde <asm/sys_sh n	Mon Mar G9 /5335 r0c-aica.o
 
 ifeq ($(CONFIG_SH_Gsys_sh n	Ses boNaiga/53dORY_Schaet)ex 43,6NI43,45atic 	oto \
+  -(r; e}4oS+T G defLi)d(__SH4__) TCPU_	+eT3taCON
+c1,1  alias,Nwcemaptild)+hFIG page;g tots	/* colo7._+ &inpudefLi)yCOLOUR_ALIGN(ain_)	(((ain_)+SHMLBA-1)&~(SHMLBA-1))
@o+opyrP1pcess th ($(_get_un@ pped_anux-y    cCt
 
+*t
 p,B@ vNRE_FGENERIain_s
+@opyrP1pcess thlen,B@ vNRE_FGENERIpgoff, opyrP1pcess that wa f@@ -	y    cCvm_anux_y    cC*vma;-+MEMSUR	SCONT-& MAP_FIXED)st
@@ /efWi d(I_SOLaccepDFae hFIeSH@ ppingdifFIG_would vinit_
o@@  mi.C,1  aliasinp
# nstra -3s.,
	@b*neEM SUR	tSCONT-& MAP_SHARED)s&&4(ain_ &4(SHMLBA - 1)f) +	ile unsi]-EINVAL.o2,	e unsi]ain_.o+	}np +	SUR	len > TASK@SIZE)o2,	e unsi]-ENOMEM; +	SUR	!ain_)m+7	oin_ = TASK@UNMAPPED_pF T;-+MEMoin_ = COLOUR_ALIGN(ain_);-+MEMG_SM(vma = fLid_vma	eur_end->mm, ain_); ; vma = vma->vm_nex@)st
@@ /efAta,
is)e chG: R	!vma || ain_ < vma->vm_0] ).b*neEM SUR	TASK@SIZE - len < ain_)m+7		e unsi]-ENOMEM; +		SUR	!vma || ain_ + len <= vma->vm_ < ob)2+il	e unsi]ain_.o+	Moin_ = vma->vm_0] .o+	Moin_ = COLOUR_ALIGN(ain_);-+	}12 ];T@@ vNR+  +	 pF Tstline	ss t
 d(_m@ p2(@ vNRE_FGENERIain_s opyrP1pcess thlen,B@ vNRE_FGENERIprot,     opyrP1pcess that wa,
st40fd,B@ vNRE_FGENERIpgoffIm(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Gti/*pnit.c	Thu Sep h0:02:03 ti/*pnP6 +35,9 @@
 #include <ahde <asm/ti/*pnetup_dc.o io_dc.o r9c-aica.o
 
 ifeq ($(CONFIG_SH_Gti/*pneSes boNaiga/53dORY_Schaet)ex -C4R(w44ry size' CONFti/*pnthen
F000000
 2/28a/5342:51
+if [ "$CONFIG_SH_HP69ti/*pnthen
30G_MEfin9/01)&4:34:31Nmrbrowts$CONFI  *else
it.c	Thu Sep h0:02:03 ti/*pnPy
+e8 +4183C11R+183,9atic +	 pF Tstline	ES <c_o_(imer_ -3e7751 (			p8rq, h a prdev_id, y    cCet_engs *engsImst
 	_o_(imer(engsI.o_T G 0R+   SUR	!u{
r_mode(engsI)no@7sh__o_prot
 
(engs->pc).o_T)@ vNRnareaGzbH_t
@@ -2HEARTBEAT   SUR	:h_Tv.mv_he obbees !=sNULL)G_8 +4360,1.o+359
11mtic u)@ vNRnT)@ vNRna-	SUR	MACH_DREAMCAST)a-	ixti/*ptv__pe TIxti/*ptv_u_pe TI00y-	) {
o-		rtc_gettimeofday-&xti/*IGMEM@tc_gettimeofday-&xti/*IGM    setup_8rq(TIMEROIRQ, &8rq0);Rna-	SUR	MACH_DREAMCAST)a-	i(imer_freq TI50*1+++*1+++/40y-	) {
o-		(imer_freq TIget_(imer_frequ)ncy().o+	(imer_freq TIget_(imer_frequ)ncy().o c 	ACONFe_c dek TItimer_freq * 4= G_8 +4391C11R+384,9atic 	}RnT)l G defLi)d(__SH4__)  	{* chGzbH_t
@@ -2CPU_SUBTYPE_eT40STB1no@7@ vNRE_FGENERIpvrON-7	frqcr_SH4o 
+NFw(FRQCR).o 
_T GzbH_t
@@ -2CPU_SUBTYPE_eT40STB1no@7/()/spR+should d0xp[1]ytbi movptr			child)SH3 d0xpinp
# Th,-o
@@then u{
"ild)p0x20;
-	no@7 * y    cu	in(chdetermine	whichiCPUgwinare1runninpFon.no@7 */t)ex 435,6NI427s8If no@7}+if [RnT)@ vNRn		{-dmaafrqcr_SH4o 
+NFw(FRQCR).o+N @7	ifc  ||Nfc_t[1],[(frqcr>> 6)l&lf,+++7]ON @7	bfc  ||bfc_t[1],[(frqcr>> 3)l&lf,+++7]ON @7	pfe TIpfc_t[1],[frqcr_&lf,+++7]ON(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFIG_SH_Gtrap
 nit.c	Thu Sep h0:02:03 trap
 nP6 +35,9 @@
 #include <ahde <asm/trap
 n	Mon Jan 29
 ob19:41
-aica.o
 
 ifeq ($(CONFIG_SH_Gtrap
 n	Ses boNaiga/53dORY_Schaet)ex -C4R(w44ry size' CONFtrap
 nthen
5G_ME0
 2/27 .o 27:55
+if [ "$CONFIG_SH_HP69trap
 nthen
14G_MEfine_24 08:07:10kDISCONTIGMEM y
+else
it.c	Thu Sep h0trap
 nPy
+e8 +4314C11R+314C11Rtic noh/+e houDFabouDFild)t
rstP"en u{
rspace fixups */o 	SUR	u{
r_mode(engsIs&&4handle_un_signed__SOify_equ-3>0)led_	    handle_un_signed__SOify_equ-3--.o+	Mhandle_un_signed__SOify_equ-3--.o d_	    ) - 1;
"FixinpFup un_signed u{
rspace otalra_ind\"%s\"Ipid=%<cec=0x%p_ins=0x%04hxtal_m-7	on cur_end->eqmm,cur_end->pid,(u16*)engs->pc,iny    cion).o+		e - 1;
"FixinpFup un_signed u{
rspace otalra_ind\"%s\"Ipid=%<cec=0x%p_ins=0x%04hxtal_m+7	on Bo  cur_end->eqmm,cur_end->pid,(u16*)engs->pc,iny    cion).o 	}4oSH_reA ||-EFAULT0y8 +4502# I+502# If no@die_if_IG_SH_("excepDion",-&rega,
exf; e}4oS_T G defLi)d(t
@@ -2DEBUG_KERNEL_WITH_GDB_eTUB) || defLi)d(t
@@ -2SH_STANDARD_nux/)o+T G defLi)d(t
@@ -2SH_STANDARD_nux/)o h a prgdb_vbr_vse
DM;RnT)@ vNRna8 +4514# I+514e.of no@excepDion_handlinp_t[1],[12] TI=h a pr)_o_e aerved_iny ;no@excepDion_handlinp_t[1],[13] TI=h a pr)_o_illegal_slot+iny ;noS_T G defLi)d(t
@@ -2DEBUG_KERNEL_WITH_GDB_eTUB) || defLi)d(t
@@ -2SH_STANDARD_nux/)o+T G defLi)d(t
@@ -2SH_STANDARD_nux/)o     	io
 @e* Readtild)oI"mOalue tra,
elVBR engister 
3tiarea_sis,
 @e*tild)vee
DMSthrough	whichidebug-o
@@nux/ trap
nareN(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFlib/M~ket
 
+$(CONFIG_SH_NFlib/M~ket
 
P6 +35,9 @@
 #include <ahdlib/M~ket
 
	Fri2,10 29
 4:07:F000000a.o
 
 ifeq ($(CONFlib/M~ket
 
	Ses boNaiga/53dORY_Schaet)ex 4e.o
4e.of no
 L_TARGET TIlib.a
 obj-y  =
delay	o|AMCcpy	o|AMC vd.o|AMCmovp	o|AMCchr	o|oI"- b,cksum	o|\d_	  b,cksum	o|y  .CAScmp.o
@@b b,cksum	o|y  .CAScmp.o|y  len.o
o
 USE_STANDARD_AS_RULE :TItrueSHm(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFlib/ b,cksum	S $(CONFIG_SH_NFlib/ b,cksum	SP6 +35,9 @@
 #include <ahdlib/ b,cksum	S	Sun Jan 2ga/8b56 00c-aica.o
 
 ifeq ($(CONFlib/ b,cksum	S	Ses boNaiga/53dORY_Schaet)ex -C4R(w44ry size' CONF b,cksum	Sthen
4G_ME0in5/14 08:41:26
+if [ "$CONFIG_SH_HP69 b,cksum	Sthen
10G_MEfine_06 13311:32kDISCONTIGMEM y
+else
INET		An implio N@"K:$	"ofgild)TCP/IPIprotocol suithe
orhild)LINUX y
+		opetrucERI2ystemG 
INETi	sTsmplio N@ed u{ingdild) BSD Socketa8 +4544G3 +544G4of no@tst	#l, r0		! Cb,cknosigno N@.no@bt	2f		! JumpdifFosigno N@i	sTok.no@!d_	add	#-l, r5	! Asigno N@iuces up)two oytSs.,
	add	#-l, r5		! Asigno N@iuces up)two oytSs., 	cmp/pz	r5		!no@bt/s	1f		! JumpdifFwe hu iattleast)two oytSs., 	 cly po	bra	6NRn	 add	#l, r5		! r5lwaHP< 2G 
Deal;g toti@.no1:
@@mov	r5, r1		! Surceg t len 
orhit_
riuce.c 	ACv.w	@r4+, r0
 @200u.w	r0, r0
 @addc	r0, r6t)ex 90,7NI91C.of no@addc	r3, r6t @addc	r0, r6t @addc	r2, r6t-	ACvt	r0	
@@movt	r0no@dt	r5po	bf/s	3b, 	 cmp/eq	#1, r0
8 +4185,48R+186,48Rf no@mov.l	r5,@-r15no@mov.l	r6,@-r15not-	ACv	#3, r0			! Cb,cknsrc-o
@@des@Ma	i equa  y _signedt-	ACv	r4, r1d_	and	r0, r1d_	and	r5, r0
-	cmp/eq	r1, r0
-	bf	3f			! DCoOe_end osigno N@s,B@{
"slow-rn;s:$	
-	tst	#1,r0			! Cb,ckndes@Mword _signedt-	bf	3f			! IfI_SO, d(Iittild)+low-way
@@mov	#3,r0		! Cb,cknsrc-o
@@des@Ma	i equa  y _signedt+	ACv	r4,r1
@@and	r0,r1
@@and	r5,r0_1b.mp/eq	r1,r0_1bbf	3f		! DCoOe_end osigno N@s,B@{
"slow-rn;s:$	
+	tst	#1,r0		! Cb,ckndes@Mword _signedt1bbf	3f		! IfI_SO, d(Iittild)+low-way
 c 	ACv	#l,r0
-	tst	r0,r5			! Cb,ckndes@Mosigno N@.ot-	bt	2f			! JumpdifFosigno N@i	sTok.n_	add	#-l,r6			! Asigno N@iuces up)two oytSs.,-	cmp/pz	r6			! JumpdifFwe hu iattleast)two oytSs.,+	tst	r0,r5		! Cb,ckndes@Mosigno N@.ot+@bt	2f		! JumpdifFosigno N@i	sTok.n+	add	#-l,r6		! Asigno N@iuces up)two oytSs.,
	cmp/pz	r6		! JumpdifFwe hu iattleast)two oytSs., 	bt/s	1f, 	 cly po	bra	4NR-a add	#l,r6			! r6lwaHP< 2G	Deal;g toti@.n+a add	#l,r6		! r6lwaHP< 2G	Deal;g toti@.not-3:	! Handle PCoOe_end src-o
@@des@Ma
 io N@s.n+3:	! Handle PCoOe_end src-o
@@des@Ma
 gio N@s.no@!)/spR+isS_SOLcommon,T001ssmpli oytS oy oytS copy ntentdo.t-	ACv	r6, r2t+	ACv	r6,r2t 	shlr	r6t-	tst	r6, r6t+	tst	r6,r6t @bt	4f, 	cly p-5:	
-SRC(@mov.b	@r4+,r0 )
-DST(@mov.b	r0,@r5	)n_	add	#1, r5
-SRC(@mov.b	@r4+,r1	)
-DST(@mov.b	r1,@r5	)n_	add	#1,r5
-
_@200u.b	r0,r0_1b.a
 gi	2t+5:
@SRC(@mov.b	@r4+,r1 	)n@SRC(@mov.b	@r4+,r0		)
 @200u.b	r1,r1
@DST(@mov.b	r1,@r5		)n@DST(@mov.b	r0,@(1,r5)	)n@@200u.b	r0,r0_1badd	#l,r5o+N T GzbH	__LITTLE_ENDIAN__d-	shll8	r1d_T) {
o 	shll8	r0F Tel{
o@@shll8	r1d T)@ vNR-aor	r1,r0	
@@or	r1,r0
 c 	addc	r0,r7c 	ACvt	r0n8 +4238C16NI239,1tatic c 	ACv	r2, r0no@tst	#1, r0
-	bt	7f	t+@bt	7fpo	bra	5f, 	 cly pono@!)src-o
@@des@Mequa  y _signed, eutF
3ta)two oytS boundERy.no@!)Handle t
rstP"wo oytSs as a0t); Cal_.CAS
-	.a
 gi	5_1b.a
 gi	2to1:	
-SRC(@mov.w	@r4+,r0	)
-DST(@mov.w	r0,@r5	)n+SRC(@mov.w	@r4+,r0		)n@DST(@mov.w	r0,@r5		)
 @add	#l,r5o @200u.w	r0,r0
 @addc	r0,r7c8 +4260,42NI261,36of no@tst	r6,r6t @bt/s	2f, 	 cly p1b.a
 gi	2to1:	
-SRC(@mov.l	@r4+,r0	)
-SRC(@mov.l	@r4+,r1	)n+SRC(@mov.l	@r4+,r0		)n@SRC(@mov.l	@r4+,r1		)
 @addc	r0,r7c-DST(@mov.l	r0,@r5	)n_	add	#4,r5o+DST(@mov.l	r0,@r5		)n@DST(@mov.l	r1,@(4,r5)	)n @addc	r1,r7c-DST(@mov.l	r1,@r5	)n_	add	#4,r5o 
-SRC(@mov.l	@r4+,r0	)
-SRC(@mov.l	@r4+,r1	)n+SRC(@mov.l	@r4+,r0		)n@SRC(@mov.l	@r4+,r1		)
 @addc	r0,r7c-DST(@mov.l	r0,@r5	)n_	add	#4,r5o+DST(@mov.l	r0,@(8,r5)	)n@DST(@mov.l	r1,@(12,r5)	)n @addc	r1,r7c-DST(@mov.l	r1,@r5	)n_	add	#4,r5o 
 SRC(@mov.l	@r4+,r0 	)
-SRC(@mov.l	@r4+,r1	)n+SRC(@mov.l	@r4+,r1		)
 @addc	r0,r7c-DST(@mov.l	r0,@r5	)n_	add	#4,r5o+DST(@mov.l	r0,@(16,r5)	)n@DST(@mov.l	r1,@(20,r5)	)n @addc	r1,r7c-DST(@mov.l	r1,@r5	)n_	add	#4,r5o 
-SRC(@mov.l	@r4+,r0	)
-SRC(@mov.l	@r4+,r1	)n+SRC(@mov.l	@r4+,r0		)n@SRC(@mov.l	@r4+,r1		)
 @addc	r0,r7c-DST(@mov.l	r0,@r5	)n_	add	#4,r5o+DST(@mov.l	r0,@(24,r5)	)n@DST(@mov.l	r1,@(28,r5)	)n @addc	r1,r7c-DST(@mov.l	r1,@r5	)n_	add	#4,r5o1badd	#3l,r5o @movt	r0no@dt	r6po	bf/s	1bm(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFlib/y  len.S $(CONFIG_SH_NFlib/y  len.SP6 +35,9 @@
 #include <ahdlib/y  len.S8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !lib/y  len.S8AGa,
elNcu &inpF T ble ch@@
nux1R(w470O"l0_CP _HP69s  len.Sthen
FG_MEfin6/29
 4:07:15
+if [ "$CONFIG &_+eE)"s  len" implio N@"K:$	"ofgSoburHP
+		   rey' CO.:6 2C1,1999  Kaz KojimaP
+		   /al0_CP 8izd_t9s  len (XRDY =chFInEs)   inpF T ble ch@@
nux1Rt.ckage	chi ENTRY(s  len)t+	ACv	r4,r0
@@and	#3,r0,+	tst	r0,r0_1bbt/s	1f,+a ACv	#0,r2t+n+	add	#-1,r0_1bshll2	r0_1bshll	r0_1bbraf	r0_1bS_Sp
@o+@Cov.b	@r4+,r1,+	tst	r1,r1
@@bt	8fn+	add	#1,r2t+n+	Cov.b	@r4+,r1,+	tst	r1,r1
@@bt	8fn+	add	#1,r2t+n+	Cov.b	@r4+,r1,+	tst	r1,r1
@@bt	8fn+	add	#1,r2	t+n+1:
@@mov	#0,r3
+2:
@@mov.l	@r4+,r1,
	cmp/s  	r3,r1
@@bf/s	2bn+a add	#4,r2t+n+	add	#-4,r2t+T GnzbH___LITTLE_ENDIAN__d1bswap.b	r1,r1
@bswap.w	r1,r1
@bswap.b	r1,r1
@T@@ vNR1_200u.b	r1,r0,+	tst	r0,r0_1bbt/s	8fn+	 shlr8	r1d+	add	#1,r2t+_200u.b	r1,r0,+	tst	r0,r0_1bbt/s	8fn+	 shlr8	r1d+	add	#1,r2t+_200u.b	r1,r0,+	tst	r0,r0_1bbt	8fn+	add	#1,r2t+8:MEM@ts,+a ACv	rl,r0
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFmm/M~ket
 
+$(CONFIG_SH_NFmm/M~ket
 
P6 +35,9 @@
 #include <ahdmm/M~ket
 
	Fri2,10 29
 4:07:F000000a.o
 
 ifeq ($(CONFmm/M~ket
 
	Ses boNaiga/53dORY_Schaet)ex 8,64 8s11mtic u NotS 2! 0Ue CFLAGS defLiit:$	+isS_Sw-		 ,
elmain m~ket
 
.	cpo
 O_TARGET := mm.o
-obj-y	 := +d lUo faultUo 200[1],.oi.C,1 .oi# ioremap.oi
+obj-y	 := +d lUo faultUo 200[1],.oi.lear_page.oi.y' _page.ot+n+obj-$(t
@@ -2CPU_SH3) +=i.C,1 -sh3.ot+obj-$(t
@@ -2CPU_SH4) +=i.C,1 -sh4.oi__clear_u{
r_page-sh4.oi__cy' _u{
r_page-sh4.oiioremap.ot+n+USE_STANDARD_AS_RULE :TItrueSHm  ble ch@$(TOPDIR)/RulSs.m~ke
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFmm/__clear_u{
r_page-sh4.S $(CONFIG_SH_NFmm/__clear_u{
r_page-sh4.SP6 +35,9 @@
 #include <ahdmm/__clear_u{
r_page-sh4.S8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !mm/__clear_u{
r_page-sh4.S8AGa,
elNcu &inpF T ble ch@@
nux1R(w449O"l0_CP _HPFIG &_+eE)__clear_u{
r_page implio N@"K:$	"ofgSoburHP
+		   rey' CO.:6 2C1,8 +1  Nf [ "Yutaka &TKaz KojimaP
+		   /al0_CP_+eE)__clear_u{
r_pageMAKE)@to: P1
- sourcs(g tots	/* colo7)MAKE)@oCO._to: P1
- sourcP
+		   rES <caOclear_u{
r_page=h a pr
3,Fh a proCO._to)	   /al0_CP_+eE)r0 6 +3scratchhat mir4 6 +3toat mir5 6 +3oCO._toat mir6 6 +3to + 4096	   inpT ble ch@@
nux1Rt.ckage	chi ENTRY(aOclear_u{
r_page)t+	ACv	r4,r6
@@mov.w	.L4096,r0_1badd	r0,r6
@@mov	#0,r0_1b!n+1:	ocbi	@r5o1badd	#3l,r5o@@movca.l	r0,@r4t+	ACv	r4,r1
@@add	#3l,r4
@@mov.l	r0,@-r4
@@mov.l	r0,@-r4
@@mov.l	r0,@-r4
@@mov.l	r0,@-r4
@@mov.l	r0,@-r4
@@mov.l	r0,@-r4
@@mov.l	r0,@-r4
@@add	#l8,r4
@@.mp/eq	r6,r4
@@bf/s	1bm+a ocbwb	@r1_1b!n+M@ts,+a _Sp
@.L4096:	.word	4096	(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFmm/__cy' _u{
r_page-sh4.S $(CONFIG_SH_NFmm/__cy' _u{
r_page-sh4.SP6 +35,9 @@
 #include <ahdmm/__cy' _u{
r_page-sh4.S8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !mm/__cy' _u{
r_page-sh4.S8AGa,
elNcu &inpF T ble ch@@
nux1R(w469O"l0_CP _HP69__cy' _u{
r_page-sh4.Sthen
1G_MEfine_23 jF T2:17
+if [ "$CONFIG &_+eE)__cy' _u{
r_page implio N@"K:$	"ofgSoburHP
+		   rey' CO.:6 2C1,8 +1  Nf [ "Yutaka &TKaz KojimaP
+		   /al0_CP_+eE)__cy' _u{
r_pageMAKE)@to: P1
- sourcs(g tots	/* colo7)MAKE)@
SK_: P1
- sourcP
+	)@oCO._to: P1
- sourcP
+		   rES <caOcy' _u{
r_page=h a pr
3,Fh a pr
SK_,Fh a proCO._to)	   /al0_CP_+eE)r0, r1, r2, r3, r4, r5, r6, r7 6 +3scratchhat mir8 6 +3
SK_S+ 4096	    r9 6 +3oCO._toat mir10 6 +3toat mir11m6 +3
SK_	   inpT ble ch@@
nux1Rt.ckage	chi ENTRY(aOcy' _u{
r_page)
@@mov.l	r8,@-r15n@@mov.l	r9,@-r15n@@mov.l	r10,@-r15n@@mov.l	r11,@-r15n@@mov	r4,r10
@@mov	r5,r11t+	ACv	r6,r9
@@mov	r5,r8
@@mov.w	.L4096,r0_1badd	r0,r8_1b!n+1:	ocbi	@r9
@@add	#3l,r9
@@mov.l	@r11+,r0_1bmov.l	@r11+,r1_1bmov.l	@r11+,r2_1bmov.l	@r11+,r3_1bmov.l	@r11+,r4_1bmov.l	@r11+,r5_1bmov.l	@r11+,r6_1bmov.l	@r11+,r7o@@movca.l	r0,@r10
@@mov	r10,r0_1badd	#3l,r10_1bmov.l	r7,@-r10_1bmov.l	r6,@-r10_1bmov.l	r5,@-r10_1bmov.l	r4,@-r10_1bmov.l	r3,@-r10_1bmov.l	r2,@-r10_1bmov.l	r1,@-r10_1bocbwb	@r0_1b.mp/eq	r11,r8_1bbf/s	1bm+a add	#l8,r10_1b!n+bmov.l	@r15+,r11t+	ACv.l	@r15+,r10t+	ACv.l	@r15+,r9t+	ACv.l	@r15+,r8n+M@ts,+a _Sp
@.L4096:	.word	4096	(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFmm/.C,1 -sh3.c $(CONFIG_SH_NFmm/.C,1 -sh3.cP6 +35,9 @@
 #include <ahdmm/.C,1 -sh3.c8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !mm/.C,1 -sh3.c8AGa,
elNcu &inpF T ble ch@@
nux1R(w4219O"l0_CP _HP69.C,1 -sh3.cthen
5G_MEfin8_24 15:31:41
dwmw2s$CONFI
+		   r $(CONFIG_SH_NFmm/.C,1 -sh3.cP
+		   rey' CO.:6 2C1,1999,,8 +0  Nf [ "Yutaka,
+		   inpF T ble ch@@
nux1R+d lUhNhG_PCchild);$	"
+
mmanUhNhG_PCchild);$	"
+
mmUhNhG_PCchild);$	"
+
thnuxdsGm_a T ble ch@@R+G*- sospaceGm_a T ble ch@@R+G*page	chi eAe.o t/spR+G*pg0[1],.chi eAe.o t/spR+G*p0x20;
-	Gm_a eAe.o t/spR+G*.C,1 .T bleAe.o t/spR+G*FIGm_aleAe.o t/spR+G*uotalra	chi eAe.o t/spR+G*pga  de	chi vmaddr);
+R+G* mu_eq t200


(ehG_defLi)yCCR		f,ffffffec@PU_Ad@ourcsofgCC,1  Cq trol Rngister &inp_defLi)yCCR_CACHE_VAL	f,+++++++5@PU_8k-oytS cC,1 , P1-wb,c)C[1], &inp_defLi)yCCR_CACHE_INIT	f,+++++++d@PU_8k-oytS cC,1 , CF, P1-wb,c)C[1], &inp_defLi)yCCR_CACHE_ENfile	_1
@np_defLi)yCACHE_OC_ADD/ESS_ARRAY f,f+++++++np_defLi)yCACHE_VALID	 _1
@_defLi)yCACHE_UPDATED	 _2
@_defLi)yCACHE_PHYSADD/_MASK f,1ffffc++np0_CP 7709A/= 29)haHP16Ki.C,1  (256- N@ry), n= chi7702)haHPonly 2K(+else
)_ if 7702)isS_SOLsobj-y +42(yet) &inp8 12:29_.C,1 _ ystem_STB1 @ -	 STBway_shift; -	 STB N@ry_@ -i;-+	 STBnum_0]triesGME};*  TCP Data Ga,BSS)isSclear* iaf3e7 settingdilpR+Oari[1],._ if So,NwceShould _SOLplaciddilpR+Oari[1], Ga,BSS)se cion._ if _area_sizdeilis,FIG_is)elacidda40data)se cion. &inp8  pF T8 12:29_.C,1 _ ystem_STB1 .C,1 _ ystem_STB1 = {0,};*  T_defLi)yCACHE_OC_WAY_SHIFT	(.C,1 _ ystem_STB1.way_shift) T_defLi)yCACHE_OC_ENTRY_SHIFT    4 T_defLi)yCACHE_OC_ENTRY_MASK	(.C,1 _ ystem_STB1. N@ry_@ -i) T_defLi)yCACHE_OC_NUM_ENTRIES	(.C,1 _ ystem_STB1.num_0]tries) T_defLi)yCACHE_OC_NUM_WAYS	4 T_defLi)yCACHE_OC_ASSOC_BIT    (1<<3)];*  TCPU_	+eW0(		_babi a  _ild)cC,1 .P
+		   rF_SMSH-4,Nwceonly 3"y" 
3tflushs(g0(		_babi) OpetrndgCC,1 ,MAKE)us _ay    ciongCC,1  doesn'tthurce"upd"K)
"0data.P
+		   rAssu/*s)t atltspR+isS> en+
-		 in3e7751 F_&inpF @@eq t200,-o
@@P2	ZE, ~Shuld [ "INLINE@struct *._+ &inp8  pF Tstline	ES <c.C,1 _wbabi_a  a ze) f@@ -	@ vNRE_FGENERIain_s data,oi, j;-+MEMG_SM(G=0;Bi<CACHE_OC_NUM_ENTRIES;Bi++)led+		G_SM(j=0;Bj<CACHE_OC_NUM_WAYS;Bj++)led+		Moin_ = CACHE_OC_ADD/ESS_ARRAY|(j<<CACHE_OC_WAY_SHIFT)|o+	:a	(i<<CACHE_OC_ENTRY_SHIFT).o+	ildata = .o 
+NFl=ain_);-+	M SUR	tdata & 2CACHE_UPDATED|CACHE_VALIDf) +	il    == 2CACHE_UPDATED|CACHE_VALIDf) +	il	.o 
+objl(data & ~CACHE_UPDATED, ain_); +	i}-+	}12 ];* 8  pF TES <caONFIG
+detect_cpu_and_cC,1 _ ystema ze) f@@ -	@ vNRE_FGENERIain_0, ain_1s data0s data1s data2s data3;-+MEMjump_to_P2().o+	PU
@@b*)Cb,cknifgild) N@rye hFdowHPoSMno@.n+a +eWhen shFdowed, it's 128- N@rye ystemGn+a +eOildrwise, it's 256- N@rye ystemGn+a +/MEMoin_0 = CACHE_OC_ADD/ESS_ARRAY + (3 <<012IGMEMain_1 = CACHE_OC_ADD/ESS_ARRAY + (1 <<012IGME
@@PU_F
rst, g0(		_babi & _nv_sid"K) +/MEMdata0  = .o 
+NFl=ain_0IGMEM.o 
+objl(data0&~(CACHE_VALID|CACHE_UPDATED), ain_0IGMEMdata1  = .o 
+NFl=ain_1IGMEM.o 
+objl(data1&~(CACHE_VALID|CACHE_UPDATED), ain_1IGME
@@PU_N200,-cb,cknifgildre's shFdowPoSMno@ +/MEMdata0 = .o 
+NFl=ain_0IGMEMdata0 ^=yCACHE_VALIDGMEM.o 
+objl(data0, ain_0IGMEMdata1 = .o 
+NFl=ain_1IGMEMdata2 =
data1 ^yCACHE_VALIDGMEM.o 
+objl(data2, ain_1IGMEMdata3 = .o 
+NFl=ain_0IGME
@@PU_Last y,-8nv_si"K) ildm.b*neEM.o 
+objl(data0&~CACHE_VALID, ain_0IGMEM.o 
+objl(data2&~CACHE_VALID, ain_1IGMEMbabi_to_P1();-+MEMSUR	data0 ==
data1 && data2 ==
data3)le@PU_ShFdowP*neEM .C,1 _ ystem_STB1.way_shift = 11;eEM .C,1 _ ystem_STB1. N@ry_@ -i TI0x7f0;eEM .C,1 _ ystem_STB1.num_0]tries = 128;eEM .pu_data->typ
 = CPU_SH7708;
+	} el{
le@	@7/()7709A _SM= 29)P*neEM .C,1 _ ystem_STB1.way_shift = 12;eEM .C,1 _ ystem_STB1. N@ry_@ -i TI0xff0;eEM .C,1 _ ystem_STB1.num_0]tries = 256;eEM .pu_data->typ
 = CPU_SH7729;-+	}12 ];* ES <caONFIG_.C,1 _NFIGa ze) f@@ -	@ vNRE_FGENERIccr;
+
@@detect_cpu_and_cC,1 _ ystema);-+MEMjump_to_P2().o+	ccr_SH4o 
+NFl(CCR).o+MSUR	ccr_&lCCR_CACHE_ENfile)
@@ /eo@@  miXXX: Should cb,cknRA he	i. o@@  miIfnRA waHP1,Nwceonly 3"y" 
3tflushsild)hFlf"ofgild)cC,1 s.,
	@b*neEM .C,1 _wbabi_a  a);-+MEM.o 
+objl(CCR_CACHE_INIT, CCR).o+Mbabi_to_P1();-+}*  TCPU_	+eW0(		_babi ild)+elty D-cC,1 s, eutFno@ _nv_sid"K) ildm."	$(MAKE)_sltspR+nux  y w-y oti@, _SMshould wcejXhDFaliasltspR+nbed
+ MAKE)toi__flush_purge_engiongtoo?"	$(MAKE)START: Veltual_Ad@ourcs(U0, P1, _SMP3)MAKE)SIZE: Sizdeofgild)engion.	   inpF ES <caOflush_wbabi_engion=h a pr < ob,
st408izd)f@@ -	@ vNRE_FGENERIv, j;-+	@ vNRE_FGENERIbngin,c)Cd;
+@opyrP1pcess that was +
@@bngin ||(\
 	 SH2000			8 
  h& ~(L1_CACHE_BYTES-1IGMEM0]  ||((\
 	 SH2000			8 
  h+ 8izde+ L1_CACHE_BYTES-1IeEM & ~(L1_CACHE_BYTES-1IGMEMEMG_SM(v ||bngin; v <c)Cd; v+=L1_CACHE_BYTES)led+		G_SM(j=0;Bj<CACHE_OC_NUM_WAYS;Bj++)led+		MopyrP1pcess thdata,oain_s pGMEMEM		p ||__pa(v);-+	M oin_ = CACHE_OC_ADD/ESS_ARRAY|(j<<CACHE_OC_WAY_SHIFT)|o+	:a	(v&CACHE_OC_ENTRY_MASK);-+	M opyr_and_cli(SCONTIGM+	ildata = .o 
+NFl=ain_);-+	M -+	M SUR	tdata & CACHE_PHYSADD/_MASK) == +	il    (p & CACHE_PHYSADD/_MASK))led+		Mldata 	\
 CACHE_UPDATED; +	il	.o 
+objl(data, ain_); +	i	M@
as
++_SCONT(SCONTIGM+	i	MbnuxkGM+	i	}o+	ile as
++_SCONT(SCONTIGM+	i}-+	}12 ];* CPU_	+eW0(		_babi ild)+elty D-cC,1 s-o
@@_nv_sid"K) ildm."	$(MAKE)START: Veltual_Ad@ourcs(U0, P1, _SMP3)MAKE)SIZE: Sizdeofgild)engion.	   inpES <caOflush_purge_engion=h a pr < ob,
st408izd)f@@ -	@ vNRE_FGENERIv;-+	@ vNRE_FGENERIbngin,c)Cd;
+
@@bngin ||(\
 	 SH2000			8 
  h& ~(L1_CACHE_BYTES-1IGMEM0]  ||((\
 	 SH2000			8 
  h+ 8izde+ L1_CACHE_BYTES-1IeEM & ~(L1_CACHE_BYTES-1IGMEMEMG_SM(v ||bngin; v <c)Cd; v+=L1_CACHE_BYTES)led+		opyrP1pcess thdata,oain_GMEMEM	data = (v & f,fffffc+0= + 	 _Veltual_
- sourc, ~U, ~Vb*neEM oin_ = CACHE_OC_ADD/ESS_ARRAY | (v&CACHE_OC_ENTRY_MASK) | o+	ilCACHE_OC_ASSOC_BIT;eEM .o 
+objl(data, ain_); +	}12 ];* CPU_	+eNo g0(		_babi pleas,"	$(MAKE)ExcepD I d( 'ttmoinkgildre's ~ny wayF
3tah a pild)g0(		babi. S01weMAKE)jXhDFaliaslit)toi__flush_purge_engion().
dwmw2.	   inpES <caOflush__nv_sid"K)_engion=h a pr < ob,
st408izd)f@	__attrieute__((alias("__flush_purge_engion")));
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFmm/.C,1 -sh4.c $(CONFIG_SH_NFmm/.C,1 -sh4.cP6 +35,9 @@
 #include <ahdmm/.C,1 -sh4.c8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !mm/.C,1 -sh4 i8AGa,
elNcu &inpF T ble ch@@
nux1R(w4439O"l0_CP _HP69.C,1 -sh4 nthen
15G_MEfin8_10
 4:13313
+if [ "$CONFIG &_+eE)Da+ tsdm+-@@
 !mm/.C,1 .cP
+		   rey' CO.:6 2C1,1999,,8 +0  Nf [ "Yutaka,
+		   inpF T ble ch@@
nux1R(w]i-		chi+vmaddr);
+		if (+d lUhNhG_PCchild);$	"
+
mmanUhNhG_PCchild);$	"
+
mmUhNhG_PCchild);$	"
+
thnuxdsGm_a T ble ch@@R+G*- sospaceGm_a T ble ch@@R+G*page	chi eAe.o t/spR+G*pg0[1],.chi eAe.o t/spR+G*p0x20;
-	Gm_a eAe.o t/spR+G*.C,1 .T bleAe.o t/spR+G*FIGm_aleAe.o t/spR+G*uotalra	chi eAe.o t/spR+G*pga  de	chi vmaddr);
+R+G* mu_eq t200


(ehG_defLi)yCCR		I0xff00001c@PU_Ad@ourcsofgCC,1  Cq trol Rngister &inp_defLi)yCCR_CACHE_VAL	 f,+++++1+5@PU_8k+16k-oytS cC,1 ,P1-wb,)C[1], &inp_defLi)yCCR_CACHE_INIT	 f,+++++9+d@PU_ICI,ICE(8k), OCI,P1-wb,OCE(16k) &inp_defLi)yCCR_CACHE_ENfile f,+++++1+1
@np_defLi)yCACHE_IC_ADD/ESS_ARRAY f,f+++++++np_defLi)yCACHE_OC_ADD/ESS_ARRAY f,f4++++++np_defLi)yCACHE_VALID	 _1
@_defLi)yCACHE_UPDATED	 _2
@ T_defLi)yCACHE_OC_WAY_SHIFTon Bo  13np_defLi)yCACHE_IC_WAY_SHIFTon Bo  13np_defLi)yCACHE_OC_ENTRY_SHIFT      5np_defLi)yCACHE_IC_ENTRY_SHIFT      5np_defLi)yCACHE_OC_ENTRY_MASK		0x3fe0np_defLi)yCACHE_OC_ENTRY_PHYS_MASK	f,+fe0np_defLi)yCACHE_IC_ENTRY_MASK		0x1fe0np_defLi)yCACHE_IC_NUM_ENTRIES	256 T_defLi)yCACHE_OC_NUM_ENTRIES	512];* 8  pF TES <caONFIG
+detect_cpu_and_cC,1 _ ystema ze) f@@ -T GzbH_t
@@ -2CPU_SUBTYPE_eT40STB1n+ .pu_data->typ
 = CPU_ST40STB1;F Tel G defLi)d(t
@@ -2CPU_SUBTYPE_e = d0) || defLi)d(t
@@ -2CPU_SUBTYPE_e = d1IeEM.pu_data->typ
 = CPU_SH7750;F Tel{
o@#  -(r Unknown SH4iCPUgtyp
o@T@@ vNR1 ];* ES <caONFIG_.C,1 _NFIGa ze) f@@ -	@ vNRE_FGENERIccr;
+
@@detect_cpu_and_cC,1 _ ystema);-+MEMjump_to_P2().o+	ccr_SH4o 
+NFl(CCR).o+MSUR	ccr_&lCCR_CACHE_ENfile)st
@@ /eo@@  miXXX: Should cb,cknRA he	i. o@@  miIfnRA waHP1,Nwceonly 3"y" 
3tflushsild)hFlf"ofgild)cC,1 s.,
	@b*neEM @ vNRE_FGENERIain_s dataGMEMEM	G_SM(oin_ = CACHE_OC_ADD/ESS_ARRAY;m+7	on Boain_ < (CACHE_OC_ADD/ESS_ARRAY+ +	il     (CACHE_OC_NUM_ENTRIES <<0CACHE_OC_ENTRY_SHIFT));m+7	on Boain_ +||(1 <<0CACHE_OC_ENTRY_SHIFT))led+		Mdata = .o 
+NFl=ain_);-+	M SUR	tdata & 2CACHE_UPDATED|CACHE_VALIDf) +	il    == 2CACHE_UPDATED|CACHE_VALIDf) +	il	.o 
+objl(data & ~CACHE_UPDATED, ain_); +	i}-+	}12MEM.o 
+objl(CCR_CACHE_INIT, CCR).o+Mbabi_to_P1();-+}*  TCPU_	+eSH-4)haHPveltually 8ndexed<o
@@physically tagged)cC,1 .P
+	/];* 8  pF T8 12:29 emaph
++ p3map_ em[4];];* ES <caONFIG_p3_.C,1 _NFIGa ze) f@@ -	PU_Iniioremap.cb*neEM2000			st40remap_anux_pages(@ vNRE_FGENERIain_urc, +	il	    @ vNRE_FGENERIphys_ain_s
+@il	    @ vNRE_FGENERI8izd, opyrP1pcess that wa ;-+MEMSUR	remap_anux_pages(P3SEG, 0, PAGE@SIZE*4, _PAGE@CACHfile)) +	i_antc("p3_.C,1i _NFIG fa
 
d."IGMEMoema_NFIG (&p3map_ em[0], 1IGMEMoema_NFIG (&p3map_ em[1], 1IGMEMoema_NFIG (&p3map_ em[2], 1IGMEMoema_NFIG (&p3map_ em[3], 1IGME}*  TCPU_	+eW0(		_babi ild)+elty D-cC,1 s, eutFno@ _nv_sid"K) ildm."	$(MAKE)START: Veltual_Ad@ourcs(U0, P1, _SMP3)MAKE)SIZE: Sizdeofgild)engion.	   inpES <caOflush_wbabi_engion=h a pr < ob,
st408izd)f@@ -	@ vNRE_FGENERIv;-+	@ vNRE_FGENERIbngin,c)Cd;
+
@@bngin ||(\
 	 SH2000			8 
  h& ~(L1_CACHE_BYTES-1IGMEM0]  ||((\
 	 SH2000			8 
  h+ 8izde+ L1_CACHE_BYTES-1IeEM & ~(L1_CACHE_BYTES-1IGMEMG_SM(v ||bngin; v <c)Cd; v+=L1_CACHE_BYTES)led+		R+GTESl pFle("ocbwb	%0" +	il     :+ 	 no objpu@ +/MEMil     :+"m" (__ma ))); +	}12 ];* CPU_	+eW0(		_babi ild)+elty D-cC,1 s-o
@@_nv_sid"K) ildm."	$(MAKE)START: Veltual_Ad@ourcs(U0, P1, _SMP3)MAKE)SIZE: Sizdeofgild)engion.	   inpES <caOflush_purge_engion=h a pr < ob,
st408izd)f@@ -	@ vNRE_FGENERIv;-+	@ vNRE_FGENERIbngin,c)Cd;
+
@@bngin ||(\
 	 SH2000			8 
  h& ~(L1_CACHE_BYTES-1IGMEM0]  ||((\
 	 SH2000			8 
  h+ 8izde+ L1_CACHE_BYTES-1IeEM & ~(L1_CACHE_BYTES-1IGMEMG_SM(v ||bngin; v <c)Cd; v+=L1_CACHE_BYTES)led+		R+GTESl pFle("ocbp	%0" +	il     :+ 	 no objpu@ +/MEMil     :+"m" (__ma ))); +	}12 ];* * CPU_	+eNo g0(		_babi pleas,"	$(inpES <caOflush__nv_sid"K)_engion=h a pr < ob,
st408izd)f@@ -	@ vNRE_FGENERIv;-+	@ vNRE_FGENERIbngin,c)Cd;
+
@@bngin ||(\
 	 SH2000			8 
  h& ~(L1_CACHE_BYTES-1IGMEM0]  ||((\
 	 SH2000			8 
  h+ 8izde+ L1_CACHE_BYTES-1IeEM & ~(L1_CACHE_BYTES-1IGMEMG_SM(v ||bngin; v <c)Cd; v+=L1_CACHE_BYTES)led+		R+GTESl pFle("ocbi	%0" +	il     :+ 	 no objpu@ +/MEMil     :+"m" (__ma ))); +	}12 ];* CPU_	+eW0(		_babi ild)rangdeofgD-cC,1 ,-o
@@purge ild)I-cC,1 .P
+		   rC en+
-
SK_SIG_SH_G$CONFeUc:sys_in6 +$CONFe<o
@@@bed
+  G_SMa.ouDFG_Smat.	   inpES <cflush__.C,1 _rangd(@ vNRE_FGENERI < ob,
@ vNRE_FGENERI0] )f@@ -	flush_.C,1 _a  a);-+ ];* CPU_	+eW0(		_babi ild)D-cC,1 -o
@@purge ild)I-cC,1  G_SMvNREal_trampoline. 	   inpES <cflush_cC,1 _ igtramp(@ vNRE_FGENERIain_)f@@ -	@ vNRE_FGENERIv, 8ndex;
+@opyrP1pcess that was 
+
@@v ||ain_ &4~(L1_CACHE_BYTES-1IGMEMR+GTESl pFle("ocbwb	%0" +	i     :+ 	 no objpu@ +/MEMi     :+"m" (__ma ))); +-+	 Sdex = CACHE_IC_ADD/ESS_ARRAY| (v&CACHE_IC_ENTRY_MASK);-+	opyr_and_cli(SCONTIGM+	jump_to_P2().o+	co 
+objl(0, 8ndex); io ClearFouDFV_sid-bIG_+/MEMbabi_to_P1();-+le as
++_SCONT(SCONTIGM+ ];* CPU_	+eW0(		babi&Inv_sid"K) ild)D-cC,1 -ofgild)pageMAKE/* 8  pF TES <caOflush_dcC,1 _page=@ vNRE_FGENERIphys f@@ -	@ vNRE_FGENERIain_s data;
+@opyrP1pcess that was +
@@phys |||CACHE_VALIDGME-+	opyr_and_cli(SCONTIGM+	jump_to_P2().o+
@@PU_Loop a  _ild)D-cC,1 -*neEMG_SM(oin_ = CACHE_OC_ADD/ESS_ARRAY;m+7on Boain_ < (CACHE_OC_ADD/ESS_ARRAYMEMi     +(CACHE_OC_NUM_ENTRIES<<0CACHE_OC_ENTRY_SHIFT));m+7on Boain_ +||(1<<CACHE_OC_ENTRY_SHIFT))led+		data = .o 
+NFl=ain_)&(f,1ffff000|CACHE_VALIDf; +		SUR	data ==Iphys f@il	.o 
+objl(0, ain_); +	}12o+T G 0 io DEBUG DEBUG &inph/+eLoop a  _ild)I-cC,1 -*neEMG_SM(oin_ = CACHE_IC_ADD/ESS_ARRAY;m+7on Boain_ < (CACHE_IC_ADD/ESS_ARRAYMEMi     +(CACHE_IC_NUM_ENTRIES<<0CACHE_IC_ENTRY_SHIFT));m+7on Boain_ +||(1<<CACHE_IC_ENTRY_SHIFT))led+		data = .o 
+NFl=ain_)&(f,1ffff000|CACHE_VALIDf; +		SUR	data ==Iphys led+		Me - 1;
KERN_INFO "__flush_cC,1 _page:)I-cC,1 - N@ryefound\n"IOf@il	.o 
+objl(0, ain_); +	i}-+	}12T@@ vNR1_babi_to_P1();-+le as
++_SCONT(SCONTIGM+ ];* CPU_	+eW0(		_babi & _nv_sid"K) ild)D-cC,1 -ofgild)page	ZE, ~(T3taCON
+"alias" issues) T  inpES <cflush_dcC,1 _page=y    cCeage *page)
@{MEMSUR	t as_bIG(PG_@ pped, &page->SCONTI f@ilaOflush_dcC,1 _page=PHYSADD/(page_ain_urc(page))); + ];* ES <cflush_.C,1 _a  a ze) f@@ -	2000			@ vNRE_FGENERI0mpty_zero_page[1024];];@opyrP1pcess that was +	@ vNRE_FGENERIain_GME-+	opyr_and_cli(SCONTIGM+nph/+ePrefetchhild)+ata to g0(		_babi D-cC,1 -*neEMG_SM(oin_ = (\
 	 SH2000			0mpty_zero_page;m+7on Boain_ < (\
 	 SH2000			0mpty_zero_pagee+ 1024*16;m+7on Boain_ +||L1_CACHE_BYTES)d+		R+GTESl pFle("pref @%0"::"r"M(oin_));-+MEMjump_to_P2().o+	PU FlushsD-cC,1 /I-cC,1 -*neEM.o 
+objl(CCR_CACHE_INIT, CCR).o+Mbabi_to_P1();-+le as
++_SCONT(SCONTIGM+ ];* ES <cflush_.C,1 _mm=y    cCmm_y    cC*mm f@@ -	PU_Isgildre ~ny good way? &inph/+eXXX: possi1]ytcallcflush_.C,1 _rangdeG_SMeC,1 vmMa	ia-*neEMGlush_.C,1 _a  a);-+ ];* CPU_	+eW0(		_babi o
@@_nv_sid"K) D-cC,1 s."	$(MAKE)START, END: Veltual_Ad@ourcs(U0Iain_urc)"	$(MAKE)NOTE: We 3"y" 
3tflushsild)_physical_Ceage  N@ry	ZE, ~Flushingdild)cC,1 -lineseG_SMU0Ionly isn'ttenough	ZE, ~We 3"y" 
3tflushsG_SMP1gtoo,	whichimay@eq tain alias s."	$(inpES <cflush_cC,1 _rangd(y    cCmm_y    cC*mm,
@ vNRE_FGENERI < ob,m+7	on Bo  @ vNRE_FGENERI0] )f@@ -	PU
@@b*)W* could callcflush_.C,1 _eage 
orhild)pages-ofgildsd)rangd,
@@b*)eutFIG'sS_SOLefficiend (scangild)cC,1 s a  _ild)ti/*p..)Gn+a +
@@b*)W* can'tt@{
"A-bIG_magic, asgildre's ild)cC{
"we d( 'tthurc
@@b*)v_sid- N@ryeon TLBGn+a +/MEMGlush_.C,1 _a  a);-+ ];* CPU_	+eW0(		_babi o
@@_nv_sid"K) I/D-cC,1 s-
orhild)page.P
+		   rADD/: Veltual_Ad@ourcs(U0Iain_urc)"	$(inpES <cflush_cC,1 _page=y    cCvm_anux_y    cC*vma,B@ vNRE_FGENERIain_urc)"	@ -	pgd_cC*di_.o+	pmd_cC*pmd.o+	pte_cC*pte.o+	pte_cC N@rys +	@ vNRE_FGENERIphys,Iain_s data;
+@opyrP1pcess that was +
@@di_ TIpgd_offset(vma->vm_mm, ain_urc).o+	pmd TIpmd_offset(di_, ain_urc).o+	SUR	pmd_none(*pmd) || pmd_bad(*pmd))o2,	e unsi.o+	pte TIpte_offset(pmd, ain_urc).o+	 N@rye=C*pte.o+	SUR	pte_none( N@ry) || !pte_pe aent( N@ry))o2,	e unsi.o+
@@phys TIpte_v_s( N@ry)&PTE_PHYS_MASKs +
@@phys |||CACHE_VALIDGME	opyr_and_cli(SCONTIGM+	jump_to_P2().o+
@@PU_Wceonly 3"y" 
3tflushsD-cC,1 -when weshurcealiasl+/MEMSUR	tain_urc^phys l& CACHE_ALIAS)st
@@ /efLoop 4K-ofgild)D-cC,1 -*neEMMG_SM(oin_ = CACHE_OC_ADD/ESS_ARRAY | (- sourcs& CACHE_ALIAS);m+7	on Boain_ < (CACHE_OC_ADD/ESS_ARRAY + (- sourcs& CACHE_ALIAS) MEMil     +(CACHE_OC_NUM_ENTRIES/4<<CACHE_OC_ENTRY_SHIFT));m+7	on Boain_ +||(1<<CACHE_OC_ENTRY_SHIFT))led+			data = .o 
+NFl=ain_)&(f,1ffff000|CACHE_VALIDf; +			SUR	data ==Iphys f@il		.o 
+objl(0, ain_); +	i}-+	h/+eLoop a_SOldr 4K-ofgild)D-cC,1 -*neEMMG_SM(oin_ = CACHE_OC_ADD/ESS_ARRAY | (phys & CACHE_ALIAS);m+7	on Boain_ < (CACHE_OC_ADD/ESS_ARRAY + (phys & CACHE_ALIAS) MEMil     +(CACHE_OC_NUM_ENTRIES/4<<CACHE_OC_ENTRY_SHIFT));m+7	on Boain_ +||(1<<CACHE_OC_ENTRY_SHIFT))led+			data = .o 
+NFl=ain_)&(f,1ffff000|CACHE_VALIDf; +			SUR	data ==Iphys f@il		.o 
+objl(0, ain_); +	i}-+	}np +	SUR	vma->vm_SCONT-& VM_EXEC)
@@ /efLoop 4K-ofgild)I-cC,1 -*neEMMG_SM(oin_ = CACHE_IC_ADD/ESS_ARRAY|(- sourc&f,1000);m+7	on Boain_ < ((CACHE_IC_ADD/ESS_ARRAY|(- sourc&f,1000))MEMil     +(CACHE_IC_NUM_ENTRIES/2<<CACHE_IC_ENTRY_SHIFT));m+7	on Boain_ +||(1<<CACHE_IC_ENTRY_SHIFT))led+			data = .o 
+NFl=ain_)&(f,1ffff000|CACHE_VALIDf; +			SUR	data ==Iphys f@il		.o 
+objl(0, ain_); +	i}-+	babi_to_P1();-+le as
++_SCONT(SCONTIGM+ ];* CPU_	+eclear_u{
r_pageMAKE)@to: P1
- sourcMAKE)@- sourc: U0Iain_urc 
3tbi @ pped"	$(inpES <cclear_u{
r_page=h a pr
3,F@ vNRE_FGENERIain_urc)"	@ -	y    cCeage *page = velt_to_page=to).o+
@@__set_bIG(PG_@ pped, &page->SCONTI.o+	SUR		tain_urc ^ (\
 	 SH2000			to) & CACHE_ALIAS) ==I0 f@il.lear_page=to).o+	el{
le +	i_gprot_cC_gprot ||__pgprot(_PAGE@P/ESENT | o+	il7	on _PAGE@RW | _PAGE@CACHfile |o+	il7	on _PAGE@DIRTY | _PAGE@ACCESSED | o+	il7	on _PAGE@HW_SHARED | _PAGE@FLAGS_HARDf; +		@ vNRE_FGENERIphys_ain_ ||PHYSADD/(to).o+		@ vNRE_FGENERIp3_ain_ ||P3SEG + (- sourcs& CACHE_ALIAS).o+		egd_cC*di_ TIpgd_offset_k(p3_ain_).o+		emd_cC*pmd TIpmd_offset(di_, p3_ain_).o+		ete_cC*pte TIpte_offset(pmd, p3_ain_).o+		ete_cC N@rys +	@opyrP1pcess that was +
@@	 N@rye=Cmk_pte_phys(phys_ain_sC_gprot).o+		down(&p3map_ em[(- sourcs& CACHE_ALIAS)>>12]).o+		set_pte	pte,C N@ry).o+		spyr_and_cli(SCONTIGM+	iaOflush_tlb_page=get_asid(), p3_ain_).o+		e as
++_SCONT(SCONTIGM+	iupd"K)_ mu_eC,1 (NULL, p3_ain_,C N@ry).o+		aOclear_u{
r_page==h a pr)p3_ain_,Cto).o+		pte_clear	pteIGM+	iup(&p3map_ em[(- sourcs& CACHE_ALIAS)>>12]).o+	}12 ];* CPU_	+ecy' _u{
r_pageMAKE)@to: P1
- sourcMAKE)@
SK_: P1
- sourcP
+	)@- sourc: U0Iain_urc 
3tbi @ pped"	$(inpES <ccy' _u{
r_page=h a pr
3,Fh a pr
SK_,F@ vNRE_FGENERIain_urc)"	@ -	y    cCeage *page = velt_to_page=to).o+
@@__set_bIG(PG_@ pped, &page->SCONTI.o+	SUR		tain_urc ^ (\
 	 SH2000			to) & CACHE_ALIAS) ==I0 f@il.y' _page(
3,F
SK_).o+	el{
le +	i_gprot_cC_gprot ||__pgprot(_PAGE@P/ESENT | o+	il7	on _PAGE@RW | _PAGE@CACHfile |o+	il7	on _PAGE@DIRTY | _PAGE@ACCESSED | o+	il7	on _PAGE@HW_SHARED | _PAGE@FLAGS_HARDf; +		@ vNRE_FGENERIphys_ain_ ||PHYSADD/(to).o+		@ vNRE_FGENERIp3_ain_ ||P3SEG + (- sourcs& CACHE_ALIAS).o+		egd_cC*di_ TIpgd_offset_k(p3_ain_).o+		emd_cC*pmd TIpmd_offset(di_, p3_ain_).o+		ete_cC*pte TIpte_offset(pmd, p3_ain_).o+		ete_cC N@rys +	@opyrP1pcess that was +
@@	 N@rye=Cmk_pte_phys(phys_ain_sC_gprot).o+		down(&p3map_ em[(- sourcs& CACHE_ALIAS)>>12]).o+		set_pte	pte,C N@ry).o+		spyr_and_cli(SCONTIGM+	iaOflush_tlb_page=get_asid(), p3_ain_).o+		e as
++_SCONT(SCONTIGM+	iupd"K)_ mu_eC,1 (NULL, p3_ain_,C N@ry).o+		aOcy' _u{
r_page==h a pr)p3_ain_,C
SK_,Fto).o+		pte_clear	pteIGM+	iup(&p3map_ em[(- sourcs& CACHE_ALIAS)>>12]).o+	}12 ](MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFmm/.C,1 .c $(CONFIG_SH_NFmm/.C,1 .cP6 +35,9 @@
 #include <ahdmm/.C,1 pnetup_dc.o io_dc.o r9c-aica.o
 
 ifeq ($(CONFmm/.C,1 pne +42,10 @@
 obj-$(ondiCI
)ex -C524 +ux1Ry size' CONF C,1 pnthen
10G_ME0/03/07o_1:58:34
+if [ "$CONFI- *I- *)Da+ tsdm+-@@
 !mm/.C,1 .cP- *I- *)ey' CO.:6 2C1,1999,,8 +0  Nf [ "Yutaka,- *I- */
-
_T ble ch@@
nux1R(w]i-		chi-vmaddr);
+		if (+d lUhNh-_PCchild);$	"
+
mmanUhNh-_PCchild);$	"
+
mmUhNh-_PCchild);$	"
+
thnuxdsGm_a-T ble ch@@R+G*page	chi-eAe.o t/spR+G*pg0[1],.chi-eAe.o t/spR+G*p0x20;
-	Gm_a-eAe.o t/spR+G*.C,1 .T b-eAe.o t/spR+G*FIGm_a-eAe.o t/spR+G*uotalra	chi-S_T G defLi)d(__sh3__) -_defLi)yCCR		f,ffffffec@PU_Ad@ourcsofgCC,1  Cq trol Rngister &in-_defLi)yCCR_CACHE_VAL	f,+++++++5@PU_8k-oytS cC,1 , P1-wb,c)C[1], &in-_defLi)yCCR_CACHE_INIT	f,+++++++d@PU_8k-oytS cC,1 , CF, P1-wb,c)C[1], &in-_defLi)yCCR_CACHE_ENfile	_1
-n-_defLi)yCACHE_IC_ADD/ESS_ARRAY f,f+++++++ io SH-3)haHPunified)cC,1 e ystem &in-_defLi)yCACHE_OC_ADD/ESS_ARRAY f,f+++++++n-_defLi)yCACHE_VALID	 _1
-_defLi)yCACHE_UPDATED	 _2
-size'7709A/= 29)haHP16Ki.C,1  (256- N@ry), n= chi7702)haHPonly 2K(+else
)_-if 7702)isS_SOLsobj-y +42(yet) &in-8 12:29_.C,1 _ ystem_STB1 @ -	 STBway_shift; -	 STB N@ry_@ -i;--	 STBnum_0]triesGM-};
-size'Data Ga,BSS)isSclear* iaf3e7 settingdilpR+Oari[1],._-if So,NwceShould _SOLplaciddilpR+Oari[1], Ga,BSS)se cion._-if _area_sizdeilis,FIG_is)elacidda40data)se cion. &in-8  pF T8 12:29_.C,1 _ ystem_STB1 .C,1 _ ystem_STB1 = {0,};*-n-_defLi)yCACHE_OC_WAY_SHIFT	(.C,1 _ ystem_STB1.way_shift) -_defLi)yCACHE_IC_WAY_SHIFT	(.C,1 _ ystem_STB1.way_shift) -_defLi)yCACHE_OC_ENTRY_SHIFT    4 -_defLi)yCACHE_OC_ENTRY_MASK	(.C,1 _ ystem_STB1. N@ry_@ -i) -_defLi)yCACHE_IC_ENTRY_MASK	(.C,1 _ ystem_STB1. N@ry_@ -i) -_defLi)yCACHE_OC_NUM_ENTRIES	(.C,1 _ ystem_STB1.num_0]tries) -_defLi)yCACHE_OC_NUM_WAYS	4 -_defLi)yCACHE_IC_NUM_WAYS	4 -_)l G defLi)d(__SH4__) -_defLi)yCCR		I0xff00001c@PU_Ad@ourcsofgCC,1  Cq trol Rngister &in-_defLi)yCCR_CACHE_VAL	 f,+++++1+5@PU_8k+16k-oytS cC,1 ,P1-wb,)C[1], &in-_defLi)yCCR_CACHE_INIT	 f,+++++9+d@PU_ICI,ICE(8k), OCI,P1-wb,OCE(16k) &in-_defLi)yCCR_CACHE_ENfile f,+++++1+1
-n-_defLi)yCACHE_IC_ADD/ESS_ARRAY f,f+++++++n-_defLi)yCACHE_OC_ADD/ESS_ARRAY f,f4++++++n-_defLi)yCACHE_VALID	 _1
-_defLi)yCACHE_UPDATED	 _2
-si_defLi)yCACHE_OC_WAY_SHIFTon Bo  13n-_defLi)yCACHE_IC_WAY_SHIFTon Bo  13n-_defLi)yCACHE_OC_ENTRY_SHIFT      5n-_defLi)yCACHE_IC_ENTRY_SHIFT      5n-_defLi)yCACHE_OC_ENTRY_MASK		0x3fe0n-_defLi)yCACHE_OC_ENTRY_PHYS_MASK	f,+fe0n-_defLi)yCACHE_IC_ENTRY_MASK		0x1fe0n-_defLi)yCACHE_IC_NUM_ENTRIES	256 -_defLi)yCACHE_OC_NUM_ENTRIES	512]-_defLi)yCACHE_OC_NUM_WAYS	 _1
-_defLi)yCACHE_IC_NUM_WAYS	 _1
-_)@ vNR-
-sizeI- *)W0(		_babi a  _ild)cC,1 .P- *I- *)F_SMSH-4,Nwceonly 3"y" 
3tflushs(g0(		_babi) OpetrndgCC,1 ,M-KE)us _ay    ciongCC,1  doesn'tthurce"upd"K)
"0data.P- *I- *)Assu/*s)t atltspR+isS> en+
-		 in3e7751 F_&inpF @@eq t200,-o
@@P2	Z-, ~Shuld [ "INLINE@struct *._- &in-8  pF Tstline	ES <c.C,1 _wbabi_a  a ze) f-@ -	@ vNRE_FGENERIain_s data,oi, j;--
_@G_SM(G=0;Bi<CACHE_OC_NUM_ENTRIES;Bi++)led-		G_SM(j=0;Bj<CACHE_OC_NUM_WAYS;Bj++)led-	M oin_ = CACHE_OC_ADD/ESS_ARRAY|(j<<CACHE_OC_WAY_SHIFT)|o-	:a	(i<<CACHE_OC_ENTRY_SHIFT).o-		Mdata = .o 
+NFl=ain_);--	M SUR	tdata & 2CACHE_UPDATED|CACHE_VALIDf) -	il    == 2CACHE_UPDATED|CACHE_VALIDf)led-	M ldata 	\
 CACHE_UPDATED; -	il	.o 
+objl(data, ain_); -	i	}o-i	}o-i}o-}--
_8  pF TES <caONFIG
-detect_cpu_and_cC,1 _ ystema ze) f-@ -T G defLi)d(__sh3__) -	@ vNRE_FGENERIain_0, ain_1s data0s data1s data2s data3;--
_@jump_to_P2().o-	PU
-@b*)Cb,cknifgild) N@rye hFdowHPoSMno@.n-a +eWhen shFdowed, it's 128- N@rye ystemGn-a +eOildrwise, it's 256- N@rye ystemGn-a +/M-Moin_0 = CACHE_OC_ADD/ESS_ARRAY + (3 <<012IGM-Main_1 = CACHE_OC_ADD/ESS_ARRAY + (1 <<012IGM-o-	PU_F
rst, g0(		_babi & _nv_sid"K) +/M-Mdata0  = .o 
+NFl=ain_0IGM-M.o 
+objl(data0&~(CACHE_VALID|CACHE_UPDATED), ain_0IGM-Mdata1  = .o 
+NFl=ain_1IGM-M.o 
+objl(data1&~(CACHE_VALID|CACHE_UPDATED), ain_1IGM-o-	PU_N200,-cb,cknifgildre's shFdowPoSMno@ +/M-Mdata0 = .o 
+NFl=ain_0IGM-Mdata0 ^=yCACHE_VALIDGM-M.o 
+objl(data0, ain_0IGM-Mdata1 = .o 
+NFl=ain_1IGM-Mdata2 =
data1 ^yCACHE_VALIDGM-M.o 
+objl(data2, ain_1IGM-Mdata3 = .o 
+NFl=ain_0IGM-o-	PU_Last y,-8nv_si"K) ildm.b*ne-M.o 
+objl(data0&~CACHE_VALID, ain_0IGM-M.o 
+objl(data2&~CACHE_VALID, ain_1IGM-	babi_to_P1();--o-	SUR	data0 ==
data1 && data2 ==
data3)le@PU_ShFdowP*ne-M .C,1 _ ystem_STB1.way_shift = 11;e-M .C,1 _ ystem_STB1. N@ry_@ -i TI0x7f0;e-M .C,1 _ ystem_STB1.num_0]tries = 128;e-M .pu_data->typ
 = CPU_SH7708;
-	} el{
le@	@7/()7709A _SM= 29)P*ne-M .C,1 _ ystem_STB1.way_shift = 12;e-M .C,1 _ ystem_STB1. N@ry_@ -i TI0xff0;e-M .C,1 _ ystem_STB1.num_0]tries = 256;e-M .pu_data->typ
 = CPU_SH7729;--i}o-_)l G defLi)d(__SH4__) -_ GzbH_t
@@ -2CPU_SUBTYPE_eT40STB1n- .pu_data->typ
 = CPU_ST40STB1;F-Tel G defLi)d(t
@@ -2CPU_SUBTYPE_e = d0) || \_-if    defLi)d(t
@@ -2CPU_SUBTYPE_e = d1Ie-M.pu_data->typ
 = CPU_SH7750;F_T) {
o-#  -(r Unknown SH4iCPUgtyp
o-_)@ vNR-_)@ vNR-}--
_ES <caONFIG_.C,1 _NFIGa ze) f-@ -	@ vNRE_FGENERIccr;
-o-	detect_cpu_and_cC,1 _ ystema);--o-	ccr_SH4o 
+NFl(CCR).o_@jump_to_P2().o-	SUR	ccr_&lCCR_CACHE_ENfile)
-		PU
-@  miXXX: Should cb,cknRA he	i. o-@  miIfnRA waHP1,Nwceonly 3"y" 
3tflushsild)hFlf"ofgild)cC,1 s.,-		P*ne-M .C,1 _wbabi_a  a);--M-M.o 
+objl(CCR_CACHE_INIT, CCR).o-	babi_to_P1();--}i-S_T G defLi)d(__SH4__) -zeI- *)SH-4)haHPveltually 8ndexed<o
@@physically tagged)cC,1 .P- */
-
_zeI- *)W0(		_babi ild)+elty D-cC,1 s, eutFno@ _nv_sid"K) ildm."- *I- *)START, END: Veltual_Ad@ourc_- &in-8  pF TES <cd.C,1 _wbabi_rangd(@ vNRE_FGENERI < ob,
@ vNRE_FGENERI0] )f-@ -	@ vNRE_FGENERIv;--M-M8 
  h&=4~(L1_CACHE_BYTES-1IGM-MG_SM(v ||8 
  ; v <c)Cd; v+=L1_CACHE_BYTES)led-		R+GTESl pFle("ocbwb	%0" -	il     :+ 	 no objpu@ +/M-Mil     :+"m" (__ma ))); -i}o-}--
_zeI- *)Inv_sid"K) I-cC,1 s."- *I- *)START, END: Veltual_Ad@ourc_- &_- &in-8  pF TES <c_.C,1 _purge_eangd(@ vNRE_FGENERI < ob,
@ vNRE_FGENERI0] )f-@ -	@ vNRE_FGENERIain_s data,ov;--M-M8 
  h&=4~(L1_CACHE_BYTES-1IGM-
_@jump_to_P2().o-	PU
-@b*)To)handle ild)cC,1 -line,Nwcecalcul"K) ild) N@ryeg totveltual
-@b*)- sourc:  N@rye=Cvain_ &4CACHE_IC_ENTRY_MASKGn-a +n-a +eW totA-bIG_"on"s data g0(	tengto+isSteansl"K)d oy MMU<o
@n-a +ecompar* iild)tag"ofgcC,1 -o
@@ G IG'sS_SOLmatched, _SOlingn-a +entent[ "occurr* .  (W* cantaCON
+flushingdSOldr cC,1 s.)n-a +en-a +eNOTE: We cant@{
"A-bIG_feature he	i, eecau{
"we hurcev_sidn-a +e0]triy 8n TLB (attleast)8n UTLB), asgd.C,1 _wbabi_rangd+isn-a +ec en+
-bef
++ tspR+struct *+isS> en+
Gn-a +/M-MG_SM(v ||8 
  ; v <c)Cd; v+=L1_CACHE_BYTES)led-		Rin_ = CACHE_IC_ADD/ESS_ARRAY |	(v&CACHE_IC_ENTRY_MASK)M-Mil|I0x8+ 	 A-bIG_+/;e-M data = (v&f,fffffc+0= + 	 V_sid=0P*ne-M .o 
+objl(data, ain_); -	}o-	babi_to_P1();--}i-S_zeI- *)W0(		_babi ild)rangdeofgD-cC,1 ,-o
@@purge ild)I-cC,1 .P- *I- *)e en+
-
SK_Ssh/IG_SH_GvNREal.c, af3e7 otalraingdild)memoryI- *)through U0Iarea.  START-o
@@END+isSt1 -od@ourcsofgU0.P- */
-ES <cflush__.C,1 _rangd(@ vNRE_FGENERI < ob,
@ vNRE_FGENERI0] )f-@ -	@ vNRE_FGENERIat was -M-M8pyr_and_cli(SCONTIGM-	d.C,1 _wbabi_rangd( < ob,
0] ).o-	S.C,1 _purge_eangd( < ob,
0] ).o-	e as
++_SCONT(SCONTIGM-}i-S_zeI- *)W0(		_babi ild)D-cC,1 -o
@@purge ild)I-cC,1  G_SMvNREal_trampoline. 	- */
-ES <cflush_cC,1 _ igtramp(@ vNRE_FGENERIain_)f-@ -	@ vNRE_FGENERIv, 8ndex;
-M-Mv ||ain_ &4~(L1_CACHE_BYTES-1IGM-	R+GTESl pFle("ocbwb	%0" -	i     :+ 	 no objpu@ +/M-Mi     :+"m" (__ma ))); ---	 Sdex = CACHE_IC_ADD/ESS_ARRAY| (v&CACHE_IC_ENTRY_MASK);--	co 
+objl(0, 8ndex); io ClearFouDFV_sid-bIG_+/M-}--
_zeI- *)Inv_sid"K) ild)I-cC,1  ofgild)pageR	d( 'tt3"y" 
3tg0(		_babi D-cC,1 ).P- *I- *)e en+
-
SK_SIG_SH_Gptrac pnt mm/memory.c af3e7 flush_page_to_ram+isS> en+
Gn- */
-ES <cflush__.C,1 _page=y    cCvm_anux_y    cC*vma,By    cCeage *pg)f-@ -	@ vNRE_FGENERIphys,Iain_s data, 8GM-o-	PU_Physical-od@ourcsofgtspR+eage */M-Mphys TI(pg -)mem_@ p)*PAGE@SIZE +caOMEMORY_STARTGM-
_@jump_to_P2().o-	PUeLoop a  _ild)I-cC,1 -*ne_@G_SM(G=0;Bi<CACHE_IC_NUM_ENTRIES;Bi++)led-		oin_ = CACHE_IC_ADD/ESS_ARRAY| (i<<CACHE_IC_ENTRY_SHIFT).o-		data = .o 
+NFl=ain_);--	MSUR	tdata & CACHE_VALIDf && tdata&PAGE@MASK) ==Iphys led-M ldata 	\
 CACHE_VALIDGM-Ml	.o 
+objl(data, ain_); -	i} -	}o-	babi_to_P1();--}i-S_zeI- *)W0(		_babi & _nv_sid"K) ild)D-cC,1 -ofgild)page	Z-, ~(T3taCON
+"alias" issues) - */
-ES <cflush_dcC,1 _page=y    cCeage *pg)f-@ -	@ vNRE_FGENERIphys,Iain_s data, 8GM-o-	PU_Physical-od@ourcsofgtspR+eage */M-Mphys TI(pg -)mem_@ p)*PAGE@SIZE +caOMEMORY_STARTGM-
_@jump_to_P2().o-	PUeLoop a  _ild)D-cC,1 -*ne_@G_SM(G=0;Bi<CACHE_OC_NUM_ENTRIES;Bi++)led-		oin_ = CACHE_OC_ADD/ESS_ARRAY| (i<<CACHE_OC_ENTRY_SHIFT).o-		data = .o 
+NFl=ain_);--	MSUR	tdata & CACHE_VALIDf && tdata&PAGE@MASK) ==Iphys led-M ldata 	\
 (CACHE_VALID|CACHE_UPDATED)GM-Ml	.o 
+objl(data, ain_); -	i} -	}o-	babi_to_P1();--}i-S_ES <cflush_.C,1 _a  a ze) f-@ -	@ vNRE_FGENERIain_s data,oi; -	@ vNRE_FGENERIat was -M-M8pyr_and_cli(SCONTIGM-	jump_to_P2().o-o-	PUeLoop a  _ild)D-cC,1 -*ne_@G_SM(G=0;Bi<CACHE_OC_NUM_ENTRIES;Bi++)led-		oin_ = CACHE_OC_ADD/ESS_ARRAY|(i<<CACHE_OC_ENTRY_SHIFT).o-		data = .o 
+NFl=ain_);--	MSUR	data & CACHE_VALIDf ed-M ldata 	\
 (CACHE_UPDATED|CACHE_VALIDfGM-Ml	.o 
+objl(data, ain_); -	i} -	}o-o-	PUeLoop a  _ild)I-cC,1 -*ne_@G_SM(G=0;Bi<CACHE_IC_NUM_ENTRIES;Bi++)led-		oin_ = CACHE_IC_ADD/ESS_ARRAY| (i<<CACHE_IC_ENTRY_SHIFT).o-		data = .o 
+NFl=ain_);--	MSUR	data & CACHE_VALIDf ed-M ldata 	\
 CACHE_VALIDGM-Ml	.o 
+objl(data, ain_); -	i} -	}o-o-	babi_to_P1();--	e as
++_SCONT(SCONTIGM-}i-S_ES <cflush_.C,1 _mm=y    cCmm_y    cC*mm f-@ -	PU_Isgildre ~ny good way? &in-h/+eXXX: possi1]ytcallcflush_.C,1 _rangdeG_SMeC,1 vmMa	ia-*ne-MGlush_.C,1 _a  a);--}i-S_zeI- *)W0(		_babi o
@@_nv_sid"K) D-cC,1 s."- *I- *)START, END: Veltual_Ad@ourcs(U0Iain_urc)"- *I- *)NOTE: We 3"y" 
3tflushsild)_physical_Ceage  N@ry	Z-, ~Flushingdild)cC,1 -lineseG_SMU0Ionly isn'ttenough	Z-, ~We 3"y" 
3tflushsG_SMP1gtoo,	whichimay@eq tain alias s."- */
-ES <cflush_cC,1 _rangd(y    cCmm_y    cC*mm,
@ vNRE_FGENERI < ob,m-7	on Bo  @ vNRE_FGENERI0] )f-@ -	PUn-a +eW* could callcflush_.C,1 _eage 
orhild)pages-ofgildsd)rangd,
-@b*)eutFIG'sS_SOLefficiend (scangild)cC,1 s a  _ild)ti/*p..)Gn-a +n-a +eW* can'tt@{
"A-bIG_magic, asgildre's ild)cC{
"we d( 'tthurc
-@b*)v_sid- N@ryeon TLBGn-a +/M-MGlush_.C,1 _a  a);--}i-S_zeI- *)W0(		_babi o
@@_nv_sid"K) D-cC,1 s-
orhild)page.P- *I- *)ADD/: Veltual_Ad@ourcs(U0Iain_urc)"- *I- *)NOTE: We 3"y" 
3tflushsild)_physical_Ceage  N@ry	Z-, ~Flushingdild)cC,1 -lineseG_SMU0Ionly isn'ttenough	Z-, ~We 3"y" 
3tflushsG_SMP1gtoo,	whichimay@eq tain alias s."- */
-ES <cflush_cC,1 _page=y    cCvm_anux_y    cC*vma,B@ vNRE_FGENERIain_)f-@ -	pgd_cC*di_.o-	pmd_cC*pmd.o-	pte_cC*pte.o-	ete_cC N@rys -	@ vNRE_FGENERIphys;M-M8    cCeage *pg;
-o-	di_ TIpgd_offset(vma->vm_mm, ain_).o-	pmd TIpmd_offset(di_, ain_).o-	SUR	pmd_none(*pmd))M-Mie unsi.o-	SUR	pmd_bad(*pmd))o-Mie unsi.o-	pte TIpte_offset(pmd, ain_).o-	 N@rye=C*pte.o-	SUR	pte_none( N@ry) || !pte_pe aent( N@ry))o-Mie unsi.o-	phys TIpte_v_s( N@ry)&PAGE@MASK.o-	pg = velt_to_page=__v_(phys)); -iflush_dcC,1 _page=pg);--}i-S_zeI- *)W0(		-babi & _nv_sid"K) ild)cC,1 .P- *I- *)Af3e7 otalraingdild)memory-
SK_SIG_SH_ space (P1-anux),Nwce3"y" 
3tI- *)w0(		_babi ild)cC,1 -line.P- *I- *)We sem+-@_ild)D-cC,1 -
3tsee@ G we hurceild) N@ries core apondingdioI- *)thd)page,-o
@@ G found,)w0(		_babi ildm."- */
-ES <caOflush_page_to_ram=h a prkain_)f-@ -	@ vNRE_FGENERIphys,Iain_s data, 8GM-o-	PU_Physical-od@ourcsofgtspR+eage */M-Mphys TIPHYSADD/(kain_).o-
_@jump_to_P2().o-	PUeLoop a  _ild)D-cC,1 -*ne_@G_SM(G=0;Bi<CACHE_OC_NUM_ENTRIES;Bi++)led-		oin_ = CACHE_OC_ADD/ESS_ARRAY| (i<<CACHE_OC_ENTRY_SHIFT).o-		data = .o 
+NFl=ain_);--	MSUR	tdata & CACHE_VALIDf && tdata&PAGE@MASK) ==Iphys led-M ldata 	\
 (CACHE_UPDATED|CACHE_VALIDfGM-Ml	.o 
+objl(data, ain_); -	i} -	}o-	babi_to_P1();--}i-S_ES <cflush_page_to_ram=y    cCeage *pg)f-@ -	@ vNRE_FGENERIphysGM-o-	PU_Physical-od@ourcsofgtspR+eage */M-Mphys TI(pg -)mem_@ p)*PAGE@SIZE +caOMEMORY_STARTGM-	aOflush_page_to_ram=phys_to_velt(phys)); -}i-S_zeI- *)Cb,ckn N@ries ofgild)I-cC,1 -&)D-cC,1 -ofgild)page	Z-, ~(T3tsee@"alias" issues) - */
-ES <ccb,ck_cC,1 _page=y    cCeage *pg)f-@ -	@ vNRE_FGENERIphys,Iain_s data, 8GM-	@ vNRE_FGENERIkain_GM-	@ vNRE_FGENERIcC,1 _line_8ndex;
-	 STBbing1 = 0GM-o-	PU_Physical-od@ourcsofgtspR+eage */M-Mphys TI(pg -)mem_@ p)*PAGE@SIZE +caOMEMORY_STARTGM-	koin_ = phys + PAGE@OFFSETGM-	cC,1 _line_8ndex TI(koin_&CACHE_OC_ENTRY_MASK)>>CACHE_OC_ENTRY_SHIFT.o-
_@jump_to_P2().o-	PUeLoop a  _ild)D-cC,1 -*ne_@G_SM(G=0;Bi<CACHE_OC_NUM_ENTRIES;Bi++)led-		oin_ = CACHE_OC_ADD/ESS_ARRAY| (i<<CACHE_OC_ENTRY_SHIFT).o-		data = .o 
+NFl=ain_);--	MSUR	tdata & 2CACHE_UPDATED|CACHE_VALIDf) -	i    == 2CACHE_UPDATED|CACHE_VALIDf -	i    && tdata&PAGE@MASK) ==Iphys led-M ldata 	\
 (CACHE_VALID|CACHE_UPDATED)GM-Ml	.o 
+objl(data, ain_); -	iMSUR	ti^cC,1 _line_8ndex)&f,180)M-Mil	bing1 = 1; -	i} -	}o-o-	cC,1 _line_8ndex &TI0xff.o-	PUeLoop a  _ild)I-cC,1 -*ne_@G_SM(G=0;Bi<CACHE_IC_NUM_ENTRIES;Bi++)led-		oin_ = CACHE_IC_ADD/ESS_ARRAY| (i<<CACHE_IC_ENTRY_SHIFT).o-		data = .o 
+NFl=ain_);--	MSUR	tdata & CACHE_VALIDf && tdata&PAGE@MASK) ==Iphys led-M ldata 	\
 CACHE_VALIDGM-Ml	.o 
+objl(data, ain_); -	iMSUR	tti^cC,1 _line_8ndex)&f,80))M-Mil	bing1 = 2; -	i} -	}o-	babi_to_P1();--o-	SUR	bing1 led-M 2000			ES <cdump_ < cka ze) ;--o-		SUR	bing1 ==1)M-Mile - 1;
"BINGO!\n"IOf-M 2 {
o-Mile - 1;
"Bing1!\n"IOf-M dump_ < ckaIOf-M e - 1;
"--------------------\n"IOf-M}o-}--
_ze Pagd+is 4K, OC 8izdeiHP16K,gildre ~re 
our-lines. &in-_defLi)yCACHE_ALIAS f,++++3+++n-
-ES <cclear_u{
r_page=h a pr
3,F@ vNRE_FGENERIain_urc)"-@ -	.lear_page=to).o-	SUR		tain_urc ^ (\
 	 SH2000			to) & CACHE_ALIAS))M-MiaOflush_page_to_ram=to).o-}i-S_ES <ccy' _u{
r_page=h a pr
3,Fh a pr
SK_,F@ vNRE_FGENERIain_urc)"-@ -	.y' _page(
3,F
SK_).o-	SUR		tain_urc ^ (\
 	 SH2000			to) & CACHE_ALIAS))M-MiaOflush_page_to_ram=to).o-}i-_)@ vNR(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFmm/.lear_page.S $(CONFIG_SH_NFmm/.lear_page.SP6 +35,9 @@
 #include <ahdmm/.lear_page.S8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !mm/.lear_page.S8AGa,
elNcu &inpF T ble ch@@
nux1R(w452O"l0_CP _HP69.lear_page.Sthen
1G_MEfin7/23 10c.o 50
+if [ "$CONFIG &_+eE).lear_page implem N@act *+ofgSuperHP
+		   rey' CO.:6 2C1,_MEf  Nf [ "Yutaka & Kaz Kojima,
+		   inpF /&_+eE).lear_pageMAKE)@to: P1
- sourcMAKEMAKE)ES <cclear_page=h a pr
3)	   inpF /&_+eE)r0 6 +3scratch_+eE)r4 6 +3ioI+eE)r5 6 +3io + 4096	   inp_PCchild);$	"
+
$	"kage	chi ENTRY(clear_page f@imov	r4,r5f@imov.w	.Llimit,r0MEMain	r0,r5f@imov	#0,r0MEM!
+1:o+T G defLi)d(__sh3__) @imov.l	r0,@r4F Tel G defLi)d(__SH4__) @imovca.l	r0,@r4F imov	r4,r112T@@ vNR1_ain	#32,r4F imov.l	r0,@-r4F imov.l	r0,@-r4F imov.l	r0,@-r4F imov.l	r0,@-r4F imov.l	r0,@-r4F imov.l	r0,@-r4F imov.l	r0,@-r4F # G defLi)d(__SH4__) @iocbwb	@r112T@@ vNR1_cmp/eq	r5,r4F ibf/s	1bn+a ain	#28,r4F i!-+letsn+a nop
+.Llimit:	.word	(4096-28)R(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFmm/.y' _page.S $(CONFIG_SH_NFmm/.y' _page.SP6 +35,9 @@
 #include <ahdmm/.y' _page.S8 +42,10 @@
 obj-$(ondiCI
a hDa+ tsdm+-@@
 !mm/.y' _page.S8AGa,
elNcu &inpF T ble ch@@
nux1R(w469O"l0_CP _HP69.y' _page.Sthen
2G_MEfin7/23 10c27:25
+if [ "$CONFIG &_+eE).y' _page implem N@act *+ofgSuperHP
+		   rey' CO.:6 2C1,_MEf  Nf [ "Yutaka & Kaz Kojima,
+		   inpF /&_+eE).y' _pageMAKE)@to: P1
- sourcMAKE)@
SK_: P1
- sourcP
+	MAKE)ES <ccy' _page(h a pr
3,Fh a pr
SK_)	   inpF /&_+eE)r0, _1s r2s r3s r4s r5s r6s r7 6 +3scratch _+eE)r8 6 +3
SK_S+ 4096	    r9 6 +3_SOLu{
d	    r10 6 +3ioI+eE)r11 6 +3
SK_	   inp_PCchild);$	"
+
$	"kage	chi ENTRY(cy' _page) @imov.l	r8,@-r15 @imov.l	r10,@-r15 @imov.l	r11,@-r15 @imov	r4,r10 @imov	r5,r11 @imov	r5,r8f@imov.w	.L4096,r0MEMain	r0,r8MEM!
+1:imov.l	@r11+,r0MEMmov.l	@r11+,r1MEMmov.l	@r11+,r2MEMmov.l	@r11+,r3MEMmov.l	@r11+,r4MEMmov.l	@r11+,r5MEMmov.l	@r11+,r6MEMmov.l	@r11+,r7o+T G defLi)d(__sh3__) @imov.l	r0,@r10 @Tel G defLi)d(__SH4__) @imovca.l	r0,@r10 @imov	r10,r0MET@@ vNR1_ain	#32,r10MEMmov.l	r7,@-r10MEMmov.l	r6,@-r10MEMmov.l	r5,@-r10MEMmov.l	r4,@-r10MEMmov.l	r3,@-r10MEMmov.l	r2,@-r10MEMmov.l	r1,@-r10ME# G defLi)d(__SH4__) @iocbwb	@r012T@@ vNR1_cmp/eq	r11,r8MEMbf/s	1bn+a ain	#28,r10MEM!
+Mmov.l	@r15+,r11 @imov.l	@r15+,r10 @imov.l	@r15+,r8-+letsn+a nop
+.L4096:	.word	4096	(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFmm/200[1],.c $(CONFIG_SH_NFmm/200[1],.cP6 +35,9 @@
 #include <ahdmm/200[1],.c8 +42Apr 11 21:24:52c-aica.o
 
 ifeq ($(CONFmm/200[1],.c8AGa,
elNcu &inpF T ble ch@@
n1,4R(w44Ry size' CONF200[1],.cthen
1G1999/09/18
 ob57:37
+if [ "$CONFIGze' CONF200[1],.cthen
2G_MEfin3/@@
 0:43:18
+if [ "$CONFI +	M +	 $(CONFIG_SH_NFmm/200[1],.cP +	  Taken3
SK_:	(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFmm/fault.c $(CONFIG_SH_NFmm/fault.cP6 +35,9 @@
 #include <ahdmm/fault.cetup_dc.o io_dc.o r9c-aica.o
 
 ifeq ($(CONFmm/fault.ceAGa,
elNcu &inpF T ble ch@@
n1,4R(w44Ry size' CONFfault.cthen
13G_ME0/03/07o_2:05:24
+if [ "$CONFIGze' CONFfault.cthen
48G_MEfin8_T b00c27:04
+if [ "$CONFI +	M +	  $(CONFIG_SH_NFmm/fault.cP +	  ey' CO.:6 2C1,1999  Nf [ "Yutaka,@@
n28,10 +28,6Ry s vmaddr);
+R+G* mu_eq t200


( 
 2000			ES <cdie(cynst char *,y    cCet_engs *,00			;
_8  pF TES <caOflush_tlb_page=@ vNRE_FGENERIasid,F@ vNRE_FGENERIpage);S_T G defLi)d(__SH4__) -8  pF TES <caOflush_tlb_phys(@ vNRE_FGENERIphys ;i-_)@ vNR 
 /	M +	 Ug y,-ug y,-eutFild)goto'R+nusult)8n bet3e7 ossembly..,@@
n242,8 +238,10 y s 	pte_cC*pte.o 	ete_cC N@rys  o-	SUR	ain_urc >= VMALLOC_START && ain_urc < VMALLOC_END)o+	SUR	ain_urc >= P3SEG && ain_urc < P4SEG)o 		di_ TIpgd_offset_k(ain_urc).o+	 l{
lSUR	ain_urc >= TASK@SIZE)o2,	e unsi 1;   2 {
o 		di_ TIpgd_offset(curr*nt->mm, ain_urc).o ,@@
n257,7 +255,7 y s 	}o 	ete TIpte_offset(pmd, ain_urc).o 	 N@rye=C*pte.o-	SUR	pte_none( N@ry) || !pte_pe aent( N@ry)o+	SUR	pte_none( N@ry) || pte_not_pe aent( N@ry)o i    || (g0(		otalra && !pte_g0(		( N@ry)))o 		e unsi 1;  ,@@
n283,27 +281,24 y s 	@ vNRE_FGENERIpteval;s 	@ vNRE_FGENERIvpn;s vmG defLi)d(__SH4__) @iy    cCeage *page;s 	@ vNRE_FGENERIptea;s v)@ vNR 
-M8pyr_and_cli(SCONTIGM-T G defLi)d(__SH4__) -	SUR	pte_shar* 	pteI led-M 8    cCeage *pg;
ph/+ePtrac imay@ea  _ilpR+nbed
+ .l+/MEMSUR	vma && curr*nt->act(AR_mm != vma->vm_mm)o2,	e unsi.o o-@ pteval TIpte_v_s(pteIGM-@ pteval &= PAGE@MASK. PU_PhysicallCeage ain_urc +/M-MiaOflush_tlb_phys(ptevalIGM-@ pg = velt_to_page=__v_(ptevalIIGM-@ flush_dcC,1 _page=pg);-E# G defLi)d(__SH4__) @ipage = pte_page=pteIGM+	SUR	VALID_PAGE(page) && !t as_bIG(PG_@ pped, &page->SCONTI led+		opyrP1pcess thphys TIpte_v_s(pteI & PTE_PHYS_MASKs +MiaOflush_wbabi_engion==h a pr)P1SEGADD/(phys , PAGE@SIZE).o+		aOset_bIG(PG_@ pped, &page->SCONTI.o 	}o v)@ vNR 
-M/+ePtrac imay@ea  _ilpR+nbed
+ .l+/M-MSUR	vma && curr*nt->act(AR_mm != vma->vm_mm)led-M e as
++_SCONT(SCONTIGM-Mie unsi.o-	}ME	opyr_and_cli(SCONTIGM 
 @PU_Set PTEH)engister &in 	vpn TI(- sourcs& MMU_VPN_MASK) | get_asid();,@@
n327,7 +322,7 y s 	e as
++_SCONT(SCONTIGM }R 
-8  pF TES <caOflush_tlb_page=@ vNRE_FGENERIasid,F@ vNRE_FGENERIpage)npES <caOflush_tlb_page=@ vNRE_FGENERIasid,F@ vNRE_FGENERIpage)nled 	@ vNRE_FGENERIain_s data;
 ,@@
n349,40 +344,6Ry s 	babi_to_P1();- v)@ vNR }i-S_T G defLi)d(__SH4__) -8  pF TES <caOflush_tlb_phys(@ vNRE_FGENERIphys f-@ -	@ vNRE_FGENERIain_s data,opte.o-o-	pte TIphys | MMU_UTLB_VALIDGM-MG_SM(oin_ = MMU_UTLB_DATA_ARRAY;m-	on Boain_ < MMU_UTLB_DATA_ARRAY+(MMU_UTLB_ENTRIES<<MMU_U_ENTRY_SHIFT).o-	on Boain_ +||(1<<MMU_U_ENTRY_SHIFT))led-M data = .o 
+NFl=ain_);--	MSUR	tdata & 2MMU_UTLB_VALID|PAGE@MASK)) ==IpteI ed-M ldata 	\
 MMU_UTLB_VALIDGM-M	@jump_to_P2().o-	l	.o 
+objl(data, ain_); -	iMbabi_to_P1();--	iMbreak; -	i} -	}o-	pte TIphys | MMU_ITLB_VALIDGM-MG_SM(oin_ = MMU_ITLB_DATA_ARRAY;m-	on Boain_ < MMU_ITLB_DATA_ARRAY+(MMU_ITLB_ENTRIES<<MMU_I_ENTRY_SHIFT).o-	on Boain_ +||(1<<MMU_I_ENTRY_SHIFT))led-M data = .o 
+NFl=ain_);--	MSUR	tdata & 2MMU_ITLB_VALID|PAGE@MASK)) ==IpteI ed-M ldata 	\
 MMU_ITLB_VALIDGM-M	@jump_to_P2().o-	l	.o 
+objl(data, ain_); -	iMbabi_to_P1();--	iMbreak; -	i} -	}o-}i-_)@ vNR 
 ES <cflush_tlb_page=y    cCvm_anux_y    cC*vma,B@ vNRE_FGENERIpage)nled(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFmm/+d lUc $(CONFIG_SH_NFmm/+d lUcP6 +35,9 @@
 #include <ahdmm/+d lUcetup_dc.o io_dc.o r9c-aica.o
 
 ifeq ($(CONFmm/+d lUcethu,
elN20G_M:02:03ble ch@@
n1,4R(w44Ry size' CONF+d lUcthen
17G_ME0-04-0u &5:38:54+T b+if [ "$CONFIGze' CONF+d lUcthen
18G_MEfin8_T3o_1:22:06
+if [ "$CONFI +	M +	  $(CONFIG_SH_NFmm/+d lUcP +	M@@
n34,41 +34,23Ry s vmaddr);
+R+G*pga  de	chi vmaddr);
+R+G* mu_eq t200


( eAe.o t/spR+G*FIGm_aleAe.o t/spR+G*tlb


(ehG mu_gaildr_cCmmu_gaildrs[NR2CPUS];R 
 /	M +	 CC,1 -ofgMMU<eq t200 last)u{
d.
)P*neB@ vNRE_FGENERI mu_eq t200_cC,1 ;R 
-T GzbH_t
@@ -2DISt
@TIGMEM
+pg_data_ F_&ieq tig_page_data[NR2NODES];R+bootmem_data_ F_&ieq tig_node_bdata[NR2NODES];R+T@@ vNR1
 8  pF T@ vNRE_FGENERItotalram_pages;
 8  pF T@ vNRE_FGENERItotalhO.:_pages;
 
-2000			@ vNRE_FGENERIin6 +smp_@ ppings(@ vNRE_FGENER ;--o-2000			@ vNRE_FGENERI0mpty_zero_page[1024];]-o- STBdo_cb,ck_pg0_cC,1 ( STBlow,
st40hO.: f-@ -	st40fr"y" = 0GM-	SUR	pg0[1],_cC,1 _ ize >0hO.: led-M do ed-M lSUR	pgd_quicklist)led-	M lfr"y_pgd_slow=get_pgd_fast(IIGM-@  lfr"yd++; -	i	}o-i		SUR	pmd_quicklist)led-	M lpmd_fr"y_slow=pmd_a  de_one_fast(NULL, 0IIGM-@  lfr"yd++; -	i	}o-i		SUR	pte_quicklist)led-	M lpte_fr"y_slow=pte_a  de_one_fast(NULL, 0IIGM-@  lfr"yd++; -	i	}o-i	} n= chi	pg0[1],_cC,1 _ ize >0low); -	}o-	e unsi fr"yd.o-}i-S ES <cshow_mema ze) fled 	st40i,Itotal = 0,+nuservy" = 0GM@@
n91,7 +73,6Ry s 	e - 1;
"%d+nuservy" pages\n",nuservy"I.o 	e - 1;
"%d+pages-shar* \n",shar* I.o 	e - 1;
"%d+pages-swapIcC,1  \n",cC,1  ).o-	p - 1;
"%ld+pages-inCeage 0[1],IcC,1 \n",pg0[1],_cC,1 _ izeI.o 	show_buffdrs(IGM }R 
@@
n146,12R(w27,18Gy s 			zones_ ize[ZONE_DMA]e=Cmax_dma -I < ob_pfi.o 			zones_ ize[ZONE_NORMAL]e=Clow -)max_dma.o 		}o-i	fr"y_anux_in6 +node(0, 0, 0, zones_ ize,caOMEMORY_START, 0I.o+		fr"y_anux_in6 +node(0, NODE_DATA(0), 0, zones_ ize,caOMEMORY_START, 0I.o+T GzbH_t
@@ -2DISt
@TIGMEM
+		zones_ ize[ZONE_DMA]e=CaOMEMORY_SIZE_2ND >> PAGE@SHIFT.o+		zones_ ize[ZONE_NORMAL]e=C0.o+		fr"y_anux_in6 +node(1, NODE_DATA(1), 0, zones_ ize,caOMEMORY_START_2ND, 0I.o+T)@ vNR  	}o }R 
 ES <caONFIG_mem_STIGa ze) f @ -	2000			@ vNRE_FGENERI0mpty_zero_page[1024];] 	st40code ize,cnuservy"pagess data ize,cSTIG ize;] 	st40tmp;
 ,@@
n160,10 +147,13Ry s 
 @PU_clearFild)zero-eage */M 	memset(0mpty_zero_page, 0, PAGE@SIZE); -iflush_page_to_ram=helt_to_page=0mpty_zero_page));m+7aOflush_wbabi_engion=0mpty_zero_page, PAGE@SIZE);  
 @PU_ilpR+ntentpu@ a  _low memory-q toFild)fr"ylistc +/M-Mtotalram_pages +||fr"y_all_bootmem();-+ltotalram_pages +||fr"y_all_bootmem+node(NODE_DATA(0)I.o+T GzbH_t
@@ -2DISt
@TIGMEM
+	totalram_pages +||fr"y_all_bootmem+node(NODE_DATA(1)I.o+T)@ vNR 	nuservy"pagese=C0.o MG_SM(tmpe=C0.0tmp < num_physpages;0tmp++)o 		/	M@@
n182,6R+172,8 y s 		nuservy"pagese<< (PAGE@SHIFT-10),o 		data ize >> 10,o 		STIG ize >> 10).o+
@@p3_.C,1 _NFIGaIGM }R 
 ES <cfr"y_NFIGmema ze) f(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFmm/+oremapUc $(CONFIG_SH_NFmm/+oremapUcP6 +35,9 @@
 #include <ahdmm/+oremapUc8 +42Apr 11 21:24:52c-aica.o
 
 ifeq ($(CONFmm/+oremapUc8AGa,
elNcu &inpF T ble ch@@
n1,4R(w44Ry size' CONF+oremapUcthen
2G1999/11/25 14bj-$28b+if [ "$CONFIGze' CONF+oremapUcthen
4G_MEfin6/30 09:18:39
+if [ "$CONFI +	M +	 IG_SH_NFmm/+oremapUcP +	M@@
n13,8 +13,8 y s vmaddr);
+R+G*FIGm_a vmaddr);
+R+G*pga  de	chi n-8  pF Tstline	ES <cremap_anux_pte	pte_cC* pte,C@ vNRE_FGENERIain_urc,
@ vNRE_FGENERI ize, -	@ vNRE_FGENERIphys_ain_,C@ vNRE_FGENERIat wa)* 8  pF Tstline	ES <cremap_anux_pte	pte_cC* pte,C@ vNRE_FGENERIain_urc,
+@opyrP1pcess th ize,c@ vNRE_FGENERIphys_ain_,C@ vNRE_FGENERIat wa)*led 	@ vNRE_FGENERI)Cd;
 i_gprot_cC_gprot ||__pgprot(_PAGE@P/ESENT | _PAGE@RW |M@@
n36,11 +36,11 y s 		- sourcs+= PAGE@SIZE.o 		phys_ain_ += PAGE@SIZE.o 		pte++; -	} n= chi	- sourcs&& ain_urc < 0] ).o+	} n= chi	- sourcs&& (ain_urc < 0] )IGM }R 
-8  pF Tstline	st40remap_anux_pmd(pmd_cC* pmd, @ vNRE_FGENERIain_urc,
@ vNRE_FGENERI ize, -	@ vNRE_FGENERIphys_ain_,C@ vNRE_FGENERIat wa)* 8  pF Tstline	st40remap_anux_pmd(pmd_cC* pmd, @ vNRE_FGENERIain_urc,
+@opyrP1pcess th ize,c@ vNRE_FGENERIphys_ain_,C@ vNRE_FGENERIat wa)*led 	@ vNRE_FGENERI)Cd;
 M@@
n58,r9c+58,r9cy s 		numap_anux_pte	pte,Iain_urc,
0]  -Iain_urc,
- sourcs+Iphys_ain_,CSCONTI.o 		- sourcsTI(- sourcs+ PMD@SIZE) & PMD@MASKs   lpmd++; -	} n= chi	- sourcs&& ain_urc < 0] ).o+	} n= chi	- sourcs&& (ain_urc < 0] )IGM 	e unsi 0GM }R 
-8  pF Tst40remap_anux_pages(@ vNRE_FGENERIain_urc,
@ vNRE_FGENERIphys_ain_,M-Mil    opyrP1pcess th ize,c@ vNRE_FGENERIat wa)* st40remap_anux_pages(@ vNRE_FGENERIain_urc,
@ vNRE_FGENERIphys_ain_,M+7	on BoopyrP1pcess th ize,c@ vNRE_FGENERIat wa)*led 	st40  -(r;
 i_gd_cC* di_.o 	@ vNRE_FGENERI)Cd ||ain_urcs+  ize;] 
 i_hys_ain_ -||ain_urc;o-	di_ TIpgd_offset(&in6 +$m, ain_urc).o+	di_ TIpgd_offset_k(ain_urc).o MGlush_.C,1 _a  a);- 	SUR	ain_urc >= 0] )f  lBUG();,@@
n106,7 +106,7 y s C* hurceio<eq vertFildmTst4o a*+offset-inCaCeage-alNRE_FG@ pping,-eutFilds C* > en+rcshould 'tt3"y" 
3tknow)t atlsma  _detail.
)P*ne_ES <c*caONoremap(@ vNRE_FGENERIphys_ain_,C@ vNRE_FGENERI ize,c@ vNRE_FGENERIat wa)* ES <c*cp3_Noremap(@ vNRE_FGENERIphys_ain_,C@ vNRE_FGENERI ize,c@ vNRE_FGENERIat wa)*led 	ES <c*cain_GM 	y    cCvm_y    cC*Ma	ia;,@@
n150,7 +150,7 y s 	e unsi =h a pr) (offset-+ (char *)ain_);  }R 
-ES <c_ounmap(h a prain_)f ES <cp3_Nounmap(h a prain_)fled 	sUR	ain_ >0hO.:_memory)o 		e unsi vfr"y(=h a pr) (PAGE@MASK & 2@ vNRE_FGENER  oin_));-(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_NFvm$(CON.lds.S $(CONFIG_SH_NFvm$(CON.lds.SP6 +35,9 @@
 #include <ahdvm$(CON.lds.Setup_dc.o io_dc.o r9c-aica.o
 
 ifeq ($(CONFvm$(CON.lds.SeAGa,
elNcu &inpF T ble ch@@
n1,4R(w44Ry size' CONFvm$(CON.lds.Sthen
4G1999/12/23 11:37:45b+if [ "$CONFIGze' CONFvm$(CON.lds.inthen
5G_MEfin7/27o_1:45:55
+if [ "$CONFI +	 ld3script 
3tmakegSuperH L(CONSIG_SH_I +	 W0(	tengby Nf [ "Yutaka,)P*ne@@
n74,7 +74,11 y s   . TIALIGN(4096);    .data.page_alNRE_FG: { *(.data.idt) }R 
+_ GzbH_t
@@ -2CPU_SH3	
+  . TIALIGN(16I.o+T) {
o   . TIALIGN(32I.o+T)@ vN	    .data..C,1 line_alNRE_FG: { *(.data..C,1 line_alNRE_F) }R 
   . TIALIGN(4);-(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_/boot/btfixupprepUc $(CONFIG_SH_pIG_/boot/btfixupprepUcP6 +35,9 @@
 #include <apIG_/boot/btfixupprepUc	Sun O cC 4 10c22:42G1998a.o
 
 ifeq ($(COpIG_/boot/btfixupprepUc	tup_Aug 28b0dc.9:44ble ch@@
n1,4R(w44Ry size' CONFbtfixupprepUcthen
5G1998/09/16 &inp4:55
jj"$CONFIGze' CONFbtfixupprepUcthen
6G_MEfin8_22 &5:27:47 durcm"$CONFI +  Simple utility 
3tprep~re vm$(CON image 
orhOpIG_.I +  Resolv s a  _BTFIXUP)u{
s-o
@@settings-o
@@c	iatesI +  ahOpecial .s object 
3t$	"k toFild)image.,@@
n88,6R+88,16 y s 	e unsi array-+ last)- 1;  }R 
+ES <cset_mode (char *buffdr)"	@ -  MG_SM(mode =C0.; mode++)o+		SUR	buffdr[mode] < '0' || buffdr[mode] > '9' f@il	break; +	SUR	mode !=cu && mode !=c16Io+		fata a);-+ ];* 
Tst40main( STBargc,char **argv)fled 	char *p, *q;,@@
n106,14R(w16,6Ry s 			goto0main0.o MGata a);-0main0:M-	SUR	fgetsR	buffdr, 1024,By din) ==INULL || buffdr[0] < '0' || buffdr[0] > '9' f-		fata a);--MG_SM(mode =C0.; mode++)o-		SUR	buffdr[mode] < '0' || buffdr[mode] > '9' f-	iMbreak; -	SUR	mode !=cu && mode !=c16Io-		fata a);--Ms 	e en+n ||8 rn+n(e earc);- 	n= chi	fgetsR	buffdr, 1024,By din) !=INULL)o 		SUR	!8 rncmpR	buffdr, e earc, e en+n))M@@
n132,6R+134,8 y s 		 STBnbase;] 		SUR	!8 rncmpR	buffdr, e earc, e en+n))M 			goto0main1;o+		SUR	mode ==I0 f@il	set_mode (buffdr)s   lp ||8 rchrR	buffdr, '\n');] 		SUR	p) *pe=C0.o M	SUR	8 rn+n (buffdr) < 22+mode)-(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_/IG_SH_Gin6 +taskUc $(CONFIG_SH_pIG_/IG_SH_Gin6 +taskUcP6 +35,9 @@
 #include <apIG_/IG_SH_Gin6 +taskUc	Mon_dc.o26G_2:41 T b1999a.o
 
 ifeq ($(COpIG_/IG_SH_Gin6 +taskUc	Mon_
elN17 &5:2F T ble ch@@
n4,7 +4,6Ry s vmaddr);
+R+G*pg0[1],.chi eAe.o t/spR+G*uotalra	chi n-8  pF T8 12:29vm_anux_y    cCin6 +$mape=CINIT_MMAP;
 8  pF Ty    cCfs_y    cCin6 +fse=CINIT_FS;
 8  pF Ty    cCf
 
s_y    cCin6 +f
 
se=CINIT_FILES;
 8  pF Ty    cCvNREal_y    cCin6 +vNREalse=CINIT_SIGNALS;-(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_/IG_SH_Gptrac pn $(CONFIG_SH_pIG_/IG_SH_Gptrac pnP6 +35,9 @@
 #include <apIG_/IG_SH_Gptrac pn	Sun Aug 12 &3:27:59c-aica.o
 
 ifeq ($(COpIG_/IG_SH_Gptrac pn	tup_
elN18o_dc.3:51ble ch@@
n260,6R+260,16 y s };s v)@ vNR 
 /&_+eE)e en+
-by IG_SH_Gptrac pn when detaching..P
+	MAKE)Makegsure aing 
+stelNbitsRetc ~re _SOLset."	$(inpES <cptrac __&inpF =y    cCtask_y    cC*child)"	@ -	 	 nothingdio do$(inp ];* R+G$	"kage	ES <cdo_ptrac (y    cCet_engs *engs)*led 	@ vNRE_FGENERIrequest ||engs->u_engs[UREG_I0];,@@
n576,r9c+586,11 y s 	}R 
 	cC{
"PTRACE_SUNDETACH: {  	 detachCaCe0x20;
)t atlwaHPattC,1  .l+/M-M	@ vNRE_FGENERIat was -	MSUR	t@ vNRE_FGENER  data > _NSIG led+		st40  - TIptrac __etach(childs data);o+		SUR	  -)led 			pt_  -(r_e unsi(engs, EIO);] 			goto0ou +t-i;- 		}o-i	child->ptrac  	\
 (PT_PTRACED|PT_TRACESYSIGM-@ wake_up_e0x20;
(childIGM-@ child->ex6 +code =Cdata;
-@ w0(		_lock_irqopyr(&tasklist_lock,CSCONTI.o-@ REMOVE_LINKS(childIGM-@ child->p_eptr = .hild->p_oeptrGM-@ SET_LINKS(childIGM-@ w0(		_unlock_irqe as
++(&tasklist_lock,CSCONTI.o 		pt_succ_e unsi(engs, 0I.o 		goto0ou +t-i;- 	}-(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_/IG_SH_Gsetuppn $(CONFIG_SH_pIG_/IG_SH_GsetuppnP6 +35,9 @@
 #include <apIG_/IG_SH_Gsetuppnethu,Apr 19 .o 38:48G_MEfa.o
 
 ifeq ($(COpIG_/IG_SH_Gsetuppnethu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size'' CONFsetuppnthen
124G_MEfin4/14R21:&3:46 durcm"$CONFI+ze'' CONFsetuppnthen
125G_MEfin9/20G00:35:30 durcm"$CONFI +	  $(CONFIG_SH_pIG_/IG_SH_GsetuppnP +	M +	  ey' CO.:6 2C1,1995  Dav <cS. Mien+rc(durcm@caip.rutgers.edu)M@@
n441,10 +441,6Ry s 		breakpost4(I.o 	}o 
-M/+eDu -
3tstabi a NREm N@cnustriuct *s-o
@@assu/pct *s...l+/M-MSn6 +$m.$map->vm_page_prot ||PAGE@SHARED;M-MSn6 +$m.$map->vm_8 
  h= PAGE@OFFSETGM-	Sn6 +$m.$map->vm_)Cd ||PAGE@OFFSET-+ hO.: as_pain_GM 	Sn6 +$m.eq t200 = 2@ vNRE_FGENER  NO_t
@TEXTGM 	Sn6 +taskUthnuxd.kengs = &fake_swapper_engs;] 
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_/lib/debuglockspn $(CONFIG_SH_pIG_/lib/debuglockspnP6 +35,9 @@
 #include <apIG_/lib/debuglockspn	Fri_
elN10o_1:06 r9c1999a.o
 
 ifeq ($(COpIG_/lib/debuglockspn	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size' CONFdebuglockspnthen
10G1999/09/10
 0:40:36 durcm"$CONFI+ze' CONFdebuglockspnthen
11G_MEfin9/20G00:35:31 durcm"$CONFI +	 debuglockspn: Debuggingdverst *s-ofgSMP lockingdprimit(ARs.P +	M +	 ey' CO.:6 2C1,1997 Dav <cS. Mien+rc(durcm@caip.rutgers.edu)M@@
n29,11 +29,9cy s 8  pF Tstline	ES <cshow(char *str,Bypinlock_cC*lock,C@ vNRE_FGENERIcCen+r)*led 	st40cpu ||8mp_e0x20;
(r_id();,-	2000			ypinlock_cCcynsol	_locks  o-	SUR	lock !=I&cynsol	_lock)f-M e - 1;
"%s(%p) CPU#%<cstubi at %08lx, own+rcPC(%08lx):CPU(%lx)\n",st_,M-Millock,Ccpu,IcCen+r, lock->own+r_pc &4~3, lock->own+r_pc &43);o+	e - 1;
"%s(%p) CPU#%<cstubi at %08lx, own+rcPC(%08lx):CPU(%lx)\n",st_,M+illock,Ccpu,IcCen+r, lock->own+r_pc &4~3, lock->own+r_pc &43);o }R 
 8  pF Tstline	ES <cshow_nuxd(char *str,Brwlock_cC*lock,C@ vNRE_FGENERIcCen+r)*(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_/mm/+d lUc $(CONFIG_SH_pIG_/mm/+d lUcP6 +35,9 @@
 #include <apIG_/mm/+d lUce +42dc.o25o_dc 0:19c-aica.o
 
 ifeq ($(COpIG_/mm/+d lUcethu,
elN20G_M:02:03ble ch@@
n32,6R+32,9Ry s vmaddr);
+R+G*page	chi vmaddr);
+R+G*pg0[1],.chi eAe.o t/spR+G*vain_sGm_aleAe.o t/spR+G*tlb


(ehG mu_gaildr_cCmmu_gaildrs[NR2CPUS];R 
 @ vNRE_FGENERI*OpIG__v_sid_ain__bIGmap;] 
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_/mm/srmmuUc $(CONFIG_SH_pIG_/mm/srmmuUcP6 +35,9 @@
 #include <apIG_/mm/srmmuUce +42dc.o25o_dc 0:19c-aica.o
 
 ifeq ($(COpIG_/mm/srmmuUcethu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size' CONFsrmmuUcthen
230G_MEfin7/17 &6 r7:33-o
ton_$CONFI+ze' CONFsrmmuUcthen
231G_MEfin9/20G00:35:31 durcm"$CONFI +	 srmmuUc:  SRMMU<OpecifF Tnbed
+ seG_SMmemory-managem N@.P +	M +	 ey' CO.:6 2C1,1995 Dav <cS. Mien+rcc(durcm@caip.rutgers.edu)M@@
n1092,7 +1092,6Ry s 		map_ pbank	t@ vNRE_FGENER __v_(sp_banks[i].base_ain_), iI.o 	}o 
-MSn6 +$m.$map->vm_8 
  h= PAGE@OFFSETGM 	BTFIXUPSET_SIMM13(u{
r_ptrs_per_pgd,|PAGE@OFFSET-/ SRMMU_PGDIR@SIZE);  }] 
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64R(w]i-		in $(CONFIG_SH_pIG_64R(w]i-		inP6 +35,9 @@
 #include <apIG_64R(w]i-		in	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeq ($(COpIG_64R(w]i-		in	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry si# _HP69.y]i-		inthen
149G_MEfin8_T b17:47:51bdurcm"$CONFI+# _HP69.y]i-		inthen
150G_MEfin9/18G00:36:03bdurcm"$CONFI #)F_SMa descriptt *+ofgt1 e yntaxsofgtspR+.y]i-	uract *+t
 
,I #)see@t1  Cq i-	ure3script.P #M@@
n200,6R+200,9 y s       fis       dep_tri8  pe 'QlogF TISP SCSILsobj-y '_t
@@ -2SCSI_QLOGIC_ISP $t
@@ -2SCSIs       dep_tri8  pe 'QlogF TISP FC SCSILsobj-y '_t
@@ -2SCSI_QLOGIC_FC $t
@@ -2SCSIs+      SUR[ "$t
@@ -2SCSI_QLOGIC_FC" !=I"n" ];@t1 ns+         defLi)_bool_t
@@ -2SCSI_QLOGIC_FC_FIRMWARE ys+      fis    fis s    )Cdm Nu
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64Rdef.y]i-	 $(CONFIG_SH_pIG_64Rdef.y]i-	P6 +35,9 @@
 #include <apIG_64Rdef.y]i-		Mon_Aug 27o_2:41:40c-aica.o
 
 ifeq ($(COpIG_64Rdef.y]i-		thu,
elN20G14:_1:57ble ch@@
n96,16 +96,16 y s v_t
@@ -2FB_PM2_FIFO2DISt
@NECT)isS_SOLset
_t
@@ -2FB_PM2_PCI=ys v_t
@@ -2FB_CYBER_ME0)isS_SOLset
-v_t
@@ -2FB_PVR2)isS_SOLset
-v_t
@@ -2FB_PVR2_DEBUG)isS_SOLset
-v_t
@@ -2FB_E1355)isS_SOLset
_v_t
@@ -2FB_MATROX)isS_SOLset
_t
@@ -2FB_ATY=ys v_t
@@ -2FB_ATY_GX)isS_SOLset
_t
@@ -2FB_ATY_CT=ys+#_t
@@ -2FB_ATY_CT_VAIO_LCD)isS_SOLset
+#_t
@@ -2FB_RADEON)isS_SOLset
_v_t
@@ -2FB_ATY128)isS_SOLset
-v_t
@@ -2FB_3DFX)isS_SOLset
_v_t
@@ -2FB_SIS)isS_SOLset
+#_t
@@ -2FB_3DFX)isS_SOLset
+#_t
@@ -2FB_VOODOO1)isS_SOLset
_t
@@ -2FB_SBUS=ys t
@@ -2FB_CREATOR=ys t
@@ -2FB_CGSIX=ys@@
n164,6R+164,7 y s #_t
@@ -2MD_RAID0)isS_SOLset
_v_t
@@ -2MD_RAID1)isS_SOLset
_v_t
@@ -2MD_RAID5)isS_SOLset
+#_t
@@ -2MD@MULTIPATH)isS_SOLset
_v_t
@@ -2BLK_DEV_LVM)isS_SOLset
_v_t
@@ -2BLK_DEV_RAM)isS_SOLset
_v_t
@@ -2BLK_DEV_INITRD)isS_SOLset
@@
n255,6R+256,7 y s t
@@ -2BLK_DEV_IDEPCI=ys v_t
@@ -2IDEPCI@SHARE_IRQ)isS_SOLset
_t
@@ -2BLK_DEV_IDEDMA_PCI=ys+t
@@ -2BLK_DEV_ADMA=ys v_t
@@ -2BLK_DEV_OFFBOARD)isS_SOLset
_t
@@ -2IDEDMA_PCI_AUTO=ys t
@@ -2BLK_DEV_IDEDMA=ys@@
n264,8 +266,8 y s v t
@@ -2AEC62XX_TUNING)isS_SOLset
_t
@@ -2BLK_DEV_ALI15X3=ys v_t
@@ -2WDC_ALI15X3)isS_SOLset
-v_t
@@ -2BLK_DEV_AMD74T bisS_SOLset
-v_t
@@ -2AMD74T _OVERRIDE)isS_SOLset
+#_t
@@ -2BLK_DEV_AMD74XX)isS_SOLset
+#_t
@@ -2AMD74XX_OVERRIDE)isS_SOLset
_t
@@ -2BLK_DEV_CMD64X=ys v_t
@@ -2BLK_DEV_CY82C693)isS_SOLset
_v_t
@@ -2BLK_DEV_CS5530)isS_SOLset
@@
n276,7 +278,8 y s v t
@@ -2BLK_DEV_OPTI621)isS_SOLset
_v_t
@@ -2BLK_DEV_PDC202XX)isS_SOLset
_v_t
@@ -2PDC202XX_BURST)isS_SOLset
-v_t
@@ -2BLK_DEV_OSB4)isS_SOLset
+#_t
@@ -2PDC202XX_FORCE)isS_SOLset
+#_t
@@ -2BLK_DEV_SVWKS)isS_SOLset
_v_t
@@ -2BLK_DEV_SIS5513)isS_SOLset
_v_t
@@ -2BLK_DEV_SLC90E66)isS_SOLset
_v_t
@@ -2BLK_DEV_TRM290)isS_SOLset
@@
n286,6R+289,9cy s #_t
@@ -2IDEDMA_IVB)isS_SOLset
_v_t
@@ -2DMA_NONPCI)isS_SOLset
_t
@@ -2BLK_DEV_IDE_MODES=ys+t
@@ -2BLK_DEV_ATARAID=ms+t
@@ -2BLK_DEV_ATARAID2PDC=ms+t
@@ -2BLK_DEV_ATARAID2HPT=ms P #M_v_SCSILsobj-y h@@
n334,6R+340,7 y s #_t
@@ -2SCSI_NCR53C8XX_SYMBIOS_COMPAT)isS_SOLset
_t
@@ -2SCSI_QLOGIC_ISP=ms t
@@ -2SCSI_QLOGIC_FC=ys+t
@@ -2SCSI_QLOGIC_FC_FIRMWARE=ys P #M_v_Fibre3ChanSH_ sobj-y h@@
n410,7 +417,6Ry s v Eildrne6 210 _SM100MbIG)P #M_t
@@ -2NET_ETHERNET=ys-v_t
@@ -2ARM2AM79C961A)isS_SOLset
_t
@@ -2SUNLANCE=ys t
@@ -2HAPPYMEAL=ys t
@@ -2SUNBMAC=ms@@
n458,6R+464,7 y s #_t
@@ -2TLAN)isS_SOLset
_t
@@ -2VIA_RHINE=ms t
@@ -2WINBOND_840=ms+#_t
@@ -2LAN_SAA9730)isS_SOLset
_v_t
@@ -2NET_POCKET)isS_SOLset
_P #M@@
n467,6R+474,7 y s #_t
@@ -2ACENIC_OMIT_TIGON_I)isS_SOLset
_t
@@ -2DL2K=ms t
@@ -2MYRI_SBUS=ms+t
@@ -2NS83820=ms t
@@ -2HAMACHI=ms t
@@ -2YELLOWFIN=ms t
@@ -2SK98LIN=ms@@
n709,7 +717,10 y s t
@@ -2USB_STORAGE=ms # t
@@ -2USB_STORAGE_DEBUG)isS_SOLset
 t
@@ -2USB_STORAGE_FREECOM=ys+t
@@ -2USB_STORAGE_ISD_ME=ys t
@@ -2USB_STORAGE_DPCM=ys+t
@@ -2USB_STORAGE_HP8200e=ys+t
@@ -2USB_STORAGE_SDDR09=ys t
@@ -2USB_ACM=ms t
@@ -2USB_PRINTER=ms P@@
n740,10 +751,10 y s #M_v_USB Network adaptorss #M-t
@@ -2USB_PLUSB=ms t
@@ -2USB_PEGASUS=ms t
@@ -2USB_CATC=ms-t
@@ -2USB_NET1080=ms+t
@@ -2USB_KAWETH=ms+t
@@ -2USB_USBNET=ms P #M_v_USB j-y  driversP@@
n773,6R+784,7 y s t
@@ -2USB_SERIAL_MCT_U232=ms t
@@ -2USB_SERIAL_PL2303=ms t
@@ -2USB_SERIAL_CYBERJACK=ms+t
@@ -2USB_SERIAL_XIRCOM=ms t
@@ -2USB_SERIAL_OMNINET=ms P #M@@
n791,7 +803,7 y s #
_t
@@ -2BLUEZ_HCIUSB=ms t
@@ -2BLUEZ_HCIUART=ms-t
@@ -2BLUEZ_HCIEMU=ms+t
@@ -2BLUEZ_HCIVHCI=ms P #M_v_Watchdog
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gdtlb_babi)Cd.S $(CONFIG_SH_pIG_64RIG_SH_Gdtlb_babi)Cd.SP6 +35,9 @@
 #include <apIG_64RIG_SH_Gdtlb_babi)Cd.S	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_Gdtlb_babi)Cd.S	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size' CONFdtlb_babi)Cd.Sthen
12G_MEfin8_13G_M:41:54 kanoj"$CONFIGze' CONFdtlb_babi)Cd.Sthen
14G_MEfin9/07o_8:26 r7 kanoj"$CONFI +	 dtlb_babi)Cd.S: Backn N" 
3tDTLB misR+nuplacem N@Ty  ategy.M +	                 TspR+pR+pe.o t/<cdiarctly 8ntoFild)  ap 0[1],.P +	M@@
n6,11 +6,27 y s C* ey' CO.:6 2C1,1997,1998 Jakub J linek   (jj@ul  a.$(CON.cz)
)P*neBn-_defLi)yTAG_t
@TEXT_BITS	0x3ffaleAe.o t/spR+G*pg0[1],.chi+-E# G PAGE@SHIFT ==I13-E#defLi)yFILL_VALID_SZ_BITS1(r1) \n+a sllx		%g2, 62s r1-E#defLi)yFILL_VALID_SZ_BITS2(r1)-E#defLi)yFILL_VALID_SZ_BITS_NOP nop
+T) {
 PU_PAGE@SHIFT  inp_defLi)yFILL_VALID_SZ_BITS1(r1) \n+aor		%g0, 5s r1-E#defLi)yFILL_VALID_SZ_BITS2(r1) \n+asllx		_1s 61s r1-E#defLi)yFILL_VALID_SZ_BITS_NOPo+T)@ vN PU_PAGE@SHIFT  inp-E#defLi)yVPTE_BITS		(_PAGE@CP | _PAGE@CV | _PAGE@P )P #defLi)yVPTE_SHIFT		(PAGE@SHIFT - 3)n-_defLi)yPMD@SHIFT		(23 - PAGE@SHIFT + 3)n-_defLi)yPGD@SHIFT		(34 - PAGE@SHIFT + 3)n-_defLi)yVPTE_BITS		(_PAGE@CP | _PAGE@CV | _PAGE@P)-E#defLi)yTLB_PMD@SHIFT		(PAGE@SHIFT - 3 + 3)nE#defLi)yTLB_PGD@SHIFT		(PMD@BITS + PAGE@SHIFT - 3 + 3)nE#defLi)yTLB_PMD@MASK		(((1e<< PMD@BITS))- 1)e<< 1)nE#defLi)yTLB_PGD@MASK		(((1e<< (VA@BITS - PAGE@SHIFT - (PAGE@SHIFT - 3) - PMD@BITS)))- 1)e<< 2)R 
 /	_WaysNwcecan get he	i:P +	M@@
n31,13R+47,13Ry s 
 /	_TLB1 ** ICACHE-line 2: QuickyVPTE misR	  	*/M 	ldxa		[%g1] ASI_DMMU, %g5		! DoingdPGDIcC,1ing?
-M8rlx		%g6, (PMD@SHIFT)- 1), %g1	! Posict *+PMD+offsetn+asrlx		%g6, (TLB_PMD@SHIFT)- 1), %g1	! Posict *+PMD+offsetn 	be,pn		%xcc, OpIG_64_vpte_nucleus	! IR+pt3
SK_SNucleus?
-M-o
@		%g1s 0xffe, %g1			! Mask+PMD+offsetNbitsn+a a
@		%g1s TLB_PMD@MASK, %g1		! Mask+PMD+offsetNbitsn 	brnz,pt		%g5, OpIG_64_vpte_eq tinue	! Yep, g3t$	kegsmok
o 	 ain		%g1s %g1s %g1			! Posict *+PMD+offset some more
-M8rlx		%g6, (PGD@SHIFT)- 2), %g5	! Posict *+PGD+offsetn-	a
@		%g5s 0xffc, %g5			! Mask+PGD+offsetn+asrlx		%g6, (TLB_PGD@SHIFT)- 2), %g5	! Posict *+PGD+offsetn+	a
@		%g5s TLB_PGD@MASK, %g5		! Mask+PGD+offsetn 
 /	_TLB1 ** ICACHE-line 3: QuickyVPTE misR	  	*/M 	lduwa		[%g7 + %g5] ASI_PHYS_USE_EC, %g5! Load+PGDM@@
n48,7 +64,8 y s 	lduwa		[%g5 + %g1] ASI_PHYS_USE_EC, %g5! Load+PMDM 	yllx		%g5s 11, %g5			! Shift 8ntoFplacen 	brz,pn		%g5s vpte_no N@			! V_sid?
-M-sllx		%g2, 62s %g1			! Put _PAGE@VALID 8ntoF%g1n+a FILL_VALID_SZ_BITS1(%g1)			! Put _PAGE@VALID 8ntoF%g1n+aFILL_VALID_SZ_BITS2(%g1)			! Put _PAGE@VALID 8ntoF%g1n aor		%g5s VPTE_BITS, %g5		! Prep~re VPTE datan 
 /	_TLB1 ** ICACHE-line 4: QuickyVPTE misR	  	*/M@@
n59,10 +76,15 y s 	e ury						! Load+PTE once agains 	nop
 	nop
-	nop
+aFILL_VALID_SZ_BITS_NOPoBn-_unzbH_TAG_t
@TEXT_BITSP #unzbH_VPTE_SHIFTn-_unzbH_PMD@SHIFTn-_unzbH_PGD@SHIFTnE#unzbH_TLB_PMD@SHIFTnE#unzbH_TLB_PGD@SHIFTn #unzbH_VPTE_BITSPE#unzbH_TLB_PMD@MASKnE#unzbH_TLB_PGD@MASKnE#unzbH_FILL_VALID_SZ_BITS1nE#unzbH_FILL_VALID_SZ_BITS2nE#unzbH_FILL_VALID_SZ_BITS_NOPo+
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gdtlb_base.S $(CONFIG_SH_pIG_64RIG_SH_Gdtlb_base.SP6 +35,9 @@
 #include <apIG_64RIG_SH_Gdtlb_base.S	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_Gdtlb_base.S	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size' CONFdtlb_base.Sthen
10G_MEfin8_13G_M:41:54 kanoj"$CONFIGze' CONFdtlb_base.Sthen
14G_MEfin9/11 02:_M:23 kanoj"$CONFI +	 dtlb_base.S:	Frot40 N" 
3tDTLB misR+nuplacem N@Ty  ategy.M +	              TspR+pR+pe.o t/<cdiarctly 8ntoFild)  ap 0[1],.P +	M@@
n6,11 +6,6 y s C* ey' CO.:6 2C1,1997,1998 Jakub J linek   (jj@ul  a.$(CON.cz)
)P*neBn-_defLi)yTAG_t
@TEXT_BITS	0x3ffa-#defLi)yVPTE_SHIFT		(PAGE@SHIFT - 3)n-_defLi)yKERN_HIGHBITS		((_PAGE@VALID | _PAGE@SZ4MB) ^ 0xfffff80000000000)n-_defLi)yKERN_LOWBITS		(_PAGE@CP | _PAGE@CV | _PAGE@P | _PAGE@W)i-S ze'%g1	TLB_SFSR	(%g1 + %g1 ==ITLB_TAG_ACCESS)
)P* %g2	(KERN_HIGHBITS | KERN_LOWBITS)
)P* %g3 yVPTE base	(0xfffffffe00000000)	Spitfiar/Blackbird (44-bIG_VA space)M@@
n18,10 +13,10 y s P* %g7	__pa(curr*nt->mm->pgd)P +	M +	 TheyVPTE base)v_sudeiHPcompletely_magic, eutFnoK) ilatZ-, ~nothingd l{
lSngild)IG_SH_ oildr ilangildsd)TLB misRMAKE)fewFplaceslSngild)IG_SH_ oildr ilangildsd)TLB misRM C* hundlerstknow)anythingdaboutFild)VPTE mechunism orZ-, ~how)IG_works.  eynsiderFild)44-bIG_VADDR Ul  a-I/IIZ-, ~cC{
"aHPan example:MAKE)how)IG_works (see@VPTE_SIZE, TASK@SIZE-o
@@PTRS_PER_PGD).	   reynsiderFild)44-bIG_VADDR Ul  a-I/II~cC{
"aHPan example:M +	M +	 VA[0 : |(1<<43)]Ce0xducd)VPTE 8ndex [%g3 yyyyyyyyyyyyyyyyyyyyyyy: | 0]M +	 VA[0 : -(1<<43)]Ce0xducd)VPTE 8ndex [%g3-(1<<(43-PAGE@SHIFT+3))): %g3]M@@
n34,7 +29,7 y s C* If you'rd)payingda	tenct *+you'll~notic) ilatgtspR+means hulf+ofs C* ild)VPTE 0[1],IpR+aboARC%g3 o
@@hulf+pR+below,
low VA ain_urceRM C* mapee0xg_urc(ARly_upwards3
SK_S%g3,-o
@@hO.: VA ain_urceR mapZ-, ~e0xg_urc(ARly_downwards3
SK_S%g3.  TspR+triuklwaHP3"y"y" 
3tmake	   re0xg_urc(ARly_upwards3towards3%g3.  TspR+triuklwaHP3"y"y" 
3tmake	 C* ild)same 8 8ny    ct *+hundler_work boileG_SMSpitfiar/Blackbird'RM C* prchliar_VA space)ho],Icy]i-	uract *+o
@@ild)full~64-bIG_VA spaceM C* on -ofgCheetah at ild)same ti/*pM@@
n48,26R+43,47 y s C* 4) User space)otalraeR by nucleus at il0
)P*neBnE# G PAGE@SHIFT ==I13-E/&_+eE)ToPcompuK) vpte+offset,Nwce3"y" 
3tdo (	ain_ >>I13)e<< 3),_+eE)whichican be+opti/izy" 
3t	ain_ >>I10) SURbitsR10/11/12ican_+eE)be+guarant"y" 
3tbe+0 ...l mu_eq t200

tdoeR guarant"ygtspR_+eE)byIonly uaingd10 bitsRSngild)hweq t200 v_sud."	$(inp_defLi)yCREATE@VPTE_OFFSET1(r1s r2)np_defLi)yCREATE@VPTE_OFFSET2(r1s r2) \n+ail	srax	_1s 10,+n2np_defLi)yCREATE@VPTE_NOP		nop
+T) {
np_defLi)yCREATE@VPTE_OFFSET1(r1s r2) \n+ail	srax	_1s PAGE@SHIFT,+n2np_defLi)yCREATE@VPTE_OFFSET2(r1s r2) \n+ail	sllx	r2s 3,+n2np_defLi)yCREATE@VPTE_NOPR+T@@ vNR1
 /+eDTLB ** ICACHE-line 1: Quickyu{
r)TLB misRes		*/M 	ldxa		[%g1 + %g1] ASI_DMMU, %g4	! Get TAG_ACCESSM 	o
@cc		%g4,yTAG_t
@TEXT_BITS, %g0	! FSK_SNucleus?
3
SK__tl1_  ap:MA	CREATE@VPTE_OFFSET1(%g4,y%g6)			! C	iate)VPTE offsetn 	be,pn		%xcc, 3f			! Yep, Opecial e0x20;
ing
-M-srax		%g4,yVPTE_SHIFT,y%g6		! C	iate)VPTE offsetn+a CREATE@VPTE_OFFSET2(%g4,y%g6)			! C	iate)VPTE offsetn 	ldxa		[%g3 + %g6] ASI_S, %g5		! Load+VPTE
 1:	brlz,pt		%g5, 9f				! V_sid,
load+8ntoFTLBo 	 nop						! Delay-sloto-	ba,a,pt		%xcc, 4f			! Inv_sid, eranchioutMEMba,a,pt		%xcc, ENERpath			! Inv_sid, eranchioutM 
 /+eDTLB ** ICACHE-line 2: QuickyIG_SH_ TLB misRes	*/M 3:	brlz,pt		%g4, 9f				! KG_SH_ heltual map?o 	 xor		%g2s %g4, %g5			! Finish bit twiddleso-	ldxa		[%g3 + %g6] ASI_N, %g5		! Yep, load+k-vpteo-	ba,pt		%xcc, 1b			! Cq tinue ilb e eoadMEMba,pt		%xcc, kvmap			! Yep, goccb,ckeG_SMobp/vma  deo 	 nopMEMnop
 9:	stxa		%g5, [%g0] ASI_DTLB_DATA_IN	! R eoadFTLBo 	e ury						! T ap e unsi
-4:	rdpr		%p8  pe, %g5			! MoARCst4o al00		ate)globalR_+ENERpath:MA	rdpr		%p8  pe, %g5			! MoARCst4o al00		ate)globalR_ 
 /+eDTLB ** ICACHE-line 3: winfixups+	ial_faults		*/M 	wrpr		%g5s PSTATE@AG|PSTATE@MG, %p8  pe,@@
n87,9 +103,8 y s 	nop
 	nop
 	nop
-	nop
+aCREATE@VPTE_NOPRBn-_unzbH_TAG_t
@TEXT_BITSP-#unzbH_VPTE_SHIFTn-_unzbH_KERN_HIGHBITSn-_unzbH_KERN_LOWBITSnE#unzbH_CREATE@VPTE_OFFSET1nE#unzbH_CREATE@VPTE_OFFSET2nE#unzbH_CREATE@VPTE_NOPR(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_G N@ry.S $(CONFIG_SH_pIG_64RIG_SH_G N@ry.SP6 +35,9 @@
 #include <apIG_64RIG_SH_G N@ry.S	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_G N@ry.S	tup_Aug 28b0dc.9:44ble ch@@
n1,4R(w44Ry size' CONF N@ry.Sthen
129G_MEfin8_13G_M:41:54 kanoj"$CONFIGze' CONF N@ry.Sthen
134G_MEfin8_27o_8:42:07 kanoj"$CONFI +	  ($(COpIG_64RIG_SH_G N@ry.S:  SpIG_64)  ap low-leARlF N@ry post4s.P +	M +	 ey' CO.:6 2C1,1995,1997 Dav <cS. Mien+rc(durcm@caip.rutgers.edu)M@@
n21,7 +21,7 y s vmaddr);
+R+G*visR+G.chi eAe.o t/spR+G*e8  pe	chi n-ze'_defLi)ySYSCALL_TRACING)(inpze'_defLi)ySYSCALL_TRACING	1P*neBn'_defLi)ych/ptr      g6
 ,@@
n32,7 +32,25Ry s 
 @.globll	spIG_64_vpte_patchme1
 @.globll	spIG_64_vpte_patchme2-E/&_+eE)OnCaCseeq d leARlFvpte+misR,ccb,ckewheildr ile+oCO.inal fault+pR+toFild)OBP _+eE)range (noK) ilatgtspR+pR+only po;
i1],IG_SM8ny    ct *+misR,cdata misRes3ioI+eE)obp)range do _SOLu{
Fvpte). If so, gocbabicdiarctly toFild)faultiERIain_urc.	   rTspR+pR+becau{
Fwcewant 
3tnuxdFild) pc, oildrwi{
Fwcehurcenoeway-ofgknowing
+C* ild)8i a NREy" faultiERIain_urc SURwe ~re uaingd>8kyIG_SH_ pagesizy.rTspR+alRoI+eE)ensuresS_SFvpte+range ain_urceR ~re dropped 8ntoFilb n= chiobp)pR+exrchting
+C* (see@inldrit_locked_e0xm_@ ppings()+rant)."	$(in OpIG_64_vpte_nucleus: @imov		0xf, %g5n+asllx		%g5s 28, %g5			! Load+0xf0000000R1_cmp		%g4, %g5			! Isoain_ >= LOW_OBP_ADDRESS?MEMblu,pn		%xcc, OpIG_64_vpte_patchme1
+a mov		0x1, %g5n+asllx		%g5s 32, %g5			! Load+0x100000000R1_cmp		%g4, %g5			! Isoain_ < HI_OBP_ADDRESS?MEMblu,pn		%xcc, obp_iain__patch_+	 nopM OpIG_64_vpte_patchme1:M 	yeili		%hi(0), %g5			! TspR+has 
3tbe+patchedM OpIG_64_vpte_patchme2:s@@
n45,6R+63,74 y s 	stxa		%g4, [%g1 + %g1] ASI_DMMU	! R as
++tprevious TAG_ACCESSM 	don 						! SlickytriukeBnE@.globll	obp_iain__patch_+	.globll	obp_dain__patch_+
+obp_iain__patch: @iyeili		%hi(0), %g5			! TspR+o
@@fo  dwing)pR+patchedM+aor		%g5s %lo(0), %g5		! g5 now)holdsiobp)pmd base)physain_M+awrpr		%g0,+1, %tl			! Behurceac SURwe ~re atgTL0MA	rdpr		% pc, %g4			! Find+oCO.inal faulting)pain_M+asrlx		%g4, 13, %g4			! Throw)outFeq t200 bitsn+asllx		%g4, 13, %g4			! g4+has vpn + ctx0 now @imov		TLB_SFSRs %g1			! R as
++t%g1 v_sud @iy xa		%g4, [%g1 + %g1] ASI_IMMU	! R as
++tprevious TAG_ACCESSM+asrlx		%g4, 23,y%g6			! Find+pmd numbern+	a
@		%g6s 0x7ff,y%g6			! Find+pmd numbern+	sllx		%g6s 2,y%g6			! Find+pmd offsetn+alduwa		[%g5 + %g6] ASI_PHYS_USE_EC, %g5! Load+pmd, ie page0[1],Iphysain_M+abrz,pn		%g5s ENERpath			! Ki  _ile PROM ? :-)n+a sllx		%g5s 11, %g5			! Shift 8ntoFplacen+asrlx		%g4, 13, %g6			! find+pte+number-inCeage0[1],n+	a
@		%g6s 0x3ff,y%g6			! find+pte+number-inCeage0[1],n+	sllx		%g6s 3, %g6			! find+pte+offset-inCeage0[1],n+	ldxa		[%g5 + %g6] ASI_PHYS_USE_EC, %g5! Load+pteM+abrgez,pn	%g5s ENERpath			! Ki  _ile PROM ? :-)n+a nop
+astxa		%g5, [%g0] ASI_ITLB_DATA_IN	! pu@ 8ntoFilbMA	r ury						! gocbabicto0oCO.inal fault_+
+obp_dain__patch: @iyeili		%hi(0), %g5			! TspR+o
@@fo  dwing)pR+patchedM+aor		%g5s %lo(0), %g5		! g5 now)holdsiobp)pmd base)physain_M+asrlx		%g4, 23,y%g6			! Find+pmd numbern+	a
@		%g6s 0x7ff,y%g6			! Find+pmd numbern+	sllx		%g6s 2,y%g6			! Find+pmd offsetn+alduwa		[%g5 + %g6] ASI_PHYS_USE_EC, %g5! Load+pmd, ie page0[1],Iphysain_M+abrz,pn		%g5s ENERpathn+a sllx		%g5s 11, %g5			! Shift 8ntoFplacen+asrlx		%g4, 13, %g6			! find+pte+number-inCeage0[1],n+	a
@		%g6s 0x3ff,y%g6			! find+pte+number-inCeage0[1],n+	sllx		%g6s 3, %g6			! find+pte+offset-inCeage0[1],n+	ldxa		[%g5 + %g6] ASI_PHYS_USE_EC, %g5! Load+pteM+abrgez,pn	%g5s ENERpathn+a nop
+astxa		%g5, [%g0] ASI_DTLB_DATA_IN	! pu@ 8ntoFilbMA	r urynpF /&_+eE)OnCaCfirst leARlFdata misR,ccb,ckewheildr ilpR+pR+toFild)OBP range (noK) ilat_+eE)suchCatalraeR can be+mat/sby e0xm, asNwc  _as-by IG_SH_ uaingde0xm_ge0e0xpertyI+eE)on "ain_urc"),-o
@@if so, do _SOLu{
FvpteCatalra ...lraildr,Lu{
FinG_Smact *_+eE)savy" during)pnldrit_e0xm_@ ppings()+uaingd8kypagesizy."	$(inpkvmap: @imov		0xf, %g5n+asllx		%g5s 28, %g5			! Load+0xf0000000R1_cmp		%g4, %g5			! Isoain_ >= LOW_OBP_ADDRESS?MEMblu,pn		%xcc, vma  de_ain_M+a mov		0x1, %g5n+asllx		%g5s 32, %g5			! Load+0x100000000R1_cmp		%g4, %g5			! Isoain_ < HI_OBP_ADDRESS?MEMblu,pn		%xcc, obp_dain__patch_+	 nopM+vma  de_ain_:						! vma  deoain_ atalraedn+	ldxa		[%g3 + %g6] ASI_N, %g5		! Yep, load+k-vpteo+abrgez,pn	%g5s ENERpath			! V_sid,
load+8ntoFTLBo+a nop
+astxa		%g5, [%g0] ASI_DTLB_DATA_IN	! R eoadFTLBoA	r urynpF @PU_TspR+pR+trivial withFild)new0code...l+/M @.globll	do_fpdis
 do_fpdis:
@@
n1413,9 +1499,8 y s 	 srl		%i0, 0, %o0				! IEU0M 	yll		%g1s 2, %l4				! IEU0	Groups vmGzbH_SYSCALL_TRACINGn-	ain		%sp, STACK_BIAS + REGWIN_SZ, %o1
 	cCll		syscCll_trac _ N@ry
-M-mov		%g1s %o0n+a ain		%sp, STACK_BIAS + REGWIN_SZ, %o0M 	yrl		%i0, 0, %o0s v)@ vNR imov		%i4, %o4				! IEUch@@
n1442,9 +1527,8 y s 	 mov		%i0, %o0				! IEU0M 	yll		%g1s 2, %l4				! IEU0	Groups vmGzbH_SYSCALL_TRACINGn-	ain		%sp, STACK_BIAS + REGWIN_SZ, %o1
 	cCll		syscCll_trac _ N@ry
-M-mov		%g1s %o0n+a ain		%sp, STACK_BIAS + REGWIN_SZ, %o0M 	mov		%i0, %o0s v)@ vNR imov		%i1s %o1				! IEUch@@
n1464,8 +1548,10 y s 3:	stx		%o0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0]
 e u_sys_cCll:s vmGzbH_SYSCALL_TRACINGn@imov		%o0, %o1
 	cCll		syscCll_trac _ xit
-M-oin		%sp, STACK_BIAS + REGWIN_SZ, %o1
+a ain		%sp, STACK_BIAS + REGWIN_SZ, %o0M@imov		%o1, %o0s v)@ vNR ildx		[%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE], %g3R ildx		[%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TNPC], %l1 ! pc = npcR(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_G   ap.S $(CONFIG_SH_pIG_64RIG_SH_G   ap.SP6 +35,9 @@
 #include <apIG_64RIG_SH_G   ap.S	Sun Maro25o_8:14:21c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_G   ap.S	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size' CONF   ap.Sthen
44G_MEfin3_22 00:51:25odurcm"$CONFI+ze' CONF   ap.Sthen
45G_MEfin9/07o21:04:40ckanoj"$CONFI +	    ap.S: Prep~ringdG_SM N@ry 8ntoFild)IG_SH_ on SpIG_ V9.P +	M +	 ey' CO.:6 2C1,1996s 1997 Dav <cS. Mien+rc(durcm@caip.rutgers.edu)M@@
n11,8 +11,9Ry s vmaddr);
+R+G*page	chi vmaddr);
+R+G*spitfiar	chi vmaddr);
+R+G*huxd.m_aleAe.o t/spR+G*e0x20;
(r	chi n-_defLi)		TASK@REGOFF		((PAGE@SIZE<<1)-TRACEREG_SZ-REGWIN_SZ)np_defLi)		TASK@REGOFF		(THREAD@SIZE-TRACEREG_SZ-REGWIN_SZ)n _defLi)		ETRAP_PSTATE1		(PSTATE@RMO | PSTATE@PRIV)n _defLi)		ETRAP_PSTATE2		(PSTATE@RMO | PSTATE@PEF | PSTATE@PRIV | PSTATE@IE)] 
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Ghuxd.S $(CONFIG_SH_pIG_64RIG_SH_Ghuxd.SP6 +35,9 @@
 #include <apIG_64RIG_SH_Ghuxd.Sethu,Apr 12o_2:10c25c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_Ghuxd.Sethu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size' CONFhuxd.Sthen
77G_MEfin4/05o_2:44:34odurcm"$CONFI+ze' CONFhuxd.Sthen
81G_MEfin9/07o23bj-$15ckanoj"$CONFI +	 huxd.S: Initial boot0codedG_SMild)SpIG_64)j-y  of L(CON.P +	M +	 ey' CO.:6 2C1,1996s1997 Dav <cS. Mien+rc(durcm@caip.rutgers.edu)M@@
n472,7 +472,7 y s 
 @wr	%g0,+ASI_P, %asiR imov	1, %g5n-asllx	%g5, (PAGE@SHIFT + 1), %g5n+asllx	%g5s THREAD@SHIFT,y%g5M 	yub	%g5, (REGWIN_SZ + STACK_BIAS),y%g5M 	ain	%g6s %g5s %spR imov	0, %fpM@@
n488,13R+488,6Ry s 	cCll	__bzeros 	 sub	%o1, %o0, %o1
 
-M/+eNow)clearF0mpty_zero_pagel+/M-Myeili	%hi(8192), %o1
-aor	%o1, %lo(8192), %o1
-ayeili	%hi(KERNBASE), %g3R-	cCll	__bzeros-M-or	%g3,-%lo(KERNBASE), %o0s-R imov	%l6s %o1			! OpenPROM stabis 	cCll	e0xm_Sn6 s 	 mov	%l7, %o0			! OpenPROM cif hundlerM@@
n647,12 +640,13Ry s 	r us 	 e as
++R 
 /&_+eE)Theyfo  dwing)skipstmakegsure ild)  ap 0[1],RSngi0[1],.S)isSa NREy"I+eE)on a 32K boundary asIrequiar
-by ild)v9 OpecseG_SMTBA|engister."	$(in OpIG_64_boot_)Cd:M 	.skip	0x_ME0)+ _8 
  h- OpIG_64_boot_)Cd
 bootup_u{
r_stabi_)Cd:M-s-M.globll0mpty_bad_page
-0mpty_bad_page:M 	.skip	0x_ME0eBn'_ GzbH_t
@@ -2SBUS
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gin6 +taskUc $(CONFIG_SH_pIG_64RIG_SH_Gin6 +taskUcP6 +35,9 @@
 #include <apIG_64RIG_SH_Gin6 +taskUc	thu,Apr 19 .o 38:48G_MEfa.o
 
 ifeq ($(COpIG_64RIG_SH_Gin6 +taskUc	thu,
elN20G14:_1:57ble ch@@
n3,8 +3,8 y s s vmaddr);
+R+G*pg0[1],.chi eAe.o t/spR+G*uotalra	chileAe.o t/spR+G*e0x20;
(r	chi n-8  pF T8 12:29vm_anux_y    cCin6 +$mape=CINIT_MMAP;
 8  pF Ty    cCfs_y    cCin6 +fse=CINIT_FS;
 8  pF Ty    cCf
 
s_y    cCin6 +f
 
se=CINIT_FILES;
 8  pF Ty    cCvNREal_y    cCin6 +vNREalse=CINIT_SIGNALS;-@@
n17,3R+17,11 y s  (in __R+G__ (".t200");  unt *+task_unt *+in6 +task_unt *+= {CINIT_TASK(in6 +task_unt *.task) };s+
 /&_+eE)ThpR+pR+toFmakegild)in6 +task+stabi ofgt1 eCO.:6  ize G_SM>8kypagesizy."	$()TheydefLiitt *+ofgtask_unt *+in s,1  .hFmakeR+pt316k widd."	$(inp_ G PAGE@SHIFT !=I13-Echar in6 +task_stabi[THREAD@SIZEh- INIT_TASK@SIZE]+= {C0 };s+v)@ vNR(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gioctl32Uc $(CONFIG_SH_pIG_64RIG_SH_Gioctl32UcP6 +35,9 @@
 #include <apIG_64RIG_SH_Gioctl32Uc	Sun Aug 12 &3:27:59c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_Gioctl32Uc	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size' CONFioctl32Ucthen
121G_MEfin8_T3G14:27:21odurcm"$CONFI+ze' CONFioctl32Ucthen
125G_MEfin9/18G2inpF T5 durcm"$CONFI +	 ioctl32Uc: Cq verst * between 32bit o
@@64bit nat(AR ioctls.P +	M +	 ey' CO.:6 2C1,1997-_ME0) Jakub J linek  (jakub@ar
hat.com)M@@
n94,6R+94,7 y s 
 eAe.o t/sp
 ifequsb.chi eAe.o t/sp
 ifequsbdevic _fa	chileAe.o t/sp
 ifeqnbd	chi n /+eUsygtspR+toFget at 32-bIG_u{
r)paraed post4ers. s    Se e ys_ypIG_32Uc G_SMdescriptt *+aboutFildse.P*ne@@
n3691,6R+3692,9Ry s COMPATIBLE@IOCTL(BLKFRASET)s COMPATIBLE@IOCTL(BLKSECTSET)s COMPATIBLE@IOCTL(BLKSSZGET)s+COMPATIBLE@IOCTL(BLKBSZGET)s+COMPATIBLE@IOCTL(BLKBSZSET)s+COMPATIBLE@IOCTL(BLKGETSIZE64)R 
 /	_RAID (in COMPATIBLE@IOCTL(RAID2VERSION)M@@
n3733,6R+3737,7 y s t
MPATIBLE@IOCTL(KDGKBSENT)s COMPATIBLE@IOCTL(KDSKBSENT)s COMPATIBLE@IOCTL(KDGKBDIACR)s+COMPATIBLE@IOCTL(KDKBDREP)s COMPATIBLE@IOCTL(KDSKBDIACR)s COMPATIBLE@IOCTL(KDGKBLED)s COMPATIBLE@IOCTL(KDSKBLED)s@@
n4250,6R+4255,16 y s COMPATIBLE@IOCTL(MEMUNLOCK)s COMPATIBLE@IOCTL(MEMGETREGIONCOUNT)s COMPATIBLE@IOCTL(MEMGETREGIONINFO)I+ze'NBD (in+COMPATIBLE@IOCTL(NBD_SET_SOCK)s+COMPATIBLE@IOCTL(NBD_SET_BLKSIZE)n+COMPATIBLE@IOCTL(NBD_SET_SIZE)n+COMPATIBLE@IOCTL(NBD_DO_IT)n+COMPATIBLE@IOCTL(NBD_CLEAR_SOCK)s+COMPATIBLE@IOCTL(NBD_CLEAR_QUE)n+COMPATIBLE@IOCTL(NBD_PRINT_DEBUG)n+COMPATIBLE@IOCTL(NBD_SET_SIZE_BLOCKS)n+COMPATIBLE@IOCTL(NBD_DISt
@NECT)
 /	_A
@@ildsR ioctlse3"y" 
ranslact *+(in HANDLE@IOCTL(MEMREADOOB32, mtd_rw_oob)n HANDLE@IOCTL(MEMWRITEOOB32, mtd_rw_oob)n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gio mu_eqmm *.c $(CONFIG_SH_pIG_64RIG_SH_Gio mu_eqmm *.cP6 +35,9 @@
 #include <apIG_64RIG_SH_Gio mu_eqmm *.c	Mon_dcn 19 17:59 38 _ME0e.o
 
 ifeq ($(COpIG_64RIG_SH_Gio mu_eqmm *.c	tup_Aug 28b0dc.9:44ble ch@@
n1,4R(w44Ry size' CONFio mu_eqmm *.cthen
4G_ME0in6/04R21:5M:23 o
ton_$CONFI+ze' CONFio mu_eqmm *.cthen
5G_MEfin8_24 17:57:51bkanoj"$CONFI +	 io mu_eqmm *.c: Ul  aSpIG_ SBUS/PCI)eqmm * io mu0code.P +	M +	 ey' CO.:6 2C1,1999 Dav <cS. Mien+rc(durcm@ar
hat.com)M@@
n36,12 +36,12Ry s 		@ vNRE_FGENERI  
  ,I)Cd;
 M 		8 
  h= sg[i].dvma_ain_urc;o-		8 
  h= s 
  h& PAGE@MASK;o+		8 
  h= s 
  h& IO_PAGE@MASK;o M 		)Cd ||sg[i].dvma_ain_urcs+  g[i].dvma_length;o-		)Cd ||()Cd + (PAGE@SIZE)- 1))h& PAGE@MASK;o+		)Cd ||()Cd + (IO_PAGE@SIZE)- 1))h& IO_PAGE@MASK;o M-M egcount += ((0]  -Is 
  ) >>IPAGE@SHIFT);o+		egcount += ((0]  -Is 
  ) >>IIO_PAGE@SHIFT);o 	}R 
 	SUR	pgcount != npages)led@@
n70,7 +70,7 y s 		@ vNRE_FGENERIpain_GM s 		ze'SG o
@@DMA_SG must beginCat ild)same sub-pagelboundary.l+/M-M	SUR	tsgain_ & ~PAGE@MASK) !=I(dain_ & ~PAGE@MASK) led+		sUR	tsgain_ & ~IO_PAGE@MASK) !=I(dain_ & ~IO_PAGE@MASK))led 			p - 1;
"verify_one_@ p: WrNERI  
  +offset-"d 			yyyyyyy" g[%08lx] dma[%08x]\n",d 			yyyyyyysgain_,cdain_); @@
n80,10 +80,10 y s 
 @	ze'Verify ild)IOPTE post4s+toFild)CO.:6 page	l+/M @	pain_ ||iopte_val(*iopte)h& IOPTE_PAGEs -	MSUR	tpain_ +|PAGE@OFFSET) !=I(sgain_ & PAGE@MASK) led+		sUR	tpain_ +|PAGE@OFFSET) !=I(sgain_ & IO_PAGE@MASK))led 			p - 1;
"verify_one_@ p: IOPTE[%08lx] @ psFild)"d 			yyyyyyy"wrNERIpage,cshould be+[%08lx]\n",d-			yyyyyyyiopte_val(*iopte),I(sgain_ & PAGE@MASK) - PAGE@OFFSET);o+			yyyyyyyiopte_val(*iopte),I(sgain_ & IO_PAGE@MASK) - PAGE@OFFSET);o 			net4s+=
n1;] 			goto0ou ;- 		}o@@
n91,10 +91,10 y s @	ze'IfgtspR+SG crorceR ~Ipage,cadjust toFilatt3"x6 pages @	eE)boundary a d loop.s @	eE/M-M	SUR	tsgain_ & PAGE@MASK) ^R	tsgain_ +  gn+n - 1)e& PAGE@MASK) led+		sUR	tsgain_ & IO_PAGE@MASK) ^R	tsgain_ +  gn+n - 1)e& IO_PAGE@MASK))led 			@ vNRE_FGENERI3"x6_page,c(MAK;o M-M 	3"x6_page =I(sgain_ + PAGE@SIZE) & PAGE@MASK;o+			3"x6_page =I(sgain_ + IO_PAGE@SIZE)h& IO_PAGE@MASK;o 			(MAKE=I3"x6_page -Isgain_GM 			8gain_ +=c(MAK;o 			(ain_ +=c(MAK;o@@
n109,7 +109,7 y s 		(ain_ +=c gn+n;o 		dn+n -=c gn+n;o M-M	SUR	dn+n >C0 && ((dain_ & ~PAGE@MASK) ==I0 )o+		SUR	dn+n >C0 && ((dain_ & ~IO_PAGE@MASK) ==I0 )o 			iopte++;
 M 		8g++;
@@
n175,7 +175,7 y s 		 STBi;
 M 		p - 1;
"verify_ gnist: Crap, mlraed upG@ ppingR,cdumping,-iodma at %08x.\n",d-		yyyyyyy(u32)I(sg->dvma_ain_urcs& PAGE@MASK) ;M+7	on Boyy(u32)I(sg->dvma_ain_urcs& IO_PAGE@MASK));o 		G_SM(ie=C0. i < net4s. i++)led 			p - 1;
"sg(%d): ain_urc(%p) length(%x))"d 			yyyyyyy"dma_ain_urc[%08x] dma_length[%08x]\n",d@@
n189,13R+189,6 y s }s v)@ vNR 
ize'Two ain_urceR ~re "heltuallyFeq tiguous"@if a d only if:Z-, ~1)eThey ~re equal, or...Z-, ~2)eThey ~re boileonCaCeage)boundry
-eE/M-#defLi)yVt
@TIG(__X, __Y)	(((__X) ==I(__Y)) || \M-M 		 (((__X) |I(__Y)) << (64UL - PAGE@SHIFT)) ==I0UL)i-S @ vNRE_FGENERIprep~re_ g(y    cCsca	ternist *sg,-iSTBnet4s)*led 	y    cCsca	ternist *dma_sg ||sg;M@@
n204,7 +197,7 y s 
 @prev  = 2@ vNRE_FGENER  sg->ain_urc;o @prev += 2@ vNRE_FGENER  (det4_n+n ||8g->length);,-	det4_ain_ ||(u32)I(2@ vNRE_FGENER sg->ain_urc & 2PAGE@SIZE)- 1UL) ;M+7det4_ain_ ||(u32)I(2@ vNRE_FGENER sg->ain_urc & 2IO_PAGE@SIZE)- 1UL) ;M 	n= chi	H)/bt4s)led 		@ vNRE_FGENERIain_GM s@@
n217,9 +210,9 y s o 			(et4_ain_ ||(((et4_ain_ +o 				      det4_n+n +M-M 		  Boyy(PAGE@SIZE)- 1UL)  >>IPAGE@SHIFT);o-			(et4_ain_ <<=IPAGE@SHIFT;o-			(et4_ain_ += ain_ & (PAGE@SIZE)- 1UL);o+				  Boyy(IO_PAGE@SIZE)- 1UL)  >>IIO_PAGE@SHIFT);o+			(et4_ain_ <<=IIO_PAGE@SHIFT;o+			(et4_ain_ += ain_ & (IO_PAGE@SIZE)- 1UL);o 			(et4_n+n ||0;- 		}o 		(et4_n+n +||8g->length;M@@
n230,5 +223,5Ry s 
 @e unsi 	t@ vNRE_FGENER  det4_ain_ +o 		t@ vNRE_FGENER  det4_n+n +M-M (PAGE@SIZE)- 1UL)  >>IPAGE@SHIFT;o+		(IO_PAGE@SIZE)- 1UL)  >>IIO_PAGE@SHIFT;  }](MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gio mu_eqmm *.h 
 ifeq ($(COpIG_64RIG_SH_Gio mu_eqmm *.hP6 +35,9 @@
 #include <apIG_64RIG_SH_Gio mu_eqmm *.h	Mon_DecN20G_2:05:52c1999a.o
 
 ifeq ($(COpIG_64RIG_SH_Gio mu_eqmm *.h	tup_Aug 28b0dc.9:44ble ch@@
n1,4R(w44Ry size' CONFio mu_eqmm *.hthen
1G1999/12/17 &2:31:54 jj"$CONFIGze' CONFio mu_eqmm *.hthen
3G_MEfin8_24 19:36:58bkanoj"$CONFI +	 io mu_eqmm *.h: Ul  aSpIG_ SBUS/PCI)eqmm * io mu0declaract *s.P +	M +	 ey' CO.:6 2C1,1999 Dav <cS. Mien+rc(durcm@ar
hat.com)M@@
n10,6R+10,22Ry s vmaddr);
+R+G*page	chi vmaddr);
+R+G*io mu	chi vmaddr);
+R+G*sca	ternist.chi+-E/&_+eE)These g(ARC@ pping  ize of eachCio mu0pte*tlb
"	$(inp_defLi)yIO_PAGE@SHIFT			13-E#defLi)yIO_PAGE@SIZE			(1UL << IO_PAGE@SHIFT)-E#defLi)yIO_PAGE@MASK			(~(IO_PAGE@SIZE-1))-E#defLi)yIO_PAGE@ALIGN	ain_)		(((ain_)+IO_PAGE@SIZE-1)&IO_PAGE@MASK)np-E#defLi)yIO_TSB_ENTRIES			(128*1024)-E#defLi)yIO_TSB_SIZE			(IO_TSB_ENTRIESeE)8)s+
 /&_+eE)ThpR+pR+tld)hardwiar
-shift 8ngild)ioilb tag/data pIGts
"	$(inp_defLi)yIOMMU_PAGE@SHIFT		13- 
 /	_You ~re _y  NERly_ aivisy" 
3ten[1],Rtheyfo  dwing)debuggingdcodeI +	  ny ti/*+youFmakegchunges+toFild)sgdcode+below,
run+pt3
_SMa n= ch](MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gitlb_base.S $(CONFIG_SH_pIG_64RIG_SH_Gitlb_base.SP6 +35,9 @@
 #include <apIG_64RIG_SH_Gitlb_base.S	Sun Nov 12G_M:37:16 _ME0e.o
 
 ifeq ($(COpIG_64RIG_SH_Gitlb_base.S	tup_Aug 28b0dc.9:44ble ch@@
n1,4R(w44Ry size' CONFitlb_base.Sthen
10G_ME0/11/10 .o 28:45odurcm"$CONFI+ze' CONFitlb_base.Sthen
11G_MEfin8_17 04:55 T bkanoj"$CONFI +	 itlb_base.S:	Frot40 N" 
3tITLB misR+nuplacem N@Ty  ategy.M +	              TspR+pR+pe.o t/<cdiarctly 8ntoFild)  ap 0[1],.P +	M@@
n6,8 +6,25 y s C* ey' CO.:6 2C1,1997,1998 Jakub J linek   (jj@ul  a.$(CON.cz)
)P*neBn-_defLi)yTAG_t
@TEXT_BITS	0x3ffa-#defLi)yVPTE_SHIFT		(PAGE@SHIFT - 3)nE# G PAGE@SHIFT ==I13-E/&_+eE)ToPcompuK) vpte+offset,Nwce3"y" 
3tdo (	ain_ >>I13)e<< 3),_+eE)whichican be+opti/izy" 
3t	ain_ >>I10) SURbitsR10/11/12ican_+eE)be+guarant"y" 
3tbe+0 ...l mu_eq t200

tdoeR guarant"ygtspR_+eE)byIonly uaingd10 bitsRSngild)hweq t200 v_sud."	$(inp_defLi)yCREATE@VPTE_OFFSET1(r1s r2) \n+ail	srax	_1s 10,+n2np_defLi)yCREATE@VPTE_OFFSET2(r1s r2)np_defLi)yCREATE@VPTE_NOP		nop
+T) {
 PU_PAGE@SHIFT  inp_defLi)yCREATE@VPTE_OFFSET1(r1s r2) \n+ail	srax	_1s PAGE@SHIFT,+n2np_defLi)yCREATE@VPTE_OFFSET2(r1s r2) \n+ail	sllx	r2s 3,+n2np_defLi)yCREATE@VPTE_NOPR+T@@ vN PU_PAGE@SHIFT  inp- 
 /	_WaysNwcecan get he	i:P +	M@@
n20,7 +37,8 y s s ze'ITLB ** ICACHE-line 1: Quickyu{
r)TLB misRes		*/M 	ldxa		[%g1 + %g1] ASI_IMMU, %g4	! Get TAG_ACCESSM-	srax		%g4,yVPTE_SHIFT,y%g6		! C	iate)VPTE offsetn+aCREATE@VPTE_OFFSET1(%g4,y%g6)			! C	iate)VPTE offsetn+aCREATE@VPTE_OFFSET2(%g4,y%g6)			! C	iate)VPTE offsetn 	ldxa		[%g3 + %g6] ASI_P, %g5		! Load+VPTE
 1:	brgez,pn	%g5s 3f				! No0 v_sid, eranchioutM 	 nop						! Delay-sloto@@
n58,7 +76,8 y s 	nop
 	nop
 	nop
-	nop
+aCREATE@VPTE_NOPRBn-_unzbH_TAG_t
@TEXT_BITSP-#unzbH_VPTE_SHIFTnE#unzbH_CREATE@VPTE_OFFSET1nE#unzbH_CREATE@VPTE_OFFSET2nE#unzbH_CREATE@VPTE_NOPR(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gpci_io mu	c $(CONFIG_SH_pIG_64RIG_SH_Gpci_io mu	cP6 +35,9 @@
 #include <apIG_64RIG_SH_Gpci_io mu	c	thu,May 24 15bj-$58G_MEfa.o
 
 ifeq ($(COpIG_64RIG_SH_Gpci_io mu	c	tup_Aug 28b0dc.9:44ble ch@@
n1,4R(w44Ry size' CONFpci_io mu	cthen
14G_MEfin5/23 03:06 51odurcm"$CONFI+ze' CONFpci_io mu	cthen
15G_MEfin8_24 19:36:58bkanoj"$CONFI +	 pci_io mu	c: Ul  aSpIG_ PCI)eqn  Nen+rcIOM/STC sobj-y .P +	M +	 ey' CO.:6 2C1,1999 Dav <cS. Mien+rc(durcm@ar
hat.com)M@@
n121,7 +121,7 y s 	n= chi	(1UL << cnum) < npages)o 		cnum++;
 M-	 N@T= (base)<< (32 - PAGE@SHIFT + PBM_LOGCLUSTERS - io mu->page_0[1],_sz_bIGs )o+	 N@T= (base)<< (32 - IO_PAGE@SHIFT + PBM_LOGCLUSTERS - io mu->page_0[1],_sz_bIGs )o 		>>I(32 + PBM_LOGCLUSTERS + cnum - io mu->page_0[1],_sz_bIGs ;
 M 	ze'Ifgtse)global flush mi.:6 _SOLhurcecau.:6 tspR+ N@ry,d@@
n184,7 +184,7 y s 	ES <c*ret;d 	st40npages;
 M-	 ize =IPAGE@ALIGN	 ize);o+	 ize =IIO_PAGE@ALIGN	 ize);o aorderF= get_order	 ize);o aSUR	orderF>=I10)o 		e unsi NULL;
@@
n198,7 +198,7 y s 	io mu0= pcp->pbm->io mu;
 M 	ypin_lock_irqsavy(&io mu->lock,Cflags);o-	iopte0= a  de_cynsistent_.o ster(io mu,  ize >>IPAGE@SHIFT);o+	iopte0= a  de_cynsistent_.o ster(io mu,  ize >>IIO_PAGE@SHIFT);o 	SUR	iopte0== NULL)led 		ypin_unlock_irqe as
++(&io mu->lock,Cflags);o 		Gree_pages(first_page,corder);M@@
n206,9 +206,9 y s 	}R 
 	*dma_ain_pe=C(io mu->page_0[1],_map_base)+d-		yyyyyy(	iopte0- io mu->page_0[1],)e<< PAGE@SHIFT));M+7	on Boy(	iopte0- io mu->page_0[1],)e<< IO_PAGE@SHIFT));o 	e ue=C(ES <c*) first_page;o-	npages ||8ize >>IPAGE@SHIFT;M+7npages ||8ize >>IIO_PAGE@SHIFT;  	ctx ||0;- 	SUR	io mu->io mu_etxflush)o 		ctx ||io mu->io mu_eur_etx++;
@@
n218,17 +218,17 y s 		7	on BoIOPTE_WRITE |s 		7	on Bo(first_pageh& IOPTE_PAGE));o 		iopte++;
-		first_pageh+= PAGE@SIZE;M+7	first_pageh+= IO_PAGE@SIZE;o 	}R 
 	{s 		 STBi;
 		u32 dain_ ||*dma_ain_p;o M-M	npages ||8ize >>IPAGE@SHIFT;M+77npages ||8ize >>IIO_PAGE@SHIFT;  		G_SM(ie=C0. i < npages; i++)led 			pci_io mu_write	io mu->io mu_flush,cdain_); -			(ain_ +=cPAGE@SIZE;M+7		(ain_ +=cIO_PAGE@SIZE;o 		}o 	}M s@@
n245,11 +245,11 y s 	iopte_t *iopte;o 	@ vNRE_FGENERIflags,corder, npages, i, ctx;o M-Mnpages ||PAGE@ALIGN	 ize) >>IPAGE@SHIFT;M+7npages ||IO_PAGE@ALIGN	 ize) >>IIO_PAGE@SHIFT;  	pcp0= pdev->sysdata;s 	io mu0= pcp->pbm->io mu;
 	iopte0= io mu->page_0[1], +M-M ((dvma - io mu->page_0[1],_map_base) >>IPAGE@SHIFT);o+		((dvma - io mu->page_0[1],_map_base) >>IIO_PAGE@SHIFT);o M 	ypin_lock_irqsavy(&io mu->lock,Cflags);o 
@@
n286,7 +286,7 y s 		pci_io mu_write	io mu->io mu_etxflush, ctx);o 	}d l{
l{  		G_SM(ie=C0. i < npages; i++)led-			u32 dain_ ||dvma +M(ie<< PAGE@SHIFT);M+7		u32 dain_ ||dvma +M(ie<< IO_PAGE@SHIFT);o M 			pci_io mu_write	io mu->io mu_flush,cdain_);  		}o@@
n321,8 +321,8 y s 		BUG();o M 	oain_ ||(u vNRE_FGENER ptr;M-Mnpages ||PAGE@ALIGN	oain_ +  z) - 	oain_ & PAGE@MASK);M-Mnpages >>=IPAGE@SHIFT;M+7npages ||IO_PAGE@ALIGN	oain_ +  z) - 	oain_ & IO_PAGE@MASK);M+7npages >>=IIO_PAGE@SHIFT;  M 	ypin_lock_irqsavy(&io mu->lock,Cflags);o 
@@
n330,9 +330,9 y s 	if (base)== NULL)s 		goto0bad;
 	bus_ain_ ||(io mu->page_0[1],_map_base)+d-		yyyy((base)- io mu->page_0[1],)e<< PAGE@SHIFT));M-	e ue=Cbus_ain_ | 	oain_ & ~PAGE@MASK);M-Mbase_pain_ ||__pa(oain_ & PAGE@MASK);M+		yyyy((base)- io mu->page_0[1],)e<< IO_PAGE@SHIFT));o+	e ue=Cbus_ain_ | 	oain_ & ~IO_PAGE@MASK);M+7base_pain_ ||__pa(oain_ & IO_PAGE@MASK);M 	ctx ||0;- 	SUR	io mu->io mu_etxflush)o 		ctx ||io mu->io mu_eur_etx++;
@@
n343,7 +343,7 y s 	iUR	diarctt *+!= PCI2DMA_TODEVICE)o 		iopte_e0xtrctt *+|=oIOPTE_WRITE;o M-MG_SM(ie=C0. i < npages; i++, base++, base_pain_ +=cPAGE@SIZE)o+	G_SM(ie=C0. i < npages; i++, base++, base_pain_ +=cIO_PAGE@SIZE)o 		iopte_val(*base) ||iopte_e0xtrctt *+| base_pain_;  M 	ypin_unlock_irqe as
++(&io mu->lock,Cflags);o@@
n372,15 +372,15 y s 	io mu0= pcp->pbm->io mu;
 	y  buKE=I&pcp->pbm->stc;o M-Mnpages ||PAGE@ALIGN	bus_ain_ +  z) - 	bus_ain_ & PAGE@MASK);M-Mnpages >>=IPAGE@SHIFT;M+7npages ||IO_PAGE@ALIGN	bus_ain_ +  z) - 	bus_ain_ & IO_PAGE@MASK);M+7npages >>=IIO_PAGE@SHIFT;  	base)= io mu->page_0[1], +M-M ((bus_ain_ - io mu->page_0[1],_map_base) >>IPAGE@SHIFT);o+		((bus_ain_ - io mu->page_0[1],_map_base) >>IIO_PAGE@SHIFT);o _ GzbH_DEBUG_PCI_IOMMUo 	SUR	iopte_val(*base) |=oIOPTE_INVALID)M 		p - 1;
"pci_unmap_aing],Ica  ed on _Sn-@ pped engion %08x,%08x3
SK_S%016lx\n",Cbus_ain_,  z, __builtin_e unsi_ain_urc(0));o v)@ vNR-	bus_ain_ &= PAGE@MASK;o+	bus_ain_ &= IO_PAGE@MASK;o M 	ypin_lock_irqsavy(&io mu->lock,Cflags);o 
@@
n404,7 +404,7 y s 		7	pci_io mu_write	flusheng, ctx);o 			} n= ch(((ENER pci_io mu_nuxd(matcheng)) < 0L);o 		}d l{
l{ -			G_SM(ie=C0. i < npages; i++, vain_ +=cPAGE@SIZE)o+			G_SM(ie=C0. i < npages; i++, vain_ +=cIO_PAGE@SIZE)o 		7	pci_io mu_write	y  buK->st buK_pflush,cvain_);  		}o 
@@
n432,9 +432,9 y s 		@ vNRE_FGENERIptevale=C~0UL;
 		u32 dma_npages;
 M-		dma_npages ||(((ma_sg->dvma_ain_urcs& (PAGE@SIZE)- 1UL)  +o+		dma_npages ||(((ma_sg->dvma_ain_urcs& (IO_PAGE@SIZE)- 1UL)  +d 			yyyyyy(ma_sg->dvma_length +M-M 	on Boy(	u32)(PAGE@SIZE)- 1UL)   >>IPAGE@SHIFT;o+			on Boy(	u32)(IO_PAGE@SIZE)- 1UL) ) >>IIO_PAGE@SHIFT;  		doled 			@ vNRE_FGENERIoffsetGM 			8NRE_FG STBn+n;o@@
n449,15 +449,15 y s o 				tmp = 2@ vNRE_FGENER  __pa(sg->ain_urc);o 				n+n ||8g->length; -				sUR	t(tmp ^Ipteval) >>IPAGE@SHIFT)+!= 0UL)l{ -			7	ptevale=Ctmp & PAGE@MASK;o-			7	offset-=Ctmp & (PAGE@SIZE)- 1UL);o+				sUR	t(tmp ^Ipteval) >>IIO_PAGE@SHIFT)+!= 0UL)l{ +			7	ptevale=Ctmp & IO_PAGE@MASK;o+			7	offset-=Ctmp & (IO_PAGE@SIZE)- 1UL);o 					bnuxk;o 				} -				sUR	t(tmp ^I(tmp + n+n - 1UL)  >>IPAGE@SHIFT)+!= 0UL)l{ -			7	ptevale=C(tmp + PAGE@SIZE) & PAGE@MASK;o+				sUR	t(tmp ^I(tmp + n+n - 1UL)  >>IIO_PAGE@SHIFT)+!= 0UL)l{ +			7	ptevale=C(tmp + IO_PAGE@SIZE)h& IO_PAGE@MASK;o 			7	offset-=C0UL;
-			7	n+n -=c(PAGE@SIZE)- (tmp & (PAGE@SIZE)- 1UL)));o+					n+n -=c(IO_PAGE@SIZE)- (tmp & (IO_PAGE@SIZE)- 1UL)));o 					bnuxk;o 				}  				8g++;
@@
n466,8 +466,8 y s 		7ptevale=Ciopte_e0xtrctt *+| (ptevale& IOPTE_PAGE);o 			n= chi	n+n >C0)led 				*iopte++ ||__iopte(pteval); -			7ptevale+=cPAGE@SIZE;M-		7	n+n -=c(PAGE@SIZE)- offset);o+				ptevale+=cIO_PAGE@SIZE;o+				n+n -=c(IO_PAGE@SIZE)- offset);o 		7	offset-=C0;o 		7	dma_npages--;o 			}M@@
n479,14 +479,14 y s 		7+	  djustiERIptevaleaENERItse)way.  Stopewhen wes 		7+	 detrctCaCeage)crorcingd vent.s 		7+	/M-M		n= chi	(ptevale<< (64 - PAGE@SHIFT)) != 0UL &&o+			n= chi	(ptevale<< (64 - IO_PAGE@SHIFT)) != 0UL &&o 			yyyyyyyptevale== __pa(sg->ain_urc) &&o 			yyyyyyy	(ptevale^M-M 		 (__pa(sg->ain_urc) +|8g->length - 1UL)  >>IPAGE@SHIFT)+== 0UL)l{ +			7 (__pa(sg->ain_urc) +|8g->length - 1UL)  >>IIO_PAGE@SHIFT)+== 0UL)l{  				ptevale+=c8g->length;  				8g++;
 			} -			sUR	tptevale<< (64 - PAGE@SHIFT)) ==I0UL)i+			sUR	tptevale<< (64 - IO_PAGE@SHIFT)) ==I0UL)i 		7	ptevale=C~0UL;
 		} n= ch (dma_npages != 0);o 		(ma_sg++;
@@
n534,7 +534,7 y s 	base)= a  de_st eaming_.o ster(io mu, npages);s 	if (base)== NULL)s 		goto0bad;
-	(ma_base)= io mu->page_0[1],_map_base)+y((base)- io mu->page_0[1],)e<< PAGE@SHIFT);M+7dma_base)= io mu->page_0[1],_map_base)+y((base)- io mu->page_0[1],)e<< IO_PAGE@SHIFT);o M 	ze'Step 3: N_Smalize DMA ain_urceR	l+/M @usy" =I3"lems;
@@
n591,16 +591,16 y s 	io mu0= pcp->pbm->io mu;
 	y  buKE=I&pcp->pbm->stc;o 	R-	bus_ain_ =c gnist->dvma_ain_urcs& PAGE@MASK;o+	bus_ain_ =c gnist->dvma_ain_urcs& IO_PAGE@MASK;o M 	G_SM(ie=C1. i < nelems; i++)o 		ifI(sgnist[i].dvma_length ==I0 i 		7bnuxk;o 	i--;o-Mnpages ||(PAGE@ALIGN	 gnist[i].dvma_ain_urcs+  gnist[i].dvma_length) - bus_ain_) >>IPAGE@SHIFT;M+7npages ||(IO_PAGE@ALIGN	 gnist[i].dvma_ain_urcs+  gnist[i].dvma_length) - bus_ain_) >>IIO_PAGE@SHIFT;  M 	base)= io mu->page_0[1], +M-M ((bus_ain_ - io mu->page_0[1],_map_base) >>IPAGE@SHIFT);o+		((bus_ain_ - io mu->page_0[1],_map_base) >>IIO_PAGE@SHIFT);o o _ GzbH_DEBUG_PCI_IOMMUo 	SUR	iopte_val(*base) |=oIOPTE_INVALID)M@@
n629,7 +629,7 y s 		7	pci_io mu_write	flusheng, ctx);o 			} n= ch(((ENER pci_io mu_nuxd(matcheng)) < 0L);o 		}d l{
l{ -			G_SM(ie=C0. i < npages; i++, vain_ +=cPAGE@SIZE)o+			G_SM(ie=C0. i < npages; i++, vain_ +=cIO_PAGE@SIZE)o 		7	pci_io mu_write	y  buK->st buK_pflush,cvain_);  		}o 
@@
n667,9 +667,9 y s o 	ypin_lock_irqsavy(&io mu->lock,Cflags);o 
-Mnpages ||PAGE@ALIGN	bus_ain_ +  z) - 	bus_ain_ & PAGE@MASK);M-Mnpages >>=IPAGE@SHIFT;M-	bus_ain_ &= PAGE@MASK;o+	npages ||IO_PAGE@ALIGN	bus_ain_ +  z) - 	bus_ain_ & IO_PAGE@MASK);M+7npages >>=IIO_PAGE@SHIFT; +	bus_ain_ &= IO_PAGE@MASK;o M 	ze'Step 1: RecordFild)eq t200,@if a y	l+/M @ctx ||0;-@@
n678,7 +678,7 y s 		 opte_t *iopte;o s 		 opte)= io mu->page_0[1], +M-M 	((bus_ain_ - io mu->page_0[1],_map_base)>>PAGE@SHIFT);M+7		((bus_ain_ - io mu->page_0[1],_map_base)>>IO_PAGE@SHIFT);o 	@ctx ||(iopte_val(*iopte)h& IOPTE_t
@TEXT) >>I47UL;
 	}o 
@@
n696,7 +696,7 y s 	}d l{
l{  		@ vNRE_FGENERIi;
 M-		G_SM(ie=C0. i < npages; i++, bus_ain_ +=cPAGE@SIZE)o+		G_SM(ie=C0. i < npages; i++, bus_ain_ +=cIO_PAGE@SIZE)o 		7pci_io mu_write	y  buK->st buK_pflush,cbus_ain_);
 	}o 
@@
n735,7 +735,7 y s 		 opte_t *iopte;o s 		 opte)= io mu->page_0[1], +M-M 	(( gnist[0].dvma_ain_urcs- io mu->page_0[1],_map_base) >>IPAGE@SHIFT);o+			(( gnist[0].dvma_ain_urcs- io mu->page_0[1],_map_base) >>IIO_PAGE@SHIFT);o 	@ctx ||(iopte_val(*iopte)h& IOPTE_t
@TEXT) >>I47UL;
 	}o 
@@
n754,14 +754,14 y s 		@ vNRE_FGENERIi,0npages;
 		u32 bus_ain_;
 M-		bus_ain_ =c gnist[0].dvma_ain_urcs& PAGE@MASK;o+		bus_ain_ =c gnist[0].dvma_ain_urcs& IO_PAGE@MASK;o M 		G_S(ie=C1. i < nelems; i++)o 			SUR	! gnist[i].dvma_length)o 		7	bnuxk;o 		i--;o-MMnpages ||(PAGE@ALIGN	 gnist[i].dvma_ain_urcs+  gnist[i].dvma_length) - bus_ain_) >>IPAGE@SHIFT;M-		G_SM(ie=C0. i < npages; i++, bus_ain_ +=cPAGE@SIZE)o+		npages ||(IO_PAGE@ALIGN	 gnist[i].dvma_ain_urcs+  gnist[i].dvma_length) - bus_ain_) >>IIO_PAGE@SHIFT; +		G_SM(ie=C0. i < npages; i++, bus_ain_ +=cIO_PAGE@SIZE)o 		7pci_io mu_write	y  buK->st buK_pflush,cbus_ain_);
 	}o 
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gpci_psycho	c $(CONFIG_SH_pIG_64RIG_SH_Gpci_psycho	cP6 +35,9 @@
 #include <apIG_64RIG_SH_Gpci_psycho	c	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_Gpci_psycho	c	tup_Aug 28b0dc.9:44ble ch@@
n1,4R(w44Ry size' CONFpci_psycho	cthen
27G_MEfin8_12 &3:18:23 durcm"$CONFI+ze' CONFpci_psycho	cthen
28G_MEfin8_24 19:36:58bkanoj"$CONFI +	 pci_psycho	c: PSYCHO/U2P Opecifi_ PCI)eqn  Nen+rcsobj-y .P +	M +	 ey' CO.:6 2C1,1997s 1998,,1999 Dav <cS. Mien+rc(durcm@caipfs.rutgers.edu)M@@
n18,6R+18,7 y s vmaddr);
+R+G*  
 fiar	chi s vmaddr);
"pci_impl.h"ileAe.o t/s"io mu_eqmm *.h"s s ze'All PSYCHO|engisterR ~re 64-bIGs.  Tseyfo  dwing)otalraorM +	 rohtineR ~re how)they ~re atalraed.  TseyREG pIGameterM@@
n715,12 +716,12Ry s 			yyyyyyy	(tags& PSYCHO_IOMMU_TAG_WRITE) ? 1 :I0 ,s 			yyyyyyy	(tags& PSYCHO_IOMMU_TAG_STREAM) ? 1 :I0 ,s 			yyyyyyy	(tags& PSYCHO_IOMMU_TAG_SIZE)h? 64 :I8),d-			yyyyyyy(tags& PSYCHO_IOMMU_TAG_VPAGE)e<< PAGE@SHIFT);M+7		yyyyyyy(tags& PSYCHO_IOMMU_TAG_VPAGE)e<< IOMMU_PAGE@SHIFT);o 			p - 1;
"PSYCHO%d: IOMMU DATA(%d)[v_sid(%d) cache(%d) ppg(%016lx)]\n",d 			yyyyyyyp->8ndex, i,s 			yyyyyyy	(data & PSYCHO_IOMMU_DATA_VALID) ? 1 :I0 ,s 			yyyyyyy	(data & PSYCHO_IOMMU_DATA_CACHE) ? 1 :I0 ,s-			yyyyyyy(data & PSYCHO_IOMMU_DATA_PPAGE)e<< PAGE@SHIFT);M+7		yyyyyyy(data & PSYCHO_IOMMU_DATA_PPAGE)e<< IOMMU_PAGE@SHIFT);o 		}o 	}M 	__psycho_cb,ck_stc_err_S(p, afsr, afar, type);o@@
n1322,7 +1323,7 y s 	C* i[1], (128KCiopteseE)8 byteseper-iopte).  TspR+pRs 	C* eage)orderF7 on Ul  aSpIG_.s 	C*/M-Mtsbbase)= __ge0_Gree_pages(GFP_KERNEL, 7);M+7tsbbase)= __ge0_Gree_pages(GFP_KERNEL, get_order	IO_TSB_SIZE));s 	if (!tsbbase)l{  		e0xm_p - 1f
"PSYCHO_IOMMU: Err_S, gfp(tsb) fa
 
d.\n");o 		e0xm_halt();o@@
n1331,7 +1332,7 y s 	io mu->page_0[1],_sz_bIGse=C17;s 	io mu->page_0[1],_map_base)=C0xc0000000;s 	io mu->dma_ain__mask)=C0xffffffff;M-	memset((char *)tsbbase, 0, PAGE@SIZE)<< 7);M+7memset((char *)tsbbase, 0, IO_TSB_SIZE);o M 	ze'WeI  
  +withFnoPconsistentG@ ppingR	l+/M @io mu->lowest_cynsistent_mape=
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gpci_sabnu	c $(CONFIG_SH_pIG_64RIG_SH_Gpci_sabnu	cP6 +35,9 @@
 #include <apIG_64RIG_SH_Gpci_sabnu	c	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_Gpci_sabnu	c	tup_Aug 28b0dc.9:44ble ch@@
n1,4R(w44Ry size' CONFpci_sabnu	cthen
38G_MEfin8_12 &3:18:23 durcm"$CONFI+ze' CONFpci_sabnu	cthen
39G_MEfin8_24 19:36:58bkanoj"$CONFI +	 pci_sabnu	c: Sabnu Opecifi_ PCI)eqn  Nen+rcsobj-y .P +	M +	 ey' CO.:6 2C1,1997s 1998,,1999 Dav <cS. Mien+rc(durcm@caipfs.rutgers.edu)M@@
n19,6R+19,7 y s vmaddr);
+R+G* mp	chi s vmaddr);
"pci_impl.h"ileAe.o t/s"io mu_eqmm *.h"s s ze'All SABRE|engisterR ~re 64-bIGs.  Tseyfo  dwing)otalraorM +	 rohtineR ~re how)they ~re atalraed.  TseyREG pIGameterM@@
n759,13R+760,13Ry s 			yyyyyyyp->8ndex, i, tag, type_st ing,s 			yyyyyyy	(tags& SABRE_IOMMUTAG_WRITE) ? 1 :I0 ,s 			yyyyyyy	(tags& SABRE_IOMMUTAG_SIZE)h? 64 :I8),d-			yyyyyyy((tags& SABRE_IOMMUTAG_VPN)e<< PAGE@SHIFT));M+7		yyyyyyy((tags& SABRE_IOMMUTAG_VPN)e<< IOMMU_PAGE@SHIFT));o 			p - 1;
"SABRE%d: IOMMU DATA(%d)[RAW(%016lx)v_sid(%d)usy"(%d)cache(%d)ppg(%016lx)\n",d 			yyyyyyyp->8ndex, i,Fdata,s 			yyyyyyy	(data & SABRE_IOMMUDATA_VALID) ? 1 :I0 ,s 			yyyyyyy	(data & SABRE_IOMMUDATA_USED) ? 1 :I0 ,s 			yyyyyyy	(data & SABRE_IOMMUDATA_CACHE) ? 1 :I0 ,s-			yyyyyyy((data & SABRE_IOMMUDATA_PPN)e<< PAGE@SHIFT));M+7		yyyyyyy((data & SABRE_IOMMUDATA_PPN)e<< IOMMU_PAGE@SHIFT));o 		}o 	}M 	ypin_unlock_irqe as
++(&io mu->lock,Cflags);o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gpci_schizo	c $(CONFIG_SH_pIG_64RIG_SH_Gpci_schizo	cP6 +35,9 @@
 #include <apIG_64RIG_SH_Gpci_schizo	c	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_Gpci_schizo	c	tup_Aug 28b0dc.9:44ble ch@@
n1,4R(w44Ry size' CONFpci_schizo	cthen
20G_MEfin8_12 &3:18:23 durcm"$CONFI+ze' CONFpci_schizo	cthen
21G_MEfin8_24 19:36:58bkanoj"$CONFI +	 pci_schizo	c: SCHIZO Opecifi_ PCI)eqn  Nen+rcsobj-y .P +	M +	 ey' CO.:6 2C1,_MEf Dav <cS. Mien+rc(durcm@ar
hat.com)M@@
n16,6R+16,7 y s vmaddr);
+R+G*upa	chi s vmaddr);
"pci_impl.h"ileAe.o t/s"io mu_eqmm *.h"s s ze'All SCHIZO engisterR ~re 64-bIGs.  Tseyfo  dwing)otalraorM +	 rohtineR ~re how)they ~re atalraed.  TseyREG pIGameterM@@
n659,12 +660,12Ry s 			yyyyyyy	(tags& SCHIZO_IOMMU_TAG_WRITE) ? 1 :I0 ,s 			yyyyyyy	(tags& SCHIZO_IOMMU_TAG_STREAM) ? 1 :I0 ,s 			yyyyyyy	(tags& SCHIZO_IOMMU_TAG_SIZE)h? 64 :I8),d-			yyyyyyy(tags& SCHIZO_IOMMU_TAG_VPAGE)e<< PAGE@SHIFT);M+7		yyyyyyy(tags& SCHIZO_IOMMU_TAG_VPAGE)e<< IOMMU_PAGE@SHIFT);o 			p - 1;
"SCHIZO%d: PBM-%c IOMMU DATA(%d)[v_sid(%d) cache(%d) ppg(%016lx)]\n",d 			yyyyyyyp->8ndex, pbm_name, i,s 			yyyyyyy	(data & SCHIZO_IOMMU_DATA_VALID) ? 1 :I0 ,s 			yyyyyyy	(data & SCHIZO_IOMMU_DATA_CACHE) ? 1 :I0 ,s-			yyyyyyy(data & SCHIZO_IOMMU_DATA_PPAGE)e<< PAGE@SHIFT);M+7		yyyyyyy(data & SCHIZO_IOMMU_DATA_PPAGE)e<< IOMMU_PAGE@SHIFT);o 		}o 	}M 	__schizo_cb,ck_stc_err_S_pbm(pbm, type);o@@
n1639,7 +1640,7 y s 	C* i[1], (128KCiopteseE)8 byteseper-iopte).  TspR+pRs 	C* eage)orderF7 on Ul  aSpIG_.s 	C*/M-Mtsbbase)= __ge0_Gree_pages(GFP_KERNEL, 7);M+7tsbbase)= __ge0_Gree_pages(GFP_KERNEL, get_order	IO_TSB_SIZE));s 	if (!tsbbase)l{  		e0xm_p - 1f
"SCHIZO_IOMMU: Err_S, gfp(tsb) fa
 
d.\n");o 		e0xm_halt();o@@
n1648,7 +1649,7 y s 	io mu->page_0[1],_sz_bIGse=C17;s 	io mu->page_0[1],_map_base)=C0xc0000000;s 	io mu->dma_ain__mask)=C0xffffffff;M-	memset((char *)tsbbase, 0, PAGE@SIZE)<< 7);M+7memset((char *)tsbbase, 0, IO_TSB_SIZE);o M 	ze'WeI  
  +withFnoPconsistentG@ ppingR	l+/M @io mu->lowest_cynsistent_mape=
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gp0x20;
	c $(CONFIG_SH_pIG_64RIG_SH_Gp0x20;
	cP6 +35,9 @@
 #include <apIG_64RIG_SH_Gp0x20;
	c	tup_Jul  3 17:08:19c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_Gp0x20;
	c	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size'' CONFp0x20;
	cthen
118G_MEfin6_T3G13:41:13Recd"$CONFI+ze'' CONFp0x20;
	cthen
119G_MEfin9/07o21:04:40ckanoj"$CONFI +	  IG_SH_pIG_64RIG_SH_Gp0x20;
	cP +	M +	  ey' CO.:6 2C1,1995,,1996 Dav <cS. Mien+rc(durcm@caip.rutgers.edu)M@@
n585,7 +585,7 y s 	char *child_trap_Grame;o M 	ze'Calculate+offset-to stabi_Grame & pt_engsC*/M-Mchild_trap_Grame ||((char *)p))+y((PAGE@SIZE)<< 1) - 	TRACEREG_SZ+REGWIN_SZ));M+7child_trap_Grame ||((char *)p))+y(THREAD@SIZEh- 	TRACEREG_SZ+REGWIN_SZ));M 7memcpy(child_trap_Grame,R	t(y    cCeng_window)*)engs)-1), 	TRACEREG_SZ+REGWIN_SZ));M 7t->ksp = 22@ vNRE_FGENER  child_trap_Grame) - STACK_BIAS;M 7t->flags+|=oSPARC_FLAG_NEWCHILD;o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gptrac 	c $(CONFIG_SH_pIG_64RIG_SH_Gptrac 	cP6 +35,9 @@
 #include <apIG_64RIG_SH_Gptrac 	c	Sun Aug 12 &3:27:59c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_Gptrac 	c	tup_
elN18G16:58:03ble ch@@
n105,6R+105,16 y s };s v)@ vNR 
E/&_+eE)Ca  ed by IG_SH_Gptrac 	c when detabhing.."	$(_+eE)Makegsure aing],Istep bIGseetc ~re _SOLset."	$(inpES <cptrac _dis[1],(y    cCtask_st   cC*child)
+{ +	ze'_SOhing 
3tdo (inp}np- R+G
 ikage)ES <cdo_ptrac (y    cCpt_engsC*engs)*led 	 STBrequest = engs->u_engs[UREG_I0];
@@
n562,22R+572,11 y s 	}R 
 	case)PTRACE_SUNDETACH: { ze'detabhCaCe0x20;
FilattwaR ~ttabhed. 	/M-M	@ vNRE_FGENERIflags;M-s-M	sUR	t@ vNRE_FGENER  data > _NSIG led+		st40 rr_S0= ptrac _detabh(child,Fdata);M+7	sUR	 rr_S)led 			pt_err_S_e unsi(engs, EIO);] 			goto0ou _tsk;o 		}o-M	child->ptrac  &= ~(PT_PTRACED|PT_TRACESYS); -		child-> xit_code+= data;s-s-M	write_lock_irqsavy(&tasknist_lock,Cflags);o-		REMOVE_LINKS(child); -		child->p_pptr+= child->p_opptr;M-M	SET_LINKS(child); -		write_unlock_irqe as
++(&tasknist_lock,Cflags);o- -		wake_up_e0x20;
(child);  		pt_succ_e unsi(engs, 0);o 		goto0ou _tsk;o 	}](MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gsbu
	c $(CONFIG_SH_pIG_64RIG_SH_Gsbu
	cP6 +35,9 @@
 #include <apIG_64RIG_SH_Gsbu
	c	thu,May 24 15bj-$58G_MEfa.o
 
 ifeq ($(COpIG_64RIG_SH_Gsbu
	c	tup_Aug 28b0dc.9:44ble ch@@
n1,4R(w44Ry size' CONFsbu
	cthen
14G_MEfin5/23 03:06 51odurcm"$CONFI+ze' CONFsbu
	cthen
16G_MEfin8_24 19:36:58bkanoj"$CONFI +	 sbu
	c: Ul  aSpIG_ SBUS)eqn  Nen+rcsobj-y .P +	M +	 ey' CO.:6 2C1,1999 Dav <cS. Mien+rc(durcm@ar
hat.com)M@@
n37,7 +37,7 y s vdefLi)yONE_GIG		(1UL * 1024UL * 1024UL * 1024UL)n _defLi) CLUSTER_SIZE	(ONE_GIG / NCLUSTERS)n _defLi) CLUSTER_MASK	(CLUSTER_SIZE - 1)a-#defLi)yCLUSTER_NPAGES	(CLUSTER_SIZE >>IPAGE@SHIFT)np_defLi)yCLUSTER_NPAGES	(CLUSTER_SIZE >>IIO_PAGE@SHIFT)- _defLi) MAP_BASE	(	u32)0xc0000000)R 
 y    cCsbus_io mu0ed@@
n99,7 +99,7 y s 8  pF TES <cio mu_flush(y    cCsbus_io mu0*io mu, u32 base, @ vNRE_FGENERI3pages)o {s 	n= chi	npages--)M-M	@pa_writeq(base)+y(npages << PAGE@SHIFT),M+7	@pa_writeq(base)+y(npages << IO_PAGE@SHIFT),s 			yyyio mu->io mu_engsC+ IOMMU_FLUSH);o 	@pa_nuxdq	io mu->sbus_eqn  Ne_eng);  }]@@
n120,7 +120,7 y s {M @io mu->st buK_flushflag-=C0UL;
 	n= chi	npages--)M-M	@pa_writeq(base)+y(npages << PAGE@SHIFT),M+7	@pa_writeq(base)+y(npages << IO_PAGE@SHIFT),s 			yyyio mu->st buK_engsC+ STRBUF_PFLUSH);o M 	ze'Whoopee cushion!P*ne@@
n191,8 +191,8 y s 	cnum =C0;o 	n= chi	(1UL << cnum) < npages)o 		cnum++;
-	 N@T= (base)& CLUSTER_MASK) >>I(PAGE@SHIFT + cnum);o-	iopte0= io mu->page_0[1], +y((base)- MAP_BASE) >>IPAGE@SHIFT);o+	 N@T= (base)& CLUSTER_MASK) >>I(IO_PAGE@SHIFT + cnum);o+	iopte0= io mu->page_0[1], +y((base)- MAP_BASE) >>IIO_PAGE@SHIFT);o 	Sopte_val(*iopte)h=C0UL;
 M 	ze'Ifgtse)global flush mi.:6 _SOLhurcecau.:6 tspR+ N@ry,d@@
n235,7 +235,7 y s s 8  pF TES <cGree_cynsistent_.o ster(y    cCsbus_io mu0*io mu, u32 base, @ vNRE_FGENERI3pages)o {s-	 opte_t *iopte0= io mu->page_0[1], +y((base)- MAP_BASE) >>IPAGE@SHIFT);o+	 opte_t *iopte0= io mu->page_0[1], +y((base)- MAP_BASE) >>IIO_PAGE@SHIFT);o M 	sUR	tiopte0- io mu->page_0[1],)e== io mu->lowest_cynsistent_map)led 		 opte_t *walke=Ciopte +ynpages;
@@
n266,7 +266,7 y s 	iUR	8ize <=C0 || sdev)== NULL || dvma_ain_)== NULL)s 		e unsi NULL;
 M-	 ize =IPAGE@ALIGN	 ize);o+	 ize =IIO_PAGE@ALIGN	 ize);o aorderF= get_order	 ize);o aSUR	orderF>=I10)o 		e unsi NULL;
@@
n278,7 +278,7 y s 	io mu0= sdev->bus->io mu;
 M 	ypin_lock_irqsavy(&io mu->lock,Cflags);o-	iopte0= a  de_cynsistent_.o ster(io mu,  ize >>IPAGE@SHIFT);o+	iopte0= a  de_cynsistent_.o ster(io mu,  ize >>IIO_PAGE@SHIFT);o 	SUR	iopte0== NULL)led 		ypin_unlock_irqe as
++(&io mu->lock,Cflags);o 		Gree_pages(first_page,corder);M@@
n286,15 +286,15 y s 	}R 
 	ze'Ok,Nwc're)eqmmitt_FGa6 tspR+post4. 	/M-M*dvma_ain_)= MAP_BASE +	(	iopte0- io mu->page_0[1],)e<< PAGE@SHIFT);o+	*dvma_ain_)= MAP_BASE +	(	iopte0- io mu->page_0[1],)e<< IO_PAGE@SHIFT);o 	e ue=C(ES <c*) first_page;o-	npages ||8ize >>IPAGE@SHIFT;M+7npages ||8ize >>IIO_PAGE@SHIFT;  	n= chi	npages--)led 		*iopte++ ||__iopte(IOPTE_VALID | IOPTE_tACHE-|oIOPTE_WRITE |s 		7	on (__pa(first_page)h& IOPTE_PAGE));o-		first_pageh+= PAGE@SIZE;M+7	first_pageh+= IO_PAGE@SIZE;o 	}R-	io mu_flush(io mu, *dvma_ain_,  ize >>IPAGE@SHIFT);o+	io mu_flush(io mu, *dvma_ain_,  ize >>IIO_PAGE@SHIFT);o 	ypin_unlock_irqe as
++(&io mu->lock,Cflags);o 
 @e unsi ret;d@@
n308,7 +308,7 y s 	iUR	8ize <=C0 || sdev)== NULL || cpu)== NULL)s 		e unsi;o M-Mnpages ||PAGE@ALIGN	 ize) >>IPAGE@SHIFT;M+7npages ||IO_PAGE@ALIGN	 ize) >>IIO_PAGE@SHIFT;  	io mu0= sdev->bus->io mu;
 M 	ypin_lock_irq(&io mu->lock);o@@
n333,25 +333,25 y s 		BUG();o M 	pbase)=Ct@ vNRE_FGENER  ptr;M-Moffset-=C(u32)I(pbase)& ~PAGE@MASK);M-M ize =I(PAGE@ALIGN	pbase)+y ize) -I(pbase)& PAGE@MASK));o-	pbase)=Ct@ vNRE_FGENER  __pa(pbase)& PAGE@MASK);M+7offset-=C(u32)I(pbase)& ~IO_PAGE@MASK);M+7 ize =I(IO_PAGE@ALIGN	pbase)+y ize) -I(pbase)& IO_PAGE@MASK));o+	pbase)=Ct@ vNRE_FGENER  __pa(pbase)& IO_PAGE@MASK);M M 	ypin_lock_irqsavy(&io mu->lock,Cflags);o-	npages ||8ize >>IPAGE@SHIFT;M+7npages ||8ize >>IIO_PAGE@SHIFT;  	iopte0= a  de_st eaming_.o ster(io mu, npages);s 	if (iopte0== NULL)s 		goto0bad;
-	(ma_base)= MAP_BASE + (	iopte0- io mu->page_0[1],)e<< PAGE@SHIFT);o-	npages ||8ize >>IPAGE@SHIFT;M+7(ma_base)= MAP_BASE + (	iopte0- io mu->page_0[1],)e<< IO_PAGE@SHIFT);o+	npages ||8ize >>IIO_PAGE@SHIFT;  	iopte_bIGse=CIOPTE_VALID | IOPTE_STBUF | IOPTE_tACHE;s 	iUR	dia != SBUS2DMA_TODEVICE)o 		iopte_bIGse|=oIOPTE_WRITE;o 	n= chi	npages--)led 		*iopte++ ||__iopte(iopte_bIGse|I(pbase)& IOPTE_PAGE));o-		pbase)+= PAGE@SIZE;M+7	pbase)+= IO_PAGE@SIZE;o 	}R-	npages ||8ize >>IPAGE@SHIFT;M+7npages ||8ize >>IIO_PAGE@SHIFT;  	ypin_unlock_irqe as
++(&io mu->lock,Cflags);o 
 @e unsi ((ma_base)| offset);o@@
n365,14 +365,14 y s ES <csbus_unmap_aing],(y    cCsbus_dev)*sdev, dma_ain__t dma_ain_,  ize_6  ize,-iSTBdiarctt *)*led 	y    cCsbus_io mu0*io mu0= sdev->bus->io mu;
-	u32 dma_base)= dma_ain_s& PAGE@MASK;o+	u32 dma_base)= dma_ain_s& IO_PAGE@MASK;o 	@ vNRE_FGENERIflags;M M-M ize =I(PAGE@ALIGN	dma_ain_s+y ize) -Idma_base);M+7 ize =I(IO_PAGE@ALIGN	dma_ain_s+y ize) -Idma_base);M M 	ypin_lock_irqsavy(&io mu->lock,Cflags);o-	Gree_st eaming_.o ster(io mu, dma_base,  ize >>IPAGE@SHIFT);o-	st buK_flush(io mu, dma_base,  ize >>IPAGE@SHIFT);o+	Gree_st eaming_.o ster(io mu, dma_base,  ize >>IIO_PAGE@SHIFT);o+	st buK_flush(io mu, dma_base,  ize >>IIO_PAGE@SHIFT);o 	ypin_unlock_irqe as
++(&io mu->lock,Cflags);o }o 
@@
n385,9 +385,9 y s 		@ vNRE_FGENERIptevale=C~0UL;
 		u32 dma_npages;
 M-		dma_npages ||(((ma_sg->dvma_ain_urcs& (PAGE@SIZE)- 1UL)  +o+		dma_npages ||(((ma_sg->dvma_ain_urcs& (IO_PAGE@SIZE)- 1UL)  +d 			yyyyyy(ma_sg->dvma_length +M-M 	on Boy(	u32)(PAGE@SIZE)- 1UL)   >>IPAGE@SHIFT;o+			on Boy(	u32)(IO_PAGE@SIZE)- 1UL) ) >>IIO_PAGE@SHIFT;  		doled 			@ vNRE_FGENERIoffsetGM 			8NRE_FG STBn+n;o@@
n402,15 +402,15 y s o 				tmp = 2@ vNRE_FGENER  __pa(sg->ain_urc);o 				n+n ||8g->length; -				sUR	t(tmp ^Ipteval) >>IPAGE@SHIFT)+!= 0UL)l{ -			7	ptevale=Ctmp & PAGE@MASK;o-			7	offset-=Ctmp & (PAGE@SIZE)- 1UL);o+				sUR	t(tmp ^Ipteval) >>IIO_PAGE@SHIFT)+!= 0UL)l{ +			7	ptevale=Ctmp & IO_PAGE@MASK;o+			7	offset-=Ctmp & (IO_PAGE@SIZE)- 1UL);o 					bnuxk;o 				} -				sUR	t(tmp ^I(tmp + n+n - 1UL)  >>IPAGE@SHIFT)+!= 0UL)l{ -			7	ptevale=C(tmp + PAGE@SIZE) & PAGE@MASK;o+				sUR	t(tmp ^I(tmp + n+n - 1UL)  >>IIO_PAGE@SHIFT)+!= 0UL)l{ +			7	ptevale=C(tmp + IO_PAGE@SIZE)h& IO_PAGE@MASK;o 			7	offset-=C0UL;
-			7	n+n -=c(PAGE@SIZE)- (tmp & (PAGE@SIZE)- 1UL)));o+					n+n -=c(IO_PAGE@SIZE)- (tmp & (IO_PAGE@SIZE)- 1UL)));o 					bnuxk;o 				}  				8g++;
@@
n419,8 +419,8 y s 		7ptevale=C((ptevale& IOPTE_PAGE))| iopte_bIGs);o 			n= chi	n+n >C0)led 				*iopte++ ||__iopte(pteval); -			7ptevale+=cPAGE@SIZE;M-		7	n+n -=c(PAGE@SIZE)- offset);o+				ptevale+=cIO_PAGE@SIZE;o+				n+n -=c(IO_PAGE@SIZE)- offset);o 		7	offset-=C0;o 		7	dma_npages--;o 			}M@@
n432,14 +432,14 y s 		7+	  djustiERIptevaleaENERItse)way.  Stopewhen wes 		7+	 detrctCaCeage)crorcingd vent.s 		7+	/M-M		n= chi	(ptevale<< (64 - PAGE@SHIFT)) != 0UL &&o+			n= chi	(ptevale<< (64 - IO_PAGE@SHIFT)) != 0UL &&o 			yyyyyyyptevale== __pa(sg->ain_urc) &&o 			yyyyyyy	(ptevale^M-M 		 (__pa(sg->ain_urc) +|8g->length - 1UL)  >>IPAGE@SHIFT)+== 0UL)l{ +			7 (__pa(sg->ain_urc) +|8g->length - 1UL)  >>IIO_PAGE@SHIFT)+== 0UL)l{  				ptevale+=c8g->length;  				8g++;
 			} -			sUR	tptevale<< (64 - PAGE@SHIFT)) ==I0UL)i+			sUR	tptevale<< (64 - IO_PAGE@SHIFT)) ==I0UL)i 		7	ptevale=C~0UL;
 		} n= ch (dma_npages != 0);o 		(ma_sg++;
@@
n472,7 +472,7 y s 	iopte0= a  de_st eaming_.o ster(io mu, npages);s 	if (iopte0== NULL)s 		goto0bad;
-	(ma_base)= MAP_BASE + (	iopte0- io mu->page_0[1],)e<< PAGE@SHIFT);o+7(ma_base)= MAP_BASE + (	iopte0- io mu->page_0[1],)e<< IO_PAGE@SHIFT);o 
 	ze'N_Smalize DVMA ain_urceR	l+/M @sgtmp = sg;M@@
n516,18 +516,18 y s 		e unsi;o 	}R 
-	(vma_base)= sg[0].dvma_ain_urcs& PAGE@MASK;o+	(vma_base)= sg[0].dvma_ain_urcs& IO_PAGE@MASK;o 	G_SM(ie=C0. i < net4s. i++)led 		ifI(sg[i].dvma_length ==I0 i 		7bnuxk;o 	}o 	i--;o-M ize =IPAGE@ALIGN	 g[i].dvma_ain_urcs+  g[i].dvma_length) -Idvma_base;o+	 ize =IIO_PAGE@ALIGN	 g[i].dvma_ain_urcs+  g[i].dvma_length) -Idvma_base;o   	io mu0= sdev->bus->io mu;
 	ypin_lock_irqsavy(&io mu->lock,Cflags);o-	Gree_st eaming_.o ster(io mu, dvma_base,  ize >>IPAGE@SHIFT);o-	st buK_flush(io mu, dvma_base,  ize >>IPAGE@SHIFT);o+	Gree_st eaming_.o ster(io mu, dvma_base,  ize >>IIO_PAGE@SHIFT);o+	st buK_flush(io mu, dvma_base,  ize >>IIO_PAGE@SHIFT);o 	ypin_unlock_irqe as
++(&io mu->lock,Cflags);o }o 
@@
n536,10 +536,10 y s 	y    cCsbus_io mu0*io mu0= sdev->bus->io mu;
 	@ vNRE_FGENERIflags;M M-M ize =I(PAGE@ALIGN	base)+y ize) -I(base)& PAGE@MASK));o+7 ize =I(IO_PAGE@ALIGN	base)+y ize) -I(base)& IO_PAGE@MASK));o 
 	ypin_lock_irqsavy(&io mu->lock,Cflags);o-	st buK_flush(io mu, base)& PAGE@MASK,  ize >>IPAGE@SHIFT);o+	st buK_flush(io mu, base)& IO_PAGE@MASK,  ize >>IIO_PAGE@SHIFT);o 	ypin_unlock_irqe as
++(&io mu->lock,Cflags);o }o 
@@
n550,16 +550,16 y s 	u32 base;d 	st40i;
 M-	base)= sg[0].dvma_ain_urcs& PAGE@MASK;o+	base)= sg[0].dvma_ain_urcs& IO_PAGE@MASK;o 	G_SM(ie=C0. i < net4s. i++)led 		ifI(sg[i].dvma_length ==I0 i 		7bnuxk;o 	}o 	i--;o-M ize =IPAGE@ALIGN	 g[i].dvma_ain_urcs+  g[i].dvma_length) -Ibase;o+	 ize =IIO_PAGE@ALIGN	 g[i].dvma_ain_urcs+  g[i].dvma_length) -Ibase;o   	ypin_lock_irqsavy(&io mu->lock,Cflags);o-	st buK_flush(io mu, base,  ize >>IPAGE@SHIFT);o+	st buK_flush(io mu, base,  ize >>IIO_PAGE@SHIFT);o 	ypin_unlock_irqe as
++(&io mu->lock,Cflags);o }o 
@@
n1123,14 +1123,14 y s 	C* i[1], (128KCiopteseE)8 byteseper-iopte).  TspR+pRs 	C* eage)orderF7 on Ul  aSpIG_.s 	C*/M-Mtsb_base)= __ge0_Gree_pages(GFP_ATOMIC, 7);M+7tsb_base)= __ge0_Gree_pages(GFP_ATOMIC, get_order	IO_TSB_SIZE));s 	if (tsb_base)== 0UL)l{  		e0xm_p - 1f
"sbus_io mu_init: Fataleerr_S, can_SOLa  de TSB 0[1],.\n");o 		e0xm_halt();o 	}R 
 	io mu->page_0[1], ||(iopte_tc*) tsb_base;M-	memset(io mu->page_0[1],, 0, (PAGE@SIZE)<< 7));M+7memset(io mu->page_0[1],, 0, IO_TSB_SIZE);o M 	@pa_writeq(eqn  Ne,yio mu->io mu_engsC+ IOMMU_t
@TROL);o ](MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gs unp	c $(CONFIG_SH_pIG_64RIG_SH_Gs unp	cP6 +35,9 @@
 #include <apIG_64RIG_SH_Gs unp	c	tup_Jul  3 17:08:19c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_Gs unp	c	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size'' CONFs unp	cthen
65G_MEfin6_T3G13:41:13Recd"$CONFI+ze'' CONFs unp	cthen
66G_MEfin9/20G00:35:31odurcm"$CONFI +	  $(CONFIG_SH_pIG_64RIG_SH_Gs unp	cP +	M +	  ey' CO.:6 2C1,1995,1996  Dav <cS. Mien+rc(durcm@caip.rutgers.edu)M@@
n500,10 +500,6Ry s 	rd_doload+=C((ram_flags+& RAMDISK_LOAD_FLAG) != 0);	s v)@ vNR 
-	ze'Dup_to stabiLa NREm N@Te asrictt *s and assumpct *s... 	/M-Minit_mm.mmap->vm_page_e0xt =IPAGE@SHARED;M-Minit_mm.mmap->vm_  
  +=IPAGE@OFFSET;M-Minit_mm.mmap->vm_ N" =IPAGE@OFFSETC+ hO.:est_pain_;
 Minit_task.thnuxd.kengsC= &fake_sw pper_engs;o o _ GzbH_t
@FIG_IP_PNPR(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_G mp	c $(CONFIG_SH_pIG_64RIG_SH_Gsmp	cP6 +35,9 @@
 #include <apIG_64RIG_SH_Gsmp	c	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_Gsmp	c	thu,
elN20G14:_1:57ble ch@@
n126,7 +126,6Ry s }s s 8  pF TES <csmp_s unp_percpu_ti/*r(ES <);o-8  pF TES <csmp_tune_schedu
 ig(ES <);o s 8  pF TESl pF 
+@ vNRE_FGENERIca  in_flag-=C0;o 
@@
n250,7 +249,6Ry s 	p - 1;
"EnteringdUl  aSMPenguin Mode...\n");o 	__  i();o 	smp_ss
++_cpu_info(boot_cpu_id); -	smp_tune_schedu
 ig();
 Minit_idle();o M 	sUR	
 ife_num_cpus ==I1)M@@
n702,7 +700,7 y s 		 N@Tcpu)=csmp_e0x20;
or_id();o M 		  
  +&= PAGE@MASK;o-		 N"   &= PAGE@MASK;o+		 N"    =IPAGE@ALIGN	 N");o M 		sUR	mm ==Ich/r N@->acttve_mm && atomic_nuxd(&mm->mm_u{
rs) ==I1)l{  			mm->cpu_vm_mask)=C(1UL << cpu);o@@
n1035,89R+1033,6Ry s 		p++;
 	}
 @e unsi base;M-}o- -cycles_tccacheflush_ti/*;o- -extern+@ vNRE_FGENERIcheetah_tune_schedu
 ig(ES <);o-o-8  pF TES <c__initcsmp_tune_schedu
 igC(ES <)
-{ -	@ vNRE_FGENERIoCO._flush_base, flush_base, flags,c*p; -	@ vNRE_FGst40 cache_ ize,-order; -	cycles_tcpF k1,cpF k2, raw;o- -	ze'Ape0xximate+heurispF TG_SMSMP schedu
 ig.  It+pR+an -	+	 estimatt *+ofgtse)ti/*+icCtakes+toFflush tse)L2ccache -	+	 ongild) dealee0x20;
or. -	+	 -	+	 Tseyia32 chooses+toFu{
 tse)L1ccacheFflush ti/*+instead, -	+	 and IPconsiderFtspR+complete _Snsense.  TseyUl  aecan {
rvice -	+	 a misR+toFild)L1cwithFa hOt+toFild)L2RSng7 or)8 cycles, and -	+	 L2RmisRes ~re wlattc	iate)ext aebus)  affi_ (ie. ild)"cost" -	+	 of moving)oCe0x20;
F
SK_SoneTcpu)toFa_SOher). -	+	/M-Mp - 1;
"SMP:)Ca ibratiERIecacheFflush... ");o-	if (tlb_type ==Icheetah)l{ -		cacheflush_ti/* =Icheetah_tune_schedu
 ig(); -		goto0rej-y ; -	}o- -	 cache_ ize0= p0xm_get- 1zbHault(
 ife_cpus[0].p0xm_node,
-			7	 " cache- ize", (512 * 1024));o-	if ( cache_ ize0> (4 * 1024 * 1024))o-		 cache_ ize0= (4 * 1024 * 1024);M-MoCO._flush_base0= flush_base0=o-		__ge0_Gree_pages(GFP_KERNEL, orderF= get_order	 cache_ ize));o- -	if (flush_base0!= 0UL)l{ -		__ urc_and_cli(flags);o- -		ze'Scan twice ild) ize0once just)toFget ild)TLB  N@riesd-		y* load_FGand makegsure ild) econ<cscan measuresepure misRes.d-		y*/M-		G_SM(p = 2@ vNRE_FGENERc*)flush_base;d-		yyyyy	t@ vNRE_FGENER p) < (flush_base0+ ( cache_ ize<<1));o-		yyyyype+=c(64 /) izeoft@ vNRE_FGENER ))o-			*((ESl pF 
+@ vNRE_FGENERI*)p);o- -		ze'Now)the0realemeasurem N@. 	/M-M	__asm__c__ESl pF 
__("M-		b,pt	%%xcc, 1fo-		yrd	%%pF k, %0o- -		.a NRE	64
-1:		ldx	[%2 + 0x000], %%g1 -		ldx	[%2 + 0x040], %%g2 -		ldx	[%2 + 0x080], %%g3 -		ldx	[%2 + 0x0c0], %%g5 -		ain	%2, 0x100, %2 -		cmp	%2, %4M-		bne,pt	%%xcc, 1bo-		ynop
-	o-		rd	%%pF k, %1"M-		: "=&r" (tF k1), "=&r" (tF k2), "=&r" (flush_base)M-		: "2" (flush_base), "r" (flush_base +  cache_ ize)M-		: "g1", "g2", "g3", "g5");o- -		__e as
++_flags(flags);o- -		rawe=C(tF k2 -cpF k1);o- -		ze'Dampen+icCa 
 tt],, considering 
woCe0x20;
esd-		y* sharing 
ld)eacheFand f tt ig.d-		y*/M-		cacheflush_ti/* =I(rawe-I(rawe>> 2));o- -		Gree_pages(oCO._flush_base, order);M-	}d l{
l{ -		cacheflush_ti/* =I(( cache_ ize0<< 2) +M-M 		on ( cache_ ize0<< 1));o-	}o-rej-y :M-Mp - 1;
"UcingdheurispF Tof %d cycles.\n",d-	yyyyyyy	- 1)ccacheflush_ti/*);o }o 
 ze'Gp0x2Gp0xt
 
+writesecan ca  FtspR, don'tc__initcitcplease. */M(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_G pIG_64_ksym
	c $(CONFIG_SH_pIG_64RIG_SH_GspIG_64_ksym
	cP6 +35,9 @@
 #include <apIG_64RIG_SH_GspIG_64_ksym
	c	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_GspIG_64_ksym
	c	Fri,
elNg7 _1:01:20G_MEfh@@
n1,4R(w44Ry size' CONFspIG_64_ksym
	cthen
108G_MEfin6_T5 03:39:50odurcm"$CONFI+ze' CONFspIG_64_ksym
	cthen
111G_MEfin8_30 03:22:00ckanoj"$CONFI +	  ($(COpIG_64RIG_SH_GspIG_64_ksym
	c: SpIG_64 Opecifi_ ksym
csobj-y .P +	M +	 ey' CO.:6 2C1,1996 Dav <cS. Mien+rc(durcm@caip.rutgers.edu)M@@
n163,7 +163,9 y s ze'Atomic counter implem N@att *	l+/M EXPORT_SYMBOL(__atomic_ain);o EXPORT_SYMBOL(__atomic_sub);M+_ GzbH_t
@FIG_SMPo EXPORT_SYMBOL(atomic_dec_and_lock);o+v)@ vNR 
 ze'Atomic bitcoperact *s.l+/M EXPORT_SYMBOL(___test_and_s u_bIG);M@@
n206,7 +208,6Ry s EXPORT_SYMBOL(ebus_ehain);o EXPORT_SYMBOL(isa_ehain);o EXPORT_SYMBOL(pci_memspac _mask);o-EXPORT_SYMBOL(empty_zero_page);o EXPORT_SYMBOL(outsb);o EXPORT_SYMBOL(outsw);o EXPORT_SYMBOL(outsl);o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gti/*	c $(CONFIG_SH_pIG_64RIG_SH_Gti/*	cP6 +35,9 @@
 #include <apIG_64RIG_SH_Gti/*	c	tup_Jul  3 17:08:19c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_Gti/*	c	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size' CONFti/*	cthen
39G_MEfin6_T8 02:33:37odurcm"$CONFI+ze' CONFti/*	cthen
40G_MEfin9/06 02:44:28odurcm"$CONFI +	 ti/*	c: Ul  aSpIG_ ti/*rFand TOD clockcsobj-y .P +	M +	 ey' CO.:6 2C1,1997 Dav <cS. Mien+rc(durcm@caip.rutgers.edu)M@@
n464,6R+464,7 y s 		 fI(strcmp(model, "mk48t02") &&o 		yyyystrcmp(model, "mk48t08") &&o 		yyyystrcmp(model, "mk48t59") &&o+		yyyystrcmp(model, "m5819") &&o 		yyyystrcmp(model, "ds1287"))l{  		yyy	 fI(node)i 		7	node+= p0xm_getsib
 ig(node);M@@
n509,12 +510,15 y s 				sUR	edev->p0xm_node ==Inode)i 		7		bnuxk;o 			sUR	edev0== NULL)led+				sUR	isa_ehain0!= NULL)s+					goto0try_isa_elock;  				e0xm_p - 1f
"%s: Mostek _SOLe0xbed by EBUS\n",d 					yyyy__FUNCTION__);  				e0xm_halt();o 			}R 
-			SUR	! trcmp(model, "ds1287"))l{ +			SUR	! trcmp(model, "ds1287") ||o+			on B!strcmp(model, "m5819"))l{  				ds1287_engsC= edev->e aource[0].  
  ;o 			}  l{
l{  				mstk48t59_engsC= edev->e aource[0].  
  ;o@@
n524,6R+528,7 y s 		}  l{
lsUR	isa_ehain0!= NULL)l{  			y    cCisa_device *isadev;o M+try_isa_elock:  			G_S_each_isadev(isadev,Cisa_br)s 				sUR	isadev->p0xm_node ==Inode)i 		7		bnuxk;o@@
n531,12 +536,14 y s 		7	p0xm_p - 1f
"%s: Mostek _SOLe0xbed by ISA\n");o 				e0xm_halt();o 			}R-			SUR	! trcmp(model, "ds1287"))l{ +			SUR	! trcmp(model, "ds1287") ||o+			on B!strcmp(model, "m5819"))l{  				ds1287_engsC= isadev->e aource.  
  ;o 			}  l{
l{  				mstk48t59_engsC= isadev->e aource.  
  ;o 				mstk48t02_engsC= mstk48t59_engsC+ MOSTEK_48T59_48T02;o 			}R+7		bnuxk;o 		}s v)@ vNR 		 l{
l{ (MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gtrampo$(Ce.S $(CONFIG_SH_pIG_64RIG_SH_Gtrampo$(Ce.SP6 +35,9 @@
 #include <apIG_64RIG_SH_Gtrampo$(Ce.S	thu,Apr 12 &2:10:25c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_Gtrampo$(Ce.S	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size' CONFtrampo$(Ce.Sthen
21G_MEfin4_T5 12:44:34odurcm"$CONFI+ze' CONFtrampo$(Ce.Sthen
22G_MEfin9/07o21:04:40ckanoj"$CONFI +	 trampo$(Ce.S:_JumpI  
  +slurcee0x20;
ors ongOpIG_64.P +	M +	 ey' CO.:6 2C1,1997 Dav <cS. Mien+rc(durcm@caip.rutgers.edu)M@@
n13,6R+13,7 y s vmaddr);
+R+G*page	chi vmaddr);
+R+G*pg0[1],.chi vmaddr);
+R+G*spitfiar	chi+vmaddr);
+R+G*p0x20;
or.chi vmaddr);
+R+G*asm_offsets	chi s 	.datae@@
n197,7 +198,7 y s 	membar		#Synci s 	mov		1, %g5 -	sllx		%g5,I(PAGE@SHIFT + 1), %g5 +	sllx		%g5,ITHREAD@SHIFT, %g5  	sub		%g5,I(REGWIN_SZC+ STACK_BIAS), %g5  	ain		%g6, %g5, %sps 	mov		0, %fp (MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64RIG_SH_Gtrap
	c $(CONFIG_SH_pIG_64RIG_SH_Gtrap
	cP6 +35,9 @@
 #include <apIG_64RIG_SH_Gtrap
	c	thu,Apr 12 &2:10:25c-aica.o
 
 ifeq ($(COpIG_64RIG_SH_Gtraps	c	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size' CONFtraps	cthen
76G_MEfin4_T3G13:46:31odurcm"$CONFI+ze' CONFtraps	cthen
78G_MEfin9/14 19:49:32ckanoj"$CONFI +	  ($(COpIG_64RIG_SH_Gtrap
	cP +	M +	 ey' CO.:6 2C1,1995,1997 Dav <cS. Mien+rc(durcm@caip.rutgers.edu)M@@
n31,6R+31,7 y s vmaddr);
+R+G*e8  p,.chi vmaddr);
+R+G*ehafsr.chi vmaddr);
+R+G*psrcompat	chi+vmaddr);
+R+G*p0x20;
or.chi vmGzbH_t
@FIG_KMODi vmaddr);
+
 ifeqkmod.chi v)@ vNR@@
n515,21G+516,6Ry s 			yyyyyyy"i" (ASI_PHYS_USE_EC));o }o 
-_ GzbH_t
@FIG_SMPo-@ vNRE_FGENERIcheetah_tune_schedu
 ig(ES <)
-{ -	@ vNRE_FGENERIpF k1,cpF k2, raw;o- -	__asm__c__ESl pF 
__("rd %%pF k, %0" : "=r" (tF k1));o-	cheetah_flush_ cache(); -	__asm__c__ESl pF 
__("rd %%pF k, %0" : "=r" (tF k2));o- -	rawe=C(tF k2 -cpF k1);o- -	e unsi (rawe-I(rawe>> 2));o-}R-v)@ vNR-
 ze'UnG_Stun p,ly, 
ld)diagnospF Tatalra+toFild)I-eacheFtags+we ne_FGtoM +	 u{
 to cleargtse)thing interferesewithFI-eacheFcoherencyFtransactt *s.P +	M@@
n1431,7 +1417,7 y s 	doled 		ze'Bogu
F
Same post4er?l+/M @	if (fp < (task_base)+y izeof(y    cCtask_st   c)) ||o-		yyyyfp >= (task_base)+y(2 * PAGE@SIZE)))o+		yyyyfp >= (task_base)+yTHREAD@SIZE) i 		7bnuxk;o 		rwe=C(y    cCeng_window)*)fp;o 		ec = ew->8ns[7];o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64Rlib/blockop
	S $(CONFIG_SH_pIG_64Rlib/blockop
	SP6 +35,9 @@
 #include <apIG_64Rlib/blockop
	S	thu,Apr 12 &2:10:25c-aica.o
 
 ifeq ($(COpIG_64Rlib/blockop
	S	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size' CONFblockop
	Sthen
31G_MEfin4_T5 11:08:12odurcm"$CONFI+ze' CONFblockop
	Sthen
35G_MEfin9/04G16:39:53ckanoj"$CONFI +	 blockop
	S: Ul  aSpIG_ block zero optimized rohtineR.P +	M +	 ey' CO.:6 2C1,1996s 1998,,1999,G_ME0 Dav <cS. Mien+rc(durcm@ar
hat.com)M@@
n23,6R+23,14 y s _defLi) TLBTEMP_ENT2	(620<< 3)s _defLi) TLBTEMP_ENTSZ	(10<< 3)s M+_ GI(PAGE@SHIFT ==I13) ||I(PAGE@SHIFT ==I19)np_defLi)yPAGE@SIZE_REM	0x80o+v)l GI(PAGE@SHIFT ==I16) ||I(PAGE@SHIFT ==I21)np_defLi)yPAGE@SIZE_REM	0x100o+v)lseo+v)rr_S0WrNERIPAGE@SHIFT Opecifiedo+v)@ vNR+d 	.t200i s 	.a NRE		32M@@
n35,7 +43,7 y s 	ain		%o1, 0x40, %o1s 	ldda		[%o1] ASI_BLK_P, %f16s 	ain		%o1, 0x40, %o1s-	sethi		%hi(8192), %o2 +	sethi		%hi(PAGE@SIZE), %o2  1:	TOUCH(f0, f2, f4, f6s f8,,f10, f12, f14)s 	ldda		[%o1] ASI_BLK_P, %f32M 	y da		%f48,,[%o0] ASI_BLK_Po@@
n53,13R+61,32 y s 	y da		%f48,,[%o0] ASI_BLK_Po 	sub		%o2, 0x40, %o2s 	ain		%o1, 0x40, %o1s-	cmp		%o2, 0x80o+	cmp		%o2, PAGE@SIZE_REMM 	bne,pt		%xcc, 1bo 	 ain		%o0, 0x40, %o0M+_ GI(PAGE@SHIFT ==I16) ||I(PAGE@SHIFT ==I21)np	TOUCH(f0, f2, f4, f6s f8,,f10, f12, f14)s+	ldda		[%o1] ASI_BLK_P, %f32M+	y da		%f48,,[%o0] ASI_BLK_Po+	ain		%o1, 0x40, %o1s+	sub		%o2, 0x40, %o2s+	ain		%o0, 0x40, %o0M+	TOUCH(f16s f18,,f20, f22, f24, f26s f28,,f30)s+	ldda		[%o1] ASI_BLK_P, %f0M+	y da		%f48,,[%o0] ASI_BLK_Po+	ain		%o1, 0x40, %o1s+	sub		%o2, 0x40, %o2s+	ain		%o0, 0x40, %o0M+	membar		#Synci+	y da		%f32,,[%o0] ASI_BLK_Po+	ain		%o0, 0x40, %o0M+	y da		%f0,,[%o0] ASI_BLK_Po+v)lseo 	membar		#Synci 	y da		%f0,,[%o0] ASI_BLK_Po 	ain		%o0, 0x40, %o0M 	y da		%f16s [%o0] ASI_BLK_Po+v)@ vNR 	membar		#Synci 	VISExit
 @e ul
@@
n73,7 +100,7 y s 	sub		%o0, %g4, %g1s 	and		%o2, %g3, %o0M 	yethi		%hi(TLBTEMP_BASE), %o3s-	sethi		%uhi(_PAGE@VALID), %g3 +	sethi		%uhi(_PAGE@VALID | _PAGE@SZBITS), %g3  	sub		%o1, %g4, %g2M 	yllx		%g3, 32, %g3  	mov		TLB_TAG_ACCESS, %o2s@@
n239,7 +266,7 y s 	ain		%o1, 0x40, %o1s 	ldda		[%o1] ASI_BLK_P, %f16s 	ain		%o1, 0x40, %o1s-	sethi		%hi(8192), %o2 +	sethi		%hi(PAGE@SIZE), %o2  1:	TOUCH(f0, f2, f4, f6s f8,,f10, f12, f14)s 	ldda		[%o1] ASI_BLK_P, %f32M 	y da		%f48,,[%o0] ASI_BLK_Po@@
n257,13R+284,32 y s 	y da		%f48,,[%o0] ASI_BLK_Po 	sub		%o2, 0x40, %o2s 	ain		%o1, 0x40, %o1s-	cmp		%o2, 0x80o+	cmp		%o2, PAGE@SIZE_REMM 	bne,pt		%xcc, 1bo 	 ain		%o0, 0x40, %o0M+_ GI(PAGE@SHIFT ==I16) ||I(PAGE@SHIFT ==I21)np	TOUCH(f0, f2, f4, f6s f8,,f10, f12, f14)s+	ldda		[%o1] ASI_BLK_P, %f32M+	y da		%f48,,[%o0] ASI_BLK_Po+	ain		%o1, 0x40, %o1s+	sub		%o2, 0x40, %o2s+	ain		%o0, 0x40, %o0M+	TOUCH(f16s f18,,f20, f22, f24, f26s f28,,f30)s+	ldda		[%o1] ASI_BLK_P, %f0M+	y da		%f48,,[%o0] ASI_BLK_Po+	ain		%o1, 0x40, %o1s+	sub		%o2, 0x40, %o2s+	ain		%o0, 0x40, %o0M+	membar		#Synci+	y da		%f32,,[%o0] ASI_BLK_Po+	ain		%o0, 0x40, %o0M+	y da		%f0,,[%o0] ASI_BLK_Po+v)lseo 	membar		#Synci 	y da		%f0,,[%o0] ASI_BLK_Po 	ain		%o0, 0x40, %o0M 	y da		%f16s [%o0] ASI_BLK_Po+v)@ vNR cy' _u{
r_page_eqn  ife:R 	membar		#Synci 	VISExit
@@
n286,7 +332,7 y s 	ain		%o1, 0x40, %o1s 	ldda		[%o1] ASI_BLK_P, %f16s 	ain		%o1, 0x40, %o1s-	sethi		%hi(8192), %o2 +	sethi		%hi(PAGE@SIZE), %o2  1:	TOUCH(f0, f2, f4, f6s f8,,f10, f12, f14)s 	ldda		[%o1] ASI_BLK_P, %f32M 	y da		%f48,,[%o0] ASI_BLK_COMMIT_Po@@
n304,14 +350,34 y s 	y da		%f48,,[%o0] ASI_BLK_COMMIT_Po 	sub		%o2, 0x40, %o2s 	ain		%o1, 0x40, %o1s-	cmp		%o2, 0x80o+	cmp		%o2, PAGE@SIZE_REMM 	bne,pt		%xcc, 1bo 	 ain		%o0, 0x40, %o0M+_ GI(PAGE@SHIFT ==I16) ||I(PAGE@SHIFT ==I21)np	TOUCH(f0, f2, f4, f6s f8,,f10, f12, f14)s+	ldda		[%o1] ASI_BLK_P, %f32M+	y da		%f48,,[%o0] ASI_BLK_COMMIT_Po+	ain		%o1, 0x40, %o1s+	sub		%o2, 0x40, %o2s+	ain		%o0, 0x40, %o0M+	TOUCH(f16s f18,,f20, f22, f24, f26s f28,,f30)s+	ldda		[%o1] ASI_BLK_P, %f0M+	y da		%f48,,[%o0] ASI_BLK_COMMIT_Po+	ain		%o1, 0x40, %o1s+	sub		%o2, 0x40, %o2s+	ain		%o0, 0x40, %o0M+	membar		#Synci+	y da		%f32,,[%o0] ASI_BLK_COMMIT_Po+	ain		%o0, 0x40, %o0M+	ba,pt		%xcc, cy' _u{
r_page_eqn  ifeM+	 y da		%f0,,[%o0] ASI_BLK_COMMIT_Po+v)lseo 	membar		#Synci 	y da		%f0,,[%o0] ASI_BLK_COMMIT_Po 	ain		%o0, 0x40, %o0M 	ba,pt		%xcc, cy' _u{
r_page_eqn  ifeM 	 y da		%f16s [%o0] ASI_BLK_COMMIT_Po+v)@ vNR 
 	.a NRE		32M 	.globl		_clear_pageo@@
n330,7 +396,7 y s 	sub		%o0, %g4, %g1s 	and		%o1, %g3, %o0M 	mov		TLB_TAG_ACCESS, %o2s-	sethi		%uhi(_PAGE@VALID), %g3 +	sethi		%uhi(_PAGE@VALID | _PAGE@SZBITS), %g3  	sethi		%hi(TLBTEMP_BASE), %o3s 	yllx		%g3, 32, %g3  	or		%g3, (_PAGE@CP | _PAGE@CV | _PAGE@P | _PAGE@L | _PAGE@W), %g3 @@
n364,7 +430,7 y s clear_page_eqmm *:R 	membar		#Ss
++Load+| #Ss
++Ss
+++| #LoadSs
++	! LSU	Groups 	fzero		%f0				! FPA	Groups-	mov		32, %o1				! IEU0M+	mov		PAGE@SIZE/256, %o1		! IEU0M 	fzero		%f2				! FPA	Groups 	faind		%f0,,%f2, %f4			! FPA	Groups 	fmuld		%f0,,%f2, %f6			! FPM
@@
n418,3R+484,4 y s o #unzbH_FIX_INSN1o #unzbH_FIX_INSN2s+#unzbH_PAGE@SIZE_REMM(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64Rmm/Hault	c $(CONFIG_SH_pIG_64Rmm/Hault	cP6 +35,9 @@
 #include <apIG_64Rmm/Hault	c	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeq ($(COpIG_64Rmm/Hault	c	Fri,
elNg7 _1:01:20G_MEfh@@
n1,4R(w44Ry size' CONFHault	cthen
55G_MEfin8_09G_M:18:43 durcm"$CONFI+ze' CONFHault	cthen
58G_MEfin9/01G00:_1:16ckanoj"$CONFI +	  ($(COpIG_64Rmm/Hault	c: Page)Hault handlerR G_SMtse)64-bIG SpIG_.s +	M +	 ey' CO.:6 2C1,1996 Dav <cS. Mien+rc(durcm@caip.rutgers.edu)M@@
n22,11 +22,58 y s vmaddr);
+R+G*opene0xm.chi vmaddr);
+R+G*oplib.chi vmaddr);
+R+G*uatalra	chi+vmaddr);
+R+G*asi	chi+vmaddr);
+R+G*lsu	chi s vdefLi)yELEMENTS(arr)R	8izeoGI(arr)/8izeoGI(arr[0]))R 
 extern+y    cCspIG__phys_banksCsp_banks[SPARC_PHYS_BANKS];R 
E/&_+eE)To debug IG_SH_ during sysca  F N@ry."	$(inpES <csysca  _trac _ N@ry(y    cCpt_engsC*engs)*+{ +	p - 1;
"sca  F N@ry: %s[%d]/cpu%d: %d\n",Ich/r N@->eqmm,Ich/r N@->pid,csmp_e0x20;
or_id(),y	- 1)cengs->u_engs[UREG_G1]);o+}np-E/&_+eE)To debug IG_SH_ during sysca  F xit."	$(inpES <csysca  _trac _ xit(y    cCpt_engsC*engs)*+{ +	p - 1;
"sca  F xit: %s[%d]/cpu%d: %d\n",Ich/r N@->eqmm,Ich/r N@->pid,csmp_e0x20;
or_id(),y	- 1)cengs->u_engs[UREG_G1]);o+}np-E/&_+eE)To debug IG_SH_ to catbhCatalraea+toFcertain0virtual/physiealeain_urceR	_+eE)Mode+= 0 selects physiealewatbhpost4s, mode+= 1 selects virtualewatbhpost4s	_+eE)flags+= VM_READewatbhea+memnuxdCatalraea,)flags+= VM_WRITE watbhea+memwriteCatalraea._+eE)Ca  er paraea+in0a)64bIG a NRE_FGain_, withFmask)set-to tse)byteseilattne_FGto be_+eE)watbhed. TspR+pR only u{
ful onga aing],Icpu)mabhine G_SMnow. AfterItse)watbhpost4_+eE)pR detrcted, 
ld)e0x20;
Fcaucingdi +wi  Fbe kien+d, 
lus pr venting)on+infinitd) dop."	$(inpES <cs u_brkpt2@ vNRE_FGENERcain_, @ vNRE_FGchar mask,-iSTBflags,ciSTBmode)i+{ +	@ vNRE_FGENERclsubIGse=CLSU_t
@TROL_IC|LSU_t
@TROL_DC|LSU_t
@TROL_IM|LSU_t
@TROL_DM;np-E	__asm__c__ESl pF 
__("stxa	%0,,[%1] %2\n\t"o+			on Bo"membar	#Sync"o+			on Bo: ze'_S0ou putsC*/M+			on Bo: "r" (ain_), "r" (mode+? VIRT_WATCHPOINTo: PHYS_WATCHPOINT),M+7		yyyyyyy"i" (ASI_DMMU));M+7lsubIGse|= 22@ vNRE_FGENER mask)<< (mode+? 25o: 33));M+7if (flags+& VM_READ)o+		lsubIGse|= 2mode+? LSU_t
@TROL_VRo: LSU_t
@TROL_PR);M+7if (flags+& VM_WRITE)o+		lsubIGse|= 2mode+? LSU_t
@TROL_VWo: LSU_t
@TROL_PW);M+7__asm__c__ESl pF 
__("stxa %0,,[%%g0] %1\n\t"o+			on Bo"membar #Sync"o+			on Bo: ze'_S0ou putsC*/M+			on Bo: "r" (lsubIGs), "i" (ASI_LSU_t
@TROL)M+			on Bo: "memory");o+}np- ze'Nice,  imple, p0xm  ibrary does ~  Ftse sweatiERIG_SMus. ;)l+/M @ vNRE_FGENERc__initcp0xm_p obe_memoryC(ES <)
0ed@@
n170,7 +217,7 y s 	@ vNRE_FGENERcg2;
 	@ vNRE_FGchar asie=CASI_P;
   -	if (!insn)M+7if ((!insn) && (engs->t8  p,+& TSTATE_PRIV))s 		goto0can_SO_handle;
 M 	ze'Ifgu{
r+insn couldFbe nuxdC(
lus insn pR zero),eilatM(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64Rmm/init	c $(CONFIG_SH_pIG_64Rmm/init	cP6 +35,9 @@
 #include <apIG_64Rmm/init	c	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeq ($(COpIG_64Rmm/init	c	thu,
elN20G_M:02:03ble ch@@
n1,4R(w44Ry size'' CONFinit	cthen
179G_MEfin8_08b0dc52:00cdurcm"$CONFI+ze'' CONFinit	cthen
189G_MEfin9/02 23:27:18ckanoj"$CONFI +	  IG_SH_pIG_64Rmm/init	cP +	M +	  ey' CO.:6 2C1,1996-1999 Dav <cS. Mien+rc(durcm@caip.rutgers.edu)M@@
n27,9 +27,11 y s vmaddr);
+R+G*io.chi vmaddr);
+R+G*uatalra	chi vmaddr);
+R+G* mu_eqnt200	chi-vmaddr);
+R+G*vain_a	chi vmaddr);
+R+G*dma.chi vmaddr);
+R+G*starfiar	chi+vmaddr);
+R+G*tlb.chip-E mu_gaOher_TBmmu_gaOhers[NR@CPUS];R 
 extern+ES <cdevice_scan(ES <);o s@@
n55,6R+57,8 y s extern+@ vNRE_FGiSTBspIG__ramdisk_image;o extern+@ vNRE_FGiSTBspIG__ramdisk_8ize;R 
Ey    cCpage)*mem_map_zero;np--iSTBdo_cb,ck_pgt_cache( STBnow,ciSTBhO.:)*led         iSTBfre_FG=C0;o@@
n130,28 +134,6Ry s 	}o }o 
-/&_-+	 BAD_PAGE pR 
ld)eage)ilattpR u{
dIG_SMpage)Haultsewhen 
 ife_-+	 pR out-of-memory. OlderFverst *s oGI
 ife just)d <ca_-+	 do_ xit(),ebut ucingdtspR+insteademeanR 
ldre pR l0;
Frisk_-+	 G_SMoCe0x20;
Fdying in IG_SH_ mode, porcibly leaving)on+inode_-+	 unu{
dIetc.._-+	_-+	 BAD_PAGETABLE pR 
ld)ataompanying page-0[1],:di +pR+initialized_-+	 to0post4 to0BAD_PAGE  N@ries._-+	_-+	 ZERO_PAGE pR a Opecialeeage)ilattpR u{
dIG_SMzero-initialized_-+	 data and COW._-+	/
-pte_tc__bad_page(ES <)
-{ -	memset((ES <c*) &empty_bad_page, 0, PAGE@SIZE); -	e unsi pte_mkdirty(mk_pte_phys((	t@ vNRE_FGENER  &empty_bad_page) 
-			7	- 22@ vNRE_FGENER &empty_zero_page)
-			7	+ phys_base),M-M 		on     PAGE@SHARED));o-}R-s ES <cshow_mem(ES <)
0ed 	p - 1;
"Mem-info:\n");o@@
n202,10 +184,10 y s 	y    cC
 ife_p0xm_translatt *+*trans;
 	@ vNRE_FGENERIphys_page, tte_vain_, tte_data;s 	ES <c(*enmap_func)2@ vNRE_FGENER, @ vNRE_FGENER,ciST);o-	pgd_tc*pgdp; -	pmd_tc*pmdp; +	pmd_tc*pmdp,c*pmd;s 	pte_tc*ptep;d 	st40node, n, i, tsz;o+	 xtern+@ vNRE_FGiSTBobp_iain__patbh[2],Bobp_dain__patbh[2];
 M 	node+= p0xm_finddevice("/virtual-memory");o 	n+= p0xm_getp0xplen(node, "translatt *s");o@@
n229,36R+211,39Ry s 	}o 	n+= n /) izeoft*trans);o s+	zeM+	 	 Tseyobp translatt *s ~re  urcd based ong8keeage ize,-cinceyobp can useM+	 	 a mixture oGIeage izes. Miraea+toF
ld)0xf0000000 - 0x100000000, ieyobp M+	 	 range, ~re handleFGiSF N@ry.S and do _SOLu{
 tse)vpte0scheme (see rantM+	 	 in+inldrit_locked_p0xm_@ ppingR()).M+	 	/np_defLi)yOBP_PMD@SIZEh2048np_defLi)yBASE_PAGE@SIZE)8192 +	pmd)= __a  de_bootmem(OBP_PMD@SIZE, OBP_PMD@SIZE, 0UL);o+	if (pmd)== NULL)s+		early_pg0[1],_a  defa
 ("pmd");M+7memset(pmd, 0, OBP_PMD@SIZE);o 	G_SM(ie=C0. i < n. i++)led 		@ vNRE_FGENERIvain_;
 M @	if (trans[i].virt >= 0xf0000000 && trans[i].virt < 0x100000000)l{  			G_SM(vain_)= trans[i].virt;s 			yyyyyvain_)< trans[i].virt + trans[i].8ize;R-			yyyyyvain_)+=cPAGE@SIZE)l{ +			yyyyyvain_)+=cBASE_PAGE@SIZE)l{  				@ vNRE_FGENERIval;
 M-				pgdp = pgd_offset(&init_mm,yvain_); -				sUR	pgd_none(*pgdp))l{ -			7	pmdp = __a  de_bootmem(PMD@TABLE@SIZE, -			7			on     PMD@TABLE@SIZE, -			7			on     0UL);o-			7	if (pmdp)== NULL)s-			7		early_pg0[1],_a  defa
 ("pmd");M-			7	memset(pmdp, 0, PMD@TABLE@SIZE);M-			7	pgd_set(pgdp, pmdp);M-			7} -				pmdp = pmd_offset(pgdp, vain_); +				pmdp = pmd + (	vain_)>> 23)h& 0x7ff);o 				if (pmd_none(*pmdp))l{ -			7	ptep = __a  de_bootmem(PTE_TABLE@SIZE, -			7			on     PTE_TABLE@SIZE, +			7	ptep = __a  de_bootmem(BASE_PAGE@SIZE, +			7			on     BASE_PAGE@SIZE,  			7			on     0UL);o 			7	if (ptep == NULL)s 			7		early_pg0[1],_a  defa
 ("pte");M-			7	memset(ptep, 0, PTE_TABLE@SIZE);o+					memset(ptep, 0, BASE_PAGE@SIZE);o 			7	pmd_set(pmdp, ptep);o 				} -				ptep = pte_offset(pmdp, vain_); +				ptep = (pte_tc*)pmd_page(*pmdp) +o+						(	vain_)>> 13)h& 0x3ff);o o 				vale=Ctrans[i].data;s 
@@
n267,10 +252,17 y s 		7		vale&= ~0x0003fe0000000000UL;
 M 				yet_pte (ptep, __pte(vale| _PAGE@MODIFIED));o-				trans[i].data)+= PAGE@SIZE;M+7			trans[i].data)+= BASE_PAGE@SIZE;o 			}R 		}R 	}R+7phys_page = __pa(pmd);M+7obp_iain__patbh[0]e|= 2phys_page >> 10);M+7obp_iain__patbh[1]e|= 2phys_page & 0x3ff);o+	flushi((ENER &obp_iain__patbh[0]);M+7obp_dain__patbh[0]e|= 2phys_page >> 10);M+7obp_dain__patbh[1]e|= 2phys_page & 0x3ff);o+	flushi((ENER &obp_dain__patbh[0]);M 
 	ze'N_w fixup OBP'R+idea aboutewhere we0really ~re @ pped. 	/M 	p0xm_p - 1f
"Re@ pping tse)IG_SH_... ");o@@
n295,7 +287,7 y s s 7phys_page &= _PAGE@PADDR;s 7phys_page += 22@ vNRE_FGENER &p0xm_boot_page -o-		yyyyy 2@ vNRE_FGENER &empty_zero_page);o+		yyyyy 2@ vNRE_FGENER KERNBASE);o M 	sUR	tlb_type ==Ispitfiar)led 		ze'Lock tspR+intoFi/d tlbF N@ry 59P*ne@@
n336,7 +328,7 y s 		BUG();o 	}R 
-	tte_vain_ = 2@ vNRE_FGENER  &empty_zero_page;M+7tte_vain_ = 2@ vNRE_FGENER  KERNBASE;M 
 	ze'Spitfiar Errata)#32 workaround 	/M 	__asm__c__ESl pF 
__("stxa	%0,,[%1] %2\n\t"o@@
n366,7 +358,7 y s 	enmap_func(	tlb_type ==Ispitfiar ?o 		yyyy(spitfiar_ge0_dtlb_data(spIG_64_hO.:est_locked_tlb N@()) & _PAGE@PADDR) :o 		yyyy(cheetah_ge0_litlb_data(spIG_64_hO.:est_locked_tlb N@()) & _PAGE@PADDR)),M-M yy 2@ vNRE_FGENER  &empty_zero_page,o+		yyy2@ vNRE_FGENER  KERNBASE,o 		yyyp0xm_get_ mu_ihandle());M 
 	ze'Flush outeilatttemporary @ pping.P*ne@@
n389,7 +381,7 y s 		@ vNRE_FGENERI ize0= trans[i].8ize;R M @	if (vain_)< 0xf0000000UL)l{ -			@ vNRE_FGENERcaES <_  
  +=I2@ vNRE_FGENER  &empty_zero_page;M+7		@ vNRE_FGENERcaES <_  
  +=I2@ vNRE_FGENER  KERNBASE;M 7		@ vNRE_FGENERcaES <_ N" =IaES <_  
  ++ (4 * 1024 * 1024);M o 			sUR	vain_)< aES <_  
  )0ed@@
n1048,7 +1040,7 y s 	 * 4MB locked)TLB translatt *.s 	C*/M 	  
  _pfn  =IPAGE@ALIGN	2@ vNRE_FGENER  &_ N") -o-		(2@ vNRE_FGENER  &empty_zero_page);o+		(2@ vNRE_FGENER  KERNBASE);M 
 	ze'Adjust up toF
ld)physiealeain_urcewhere tse)IG_SH_ beginR	l+/M @s 
  _pfn += phys_base;o@@
n1133,7 +1125,7 y s 	@ vNRE_FGENERcalias_base0= phys_base + PAGE@OFFSET;M 	@ vNRE_FGENERc econ<_alias_page = 0;
 	@ vNRE_FGENERIpt, flags,c N"_pfn,Ieage _ava
 ; -	@ vNRE_FGENERIshift0= a ias_base0- 22@ vNRE_FGENER &empty_zero_page); +	@ vNRE_FGENERcshift0= a ias_base0- 22@ vNRE_FGENER KERNBASE);M 	@ vNRE_FGENERcreal_ N";o   	y u_bIG(0,, mu_eqnt200_bmap);o@@
n1429,7 +1421,7 y s s 7ain_ = PAGE@OFFSETC+ phys_base;o 	last =IPAGE@ALIGN	2@ vNRE_FGENER &_ N") -o-		(2@ vNRE_FGENER  &empty_zero_page);o+		(2@ vNRE_FGENER  KERNBASE);M 	last += PAGE@OFFSETC+ phys_base;o 	n= ch (ain_)< last)led 		y u_bIG(__pa(ain_))>> 22,FspIG_64_val <_ain__bIGmap);o@@
n1441,7 +1433,20 y s 	max_@ pn_ = last_val <_pfn - 2phys_base0>>IPAGE@SHIFT);o 	hO.:_memoryC= __va(last_val <_pfn << PAGE@SHIFT);o M-Mnum_physpages ||Gree_a  _bootmem();o+	num_physpages ||Gree_a  _bootmem() - 1;np-E	zeM+	 	 Set up tse)zero page, markdi +_urerv+d, soeilatteage)countM+	 	 is _SOLmanipulat_FGwhen Greeing tse)page)H0xm u{
r+ptes.M+	 	/np	mem_map_zeroC= _a  de_pages(GFP_KERNEL, 0);o+	if (mem_map_zeroC== NULL)led+		p0xm_p - 1f
"paging_init: Can_SOLa  de zero page.\n");o+		e0xm_halt();o+	}R+7SetPageRurerv+d(mem_map_zero);o+	clear_page(page_ain_urc(mem_map_zero));np--	codepages ||((2@ vNRE_FGENER  &et200)0- 22@ vNRE_FGENER &_  
  ));o 	codepages ||PAGE@ALIGN	codepages  >>IPAGE@SHIFT;o 	datapages ||((2@ vNRE_FGENER  &edata)0- 22@ vNRE_FGENER &et200));o@@
n1455,7 +1460,7 y s 		 xtern+pgd_tcempty_pg_dir[1024];s 		@ vNRE_FGENERIain_ = 2@ vNRE_FGENER empty_pg_dir;s 		@ vNRE_FGENERIalias_base0= phys_base + PAGE@OFFSET -o-			(ENER (&empty_zero_page);o+			(ENER (KERNBASE);M 		M 		memset(empty_pg_dir, 0,  izeoftempty_pg_dir));o 		ain_)+=calias_base;o@@
n1477,16 +1482,20 y s s ES <cGree_initmemC(ES <)
0ed-	@ vNRE_FGENERIain_; +	@ vNRE_FGENERcain_, initdN";o  -	ain_ = 2@ vNRE_FGENER (&__init_begin);o-	G_SM(; ain_)< 2@ vNRE_FGENER (&__init_ N"); ain_)+=cPAGE@SIZE)l{ +	zeM+	 	 Tseyinitcsrctt * pR a NRE_FGtoF8k in+vm
 ife.ldR	lPage)a NREIG_SM>8keeage izes.M+	 	/np	ain_ = PAGE@ALIGN	2@ vNRE_FGENER (&__init_begin));o+	initdN" = 2@ vNRE_FGENER (&__init_ N") & PAGE@MASK;o+	G_SM(; ain_)< initdN"; ain_)+=cPAGE@SIZE)l{  		@ vNRE_FGENERIpage;o 		y    cCpage)*p;M o 		page = (ain_)+d 			(2@ vNRE_FGENER  __va(phys_base)) -o-			(2@ vNRE_FGENER  &empty_zero_page));o+			(2@ vNRE_FGENER  KERNBASE));o 		e = virt_to_page(page);M o 		ClearPageRurerv+d(p);o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64Rmm/modupF 	c $(CONFIG_SH_pIG_64Rmm/modupF 	cP6 +35,9 @@
 #include <apIG_64Rmm/modupF 	c	thu,Apr 12 &2:10:25c-aica.o
 
 ifeq ($(COpIG_64Rmm/modupF 	c	tue_Aug 28b0dc09:44ble ch@@
n1,4R(w44Ry size'' CONFmodupF 	cthen
8G_MEfin4_T4G00:49:39cdurcm"$CONFI+ze'' CONFmodupF 	cthen
9G_MEfin8_14bl2:10:56odurcm"$CONFI +	  IG_SH_pIG_64Rmm/modupF 	cP +	M +	  ey' CO.:6 2C1,1997,1998 Jakub Je$(Cek (jj@s@ vNte.mff.cuni.cz)M@@
n10,7 +10,10 y s i vmaddr);
+R+G*uatalra	chi vmaddr);
+R+G*system	chi-vmaddr);
+R+G*vain_a	chi+np_defLi)y MODULES_VADDR	0x0000000001000000ULL  ze'Where to @ pFmodules 	/np_defLi)y MODULES_LEN	0x000000007f000000ULLnp_defLi)y MODULES_END	0x0000000080000000ULLn s 8  pF Ty    cCvm_     cC*Fmodvm
 st =INULL;o ](MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64Rmm/ul  a	S $(CONFIG_SH_pIG_64Rmm/ul  a	SP6 +35,9 @@
 #include <apIG_64Rmm/ul  a	S	Sun Mar 25o18:14:21G_MEfa.o
 
 ifeq ($(COpIG_64Rmm/ul  a	S	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size' CONFul  a	Sthen
54G_MEfin3/22b0dc26:04odurcm"$CONFI+ze' CONFul  a	Sthen
57G_MEfin9/06 19:27:17ckanoj"$CONFI +	 ul  a	S: Don'tcexpand tsese ~  FoverItse)place...P +	M +	 ey' CO.:6 2C1,1997,G_ME0 Dav <cS. Mien+rc(durcm@ar
hat.com)M@@
n9,6R+9,7 y s vmaddr);
+R+G*pg0[1],.chi vmaddr);
+R+G*page	chi vmaddr);
+R+G*spitfiar	chi+vmaddr);
+R+G* mu_eqnt200	chi 
 	ze'Basieally, a  FtspR @ dnurcehaa+toFdo withFtses 	 * facteilattCheetah does _SOLsobj-y  IMMU flushese@@
n32,7 +33,7 y s 	.t200i 	.a NRE		32M 	.globl		__flush_tlb_page, __flush_tlb_mm,y__flush_tlb_range
-__flush_tlb_page: ze'%o0=(ctx & 0x3ff), %o1=page&PAGE@MASK, %o2=SECONDARY_t
@TEXT 	/np__flush_tlb_page: ze'%o0=(ctx & TAG_t
@TEXT_BITS), %o1=page&PAGE@MASK, %o2=SECONDARY_t
@TEXT 	/n zeIC1*/	BRANCH_IF_CHEETAH(g2,Fg3, __cheetah_flush_tlb_page)
0__spitfiar_flush_tlb_page:n zeIC2*/	ldxa		[%o2] ASI_DMMU, %g2M@@
n60,7 +61,7 y s 	 wrpr		%g5,I0x0, %p8  p,M 	nopM 	nopM-__flush_tlb_mm: ze'%o0=(ctx & 0x3ff), %o1=SECONDARY_t
@TEXT 	/np__flush_tlb_mm: ze'%o0=(ctx & TAG_t
@TEXT_BITS), %o1=SECONDARY_t
@TEXT 	/n zeIC5*/	BRANCH_IF_CHEETAH(g2,Fg3, __cheetah_flush_tlb_mm)
0__spitfiar_flush_tlb_mm:n zeIC6*/	ldxa		[%o1] ASI_DMMU, %g2M@@
n88,7 +89,7 y s 	entls 	 wrpr		%g5,I0x0, %p8  p,M 	nopM-__flush_tlb_range: ze'%o0=(ctx&0x3ff), %o1=  
  &PAGE@MASK, %o2=SECONDARY_t
@TEXT,np__flush_tlb_range: ze'%o0=(ctx&TAG_t
@TEXT_BITS), %o1=  
  &PAGE@MASK, %o2=SECONDARY_t
@TEXT,n 		yyyye'%o3=dN"&PAGE@MASK, %o4=PAGE@SIZE, %o5=	 N"0-   
  )n 		yyyye/n zeIC9*/	BRANCH_IF_CHEETAH(g2,Fg3, __cheetah_flush_tlb_range)M@@
n96,7 +97,7 y s _defLi) TLB@MAGIC	207 ze'Str);t4s, do you know how I ca culat_FGtspR?  -DaveM 	/n zeIC10*/cmp		%o5, %o4M 	bleu,pt		%xcc, __flush_tlb_paged-	ysrlx		%o5, 13, %g5 +	ysrlx		%o5, PAGE@SHIFT, %g5  	cmp		%g5,ITLB@MAGICM 	bgeu,pE		%icc, __spitfiar_flush_tlb_range_eqn  
nt_ti/*s 	 or		%o1, 0x10, %g5 @@
n124,18 +125,18 y s 	flush		%g6i 
 1:	ldxa		[%g2] ASI_ITLB_TAG_READ, %o4M-	and		%o4, 0x3ff, %o5np	and		%o4, TAG_t
@TEXT_BITS, %o5n 	cmp		%o5, %o0M 	bne,pt		%icc, 2fsizeIC13*/ andn		%o4, 0x3ff, %o4I+zeIC13*/ andn		%o4, TAG_t
@TEXT_BITS, %o4n 	cmp		%o4, %o1s 	blu,pt		%xcc, 2NR 	 cmp		%o4, %o3s 	blu,pn		%xcc, 4NR 2:	 ldxa		[%g2] ASI_DTLB_TAG_READ, %o4M-	and		%o4, 0x3ff, %o5np	and		%o4, TAG_t
@TEXT_BITS, %o5n 	cmp		%o5, %o0MizeIC14*/andn		%o4, 0x3ff, %o4I+zeIC14*/andn		%o4, TAG_t
@TEXT_BITS, %o4n 	bne,pt		%icc, 3NR 	 cmp		%o4, %o1s 	blu,pt		%xcc, 3fo@@
n302,7 +303,7 y s 	ynop
 
 flush_dcpage_eheetah:s-	sethi		%hi(8192), %o4 +	sethi		%hi(PAGE@SIZE), %o4
 1:	subcc		%o4, (10<< 5), %o4
 	stxa		%g0,,[%o0 + %o4] ASI_DCACHE_INVALIDATEo 	membar		#Synci@@
n387,14 +388,14 y s 	.globl		__update_mmu_eache  __update_mmu_eache:	ze'%o0=vma, %o1=ain_urc, %o2=pte +/M @ldub		[%g6R+ AOFF_task_thnuxdR+ AOFF_thnuxd_Hault_code], %o3s-	srlx		%o1, 13, %o1s+	srlx		%o1, PAGE@SHIFT, %o1s 	ldx		[%o0 + 0x0], %o4		ze'XXXCvma->vm_mm +/M @brz,pn		%o3, 1fo-	 yllx		%o1, 13, %o0 +	ysllx		%o1, PAGE@SHIFT, %o0s 	ldx		[%o4R+ AOFF_mm_eqnt200], %o5n 	andcc		%o3, FAULT_t
DE_DTLB, %g0M 	mov		%o2, %o1s-	and		%o5, 0x3ff, %o5np	and		%o5, TAG_t
@TEXT_BITS, %o5n 	bne,pt		%xcc, __prefLll_dtlbs 	 or		%o0, %o5, %o0M 	ba,a,pt		%xcc, __prefLll_itlb
@@
n440,13R+441,13Ry s 	entry
 
 xca  _flush_tlb_range:s-	sethi		%hi(8192 - 1), %g2M-	or		%g2, %lo(8192 - 1), %g2M+	sethi		%hi(PAGE@SIZE - 1), %g2M+	or		%g2, %lo(PAGE@SIZE - 1), %g2M 	andn		%g1, %g2, %g1s 	andn		%g7, %g2, %g7  	sub		%g7, %g1, %g3  	ain		%g2, 1, %g2M-	srlx		%g3, 13, %g4s+	srlx		%g3, PAGE@SHIFT, %g4n 	cmp		%g4, 96i 
 	bgu,pE		%icc, xca  _flush_tlb_mm](MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64Rsolaris/f
	c $(CONFIG_SH_pIG_64Rsolaris/f
	cP6 +35,9 @@
 #include <apIG_64Rsolaris/f
	c	Sun Febo18 19:49:54G_MEfa.o
 
 ifeq ($(COpIG_64Rsolaris/f
	c	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size' CONFfs	cthen
24G_MEfin2/13R01:16:44bdurcm"$CONFI+ze' CONFHs	cthen
25G_MEfin9/19G00:04:30odurcm"$CONFI +	 f
	c: fs relat_FGsysca  F mulatt *+G_SMSolarisP +	M +	 ey' CO.:6 2C1,1997,1998 Jakub Je$(Cek (jj@s@ vNte.mff.cuni.cz)M@@
n406,21G+406,21Gy s 	u32	f_fien+r[16];s };o  -8  pF TiN@Te j-y _  
tvfs(y    cCinode *inode, u32 buf)
Ey  pF TiN@Te j-y _  
tvfs(y    cCvfsmount *mnt, y    cCinode *inode, u32 buf)
l{  	y    cCs 
tfs s;d 	st40)rr_S;  	y    cCsol_  
tvfs *sse=C(y    cCsol_  
tvfs *)A(buf);o  -	)rr_S0=Cvfs_s 
tfs(inode->i_sb, &s);o+	)rr_S0=Cvfs_s 
tfs(mN@->mN@_sb, &s);o 	sUR	!)rr_S)l{ -		cqn  Gchar *e = inode->i_sb->s_type->name;M+7	cqn  Gchar *e = mN@->mN@_sb->s_type->name;M 		 N@Ti = 0;
 		 N@Tj)=cstrlen (p);M 		M 		sUR	j > 15)Tj)=c15;M 		sUR	IS_RDONLY(inode))Ti = 1;o-		sUR	IS_NOSUID(inode))Ti |= 2;M+7	if (mN@->mN@_flags+& MNT_NOSUID)Ti |= 2;M 		sUR	put_u{
rC(y.f_b ize,-&ss->f_b ize)		||n 		yyyy__put_u{
rC(0,-&ss->f_fr ize)		||n 		yyyy__put_u{
rC(y.f_blocks,-&ss->f_blocks)	||n@@
n440,21G+440,21Gy s 	entnsi )rr_S;  }o  -8  pF TiN@Te j-y _  
tvfs64(y    cCinode *inode, u32 buf)
Ey  pF TiN@Te j-y _  
tvfs64(y    cCvfsmount *mnt, y    cCinode *inode, u32 buf)
l{  	y    cCs 
tfs s;d 	st40)rr_S;  	y    cCsol_  
tvfs64 *sse=C(y    cCsol_  
tvfs64 *)A(buf);o 			 -	)rr_S0=Cvfs_s 
tfs(inode->i_sb, &s);o+	)rr_S0=Cvfs_s 
tfs(mN@->mN@_sb, &s);o 	sUR	!)rr_S)l{ -		cqn  Gchar *e = inode->i_sb->s_type->name;M+7	cqn  Gchar *e = mN@->mN@_sb->s_type->name;M 		 N@Ti = 0;
 		 N@Tj)=cstrlen (p);M 		M 		sUR	j > 15)Tj)=c15;M 		sUR	IS_RDONLY(inode))Ti = 1;o-		sUR	IS_NOSUID(inode))Ti |= 2;M+7	if (mN@->mN@_flags+& MNT_NOSUID)Ti |= 2;M 		sUR	put_u{
rC(y.f_b ize,-&ss->f_b ize)		||n 		yyyy__put_u{
rC(0,-&ss->f_fr ize)		||n 		yyyy__put_u{
rC(y.f_blocks,-&ss->f_blocks)	||n@@
n482,7 +482,7 y s 	)rr_S0=Cu{
r_path_walk((cqn  Gchar *)A(path),&N");o 	sUR	!)rr_S)l{  		y    cCinode *Cinode = nd.d N@ry->d_inode;o-		 rr_S0=Ce j-y _  
tvfs(inode, buf);o+		 rr_S0=Ce j-y _  
tvfs(nd.mnt, inode, buf);o 		path_release(&N");o 	}s 	entnsi )rr_S; @@
n496,7 +496,7 y s 	 rr_S0=C-EBADF;o 	Gi], ||fget(f");o 	sUR	Gi],)l{ -		 rr_S0=Ce j-y _  
tvfs(Gi],->f_d N@ry->d_inode, buf);o+		 rr_S0=Ce j-y _  
tvfs(Gi],->f_vfsmnt, Gi],->f_d N@ry->d_inode, buf);o 		fput	Gi],);o 	}R 
@@
n512,7 +512,7 y s 	)rr_S0=Cu{
r_path_walk((cqn  Gchar *)A(path), &N");o 	sUR	!)rr_S)l{  		y    cCinode *Cinode = nd.d N@ry->d_inode;o-		 rr_S0=Ce j-y _  
tvfs64(inode, buf);o+		 rr_S0=Ce j-y _  
tvfs64(nd.mnt, inode, buf);o 		path_release(&N");o 	}s 	unlock_IG_SH_();M@@
n528,7 +528,7 y s 	Gi], ||fget(f");o 	sUR	Gi],)l{  		lock_IG_SH_();M-		 rr_S0=Ce j-y _  
tvfs64(Gi],->f_d N@ry->d_inode, buf);o+		 rr_S0=Ce j-y _  
tvfs64(Gi],->f_vfsmnt, Gi],->f_d N@ry->d_inode, buf);o 		unlock_IG_SH_();M 		fput	Gi],);o 	}R(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64Rsolaris/misc	c $(CONFIG_SH_pIG_64Rsolaris/misc	cP6 +35,9 @@
 #include <apIG_64Rsolaris/misc	c	Sun Mar 25o18:14:21G_MEfa.o
 
 ifeq ($(COpIG_64Rsolaris/misc	c	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size' CONFmisc	cthen
32G_MEfin3/24 09:36:_1bdurcm"$CONFI+ze' CONFmisc	cthen
33G_MEfin9/18bl2:29:06odurcm"$CONFI +	 misc	c: MircelaneousGsysca  F mulatt *+G_SMSolarisP +	M +	 ey' CO.:6 2C1,1997,1998 Jakub Je$(Cek (jj@s@ vNte.mff.cuni.cz)M@@
n708,13R+708,14 y s extern+ENERcsolaris_to_
 ife_vNREals[],C
 ife_to_solaris_vNREals[];o s 8    cCexec_domain0solaris_exec_domain0=l{ -	"Solaris",d-	(lca  7_func)NULL,d-	1, 1,	ze'PER_SVR4 persoEalityy*/M-	solaris_to_
 ife_vNREals,d-	
 ife_to_solaris_vNREals,d-	THIS_MODULE,d-	NULLnp	name:		"Solaris",d+	handler:	NULL,d+	pers_low:	1,		ze'PER_SVR4 persoEalityy*/M+	pers_hO.::	1,s+	sNREal_map:	solaris_to_
 ife_vNREals,d+	sNREal_invmap:	
 ife_to_solaris_vNREals,d+	module:		THIS_MODULE,dp	next:		NULLn };o   extern+ N@Tinit_socksys(ES <);o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64Rsolaris/timod.c $(CONFIG_SH_pIG_64Rsolaris/timod.cP6 +35,9 @@
 #include <apIG_64Rsolaris/timod.c	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeq ($(COpIG_64Rsolaris/timod.c	thu,
elN20G14:_1:57ble ch@@
n1,4R(w44Ry size' CONFti/od.cthen
15G_MEfin8_13R18:56:_0odurcm"$CONFI+ze' CONFti/od.cthen
16G_MEfin9/18bl2:29:06odurcm"$CONFI +	 ti/od.cNFti/odF mulatt *.P +	M +	 ey' CO.:6 2C1,1998 Patrik Rak (prak3264@ss1000.ms.mff.cuni.cz)M@@
n699,7 +699,7 y s 	}o 	sUR	ctl_maxlen >= 0 && sock->pfirst)led 		y    cCT_p -msg *it =Isock->pfirst;o-		sSTBn = min( ST, ctl_maxlen, i@->length);M+7	iSTBn = min_t( ST, ctl_maxlen, i@->length);M 		SCHECK@MAGIC((char*)((u64)(((char *)&i@->type)+sock->offset+i@->length+7)&~7),MKCTL@MAGIC);M 		SOLD("purtiERIctl data");o 		if(cy' _to_u{
r	ctl_buf,o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFIG_SH_pIG_64Rvm
 ife.ldR $(CONFIG_SH_pIG_64Rvm
 ife.ldRP6 +35,9 @@
 #include <apIG_64Rvm
 ife.ldR	tup_Jul  3 17:08:19c-aica.o
 
 ifeq ($(COpIG_64Rvm
 ife.ldR	Fri,
elNg7 _1:01:20G_MEfh@@
n5,7 +5,6Ry s 
 SECTIONS
0ed-  empty_zero_page = 0x0000000000400000;
   sw pper_pmd_dir = 0x0000000000402000;
   empty_pg_dir = 0x0000000000403000;
   . = 0x4000;
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/block/mfmhd.c $(CONFdrivers/acorn/block/mfmhd.cP6 +35,9 @@
 #incldrivers/acorn/block/mfmhd.c	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeqdrivers/acorn/block/mfmhd.c	thu,
elN13R15:21:32G_MEf @@
n1210,6R+1210,8 y s s 7case BLKGETSIZE:o 		e unsi put_u{
rC(mfm[minor].nr_srcts,-(ENERI*)arg);o+	case BLKGETSIZE64:M+7	e unsi put_u{
rC((u64)mfm[minor].nr_srcts0<< 9,-(u64 *)arg);o s 7case BLKFRASET:M 		sUR	!cap[1],(CAP_SYS_ADMIN))M@@
n1311,15 +1313,13Ry s }n s 8  pF Ty    cCg)@ vsk mfm_g)@ vsk =l{ -	MAJOR_NR,		ze'Maj_SMnumb
rC*/M-	"mfm",			ze'Maj_SMname */M-	6,			ze'BIGsetocshift0tocgetcreal)H0xm pIGtitt *+*/M-	10<< 6,			ze'Numb
rCoGIeaGtitt *s percreal)*/M-	mfm,			ze'hdTy    cC*/M-	mfm_8izes,		ze'block 8izesC*/M-	0,			ze'numb
rC*/M-	(ES <c*) mfm_info,	ze'st4ernal)*/M-	NULL			ze'next 	/np	maj_S:		MAJOR_NR,np	maj_S_name:	"mfm",np	minor_shift:	6,np	max_p:		10<< 6,M+	paGt:		mfm,d+	sNzes:		mfm_8izes,d+	real_devices:	(ES <c*)mfm_info,n };o   8  pF Ty    cCblock_device_operact *s mfm_fops =o@@
n1450,10 +1450,7 y s 	blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);o 	nuxd_ahuxd[MAJOR_NR] =l8;	ze'8csrct_SM(4kB?) nuxdCahnuxdR+/M 
-_ GnzbH_MODULEM-	mfm_g)@ vsk.next =Cg)@ vsk_huxd;o-	g)@ vsk_huxd =C&mfm_g)@ vsk;R-v)@ vNRp	ain_g)@ vsk(&mfm_g)@ vsk);o s 7Busy = 0;
 	lastOpecifieddrive0=C-1;o@@
n1501,6R+1498,10 y s }s i vmfzbH_MODULEM+
+EXPORT_NO_SYMBOLS;o+MODULE_LICENSE("GPL");np--iSTBinit_module(ES <)
0ed 	e unsi mfm_init();M@@
n1512,6R+1513,7 y s 		outwC(0,-mfm_irqen[1],);	ze'Requir_FGtoFen[1], IRQs)H0xm MFM podule +/M @Gree_irq(mfm_irq, NULL);M 	@ regis4er_blkdev(MAJOR_NR, "mfm");o+	del_g)@ vsk(&mfm_g)@ vsk);o 	sUR	ecs)n 		ecard_release(ecs);o 	sUR	mfm_ain_)
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/char/{
rial-card.c $(CONFdrivers/acorn/char/{
rial-card.cP6 +35,9 @@
 #incldrivers/acorn/char/{
rial-card.c	Mon_
elN18R15:15:22G_ME0a.o
 
 ifeqdrivers/acorn/char/{
rial-card.c	thu,
elN13R15:21:32G_MEf @@
n126,5 +126,7 y s s EXPORT_NO_SYMBOLS;o o+MODULE_LICENSE("GPL");np--module_init(INIT);o module_ xit(EXIT);o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/net/e
ldr1.c $(CONFdrivers/acorn/net/e
ldr1.cP6 +35,9 @@
 #incldrivers/acorn/net/e
ldr1.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/acorn/net/e
ldr1.c	thu,
elN13R15:21:32G_MEf @@
n1102,3R+1102,5 y s s module_init(e
ldr1_init);o module_ xit(e
ldr1_ xit);np-+MODULE_LICENSE("GPL");n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/net/e
ldr3.c $(CONFdrivers/acorn/net/e
ldr3.cP6 +35,9 @@
 #incldrivers/acorn/net/e
ldr3.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/acorn/net/e
ldr3.c	thu,
elN13R15:21:32G_MEf @@
n938,3R+938,5 y s s module_init(e
ldr3_init);o module_ xit(e
ldr3_ xit);np-+MODULE_LICENSE("GPL");n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/net/e
ldrh.c $(CONFdrivers/acorn/net/e
ldrh.cP6 +35,9 @@
 #incldrivers/acorn/net/e
ldrh.c	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeqdrivers/acorn/net/e
ldrh.c	thu,
elN13R15:21:32G_MEf @@
n67,6R+67,7 y s s MODULE_AUTHOR("Russell KiER");o MODULE_DESCRIPTION("E
ldrH/E
ldrM driver");npMODULE_LICENSE("GPL");n   8  pF Tchar verst *[]c__initdata)=o 	"E
ldrH/E
ldrM DriverR	c)G_ME0 Russell KiER v1.08\n";n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/scsi/acornscsi.c $(CONFdrivers/acorn/scsi/acornscsi.cP6 +35,9 @@
 #incldrivers/acorn/scsi/acornscsi.c	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeqdrivers/acorn/scsi/acornscsi.c	thu,
elN13R15:21:32G_MEf @@
n1059,7 +1059,7 y s     /*d      * A  de p,+some bufferROpIce, limit_FGtoFhalf tse)bufferROized      */d-    length = min(@ vNRE_FGiST, hos@->scsi.SCp.tspR_residual, DMAC_BUFFER_SIZE / 2);np    length = min_t(@ vNRE_FGiST, hos@->scsi.SCp.tspR_residual, DMAC_BUFFER_SIZE / 2);n     iUR	length)0ed 	hos@->dma.s 
  _ain_ = ain_urce= hos@->dma.Gree_ain_;
 	hos@->dma.Gree_ain_e=C(hos@->dma.Gree_ain_e+ length)0& @@
n1187,7 +1187,7 y s     /*d      * A  de p,+some bufferROpIce, limit_FGtoFhalf tse)on-board RAMROized      */d-    length = min(@ vNRE_FGiST, hos@->scsi.SCp.tspR_residual, DMAC_BUFFER_SIZE / 2);np    length = min_t(@ vNRE_FGiST, hos@->scsi.SCp.tspR_residual, DMAC_BUFFER_SIZE / 2);n     iUR	length)0ed 	hos@->dma.s 
  _ain_ = ain_urce= hos@->dma.Gree_ain_;
 	hos@->dma.Gree_ain_e=C(hos@->dma.Gree_ain_e+ length)0& @@
n1656,8 +1656,8 y s 		+	 to0beyin operact * AFTERgtse)targetcleavea+message outephase.s 		+	/M @	acornscsi_sbic_issuecmd(hos@, CMND_ASSERTATN);M-		period =Cmax(@ vNRE_FGiST, message[3], sdtr_period / 4);M-		length = min(@ vNRE_FGiST, message[4], sdtr_ ize);o+		eeriod =Cmax_t(@ vNRE_FGiST, message[3], sdtr_period / 4);M+		length = min_t(@ vNRE_FGiST, message[4], sdtr_ ize);o 		msgqueue_ainmsg(&hos@->scsi.msgs, 5, EXTENDED_MESSAGE, 3,  			7 EXTENDED_SDTR, period, length);M 		hos@->device[hos@->SCpN@->target].sync_xferR=M@@
n3158,3R+3158,6 y s s module_init(acornscsi_init);o module_ xit(acornscsi_ xit);np-+MODULE_LICENSE("GPL");n+EXPORT_NO_SYMBOLS;o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/scsi/arxescsi.c $(CONFdrivers/acorn/scsi/arxescsi.cP6 +35,9 @@
 #incldrivers/acorn/scsi/arxescsi.c	thu,Febo'8c16:32:44ble ch.o
 
 ifeqdrivers/acorn/scsi/arxescsi.c	thu,
elN13R15:21:32G_MEf @@
n439,3R+439,4 y s module_init(init_arxe_scsi_driver);o module_ xit(exit_arxe_scsi_driver);o -+MODULE_LICENSE("GPL");n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/scsi/cumana_1.c $(CONFdrivers/acorn/scsi/cumana_1.cP6 +35,9 @@
 #incldrivers/acorn/scsi/cumana_1.c	thu,Febo'8c16:32:44ble ch.o
 
 ifeqdrivers/acorn/scsi/cumana_1.c	thu,
elN13R15:21:32G_MEf @@
n424,3R+424,6 y s s module_init(cumanascsi_init);o module_ xit(cumanascsi_ xit);np-+MODULE_LICENSE("GPL");n+EXPORT_NO_SYMBOLS;o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/scsi/cumana_2.c $(CONFdrivers/acorn/scsi/cumana_2.cP6 +35,9 @@
 #incldrivers/acorn/scsi/cumana_2	c	Fri,Mar  2R18:38:37ble ch.o
 
 ifeqdrivers/acorn/scsi/cumana_2.c	thu,
elN13R15:21:32G_MEf @@
n86,6R+86,7 y s MODULE_DESCRIPTION("Cumana SCSI II driver");n MODULE_PARM(term, "1-8i");n MODULE_PARM_DESC(term, "SCSI bus terminact *");npMODULE_LICENSE("GPL");n   /	M +	 U{
 term=0,1,0,0,0 toF
nsi terminacorR on/offo(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/scsi/ecoscsi.c $(CONFdrivers/acorn/scsi/ecoscsi.cP6 +35,9 @@
 #incldrivers/acorn/scsi/ecoscsi.c	thu,Febo'8c16:32:44ble ch.o
 
 ifeqdrivers/acorn/scsi/ecoscsi.c	thu,
elN13R15:21:32G_MEf @@
n292,3R+292,6 y s s module_init(ecoscsi_init);o module_ xit(ecoscsi_ xit);np-+EXPORT_NO_SYMBOLS;o+MODULE_LICENSE("GPL");n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/scsi/eesox.c $(CONFdrivers/acorn/scsi/eesox.cP6 +35,9 @@
 #incldrivers/acorn/scsi/eesox.c	Fri,Mar  2R18:38:37ble ch.o
 
 ifeqdrivers/acorn/scsi/eesox.c	thu,
elN13R15:21:32G_MEf @@
n602,3R+602,5 y s module_init(eesox_init);o module_ xit(eesox_ xit);n -+EXPORT_NO_SYMBOLS;o+MODULE_LICENSE("GPL");n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/scsi/fas216.c $(CONFdrivers/acorn/scsi/fas216.cP6 +35,9 @@
 #incldrivers/acorn/scsi/fas216.c	thu,Febo'8c16:32:44ble ch.o
 
 ifeqdrivers/acorn/scsi/fas216.c	thu,
elN13R15:21:32G_MEf @@
n2777,3R+2777,5 y s {s }s v)@ vNR+d+MODULE_LICENSE("GPL");n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/scsi/msgqueue.c $(CONFdrivers/acorn/scsi/msgqueue.cP6 +35,9 @@
 #incldrivers/acorn/scsi/msgqueue.c	thu,Febo'8c16:32:44ble ch.o
 
 ifeqdrivers/acorn/scsi/msgqueue.c	thu,
elN13R15:21:32G_MEf @@
n18,6R+18,7 y s s MODULE_AUTHOR("Russell KiER");o MODULE_DESCRIPTION("SCSI message queue handliER");opMODULE_LICENSE("GPL");n   /	M +	 Functt *:Ty    cCmsgqueue_ N@ry *mq,_a  de(MsgQueue_t *msgq)n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/scsi/oak.c $(CONFdrivers/acorn/scsi/oak.cP6 +35,9 @@
 #incldrivers/acorn/scsi/oak.c	thu,Febo'8c16:32:44ble ch.o
 
 ifeqdrivers/acorn/scsi/oak.c	thu,
elN13R15:21:32G_MEf @@
n285,3R+285,6 y s s module_init(oakscsi_init);o module_ xit(oakscsi_ xit);np-+MODULE_LICENSE("GPL");n+EXPORT_NO_SYMBOLS;o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/scsi/powertec.c $(CONFdrivers/acorn/scsi/powertec.cP6 +35,9 @@
 #incldrivers/acorn/scsi/powertec.c	Fri,Mar  2R18:38:37ble ch.o
 
 ifeqdrivers/acorn/scsi/powertec.c	thu,
elN13R15:21:32G_MEf @@
n81,6R+81,7 y s MODULE_DESCRIPTION("Powertec SCSI driver");n MODULE_PARM(term, "1-8i");n MODULE_PARM_DESC(term, "SCSI bus terminact *");npMODULE_LICENSE("GPL");n   8  pF Ty    cCexpanst *_card *ecs[MAX_ECARDS];R 
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acorn/scsi/queue.c $(CONFdrivers/acorn/scsi/queue.cP6 +35,9 @@
 #incldrivers/acorn/scsi/queue.c	Fri,Febo'9 _1:30:22G_MEch.o
 
 ifeqdrivers/acorn/scsi/queue.c	thu,
elN13R15:21:32G_MEf @@
n27,6R+27,7 y s s MODULE_AUTHOR("Russell KiER");o MODULE_DESCRIPTION("SCSI eqmmand queueiER");opMODULE_LICENSE("GPL");n   _defLi) DEBUGR 
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acpi/Maket
 
+$(CONFdrivers/acpi/Maket
 
P6 +35,9 @@
 #incldrivers/acpi/Maket
 
	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/acpi/Maket
 
	Sat,
elNg8o_2:26:47ble ch@@
n38,9 +38,8 y s obj-$(CONFIG_ACPI)	+= $(foreach dir,$(acpi-subdirs),$(dir)/$(dir).o)   mfzbH_CONFIG_ACPI_KERNEL_CONFIGn    obj-$(CONFIG_ACPI) 	+= acpiconf.o osconf.o
-)lseo-   obj-$(CONFIG_ACPI)	+= driver.o
 )@ vNR+obj-$(CONFIG_ACPI)	+= driver.o
   mfeq ($(CONFIG_ACPI_BUSMGR),y)n 	obj-y	7	+= ospm/ospm.o
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acpi/maddr);/platform/acgcc.h $(CONFdrivers/acpi/maddr);/platform/acgcc.hP6 +35,9 @@
 #incldrivers/acpi/maddr);/platform/acgcc.h	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/acpi/maddr);/platform/acgcc.h	Sat,
elNg1 _1:01:28ble ch@@
n39,7 +39,6 y s _defLi)yBREAKPOINT3s _defLi)ydis[1],(  __cli()s _defLi)yen[1],(   __sti()s-_defLi)ywbinvd()n   /	! [Begin]'_S0source)code translatt *+*/R 
@@
n101,7 +100,6 y s _defLi)ydis[1],(  __cli()s _defLi)yen[1],(   __sti()s _defLi)yhalt()yyyy__asm__c__ESl pF 
__ ("sti; hlt":::"memory")s-_defLi)ywbinvd()n   /	! [Begin]'_S0source)code translatt *P +	M(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acpi/os.c $(CONFdrivers/acpi/os.cP6 +35,9 @@
 #incldrivers/acpi/os.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/acpi/os.c	thu,
elN13R16:04:43 _MEf @@
n156,7 +156,14 y s 	}o M 	sUR	2@ vNRE_FGENER  phys < virt_to_phys(hO.:_memory))led+		y    cCpage)*page;o 		*virt = phys_to_virt	2@ vNRE_FGENER  phys);M+	d+		/*tCheck+G_SM8  mping */M+		page = virt_to_page(*virt);M+7	if(page && !test_bIG(PG__urerv+d, &page->flags))M+			p - 1;
KERN_WARNING "ACPI attemptiERItoCatalra)IG_SH_ owE_FGmemoryCat,%08lX.\n",I2@ vNRE_FGENER phys);M+o 		e unsi AE_OK;o 	}R 
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acpi/ospm/ac_adapter/ac_osl.c $(CONFdrivers/acpi/ospm/ac_adapter/ac_osl.cP6 +35,9 @@
 #incldrivers/acpi/ospm/ac_adapter/ac_osl.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/acpi/ospm/ac_adapter/ac_osl.c	thu,
elN13R16:04:43 _MEf @@
n35,6R+35,7 y s s MODULE_AUTHOR("Andrew Grover");n MODULE_DESCRIPTION("ACPI Compon N@ Architrcture (CA)0- AC Adapter Driver");opMODULE_LICENSE("GPL");n   s _defLi)yAC_PROC_ROOT		"ac_adapter"
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acpi/ospm/battery/bt_osl.c $(CONFdrivers/acpi/ospm/battery/bt_osl.cP6 +35,9 @@
 #incldrivers/acpi/ospm/battery/bt_osl.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/acpi/ospm/battery/bt_osl.c	thu,
elN13R16:04:43 _MEf @@
n44,6 +44,7 y s s MODULE_AUTHOR("Andrew Grover");n MODULE_DESCRIPTION("ACPI Compon N@ Architrcture (CA)0- CoN@rol Method Battery Driver");opMODULE_LICENSE("GPL");n   s _defLi)yBT_PROC_ROOT		"battery"
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acpi/ospm/busmgr/Maket
 
+$(CONFdrivers/acpi/ospm/busmgr/Maket
 
P6 +35,9 @@
 #incldrivers/acpi/ospm/busmgr/Maket
 
	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/acpi/ospm/busmgr/Maket
 
	Sun 
elNg2b0dc48:02G_MEf @@
n1,3R+1,5 y s+export-objs	:= bm_osl.oM+o O_TARGET	:= ospm_$(notdir $(CURDIR)).o
 obj-m		:= $(O_TARGET)s EXTRA_CFLAGS	+= $(ACPI_CFLAGS)
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acpi/ospm/busmgr/bm_osl.c $(CONFdrivers/acpi/ospm/busmgr/bm_osl.cP6 +35,9 @@
 #incldrivers/acpi/ospm/busmgr/bm_osl.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/acpi/ospm/busmgr/bm_osl.c	thu,
elN13R16:04:43 _MEf @@
n37,6R+37,7 y s s MODULE_AUTHOR("Andrew Grover");n MODULE_DESCRIPTION("ACPI Compon N@ Architrcture (CA)0- ACPI Bus Manager");opMODULE_LICENSE("GPL");n   s _mfzbH_ACPI_DEBUGR(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acpi/ospm/button/bn_osl.c $(CONFdrivers/acpi/ospm/button/bn_osl.cP6 +35,9 @@
 #incldrivers/acpi/ospm/button/bn_osl.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/acpi/ospm/button/bn_osl.c	thu,
elN13R16:04:43 _MEf @@
n35,6R+35,7 y s s MODULE_AUTHOR("Andrew Grover");n MODULE_DESCRIPTION("ACPI Compon N@ Architrcture (CA)0- Button Driver");opMODULE_LICENSE("GPL");n   s _defLi)yBN_PROC_ROOT		"button"
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acpi/ospm/ec/ec_osl.c $(CONFdrivers/acpi/ospm/ec/ec_osl.cP6 +35,9 @@
 #incldrivers/acpi/ospm/ec/ec_osl.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/acpi/ospm/ec/ec_osl.c	thu,
elN13R16:04:43 _MEf @@
n36,6R+36,7 y s s MODULE_AUTHOR("Andrew Grover");n MODULE_DESCRIPTION("ACPI Compon N@ Architrcture (CA)0- Embedd_FGCoN@roller Driver");opMODULE_LICENSE("GPL");n   _mfzbH_ACPI_DEBUGR 
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acpi/ospm/e0x20;
or/e0_osl.c $(CONFdrivers/acpi/ospm/e0x20;
or/e0_osl.cP6 +35,9 @@
 #incldrivers/acpi/ospm/e0x20;
or/e0_osl.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/acpi/ospm/e0x20;
or/e0_osl.c	thu,
elN13R16:04:43 _MEf @@
n36,6R+36,7 y s s MODULE_AUTHOR("Andrew Grover");n MODULE_DESCRIPTION("ACPI Compon N@ Architrcture (CA)0- IA32 P0x20;
or Driver");opMODULE_LICENSE("GPL");n   s _defLi)yPR_PROC_ROOT		"e0x20;
or"
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acpi/ospm/system/sm_osl.c $(CONFdrivers/acpi/ospm/system/sm_osl.cP6 +35,9 @@
 #incldrivers/acpi/ospm/system/sm_osl.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/acpi/ospm/system/sm_osl.c	thu,
elN13R16:04:43 _MEf @@
n38,6R+38,7 y s s MODULE_AUTHOR("Andrew Grover");n MODULE_DESCRIPTION("ACPI Compon N@ Architrcture (CA)0- ACPI System Driver");opMODULE_LICENSE("GPL");n   s _defLi)ySM_PROC_INFO		"info"
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/acpi/ospm/
ldrmal/tz_osl.c $(CONFdrivers/acpi/ospm/
ldrmal/tz_osl.cP6 +35,9 @@
 #incldrivers/acpi/ospm/
ldrmal/tz_osl.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/acpi/ospm/
ldrmal/tz_osl.c	thu,
elN13R16:04:43 _MEf @@
n35,6R+35,7 y s s MODULE_AUTHOR("Andrew Grover");n MODULE_DESCRIPTION("ACPI Compon N@ Architrcture (CA)0- Tldrmal Zoi) Driver");opMODULE_LICENSE("GPL");n   iSTBTZP = 0;
 MODULE_PARM(TZP, "i");n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/atm/Maket
 
+$(CONFdrivers/atm/Maket
 
P6 +35,9 @@
 #incldrivers/atm/Maket
 
	Mon_Mar 26R15:36:30o-aica.o
 
 ifeqdrivers/atm/Maket
 
	Mon_Aug 27o09:01:33 _MEf @@
n25,6R+25,7 y s obj-$(CONFIG_ATM_AMBASSADOR))+=cambassador.o
 obj-$(CONFIG_ATM_TCP))+=catmtcp.o
 obj-$(CONFIG_ATM_IA))+=ciphase.o suni.oR+obj-$(CONFIG_ATM_FIRESTREAM))+=cfiarstream.o
   mfeq ($(CONFIG_ATM_FORE_MEE_PCA),y)n   FORE_MEE_FW_OBJS)+=cfore_MEe_pca_fw.o
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/atm/ambassador.c $(CONFdrivers/atm/ambassador.cP6 +35,9 @@
 #incldrivers/atm/ambassador.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/atm/ambassador.c	thu,
elN13R15:21:32G_MEf @@
n297,16 +297,16 y s _defLi)yUt
DE2(x) #xs _defLi)yUt
DE1(x,y)yUt
DE2(x ## y)n  -8  pF Tcqn  Gu32 __initdata)ucode_  
  +=I
Ey  pF Tu32 __initdata)ucode_  
  +=I
 vmaddr);
Ut
DE(  
  )n ;n  -8  pF Tcqn  Gregion___initdata)ucode_regions[] =l{ Ey  pF Tregion___initdata)ucode_regions[] =l{  vmaddr);
Ut
DE(regions)n   { 0, 0 }s };n  -8  pF Tcqn  Gu32 __initdata)ucode_data[] =l{ Ey  pF Tu32 __initdata)ucode_data[] =l{  vmaddr);
Ut
DE(data)n   0xdeadbeefs };n@@
n2585,6R+2585,7 y s s MODULE_AUTHOR(maintainer_   ing);n MODULE_DESCRIPTION(descriptt *_   ing);npMODULE_LICENSE("GPL");n MODULE_PARM(debug,   "h");n MODULE_PARM(cmds,    "i");n MODULE_PARM(txs,     "i");n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/atm/ambassador.h 
 ifeqdrivers/atm/ambassador.hP6 +35,9 @@
 #incldrivers/atm/ambassador.h	Mon_Dec 11N13:22:06o_ME0a.o
 
 ifeqdrivers/atm/ambassador.h	thu,
elN13R15:21:32G_MEf @@
n664,9 +664,9 y s   @ vNRE_FGiSTBcount;  }Tregion;n  -extern+cqn  Gregion_ucode_regions[]; -extern+cqn  Gu32 ucode_data[]; -extern+cqn  Gu32 ucode_  
  ; Ey  pF Tregion_ucode_regions[]; Ey  pF Tu32 ucode_data[]; Ey  pF Tu32 ucode_  
  ;    /	 r p,+rounding */M n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/atm/atmtcp.c $(CONFdrivers/atm/atmtcp.cP6 +35,9 @@
 #incldrivers/atm/atmtcp.c	Fri,Dec 29G14:35:47ble 0a.o
 
 ifeqdrivers/atm/atmtcp.c	thu,
elN13R15:21:32G_MEf @@
n420,6R+420,7 y s 	atm_tcp_ops.remove_persis4ent =INULL;o }o -+MODULE_LICENSE("GPL");n #)lseo s 8    cCatm_tcp_opsCatm_tcp_opsC=l{ (MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/atm/eni.c $(CONFdrivers/atm/eni.cP6 +35,9 @@
 #incldrivers/atm/eni.c	W_FGMayR16 10:22:50o-aica.o
 
 ifeqdrivers/atm/eni.c	Fri,
elN14G14:40:00G_MEfh@@
n32,7 +32,7 y s vmaddr);
"suni.h"s vmaddr);
"eni.h"s 
-_ GnzbH___i386__i+vmf !defLi)d(__i386__) && !defLi)d(__x86_64__)  _mfnzbH_ioenmap_noeache  _defLi)yioenmap_noeache(X,Y)yioenmap(X,Y)s v)@ vN 
@@
n2340,3R+2340,6 y s s module_init(eni_init);o module_ xit(eni_cleanup);np-+EXPORT_NO_SYMBOLS;o+MODULE_LICENSE("GPL");n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/atm/fiarstream.c $(CONFdrivers/atm/fiarstream.cP6 +35,9 @@
 #incldrivers/atm/fiarstream.c	W_FGApr 11 19:02:30o-aica.o
 
 ifeqdrivers/atm/fiarstream.c	thu,
elN13R15:21:32G_MEf @@
n271,11 +271,11 y s s    150000 packets perc econ< pR close toF
ld)limit a PC pR goiERItoChaved    anyway. We tsereforeChave+toFdis[1],FtspR G_SMe0xductt *.CH) REW */d-#unzbH_IRQ_RATE_LIMIT 100a.#unzbH_IRQ_RATE_LIMIT // 100a   /	 It4errupts work now. Unlike {
rial cards, ATM cards don'tcwork alld    ilattgreat withouteit4errupts.CH) REW */d-#unzbH_FS_POLL_FREQ 100a.#unzbH_FS_POLL_FREQ // 100a   /	 d    TspR driver can spew a who 
+$otCoGIdebugging outpucCat you. If you @@
n1928,8 +1928,6 y s s  )rr_out_Gree_atm_dev:s 	atm_dev_deregis4er(atm_dev);M- )rr_out_Gree_fs_dev:s-	kGree(fs_dev);n  )rr_out:d 	e unsi -EN
DEV;o }o@@
n2120,3R+2118,5 y s module_init(fiarstream_init_module);o module_ xit(fiarstream_cleanup_module);o -+MODULE_LICENSE("GPL");n+EXPORT_NO_SYMBOLS;o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/atm/fiarstream.h 
 ifeqdrivers/atm/fiarstream.hP6 +35,9 @@
 #incldrivers/atm/fiarstream.h	W_FGApr 11 19:02:30o-aica.o
 
 ifeqdrivers/atm/fiarstream.h	Sat,
elNg8o_2:28:14G_MEfh@@
n345,18 +345,28 y s _defLi)yCELLOSCONF_COSTyyy20x10<<  0)  /	 BIGs?R+/M 
-s _defLi)yRAS0 0x1bcs _defLi)yRAS0_DCD_XHLTy20x10<< 31)  s _defLi)yRAS0_VPSEL yyy20x10<< 16)s _defLi)yRAS0_VCSEL yyy20x10<<  0)  np_defLi)yRAS1 0x1c0np_defLi)yRAS1_UTREG yyy20x10<< 5)M+o   _defLi) DMAMR 0x1cc  _defLi) DMAMR_TX_MODE_FULL 20x00<< 0)  _defLi) DMAMR_TX_MODE_PARTy20x10<< 0)  _defLi) DMAMR_TX_MODE_NONEy20x20<< 0) /	 An< 3 */M+M+M+M+_defLi)yRAS2 0x280M+M+_defLi)yRAS2_NNI y20x10<< 0) +_defLi)yRAS2_USEL 20x10<< 1) +_defLi)yRAS2_UBS y20x10<< 2)n   s o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/atm/fore_MEe.c $(CONFdrivers/atm/fore_MEe.cP6 +35,9 @@
 #incldrivers/atm/fore_MEe.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/atm/fore_MEe.c	thu,
elN13R15:21:32G_MEf @@
n3000,3R+3000,5 y s v)@ vNR     {}s };n+o+MODULE_LICENSE("GPL");n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/atm/horiz *.c $(CONFdrivers/atm/horiz *.cP6 +35,9 @@
 #incldrivers/atm/horiz *.c	Fri,Dec 29G14:35:47ble 0a.o
 
 ifeqdrivers/atm/horiz *.c	thu,
elN13R15:21:32G_MEf @@
n2935,6R+2935,7 y s s MODULE_AUTHOR(maintainer_   ing);n MODULE_DESCRIPTION(descriptt *_   ing);npMODULE_LICENSE("GPL");n MODULE_PARM(debug, "h");n MODULE_PARM(vpi_bIGs, "h");n MODULE_PARM(max_tx_ ize,-"h");n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/atm/idt77105.c $(CONFdrivers/atm/idt77105.cP6 +35,9 @@
 #incldrivers/atm/idt77105.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/atm/idt77105.c	thu,
elN13R15:21:32G_MEf @@
n374,9 +374,7 y s             }
         }
 
-_ GzbH_MODULEM 	MOD_DEC_USE_COUNT;R-v)@ vN /	 MODULE+	/M @e unsi 0;o }o -@@
n384,6R+382,8 y s s EXPORT_SYMBOL(idt77105_init);o EXPORT_SYMBOL(idt77105_stop);np-+MODULE_LICENSE("GPL");n i vmfzbH_MODULEM o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/atm/iphase.c $(CONFdrivers/atm/iphase.cP6 +35,9 @@
 #incldrivers/atm/iphase.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/atm/iphase.c	Mon_
elN17bl2:52:34ble ch@@
n1,6R+1,7 y s /******************************************************************************s          iphase.c:,Device driver G_SMIt4erphase ATM PCI adapter cards s                     Author: Peter Wang  <pwang@iphase.com>            M+		   Some fixes: Arnaldo CarvalhoFde Melo <acme@conrcttva.com.br>s                    It4erphase Corporact *  <www.iphase.com>           s                                Verst *: 1.0                           
 *******************************************************************************s@@
n79,7 +80,7 y s s y  pF TIADEV *ia_dev[8];R 8  pF Ty    cCatm_dev *_ia_dev[8];R-8  pF TiN@Tiadev_count = 0;
+8  pF TiN@Tiadev_count;R 8  pF TES <cia_led_ti/*r(@ vNRE_FGENERcarg);o 8  pF Ty    cCti/*r_
 st ia_ti/*rC=l{ functt *:Tia_led_ti/*r };n y    cCatm_vcc *vcc_close_que[100];M@@
n96,6 +97,8 y s MODULE_PARM(IADebugFlag, "i");n v)@ vNR o+MODULE_LICENSE("GPL");np--vmf BITS_PER_LONG != 32M #  )rr_S FIXME:FtspR driver onlycworkR on 32-bIG platformsn v)@ vNR@@
n121,8 +124,7 y s }n s 8  pF TiN@Tia_enque_rtn_q (IARTN_Q *que, y    cCdesc_tbl_t data)0ed-   IARTN_Q * N@ry;d-    N@ry = (IARTN_Q *)kma  de( izeoftIARTN_Q), GFP_KERNEL);np   IARTN_Q * N@ry = kma  de( izeoft* N@ry), GFP_KERNEL);n    iUR	! N@ry) e unsi -1;n     N@ry->data)= data;n     N@ry->next =CNULL;o@@
n429,7 +431,7 y s        iUR	srv_p->rdf > MAX_RDF)n 	  e unsi INVALID_RDF;n v)@ vNR-       memset ((cain__t)f_abr_vc, 0,  izeoftf_vc_abr_ N@ry));np       memset ((cain__t)f_abr_vc, 0,  izeoft*f_abr_vc));n        f_abr_vc->f_vc_type =CABR;n        nrm =C20<< srv_p->nrm;     /* (2 **R	srv_p->nrm +1))+	/M @		          ze's.e 2**n =C20<< (n-1)+	/M@@
n544,7 +546,7 y s       TstSchedTbl = 2@16*)(SchedTbl+testSlot);  z/set index and nuxdCin valued       IF_CBR(p - 1;
"CBR Tests$otC0x%x AT Lde pt * 0x%x,'NumToAsvNRE=%d\n",s                                 testSlot,I2@32)TstSchedTbl,toBeAsvNREed);) R-      memcpy((cain__t)&cbrVC,(cain__t)TstSchedTbl, izeoft@16));np      memcpy((cain__t)&cbrVC,(cain__t)TstSchedTbl, izeoftcbrVC));n       wh
 
+tcbrVC)  z/ If anotser VCCat tspR lde pt *, weChave+toFkeelNlookingn       {s           inc++;M@@
n555,7 +557,7 y s                                                        2@32)SchedTbl,testSlot);)
           }
           TstSchedTbl = 2@16 *)(SchedTbl + testSlot);  z/ set 0[1], indexR-          memcpy((cain__t)&cbrVC,(cain__t)TstSchedTbl, izeoft@16)); np          memcpy((cain__t)&cbrVC,(cain__t)TstSchedTbl, izeoftcbrVC)); s           sUR	!cbrVC)s              bnuxk;
           testSlot = idealSlot + inc;M@@
n569,10 +571,10 y s           TstSchedTbl = 2@16*)(SchedTbl + testSlot);s           IF_CBR(p - 1;
"Ruxding CBR Tbl)H0xm 0x%x,'CbrVal=0x%x Iteract * %d\n",s                           2@32)TstSchedTbl,cbrVC,inc);) R-          memcpy((cain__t)&cbrVC,(cain__t)TstSchedTbl, izeoft@16));np          memcpy((cain__t)&cbrVC,(cain__t)TstSchedTbl, izeoftcbrVC));n        } ze'wh
 
+	/M        z/ Mov,FtspR VCI numb
rC- 1o tspR lde pt *CoGI
ld)CBR Sched 0[1],.R-       memcpy((cain__t)TstSchedTbl, (cain__t)&vcIndex, izeoft@16));np       memcpy((cain__t)TstSchedTbl, (cain__t)&vcIndex, izeoftTstSchedTbl));n        dev->CbrRemEN@ries--;n        toBeAsvNREed--;n    } ze'wh
 
+	/ -@@
n658,20 +660,20 y s        skb0=Cetne->data.txskb;s        iUR	!skb) {s            p - 1;
"ia_tx_poll: skb0pR null\*");n-           e unsi;np           go1o out;n        }n        vcc = ATM_SKB(skb)->vcc;s        iUR	!vcc) {s            p - 1;
"ia_tx_poll: vcc pR null\*");n            dev_kGree_skb_any(skb);n-           e unsi;np	   go1o out;n        }n s        iavcc = INPH_IA_VCC(vcc);s        iUR	!iavcc) {s            p - 1;
"ia_tx_poll: iavcc pR null\*");n            dev_kGree_skb_any(skb);n-           e unsi;np	   go1o out;n        }n s        skb1 =Iskb_dequeue(&iavcc->txing_skb);n@@
n680,7 +682,7 y s              p - 1;
"IA_tx_intr: Vci %d ldst pkt!!!\n",Ivcc->vci);n           }s           IF_ERR(p - 1;
"RuleaseI
ld)SKB not match\*");)n-          iUR	vcc &&R	vcc->pop) && (skb1->len != 0))M+          iUR		vcc->pop) && (skb1->len != 0))M           {s              vcc->pop	vcc, skb1);n              IF_EVENT(p - 1;
"Tansmit Doi) - skb00x%lx e unsi\n",s@@
n695,7 +697,7 y s           ia_enque_huxd_rtn_q (&iadev->tx_e unsi_q,Cetne);n           bnuxk;
        }n-       iUR	vcc &&R	vcc->pop) && (skb->len != 0))M+       iUR		vcc->pop) && (skb->len != 0))M        {s           vcc->pop	vcc, skb);s           IF_EVENT(p - 1;
"Tx Doi) - skb00x%lx e unsi\n",(ENER)skb);)M@@
n705,6R+707,7 y s        kGree(etne);n     }s     ia_que_tx(iadev);npout:d     e unsi;n }s viUR0M@@
n924,9 +927,9 y s    suni_pm7345->suni_rxcp_ctrl = 0x2c;s    suni_pm7345->suni_rxcp_fctrl = 0x81;n  n-   suni_pm7345->suni_rxcp_idle_pat_h1 = 0;
-   suni_pm7345->suni_rxcp_idle_pat_h2 = 0;
-   suni_pm7345->suni_rxcp_idle_pat_h3 = 0;
+   suni_pm7345->suni_rxcp_idle_pat_h1 =
+   	suni_pm7345->suni_rxcp_idle_pat_h2 =
+   	suni_pm7345->suni_rxcp_idle_pat_h3 = 0;
    suni_pm7345->suni_rxcp_idle_pat_h4 = 1;o  s    suni_pm7345->suni_rxcp_idle_mask_h1 = 0xff;M@@
n934,15 +937,15 y s    suni_pm7345->suni_rxcp_idle_mask_h3 = 0xff;M    suni_pm7345->suni_rxcp_idle_mask_h4 = 0xfe;n  n-   suni_pm7345->suni_rxcp_cell_pat_h1 = 0;
-   suni_pm7345->suni_rxcp_cell_pat_h2 = 0;
-   suni_pm7345->suni_rxcp_cell_pat_h3 = 0;
+   suni_pm7345->suni_rxcp_cell_pat_h1 =
+   	suni_pm7345->suni_rxcp_cell_pat_h2 =
+   	suni_pm7345->suni_rxcp_cell_pat_h3 = 0;
    suni_pm7345->suni_rxcp_cell_pat_h4 = 1;o  s-   suni_pm7345->suni_rxcp_cell_mask_h1 = 0xff;M-   suni_pm7345->suni_rxcp_cell_mask_h2 = 0xff;M-   suni_pm7345->suni_rxcp_cell_mask_h3 = 0xff;M-   suni_pm7345->suni_rxcp_cell_mask_h4 = 0xff;M+   suni_pm7345->suni_rxcp_cell_mask_h1 =
+   	suni_pm7345->suni_rxcp_cell_mask_h2 =
+   	suni_pm7345->suni_rxcp_cell_mask_h3 =
+   	suni_pm7345->suni_rxcp_cell_mask_h4 = 0xff;M  
    suni_pm7345->suni_txcp_ctrl = 0xa4;
    suni_pm7345->suni_txcp_intr_en_sts = 0x10;M@@
n1144,8 +1147,7 y s                 )lse {s                     IF_ERR(p - 1;
" cause: bufferRover Glow\*");)n                 }M-		Gree_desc(dev,Cdesc);  M-		e unsi 0;  M+		go1o out_Gree_desc;o 	}  
   o 	ze' 
@@
n1158,8 +1160,7 y s         iUR	len > iadev->rx_buf_sz) {s            p - 1;
"Over %d bytes sdu e ceiv+d, dropped!!!\n",Iiadev->rx_buf_sz);n            atomic_inc(&vcc->8  ps->rx_err);n-           Gree_desc(dev,Cdesc); n-           e unsi 0;
+	   go1o out_Gree_desc;o         }s 		  s viURLINUX_VERSION_t
DE >= 0x20312
@@
n1173,8 +1174,7 y s               IF_ERR(p - 1;
"can'tca  de p,+memoryCG_SMe cv, drop pkt!\*");)  s               atomic_inc(&vcc->8  ps->rx_drop);n              Catm_e unsi	vcc, atm_pdu2true ize	len));n-              Gree_desc(dev,Cdesc); n-	      e unsi 0;  M+	      go1o out_Gree_desc;o 	   }  
         }s         )lse {s@@
n1182,8 +1182,7 y s v)@ vNR            iUR	vcc->vci < 32)n               p - 1;
"Drop coN@rol packets\*");n-           Gree_desc(dev,Cdesc);n-           e unsi 0;
+	      go1o out_Gree_desc;o         }s 	skb_put	skb,len);  
         // pwang_testR@@
n1206,7 +1205,10 y s 	udelay(1);  
 	/	 Itcrement transactt *Bcount
rC*/  
 	writel(1,Iiadev->dma+IPHASE5575_RX_COUNTER);   n-	e unsi 0;  M+out:	e unsi 0;  M+out_Gree_desc:M+        Gree_desc(dev,Cdesc);n+        go1o out;n }  
   o 8  pF TES <crx_intr(y    cCatm_dev *dev)' 
@@
n1280,6R+1282,7 y s   u_shorcCs 
te;   s   y    cCd 
+	d 
, *cur_d 
;  
   u_intCd 
_lp;  M+ TiN@Tlen;o   iadev = INPH_IA_DEV(dev);  
  
   ze'Greeca  I
ld)d 
s don
, ilattpR ju  Gupd p,+our owECd 
+nuxdCpoit4er ' 
@@
n1299,7 +1302,7 y s       desc = ATM_DESC(skb);s       Gree_desc(dev,Cdesc);  M                
-      iUR	!skb->len)  np      iUR	!	len =Iskb->len))n       {  M           p - 1;
"rx_dle_intr: skb0len 0\*");  
 	  dev_kGree_skb_any(skb);' 
@@
n1313,7 +1316,6 y s           vcc = ATM_SKB(skb)->vcc;s 	  iUR	!vcc) {s 	      p - 1;
"IA: null vcc\*");  
-              atomic_inc(&vcc->8  ps->rx_err);n               dev_kGree_skb_any(skb);n               go1o INCR_DLE;n           }s@@
n1323,27 +1325,27 y s              atomic_inc(&vcc->8  ps->rx_err);n              dev_kGree_skb_any(skb);n viURLINUX_VERSION_t
DE >= 0x20312
-            Catm_e unsi	vcc, atm_gue s_pdu2true ize	skb->len));np            Catm_e unsi	vcc, atm_gue s_pdu2true ize	len));n #)lseo-            Catm_e unsi	vcc, atm_pdu2true ize	skb->len));np            Catm_e unsi	vcc, atm_pdu2true ize	len));n #)@ vNR              go1o INCR_DLE;n            }s           // getcreal)pkt length  pwang_testR           trail*rC=l(y    cCcpcs_trail*r*)((u_char *)skb->data)+
-                                 skb->len -  izeofty    cCcpcs_trail*r));np            C                    skb->len -  izeoft*trail*r));n           length =  sw p(trail*r->length);M           iUR		length > iadev->rx_buf_sz) || 	length > s                               (skb->len -  izeofty    cCcpcs_trail*r))))M           {s              atomic_inc(&vcc->8  ps->rx_err);n-             dev_kGree_skb_any(skb);n              IF_ERR(p - 1;
"rx_dle_intr: BxdC AAL5 trail*rC%d (skb0len %d)",Is                                                             length,Iskb->len);)np            Cdev_kGree_skb_any(skb);n viURLINUX_VERSION_t
DE >= 0x20312
-            Catm_e unsi	vcc, atm_gue s_pdu2true ize	skb->len));np            Catm_e unsi	vcc, atm_gue s_pdu2true ize	len));n #)lseo-            Catm_e unsi	vcc, atm_pdu2true ize	skb->len));np            Catm_e unsi	vcc, atm_pdu2true ize	len));n #)@ vN 
              go1o INCR_DLE;n           }s@@
n1429,7 +1431,7 y s 	IADEV *iadev;  
 	y    cCrx_buf_desc *buf_desc_ptr;  
 	@ vNRE_FGENERcrx_pkt_  
  +=I0;  M-	u32 	d 
_ain_;  M+	u32 	od 
_ain_, 	d 
_ain_;  M 	y    cCabr_vc_0[1],  *abr_vc_0[1],; 
 	@16 *vc_0[1],;  
 	@16 *rea s_0[1],;  
@@
n1451,13R+1453,14 y s 	*/   
   o 	ze'a  de p,+8k bytes */  
-	d 
_ain_ = 2@32*)kma  de(2* izeofty    cCd 
)*DLE_ENTRIES, GFP_KERNEL);  
-	iUR	!d 
_ain_)  np	od 
_ain_ = kma  de(2* izeofty    cCd 
)*DLE_ENTRIES, GFP_KERNEL);  
+	iUR	!od 
_ain_)  n 	{  M 		p - 1;
KERN_ERR DEV_LABEL "can'tca  de p,+DLEs\*");  
+7	e unsi -EN
MEM;o 	}  
 	ze'find 4k byte boundaryCwithinI
ld)8kca  de p,d */  
-	d 
_ain_ = 2@32*)(R	2@32)d 
_ain_+(4096-1))+& ~(4096-1) );  
+7d 
_ain_ = 2@32*)(R	2@32)od 
_ain_+(4096-1))+& ~(4096-1) );  
 	iadev->rx_d 
_q.  
  +=Ity    cCd 
*)d 
_ain_;  M 	iadev->rx_d 
_q.ruxd =Ciadev->rx_d 
_q.  
  ;  M 	iadev->rx_d 
_q.write =Ciadev->rx_d 
_q.  
  ;  M@@
n1499,12 +1502,12 y s 	/	 Ititialize each  N@ry inI
ld)BufferRDescript_SMT[1], */  
         iadev->RX_DESC_BASE_ADDR =Ciadev->rea s_ram+RX_DESC_BASE*iadev->memSize;o 	buf_desc_ptr =(y    cCrx_buf_desc *)iadev->RX_DESC_BASE_ADDR;M-	memset((cain__t)buf_desc_ptr, 0,  izeofty    cCrx_buf_desc));  
+7memset((cain__t)buf_desc_ptr, 0,  izeoft*buf_desc_ptr));  
 	buf_desc_ptr++;  
 	rx_pkt_  
  +=Iiadev->rx_pkt_ram;  
 	for(i=1; i<=iadev->num_ex_desc; i++)  n 	{  M-		memset((cain__t)buf_desc_ptr, 0,  izeofty    cCrx_buf_desc));  
+77memset((cain__t)buf_desc_ptr, 0,  izeoft*buf_desc_ptr));  
 		buf_desc_ptr->buf_s 
  _hi0=Cex_pkt_  
  +>> 16;  
 		buf_desc_ptr->buf_s 
  _lo0=Cex_pkt_  
  +& 0x0000ffff;  
 		buf_desc_ptr++;		  s@@
n1599,7 +1602,7 y s         i =CABR_VC_TABLE+	 iadev->memSize;o 	abr_vc_0[1], =Ity    cCabr_vc_0[1], *)(iadev->rea s_ram+i);  M         j =IREASS_TABLE_SZ+	 iadev->memSize;o-        memset ((char*)abr_vc_0[1],, 0, j+	  izeofty    cCabr_vc_0[1], ) );np        memset ((char*)abr_vc_0[1],, 0, j+	  izeoft*abr_vc_0[1],));n     	for(i+=I0; i < j; i++) {   		M @	abr_vc_0[1],->rdf = 0x0003;n              	abr_vc_0[1],->air = 0x5eb1;o@@
n1635,11 +1638,12 y s   M 	ykb_queue_huxd_init(&iadev->rx_dma_q);  
 	iadev->rx_Gree_desc_qhuxd =CNULL;   n-	iadev->rx_open =(y    cCatm_vcc **)kma  de(4*iadev->num_vc,GFP_KERNEL);np	iadev->rx_open = kma  de(4*iadev->num_vc,GFP_KERNEL);n 	sUR	!iadev->rx_open)  n 	{  M 		p - 1;
KERN_ERR DEV_LABEL "itfC%d couldn'tcgetcGreecpage\n",s 		dev->number);  
+77kGree(od 
_ain_);o 		e unsi -EN
MEM;  M 	}  
 	memset(iadev->rx_open, 0, 4*iadev->num_vc);' 
@@
n1770,7 +1774,7 y s           }
         }s         ia_vcc =  INPH_IA_VCC(vcc);s-        memset((cain__t)ia_vcc, 0,  izeofty    cCia_vcc));np        memset((cain__t)ia_vcc, 0,  izeoft*ia_vcc));n         iUR	vcc->qos.txtp.max_sdu > s                          (iadev->tx_buf_sz -  izeofty    cCcpcs_trail*r))){s            p - 1;
"IA:  SDU  izeRover 
ld)configur_FGSDU  izeR%d\n",s@@
n1815,8 +1819,8 y s 	evc =Ity    cCext_vc *)iadev->EXT_VC_TABLE_ADDR;  
 	vc +=Ivcc->vci;  
 	evc +=Ivcc->vci;  
-	memset((cain__t)vc, 0,  izeofty    cCmain_vc));  
-	memset((cain__t)evc, 0,  izeofty    cCext_vc));  
+7memset((cain__t)vc, 0,  izeoft*vc));  
+7memset((cain__t)evc, 0,  izeoft*evc));  
 	  
 	ze'storeC
ld)mdst vNREificant 4 bIGsCoGIvci asF
ld)last 4 bIGsC  M 		oGIfirst p
  +oGIatm huxder.' 
@@
n1921,10 +1925,11 y s                                 ruxdw(iadev->seg_reg+SEG_MASK_REG));)  s 	ze---------- Ititializing Transmit DLEs ----------*/  
 	ze'a  de ping 8kcmemoryCG_SMtransmit DLEs */  
-	d 
_ain_ = 2@32*)kma  de(2* izeofty    cCd 
)*DLE_ENTRIES, GFP_KERNEL);  
+7d 
_ain_ = kma  de(2* izeofty    cCd 
)*DLE_ENTRIES, GFP_KERNEL);  
 	iUR	!d 
_ain_)  n 	{  M 		p - 1;
KERN_ERR DEV_LABEL "can'tca  de p,+TX+DLEs\*");  
+7	e unsi -EN
MEM;o 	}  
   
 	ze'find 4k byte boundaryCwithinI
ld)8kca  de p,d */  
@@
n1967,20 +1972,19 y s   M 	ze'stitialize each  N@ry inI
ld)bufferRdescript_SMt[1], */  
 	buf_desc_ptr =(y    cCtx_buf_desc *)(iadev->seg_ram+TX_DESC_BASE);  
-	memset((cain__t)buf_desc_ptr, 0,  izeofty    cCtx_buf_desc));  
+7memset((cain__t)buf_desc_ptr, 0,  izeoft*buf_desc_ptr));  
 	buf_desc_ptr++;  
 	tx_pkt_  
  +=ITX_PACKET_RAM;  
 	for(i=1; i<=iadev->num_tx_desc; i++)  n 	{  M-		memset((cain__t)buf_desc_ptr, 0,  izeofty    cCtx_buf_desc));  
+77memset((cain__t)buf_desc_ptr, 0,  izeoft*buf_desc_ptr));  
 		buf_desc_ptr->desc_mode = AAL5;  
 		buf_desc_ptr->buf_s 
  _hi0=Ctx_pkt_  
  +>> 16;  
 		buf_desc_ptr->buf_s 
  _lo0=Ctx_pkt_  
  +& 0x0000ffff;  
 		buf_desc_ptr++;		  s 		tx_pkt_  
  ++=Iiadev->tx_buf_sz;  M 	}  
-        iadev->tx_buf= (cain__t*)kma  de(iadev->num_tx_desc* izeoftcain__t), 
-                                                                   GFP_KERNEL);np        iadev->tx_buf = kma  de(iadev->num_tx_desc* izeoftcain__t), GFP_KERNEL);n         iUR	!iadev->tx_buf) {s             p - 1;
KERN_ERR DEV_LABEL " couldn'tcgetcmem\*");n             e unsi -EAGAIN;o@@
n1988,14 +1992,14 y s        	G_SM(i=I0; i< iadev->num_tx_desc; i++)s        	{
  
-       	    iadev->tx_buf[i] =(cain__t)kma  de( izeofty    cCcpcs_trail*r),np       	    iadev->tx_buf[i] = kma  de( izeofty    cCcpcs_trail*r),n                                                            GFP_KERNEL|GFP_DMA);n             if	!iadev->tx_buf[i]) {                
 		p - 1;
KERN_ERR DEV_LABEL " couldn'tcgetcGreepage\n"); s          	e unsi -EAGAIN;o             }
         }
-        iadev->desc_tbl+=Ity    cCdesc_tbl_t *)kma  de(iadev->num_tx_desc *np        iadev->desc_tbl+=Ikma  de(iadev->num_tx_desc *n                                     izeofty    cCdesc_tbl_t), GFP_KERNEL);n   M 	ze'Communie pt *CQueues baseIain_urce*/  
@@
n2121,18 +2125,17 y s 	memset((cain__t)(iadev->seg_ram+i),  0, iadev->num_vc*4);o 	vc =Ity    cCmain_vc *)iadev->MAIN_VC_TABLE_ADDR;  
 	evc =Ity    cCext_vc *)iadev->EXT_VC_TABLE_ADDR;  
-        iadev->testT[1], =Ity    cCtestT[1],_t **)
-                          kma  de( izeoftENER)*iadev->num_vc, GFP_KERNEL); np        iadev->testT[1], =Ikma  de( izeoftENER)*iadev->num_vc, GFP_KERNEL); n         iUR	!iadev->testT[1],) {s            p - 1;
"GetcGreepage  fail*d\*");n            e unsi -EAGAIN; 
         }s 	for(i=0; i<iadev->num_vc; i++)  n 	{  M-		memset((cain__t)vc, 0,  izeofty    cCmain_vc));  
-		memset((cain__t)evc, 0,  izeofty    cCext_vc));  
-                iadev->testT[1],[i] = ty    cCtestT[1],_t *)
-                            kma  de( izeofty    cCtestT[1],_t), GFP_KERNEL);np	7memset((cain__t)vc, 0,  izeoft*vc));  
+77memset((cain__t)evc, 0,  izeoft*evc));  
+                iadev->testT[1],[i] = kma  de( izeofty    cCtestT[1],_t),M+						GFP_KERNEL);n 		iUR	!iadev->testT[1],[i])M @		e unsi -EN
MEM;o               	iadev->testT[1],[i]->lastTime = 0;
@@
n2682,7 +2685,7 y s                                  vcc->dev->number,Ivcc->vpi,Ivcc->vci);)  
   
 	ze'Device dependent stitializatt *+*/  n-	ia_vcc = kma  de( izeofty    cCia_vcc), GFP_KERNEL);  
+	ia_vcc = kma  de( izeoft*ia_vcc), GFP_KERNEL);  
 	sUR	!ia_vcc) e unsi -EN
MEM;  M 	INPH_IA_VCC(vcc)+=Iia_vcc;  M    @@
n2989,7 +2992,7 y s s 	ze'BuildI
ld)DLE y    cure */  
 	wr_ptr = iadev->tx_d 
_q.write;  
-	memset((cain__t)wr_ptr, 0,  izeofty    cCd],));  
+7memset((cain__t)wr_ptr, 0,  izeoft*wr_ptr));  
 	wr_ptr->sys_pkt_ain_ = ain_;  M 	wr_ptr-> de l_pkt_ain_ = (buf_desc_ptr->buf_s 
  _hi0<< 16) |Is                                                   buf_desc_ptr->buf_s 
  _lo;' 
@@
n3175,9 +3178,9 y s 		p - 1;
KERN_ERR DEV_LABEL " driver but'_S0PCI BIOS ?\*");  
 		e unsi 0;  M 	}  
-	iadev = (IADEV *)kma  de( izeoftIADEV), GFP_KERNEL); np	iadev = kma  de( izeoft*iadev), GFP_KERNEL); n 	iUR	!iadev) e unsi -EN
MEM;  M-        memset((char*)iadev, 0,  izeoftIADEV));np        memset((char*)iadev, 0,  izeoft*iadev));n 	prev_dev =CNULL;  M 	wh
 
((iadev->pci0=Cpci_find_device(PCI_VENDOR_ID_IPHASE,  
 		PCI_DEVICE_ID_IPHASE_5575,  p ev_dev))) {  h@@
n3212,10 +3215,9 y s 		p ev_dev =Ciadev->pci;  
 		iadev->next_board =Iia_boards;  
 		ia_boards)= dev;  
-		iadev = (IADEV *)kma  de(   n-				 izeoftIADEV), GFP_KERNEL);  
+77iadev = kma  de( izeoft*iadev), GFP_KERNEL);  n 		iUR	!iadev) bnuxk;   
-                memset((char*)iadev, 0,  izeoftIADEV)); 
+                memset((char*)iadev, 0,  izeoft*iadev)); n 		index++;  
                 dev =INULL;o 	}  
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/atm/nies 
 .c $(CONFdrivers/atm/nies 
 .cP6 +35,9 @@
 #incldrivers/atm/nies 
 .c	W_FGJul 25 17:10:19c-aica.o
 
 ifeqdrivers/atm/nies 
 .c	thu,
elN13R15:21:32G_MEf @@
n271,6 +271,7 y s 8  pF Ty    cCti/*r_
 st ns_ti/*r;o 8  pF Tchar *mac[NS_MAX_CARDS];R MODULE_PARM(mac, "1-" __MODULE_STRING(NS_MAX_CARDS) "s");opMODULE_LICENSE("GPL");n   s /	 Functt *s*******************************************************************/
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/atm/suni.c $(CONFdrivers/atm/suni.cP6 +35,9 @@
 #incldrivers/atm/suni.c	Fri,May  5o_2:37:52ble 0a.o
 
 ifeqdrivers/atm/suni.c	thu,
elN13R15:21:32G_MEf @@
n309,6R+309,8 y s EXPORT_SYMBOL(suni_init);o R o+MODULE_LICENSE("GPL");np--vmfzbH_MODULEM o 
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/atm/uPD98402.c $(CONFdrivers/atm/uPD98402.cP6 +35,9 @@
 #incldrivers/atm/uPD98402.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/atm/uPD98402.c	thu,
elN13R15:21:32G_MEf @@
n255,6R+255,7 y s s --vmfzbH_MODULEMpMODULE_LICENSE("GPL");n   EXPORT_SYMBOL(uPD98402_init);o R(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/atm/zatm.c $(CONFdrivers/atm/zatm.cP6 +35,9 @@
 #incldrivers/atm/zatm.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/atm/zatm.c	Fri,
elN14G14:40:00G_MEfh@@
n52,6R+52,12 y s _defLi) DPRINTK(format,args...)n v)@ vNR o+_ GnzbH___i386__i+vmfzbH_CONFIG_ATM_ZATM_EXACT_TSi+vwarning ParciseI
i/*8  mping onlycavail[1],  *+i386 platforma.#unzbH_CONFIG_ATM_ZATM_EXACT_TSi+v)@ vNR+v)@ vNR o _mfnzbH_CONFIG_ATM_ZATM_DEBUGR 
@@
n1846,6 +1852,8 y s s vmfzbH_MODULEM  o+MODULE_LICENSE("GPL");np--int stit_module(ES <)n {n 	iUR	!zatm_detrct())led(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/Config.in $(CONFdrivers/b dek/Config.inP6 +35,9 @@
 #incldrivers/b dek/Config.in	Sat,Febo'3o_2:13:19c-aica.o
 
 ifeqdrivers/b dek/Config.in	Fri,
elN14G14:04:06o_MEf @@
n42,7 +42,7 y s s tris 
te 'RAMFdisk support'_CONFIG_BLK_DEV_RAM  mf [ "$CONFIG_BLK_DEV_RAM" =I"y" -o "$CONFIG_BLK_DEV_RAM" =I"m" ];I
ldn
-	int '   Default RAMFdisk size'_CONFIG_BLK_DEV_RAM_SIZE 4096
+   int '  Default RAMFdisk size'_CONFIG_BLK_DEV_RAM_SIZE 4096
 fi
 dep_bool '  Ititial RAMFdisk (stitrd) support'_CONFIG_BLK_DEV_INITRD $CONFIG_BLK_DEV_RAM  d(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/DAC960.c $(CONFdrivers/b dek/DAC960.cP6 +35,9 @@
 #incldrivers/b dek/DAC960.c	Sun Aug 12 13:27:59c-aica.o
 
 ifeqdrivers/b dek/DAC960.c	Mon_
elN10o_2:42:31G_MEf @@
n31,6 +31,7 y s vmaddr);
<
 ifeqcomplett *.h>s vmaddr);
<
 ifeqdelay.h>s vmaddr);
<
 ifeqhdreg.h>s+vmaddr);
<
 ifeqblkpg.h>s vmaddr);
<
 ifeqit4errupt.h>s vmaddr);
<
 ifeqioport.h>s vmaddr);
<
 ifeq deks.h>s@@
n1882,7 +1883,6 y s 8  pF Tboolean DAC960_Regis4erB dekDevice(DAC960_CoN@roller_T *CoN@roller)n {n   int MajorNumb
rC= DAC960_MAJOR +GCoN@roller->CoN@rollerNumb
r;s-  GenericDiskInfo_T *GenericDiskInfo;o   RequestQueue_T *RequestQueue;n   int MinorNumb
r;s   zeo@@
n1937,13R+1937,7 y s   /*n     In8    I
ld)Generic Disk Informatt *+y    cure at ts)yendCoGI
ld)
 st.n   */d-  iUR		GenericDiskInfoC= g)@ vsk_head) !=INULL)
-    {
-      wh
 
+tGenericDiskInfo->next !=INULL)
-	GenericDiskInfoC= GenericDiskInfo->next;s-      GenericDiskInfo->next = &CoN@roller->GenericDiskInfo;o-    }
-  )lse g)@ vsk_head = &CoN@roller->GenericDiskInfo;o+  add_g)@ vsk(&CoN@roller->GenericDiskInfo);s   /*n     Indie p,+
ld)B dek'Device Regis4ract * complet_FGsutalrafully,n   */d@@
n1979,16 +1973,7 y s   /*n     RemoveI
ld)Generic Disk Informatt *+y    cure H0xm 
ld)
 st.n   */d-  iUR	g)@ vsk_head != &CoN@roller->GenericDiskInfo)
-    {
-      GenericDiskInfo_T *GenericDiskInfoC= g)@ vsk_head;
-      wh
 
+tGenericDiskInfo !=INULL &&n-	     GenericDiskInfo->next !=I&CoN@roller->GenericDiskInfo)
-	GenericDiskInfoC= GenericDiskInfo->next;s-      iUR	GenericDiskInfo !=INULL)
-	GenericDiskInfo->next = GenericDiskInfo->next->next;s-    }
-  )lse g)@ vsk_head = CoN@roller->GenericDiskInfo.next;s+  del_g)@ vsk(&CoN@roller->GenericDiskInfo);s }n s h@@
n5089,26R+5074,19 y s @		    izeoftDiskGeometry_T))l? -EFAULT : 0);n     caseIBLKGETSIZE:
       ze'GetcDevice Size. */d-      iUR		lNERc*) Argument ==INULL) e unsi -EINVAL;o       e unsi put_user(CoN@roller->GenericDiskInfo.p
  [MINOR(Inode->i_rdev)]s @		@		 .nr_srcts,s 		      (lNERc*) Argument);np    caseIBLKGETSIZE64:M+      e unsi put_user((u64)CoN@roller->GenericDiskInfo.p
  [MINOR(Inode->i_rdev)].nr_srcts0<< 9,M+		      2@64c*) Argument);n     caseIBLKRAGET:d-      ze'GetcRuxd-Ahead. */d-      iUR		lNERc*) Argument ==INULL) e unsi -EINVAL;o-      e unsi put_user(ruxd_ahead[MAJOR(Inode->i_rdev)], (lNERc*) Argument);n     caseIBLKRASET:d-      ze'SetcRuxd-Ahead. */d-      iUR	!cap[1],(CAP_SYS_ADMIN)) e unsi -EACCES;s-      iUR	Argument > 256) e unsi -EINVAL;o-      e xd_ahead[MAJOR(Inode->i_rdev)] = Argument;o-      e unsi 0;n     caseIBLKFLSBUF:d-      ze'Flush)Buffers. */d-      iUR	!cap[1],(CAP_SYS_ADMIN)) e unsi -EACCES;s-      fsync_dev(Inode->i_rdev);s-      invalid p,_buffers(Inode->i_rdev);s-      e unsi 0;
+    caseIBLKBSZGET:d+    caseIBLKBSZSET:d+      e unsi blk_ioctl (Inode->i_rdev, Request, Argument);npn     caseIBLKRRPART:
       ze'Re-Ruxd P
  itt *+T[1],.+	/M       iUR	!cap[1],(CAP_SYS_ADMIN)) e unsi -EACCES;s(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/Maket
 
+$(CONFdrivers/b dek/Maket
 
P6 +35,9 @@
 #incldrivers/b dek/Maket
 
	Fri,Dec 29G14:07:21ble 0a.o
 
 ifeqdrivers/b dek/Maket
 
	Sun 
elNg9o_2:00:55ble ch@@
n10,7 +10,7 y s s O_TARGET := b dek.o
  -export-objs	:= ll_rw_blk.o blkpg.oNloop.oNDAC960.os+export-objs	:= ll_rw_blk.o blkpg.oNloop.oNDAC960.o g)@hd.o
   obj-y	:= ll_rw_blk.o blkpg.oNg)@hd.o )levator.o
 s(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/acsi.c $(CONFdrivers/b dek/acsi.cP6 +35,9 @@
 #incldrivers/b dek/acsi.c	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeqdrivers/b dek/acsi.c	thu,
elN13R15:21:32G_MEf @@
n1138,6R+1138,10 y s 		e unsi put_user(acsi_p
  [MINOR(inode->i_rdev)].nr_srcts,s @		@(lNERc*) arg);o 
+	  caseIBLKGETSIZE64:   ze'Reunsi device  izeR*/M+		e unsi put_user((u64)acsi_p
  [MINOR(inode->i_rdev)].nr_srcts0<< 9,M+			@(@64c*) arg);o+
 	  caseIBLKROSET:d 	  caseIBLKROGET:d 	  caseIBLKFLSBUF:d@@
n1386,16 +1390,14 y s extern+y    cCb dek_device_operact *s acsi_fops;n s 8  pF Ty    cCg)@ vsk acsi_g)@ vsk =l{ -	MAJOR_NR,		ze'Major numb
rC*/	 -	"ad",			ze'Major nameR*/M-	4,			ze'BIGs+toFshift+toFgetcreal)H0xm p
  itt *+*/M-	10<< 4,			ze'Numb
rCoGIp
  itt *s percreal)*/M-	acsi_p
  ,		ze'hdTy    cC*/M-	acsi_ izes,		ze'b dek  izesC*/M-	0,			ze'numb
rC*/M-	(ES <c*)acsi_info,	ze'stternal)*/M-	NULL,			ze'next */M-	&acsi_fops,		ze't
 
+operact *s */M+	major:		MAJOR_NR,M+	major_name:	"ad",M+	minor_shift:	4,M+	max_p:		10<< 4,M+	p
  :		acsi_p
  ,M+	 izes:		acsi_ izes,M+	real_devices:	(ES <c*)acsi_info,M+	fops:		&acsi_fops,s };n 	s _defLi) MAX_SCSI_DEVICE_t
DE 10
@@
n1792,8 +1794,7 y s 	M @blk_itit_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);n 	e xd_ahead[MAJOR_NR] = 8;		ze'8c ect_SM(4kB) e xd-aheadC*/M-	acsi_g)@ vsk.next = g)@ vsk_head;
-	g)@ vsk_head = &acsi_g)@ vsk;np	add_g)@ vsk(&acsi_g)@ vsk);n i vmfzbH_CONFIG_ATARI_SLM
 	errC= slm_init();n@@
n1805,6R+1806,9 y s s --vmfzbH_MODULEMpo+MODULE_LICENSE("GPL");np--int stit_module(ES <)n {n 	int err;n@@
n1817,8 +1821,6 y s s ES <ccleanup_module(ES <)n {n-	y    cCg)@ vsk ** gdp;
-s 	del_ti/*r( &acsi_ti/*r );n 	blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));n 	atari_   am_Gree( acsi_bufferR);n@@
n1826,13R+1828,7 y s 	iUR	devfs_unregis4er_blkdev( MAJOR_NR, "ad" ) != 0)s 		p - 1;
 KERN_ERR "acsi:ccleanup_module fail*d\*");n n-	G_SM(gdp = &g)@ vsk_head; *gdp; gdp = &((*gdp)->next))
-		iUR	*gdp == &acsi_g)@ vsk)
-			bnuxk;
-	iUR	!*gdp)
-		p - 1;
 KERN_ERR "acsi:c N@ry inI vsk chainImissing!\*"R);n-	)lseo-		*gdp = (*gdp)->next;np	del_g)@ vsk(&acsi_g)@ vsk);n }n v)@ vNR o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/amiflop.c $(CONFdrivers/b dek/amiflop.cP6 +35,9 @@
 #incldrivers/b dek/amiflop.c	Sat,Apr 28 11:27:53c-aica.o
 
 ifeqdrivers/b dek/amiflop.c	thu,
elN13R15:21:32G_MEf @@
n118,6R+118,7 y s 8  pF TlNERcint fd_def_df0 = FD_DD_3;     /* default G_SMdf0 iURit doesn'tcidentifyR+/M 
 MODULE_PARM(fd_def_df0,"l");opMODULE_LICENSE("GPL");n   /*n  * 'Macross@@
n1555,6R+1556,9 y s 		bnuxk;
 	caseIBLKGETSIZE:
 		e unsi put_user(utit[drive].b deks,(lNERc*)p
 am);np	7bnuxk;
+	caseIBLKGETSIZE64:M+		e unsi put_user((u64)utit[drive].b deks0<< 9, 2@64c*)p
 am);n 		bnuxk;
 	caseIFDSETPRM:
 	caseIFDDEFPRM:
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/ataflop.c $(CONFdrivers/b dek/ataflop.cP6 +35,9 @@
 #incldrivers/b dek/ataflop.c	Fri,Febo'9 11:30:22c-aica.o
 
 ifeqdrivers/b dek/ataflop.c	thu,
elN13R15:21:32G_MEf @@
n2056,6 +2056,9 y s }n s vmfzbH_MODULEMpo+MODULE_LICENSE("GPL");np--int stit_module (ES <)n {n 	iUR	!MACH_IS_ATARI)
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/blkpg.c $(CONFdrivers/b dek/blkpg.cP6 +35,9 @@
 #incldrivers/b dek/blkpg.c	Sun May 20 11:34:05c-aica.o
 
 ifeqdrivers/b dek/blkpg.c	Mon_
elN17b15:37:33G_MEfh@@
n54,17 +54,6 y s  e'Nop,+
lat,several)drives may have+the  ameRmajor.n  +/M 
-ze'a 
 iearc earch,Isuperfluous whei devtpR aCpoit4er */M-8  pF Ty    cCg)@ vsk *get_g)@ vsk(kdev_t dev) {n-	y    cCg)@ vsk *g;
-	int m =CMAJOR(dev);s-n-	G_SM(g = g)@ vsk_head; g; g = g->next)
-		iUR	g->major == m)
-			bnuxk;
-	e unsi g;
-}
-s /*n  * Add aCp
  itt *.n  + @@
n250,6R+239,7 y s 		caseIBLKGETSIZE:
 			ze'Today get_g)@ vsk() e quiars'a 
 iearc can;s @		   add tspR whei devthasCpoit4er type.R*/M+			ze'add BLKGETSIZE64+too+	/M @		g = g)t_g)@ vsk(dev);n 			iUR	!g)M @			lNERval = 0;
@@
n273,6R+263,29 y s 		caseIBLKELVSET:d 			e unsi blkelvs)t_ioctl(&blk_g)t_queue(dev)->)levator,s @		@	       (blkelv_ioctl_arg_t *) arg);o+
+		caseIBLKBSZGET:d+			ze'getc
ld)
ogical b dek  ize (cf.IBLKSSZGET)R*/M+			it4val = BLOCK_SIZE;M+			if (blk ize_ ize[MAJOR(dev)])M+			@it4val = blk ize_ ize[MAJOR(dev)][MINOR(dev)];M+			e unsi put_user (st4val, (st4 *) arg);o+
+		caseIBLKBSZSET:d+			ze'setc
ld)
ogical b dek  ize */M+			iUR	!cap[1], (CAP_SYS_ADMIN))M+			@e unsi -EACCES;s+			iUR	!devt|| !arg)M+			@e unsi -EINVAL;o+			iUR	g)t_user (st4val, (st4 *) arg))M+			@e unsi -EFAULT;o+			iUR	it4val > PAGE_SIZE || it4val < 512 ||o+			    (it4val & (it4val - 1)))M+			@e unsi -EINVAL;o+			iUR	is_mount
dR	dev) || is_sw p_p
  itt *+	dev))M+			@e unsi -EBUSY;o+			s)t_b deksize (dev, it4val);M+			e unsi 0;n   		default:M @		e unsi -EINVAL;o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/cciss.c $(CONFdrivers/b dek/cciss.cP6 +35,9 @@
 #incldrivers/b dek/cciss.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/b dek/cciss.c	tup_
elN18G14:10:43G_MEfh@@
n50,6R+50,7 y s /* Embedd
dRmodule documentatt *+macros -  eeRmodules.h+	/M MODULE_AUTHOR("Char 
s M. White III - Compaq Compu4er Corporact *");n MODULE_DESCRIPTION("Driver G_SMCompaq Sm
  +Array CoN@roller 5300");opMODULE_LICENSE("GPL");n   vmaddr);
"cciss_cmd.h"s vmaddr);
"cciss.h"s@@
n400,17 +401,23 y s 		put_user(hba[ctlr]->hd[MINOR(inode->i_rdev)].s 
  _ ect, &g)o->8  rt);o 		e unsi 0;
 	caseIBLKGETSIZE:
-		iUR	!arg) e unsi -EINVAL;o 		put_user(hba[ctlr]->hd[MINOR(inode->i_rdev)].nr_srcts, (lNER*)arg);o 		e unsi 0;
+	caseIBLKGETSIZE64:M+		put_user((u64)hba[ctlr]->hd[MINOR(inode->i_rdev)].nr_srcts0<< 9, 2@64*)arg);o+		e unsi 0;
 	caseIBLKRRPART:
 		e unsi revalid p,_
ogvol(inode->i_rdev, 1);n 	caseIBLKFLSBUF:d+	caseIBLKBSZSET:d+	caseIBLKBSZGET:d 	caseIBLKROSET:d 	caseIBLKROGET:d 	caseIBLKRASET:d 	caseIBLKRAGET:d 	caseIBLKPG:d+	caseIBLKELVGET:d+	caseIBLKELVSET:d 		e unsi	 blk_ioctl(inode->i_rdev, cmd, arg));n 	caseICCISS_GETPCIINFO:d 	{
@@
n1963,8 +1970,7 y s 	hba[i]->g)@ vsk.nr_real)= hba[i]->num_luns;n s 	ze'GetconI
ld) vsk 
 st 	/ --	hba[i]->g)@ vsk.next = g)@ vsk_head;
-	g)@ vsk_head = &(hba[i]->g)@ vsk); np	add_g)@ vsk(&(hba[i]->g)@ vsk));n   	cciss_g)@init(i);n 	for(j=0; j<NWD; j++)s@@
n1980,7 +1986,6 y s {n 	ctlr_info_t *tmp_ptr;n 	int i;n-	y    cCg)@ vsk *g;
 n 	iUR	pdev->driver_data)==INULL)
 	{
@@
n_ME5,19 +2010,8 y s 	n s 	ze'removeIit H0xm 
ld) vsk 
 st 	/
-	iUR	g)@ vsk_head == &(hba[i]->g)@ vsk))
-	{n-		g)@ vsk_head = hba[i]->g)@ vsk.next;n-	} )lseo-	{n-		for(g=g)@ vsk_head; g ; g=g->next)
-		{n-			iU(g->next == &(hba[i]->g)@ vsk))
-			{n-				g->next = hba[i]->g)@ vsk.next;n-			}M-		}M-	}np	del_g)@ vsk(&(hba[i]->g)@ vsk));n+
 	pci_free_consis4ent(hba[i]->pdev, NR_CMDS+	  izeoftCommandLis4_y    c), 
 		hba[i]->cmd_pool, hba[i]->cmd_pool_dhandle);n 	pci_free_consis4ent(hba[i]->pdev, NR_CMDS+	  izeoft Err_SInfo_y    c),o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/cpqarray.c $(CONFdrivers/b dek/cpqarray.cP6 +35,9 @@
 #incldrivers/b dek/cpqarray.c	Sun Aug 12 13:27:59c-aica.o
 
 ifeqdrivers/b dek/cpqarray.c	tup_
elN18G14:10:43G_MEfh@@
n48,6R+48,7 y s /* Original)author ChrpR Frantz - Compaq Compu4er Corporact *+	/M MODULE_AUTHOR("Compaq Compu4er Corporact *");n MODULE_DESCRIPTION("Driver G_SMCompaq Sm
  2+Array CoN@rollers");opMODULE_LICENSE("GPL");n   _defLi) MAJOR_NR COMPAQ_SMART2_MAJORs vmaddr);
<
 ifeqblk.h>s@@
n311,7 +312,6 y s ES <ccleanup_module(ES <)n {n 	int i;n-	y    cCg)@ vsk *g;
 	char buff[4]; s --	for(i=0; i<nr_ctlr; i++) {s@@
n335,16 +335,7 y s 			hba[i]->cmd_pool_dhandle);n 	7kGree(hba[i]->cmd_pool_bIGs);n n-		iUR	g)@ vsk_head == &id _g)@ vsk[i]) {n-			g)@ vsk_head = id _g)@ vsk[i].next;n-		} )lse {s-			for(g=g)@ vsk_head; g; g=g->next) {s-				iUR	g->next == &id _g)@ vsk[i]) {n-					g->next = id _g)@ vsk[i].next;n-					bnuxk;
-				}M-			}M-		}M+		del_g)@ vsk(&id _g)@ vsk[i]);o 	}n 	e move_proc_ N@ry("cpqarray", proc_root_driver);o 	kGree(id );M@@
n550,8 +541,7 y s 		id _g)@ vsk[i].nr_real)= 0; n 	s 		ze'GetconI
ld) vsk 
 st 	/n-		id _g)@ vsk[i].next = g)@ vsk_head;
-		g)@ vsk_head = &id _g)@ vsk[i];o+		add_g)@ vsk(&id _g)@ vsk[i]);o n 		init_ti/*r(&hba[i]->ti/*r);n 	7hba[i]->ti/*r.expiars'= jMAKirs'+ IDA_TIMER;n@@
n1227,9 +1217,9 y s 	caseIIDAGETDRVINFO:d 		e unsi copy_to_user(&io->c.drv,&hba[ctlr]->drv[dsk], izeoftdrv_info_t));
 	caseIBLKGETSIZE:
-		iUR	!arg) e unsi -EINVAL;o-		put_user(id [(ctlr<<CTLR_SHIFT)+MINOR(inode->i_rdev)].nr_srcts, (lNER*)arg);o-		e unsi 0;
+		e unsi put_user(id [(ctlr<<CTLR_SHIFT)+MINOR(inode->i_rdev)].nr_srcts, (lNER*)arg);o+	caseIBLKGETSIZE64:M+		e unsi put_user((u64)(id [(ctlr<<CTLR_SHIFT)+MINOR(inode->i_rdev)].nr_srcts)0<< 9, 2@64*)arg);o 	caseIBLKRRPART:
 		e unsi revalid p,_
ogvol(inode->i_rdev, 1);n 	caseIIDAPASSTHRU:d@@
n1266,10 +1256,14 y s 	}	n s 	caseIBLKFLSBUF:d+	caseIBLKBSZSET:d+	caseIBLKBSZGET:d 	caseIBLKROSET:d 	caseIBLKROGET:d 	caseIBLKRASET:d 	caseIBLKRAGET:d+	caseIBLKELVGET:d+	caseIBLKELVSET:d 	caseIBLKPG:d 		e unsi blk_ioctl(inode->i_rdev, cmd, arg);R o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/floppy.c $(CONFdrivers/b dek/floppy.cP6 +35,9 @@
 #incldrivers/b dek/floppy.c	Sun Aug 12 13:27:59c-aica.o
 
 ifeqdrivers/b dek/floppy.c	Mon_
elN10o_2:42:31G_MEf @@
n124,6 +124,11 y s  * -  /suser/cap[1],/n  +/M 
+/*np *G_MEf/08/26CH) Paul Gortmaker - fix insmod oopR on machLi)sCwith nonp *Gfloppy coN@roller (
 igering task on 
 st af4er module pR gone...Tboom.)np */M+  _defLi) FLOPPY_SANITY_CHECK  _unzbH_ FLOPPY_SILENT_DCL_CLEARs h@@
n3492,6R+3497,10 y s 		caseIBLKGETSIZE:
 			ECALL	g)t_floppy_g)ometry(drive, type, &g));n 			e unsi put_user(g-> ize, (lNERc*) p
 am);np
+		caseIBLKGETSIZE64:M+			ECALL	g)t_floppy_g)ometry(drive, type, &g));n+			e unsi put_user((u64)g-> ize0<< 9, 2@64c*) p
 am);n 		ze'BLKRRPART pR not defLi)d asFfloppi
s don't haves 		 * p
  itt *+t[1],s+	/M @}s@@
n4144,7 +4153,7 y s 	e unsi 0;
 }n s-8  pF TiN@Thave_no_fdc= -EIO;n+8  pF TiN@Thave_no_fdc= -ENODEV;n   s iN@T__initGfloppy_init(ES <)n@@
n4200,7 +4209,6Ry s 		del_ti/*r(&fd_ti/*out);o 		blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));n 		devfs_unregis4er_blkdev(MAJOR_NR,"fd");o-		del_ti/*r(&fd_ti/*out);o 		e unsi -EBUSY;o 	}n n@@
n4259,9 +4267,7 y s 	iUR	have_no_fdc) n 	{o 		DPRINT("noGfloppy coN@rollersFfound\*");n-		floppy_tq.routLi) = (ES <c*)(ES <c*) empty;n-		m
 k_bh(IMMEDIATE_BH);n-		schedule();o+		eun_task_queue(&tq_immedi p,);n 		iUR	usage_count)M @		floppy_rulease_irq_and_dma();o 		blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));n@@
n4472,6R+4478,7 y s MODULE_PARM(FLOPPY_DMA,"i");n MODULE_AUTHOR("AlainIL. Knaff");n MODULE_SUPPORTED_DEVICE("fd");opMODULE_LICENSE("GPL");n   _)lseo o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/g)@hd.c $(CONFdrivers/b dek/g)@hd.cP6 +35,9 @@
 #incldrivers/b dek/g)@hd.c	W_FGJul 25 17:10:19c-aica.o
 
 ifeqdrivers/b dek/g)@hd.c	Sun 
elNg9o_2:00:55ble ch@@
n10,12 +10,137 y s  *  (
 iux@arm.uk.
 iux.org)M  +/M 
+/*np *GTODO:  rip outI
ld)e mainiERcinitGcrap H0xm 
lpR t
 
+CH)hchnp */M+  _maddr);
<
 ifeqconfig.h>s+vmaddr);
<
 ifeqmodule.h>s vmaddr);
<
 ifeqfs.h>s vmaddr);
<
 ifeqg)@hd.h>s vmaddr);
<
 ifeqkernel.h>s vmaddr);
<
 ifeqblk.h>s vmaddr);
<
 ifeqitit.h>s+vmaddr);
<
 ifeqspin dek.h>s+s+s+8  pF Trw dek_cCg)@ vsk_ dek;np
+/*np *GGlobal)kernel 
 st oGIp
  itt *iERcinformatt *.np *np *GXXX: you should _never_ atalra 
lpR diarctly.np *	
ld)onlycrea onI
lpR pR export_FGpR source compattblity.np */
+/*8  pF */Ty    cCg)@ vsk *ge@ vsk_head;
p
+EXPORT_SYMBOL(g)@ vsk_head);s+s+s+/**np *Gadd_g)@ vsk - add p
  itt *iERcinformatt *+toFkernel 
 stnp *G@gp: per-device p
  itt *iERcinformatt *np *np *GTlpR tunctt * regis4ersF
ld)p
  itt *iERcinformatt *+inI@gpnp *Gwith 
ld)kernel.np */
+ES <
+add_g)@ vsk(y    cCg)@ vsk *gp)np{o+	write_ dek(&g)@ vsk_ dek);o+	gp->next = ge@ vsk_head;
p	g)@ vsk_head = gp;o+	write_un dek(&g)@ vsk_ dek);o+}
p
+EXPORT_SYMBOL(add_g)@ vsk);s+s+s+/**np *Gdel_g)@ vsk - removeIp
  itt *iERcinformatt *+H0xm kernel 
 stnp *G@gp: per-device p
  itt *iERcinformatt *np *np *GTlpR tunctt * unregis4ersF
ld)p
  itt *iERcinformatt *+inI@gpnp *Gwith 
ld)kernel.np */
+ES <
+del_g)@ vsk(y    cCg)@ vsk *gp)np{o+	y    cCg)@ vsk **gpp;np
+	write_ dek(&g)@ vsk_ dek);o+	G_SM(gpp = &g)@ vsk_head; *gpp; gpp = &((*gpp)->next))
+		iUR	*gpp == gp)np		7bnuxk;
+	iUR	*gpp)np		*gpp = (*gpp)->next;o+	write_un dek(&g)@ vsk_ dek);o+}
p
+EXPORT_SYMBOL(del_g)@ vsk);s+s+s+/**np *Gg)t_g)@ vsk - getcp
  itt *iERcinformatt *+H_SMa givei devicenp *G@dev: device toFgetcp
  itt *iERcinformatt *+H_Snp *np *GTlpR tunctt * getsF
ld)y    cure coN@ainiERcp
  itt *iERnp *Ginformatt *+H_SM
ld)givei deviceG@dev.np */
+y    cCg)@ vsk *
+get_g)@ vsk(kdev_t dev)np{o+	y    cCg)@ vsk *gp =INULL;o+	int maj =CMAJOR(dev);s+M+	read_ dek(&g)@ vsk_ dek);o+	G_SM(gp = g)@ vsk_head; gp; gp = gp->next)
+		iUR	gp->major == maj)np		7bnuxk;
+	read_un dek(&g)@ vsk_ dek);o+
+	reunsi gp;o+}
p
+EXPORT_SYMBOL(get_g)@ vsk);s+s+s+vmfzbH_CONFIG_PROC_FS
+int
+get_p
  itt *_
 st(char *page,Tchar **8  rt, oGf_t oGfset, it4 count)Mp{o+	y    cCg)@ vsk *gp;o+	char buf[64];o+	int len, n;o+
+	len =Isp - 1f(page,T"major minor  #b deks0 name\n\*");n+	read_ dek(&g)@ vsk_ dek);o+	G_SM(gp = g)@ vsk_head; gp; gp = gp->next) {o+		G_SM(n)= 0; n <R	gp->nr_real)<< gp->minor_shift); n++) {s+			iUR	gp->p
  [n].nr_srcts0== 0)s+			@coN@ ife;np
+			len +=Isnp - 1f(page + len, 63,M+					"%4d  %4d %10d %s\n",s+					gp->major, n, gp-> izes[n],s+					 vsk_name	gp, n, buf));o+			iUR	len < oGfset)s+			@oGfset -= len, len =I0;
+			)lse iUR	len >= oGfset + count)Mp				go1o out;n+		}M+	}
p
+out:
+	read_un dek(&g)@ vsk_ dek);o+	*  
  +=Ipage + oGfset;
+	len -= oGfset;
+	iUR	len < 0)s+		len =I0;
+	reunsi len > count ? count :Tlen;o+}
pv)@ vNR+n   extern+int blk_dev_init(ES <);i vmfzbH_CONFIG_BLK_DEV_DAC960s@@
n33,6R+158,7 y s s iN@T__initGdevice_init(ES <)n {s+	rw dek_init(&g)@ vsk_ dek);o 	blk_dev_init();o 	sti();i vmfzbH_CONFIG_I2Oo(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/ll_rw_blk.c $(CONFdrivers/b dek/ll_rw_blk.cP6 +35,9 @@
 #incldrivers/b dek/ll_rw_blk.c	Sun Aug 12 13:27:59c-aica.o
 
 ifeqdrivers/b dek/ll_rw_blk.c	thu,
elN20 21:02:01G_MEf @@
n28,8 +28,7 y s vmaddr);
<asm/io.h>s vmaddr);
<
 ifeqblk.h>s vmaddr);
<
 ifeqhighmem.h>s-vmaddr);
<
 ifeqraid/md.h>s-s+vmaddr);
<
 ifeqslab.h>s vmaddr);
<
 ifeqmodule.h>s 
 zeo@@
n131,7 +130,7 y s 	e unsi max_sect_Ss[MAJOR(dev)][MINOR(dev)];M }n s-in Li) request_queue_t *__blk_g)t_queue(kdev_t dev)npin Li) request_queue_t *blk_g)t_queue(kdev_t dev)n {n 	y    cCb k_dev_y    cC*bdev =Ib k_dev + MAJOR(dev);s M@@
n141,22 +140,6Ry s 		e unsi &b k_dev[MAJOR(dev)].request_queue;M }n s-zeo- e'NOTE:I
ld) evice-specific queue() tunctt *so- e'have+to be atomic!o- e/
-request_queue_t *blk_g)t_queue(kdev_t dev)n-{
-	e quest_queue_t *ret;n-	@ vNRE_FGENERcflags;s-n-	spin_ dek_irqsave(&io_e quest_ dek,flags);
-	e u =I__blk_g)t_queue(dev);s-	spin_un dek_irqrestore(&io_e quest_ dek,flags);
-
-	e unsi ret;n-}
-s 8  pF TiN@T__blk_cleanup_queue(y    cC
 st_head *head)n {n 	y    cCe quest *rq;n@@
n990,12 +973,7 y s 	major = MAJOR(bhs[0]->b_dev);s M 	ze'DetermLi) corarct b dek  ize H_SM
lpR device. */d-	corarct_ ize = BLOCK_SIZE;M-	if (blk ize_ ize[major]) {n-		i = blk ize_ ize[major][MINOR(bhs[0]->b_dev)];
-		iUR	i)
-			corarct_ ize = i;n-	}M+	corarct_ ize = g)t_hardsrct_ ize(bhs[0]->b_dev);s M 	ze'VerifyRe quest_FGb dek  izes.+	/M 	G_SM(i+=I0; i < nr; i++) {s@@
n1272,7 +1250,6Ry s EXPORT_SYMBOL()@ _
lat_e quest_ ast);o EXPORT_SYMBOL(blk_itit_queue);o EXPORT_SYMBOL(blk_g)t_queue);
-EXPORT_SYMBOL(__blk_g)t_queue);o EXPORT_SYMBOL(blk_cleanup_queue);o EXPORT_SYMBOL(blk_queue_huxdacttve);o EXPORT_SYMBOL(blk_queue_make_e quest);o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/loop.c $(CONFdrivers/b dek/loop.cP6 +35,9 @@
 #incldrivers/b dek/loop.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/b dek/loop.c	Mon_
elN17b13:16:30G_MEfh@@
n62,6R+62,7 y s vmaddr);
<
 ifeqmajor.h>s vmaddr);
<
 ifeqwait.h>s vmaddr);
<
 ifeqblk.h>s+vmaddr);
<
 ifeqblkpg.h>s vmaddr);
<
 ifeqitit.h>s vmaddr);
<
 ifeqdevfs_fs_kernel.h>s vmaddr);
<
 ifeqsmp_ dek.h>s@@
n86,10 +87,12 y s 8  pF TiN@Ttransfer_none(y    cC
oop_device *lo, it4 cmd, char *raw_buf,s @		 char *
oop_buf, it4  ize, it4 real_b dek)n {n-	iUR	cmd0== READ)
-		memcpy(
oop_buf, raw_buf,  ize);n-	)lseo-		memcpy(raw_buf, 
oop_buf,  ize);n+	iUR	raw_buf != 
oop_buf) {s+		iUR	cmd0== READ)
p			memcpy(
oop_buf, raw_buf,  ize);n+		)lse
p			memcpy(raw_buf, 
oop_buf,  ize);n+	}n s 	e unsi 0;
 }n@@
n117,6 +120,7 y s s 8  pF TiN@Tnone_s 
tus(y    cC
oop_device *lo, y    cC
oop_info *info)
 {s+	lo-> d_flags |= LO_FLAGS_BH_REMAP;s 	e unsi 0;
 }n s@@
n313,9 +317,13Ry s 	e unsi ret;n }n s+8  pF TES <c
oop_)@ _io_transfer(y    cCbuffer_head *bh, it4 uptod p,);n 8  pF TES <c
oop_put_buffer(y    cCbuffer_head *bh)n {n-	iUR	bh) {s+	/*np	 * cheek b_)@ _io, may just be a)e mapp_FGbh and not anca  de p,d onenp	 */n+	iUR	bh &&Gbh->b_)@ _io0== 
oop_)@ _io_transfer) {s 		__free_page(bh->b_page);n 	7kmem_cache_Gree(bh_cachep, bh);o 	}n@@
n385,6R+393,14 y s {n 	y    cCbuffer_head *bh;o 
+	/*np	 * G_SMxfer_tuncs+
lat,cancoperaceconI
ld) ameRbh, do+
latnp	 */n+	iUR	lo-> d_flags & LO_FLAGS_BH_REMAP) {s+		bh = rbh;o+		go1o out_bh;o+	}n+
 	do+{s 		bh = kmem_cache_a  de(bh_cachep, SLAB_NOIO);n 		iUR	bh)n@@
n397,9 +413,6 y s s 	bh->b_ ize = rbh->b_ ize;s 	bh->b_dev =Irbh->b_rdev;n-	spin_ dek_irq(&lo-> d_ dek);o-	bh->b_rdev = 
o-> d_device;s-	spin_un dek_irq(&lo-> d_ dek);o 	bh->b_  
te = (10<< BH_Req) |I(10<< BH_Mapp_F) |I(10<< BH_Ldek);o M 	zes@@
n418,9 +431,15 y s s 	bh->b_data)=Ipage_ain_urc(bh->b_page);n 	bh->b_)@ _io0= 
oop_)@ _io_transfer;o-	bh->b_r ect_SM=Irbh->b_r ect_SM+R	lo-> d_oGfset >> 9);n+	bh->b_priv
te = rbh;o 	init_waitqueue_huxd(&bh->b_wait);o 
+out_bh:n+	bh->b_r ect_SM=Irbh->b_r ect_SM+R	lo-> d_oGfset >> 9);n+	spin_ dek_irq(&lo-> d_ dek);o+	bh->b_rdev = 
o-> d_device;s+	spin_un dek_irq(&lo-> d_ dek);o+s 	e unsi bh;o }n n@@
n475,8 +494,7 y s 	 * piggy old)bufferRonIoriginal, and submit G_SMI/Os 	 */n 	bh0= 
oop_g)t_buffer(lo, rbh);o-	bh->b_priv
te = rbh;o-	IV0= 
oop_g)t_iv(lo, bh->b_r ect_S);o+	IV0= 
oop_g)t_iv(lo, rbh->b_r ect_S);o 	iUR	rw0== WRITE) {s 		s)t_bit(BH_Dirty, &bh->b_  
te);n 		iUR	 d_do_transfer(lo, WRITE, bh->b_data, rbh->b_data,h@@
n600,7 +618,7 y s 	err_SM=I-EBUSY;o 	iUR	lo-> d_  
te != Lo_unbound)M @	go1o out;n-	 o+s 	err_SM=I-EBADF;n 	fi], =Ifg)t(arg);o 	iUR	!fi],)h@@
n620,7 +638,6Ry s 		 * If we can'tcruxd - soray. If we onlyccan'tcwrite - well,s 		 * it'R going to be e xd-only.s 		 */n-		err_SM=I-EINVAL;o 		iUR	!aops->readpage)M @		go1o out_putf;s M@@
n848,11 +865,18 y s 			errC= -ENXIO;n 			bnuxk;
 		}M-		iUR	!arg) {n-			errC= -EINVAL;o+		errC= put_user(
oop_ izes[lo-> d_numb
r]0<< 1, (lNERc*) arg);o+		bnuxk;
+	caseIBLKGETSIZE64:M+		iUR	lo-> d_  
te != Lo_bound) {s+			errC= -ENXIO;n 			bnuxk;
 		}M-		errC= put_user(
oop_ izes[lo-> d_numb
r]0<< 1, (lNERc*) arg);o+		errC= put_user((u64)
oop_ izes[lo-> d_numb
r]0<< 10, 2@64*)arg);o+		bnuxk;
+	caseIBLKBSZGET:d+	caseIBLKBSZSET:d+		errC= blk_ioctl(inode->i_rdev, cmd, arg);R 		bnuxk;
 	default:M @	errC= lo->ioctl ? lo->ioctl(lo, cmd, arg) : -EINVAL;o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/nbd.c $(CONFdrivers/b dek/nbd.cP6 +35,9 @@
 #incldrivers/b dek/nbd.c	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/b dek/nbd.c	Mon_
elN10o_2:42:31G_MEf @@
n446,6 +446,8 y s v)@ vNR 	caseIBLKGETSIZE:
 		e unsi put_user(nbd_byte izes[dev] >> 9, (lNERc*) arg);o+	caseIBLKGETSIZE64:M+		e unsi put_user((u64)nbd_byte izes[dev], 2@64c*) arg);R 	}
 	e unsi -EINVAL;o }n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/paride/bpck6.c $(CONFdrivers/b dek/paride/bpck6.cP6 +35,9 @@
 #incldrivers/b dek/paride/bpck6.c	Sun May 20 12:11:38c-aica.o
 
 ifeqdrivers/b dek/paride/bpck6.c	Mon_
elN17b22:52:34G_MEf @@
n28,7 +28,7 y s vdefLi) EXPORT_SYMTAB s vmaddr);
<
 ifeqmodule.h>s vmaddr);
<
 ifeqkernel.h>s-vmaddr);
<
 ifeqma  de.h>s+vmaddr);
<
 ifeqslab.h>s vmaddr);
<
 ifeqtypes.h>s vmaddr);
<asm/io.h>s n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/paride/pd.c $(CONFdrivers/b dek/paride/pd.cP6 +35,9 @@
 #incldrivers/b dek/paride/pd.c	Sat,Apr 28 11:27:53c-aica.o
 
 ifeqdrivers/b dek/paride/pd.c	Mon_
elN10o_2:42:31G_MEf @@
n287,6 +287,7 y s 8  pF Ty    cChd_y    cCpd_hd[PD_DEVS];R 8  pF TiN@Tpd_ izes[PD_DEVS];R 8  pF TiN@Tpd_b deksizes[PD_DEVS];R+8  pF TiN@Tpd_maxsect_Ss[PD_DEVS];R s vdefLi) PD_NAMELEN	8s h@@
n343,16 +344,13Ry s extern+y    cCb dek_device_operact *s pd_fops;n s 8  pF Ty    cCg)@ vsk pd_g)@ vsk =l{ -        PD_MAJOR,       ze'Major numb
rC*/ -        PD_NAME,        ze'Major nameR*/M-        PD_BITS,        ze'BIGs+toFshift+toFgetcreal)H0xm p
  itt *+*/M-        PD_PARTNS,      ze'Numb
rCoGIp
  itt *s percreal)*/M-        pd_hd,          ze'hdTy    cC*/M-        pd_ izes,       ze'b dek  izesC*/M-        0,              ze'numb
rC*/M-        NULL,           ze'stternal)*/M-        NULL,           ze'next */M-	&pd_fops,       ze'b dek device operact *s */M+	major:		PD_MAJOR,M+	major_name:	PD_NAME,M+	minor_shift:	PD_BITS,M+	max_p:		PD_PARTNS,M+	p
  :		pd_hd,M+	 izes:		pd_ izes,M+	fops:		&pd_fops,s };n s 8  pF Ty    cCb dek_device_operact *s pd_fops =l{ @@
n385,56 +383,6 y s 	}
 }n s-8  pF TiN Li) iN@Tpd_/bo_segment(e quest_queue_t *q, y    cCe quest *req, it4 max_segments)n-{
-	iUR	max_segments > clus4er)
-		max_segments = clus4er;
-
-	iUR	req->nr_segments < max_segments) {n-		req->nr_segments++;o-		e unsi 1;n-	}M-	e unsi 0;
-}
-s-8  pF TiN@Tpd_baek_merge_fn(e quest_queue_t *q, y    cCe quest *req, n-			         cCbuffer_head *bh, it4 max_segments)n-{
-	iUR	req->bhtail->b_data)+ req->bhtail->b_ ize == bh->b_data)o-		e unsi 1;n-	e unsi pd_/bo_segment(q, req, max_segments);
-}
-s-8  pF TiN@Tpd_H0xnt_merge_fn(e quest_queue_t *q, y    cCe quest *req, n-			          cCbuffer_head *bh, it4 max_segments)n-{
-	iUR	bh->b_data)+ bh->b_ ize == req->bh->b_data)o-		e unsi 1;n-	e unsi pd_/bo_segment(q, req, max_segments);
-}
-s-8  pF TiN@Tpd_merge_e quests_fn(e quest_queue_t *q, y    cCe quest *req,n-				     cCe quest *next, it4 max_segments)n-{
-	iN@Ttotal_segments = req->nr_segments + next->nr_segments;
-	int  ame_segment;
-
-	iUR	max_segments > clus4er)
-		max_segments = clus4er;
-
-	 ame_segment =I0;
-	iUR	req->bhtail->b_data)+ req->bhtail->b_ ize == next->bh->b_data) {n-		total_segments--;n-		same_segment =I1;n-	}M-    n-	iUR	total_segments > max_segments)n-		e unsi 0;
-
-	e q->nr_segments =Ttotal_segments;n-	e unsi 1;n-}
-s iN@Tpd_initG(ES <)n 
 {       int i;n@@
n448,19 +396,18 y s         }s 	q = BLK_DEFAULT_QUEUE(MAJOR_NR);M @blk_itit_queue(q, DEVICE_REQUEST);n-	q->baek_merge_fnC= pd_baek_merge_fn;n-	q->H0xnt_merge_fnC= pd_H0xnt_merge_fn;n-	q->merge_e quests_fnC= pd_merge_e quests_fn;o         e xd_ahead[MAJOR_NR] = 8;       ze'8c ect_SM(4kB) e xd aheadC*/M         
 	pd_g)@ vsk.major = major;
 	pd_g)@ vsk.major_name = name;n-	pd_g)@ vsk.next = g)@ vsk_head;
-	g)@ vsk_head = &pd_g)@ vsk;np	add_g)@ vsk(&pd_g)@ vsk);n i 	for(i=0;i<PD_DEVS;i++) pd_b deksizes[i] = 1024;M @blk ize_ ize[MAJOR_NR] = pd_b deksizes;o 
+	for(i=0;i<PD_DEVS;i++) pd_maxsect_Ss[i] = clus4er;
+	max_sect_Ss[MAJOR_NR] = pd_maxsect_Ss;n+
 	p - 1;
"%s: %s verst *+%s, major %d, clus4er %d, nice %d\n",s 		name,name,PD_VERSION,major,clus4er,nice);
 	pd_itit_utits();n@@
n535,6R+482,8 y s                 iUR	err) e unsi 	err);s                 put_user(pd_hd[dev].nr_srcts,(lNERc*) arg);o                 e unsi 	0);np            caseIBLKGETSIZE64:M+                e unsi put_user((u64)pd_hd[dev].nr_srcts0<< 9, 2@64c*)arg);o             caseIBLKRRPART:
 		iUR	!cap[1],(CAP_SYS_ADMIN))M @		e unsi -EACCES;s@@
n642,12 +591,12 y s 	int utit;n i         devfs_unregis4er_blkdev(MAJOR_NR,name);s-        for(gdp=&g)@ vsk_head;*gdp;gdp=&((*gdp)->next))
-                iUR	*gdp == &pd_g)@ vsk) bnuxk;
-        iUR	*gdp) *gdp = (*gdp)->next;np	del_g)@ vsk(&pd_g)@ vsk);n i 	for (utit=0;utit<PD_UNITS;utit++) d 	   iUR	PD.present) pi_rulease(PI);o+
+	max_sect_Ss[MAJOR_NR] = NULL;o }n s v)@ vNR(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/paride/pf.c $(CONFdrivers/b dek/paride/pf.cP6 +35,9 @@
 #incldrivers/b dek/paride/pf.c	Sun Febo'4 10:05:29c-aica.o
 
 ifeqdrivers/b dek/paride/pf.c	Mon_
elN10o_2:42:31G_MEf @@
n482,11 +482,9 y s                 put_user(0,(lNERc*)&g)o->8  rt);o                 e unsi 0;o             caseIBLKGETSIZE:
-                iUR	!arg) e unsi -EINVAL;o-                errC= verify_anux(VERIFY_WRITE,(lNERc*) arg, izeoftlNER));
-                iUR	err) e unsi 	err);s-                put_user(PF.cap[city,(lNERc*) arg);o-                e unsi 	0);np                e unsi put_user(PF.cap[city,(lNERc*) arg);op            caseIBLKGETSIZE64:M+                e unsi put_user((u64)PF.cap[city0<< 9,2@64c*)arg);o 	    caseIBLKROSET:d 	    caseIBLKROGET:d 	    caseIBLKRASET:d(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/paride/ppc6lnx.c $(CONFdrivers/b dek/paride/ppc6lnx.cP6 +35,9 @@
 #incldrivers/b dek/paride/ppc6lnx.c	Fri,Apr  6 10:42:55c-aica.o
 
 ifeqdrivers/b dek/paride/ppc6lnx.c	Fri,
elNg7 09:28:38c-aica@@
n108,28 +108,11 y s 8  pF Tu8 ppc6_rd_data_byte(PPC *ppc);n 8  pF Tu8 ppc6_rd_port(PPC *ppc,Tu8 port);o 8  pF TES <cppc6_wr_port(PPC *ppc,Tu8 port,Tu8 data);s-8  pF Tu8 ppc6_rd_reg(PPC *ppc,Tu8 reg);s-8  pF TES <cppc6_wr_reg(PPC *ppc,Tu8 reg,Tu8 data);s-8  pF Tu8 ppc6_verst *(PPC *ppc);n 8  pF TES <cppc6_rd_data_blk(PPC *ppc,Tu8 *data, lNERccount);o 8  pF TES <cppc6_wait_for_fifo(PPC *ppc);n 8  pF TES <cppc6_wr_data_blk(PPC *ppc,Tu8 *data, lNERccount);o 8  pF TES <cppc6_rd_port16_blk(PPC *ppc,Tu8 port,Tu8 *data, lNERclength);s-8  pF Tu16cppc6_rd_port16(PPC *ppc,Tu8 port);o-8  pF TES <cppc6_wr_port16(PPC *ppc,Tu8 port,Tu16cdata);s 8  pF TES <cppc6_wr_port16_blk(PPC *ppc,Tu8 port,Tu8 *data, lNERclength);s-8  pF Tu8 ppc6_rd_eeprom_reg(PPC *ppc);o-8  pF TES <cppc6_wr_eeprom_reg(PPC *ppc,Tu8 data);s-8  pF TES <cppc6_eeprom_8  rt(PPC *ppc);o-8  pF TES <cppc6_eeprom_)@ (PPC *ppc);o-8  pF TES <cppc6_s)t_cs(PPC *ppc);o-8  pF TES <cppc6_reset_cs(PPC *ppc);o-8  pF Tu8 ppc6_rd_eeprom_bit(PPC *ppc);o-8  pF TES <cppc6_eeprom_e xdy_wait(PPC *ppc);o-8  pF TES <cppc6_wr_eeprom_bit(PPC *ppc,Tu8 bit);s-8  pF Tu16cppc6_eeprom_e xd(PPC *ppc,Tu8 ain_);o-8  pF Tu8 ppc6_irq_test(PPC *ppc);o-8  pF Tu8 ppc6_rd_extout(PPC *ppc);n 8  pF TES <cppc6_wr_extout(PPC *ppc,Tu8 regdata);s 8  pF TiN@Tppc6_ope*(PPC *ppc);n 8  pF TES <cppc6_close(PPC *ppc);n@@
n304,7 +287,7 y s s 8  pF Tu8 ppc6_rd_data_byte(PPC *ppc)n {n-	u8 data;np	u8 data =I0;
 d 	switch(ppc->mode)
 	{
@@
n393,33 +376,6 y s s //***************************************************************************n s-8  pF Tu8 ppc6_rd_reg(PPC *ppc,Tu8 reg)n-{
-	ppc6_s)nd_cmd(ppc,2@8)(reg | ACCESS_REG | ACCESS_READ));
-
-	e unsi(ppc6_rd_data_byte(ppc));
-}
-s-//***************************************************************************n-s-8  pF TES <cppc6_wr_reg(PPC *ppc,Tu8 reg,Tu8 data)n-{
-	ppc6_s)nd_cmd(ppc,2@8)(reg | ACCESS_REG | ACCESS_WRITE));
-
-	ppc6_wr_data_byte(ppc, data);s-}
-s-//***************************************************************************n-s-8  pF Tu8 ppc6_verst *(PPC *ppc)n-{
-	ppc6_s)nd_cmd(ppc,2REG_VERSION | ACCESS_REG | ACCESS_READ));
-
-	e unsi(ppc6_rd_data_byte(ppc) & 0x3F);s-}
-s-//***************************************************************************n-s 8  pF TES <cppc6_rd_data_blk(PPC *ppc,Tu8 *data, lNERccount)s {n 	ywitch(ppc->mode)
@@
n708,44 +664,6 y s s //***************************************************************************n s-8  pF Tu16cppc6_rd_port16(PPC *ppc,Tu8 port)n-{
-	u16cdata;
-
-	ppc6_s)nd_cmd(ppc, (CMD_PREFIX_SET | PREFIX_IO16));
-
-	ppc6_s)nd_cmd(ppc, (@8)(port | ACCESS_PORT | ACCESS_READ));
-
-	data)=Ippc6_rd_data_byte(ppc);
-
-	ppc6_s)nd_cmd(ppc, (@8)(port | ACCESS_PORT | ACCESS_READ));
-
-	data)+= (u16)ppc6_rd_data_byte(ppc) << 8;
-
-	ppc6_s)nd_cmd(ppc, (CMD_PREFIX_RESET | PREFIX_IO16));
-
-	e unsi(data);s-}
-s-//***************************************************************************n-s-8  pF TES <cppc6_wr_port16(PPC *ppc,Tu8 port,Tu16cdata)n-{
-	ppc6_s)nd_cmd(ppc, (CMD_PREFIX_SET | PREFIX_IO16));
-
-	ppc6_s)nd_cmd(ppc, (@8)(port | ACCESS_PORT | ACCESS_WRITE));
-
-	ppc6_wr_data_byte(ppc, (@8)data);s-
-	ppc6_s)nd_cmd(ppc, (@8)(port | ACCESS_PORT | ACCESS_WRITE));
-
-	ppc6_wr_data_byte(ppc, (@8)(data >> 8));
-
-	ppc6_s)nd_cmd(ppc, (CMD_PREFIX_RESET | PREFIX_IO16));
-}
-s-//***************************************************************************n-s 8  pF TES <cppc6_wr_port16_blk(PPC *ppc,Tu8 port,Tu8 *data, lNERclength)s {n 	length =clength0<< 1;n@@
n762,148 +680,6Ry s 	ppc6_wr_data_blk(ppc, data,clength);s s 	ppc6_s)nd_cmd(ppc, (CMD_PREFIX_RESET | PREFIX_IO16 | PREFIX_BLK));s-}
-s-//***************************************************************************n-s-8  pF Tu8 ppc6_rd_eeprom_reg(PPC *ppc)n-{
-	ppc6_s)nd_cmd(ppc, (REG_EEPROM | ACCESS_REG | ACCESS_READ));
-
-	e unsi(ppc6_rd_data_byte(ppc));
-}
-s-//***************************************************************************n-s-8  pF TES <cppc6_wr_eeprom_reg(PPC *ppc,Tu8 data)n-{
-	ppc6_s)nd_cmd(ppc, (REG_EEPROM | ACCESS_REG | ACCESS_WRITE));
-
-	ppc6_wr_data_byte(ppc, data);s-}
-s-//***************************************************************************n-s-8  pF TES <cppc6_eeprom_8  rt(PPC *ppc)n-{
-	ppc6_wr_eeprom_reg(ppc, EEPROM_EN);s-}
-s-//***************************************************************************n-s-8  pF TES <cppc6_eeprom_)@ (PPC *ppc)n-{
-	ppc6_wr_eeprom_reg(ppc, 0);s-}
-s-//***************************************************************************n-s-8  pF TES <cppc6_set_cs(PPC *ppc)n-{
-	ppc6_wr_eeprom_reg(ppc, (@8)(ppc6_rd_eeprom_reg(ppc) | EEPROM_CS));
-}
-s-//***************************************************************************n-s-8  pF TES <cppc6_reset_cs(PPC *ppc)n-{
-	ppc6_wr_eeprom_reg(ppc, (@8)(ppc6_rd_eeprom_reg(ppc) & ~EEPROM_CS));
-}
-s-//***************************************************************************n-s-8  pF Tu8 ppc6_rd_eeprom_bit(PPC *ppc)n-{
-	ppc6_s)nd_cmd(ppc, (REG_STATUS | ACCESS_REG | ACCESS_READ));
-
-	iUR	ppc6_rd_data_byte(ppc) & STATUS_EEPROM_DO)n-		e unsi(1);n-	)lseo-		e unsi(0);s-}
-s-//***************************************************************************n-s-8  pF TES <cppc6_eeprom_e xdy_wait(PPC *ppc)n-{
-	ppc6_s)t_cs(ppc);
-
-	wh
 
(ppc6_rd_eeprom_bit(ppc));
-
-	ppc6_reset_cs(ppc);
-}
-s-//***************************************************************************n-s-8  pF TES <cppc6_wr_eeprom_bit(PPC *ppc,Tu8 bit)n-{
-	u8 eereg;
-
-	eereg)=Ippc6_rd_eeprom_reg(ppc);
-
-	eereg)&= ~(EEPROM_SK | EEPROM_DI);
-
-	iUR	bit & 1)n-		eereg)|= EEPROM_DI;
-
-	ppc6_wr_eeprom_reg(ppc, eereg);
-
-	eereg)|= EEPROM_SK;
-
-	ppc6_wr_eeprom_reg(ppc, eereg);
-
-	eereg)&= ~EEPROM_SK;
-
-	ppc6_wr_eeprom_reg(ppc, eereg);
-}
-s-//***************************************************************************n-s-8  pF Tu16cppc6_eeprom_e xd(PPC *ppc,Tu8 ain_)n-{
-	iN@Ti;n-	u16cdata;
-
-	ppc6_s)t_cs(ppc);
-
-	ppc6_wr_eeprom_bit(ppc,T1); // S 
  +bit
-
-	ppc6_wr_eeprom_bit(ppc,T1); // opcodeN10o(ruxd)
-	ppc6_wr_eeprom_bit(ppc,T0);s-n-	G_S(i=0; i<6; i++)o-		ppc6_wr_eeprom_bit(ppc,T(@8)((addr >> (5 - i)) & 1));
-
-	data)=I0;s-n-	G_S(i=0; i<16; i++)o-	{o-		ppc6_wr_eeprom_bit(ppc,0);s-n-		data)=I(data << 1) | ppc6_rd_eeprom_bit(ppc);n-	}M-
-	ppc6_reset_cs(ppc);
-
-	e unsi(data);s-}
-s-//***************************************************************************n-s-8  pF Tu8 ppc6_irq_test(PPC *ppc)n-{
-	ppc6_s)nd_cmd(ppc,2REG_STATUS | ACCESS_REG | ACCESS_READ));
-
-	e unsi(ppc6_rd_data_byte(ppc) & STATUS_IRQA);
-}
-s-//***************************************************************************n-s-8  pF Tu8 ppc6_rd_extout(PPC *ppc)n-{
-	ppc6_s)nd_cmd(ppc,2REG_VERSION | ACCESS_REG | ACCESS_READ));
-
-	e unsi((ppc6_rd_data_byte(ppc) & 0xC0) >> 6);o }n s //***************************************************************************n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/ps2esdi.c $(CONFdrivers/b dek/ps2esdi.cP6 +35,9 @@
 #incldrivers/b dek/ps2esdi.c	W_FGJul 25 17:10:19c-aica.o
 
 ifeqdrivers/b dek/ps2esdi.c	Fri,
elN14G14:04:07c-aica@@
n157,16 +157,14 y s s 8  pF Ty    cCg)@ vsk ps2esdi_g)@ vsk =
l{ -	MAJOR_NR,		ze'Major numb
rC*/ -	"ed",			ze'Major nameR*/M-	6,			ze'BIGs+toFshift+toFgetcreal)H0xm p
  itt *+*/M-	10<< 6,			ze'Numb
rCoGIp
  itt *s percreal) vsk */M-	ps2esdi,		ze'hdTy    cC*/M-	ps2esdi_ izes,		ze'b dek  izesC*/M-	0,			ze'numb
rC*/M-	(ES <c*) ps2esdi_info,	ze'stternal)*/M-	NULL,			ze'next */M-	&ps2esdi_fops,          ze't
 
+operact *s */M+	major:		MAJOR_NR,M+	major_name:	"ed",M+	minor_shift:	6,M+	max_p:		10<< 6,M+	p
  :		ps2esdi,M+	 izes:		ps2esdi_ izes,M+	real_devices:	(ES <c*)ps2esdi_info,M+	fops:		&ps2esdi_fops,s };n s ze'stittalizatt *+routLi) call_FGby ll_rw_blk.c   +/M@@
n184,8 +182,7 y s 	e xd_ahead[MAJOR_NR] = 8;	ze'8c ect_SM(4kB) e xd aheadC*/M M 	ze'someRminor housekeeping -  etupM
ld)global)g)@ vsk y    cure */M-	ps2esdi_g)@ vsk.next = g)@ vsk_head;
-	g)@ vsk_head = &ps2esdi_g)@ vsk;np	add_g)@ vsk(&ps2esdi_g)@ vsk);
 	ps2esdi_g)@init();o 	e unsi 0;
 }				ze'ps2esdi_init +/M@@
n200,6 +197,7 y s MODULE_PARM(cyl, "i");n MODULE_PARM(head, "i");n MODULE_PARM(track, "i");npMODULE_LICENSE("GPL");n   int stit_module(ES <) {n 	int drive;
@@
n223,15 +221,15 y s ES <
ccleanup_module(ES <)n {n-	if(ps2esdi_ lot)o-	{o+	if(ps2esdi_ lot) {s 		mca_m
 k_as_unused(ps2esdi_ lot);s 		mca_set_adap4er_procfn(ps2esdi_ lot, NULL, NULL);R 	}
 	e lease_region(io_base, 4);n 	free_dma(dma_arb_level);o-  	free_irq(PS2ESDI_IRQ, NULL)M+  	free_irq(PS2ESDI_IRQ, NULL);
 	devfs_unregis4er_blkdev(MAJOR_NR, "ed");np	del_g)@ vsk(&ps2esdi_g)@ vsk);
 	blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));n }n v)@ vN ze'MODULE +/M@@
n1117,6 +1115,9 y s 			}
 			bnuxk;
 
+		caseIBLKGETSIZE64:M+			e unsi put_user((u64)ps2esdi[MINOR(inode->i_rdev)].nr_srcts0<< 9, 2@64 *) arg);o+
 		caseIBLKRRPART:
                         iUR	!cap[1],(CAP_SYS_ADMIN)) s @		@e unsi -EACCES;s@@
n1127,6 +1128,8 y s 		caseIBLKRASET:d 		caseIBLKRAGET:d 		caseIBLKFLSBUF:d+		caseIBLKBSZGET:d+		caseIBLKBSZSET:d 		caseIBLKPG:d 			e unsi blk_ioctl(inode->i_rdev, cmd, arg);R 		}
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/rd.c $(CONFdrivers/b dek/rd.cP6 +35,9 @@
 #incldrivers/b dek/rd.c	W_FGJul 25 17:10:19c-aica.o
 
 ifeqdrivers/b dek/rd.c	Fri,
elN21b13:16:32G_MEf @@
n100,7 +100,7 y s 8  pF TiN@Trd_b deksizes[NUM_RAMDISKS];		ze'Size oGI1024 byte b deks0:)  +/M 8  pF TiN@Trd_kb ize[NUM_RAMDISKS];		ze'Size in b deks0oGI1024 bytes +/M 8  pF Tdevfs_handle_t devfs_handle;M-8  pF Ty    cCinode *rd_itode[NUM_RAMDISKS];	ze'Protrct_FGdevice itodes */
+y  pF Ty    cCb dek_device *rd_bdev[NUM_RAMDISKS];ze'Protrct_FGdevice data */M M /*n  * P
 ametersFfoSM
ld)boot-loading oGI
ld)RAM) vsk.  These are'setcbyM@@
n187,6 +187,132 y s v)@ vNR M /*np *GCopyright (C)G_ME0 L ifs Torvalds.np *               _ME0 Transmeta Corp.np * aops copi_FGH0xm  amfs.np */
+y  pF TiN@Tram vsk_readpage(y    cCt
 
+*t
 
, y    cCpage * page)M+{n+	iUR	!Page_Uptod p,(page)) {s+		memset(kmap(page), 0, PAGE_CACHE_SIZE);o+		kunmap(page);o+		flush_dcache_page(page);o+		SetPageUptod p,(page);o+	}n+	Un dekPage(page);o+	e unsi 0;
+}np
+/*np *GWrittng: just make sure 
ld)p
ge getsFm
 k_FGdirty, so+
latnp *G
ld)p
ge s4ealer won't grab it.np */
+y  pF TiN@Tram vsk_writepage(y    cCpage *page)M+{n+	SetPageDirty(page);o+	Un dekPage(page);o+	e unsi 0;
+}np
+y  pF TiN@Tram vsk_prepare_write(y    cCt
 
+*t
 
, y    cCpage *page,T@ vNRE_FGoGfset, @ vNRE_FGto)M+{n+	iUR	!Page_Uptod p,(page)) {s+		ES <c*addr =Ipage_ain_urc(page);o+		memset(ain_, 0, PAGE_CACHE_SIZE);o+		flush_dcache_page(page);o+		SetPageUptod p,(page);o+	}n+	SetPageDirty(page);o+	e unsi 0;
+}np
+y  pF TiN@Tram vsk_commit_write(y    cCt
 
+*t
 
, y    cCpage *page,T@ vNRE_FGoGfset, @ vNRE_FGto)M+{n+	e unsi 0;
+}np
+y  pF Ty    cCain_urc_space_operact *s ram vsk_aops =l{ +	readpage:Tram vsk_readpage,o+	writepage:Tram vsk_writepage,M+	prepare_write:Tram vsk_prepare_write,M+	commit_write:Tram vsk_commit_write,M+};np
+y  pF TiN@Trd_blkdev_pagecache_IO(st4 rw,      cCbuffer_head * sbh, it4 minor)Mp{o+	y    cCain_urc_space * mapptng;np	u vNRE_FGENERcindex;o+	int oGfset,  ize, err;o+
+	errC= -EIO;n+	errC= 0;
+	mapptng = rd_bdev[minor]->bd_itode->i_mapptng;npo+	index =Isbh->b_r ect_SM>> (PAGE_CACHE_SHIFT - 9);n+	oGfset = (sbh->b_r ect_SM<< 9) & ~PAGE_CACHE_MASK;
+	 ize =Isbh->b_ ize;spo+	do+{s+	@it4ccount;o+		y    cCpage *e'hash;o+		y    cCpage *Cpage;o+		char * src, *Gdst;o+		int ut dek = 0;
+o+		count = PAGE_CACHE_SIZE - oGfset;
+		iUR	count >  ize)M+			count =  ize;sp		 ize -=ccount;o+sp		hash =Ipage_hash(mapptng,cindex);o+		page =I__find_get_p
ge(mapptng,cindex,'hash);
+		iUR	!page) {s+			page =Igrab_cache_page(mapptng,cindex);o+			errC= -ENOMEM;s+			iUR	!page)M+				go1o out;n+			errC= 0;
+s+			iUR	!Page_Uptod p,(page)) {s+				memset(kmap(page), 0, PAGE_CACHE_SIZE);o+				kunmap(page);o+				flush_dcache_page(page);o+				SetPageUptod p,(page);o+			}
p
+			ut dek = 1;n+		}M+o+		index++;o+
+		iUR	rw0== READ) {s+			src = kmap(page);o+			src += oGfset;
+			dstC= bh_kmap(sbh);
+		} )lse {s+			dstC= kmap(page);o+			dstC+= oGfset;
+			src = bh_kmap(sbh);
+		}
+		oGfset = 0;
+s+		memcpy(dst, src, count);o+o+		kunmap(page);o+		bh_kunmap(sbh);
+
+		iUR	rw0!= READ)
p			SetPageDirty(page);o+		iUR	un dek)np			Un dekPage(page);o+		__free_page(page);o+	} wh
 
 (size);n+np out:
+	reunsi err;o+}np
+/*n  *  Basically, my     p,gy here pR toFse4 up aCbuffer-head wh
chccan'tcben  *  deleted, and make 
lat,my Ram vsk.  IfI
ld)e quest pR outside oGI
ldn  *  a  de p,d  ize, we must getcriFGoG it...s@@
n198,10 +324,7 y s {s 	u vNRE_FGit4 minor;s 	u vNRE_FGENERcoGfset, len;o-	y    cCbuffer_head *rbh;o-	char *bdata;
 n-	s 	minor = MINOR(sbh->b_rdev);
 n 	iUR	minor >= NUM_RAMDISKS)
@@
n221,20 +344,8 y s 		go1o fail;o 	}n n-	rbh0= getblk(sbh->b_rdev,Isbh->b_r ect_S/(sbh->b_ ize>>9),Isbh->b_ ize);n-	ze'IM
lpnk 
lat,it pR safe+to assume 
lat,rbh0pR not in HighMem, 
loughn-	 * sbh might be - NeilBrownn-	 */M-	bdata)=Ibh_kmap(sbh);
-	iUR	rw0== READ) {s-		iUR	sbh != rbh)
-			memcpy(bdata, rbh->b_data, rbh->b_ ize);n-	} )lseo-		iUR	sbh != rbh)
-			memcpy(rbh->b_data, bdata, rbh->b_ ize);n-	bh_kunmap(sbh);
-	m
 k_buffer_protrct_F(rbh);o-	br)lse(rbh);o+	iUR	rd_blkdev_pagecache_IO(rw,  bh, minor))o+		go1o fail;o n 	ybh->b_)@ _io(sbh,1);o 	e unsi 0;
@@
n245,10 +356,11 y s s 8  pF TiN@Trd_ioctl(y    cCinode *inode,      cCt
 
+*t
 
, u vNRE_FGit4 cmd, u vNRE_FGENERcarg)M {o+	int err_SM=I-EINVAL;o 	u vNRE_FGit4 minor;s o 	iUR	!inode || !inode->i_rdev) 	n-		e unsi -EINVAL;o+		go1o out;n s 	minor = MINOR(inode->i_rdev);s M@@
n259,26 +371,29 y s 			ze'special: we waN@Tto e leaseI
ld)eam vsk memory,s @		   it'R not like with 
ld)o
ldrCb dekdevices wheres @		   
lpR poctl onlycflushes awayM
ld)bufferRcache. */d-			iUR	(atomic_e xd(&inode->i_bdev->bd_ope*ers) > 2))
-				e unsi -EBUSY;o-			destroy_buffers(inode->i_rdev);s-			rd_b deksizes[minor] =I0;
+			)rr_SM=I-EBUSY;o+			down(&inode->i_bdev->bd_sem);o+			iUR	inode->i_bdev->bd_ope*ers <= 2) {s+				   ne p,_itode_pages(inode->i_mapptng,c0);o+				)rr_SM=I0;o+			}
p			up(&inode->i_bdev->bd_sem);o 			bnuxk;
-
          	caseIBLKGETSIZE:   ze'R unsi device  ize */d-			iUR	!arg)  e unsi -EINVAL;o-			e unsi put_user(rd_kb ize[minor] << 1, (lNERc*) arg);o-s+			iUR	!arg)M+			7bnuxk;
+			)rr_SM=Iput_user(rd_kb ize[minor] << 1, (lNERc*) arg);op		7bnuxk;
+         	caseIBLKGETSIZE64:M+			)rr_SM=Iput_user((u64)rd_kb ize[minor]<<10, 2@64*)arg);o+			bnuxk;
 		caseIBLKROSET:d 		caseIBLKROGET:d 		caseIBLKSSZGET:d-			e unsi blk_ioctl(inode->i_rdev, cmd, arg);R-n-		default:M-			e unsi -EINVAL;o+			)rr_SM=Iblk_ioctl(inode->i_rdev, cmd, arg);R 	};
-
-	e unsi 0;o+out:
+	reunsi error;s }n s n@@
n302,14 +417,12 y s {s 	extern+ES <cfree_initrd_mem(u vNRE_FGENER, u vNRE_FGENER);n n-	 dek_kernel();o 	iUR	!--initrd_users) {n-		blkdev_put	inode->i_bdev, BDEV_FILE);s-		iput	inode);o 		free_initrd_mem(initrd_8  rt, initrd_)@ );n 		initrd_8  rtM=I0;o+		inode->i_bdev->bd_cache_ope*ers--;n+		blkdev_put	inode->i_bdev, BDEV_FILE);s 	}M-	un dek_kernel();o 	e unsi 0;
 }n s@@
n324,8 +437,10 y s s 8  pF TiN@Trd_ope*(y    cCinode * inode,      cCt
 
+*Ct
 p)M {o+	int utitM=IDEVICE_NR(inode->i_rdev);s+i vmfzbH_CONFIG_BLK_DEV_INITRD
-	iUR	DEVICE_NR(inode->i_rdev)0== INITRD_MINOR) {s+	iUR	unitM== INITRD_MINOR) {s 		iUR	!initrd_8  rt) e unsi -ENODEV;n 		initrd_users++;o 		f
 p->f_op = &initrd_fops;n@@
n333,16 +448,17 y s 	}
 v)@ vNR M-	iUR	DEVICE_NR(inode->i_rdev)0>= NUM_RAMDISKS)
+	iUR	unitM>= NUM_RAMDISKS)
 		e unsi -ENXIO;n M 	zes 	 * Immunizd) evice against pnvalid p,_buffers() and p  ne_icache().s 	 */n-	iUR	rd_itode[DEVICE_NR(inode->i_rdev)]M== NULL) {s-		iUR	!inode->i_bdev) e unsi -ENXIO;n-		iUR		rd_itode[DEVICE_NR(inode->i_rdev)]M= igrab	inode)) != NULL)M-			atomic_inc(&rd_itode[DEVICE_NR(inode->i_rdev)]->i_bdev->bd_ope*ers);o+	iUR	rd_bdev[unit]M== NULL) {s+		rd_bdev[unit]M= bdg)t(kdev_t_to_nr(inode->i_rdev));o+		ed_bdev[unit]->bd_ope*ers++;o+		ed_bdev[unit]->bd_cache_ope*ers++;o+		ed_bdev[unit]->bd_inode->i_mapptng->a_ops =l&ram vsk_aops;o 	}n n 	MOD_INC_USE_COUNT;n@@
n356,7 +472,7 y s 	e unsi 0;
 }n s-8  pF Ty    cCb dek_device_operact *s fd_fops =l{ +8  pF Ty    cCb dek_device_operact *s ed_bd_op = {s 	ope*:		ed_ope*,
 	e lease:	rd_release,
 	ioctl:		ed_ioctl,h@@
n369,12 +485,13Ry s 	iN@Ti;n M 	G_SM(i+=I0 ; i < NUM_RAMDISKS; i++) {s-		iUR	rd_itode[i]) {n-			ze'withdraw pnvalid p,_buffers() and p  ne_icache() immunity */d-			atomic_dec(&rd_itode[i]->i_bdev->bd_ope*ers);o-			ze'removeI8   
+postterTto module ain_urc space */s-			rd_itode[i]->i_bdev->bd_op = NULL;o-			iput	rd_itode[i]);o+		y    cCb dek_device *bdev =Ied_bdev[i];o+		ed_bdev[i] =INULL;o+		iUR	bdev) {s+			bdev->bd_cache_ope*ers--;n+			   ne p,_itode_pages(bdev->bd_inode->i_mapptng,c0);o+			blkdev_put	bdev, BDEV_FILE);s+			bdput	bdev);R 		}
 		destroy_buffers(MKDEV(MAJOR_NR, i));o 	}n@@
n400,7 +517,7 y s 		rd_b deksize = BLOCK_SIZE;M 	}n n-	iUR	regis4er_blkdev(MAJOR_NR, "ram vsk", &fd_fops)) {s+	iUR	regis4er_blkdev(MAJOR_NR, "ram vsk", &ed_bd_op)) {s 		p - 1;
"RAMDISK: Could not getcmajor %d", MAJOR_NR);M @	e unsi -EIO;o 	}n@@
n418,14 +535,14 y s 	devfs_regis4er_series (devfs_handle, "%u", NUM_RAMDISKS,s @		       DEVFS_FL_DEFAULT, MAJOR_NR, 0,s @		       S_IFBLK | S_IRUSR | S_IWUSR,n-			       &fd_fops, NULL);
+			       &ed_bd_op, NULL);
 M 	G_SM(i+=I0; i < NUM_RAMDISKS; i++)n-		e gis4er_ vsk(NULL, MKDEV(MAJOR_NR,i), 1, &fd_fops, rd_ ize<<1);o+		e gis4er_ vsk(NULL, MKDEV(MAJOR_NR,i), 1, &ed_bd_op, rd_ ize<<1);o i vmfzbH_CONFIG_BLK_DEV_INITRD
 	ze'Wd)ought toFseparacecinitrd+operact *s here */s-	e gis4er_ vsk(NULL, MKDEV(MAJOR_NR,INITRD_MINOR), 1, &fd_fops, rd_ ize<<1);o+	e gis4er_ vsk(NULL, MKDEV(MAJOR_NR,INITRD_MINOR), 1, &ed_bd_op, rd_ ize<<1);o v)@ vNR M 	hardsrct_ ize[MAJOR_NR] = rd_hardsrc;		ze'Size oGI
ld)RAM) vsk b deks0+/M@@
n451,6 +568,8 y s MODULE_PARM     (rd_b deksize, "i");n MODULE_PARM_DESC(rd_b deksize, "B deksize oGIeach)RAM) vsk in bytes.");n  pMODULE_LICENSE("GPL");n+s ze'EnFGoG non-loading portt *s oGI
ld)RAM) vsk driver */M M vmfzbH_RD_LOADER s@@
n595,8 +714,10 y s 	outt
 
.f_op = &zbH_blk_fops;n 	init_special_inode(out_inode, S_IFBLK | S_IRUSR | S_IWUSR, kdev_t_to_nr(ram_device));n n-	if (blkdev_ope*(inode, &infi],) != 0)
+	iUR	blkdev_ope*(inode, &infi],) != 0)+{s+	@iput	out_inode);M @	go1o free_inode;n+	}n 	iUR	blkdev_ope*(out_inode, &outt
 
) != 0)
 @	go1o free_inodes;s M@@
n659,14 +780,15 y s 		iUR	i &&G	i %) evb deks0== 0)) {s 			p - 1;
"done) vsk #%d.\n", i/ evb deks);o 			ro 
te = 0;o-			invalid p,_buffers(device);d-			iUR	infi],.f_op->release)
-				infi],.f_op->release(inode, &infi],);o+			iUR	blkdev_close(inode, &infi],) != 0)+{s+	@		p - 1;
"Err_SMclosing the) vsk.\*");n+				go1o noclose_input;n+			}s 			p - 1;
"PleaseIinsertM vsk #%d and p urc ENTER\n", i/ evb deks+1);o 			wait_for_keyp urc();o 			iUR	blkdev_ope*(inode, &infi],) != 0)+ {s 				p - 1;
"Err_SMope*ing  vsk.\*");n-				go1o done;n+				go1o noclose_input;n 			}
 			infi],.f_pos =I0;
 			p - 1;
"Loading  vsk #%d... ", i/ evb deks+1);o@@
n684,18 +806,20 y s 	kGree(buf);o i succurcful_load:
-	iNvalid p,_buffers(device);d 	ROOT_DEV = MKDEV(MAJOR_NR, unit);o 	iUR	ROOT_DEVICE_NAME != NULL)Ty  cpyR	ROOT_DEVICE_NAME, "rd/0");n   done:n-	if (infi],.f_op->release)
-		infi],.f_op->release(inode, &infi],);o+	infi],.f_op->release(inode, &infi],);o+noclose_input:n+	blkdev_close(out_inode, &outt
 
);o+	iput	inode);o+@iput	out_inode);M @set_fs(fs);o 	e unsi;o free_inodes: ze'tree itodes oi error */ o 	iput	out_inode);M-	blkdev_put	inode->i_bdev, BDEV_FILE);s+	infi],.f_op->release(inode, &infi],);o free_inode:o 	iput	inode);M }
(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/xd.c $(CONFdrivers/b dek/xd.cP6 +35,9 @@
 #incldrivers/b dek/xd.c	thu,May 24 15:14:08c-aica.o
 
 ifeqdrivers/b dek/xd.c	thu,
elN13 15:21:32G_MEf @@
n126,17 +126,16Ry s extern+y    cCb dek_device_operact *s xd_fops;n s 8  pF Ty    cCg)@ vsk xd_g)@ vsk =l{ -	MAJOR_NR,	ze'Major numb
rC*/ -	"xd",		ze'Major nameR*/M-	6,		ze'BIGs+toFshift+toFgetcreal)H0xm p
  itt *+*/M-	10<< 6,		ze'Numb
rCoGIp
  itt *s percreal)*/M-	xd_y    c,	ze'hdTy    cC*/M-	xd_ izes,	ze'b dek  izesC*/M-	0,		ze'numb
rC*/M-	(ES <c*) xd_info,	ze'stternal)*/M-	NULL,		ze'next */M-	&xd_fops,	ze't
 
+operact *s */M+	major:		MAJOR_NR,M+	major_name:	"xd",M+	minor_shift:	6,M+	max_p:		10<< 6,M+	p
  :		xd_y    c,M+	 izes:		xd_ izes,M+	real_devices:	(ES <c*)xd_info,M+	fops:		&xd_fops,s };n+s 8  pF Ty    cCb dek_device_operact *s xd_fops =l{  	ope*:		xd_ope*,
 	e lease:	xd_release,
@@
n173,8 +172,7 y s 	devfs_handle =ldevfs_mk_diSM(NULL, xd_g)@ vsk.major_name, NULL);
 	blk_itit_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);n 	e xd_ahead[MAJOR_NR] = 8;	ze'8c ect_SM(4kB) e xd aheadC*/M-	xd_g)@ vsk.next = g)@ vsk_head;
-	g)@ vsk_head = &xd_g)@ vsk;np	add_g)@ vsk(&xd_g)@ vsk);n 	xd_g)@init();o o 	e unsi 0;
@@
n339,6R+337,8 y s 		caseIBLKGETSIZE:
 			iUR	!arg) e unsi -EINVAL;o 			e unsi put_user(xd_y    c[MINOR(inode->i_rdev)].nr_srcts,(lNERc*) arg);op		caseIBLKGETSIZE64:M+			e unsi put_user((u64)xd_y    c[MINOR(inode->i_rdev)].nr_srcts0<< 9, 2@64c*)arg);o 		caseIHDIO_SET_DMA:
 			iUR	!cap[1],(CAP_SYS_ADMIN)) e unsi -EACCES;s 			iUR	xdc_busy) e unsi -EBUSY;o@@
n376,9 +376,7 y s 	iN@TtargetM=IDEVICE_NR(inode->i_rdev);s 	iUR	targetM< xd_drives) {s 		xd_accurc[target]--;n-vmfzbH_MODULEs 		MOD_DEC_USE_COUNT;n-v)@ vN ze'MODULE +/M 	}
 	e unsi 0;
 }n@@
n1110,20 +1108,16 y s MODULE_PARM(xd_g)o, "3-6i");n MODULE_PARM(nodma, "i");n  pMODULE_LICENSE("GPL");n+s 8  pF TES <cxd_done)(ES <)n {n-	y    cCg)@ vsk ** gdp;n-	s 	blk ize_ ize[MAJOR_NR] = NULL;o 	blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));n 	blk_ ize[MAJOR_NR] = NULL;o 	hardsrct_ ize[MAJOR_NR] = NULL;o 	e xd_ahead[MAJOR_NR] = 0;o-	G_SM(gdp = &g)@ vsk_head; *gdp; gdp = &((*gdp)->next))
-		iUR	*gdp == &xd_g)@ vsk)n-			bnuxk;
-	iUR	*gdp)n-		*gdp = (*gdp)->next;np	del_g)@ vsk(&xd_g)@ vsk);n 	e lease_region(xd_iobase,4);o }n s(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b dek/z2ram.c $(CONFdrivers/b dek/z2ram.cP6 +35,9 @@
 #incldrivers/b dek/z2ram.c	Fri,Febo'9 11:30:22c-aica.o
 
 ifeqdrivers/b dek/z2ram.c	thu,
elN13 15:21:32G_MEf @@
n376,6 +376,9 y s }M M vmf defLi)d(MODULE)np
+MODULE_LICENSE("GPL");n+s iN@
 stit_module(TES <c)n {n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b uetooth/Config.in $(CONFdrivers/b uetooth/Config.inP6 +35,9 @@
 #incldrivers/b uetooth/Config.in	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/b uetooth/Config.in	Fri,
elNg7 09:28:38c-aica@@
n3,6 +3,6 y s s dep_tri  
te 'HCI USB driver'_CONFIG_BLUEZ_HCIUSB $CONFIG_BLUEZ $CONFIG_USBs dep_tri  
te 'HCI UART driver'_CONFIG_BLUEZ_HCIUART $CONFIG_BLUEZ
-dep_tri  
te 'HCI EMU)(Eirtual) evice) driver'_CONFIG_BLUEZ_HCIEMU)$CONFIG_BLUEZ
+dep_tri  
te 'HCI VHCI Eirtual)HCI device driver'_CONFIG_BLUEZ_HCIVHCI $CONFIG_BLUEZ
 s )@ menun(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b uetooth/Maket
 
+$(CONFdrivers/b uetooth/Maket
 
P6 +35,9 @@
 #incldrivers/b uetooth/Maket
 
	tup_Jul  3 17:08:19c-aica.o
 
 ifeqdrivers/b uetooth/Maket
 
	Fri,
elNg7 09:28:38c-aica@@
n6,6 +6,6 y s s obj-$(CONFIG_BLUEZ_HCIUSB)	+= hci_usb.os obj-$(CONFIG_BLUEZ_HCIUART)	+= hci_u
  .os-obj-$(CONFIG_BLUEZ_HCIEMU)	+= hci_emu.os+obj-$(CONFIG_BLUEZ_HCIVHCI)	+= hci_vhci.os 
 stddr);
$(TOPDIR)/Rules.maken(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b uetooth/hci_emu.c $(CONFdrivers/b uetooth/hci_emu.cP6 +35,9 @@
 #incldrivers/b uetooth/hci_emu.c	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeqdrivers/b uetooth/hci_emu.c	W_FGDec 31 16:00:00 1969n@@
n1,330 +0,0 y s-ze'o-   B ueZ - B uetooth protocol 8  ek G_SML ifxo-   Copyright (C)G_ME0n2001 Qualcomm Incorporaced
-
-   WrittenG_ME0,2001 by'Maxim Krasnyansky <maxk@qualcomm.com>
-
-   TlpR program0pR tree software; you,cancre vstribucecit and/_SMmodify
-   it utdeSM
ld)terms oGI
ld)GNU Ge*eral)PublF TLicenseIverst *+2 as
-   publFsh_FGby 
ld)Free Software Foundact *;
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
-   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANYo-   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES'o-   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN'o-   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
-   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
-   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
-   SOFTWARE IS DISCLAIMED.
-*/M-s-ze
- * B ueZ HCI Eirtual)device driver.
- e
- * $Id: hci_emu.c,v 1.1G_MEf/06/01 08:12:10 davem Exp $ 
- */M-s-vmaddr);
<
 ifeqconfig.h>s-vmaddr);
<
 ifeqmodule.h>s-s-vmaddr);
<
 ifeqerrno.h>s-vmaddr);
<
 ifeqkernel.h>s-vmaddr);
<
 ifeqmajor.h>s-vmaddr);
<
 ifeqsch_F.h>s-vmaddr);
<
 ifeqslab.h>s-vmaddr);
<
 ifeqpoll.h>s-vmaddr);
<
 ifeqfcntl.h>s-vmaddr);
<
 ifeqstit.h>s-vmaddr);
<
 ifeqrandom.h>s-s-vmaddr);
<
 ifeqskbuff.h>s-vmaddr);
<
 ifeqmiscdevice.h>s-s-vmaddr);
<asm/system.h>s-vmaddr);
<asm/uaccurc.h>s-s-vmaddr);
<net/b uetooth/b uetooth.h>s-vmaddr);
<net/b uetooth/b uez.h>s-vmaddr);
<net/b uetooth/hci_core.h>s-vmaddr);
<net/b uetooth/hci_emu.h>s-s-ze'HCI device p
   */M-s-iN@Thci_emu_ope*(y    cChci_dev *hdev)n-{
-	hdev->flags)|= HCI_RUNNING;M-	e unsi 0;
-}
-s-iN@Thci_emu_flush(y    cChci_dev *hdev)n-{
-	y    cChci_emu_y    cC*hci_emu = (s    cChci_emu_y    cC*) hdev->driver_data;
-	b uez_skb_queue_purge(&hci_emu->readq);M-	e unsi 0;
-}
-s-iN@Thci_emu_close(y    cChci_dev *hdev)n-{
-	hdev->flags)&= ~HCI_RUNNING;M-	hci_emu_flush(hdev);s-	e unsi 0;
-}
-s-iN@Thci_emu_s)nd_f ame(y    cCsk_buff *skb)n-{
-	y    cChci_dev* hdev = (s    cChci_dev *)Cskb->dev;
-	y    cChci_emu_y    cC*hci_emu;
-
-	iUR	!hdev) {s-		ERR("F ame G_SMuknowi device (hdev=NULL)");n-		e unsi -ENODEV;n-	}M-
-	iUR	!(hdev->flags)& HCI_RUNNING))n-		e unsi -EBUSY;o-M-	hci_emu = (s    cChci_emu_y    cC*) hdev->driver_data;
-
-	memcpy(skb_push(ykb,T1), &skb->pkt_type,T1);
-	ykb_queue_tail(&hci_emu->readq,Cskb);
-
-	iUR	hci_emu->flags)& HCI_EMU_FASYNC)n-		kill_fasync(&hci_emu->fasync, SIGIO, POLL_IN);s-	wake_up_stterrupti1],(&hci_emu->read_wait);
-
-	e unsi 0;o-}
-s-/* CharacterTdevice p
   */M-s-ze'Poll */M-8  pF Tu vNRE_FGit4 hci_emu_chr_poll(y    cCt
 
+*t
 
, poll_tab 
+*Cwait)n-{  n-	y    cChci_emu_y    cC*hci_emu = (s    cChci_emu_y    cC*) t
 
->priv p,_data;
-
-	poll_wait(t
 
, &hci_emu->read_wait, wait);
- n-	if (ykb_queue_le*(&hci_emu->readq))n-		e unsi POLLIN | POLLRDNORM;
-
-	e unsi POLLOUT | POLLWRNORM;
-}
-s-/* GecCpackecCH0xm user space buffer(ale xdy verified) */M-8  pF T__iN Li)__ s ize_cChci_emu_get_user(y    cChci_emu_y    cC*hci_emu, const char *buf,  ize_tccount)s-{
-	y    cCsk_buff *skb;
-
-	iUR	count > HCI_EMU_MAX_FRAME)n-		e unsi -EINVAL;o-
-	iUR	!(skbM=Ibluez_skb_a  de	count, GFP_KERNEL)))n-		e unsi -ENOMEM;s-	n-	copy_H0xm_user(ykb_put(ykb,Tcount), buf, count); 
-
-	 kb->dev = (ES <c*) &hci_emu->hdev;
-	ykb->pkt_type = *((__u8 *)Cskb->data);s-	ykb_pull(ykb,T1);o-M-	hci_arcv_f ame(ykb);
-
-	e unsi count;o-} 
-s-/* Write */M-8  pF Ts ize_cChci_emu_chr_write(y    cCt
 
+* t
 
, const char * buf, n-			      ize_tccount, lNff_t *pos)n-{
-	y    cChci_emu_y    cC*hci_emu = (s    cChci_emu_y    cC*) t
 
->priv p,_data;
-
-	iUR	verify_anux(VERIFY_READ, buf, count))n-		e unsi -EFAULT;
-
-	e unsi hci_emu_get_user(hci_emu, buf, count);
-}
-s-/* PucCpackecCto user space buffer(ale xdy verified) */M-8  pF T__iN Li)__ s ize_cChci_emu_put_user(y    cChci_emu_y    cC*hci_emu,n-				       y    cCsk_buff *skb, char *buf, it4ccount)n-{
-	iN@Tle* =ccount, total = 0;o-	char *ptSM=Ibuf;
-
-	le* =cMIN(skb->le*, len); 
-	copy_to_user(ptr,Cskb->data, len); 
-	total += len;o-M-	hci_emu->hdev.8  p.byte_tx += len;o-	ywitch (ykb->pkt_type) {s-		caseIHCI_COMMAND_PKT:d-			hci_emu->hdev.8  p.cmd_tx++;o-			bnuxk;
-
-		caseIHCI_ACLDATA_PKT:d-			hci_emu->hdev.8  p.acl_tx++;o-			bnuxk;
-
-		caseIHCI_SCODATA_PKT:d-			hci_emu->hdev.8  p.cmd_tx++;o-			bnuxk;
-	};
-
-	e unsi total;
-}
-s-/* ReadC*/M-8  pF Ts ize_cChci_emu_chr_e xd(y    cCt
 
+* t
 
, char * buf,  ize_tccount, lNff_t *pos)n-{
-	y    cChci_emu_y    cC*hci_emu = (s    cChci_emu_y    cC*) t
 
->priv p,_data;
-	DECLARE_WAITQUEUE(wait, current);
-	y    cCsk_buff *skb;
-	s ize_cCret = 0;
-
-	add_wait_queue(&hci_emu->read_wait, &wait);
-	wh
 
 (count) {s-		current->8  te = TASK_INTERRUPTIBLE;
-
-		/* ReadCf amesCH0xm device queue */s-		iUR	!(skbM=Iykb_dequeue(&hci_emu->readq))) {n-			iUR	t
 
->f_flags)& O_NONBLOCK) {n-				ret = -EAGAIN;n-				bnuxk;
-			}M-			iUR	sNREal_p)@ vng(current)) {n-				ret = -ERESTARTSYS;n-				bnuxk;
-			}M-o-			ze'No
lpngTto e ad, let'R sleep */s-			sch_Fule();n-			cont ife;n-		}M-o-		iUR	!verify_anux(VERIFY_WRITE, buf, count))n-			ret = hci_emu_put_user(hci_emu, skb, buf, count);
-		)lseo-			ret = -EFAULT;
-
-		b uez_skb_Gree(ykb);
-		bnuxk;
-	}
-
-	current->8  te = TASK_RUNNING;M-	e move_wait_queue(&hci_emu->read_wait, &wait);
-
-	e unsi ret;
-}
-s-8  pF TiN@Thci_emu_chr_ioctl(y    cCinode *inode,      cCt
 
+*t
 
, u vNRE_FGit4 cmd, u vNRE_FGENERcarg)M-{
-	e unsi -EINVAL;o-}
-s-8  pF TiN@Thci_emu_chr_fasync(iN@Tfd,      cCt
 
+*t
 
, int on)n-{
-	y    cChci_emu_y    cC*hci_emu = (s    cChci_emu_y    cC*) t
 
->priv p,_data;
-	iN@Tret;
-
-	iUR	(ret = fasync_helper(fd, t
 
, on, &hci_emu->fasync)) < 0)
-		e unsi ret; 
- n-	if (on)n-		hci_emu->flags)|= HCI_EMU_FASYNC;n-	)lse n-		hci_emu->flags)&= ~HCI_EMU_FASYNC;n-
-	e unsi 0;o-}
-s-8  pF TiN@Thci_emu_chr_ope*(y    cCinode *inode,      cCt
 
+*Ct
 e)n-{
-	y    cChci_emu_y    cC*hci_emu = NULL; 
-	y    cChci_dev *hdev;o-
-	iUR	!(hci_emu = kma  de	 izeofty    cChci_emu_y    c), GFP_KERNEL)))n-		e unsi -ENOMEM;s-
-	memset(hci_emu, 0,  izeofty    cChci_emu_y    c));
-
-	ykb_queue_head_itit(&hci_emu->readq);M-	stit_waitqueue_head(&hci_emu->read_wait);
-
-	ze'Itittalize and e gis4er'HCI device */s-	hdev = &hci_emu->hdev;
-
-	hdev->type = HCI_EMU;
-	hdev->driver_data = hci_emu;
-
-	hdev->ope*  = hci_emu_ope*;
-	hdev->close = hci_emu_close;
-	hdev->flush =Ihci_emu_flush;
-	hdev->s)nd  = hci_emu_s)nd_f ame;
-
-	iUR	hci_e gis4er_ ev(hdev) < 0) {n-		kGree(hci_emu);n-		e unsi -EBUSY;o-	}
-
-	t
 
->priv p,_data = hci_emu;
-	e unsi 0;   n-}
-s-8  pF TiN@Thci_emu_chr_close(y    cCinode *inode,      cCt
 
+*t
 
)n-{
-	y    cChci_emu_y    cC*hci_emu = (s    cChci_emu_y    cC*) t
 
->priv p,_data;
-
-	iUR	hci_une gis4er_ ev(&hci_emu->hdev) < 0) {n-		ERR("Can'tcune gis4er'HCI device %s", hci_emu->hdev.name);s-	}
-
-	kGree(hci_emu);n-	t
 
->priv p,_data = NULL;o-
-	e unsi 0;o-}
-s-8  pF T     cCt
 
_operact *s hci_emu_fops =l{ -	owner:	THIS_MODULE,	n-	llseek:	no_llseek,
-	e ad:	hci_emu_chr_e xd,
-	write:	hci_emu_chr_write,
-	poll:	hci_emu_chr_poll,
-	ioctl:	hci_emu_chr_ioctl,
-	ope*:	hci_emu_chr_ope*,
-	e lease:hci_emu_chr_close,
-	fasync:	hci_emu_chr_fasync		n-};
-
-8  pF T     cCmiscdevice hci_emu_miscdev=n-{
-        HCI_EMU_MINOR,
-        "hci_emu",
-        &hci_emu_fopsn-};
-
-iN@T__init hci_emu_itit(ES <)n-{
-	INF("B ueZ HCI EMU)driver ver %s Copyright (C)G_ME0,2001 Qualcomm Inc",  n-		BLUEZ_VER);n-	INF("WrittenG_ME0,2001 by'Maxim Krasnyansky <maxk@qualcomm.com>");
-
-	iUR	misc_e gis4er(&hci_emu_miscdev)) {n-		ERR("Can'tce gis4er'misc device %d\n", HCI_EMU_MINOR);n-		e unsi -EIO;n-	}o-
-	e unsi 0;o-}
-s-ES <chci_emu_cleanup(ES <)n-{
-	misc_dee gis4er(&hci_emu_miscdev);o-}
-s-module_itit(hci_emu_itit);o-module_exit(hci_emu_cleanup);o(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b uetooth/hci_u
  .c $(CONFdrivers/b uetooth/hci_u
  .cP6 +35,9 @@
 #incldrivers/b uetooth/hci_u
  .c	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeqdrivers/b uetooth/hci_u
  .c	Fri,
elNg7 09:28:38c-aica@@
n25,8 +25,9 y s /*n  * B ueZ HCI UART driver.n  *
- * $Id: hci_u
  .c,v 1.1G_MEf/06/01 08:12:10 davem Exp $    n+ * $Id: hci_u
  .c,v 1.5G_MEf/07/05 18:42:44 maxk Exp $    n  +/M+#defLi) VERSION "1.0"M M vmaddr);
<
 ifeqconfig.h>s vmaddr);
<
 ifeqmodule.h>s@@
n84,7 +85,7 y s 	DBG("hdev %p tty %p", hdev, tty);n M 	ze Drop TX queue */s-	b uez_skb_queue_purge(&n_hci->txq);op	skb_queue_purge(&n_hci->txq);o M 	ze Flush any p)@ vng characters in the) river and discip Li). +/M 	iUR	tty->ldisc.flush_buffer)
@@
n139,7 +140,7 y s s 		iUR	le* == skb->le*) {s 			ze FullCf ame waR sent */s-			b uez_skb_Gree(ykb);
+			kGree_skb(ykb);
 		} )lse {s 			ze Subtract sent p
   and e queue  +/M 			ykb_pull(ykb,Tlen);
@@
n334,7 +335,7 y s 		hci_arcv_f ame(n_hci->rx_ykb);
 	} )lse iUR	le* > room) {s 		ERR("Data length0pR toFlarge");n-		b uez_skb_Gree(n_hci->rx_ykb);
+		kGree_skb(n_hci->rx_ykb);
 		n_hci->hdev.8  p.err_ex++;o 	} )lse {s 		n_hci->rx_y  te = WAIT_DATA;n@@
n356,7 +357,7 y s 	hci_sco_hdr   +sh;
 	e gis4er iN@Tle*, type,Tdlen;o n-	DBG("count %d y  te %d rx_count %d",ccount, n_hci->rx_y  te, n_hci->rx_count);o+	DBG("count %d y  te %ld rx_count %ld",ccount, n_hci->rx_y  te, n_hci->rx_count);o s 	n_hci->hdev.8  p.byte_rx += count;o M@@
n441,7 +442,7 y s 		ptr++; count--;n s 		ze A  de p,CpackecC*/s-		iUR	!(n_hci->rx_ykbM=Ibluez_skb_a  de	HCI_MAX_READ, GFP_ATOMIC))) {s+		iUR	!(n_hci->rx_ykbM=Ibluez_skb_a  de	HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {s 			ERR("Can'tca  de p, mem G_SM/boCpackec");n   			n_hci->rx_y  te = WAIT_PACKET_TYPE;n@@
n536,7 +537,7 y s 	iN@Terr;o   	INF("B ueZ HCI UART driver ver %s Copyright (C)G_ME0,2001 Qualcomm Inc", n-		BLUEZ_VER);n+		VERSION);
 	INF("WrittenG_ME0,2001 by'Maxim Krasnyansky <maxk@qualcomm.com>");
 M 	ze R gis4er 
ld)tty discip Li)0+/M@@
n573,3 +574,7 y s s module_itit(n_hci_itit);o module_exit(n_hci_cleanup);op
+MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
+MODULE_DESCRIPTION("B ueZ HCI UART driver ver " VERSION);
+MODULE_LICENSE("GPL");n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b uetooth/hci_usb.c $(CONFdrivers/b uetooth/hci_usb.cP6 +35,9 @@
 #incldrivers/b uetooth/hci_usb.c	Mon_Aug 27o_2:41:40c-aica.o
 
 ifeqdrivers/b uetooth/hci_usb.c	Fri,
elNg7 09:28:38c-aica@@
n28,8 +28,9 y s  *    Copyright (c)G_ME0 Greg)Kroah-H
  man        <greg@kroah.com>
  *    Copyright (c)G_ME0 Mark Douglas Corner       <mcorner@umich.edu>n  *
- * $Id: hci_usb.c,v 1.1G_MEf/06/01 08:12:10 davem Exp $    n+ * $Id: hci_usb.c,v 1.5G_MEf/07/05 18:42:44 maxk Exp $    n  +/M+#defLi) VERSION "1.0"M M vmaddr);
<
 ifeqconfig.h>s vmaddr);
<
 ifeqmodule.h>s@@
n106,7 +107,7 y s 		usb_free_urb(husb->write_urb);
 n 	iUR	husb->iN@r_skb)n-		b uez_skb_Gree(husb->iN@r_skb);
+		kGree_skb(husb->iN@r_skb);
 }n s /*CH)))))) In4erface toFHCI layer )))))) +/M@@
n139,8 +140,8 y s 	DBG("%s", hdev->name);s M 	ze Drop TX queues */s-	b uez_skb_queue_purge(&husb->tx_ctrl_q);s-	b uez_skb_queue_purge(&husb->tx_write_q);op	skb_queue_purge(&husb->tx_ctrl_q);sp	skb_queue_purge(&husb->tx_write_q);o 
 	e unsi 0;
 }n@@
n173,7 +174,7 y s 		go1o done;n n 	iUR	hci_usb_ctrl_msg(husb,Cskb)){
-		b uez_skb_Gree(ykb);
+		kGree_skb(ykb);
 		go1o done;n 	}n s@@
n271,7 +272,7 y s 		DBG("%s ctrl y  tus: %d",chdev->name, urb->8  tus);o 
 	clear_bit(HCI_TX_CTRL, &husb->tx_y  te);s-	b uez_skb_Gree(ykb);
+	kGree_skb(ykb);
 
 	ze'Wake up device */s 	hci_usb_ctrl_wakeup(husb);
@@
n294,7 +295,7 y s 		DBG("%s bulk write y  tus: %d",chdev->name, urb->8  tus);o 
 	clear_bit(HCI_TX_WRITE, &husb->tx_y  te);s-	b uez_skb_Gree(ykb);
+	kGree_skb(ykb);
 
 	ze'Wake up device */s 	hci_usb_write_wakeup(husb);
@@
n352,7 +353,7 y s 		iUR	count > husb->iN@r_count) {s 			ERR("%s badCf ameTle* %d (exprct_FG%d)",chusb->hdev.name,ccount, husb->iN@r_count);o n-			b uez_skb_Gree(ykb);
+			kGree_skb(ykb);
 			husb->iN@r_skb = NULL;o 			husb->iN@r_count = 0;o 			e unsi;n@@
n563,7 +564,7 y s s 	epM=Ibulk_it_ep;
 	pipe = usb_rcvbulkpipe(udev, ep->bEndposttAin_urc);
-	yize = HCI_USB_MAX_READ;
+	 ize =IHCI_MAX_FRAME_SIZE;s o 	iUR	!(buf = kma  de	 ize, GFP_KERNEL))) {s 		ERR("Can'tca  de p,: e xd buffer");o@@
n652,7 +653,7 y s 	iN@Terr;o   	INF("B ueZ HCI USB driver ver %s Copyright (C)G_ME0,2001 Qualcomm Inc",  n-		BLUEZ_VER);n+		VERSION);
 	INF("WrittenG_ME0,2001 by'Maxim Krasnyansky <maxk@qualcomm.com>");
 M 	iUR	(errC= usb_r gis4er(&hci_usb_driver)) < 0)
@@
n668,3 +669,7 y s s module_itit(hci_usb_itit);o module_exit(hci_usb_cleanup);op
+MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
+MODULE_DESCRIPTION("B ueZ HCI USB driver ver " VERSION);
+MODULE_LICENSE("GPL");n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/b uetooth/hci_vhci.c $(CONFdrivers/b uetooth/hci_vhci.cP6 +35,9 @@
 #incldrivers/b uetooth/hci_vhci.c	W_FGDec 31 16:00:00 1969n.o
 
 ifeqdrivers/b uetooth/hci_vhci.c	Fri,
elNg7 09:28:38c-aica@@
n0,0 +1,340 y s+ze'o+   B ueZ - B uetooth protocol 8  ek G_SML ifxo+   Copyright (C)G_ME0n2001 Qualcomm Incorporaced
+o+   WrittenG_ME0,2001 by'Maxim Krasnyansky <maxk@qualcomm.com>
+o+   TlpR program0pR tree software; you,cancre vstribucecit and/_SMmodify
+   it utdeSM
ld)terms oGI
ld)GNU Ge*eral)PublF TLicenseIverst *+2 as
+   publFsh_FGby 
ld)Free Software Foundact *;
+o+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANYo+   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES'o+   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN'o+   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
+   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+o+   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
+   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
+   SOFTWARE IS DISCLAIMED.
++/M+
+/*np *GB ueZ HCI Eirtual)device driver.
p *n+ * $Id: hci_vhci.c,v 1.3G_MEf/08/03 04:19:50 maxk Exp $ np */
+#defLi) VERSION "1.0"M+
+vmaddr);
<
 ifeqconfig.h>s+vmaddr);
<
 ifeqmodule.h>s+
+vmaddr);
<
 ifeqerrno.h>s+vmaddr);
<
 ifeqkernel.h>s+vmaddr);
<
 ifeqmajor.h>s+vmaddr);
<
 ifeqsch_F.h>s+vmaddr);
<
 ifeqslab.h>s+vmaddr);
<
 ifeqpoll.h>s+vmaddr);
<
 ifeqfcntl.h>s+vmaddr);
<
 ifeqstit.h>s+vmaddr);
<
 ifeqrandom.h>s+
+vmaddr);
<
 ifeqskbuff.h>s+vmaddr);
<
 ifeqmiscdevice.h>s+
+vmaddr);
<asm/system.h>s+vmaddr);
<asm/uaccurc.h>s+
+vmaddr);
<net/b uetooth/b uetooth.h>s+vmaddr);
<net/b uetooth/b uez.h>s+vmaddr);
<net/b uetooth/hci_core.h>s+vmaddr);
<net/b uetooth/hci_vhci.h>s+
+ze'HCI device p
   */M+
+iN@Thci_vhci_ope*(y    cChci_dev *hdev)np{o+	hdev->flags)|= HCI_RUNNING;M+	e unsi 0;
+}np
+iN@Thci_vhci_flush(y    cChci_dev *hdev)np{o+	y    cChci_vhci_y    cC*hci_vhci = (s    cChci_vhci_y    cC*) hdev->driver_data;
p	skb_queue_purge(&hci_vhci->readq);M+	e unsi 0;
+}np
+iN@Thci_vhci_close(y    cChci_dev *hdev)np{o+	hdev->flags)&= ~HCI_RUNNING;M+	hci_vhci_flush(hdev);s+	e unsi 0;
+}np
+iN@Thci_vhci_s)nd_f ame(y    cCsk_buff *skb)np{o+	y    cChci_dev* hdev = (s    cChci_dev *)Cskb->dev;
+	y    cChci_vhci_y    cC*hci_vhci;npo+	iUR	!hdev) {s+		ERR("F ame G_SMuknowi device (hdev=NULL)");n+		e unsi -ENODEV;n+	}M+o+	iUR	!(hdev->flags)& HCI_RUNNING))n+		e unsi -EBUSY;o+M+	hci_vhci = (s    cChci_vhci_y    cC*) hdev->driver_data;
pM+	memcpy(skb_push(ykb,T1), &skb->pkt_type,T1);
+	ykb_queue_tail(&hci_vhci->readq,Cskb);
+o+	iUR	hci_vhci->flags)& VHCI_FASYNC)n+		kill_fasync(&hci_vhci->fasync, SIGIO, POLL_IN);s+	wake_up_stterrupti1],(&hci_vhci->read_wait);
+o+	e unsi 0;
+}np
+/* CharacterTdevice p
   */Mp
+/* Poll */M+8  pF Tu vNRE_FGit4 hci_vhci_chr_poll(y    cCt
 
+*t
 
, poll_tab 
+*Cwait)n+{  n+	y    cChci_vhci_y    cC*hci_vhci = (s    cChci_vhci_y    cC*) t
 
->priv p,_data;
+o+	poll_wait(t
 
, &hci_vhci->read_wait, wait);
+ o+	iUR	ykb_queue_le*(&hci_vhci->readq))n+		e unsi POLLIN | POLLRDNORM;
+o+	e unsi POLLOUT | POLLWRNORM;
+}np
+/* GecCpackecCH0xm user space buffer(ale xdy verified) */M+y  pF TiN Li)0s ize_cChci_vhci_get_user(y    cChci_vhci_y    cC*hci_vhci, const char *buf,  ize_tccount)sp{o+	y    cCsk_buff *skb;
+o+	iUR	count > HCI_MAX_FRAME_SIZE)n+		e unsi -EINVAL;o+o+	iUR	!(skbM=Ibluez_skb_a  de	count, GFP_KERNEL)))n+		e unsi -ENOMEM;s+	M+	copy_H0xm_user(ykb_put(ykb,Tcount), buf, count); 
+
+	ykb->dev = (ES <c*) &hci_vhci->hdev;
+	ykb->pkt_type = *((__u8 *)Cskb->data);s+	ykb_pull(ykb,T1);o+M+	hci_arcv_f ame(ykb);
+o+	e unsi count;o+} np
+/* Write */M+8  pF Ts ize_cChci_vhci_chr_write(y    cCt
 
+* t
 
, const char * buf, n+			      ize_tccount, lNff_t *pos)np{o+	y    cChci_vhci_y    cC*hci_vhci = (s    cChci_vhci_y    cC*) t
 
->priv p,_data;
+o+	iUR	verify_anux(VERIFY_READ, buf, count))n+		e unsi -EFAULT;
+o+	e unsi hci_vhci_get_user(hci_vhci, buf, count);
+}np
+/* PucCpackecCto user space buffer(ale xdy verified) */M+y  pF TiN Li)0s ize_cChci_vhci_put_user(y    cChci_vhci_y    cC*hci_vhci,n+				       y    cCsk_buff *skb, char *buf, it4ccount)n+{o+	int le* =ccount, total = 0;o+	char *ptSM=Ibuf;
+o+	le* =cMIN(skb->le*, len); 
+	copy_to_user(ptr,Cskb->data, len); 
+	total += len;o+M+	hci_vhci->hdev.8  p.byte_tx += len;o+	ywitch (ykb->pkt_type) {s+		caseIHCI_COMMAND_PKT:d+			hci_vhci->hdev.8  p.cmd_tx++;op		7bnuxk;
+s+		caseIHCI_ACLDATA_PKT:d+			hci_vhci->hdev.8  p.acl_tx++;op		7bnuxk;
+s+		caseIHCI_SCODATA_PKT:d+			hci_vhci->hdev.8  p.cmd_tx++;op		7bnuxk;
+	};
+o+	e unsi total;
+}np
+/* ReadC*/M+8  pF Ts ize_cChci_vhci_chr_e xd(y    cCt
 
+* t
 
, char * buf,  ize_tccount, lNff_t *pos)np{o+	y    cChci_vhci_y    cC*hci_vhci = (s    cChci_vhci_y    cC*) t
 
->priv p,_data;
+	DECLARE_WAITQUEUE(wait, current);
+	y    cCsk_buff *skb;
+	s ize_cCret = 0;
+np	add_wait_queue(&hci_vhci->read_wait, &wait);
+	wh
 
 (count) {s+		current->8  te = TASK_INTERRUPTIBLE;
+s+		/* ReadCf amesCH0xm device queue */s+		iUR	!(skbM=Iykb_dequeue(&hci_vhci->readq)))+{s+	@	iUR	t
 
->f_flags)& O_NONBLOCK) {n+				ret = -EAGAIN;n+			7bnuxk;
+			}s+	@	iUR	sNREal_p)@ vng(current)) {n+				ret = -ERESTARTSYS;n+			7bnuxk;
+			}s+
+			ze'No
lpngTto e ad, let'R sleep */s+			sch_Fule();n+			cont ife;n+		}M+o+		iUR	!verify_anux(VERIFY_WRITE, buf, count))n+			ret = hci_vhci_put_user(hci_vhci, skb, buf, count);
+		)lseo+			ret = -EFAULT;
+
+		kGree_skb(ykb);
+	7bnuxk;
+	}
+
+	current->8  te = TASK_RUNNING;M+	e move_wait_queue(&hci_vhci->read_wait, &wait);
+o+	e unsi ret;
+}np
+y  pF TlNff_t hci_vhci_chr_lseek(y    cCt
 
+* t
 
, lNff_t oGfset, int origin)M+{n+	e unsi -ESPIPE;n+}np
+y  pF TiN@Thci_vhci_chr_ioctl(y    cCinode *inode,      cCt
 
+*t
 
, u vNRE_FGit4 cmd, u vNRE_FGENERcarg)M+{n+	e unsi -EINVAL;o+}np
+y  pF TiN@Thci_vhci_chr_fasync(iN@Tfd,      cCt
 
+*t
 
, int on)np{o+	y    cChci_vhci_y    cC*hci_vhci = (s    cChci_vhci_y    cC*) t
 
->priv p,_data;
+	iN@Tret;
+o+	iUR	(ret = fasync_helper(fd, t
 
, on, &hci_vhci->fasync)) < 0)
+		e unsi ret; 
+ o+	iUR	on)np		hci_vhci->flags)|= VHCI_FASYNC;n+	else np		hci_vhci->flags)&= ~VHCI_FASYNC;n+o+	e unsi 0;
+}np
+y  pF TiN@Thci_vhci_chr_ope*(y    cCinode *inode,      cCt
 
+*Ct
 e)np{o+	y    cChci_vhci_y    cC*hci_vhci = NULL; 
+	y    cChci_dev *hdev;o+o+	iUR	!(hci_vhci = kma  de	 izeofty    cChci_vhci_y    c), GFP_KERNEL)))n+		e unsi -ENOMEM;s+M+	memset(hci_vhci, 0,  izeofty    cChci_vhci_y    c));
+o+	ykb_queue_head_itit(&hci_vhci->readq);M+	stit_waitqueue_head(&hci_vhci->read_wait);
+o+	ze'Itittalize and e gis4er'HCI device */s+	hdev = &hci_vhci->hdev;
+o+	hdev->type = HCI_VHCI;o+	hdev->driver_data = hci_vhci;npo+	hdev->ope*  = hci_vhci_ope*;o+	hdev->close = hci_vhci_close;o+	hdev->flush =Ihci_vhci_flush;o+	hdev->s)nd  = hci_vhci_s)nd_f ame;
+o+	iUR	hci_e gis4er_ ev(hdev) < 0) {n+		kGree(hci_vhci);n+		e unsi -EBUSY;o+	}
+
+	t
 
->priv p,_data = hci_vhci;np	e unsi 0;   n+}np
+y  pF TiN@Thci_vhci_chr_close(y    cCinode *inode,      cCt
 
+*t
 
)np{o+	y    cChci_vhci_y    cC*hci_vhci = (s    cChci_vhci_y    cC*) t
 
->priv p,_data;
+o+	iUR	hci_une gis4er_ ev(&hci_vhci->hdev) < 0) {n+		ERR("Can'tcune gis4er'HCI device %s", hci_vhci->hdev.name);s+	}
+
+	kGree(hci_vhci);n+	t
 
->priv p,_data = NULL;o+o+	e unsi 0;
+}np
+y  pF T     cCt
 
_operact *s hci_vhci_fops =l{ +	owner:	THIS_MODULE,	n+	llseek:	hci_vhci_chr_lseek,M+	read:	hci_vhci_chr_e xd,
+	write:	hci_vhci_chr_write,o+	poll:	hci_vhci_chr_poll,
+	ioctl:	hci_vhci_chr_ioctl,
+	ope*:	hci_vhci_chr_ope*,M+	release:hci_vhci_chr_close,M+	fasync:	hci_vhci_chr_fasync		n+};
+o+8  pF T     cCmiscdevice hci_vhci_miscdev=np{o+        VHCI_MINOR,
+        "hci_vhci",
+        &hci_vhci_fopsn+};
+o+iN@T__init hci_vhci_itit(ES <)np{o+	INF("B ueZ VHCI driver ver %s Copyright (C)G_ME0,2001 Qualcomm Inc",  n+		VERSION);
+	INF("WrittenG_ME0,2001 by'Maxim Krasnyansky <maxk@qualcomm.com>");
+o+	iUR	misc_e gis4er(&hci_vhci_miscdev)) {n+		ERR("Can'tce gis4er'misc device %d\n", VHCI_MINOR);n+		e unsi -EIO;n+	}
+
+	e unsi 0;
+}np
+ES <chci_vhci_cleanup(ES <)np{o+	misc_dee gis4er(&hci_vhci_miscdev);
+}np
+module_itit(hci_vhci_itit);o+module_exit(hci_vhci_cleanup);op
+MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
+MODULE_DESCRIPTION("B ueZ VHCI driver ver " VERSION);
+MODULE_LICENSE("GPL");n(MAKE) -C arch/$(ARCH)/boot
 
+ifneq ($(CONFdrivers/cd0xm/aztcd.c $(CONFdrivers/cd0xm/aztcd.cP6 +35,9 @@
 #incldrivers/cd0xm/aztcd.c	thu,O cC26 23:35:47G_ME0n.o
 
 ifeqdrivers/cd0xm/aztcd.c	Sun,
elNg9 10:43:02G_MEf @@
n167,7 +167,7 y s s vmaddr);
<
 ifeqverst *.h>s 
-#defLi) MAJOR_NR AZTECH_CDROM_MAJOR 
+#defLi) MAJOR_NR AZTECH_CDROM_MAJORs s vmaddr);
<
 ifeqblk.h>s vmaddr);
"aztcd.h" @@
n185,19 +185,13Ry s vmaddr);
<
 ifeqmajor.h>s vmaddr);
<
 ifeqdevfs_fs_kernel.h>s n-vmfnzbH_AZT_KERNEL_PRIOR_2_1s vmaddr);
<
 ifeqstit.h>s-v)@ vNR M vmaddr);
<asm/system.h>s vmaddr);
<asm/io.h>s n-vmfzbH_AZT_KERNEL_PRIOR_2_1s-vmaddr);
<asm/segment.h>s-v)lseo vmaddr);
<asm/uaccurc.h>s-y  pF TiN@Taztcd_b deksizes[1] = {2048};n-v)@ vN
+y  pF TiN@Taztcd_b deksizes[1] = { 2048 };n n s /*###########################################################################
@@
n206,7 +200,7 y s */s #defLi) SET_TIMER(func, jifs)   delay_timer.expires =ljiffies + (jifs); \
                                 delay_timer.functt *+= (ES <c*) (func); \
-                                add_timer(&delay_timer); 
+                                add_timer(&delay_timer);R M vdefLi) CLEAR_TIMER             del_timer(&delay_timer);R M@@
n219,17 +213,17 y s #defLi) SWITCH_IDE_SLAVE  outb_p(0xa0,azt_port+6); \
 	                  outb_p(0x10,azt_port+6); \
 	                  outb_p(0x00,azt_port+7); \
-	                  outb_p(0x10,azt_port+6); o+	                  outb_p(0x10,azt_port+6);s #defLi) SWITCH_IDE_MASTER outb_p(0xa0,azt_port+6);n n s vmf 0s #defLi) AZT_TEST
-#defLi) AZT_TEST1 /*C<iN@-..> */s-#defLi) AZT_TEST2 /*Cdo_aztcd_e quest */s-#defLi) AZT_TEST3 /*CAZT_S_y  te */s-#defLi) AZT_TEST4 /*CQUICK_LOOP-count
rC*/M-#defLi) AZT_TEST5 /*Cport(1) y  te */s+#defLi) AZT_TEST1		ze'<iN@-..> */s+#defLi) AZT_TEST2		ze'do_aztcd_e quest */s+#defLi) AZT_TEST3		ze AZT_S_y  te */s+#defLi) AZT_TEST4		ze QUICK_LOOP-count
rC*/M+#defLi) AZT_TEST5		ze port(1) y  te */s #defLi) AZT_DEBUGs #defLi) AZT_DEBUG_MULTISESSIONo v)@ vNR@@
n243,30 +237,23 y s s vdefLi) READ_TIMEOUT 3ME0n 
-#defLi) azt_portTaztcd  /*needed G_SM
ld)modutils*/M-s-vmfnzbH_AZT_KERNEL_PRIOR_2_1 
-#defLi)  memcpy_H0xmfs copy_H0xm_user
-#defLi)  memcpy_tofs   copy_to_usern-v)@ vN
+#defLi) azt_portTaztcd		zeneeded G_SM
ld)modutils */M M /*##########################################################################
   Type DefLiitt *s
   ##########################################################################
 */M-enum azt_y  te_e n-{ AZT_S_IDLE,    ze 0 */M-  AZT_S_START,   ze 1 */M-  AZT_S_MODE,    ze 2 */M-  AZT_S_READ,    ze 3 */M-  AZT_S_DATA,    ze 4 */M-  AZT_S_STOP,    ze 5 */M-  AZT_S_STOPPING ze 6C*/M+enum azt_y  te_e { AZT_S_IDLE,	ze 0 */M+	AZT_S_START,		ze 1 */M+	AZT_S_MODE,		ze 2 */M+	AZT_S_READ,		ze 3 */M+	AZT_S_DATA,		ze 4 */M+	AZT_S_STOP,		ze 5 */M+	AZT_S_STOPPING		ze 6C*/M };n-enum azt_read_modes n-{ AZT_MODE_0,     zee xd mode G_SMaudio  vsks, not support_FGby AztechCt
rmware*/M-  AZT_MODE_1,     zee xd mode G_SMnormal CD-ROMs*/M-  AZT_MODE_2      zee xd mode G_SMXA CD-ROMs*/M+enum azt_read_modes { AZT_MODE_0,	zee xd mode G_SMaudio  vsks, not support_FGby AztechCt
rmware */M+	AZT_MODE_1,		zee xd mode G_SMnormal CD-ROMs */M+	AZT_MODE_2		zee xd mode G_SMXA CD-ROMsC*/M };n M /*##########################################################################
@@
n275,20 +262,20 y s */M y  pF TiN@TaztPresent = 0;o s-y  pF Tvol pFleTiN@Tazt_transfer_is_acttve=0;
+y  pF Tvol pFleTiN@Tazt_transfer_is_acttve = 0;o s-y  pF Tchar azt_buf[CD_FRAMESIZE_RAW*AZT_BUF_SIZ];/*buffer G_SMb dek  ize converst **/M+8  pF Tchar azt_buf[CD_FRAMESIZE_RAW e AZT_BUF_SIZ];	/*buffer G_SMb dek  ize converst * */s #iH_AZT_PRIVATE_IOCTLSs-y  pF Tchar buf[CD_FRAMESIZE_RAW];              /*separacecbuffer G_SM
ld)ioctls*/M+8  pF Tchar buf[CD_FRAMESIZE_RAW];	/*separacecbuffer G_SM
ld)ioctls */s #)@ vNR M y  pF Tvol pFleTiN@Tazt_buf_bn[AZT_BUF_SIZ],Tazt_next_bn;M y  pF Tvol pFleTiN@Tazt_buf_in,Tazt_buf_out = -1;s-y  pF Tvol pFleTiN@Tazt_error=0;
-y  pF TiN@Tazt_ope*_count=0;
+y  pF Tvol pFleTiN@Tazt_error = 0;
+y  pF TiN@Tazt_ope*_count = 0;o y  pF Tvol pFleTenum azt_y  te_e azt_y  te = AZT_S_IDLE;M vmfzbH_AZT_TEST3s-y  pF Tvol pFleTenum azt_y  te_e azt_y  te_old = AZT_S_STOP;  n+y  pF Tvol pFleTenum azt_y  te_e azt_y  te_old = AZT_S_STOP;M y  pF Tvol pFleTiN@Tazt_st_old = 0;o v)@ vNR y  pF Tvol pFleTenum azt_read_modes azt_read_mode = AZT_MODE_1;
@@
n298,15 +285,13Ry s M y  pF TiN@Tazt_portT= AZT_BASE_ADDR;s n-vmfnzbH_AZT_KERNEL_PRIOR_2_1s MODULE_PARM(azt_port, "i");n-#)@ vNR M y  pF TiN@Tazt_port_auto[16]T= AZT_BASE_AUTO;o s-y  pF Tchar Tazt_cont = 0;
-y  pF Tchar Tazt_stit_)nd = 0;
-y  pF Tchar Tazt_auto_ejectT= AZT_AUTO_EJECT;M+8  pF Tchar azt_cont = 0;
+8  pF Tchar azt_stit_)nd = 0;
+8  pF Tchar azt_auto_ejectT= AZT_AUTO_EJECT;M M y  pF TiN@TAztTimeout,TAztTries;s y  pF TDECLARE_WAIT_QUEUE_HEAD(azt_waitq);
@@
n316,7 +301,7 y s 8  pF T     cCazt_Toc Toc[MAX_TRACKS];s 8  pF T     cCazt_Play_msfCazt_Play;o s-y  pF TiN@TCaztAudioS  tusT= CDROM_AUDIO_NO_STATUS;
+y  pF TiN@TaztAudioS  tusT= CDROM_AUDIO_NO_STATUS;
 8  pF Tchar aztDvskChanged = 1;
 8  pF Tchar aztTocUpToD
te = 0;o M@@
n329,54 +314,51 y s   ###########################################################################
 */M ze CDROM Drive Low Level I/O Functt *s */s-ES <c       op_ok(ES <);s-ES <c       pa_ok(ES <);s-ES <c       ste*_low(ES <);s-ES <c       dte*_low(ES <);s-ES <c       8  tusAzt(ES <);s+ES <cop_ok(ES <);s+ES <cpa_ok(ES <);s+ES <cste*_low(ES <);s+ES <cdte*_low(ES <);s+ES <c8  tusAzt(ES <);s 8  pF TES <caztS  tTimer(ES <);s M ze CDROM Drive Command Functt *s */s-y  pF TiN@TCaztS)ndCmd(it4 cmd);
-y  pF TiN@T sendAztCmd(it4 cmd,T     cCazt_Play_msfC*params);
-y  pF TiN@T aztS)ek(y    cCazt_Play_msfC*params);
-y  pF TiN@T aztS)tDvskType(it4 type);
-y  pF TiN@T aztS  tus(ES <);s-y  pF TiN@T getAztS  tus(ES <);s-y  pF TiN@T aztPlay(y    cCazt_Play_msfC*arg);opy  pF TiN@TaztS)ndCmd(it4 cmd);
py  pF TiN@TsendAztCmd(it4 cmd,T     cCazt_Play_msfC*params);
py  pF TiN@TaztS)ek(y    cCazt_Play_msfC*params);
py  pF TiN@TaztS)tDvskType(it4 type);
py  pF TiN@TaztS  tus(ES <);spy  pF TiN@TgetAztS  tus(ES <);spy  pF TiN@TaztPlay(y    cCazt_Play_msfC*arg);o 8  pF TES <caztCloseDoor(ES <);s 8  pF TES <caztLdekDoor(ES <);s 8  pF TES <caztUnldekDoor(ES <);s-y  pF TiN@T aztGetValue(u vNRE_FGchar *result);s-y  pF TiN@T aztGetQChannelInfo(     cCazt_Toc *qp);s-y  pF TiN@T aztUpd p,Toc(ES <);s-y  pF TiN@T aztGetDvskInfo(ES <);s-#iH_AZT_MULTISESSION 
- y  pF TiN@TaztGetMultiDvskInfo(ES <);s+y  pF TiN@TaztGetValue(u vNRE_FGchar *result);s+y  pF TiN@TaztGetQChannelInfo(     cCazt_Toc *qp);s+y  pF TiN@TaztUpd p,Toc(ES <);s+y  pF TiN@TaztGetDvskInfo(ES <);s+#iH_AZT_MULTISESSIONs+y  pF TiN@TaztGetMultiDvskInfo(ES <);s v)@ vNR-y  pF TiN@T aztGetToc(iN@Tmulti);s+y  pF TiN@TaztGetToc(iN@Tmulti);s M ze Kernel In4erface Functt *s */s-y  pF TiN@TCcheck_aztcd_media_change(kdev_t full_dev);s-y  pF TiN@T aztcd_ioctl(y    cCinode *ip,      cCt
 
+*tp, u vNRE_FGit4 cmd, u vNRE_FGENERcarg);s+y  pF TiN@Tcheck_aztcd_media_change(kdev_t full_dev);s+y  pF TiN@Taztcd_ioctl(y    cCinode *ip,      cCt
 
+*tp, u vNRE_FGit4 cmd,n+		       u vNRE_FGENERcarg);s 8  pF TES <cazt_transfer(ES <);s 8  pF TES <cdo_aztcd_e quest(e quest_queue_t *);s 8  pF TES <cazt_invalid p,_buffers(ES <);s-iN@T        aztcd_ope*(y    cCinode *ip,      cCt
 
+*tp);s+iN@Taztcd_ope*(y    cCinode *ip,      cCt
 
+*tp);s n-vmfzbH_AZT_KERNEL_PRIOR_2_1s-8  pF TES <caztcd_release(y    cCinode * inode,      cCt
 
+*Ct
 e);s-v)lseo-y  pF TiN@T aztcd_release(y    cCinode * inode,      cCt
 
+*Ct
 e);s-v)@ vN
+y  pF TiN@Taztcd_release(y    cCinode *inode,      cCt
 
+*t
 
);s n-iN@T      aztcd_itit(ES <);s+iN@Taztcd_itit(ES <);s s 8  pF Ty    cCb dek_device_operact *s azt_fops =l{ -	ope*:			aztcd_ope*,
-	e lease:		aztcd_release,
-	ioctl:			aztcd_ioctl,
-	check_media_change:	check_aztcd_media_change,
+	ope*:aztcd_ope*,
+	release:aztcd_release,
+	ioctl:aztcd_ioctl,
+	check_media_change:check_aztcd_media_change,
 };n M /*TAztcd S  te Machine: Controls Drive OperactERcS  te */s@@
n386,7 +368,7 y s 8  pF TES <cazt_hsg2msf(lNERchsg,      cCmsfC*msf);s 8  pF TENERcazt_msf2hsg(     cCmsfC*mp);s 8  pF TES <cazt_bin2bcd(u vNRE_FGchar *p);s-y  pF TiN@T azt_bcd2bin(u vNRE_FGchar bcd);s+y  pF TiN@Tazt_bcd2bin(u vNRE_FGchar bcd);s M /*##########################################################################
   CDROM Drive Low Level I/O Functt *ss@@
n397,53 +379,64 y s /* Wait G_SMOP_OK =ldrive answers with AFL_OP_OK aft
rCreceivtERca command*/s # defLi)MOP_OK op_ok()
 ES <cop_ok(ES <)n-{ aztTimeOutCount=0; 
-  do { aztIndacum=inb(DATA_PORT);
-       aztTimeOutCount++;o-       iUR	aztTimeOutCount>=AZT_TIMEOUT)n-	{ priN@k("aztcd: Error Wait OP_OK\n");n-	  bnuxk;
-	}
-     } wh
 
 (aztIndacum!=AFL_OP_OK);s+{o+	aztTimeOutCount = 0;o+	do {n+		aztIndacum = inb(DATA_PORT);
+		aztTimeOutCount++;o+		iUR	aztTimeOutCount >= AZT_TIMEOUT) {n+			priN@k("aztcd: Error Wait OP_OK\n");np		7bnuxk;
+		}s+	} wh
 
 (aztIndacum != AFL_OP_OK);s }n s /*CWait G_SMPA_OK =ldrive answers with AFL_PA_OK aft
rCreceivtERcparameters*/s # defLi)MPA_OK pa_ok()
 ES <cpa_ok(ES <)n-{ aztTimeOutCount=0; 
-  do { aztIndacum=inb(DATA_PORT);
-       aztTimeOutCount++;o-       iUR	aztTimeOutCount>=AZT_TIMEOUT)n-	{ priN@k("aztcd: Error Wait PA_OK\n");n-	  bnuxk;
-	}
-     } wh
 
 (aztIndacum!=AFL_PA_OK);s+{o+	aztTimeOutCount = 0;o+	do {n+		aztIndacum = inb(DATA_PORT);
+		aztTimeOutCount++;o+		iUR	aztTimeOutCount >= AZT_TIMEOUT) {n+			priN@k("aztcd: Error Wait PA_OK\n");np		7bnuxk;
+		}s+	} wh
 
 (aztIndacum != AFL_PA_OK);s }
-     
+s /*CWait G_SMSTEN=Low = handshake sNREal 'AFL_.._OK availab 
+_SMcommand executed*/s # defLi)MSTEN_LOW  ste*_low()
 ES <cste*_low(ES <)n-{ aztTimeOutCount=0; 
-  do { aztIndacum=inb(STATUS_PORT);
-       aztTimeOutCount++;o-       iUR	aztTimeOutCount>=AZT_TIMEOUT)n-	{ iUR	azt_stit_)nd) priN@k("aztcd: Error Wait STEN_LOW commands:%x\n",aztCmd);n-	  bnuxk;
-	}
-     } wh
 
 (aztIndacum&AFL_STATUS);s+{o+	aztTimeOutCount = 0;o+	do {n+		aztIndacum = inb(STATUS_PORT);
+		aztTimeOutCount++;o+		iUR	aztTimeOutCount >= AZT_TIMEOUT) {n+			iUR	azt_stit_)nd)n+			7priN@kn+				    ("aztcd: Error Wait STEN_LOW commands:%x\n",n+				     aztCmd);np		7bnuxk;
+		}s+	} wh
 
 (aztIndacum & AFL_STATUS);s }n s /*CWait G_SMDTEN=Low = handshake sNREal 'Data availab 
'*/s # defLi)MDTEN_LOW dte*_low()
 ES <cdte*_low(ES <)n-{ aztTimeOutCount=0; 
-  do { aztIndacum=inb(STATUS_PORT);
-       aztTimeOutCount++;o-       iUR	aztTimeOutCount>=AZT_TIMEOUT)n-	{ priN@k("aztcd: Error Wait DTEN_OK\n");n-	  bnuxk;
-	}
-     } wh
 
 (aztIndacum&AFL_DATA);s+{o+	aztTimeOutCount = 0;o+	do {n+		aztIndacum = inb(STATUS_PORT);
+		aztTimeOutCount++;o+		iUR	aztTimeOutCount >= AZT_TIMEOUT) {n+			priN@k("aztcd: Error Wait DTEN_OK\n");np		7bnuxk;
+		}s+	} wh
 
 (aztIndacum & AFL_DATA);s }n s /*CM@@
n452,25 +445,29 y s */s #defLi) STEN_LOW_WAIT   8  tusAzt()
 ES <cst tusAzt(ES <)n-{ AztTimeout = AZT_STATUS_DELAY;o-  SET_TIMER(aztS  tTimer, HZ/100); 
-  sleep_on(&azt_waitq);
-  iUR	AztTimeout <= 0) priN@k("aztcd: Error Wait STEN_LOW_WAIT command:%x\n",aztCmd);n-  e unsi;n+{o+	AztTimeout = AZT_STATUS_DELAY;o+	SET_TIMER(aztS  tTimer, HZ / 100);o+	yleep_on(&azt_waitq);
+	iUR	AztTimeout <= 0)
+		priN@k("aztcd: Error Wait STEN_LOW_WAIT command:%x\n",n+		       aztCmd);np	e unsi;n }n s 8  pF TES <caztS  tTimer(ES <)n-{ iUR	!(inb(STATUS_PORT) & AFL_STATUS))
-     { wake_up(&azt_waitq);
-       e unsi;n-     }M-  AztTimeout--;n-  iUR	AztTimeout <= 0)
-     { wake_up(&azt_waitq);
-       priN@k("aztcd: Error aztS  tTimer: Timeout\n");n-       e unsi;n-     }M-  SET_TIMER(aztS  tTimer, HZ/100);n+{o+	iUR	!(inb(STATUS_PORT) & AFL_STATUS)) {n+		wake_up(&azt_waitq);
+		e unsi;n+	}
+	AztTimeout--;n+	iUR	AztTimeout <= 0) {n+		wake_up(&azt_waitq);
+		priN@k("aztcd: Error aztS  tTimer: Timeout\n");n+		e unsi;n+	}
+	SET_TIMER(aztS  tTimer, HZ / 100);o }n s /*##########################################################################
@@
n481,111 +478,125 y s  * S)ndca stERle command, e unsi -1 on error, )lse 0s */M y  pF TiN@TaztS)ndCmd(it4 cmd)n-{  u vNRE_FGchar data;
-   iN@Tretry;n+{o+	u vNRE_FGchar data;
+	iN@Tretry;n s vmfzbH_AZT_DEBUGs-   priN@k("aztcd: Executvng command %x\n",cmd);
p	priN@k("aztcd: Executvng command %x\n", cmd);
 #)@ vNR M-   iUR	(azt_port==0x1f0)||(azt_port==0x170))  n-      SWITCH_IDE_SLAVE; /*switch IDE in4erface toFslave configuract **/M-   n-   aztCmd=cmd;
-   outb(POLLED,MODE_PORT);
-   do { iUR	inb(STATUS_PORT)&AFL_STATUS) bnuxk;
-	inb(DATA_PORT);    ze iURst tus lefcCH0xm last command, e ad and */M-      } wh
 
 (1);         /* discard it */M-   do { iUR	inb(STATUS_PORT)&AFL_DATA) bnuxk;
-	inb(DATA_PORT);    ze iURdata lefcCH0xm last command, e ad and */M-      } wh
 
 (1);         /* discard it */M-   G_SM(retry=0;retry<AZT_RETRY_ATTEMPTS;retry++)
-     { outb((u vNRE_FGchar) cmd,CMD_PORT);
-       STEN_LOW;
-       data=inb(DATA_PORT);
-       iUR	data==AFL_OP_OK)n-	 { e unsi 0;}           /*OP_OK?*/M-       iUR	data==AFL_OP_ERR)n-	 { STEN_LOW;
-	   data=inb(DATA_PORT);
-	   priN@k("### Error 1 aztcd: aztS)ndCmd %x  Error Code %x\n",cmd,data);s-	 }
-     }M-   iUR	retry>=AZT_RETRY_ATTEMPTS)
-     { priN@k("### Error 2 aztcd: aztS)ndCmd %x \n",cmd);
-       azt_error=0xA5;n-     }M-   RETURNM("aztS)ndCmd",-1);
+	iUR	(azt_portT== 0x1f0) || (azt_portT== 0x170))n+		SWITCH_IDE_SLAVE;	/*switch IDE in4erface toFslave configuract * */Mp
+	aztCmd =ccmd;
+	outb(POLLED, MODE_PORT);
+	do {n+		iUR	inb(STATUS_PORT) & AFL_STATUS)np		7bnuxk;
+		inb(DATA_PORT);	ze iURst tus lefcCH0xm last command, e ad and */M+	} wh
 
 (1);		ze'discard it */M+	do {n+		iUR	inb(STATUS_PORT) & AFL_DATA)np		7bnuxk;
+		inb(DATA_PORT);	ze iURdata lefcCH0xm last command, e ad and */M+	} wh
 
 (1);		ze'discard it */M+	G_SM(retry = 0;Tretry < AZT_RETRY_ATTEMPTS; retry++) {n+		outb((u vNRE_FGchar) cmd, CMD_PORT);
+		STEN_LOW;
+		data = inb(DATA_PORT);
+		iUR	dataT== AFL_OP_OK) {n+			e unsi 0;
+		}		zeOP_OK? */s+		iUR	dataT== AFL_OP_ERR) {n+			STEN_LOW;
+			data = inb(DATA_PORT);
+		7priN@kn+			    ("### Error 1 aztcd: aztS)ndCmd %x  Error Code %x\n",n+			     cmd, data);s+		}s+	}
+	iUR	retry >= AZT_RETRY_ATTEMPTS) {n+		priN@k("### Error 2 aztcd: aztS)ndCmd %x \n", cmd);
p		azt_error = 0xA5;n+	}
+	RETURNM("aztS)ndCmd", -1);
 }n s /*s  * S)ndca play+_SMe ad command toFthe) rive, e unsi -1 on error, )lse 0s */M y  pF TiN@TsendAztCmd(it4 cmd,T     cCazt_Play_msfC*params)n-{  u vNRE_FGchar data;
-   iN@Tretry;n+{o+	u vNRE_FGchar data;
+	iN@Tretry;n s vmfzbH_AZT_DEBUGs-   priN@k("aztcd: play+y  rt=%02x:%02x:%02x  end=%02x:%02x:%02x\n", \
-	   params->8  rt.min,Tparams->8  rt.sec,Tparams->8  rt.f ame, \
-	   params->end.min,T  params->end.sec,T  params->end.f ame);s-v)@ vN   n-   G_SM(retry=0;retry<AZT_RETRY_ATTEMPTS;retry++)
-     { aztS)ndCmd(cmd);
-       outb(params -> 8  rt.min,CMD_PORT);
-       outb(params -> 8  rt.sec,CMD_PORT);
-       outb(params -> 8  rt.f ame,CMD_PORT);
-       outb(params -> end.min,CMD_PORT);
-       outb(params -> end.sec,CMD_PORT);
-       outb(params -> end.f ame,CMD_PORT);
-       STEN_LOW;
-       data=inb(DATA_PORT);
-       iUR	data==AFL_PA_OK)n-	 { e unsi 0;}           /*PA_OK ?*/M-       iUR	data==AFL_PA_ERR)n-	 { STEN_LOW;
-	   data=inb(DATA_PORT);
-	   priN@k("### Error 1 aztcd: sendAztCmd %x  Error Code %x\n",cmd,data);s-	 }
-     }M-   iUR	retry>=AZT_RETRY_ATTEMPTS)
-     { priN@k("### Error 2 aztcd: sendAztCmd %x\n ",cmd);
-       azt_error=0xA5;n-     }M-   RETURNM("sendAztCmd",-1);
+	priN@k("aztcd: play+y  rt=%02x:%02x:%02x  end=%02x:%02x:%02x\n",o+	       params->8  rt.min,Tparams->8  rt.sec,Tparams->8  rt.f ame,o+	       params->end.min,Tparams->end.sec,Tparams->end.f ame);s+v)@ vN
+	G_SM(retry = 0;Tretry < AZT_RETRY_ATTEMPTS; retry++) {n+		aztS)ndCmd(cmd);
+		outb(params->8  rt.min,TCMD_PORT);
+		outb(params->8  rt.sec,TCMD_PORT);
+		outb(params->8  rt.f ame, CMD_PORT);
+		outb(params->end.min,TCMD_PORT);
+		outb(params->end.sec,TCMD_PORT);
+		outb(params->end.f ame, CMD_PORT);
+		STEN_LOW;
+		data = inb(DATA_PORT);
+		iUR	dataT== AFL_PA_OK) {n+			e unsi 0;
+		}		zePA_OK ? */s+		iUR	dataT== AFL_PA_ERR) {n+			STEN_LOW;
+			data = inb(DATA_PORT);
+		7priN@kn+			    ("### Error 1 aztcd: sendAztCmd %x  Error Code %x\n",n+			     cmd, data);s+		}s+	}
+	iUR	retry >= AZT_RETRY_ATTEMPTS) {n+		priN@k("### Error 2 aztcd: sendAztCmd %x\n ", cmd);
p		azt_error = 0xA5;n+	}
+	RETURNM("sendAztCmd", -1);
 }n s /*s  * S)ndca seek command toFthe) rive, e unsi -1 on error, )lse 0s */M y  pF TiN@TaztS)ek(y    cCazt_Play_msfC*params)n-{  u vNRE_FGchar data;
-   iN@Tretry;n+{o+	u vNRE_FGchar data;
+	iN@Tretry;n s vmfzbH_AZT_DEBUGs-   priN@k("aztcd: aztS)ek %02x:%02x:%02x\n", \
-	   params->8  rt.min,Tparams->8  rt.sec,Tparams->8  rt.f ame);s-v)@ vN   n-   G_SM(retry=0;retry<AZT_RETRY_ATTEMPTS;retry++)
-     { aztS)ndCmd(ACMD_SEEK);
-       outb(params -> 8  rt.min,CMD_PORT);
-       outb(params -> 8  rt.sec,CMD_PORT);
-       outb(params -> 8  rt.f ame,CMD_PORT);
-       STEN_LOW;
-       data=inb(DATA_PORT);
-       iUR	data==AFL_PA_OK)n-	 { e unsi 0;}           /*PA_OK ?*/M-       iUR	data==AFL_PA_ERR)n-	 { STEN_LOW;
-	   data=inb(DATA_PORT);
-	   priN@k("### Error 1 aztcd: aztS)ek\n");n-	 }
-     }M-   iUR	retry>=AZT_RETRY_ATTEMPTS)
-     { priN@k("### Error 2 aztcd: aztS)ek\n ");
-       azt_error=0xA5;n-     }M-   RETURNM("aztS)ek",-1);
+	priN@k("aztcd: aztS)ek %02x:%02x:%02x\n",o+	       params->8  rt.min,Tparams->8  rt.sec,Tparams->8  rt.f ame);s+v)@ vN
+	G_SM(retry = 0;Tretry < AZT_RETRY_ATTEMPTS; retry++) {n+		aztS)ndCmd(ACMD_SEEK);
+		outb(params->8  rt.min,TCMD_PORT);
+		outb(params->8  rt.sec,TCMD_PORT);
+		outb(params->8  rt.f ame, CMD_PORT);
+		STEN_LOW;
+		data = inb(DATA_PORT);
+		iUR	dataT== AFL_PA_OK) {n+			e unsi 0;
+		}		zePA_OK ? */s+		iUR	dataT== AFL_PA_ERR) {n+			STEN_LOW;
+			data = inb(DATA_PORT);
+		7priN@k("### Error 1 aztcd: aztS)ek\n");n+		}s+	}
+	iUR	retry >= AZT_RETRY_ATTEMPTS) {n+		priN@k("### Error 2 aztcd: aztS)ek\n ");
p		azt_error = 0xA5;n+	}
+	RETURNM("aztS)ek", -1);
 }n s /* S)ndca Set Dvsk Type commandn@@
n593,79 +604,86 y s    dent on wh
ch mode iR set ???s */M y  pF TiN@TaztS)tDvskType(it4 type)n-{  u vNRE_FGchar data;
-   iN@Tretry;n+{o+	u vNRE_FGchar data;
+	iN@Tretry;n s vmfzbH_AZT_DEBUGs-   priN@k("aztcd: set  vsk type command: type= %i\n",type);
p	priN@k("aztcd: set  vsk type command: type= %i\n", type);
 v)@ vNR-   G_SM(retry=0;retry<AZT_RETRY_ATTEMPTS;retry++)
-     { aztS)ndCmd(ACMD_SET_DISK_TYPE);
-       outb(type,CMD_PORT);
-       STEN_LOW;
-       data=inb(DATA_PORT);
-       iUR	data==AFL_PA_OK)     /*PA_OK ?*/M-	 { azt_read_mode=type;
-	   e unsi 0;            n-	 }  n-       iUR	data==AFL_PA_ERR)n-	 { STEN_LOW;
-	   data=inb(DATA_PORT);
-	   priN@k("### Error 1 aztcd: aztS)tDvskType %x Error Code %x\n",type,data);s-	 }
-     }M-   iUR	retry>=AZT_RETRY_ATTEMPTS)
-     { priN@k("### Error 2 aztcd: aztS)tDvskType %x\n ",type);
-       azt_error=0xA5;n-     }M-   RETURNM("aztS)tDvskType",-1);
+	G_SM(retry = 0;Tretry < AZT_RETRY_ATTEMPTS; retry++) {n+		aztS)ndCmd(ACMD_SET_DISK_TYPE);
+		outb(type,TCMD_PORT);
+		STEN_LOW;
+		data = inb(DATA_PORT);
+		iUR	dataT== AFL_PA_OK) {	zePA_OK ? */s+			azt_read_mode = type;
+			e unsi 0;
+		}s+		iUR	dataT== AFL_PA_ERR) {n+			STEN_LOW;
+			data = inb(DATA_PORT);
+		7priN@kn+			    ("### Error 1 aztcd: aztS)tDvskType %x Error Code %x\n",n+			     type,Tdata);s+		}s+	}
+	iUR	retry >= AZT_RETRY_ATTEMPTS) {n+		priN@k("### Error 2 aztcd: aztS)tDvskType %x\n ", type);
p		azt_error = 0xA5;n+	}
+	RETURNM("aztS)tDvskType", -1);
 }n s s /* us_FGitTazt_poll toFpoll the y  tus, )xprcts another program0toFissueca s  * ACMD_GET_STATUS  vrrctly beG_Se n  +/M-y  pF TiN@TaztS  tus(ES <)  n-{       iN@Tst;
py  pF TiN@TaztS  tus(ES <)n+{o+	int st;
 /*	int i;
 M 	i = inb(STATUS_PORT) & AFL_STATUS;    iR STEN=0?    ???s 	iUR	!i)
-*/      STEN_LOW;
-        iUR	aztTimeOutCount<AZT_TIMEOUT)	n-	{   	st = inb(DATA_PORT) & 0xFF;
++/ STEN_LOW;
+	iUR	aztTimeOutCount < AZT_TIMEOUT) {n+		st = inb(DATA_PORT) & 0xFF;
 		e unsi st;
-	}
-	)lseo-		RETURNM("aztS  tus",-1);
+	} )lseo+		RETURNM("aztS  tus", -1);
 }n s /*s  * GecCthe) rive y  tusn  +/M y  pF TiN@TgetAztS  tus(ES <)n-{       iN@Tst;
p{o+	int st;
 
-	iUR	aztS)ndCmd(ACMD_GET_STATUS)) RETURNM("getAztS  tus 1",-1);
+	iUR	aztS)ndCmd(ACMD_GET_STATUS))o+		RETURNM("getAztS  tus 1", -1);
 	STEN_LOW;
 	st = inb(DATA_PORT) & 0xFF;
 vmfzbH_AZT_DEBUGs-	priN@k("aztcd: S  tusT= %x\n",st);
p	priN@k("aztcd: S  tusT= %x\n", st);
 v)@ vNR-	iUR	(stT== 0xFF)||(st&AST_CMD_CHECK))n-	 { priN@k("aztcd: AST_CMD_CHECK error _SMnoRst tus availab 
\n");n-	   e unsi -1;s-	 }
-R-	iUR	((st&AST_MODE_BITS)!=AST_BUSY) &&R	aztAudioS  tusT== CDROM_AUDIO_PLAY))n-	   /* XXX might be an error? look at q-channel? */s-	 TCaztAudioS  tusT= CDROM_AUDIO_COMPLETED;
-R-	iUR	(stT& AST_DSK_CHG)||(stT& AST_NOT_READY))n-	 { aztDvskChanged = 1;
-	 TCaztTocUpToD
te = 0;o-	 TCaztAudioS  tusT= CDROM_AUDIO_NO_STATUS;
-	 }
+	iUR	(stT== 0xFF) || (stT& AST_CMD_CHECK)) {n+		priN@kn+		    ("aztcd: AST_CMD_CHECK error _SMnoRst tus availab 
\n");n+		e unsi -1;n+	}M+o+	iUR		(stT& AST_MODE_BITS) != AST_BUSY)o+	    &&R	aztAudioS  tusT== CDROM_AUDIO_PLAY))n+		/* XXX might be an error? look at q-channel? */sp		aztAudioS  tusT= CDROM_AUDIO_COMPLETED;
+
+	iUR	(stT& AST_DSK_CHG) || (stT& AST_NOT_READY)) {n+		aztDvskChanged = 1;
+		aztTocUpToD
te = 0;op		aztAudioS  tusT= CDROM_AUDIO_NO_STATUS;
+	}n 	e unsi st;
 }n s@@
n674,7 +692,9 y s  * S)ndca 'Play' command and gecCthe)st tus.  Use only H0xm 
ld)top half.n  +/M y  pF TiN@TaztPlay(y    cCazt_Play_msfC*arg)n-{       iUR	sendAztCmd(ACMD_PLAY_AUDIO,carg) < 0) RETURNM("aztPlay",-1);
+{o+	iUR	sendAztCmd(ACMD_PLAY_AUDIO,carg) < 0)o+		RETURNM("aztPlay", -1);
 	e unsi 0;
 }n s@@
n685,27 +705,27 y s  */o 8  pF TES <caztCloseDoor(ES <)
l{ -  aztS)ndCmd(ACMD_CLOSE);
-  STEN_LOW;
-  e unsi;n+	aztS)ndCmd(ACMD_CLOSE);
+	STEN_LOW;
+	e unsi;n }n s 8  pF TES <caztLdekDoor(ES <)
l{  #iH_AZT_ALLOW_TRAY_LOCK -  aztS)ndCmd(ACMD_LOCK);
-  STEN_LOW;
+	aztS)ndCmd(ACMD_LOCK);
+	STEN_LOW;
 v)@ vNR-  e unsi;n+	e unsi;n }n s 8  pF TES <caztUnldekDoor(ES <)
l{  #iH_AZT_ALLOW_TRAY_LOCK -  aztS)ndCmd(ACMD_UNLOCK);
-  STEN_LOW;
+	aztS)ndCmd(ACMD_UNLOCK);
+	STEN_LOW;
 v)@ vNR-  e unsi;n+	e unsi;n }n s /*s@@
n714,11 +734,12 y s  * beFissued with aztS)ndCmd()  vrrctly beG_Sen  +/M y  pF TiN@TaztGetValue(u vNRE_FGchar *result)n-{       iN@Ts;
p{o+	int s;
 M 	STEN_LOW;
-	iUR	aztTimeOutCount>=AZT_TIMEOUT)n-	{       priN@k("aztcd: aztGetValue timeout\n");n+	iUR	aztTimeOutCount >= AZT_TIMEOUT) {n+		priN@k("aztcd: aztGetValue timeout\n");n 		e unsi -1;n 	}n 	s = inb(DATA_PORT) & 0xFF;
@@
n731,42 +752,55 y s  * tab 
+of contents.n  +/M iN@TaztGetQChannelInfo(     cCazt_Toc *qp)n-{       u vNRE_FGchar notUsed;n+{o+	u vNRE_FGchar notUsed;n 	int st;
 
 vmfzbH_AZT_DEBUGs-	priN@k("aztcd: 8  rtiERcaztGetQChannelInfo  Time:%li\n",jiffies);
p	priN@k("aztcd: s  rtiERcaztGetQChannelInfo  Time:%li\n", jiffies);
 v)@ vNR-	iUR	(st=getAztS  tus())==-1)        RETURNM("aztGetQChannelInfo 1",-1);
-	iUR	aztS)ndCmd(ACMD_GET_Q_CHANNEL)) RETURNM("aztGetQChannelInfo 2",-1);
-	/*STEN_LOW_WAIT; ??? Dosemu0.60's cd0xm.c does not lik) STEN_LOW_WAIT here*/M-	iUR	aztGetValue(&notUsed)) RETURNM("aztGetQChannelInfo 3",-1); /*??? Nullbyte einlesen*/M-	iUR	(st&AST_MODE_BITS)==AST_INITIAL)n-	 { qp->ctrl_addr=0;      /* whenMaudio stop ACMD_GET_Q_CHANNEL e unsis */s-	 TCqp->track=0;          /* only one byte with AztechC rives */s-	 TCqp->poiN@Index=0;o-	 TCqp->trackTime.min=0;o-	 TCqp->trackTime.sec=0;o-	 TCqp->trackTime.f ame=0;o-	 TCqp-> vskTime.min=0;o-	 TCqp-> vskTime.sec=0;o-	 TCqp-> vskTime.f ame=0;o-	 TCe unsi 0;  s-	 }
-	)lseo-	 { iUR	aztGetValue(&qp -> ctrl_addr) < 0)       RETURNM("aztGetQChannelInfo 4",-1);
-	   iUR	aztGetValue(&qp -> track) < 0)           RETURNM("aztGetQChannelInfo 4",-1);
-	   iUR	aztGetValue(&qp -> poiN@Index) < 0)      RETURNM("aztGetQChannelInfo 4",-1);
-	   iUR	aztGetValue(&qp -> trackTime.min) < 0)   RETURNM("aztGetQChannelInfo 4",-1);
-	   iUR	aztGetValue(&qp -> trackTime.sec) < 0)   RETURNM("aztGetQChannelInfo 4",-1);
-	   iUR	aztGetValue(&qp -> trackTime.f ame) < 0) RETURNM("aztGetQChannelInfo 4",-1);
-	   iUR	aztGetValue(&notUsed) < 0)               RETURNM("aztGetQChannelInfo 4",-1);
-	   iUR	aztGetValue(&qp ->  vskTime.min) < 0)    RETURNM("aztGetQChannelInfo 4",-1);
-	   iUR	aztGetValue(&qp ->  vskTime.sec) < 0)    RETURNM("aztGetQChannelInfo 4",-1);
-	   iUR	aztGetValue(&qp ->  vskTime.f ame) < 0)  RETURNM("aztGetQChannelInfo 4",-1);
-	 }
+	iUR	(stT= getAztS  tus())T== -1)o+		RETURNM("aztGetQChannelInfo 1", -1);
+	iUR	aztS)ndCmd(ACMD_GET_Q_CHANNEL))o+		RETURNM("aztGetQChannelInfo 2", -1);
+	/*STEN_LOW_WAIT; ??? Dosemu0.60's cd0xm.c does not lik) STEN_LOW_WAIT here */sp	iUR	aztGetValue(&notUsed))o+		RETURNM("aztGetQChannelInfo 3", -1);	/*??? Nullbyte einlesen */sp	iUR	(stT& AST_MODE_BITS) == AST_INITIAL) {n+		qp->ctrl_addr = 0;	/* whenMaudio stop ACMD_GET_Q_CHANNEL e unsis */s+		qp->track = 0;	/* only one byte with AztechC rives */s+		qp->poiN@Index = 0;op		qp->trackTime.min = 0;op		qp->trackTime.sec = 0;op		qp->trackTime.f ame = 0;op		qp-> vskTime.min = 0;op		qp-> vskTime.sec = 0;op		qp-> vskTime.f ame = 0;op		e unsi 0;
+	} )lse {n+		iUR	aztGetValue(&qp->ctrl_addr) < 0)o+			RETURNM("aztGetQChannelInfo 4", -1);
+		iUR	aztGetValue(&qp->track) < 0)o+			RETURNM("aztGetQChannelInfo 4", -1);
+		iUR	aztGetValue(&qp->poiN@Index) < 0)o+			RETURNM("aztGetQChannelInfo 4", -1);
+		iUR	aztGetValue(&qp->trackTime.min) < 0)o+			RETURNM("aztGetQChannelInfo 4", -1);
+		iUR	aztGetValue(&qp->trackTime.sec) < 0)o+			RETURNM("aztGetQChannelInfo 4", -1);
+		iUR	aztGetValue(&qp->trackTime.f ame) < 0)o+			RETURNM("aztGetQChannelInfo 4", -1);
+		iUR	aztGetValue(&notUsed) < 0)o+			RETURNM("aztGetQChannelInfo 4", -1);
+		iUR	aztGetValue(&qp-> vskTime.min) < 0)o+			RETURNM("aztGetQChannelInfo 4", -1);
+		iUR	aztGetValue(&qp-> vskTime.sec) < 0)o+			RETURNM("aztGetQChannelInfo 4", -1);
+		iUR	aztGetValue(&qp-> vskTime.f ame) < 0)o+			RETURNM("aztGetQChannelInfo 4", -1);
+	}
 vmfzbH_AZT_DEBUGs-	priN@k("aztcd: exitiERcaztGetQChannelInfo  Time:%li\n",jiffies);
p	priN@k("aztcd: exitiERcaztGetQChannelInfo  Time:%li\n", jiffies);
 v)@ vNR 	e unsi 0;
 }n@@
n775,11 +809,12 y s  * ReadC
ld)tab 
+of contents (TOC) and TOC header iURnecurcaryn  +/M y  pF TiN@TaztUpd p,Toc()n-{       iN@Tst;
p{o+	int st;
 
 vmfzbH_AZT_DEBUGs-	priN@k("aztcd: 8  rtiERcaztUpd p,Toc  Time:%li\n",jiffies);
-v)@ vN  
p	priN@k("aztcd: s  rtiERcaztUpd p,Toc  Time:%li\n", jiffies);
+v)@ vNR 	iUR	aztTocUpToD
te)n 		e unsi 0;o M@@
n789,57 +824,63Ry s 	iUR	aztGetToc(0) < 0)o 		e unsi -EIO;n n-        /*audio  vsk detecct *
-          with my AztechC riveC
ldre iR noMaudio st tusTbit, so I us_C
ld)copy
-          protecct *Tbit+of 
ld)firstTtrack. If 
liR track is copy protecc_FG
-          (copy bit+= 0), I assume, it'R anMaudio   vsk. Strange, but works ??? */M-        iUR	!(Toc[DvskInfo.first].ctrl_addr & 0x40)) 
-           DvskInfo.audio=1;
-        else n-           DvskInfo.audio=0;
-R-        /* XA detecct * */M-	iUR	! DvskInfo.audio) 
-	   {Cazt_Play.8  rt.min   = 0;T /*XA detecct * only seems0toFwork*/M-             azt_Play.8  rt.sec   = 2;T /*whenMwe play+a track*/s-	 TC  azt_Play.8  rt.f ame = 0;o-	 TC  azt_Play.end.min TC  = 0;o-	 TC  azt_Play.end.sec     = 0;o-	 TC  azt_Play.end.f ame   = 1;
-	 TC  iUR	sendAztCmd(ACMD_PLAY_READ, &azt_Play)) e unsi -1;s-	     DTEN_LOW;
-	     G_SM(st=0;st<CD_FRAMESIZE;st++) inb(DATA_PORT);
-           } 
-        DvskInfo.xaT= getAztS  tus()T& AST_MODE;
-        iUR	DvskInfo.xa) 
-           { priN@k("aztcd: XA support )xprrimental - mail results0toFWerner.Zimmermann@fht-urcliERen.de\n");n-           }M-        n-        /*multisurct * detecct *
-          support G_SMmultisurct * CDs is done autom pF ally with AztechC rives,
-          we don't have toFtake care about TOC re vrrctt *; iURwe wancCthe)isofs
-          toFtake care about re vrrctt *,Rwe have toFset AZT_MULTISESSION toF1*/M-        DvskInfo.multi=0;
+	/*audio  vsk detecct *
+	   with my AztechC riveC
ldre iR noMaudio st tusTbit, so I us_C
ld)copy
+	   protecct *Tbit+of 
ld)firstTtrack. If 
liR track is copy protecc_FG
+	   (copy bit+= 0), I assume, it'R anMaudio   vsk. Strange, but works ??? */M+	iUR	!(Toc[DvskInfo.first].ctrl_addr & 0x40))o+		DvskInfo.audio = 1;
+	)lseo+		DvskInfo.audio = 0;
+o+	ze'XA detecct * */M+	iUR	!DvskInfo.audio) {n+		azt_Play.8  rt.min = 0;	/*XA detecct * only seems0toFwork */sp		azt_Play.8  rt.sec = 2;	/*whenMwe play+a track */sp		azt_Play.8  rt.f ame = 0;op		azt_Play.end.min = 0;op		azt_Play.end.sec = 0;op		azt_Play.end.f ame = 1;
+		iUR	sendAztCmd(ACMD_PLAY_READ, &azt_Play))
+			e unsi -1;n+		DTEN_LOW;
+		G_SM(st = 0;Tst < CD_FRAMESIZE; st++)n+			inb(DATA_PORT);
+	}
+	DvskInfo.xaT= getAztS  tus()T& AST_MODE;
+	iUR	DvskInfo.xa) {n+		priN@kn+		    ("aztcd: XA support )xprrimental - mail results0toFWerner.Zimmermann@fht-urcliERen.de\n");n+	}M+o+	/*multisurct * detecct *
+	   support G_SMmultisurct * CDs is done autom pF ally with AztechC rives,
+	   we don't have toFtake care about TOC re vrrctt *; iURwe wancCthe)isofs
+	   toFtake care about re vrrctt *,Rwe have toFset AZT_MULTISESSION toF1 */sp	DvskInfo.multi = 0;o viH_AZT_MULTISESSIONs-  	iUR	DvskInfo.xa) 
-  	   {CaztGetMultiDvskInfo(); /*ldre Dvsk.Info.multi iR set*/M-  	   }M-v)@ vNR-        iUR	DvskInfo.multi)
-           { DvskInfo.lastSurct *.min T= Toc[DvskInfo.next]. vskTime.min;s-	     DvskInfo.lastSurct *.sec  = Toc[DvskInfo.next]. vskTime.sec;M-             DvskInfo.lastSurct *.f ame= Toc[DvskInfo.next]. vskTime.f ame;
-             priN@k("aztcd: Multisurct * support )xprrimental\n");n-           }M-        )lseo-           { DvskInfo.lastSurct *.min T= Toc[DvskInfo.first]. vskTime.min;s-	     DvskInfo.lastSurct *.sec  = Toc[DvskInfo.first]. vskTime.sec;M-             DvskInfo.lastSurct *.f ame= Toc[DvskInfo.first]. vskTime.f ame;
-           }
+	iUR	DvskInfo.xa) {n+		aztGetMultiDvskInfo();	/*ldre Dvsk.Info.multi iR set */M+	}s+v)@ vN
+	iUR	DvskInfo.multi) {n+		DvskInfo.lastSurct *.min = Toc[DvskInfo.next]. vskTime.min;s+		DvskInfo.lastSurct *.sec = Toc[DvskInfo.next]. vskTime.sec;M+		DvskInfo.lastSurct *.f ame =n+		    Toc[DvskInfo.next]. vskTime.f ame;
+		priN@k("aztcd: Multisurct * support )xprrimental\n");n+	} )lse {n+		DvskInfo.lastSurct *.min =n+		    Toc[DvskInfo.first]. vskTime.min;s+		DvskInfo.lastSurct *.sec =n+		    Toc[DvskInfo.first]. vskTime.sec;M+		DvskInfo.lastSurct *.f ame =n+		    Toc[DvskInfo.first]. vskTime.f ame;
+	}
 o 	aztTocUpToD
te = 1;
 vmfzbH_AZT_DEBUGs-	priN@k("aztcd: exitiERcaztUpd p,Toc  Time:%li\n",jiffies);
+	priN@k("aztcd: exitiERcaztUpd p,Toc  Time:%li\n", jiffies);
 v)@ vNR 	e unsi 0;
 }n@@
n849,56 +890,58 y s  * trackn  +/M y  pF TiN@TaztGetDvskInfo()n-{ int limit;
-  u vNRE_FGchar test;
-       cCazt_Toc qInfo;M-s-vmfzbH_AZT_DEBUGs-  priN@k("aztcd: s  rtiERcaztGetDvskInfo  Time:%li\n",jiffies);
-v)@ vNn-  iUR	aztS)ndCmd(ACMD_SEEK_TO_LEADIN)) RETURNM("aztGetDvskInfo 1",-1);
-  STEN_LOW_WAIT;
-  test=0;
-  G_SM(limit=300;limit>0;limit--)
-   {  iUR	aztGetQChannelInfo(&qInfo)<0) RETURNM("aztGetDvskInfo 2",-1);
-      iUR	qInfo.poiN@Index==0xA0)   /*Number+of FirstTrack*/s-	{ DvskInfo.firstT= qInfo. vskTime.min;s-	  DvskInfo.firstT= azt_bcd2bin(DvskInfo.first);
-	  test=test|0x01;
-	}
-      iUR	qInfo.poiN@Index==0xA1)   /*Number+of LastTrack*/s-	{ DvskInfo.last T= qInfo. vskTime.min;s-	  DvskInfo.last T= azt_bcd2bin(DvskInfo.last);
-	  test=test|0x02;
-	}
-      iUR	qInfo.poiN@Index==0xA2)   /*DvskLength*/s-	{ DvskInfo.dvskLength.min=qInfo. vskTime.min;s-	  DvskInfo.dvskLength.sec=qInfo. vskTime.sec;M-	  DvskInfo.dvskLength.f ame=qInfo. vskTime.f ame;
-	  test=test|0x04;
-	}
-      iUR		qInfo.poiN@Index==DvskInfo.first)&&(test&0x01))   /*S  rtTime+of First Track*/s-	{ DvskInfo.firstTrack.min=qInfo. vskTime.min;s-	  DvskInfo.firstTrack.sec=qInfo. vskTime.sec;M-	  DvskInfo.firstTrack.f ame=qInfo. vskTime.f ame;
-	  test=test|0x08;
-	}
-      iUR	test==0x0F) bnuxk;
-   }M-vmfzbH_AZT_DEBUGs-  priN@k ("aztcd: exitiERcaztGetDvskInfo  Time:%li\n",jiffies);
-  priN@k("Dvsk Info:)firstT%d last %d length %02X:%02X.%02X dez )firstT%02X:%02X.%02X dez\n",n-  	  DvskInfo.first,s-	  DvskInfo.last,M-	  DvskInfo.dvskLength.min,s-	  DvskInfo.dvskLength.sec,M-	  DvskInfo.dvskLength.f ame,M-	  DvskInfo.firstTrack.min,s-	  DvskInfo.firstTrack.sec,M-	  DvskInfo.firstTrack.f ame);
p{o+	int limit;
+	u vNRE_FGchar test;
+	     cCazt_Toc qInfo;M+s+#iHzbH_AZT_DEBUGsp	priN@k("aztcd: s  rtiERcaztGetDvskInfo  Time:%li\n", jiffies);
+v)@ vNR+	iUR	aztS)ndCmd(ACMD_SEEK_TO_LEADIN))o+		RETURNM("aztGetDvskInfo 1", -1);
+	STEN_LOW_WAIT;
+	test = 0;op	G_SM(limit = 300; limit > 0; limit--) {n+		iUR	aztGetQChannelInfo(&qInfo) < 0)o+			RETURNM("aztGetDvskInfo 2", -1);
+		iUR	qInfo.poiN@IndexT== 0xA0) {	zeNumber+of FirstTrack */s+			DvskInfo.firstT= qInfo. vskTime.min;s+			DvskInfo.firstT= azt_bcd2bin(DvskInfo.first);
+			test = test | 0x01;
+		}s+		iUR	qInfo.poiN@IndexT== 0xA1) {	zeNumber+of LastTrack */s+			DvskInfo.last = qInfo. vskTime.min;s+			DvskInfo.last = azt_bcd2bin(DvskInfo.last);
+			test = test | 0x02;
+		}s+		iUR	qInfo.poiN@IndexT== 0xA2) {	zeDvskLength */s+			DvskInfo.dvskLength.min = qInfo. vskTime.min;s+			DvskInfo.dvskLength.sec = qInfo. vskTime.sec;M+			DvskInfo.dvskLength.f ame = qInfo. vskTime.f ame;
+			test = test | 0x04;
+		}s+		iUR		qInfo.poiN@IndexT== DvskInfo.first) &&R	test & 0x01)) {	zeS  rtTime+of First Track */s+			DvskInfo.firstTrack.minT= qInfo. vskTime.min;s+			DvskInfo.firstTrack.sec = qInfo. vskTime.sec;M+			DvskInfo.firstTrack.f ame = qInfo. vskTime.f ame;
+			test = test | 0x08;
+		}s+		iUR	test == 0x0F)np		7bnuxk;
+	}s+#iHzbH_AZT_DEBUGsp	priN@k("aztcd: exitiERcaztGetDvskInfo  Time:%li\n", jiffies);
+	priN@ko+	    ("Dvsk Info:)firstT%d last %d length %02X:%02X.%02X dez )firstT%02X:%02X.%02X dez\n",n+	     DvskInfo.first, DvskInfo.last, DvskInfo.dvskLength.min,s+	     DvskInfo.dvskLength.sec, DvskInfo.dvskLength.f ame,M+	     DvskInfo.firstTrack.min, DvskInfo.firstTrack.sec,M+	     DvskInfo.firstTrack.f ame);
 v)@ vNn-  iUR	test!=0x0F) e unsi -1;s-TCe unsi 0;R+	iUR	test != 0x0F)np		e unsi -1;n+	e unsi 0;
 }n s viH_AZT_MULTISESSIONs@@
n906,93 +949,105 y s  * GecCMultisurct * Dvsk Infon  +/M y  pF TiN@TaztGetMultiDvskInfo(ES <)n-{ int limit, k=5;
-  u vNRE_FGchar test;
-       cCazt_Toc qInfo;M-s-vmfzbH_AZT_DEBUGs-  priN@k("aztcd: s  rtiERcaztGetMultiDvskInfo\n");n-v)@ vNn-
-  do { azt_Play.8  rt.min   = Toc[DvskInfo.last+1]. vskTime.min;s-       azt_Play.8  rt.sec   = Toc[DvskInfo.last+1]. vskTime.sec;M-       azt_Play.8  rt.f ame = Toc[DvskInfo.last+1]. vskTime.f ame;
-       test=0;
-
-       G_SM(limit=30;limit>0;limit--)   /*S)ek G_SMLeadIn+of next surct **/M-           { iUR	aztS)ek(&azt_Play)) RETURNM("aztGetMultiDvskInfo 1",-1);
-             iUR	aztGetQChannelInfo(&qInfo)<0) RETURNM("aztGetMultiDvskInfo 2",-1);
-             iUR		qInfo.track==0)&&(qInfo.poiN@Index)) bnuxk;  /*LeadIn+found*/s-             iUR		azt_Play.8  rt.sec+=10) > 59)s-                {Cazt_Play.8  rt.sec=0;o-                  azt_Play.8  rt.min++;o-                }M-           }M-       iUR	!limit) bnuxk;  /*Check, iURa leadin track was+found, iURnot we'reo-                             acCthe))ndcof 
ld) vsk*/s+{o+	int limit, k = 5;
+	u vNRE_FGchar test;
+	     cCazt_Toc qInfo;M+s+#iHzbH_AZT_DEBUGsp	priN@k("aztcd: s  rtiERcaztGetMultiDvskInfo\n");n+v)@ vNR+o+	do {n+		azt_Play.8  rt.min = Toc[DvskInfo.last + 1]. vskTime.min;s+		azt_Play.8  rt.sec = Toc[DvskInfo.last + 1]. vskTime.sec;M+		azt_Play.8  rt.f ame =n+		    Toc[DvskInfo.last + 1]. vskTime.f ame;
+		test = 0;op
+		G_SM(limit = 30; limit > 0; limit--) {	/*S)ek G_SMLeadIn+of next surct * */s+			iUR	aztS)ek(&azt_Play))n+				RETURNM("aztGetMultiDvskInfo 1", -1);
+			iUR	aztGetQChannelInfo(&qInfo) < 0)o+				RETURNM("aztGetMultiDvskInfo 2", -1);
+			iUR		qInfo.track == 0) &&R	qInfo.poiN@Index))o+				bnuxk;	/*LeadIn+found */s+			iUR		azt_Play.8  rt.sec += 10) > 59) {n+				azt_Play.8  rt.sec = 0;op				azt_Play.8  rt.min++;o+			}s+		}s+		iUR	!limit)np		7bnuxk;	/*Check, iURa leadin track was+found, iURnot we'reo+				   acCthe))ndcof 
ld) vsk */s #iHzbH_AZT_DEBUG_MULTISESSIONs-       priN@k("leadin found track %d  poiN@Index %x  limit %d\n",qInfo.track,qInfo.poiN@Index,limit);
+		priN@k("leadin found track %d  poiN@Index %x  limit %d\n",n+		       qInfo.track, qInfo.poiN@Index, limit);
 v)@ vNR-       G_SM(limit=300;limit>0;limit--)
-           { iUR	++azt_Play.8  rt.f ame>74)s-                {Cazt_Play.8  rt.f ame=0;o-                  iUR	azt_Play.8  rt.sec > 59)s-                     {Cazt_Play.8  rt.sec=0;o-                       azt_Play.8  rt.min++;o-                     }M-                }     n-             iUR	aztS)ek(&azt_Play)) RETURNM("aztGetMultiDvskInfo 3",-1);
-             iUR	aztGetQChannelInfo(&qInfo)<0) RETURNM("aztGetMultiDvskInfo 4",-1);
-             iUR	qInfo.poiN@Index==0xA0)   /*Number+of NextTrack*/s-	 TC     { DvskInfo.next = qInfo. vskTime.min;s-	          DvskInfo.next = azt_bcd2bin(DvskInfo.next);s-	          test=test|0x01;
-	        }M-             iUR	qInfo.poiN@Index==0xA1)   /*Number+of LastTrack*/s-	 	{ DvskInfo.last T= qInfo. vskTime.min;s-	   	  DvskInfo.last T= azt_bcd2bin(DvskInfo.last);
-	   	  test=test|0x02;
-	 	}
-      	     iUR	qInfo.poiN@Index==0xA2)   /*DvskLength*/s-	 	{ DvskInfo.dvskLength.min T=qInfo. vskTime.min;s-	   	  DvskInfo.dvskLength.sec  =qInfo. vskTime.sec;M-	   	  DvskInfo.dvskLength.f ame=qInfo. vskTime.f ame;
-	  	  test=test|0x04;
-	 	}
-      	     iUR		qInfo.poiN@Index==DvskInfo.next)&&(test&0x01))   /*S  rtTime+of Next Track*/s-		{ DvskInfo.nextSurct *.min=qInfo. vskTime.min;s-	  	  DvskInfo.nextSurct *.sec=qInfo. vskTime.sec;M-	  	  DvskInfo.nextSurct *.f ame=qInfo. vskTime.f ame;
-	  	  test=test|0x08;
+		G_SM(limit = 300; limit > 0; limit--) {n+			iUR	++azt_Play.8  rt.f ame > 74) {n+				azt_Play.8  rt.f ame = 0;op				iUR	azt_Play.8  rt.sec > 59) {n+					azt_Play.8  rt.sec = 0;op					azt_Play.8  rt.min++;o+				}s+			}s+			iUR	aztS)ek(&azt_Play))n+				RETURNM("aztGetMultiDvskInfo 3", -1);
+			iUR	aztGetQChannelInfo(&qInfo) < 0)o+				RETURNM("aztGetMultiDvskInfo 4", -1);
+			iUR	qInfo.poiN@IndexT== 0xA0) {	zeNumber+of NextTrack */s+				DvskInfo.next = qInfo. vskTime.min;s+				DvskInfo.next = azt_bcd2bin(DvskInfo.next);s+				test = test | 0x01;
+			}s+			iUR	qInfo.poiN@IndexT== 0xA1) {	zeNumber+of LastTrack */s+				DvskInfo.last = qInfo. vskTime.min;s+				DvskInfo.last = azt_bcd2bin(DvskInfo.last);
+				test = test | 0x02;
+			}s+			iUR	qInfo.poiN@IndexT== 0xA2) {	zeDvskLength */s+				DvskInfo.dvskLength.min =n+				    qInfo. vskTime.min;s+				DvskInfo.dvskLength.sec =n+				    qInfo. vskTime.sec;M+				DvskInfo.dvskLength.f ame =n+				    qInfo. vskTime.f ame;
+				test = test | 0x04;
+			}s+			iUR		qInfo.poiN@IndexT== DvskInfo.next) &&R	test & 0x01)) {	zeS  rtTime+of Next Track */s+				DvskInfo.nextSurct *.min =n+				    qInfo. vskTime.min;s+				DvskInfo.nextSurct *.sec =n+				    qInfo. vskTime.sec;M+				DvskInfo.nextSurct *.f ame =n+				    qInfo. vskTime.f ame;
+				test = test | 0x08;
+			}s+			iUR	test == 0x0F)np		77bnuxk;
 		}
-      	     iUR	test==0x0F) bnuxk;
-   	   }M #iHzbH_AZT_DEBUG_MULTISESSIONs-       priN@k ("MultiDvsk Info:)firstT%d next %d last %d length %02x:%02x.%02x dez )firstT%02x:%02x.%02x dez )next %02x:%02x.%02x dez\n",n-     		DvskInfo.first,s-		DvskInfo.next,s-		DvskInfo.last,M-		DvskInfo.dvskLength.min,s-		DvskInfo.dvskLength.sec,M-		DvskInfo.dvskLength.f ame,M-		DvskInfo.firstTrack.min,s-		DvskInfo.firstTrack.sec,M-		DvskInfo.firstTrack.f ame,s-		DvskInfo.nextSurct *.min,s-		DvskInfo.nextSurct *.sec,M-		DvskInfo.nextSurct *.f ame);
-v)@ vNn-       iUR	test!=0x0F) M-           bnuxk;
-       else n-           DvskInfo.multi=1;   /*found TOC of m_Se than one surct **/M-       aztGetToc(1);
-     } wh
 
(--k);
+		priN@kn+		    ("MultiDvsk Info:)firstT%d next %d last %d length %02x:%02x.%02x dez )firstT%02x:%02x.%02x dez )next %02x:%02x.%02x dez\n",n+		     DvskInfo.first, DvskInfo.next, DvskInfo.last,M+		     DvskInfo.dvskLength.min, DvskInfo.dvskLength.sec,M+		     DvskInfo.dvskLength.f ame, DvskInfo.firstTrack.min,s+		     DvskInfo.firstTrack.sec, DvskInfo.firstTrack.f ame,s+		     DvskInfo.nextSurct *.min, DvskInfo.nextSurct *.sec,M+		     DvskInfo.nextSurct *.f ame);s+v)@ vN
+		iUR	test != 0x0F)np		7bnuxk;
+		)lseo+			DvskInfo.multi = 1;	/*found TOC of m_Se than one surct * */sp		aztGetToc(1);
+	} wh
 
 (--k);
 s vmfzbH_AZT_DEBUGs-  priN@k ("aztcd: exitiERcaztGetMultiDvskInfo  Time:%li\n",jiffies);
p	priN@k("aztcd: exitiERcaztGetMultiDvskInfo  Time:%li\n", jiffies);
 v)@ vNR-TCe unsi 0;R+	e unsi 0;
 }n #)@ vNR M@@
n1000,75 +1055,81 y s  * ReadC
ld)tab 
+of contents (TOC)n  +/M y  pF TiN@TaztGetToc(iN@Tmulti)
-{ int i, px;n-  int limit;
-       cCazt_Toc qInfo;M-s-vmfzbH_AZT_DEBUGs-  priN@k("aztcd: s  rtiERcaztGetToc  Time:%li\n",jiffies);
-v)@ vNn-  iUR	!multi)
-     { G_SM(i = 0; i < MAX_TRACKS; i++)
- 	    Toc[i].poiN@Index = 0;o-       i = DvskInfo.last + 3;n-     }M-  )lseo-     { G_SM(i = DvskInfo.next; i < MAX_TRACKS; i++)
-     	    Toc[i].poiN@Index = 0; o-       i = DvskInfo.last + 4 - DvskInfo.next;n-     }M+{o+	int i, px;n+	int limit;
+	     cCazt_Toc qInfo;M+s+#iHzbH_AZT_DEBUGsp	priN@k("aztcd: s  rtiERcaztGetToc  Time:%li\n", jiffies);
+v)@ vNR+	iUR	!multi) {n+		G_SM(i = 0; i < MAX_TRACKS; i++)
+			Toc[i].poiN@Index = 0;o+		i = DvskInfo.last + 3;n+	} )lse {n+		G_SM(i = DvskInfo.next; i < MAX_TRACKS; i++)
+			Toc[i].poiN@Index = 0;o+		i = DvskInfo.last + 4 - DvskInfo.next;n+	}
 o /*IsC
ldre a goodMe as * to stop mot_SMbeG_Se TOC read?
   iUR	aztS)ndCmd(ACMD_STOP)) RETURNM("aztGetToc 1",-1);
       STEN_LOW_WAIT;
 +/M n-  iUR	!multi)
-     { azt_mode = 0x05;o-       iUR	aztS)ndCmd(ACMD_SEEK_TO_LEADIN)) RETURNM("aztGetToc 2",-1);
-       STEN_LOW_WAIT;
-     }M-  G_SM(limit = 300; limit > 0; limit--)
-      { iUR	multi)
-           { iUR	++azt_Play.8  rt.sec > 59)s-                {Cazt_Play.8  rt.sec=0;o-                  azt_Play.8  rt.min++;o-                }M-             iUR	aztS)ek(&azt_Play)) RETURNM("aztGetToc 3",-1);
-           }M-	iUR	aztGetQChannelInfo(&qInfo) < 0)o-	    bnuxk;
-s-	px = azt_bcd2bin(qInfo.poiN@Index);
-R-	iUR	px > 0 &&Rpx < MAX_TRACKS &&RqInfo.track == 0)M-  	    iUR	Toc[px].poiN@IndexT== 0)
-	       { Toc[px] = qInfo;
-		 i--;n-	       }M-R-	iUR	i <= 0)
-	    bnuxk;
-      }
-
-  Toc[DvskInfo.last + 1]. vskTime = DvskInfo.dvskLength;
-  Toc[DvskInfo.last].trackTime    = DvskInfo.dvskLength;
-s-vmfzbH_AZT_DEBUG_MULTISESSION s-  priN@k("aztcd: exitiERcaztGetToc\n");n-  G_SM(i = 1; i <= DvskInfo.last+1; i++)
-       priN@k("i = %2d ctl-adr = %02X track %2d px %02X %02X:%02X.%02X dez )%02X:%02X.%02X dez\n",n-               i, Toc[i].ctrl_addr, Toc[i].track, Toc[i].poiN@Index,n-               Toc[i].trackTime.min, Toc[i].trackTime.sec, Toc[i].trackTime.f ame,s-               Toc[i]. vskTime.min, Toc[i]. vskTime.sec, Toc[i]. vskTime.f ame);n-  G_SM(i = 100; i < 103; i++)
-       priN@k("i = %2d ctl-adr = %02X track %2d px %02X %02X:%02X.%02X dez )%02X:%02X.%02X dez\n",n-               i, Toc[i].ctrl_addr, Toc[i].track, Toc[i].poiN@Index,n-               Toc[i].trackTime.min, Toc[i].trackTime.sec, Toc[i].trackTime.f ame,s-               Toc[i]. vskTime.min, Toc[i]. vskTime.sec, Toc[i]. vskTime.f ame);n+	iUR	!multi) {n+		azt_mode = 0x05;o+		iUR	aztS)ndCmd(ACMD_SEEK_TO_LEADIN))o+			RETURNM("aztGetToc 2", -1);
+		STEN_LOW_WAIT;
+	}op	G_SM(limit = 300; limit > 0; limit--) {n+		iUR	multi) {n+			iUR	++azt_Play.8  rt.sec > 59) {n+				azt_Play.8  rt.sec = 0;op				azt_Play.8  rt.min++;o+			}s+			iUR	aztS)ek(&azt_Play))n+				RETURNM("aztGetToc 3", -1);
+		}n+		iUR	aztGetQChannelInfo(&qInfo) < 0)o+			bnuxk;
+
+		px = azt_bcd2bin(qInfo.poiN@Index);
+n+		iUR	px > 0 &&Rpx < MAX_TRACKS &&RqInfo.track == 0)M+			iUR	Toc[px].poiN@IndexT== 0) {n+				Toc[px] = qInfo;
p				i--;n+			}M+o+		iUR	i <= 0)
p		7bnuxk;
+	}s+
+	Toc[DvskInfo.last + 1]. vskTime = DvskInfo.dvskLength;
+	Toc[DvskInfo.last].trackTime = DvskInfo.dvskLength;
+s+#iHzbH_AZT_DEBUG_MULTISESSIONsp	priN@k("aztcd: exitiERcaztGetToc\n");n+	G_SM(i = 1; i <= DvskInfo.last + 1; i++)
+		priN@kn+		    ("i = %2d ctl-adr = %02X track %2d px %02X %02X:%02X.%02X dez )%02X:%02X.%02X dez\n",n+		     i, Toc[i].ctrl_addr, Toc[i].track, Toc[i].poiN@Index,n+		     Toc[i].trackTime.min, Toc[i].trackTime.sec,n+		     Toc[i].trackTime.f ame, Toc[i]. vskTime.min,n+		     Toc[i]. vskTime.sec, Toc[i]. vskTime.f ame);n+	G_SM(i = 100; i < 103; i++)
+		priN@kn+		    ("i = %2d ctl-adr = %02X track %2d px %02X %02X:%02X.%02X dez )%02X:%02X.%02X dez\n",n+		     i, Toc[i].ctrl_addr, Toc[i].track, Toc[i].poiN@Index,n+		     Toc[i].trackTime.min, Toc[i].trackTime.sec,n+		     Toc[i].trackTime.f ame, Toc[i]. vskTime.min,n+		     Toc[i]. vskTime.sec, Toc[i]. vskTime.f ame);n #)@ vNR M-TCe unsi limit > 0 ? 0 : -1;n+	e unsi limit > 0 ? 0 : -1;n }n s s@@
n1080,163 +1141,186 y s #iHnzbH_MODULEM y  pF TiN@T__init aztcd_s unp(char *   )
l{ -    int ints[4];
-    
-    (ES <)get_optt *s(   , ARRAY_SIZE(iN@s), ints);
-    
-    iUR	ints[0] > 0)s-        azt_portT= ints[1];
-    iUR	ints[1] > 1)s-        azt_contT= ints[2];
-    e unsi 1;n+	int ints[4];
+
+	(ES <) get_optt *s(   , ARRAY_SIZE(iN@s), ints);
+
+	iUR	ints[0] > 0)s+		azt_portT= ints[1];
+	iUR	ints[1] > 1)s+		azt_contT= ints[2];
+	e unsi 1;n }n s __s unp("aztcd=", aztcd_s unp);
 s-v)@ vN /* !MODULE */spv)@ vN				/* !MODULE */s s /* s  * CheckiERcif 
ld)media hasMbeenGchangeds */M y  pF TiN@Tcheck_aztcd_media_change(kdev_t full_dev)
-{ iUR	aztDvskChanged)          /*  vsk changed */M-     { aztDvskChanged=0;o-       e unsi 1;n-     }M-  )lseo-       e unsi 0;               /* no change */s+{o+	iUR	aztDvskChanged) {	/*  vsk changed */M+		aztDvskChanged = 0;op		e unsi 1;
+	} )lseo+		e unsi 0;	/* no change */s }n s /*s  * Kernel IO-controls
 +/M-y  pF TiN@Taztcd_ioctl(     cCinode *ip,T     cCf
 
 *fp,Tu vNRE_FGit4 cmd,Tu vNRE_FGloERcarg)n-{       int i, st;
py  pF TiN@Taztcd_ioctl(     cCinode *ip,T     cCf
 
 *fp,Tu vNRE_FGit4 cmd,n+		       u vNRE_FGloERcarg)n+{o+	int i;
 	st   cCazt_Toc qInfo;M 	st   cCcd0xm_ti ti;M 	st   cCcd0xm_tochdr tocHdr;M 	st   cCcd0xm_msfCmsf;M 	st   cCcd0xm_tocentry entry;n-	     cCazt_Toc *tocPtr;            n+	     cCazt_Toc *tocPtr;M 	st   cCcd0xm_subchnl subchnl;
-        st   cCcd0xm_volctrl volctrl;
+	     cCcd0xm_volctrl volctrl;
 
 vmfzbH_AZT_DEBUGs-	priN@k("aztcd: 8  rtiERcaztcd_ioctl - Command:%x   Time: %li\n",cmd,Tjiffies);
-        priN@k("aztcd S  tusT%x\n", getAztS  tus());
-v)@ vNn-	iUR	!ip) RETURNM("aztcd_ioctl 1",-EINVAL);
-	iUR	getAztS  tus()<0) RETURNM("aztcd_ioctl 2", -EIO);
-	iUR	(!aztTocUpToD
te)||	aztDvskChanged))n-	{ iUR	(i=aztUpd p,Toc())<0) RETURNM("aztcd_ioctl 3", i); /* error reading TOC */M+	priN@k("aztcd: 8  rtiERcaztcd_ioctl - Command:%x   Time: %li\n",o+	       cmd,Tjiffies);
+	priN@k("aztcd S  tusT%x\n", getAztS  tus());
+v)@ vNR+	iUR	!ip)o+		RETURNM("aztcd_ioctl 1", -EINVAL);
+	iUR	getAztS  tus() < 0)o+		RETURNM("aztcd_ioctl 2", -EIO);
+	iUR	(!aztTocUpToD
te) || (aztDvskChanged)) {n+		iUR	(i = aztUpd p,Toc()) < 0)o+			RETURNM("aztcd_ioctl 3", i);	/* error reading TOC */M 	}n n-	 witch (cmd)n-	{n-	case CDROMSTART:     /* Spin upCthe) rive. Don't know, whacCto do,s-	                        acCleast closeC
ld)tray +/M-viH_AZT_PRIVATE_IOCTLS s-	        iUR	aztS)ndCmd(ACMD_CLOSE)) RETURNM("aztcd_ioctl 4",-1);
-	        STEN_LOW_WAIT;
+	 witch (cmd) {n+	case CDROMSTART:	/* Spin upCthe) rive. Don't know, whacCto do,s+				   acCleast closeC
ld)tray +/M+viH_AZT_PRIVATE_IOCTLSo+		iUR	aztS)ndCmd(ACMD_CLOSE))o+			RETURNM("aztcd_ioctl 4", -1);
+		STEN_LOW_WAIT;
 v)@ vNR 	7bnuxk;
-	case CDROMSTOP:      /* Spin downCthe) rive */s-		iUR	aztS)ndCmd(ACMD_STOP)) RETURNM("aztcd_ioctl 5",-1);
+	case CDROMSTOP:	/* Spin downCthe) rive */s+		iUR	aztS)ndCmd(ACMD_STOP))o+			RETURNM("aztcd_ioctl 5", -1);
 		STEN_LOW_WAIT;
 		/* should we do anythiERcif it fails? */M 		aztAudioS  tusT= CDROM_AUDIO_NO_STATUS;
 	7bnuxk;
-	case CDROMPAUSE:     /* Paus_C
ld) rive */s-                iUR	aztAudioS  tusT!= CDROM_AUDIO_PLAY) e unsi -EINVAL; o-s-		iUR	aztGetQChannelInfo(&qInfo) < 0)o-		{ /*  vdn't gecCq channelGitfo */s-		TCaztAudioS  tusT= CDROM_AUDIO_NO_STATUS;
-		  RETURNM("aztcd_ioctl 7",0);
+	case CDROMPAUSE:	/* Paus_C
ld) rive */s+		iUR	aztAudioS  tusT!= CDROM_AUDIO_PLAY)
+			e unsi -EINVAL;M+o+		iUR	aztGetQChannelInfo(&qInfo) < 0) {	/*  vdn't gecCq channelGitfo */s+			aztAudioS  tusT= CDROM_AUDIO_NO_STATUS;
+			RETURNM("aztcd_ioctl 7", 0);
 		}
-		azt_Play.8  rt = qInfo. vskTime;        /* remember+re8  rt poiN@ */sp		azt_Play.8  rt = qInfo. vskTime;	/* remember+re8  rt poiN@ */s s-		iUR	aztS)ndCmd(ACMD_PAUSE)) RETURNM("aztcd_ioctl 8",-1);
+		iUR	aztS)ndCmd(ACMD_PAUSE))
+			RETURNM("aztcd_ioctl 8", -1);
 		STEN_LOW_WAIT;
 		aztAudioS  tusT= CDROM_AUDIO_PAUSED;
 	7bnuxk;
-	case CDROMRESUME:    /* Play+it again, Sam */s-		iUR	aztAudioS  tusT!= CDROM_AUDIO_PAUSED) e unsi -EINVAL;
+	case CDROMRESUME:	/* Play+it again, Sam */s+		iUR	aztAudioS  tusT!= CDROM_AUDIO_PAUSED)
+			e unsi -EINVAL;M 		/* re8  rt 
ld) rive acCthe)sav_FGpositt *. */M 		i = aztPlay(&azt_Play);s-		iUR	i < 0)o-		{ aztAudioS  tusT= CDROM_AUDIO_ERROR;
-		  e unsi -EIO;n+		iUR	i < 0) {n+			aztAudioS  tusT= CDROM_AUDIO_ERROR;
+			e unsi -EIO;
 		}
 		aztAudioS  tusT= CDROM_AUDIO_PLAY;
 	7bnuxk;
-	case CDROMMULTISESSION: /*multisurct * support -- )xprrimental*/s-	 TC     { st   cCcd0xm_multisurct * ms;s-vmfzbH_AZT_DEBUGs-   		  priN@k("aztcd ioctl MULTISESSION\n");n+	case CDROMMULTISESSION:	/*multisurct * support -- )xprrimental */s+		{n+			st   cCcd0xm_multisurct * ms;s+#iHzbH_AZT_DEBUGsp			priN@k("aztcd ioctl MULTISESSION\n");n+v)@ vN
+			iUR	copy_H0xm_us_rn+			    (&ms, (ES < *)carg,n+			     sizeof(st   cCcd0xm_multisurct *)))n+				e unsi -EFAULT;
+			iUR	ms.addr_formatT== CDROM_MSF) {n+				ms.addr.msf.minute =n+				    azt_bcd2bin(DvskInfo.lastSurct *.min);
+				ms.addr.msf.second =n+				    azt_bcd2bin(DvskInfo.lastSurct *.sec);
+				ms.addr.msf.f ame =n+				    azt_bcd2bin(DvskInfo.lastSurct *.op						f ame);n+			} )lse iUR	ms.addr_formatT== CDROM_LBA)
+				ms.addr.lba =n+				    azt_msf2hsg(&DvskInfo.lastSurct *);n+			)lseo+				e unsi -EINVAL;M+			ms.xa_flag = DvskInfo.xa;
+			iUR	copy_to_us_rn+			    ((ES < *)carg, &ms,n+			     sizeof(st   cCcd0xm_multisurct *)))n+				e unsi -EFAULT;
+#iHzbH_AZT_DEBUGsp			iUR	ms.addr_formatT== CDROM_MSF)n+				priN@kn+				    ("aztcdMmultisurct * xa:%d,Tmsf:%02x:%02x.%02x [%02x:%02x.%02x])\n",n+				     ms.xa_flag,Tms.addr.msf.minute,n+				     ms.addr.msf.second,Tms.addr.msf.f ame,s+				     DvskInfo.lastSurct *.min,n+				     DvskInfo.lastSurct *.sec,n+				     DvskInfo.lastSurct *.f ame);n+			)lseo+				priN@kn+				    ("aztcdMmultisurct * %d,Tlba:0x%08x [%02x:%02x.%02x])\n",n+				     ms.xa_flag,Tms.addr.lba,s+				     DvskInfo.lastSurct *.min,n+				     DvskInfo.lastSurct *.sec,n+				     DvskInfo.lastSurct *.f ame);n v)@ vNR-		  st = vrrify_anux(VERIFY_WRITE, (ES <*)carg, sizeof(st   cCcd0xm_multisurct *));
-		  iUR	st) e unsi st;
-		  memcpy_H0xmfs(&ms, (ES <*)carg, sizeof(st   cCcd0xm_multisurct *));
-		  iUR	ms.addr_formatT== CDROM_MSF) 
-		     { ms.addr.msf.minute = azt_bcd2bin(DvskInfo.lastSurct *.min);
-		       ms.addr.msf.second = azt_bcd2bin(DvskInfo.lastSurct *.sec);
-		       ms.addr.msf.f ame  = azt_bcd2bin(DvskInfo.lastSurct *.f ame);n-		     } 
-		  )lse iUR	ms.addr_formatT== CDROM_LBA)
-		       ms.addr.lba = azt_msf2hsg(&DvskInfo.lastSurct *);n-		  )lse
-		       e unsi -EINVAL;M-		  ms.xa_flag = DvskInfo.xa;
-	  	  memcpy_tofs((ES <*)carg, &ms, sizeof(st   cCcd0xm_multisurct *));
-#iHzbH_AZT_DEBUG 
- 		  iUR	ms.addr_formatT== CDROM_MSF) 
-                      priN@k("aztcd multisurct * xa:%d,Tmsf:%02x:%02x.%02x [%02x:%02x.%02x])\n",n-			      ms.xa_flag,Tms.addr.msf.minute, ms.addr.msf.second,Tn-			      ms.addr.msf.f ame, DvskInfo.lastSurct *.min,n-			      DvskInfo.lastSurct *.sec, DvskInfo.lastSurct *.f ame);n-		  )lse
-		      priN@k("aztcd multisurct * %d,Tlba:0x%08x [%02x:%02x.%02x])\n",n-			      ms.xa_flag,Tms.addr.lba, DvskInfo.lastSurct *.min,n-			      DvskInfo.lastSurct *.sec, DvskInfo.lastSurct *.f ame);n-v)@ vNn-   		  e unsi 0;o-		}
-	case CDROMPLAYTRKIND:     /* Play+a track.  TliR currently+ignore8Gitdex. */s-		st = vrrify_anux(VERIFY_READ, (ES < *)carg, sizeof ti);s-		iUR	st) e unsi st;
-		memcpy_H0xmfs(&ti, (ES < *)carg, sizeof ti);s+			e unsi 0;
+		}n+	case CDROMPLAYTRKIND:	/* Play+a track.  TliR currently+ignore8Gitdex. */s+		iUR	copy_H0xm_us_r(&ti, (ES < *)carg, sizeof ti))
+			e unsi -EFAULT;
 		iUR	ti.cdti_trk0 < DvskInfo.firstn-			|| ti.cdti_trk0 > DvskInfo.lastn-			|| ti.cdti_trk1 < ti.cdti_trk0)o-		{ e unsi -EINVAL;M+		    || ti.cdti_trk0 > DvskInfo.lastn+		    || ti.cdti_trk1 < ti.cdti_trk0) {n+			e unsi -EINVAL;M 		}
 		iUR	ti.cdti_trk1 > DvskInfo.last)
-		    ti.cdti_trk1 = DvskInfo.last;
+			ti.cdti_trk1 = DvskInfo.last;
 		azt_Play.8  rt = Toc[ti.cdti_trk0]. vskTime;
 		azt_Play.end = Toc[ti.cdti_trk1 + 1]. vskTime;
 vmfzbH_AZT_DEBUGs-priN@k("aztcd play: %02x:%02x.%02x to %02x:%02x.%02x\n",n-	azt_Play.8  rt.min,Cazt_Play.8  rt.sec,Cazt_Play.8  rt.f ame,n-	azt_Play.end.min, azt_Play.end.sec, azt_Play.end.f ame);
+		priN@k("aztcd play: %02x:%02x.%02x to %02x:%02x.%02x\n",n+		       azt_Play.8  rt.min,Cazt_Play.8  rt.sec,n+		       azt_Play.8  rt.f ame, azt_Play.end.min,n+		       azt_Play.end.sec, azt_Play.end.f ame);
 v)@ vNR 	7i = aztPlay(&azt_Play);s-		iUR	i < 0)o-		{ aztAudioS  tusT= CDROM_AUDIO_ERROR;
-		  e unsi -EIO;n+		iUR	i < 0) {n+			aztAudioS  tusT= CDROM_AUDIO_ERROR;
+			e unsi -EIO;
 		}
 		aztAudioS  tusT= CDROM_AUDIO_PLAY;
 	7bnuxk;
-	case CDROMPLAYMSF:   /* Play+8  rtiERcacCthe)given MSF addrurc. */s+	case CDROMPLAYMSF:	/* Play+8  rtiERcacCthe)given MSF addrurc. */s /*              iUR	aztAudioS  tusT== CDROM_AUDIO_PLAY) 
 	7{ iUR	aztS)ndCmd(ACMD_STOP)) RETURNM("aztcd_ioctl 9",-1);
 		  STEN_LOW;
 		TCaztAudioS  tusT= CDROM_AUDIO_NO_STATUS;
 		}
 */s-		st = vrrify_anux(VERIFY_READ, (ES < *)carg, sizeof msf);s-		iUR	st) e unsi st;
-		memcpy_H0xmfs(&msf, (ES < *)carg, sizeof msf);s+		iUR	copy_H0xm_us_r(&msf, (ES < *)carg, sizeof msf))
+			e unsi -EFAULT;
 		/* convrrcCto bcd */M 		azt_bin2bcd(&msf.cdmsf_min0);
 		azt_bin2bcd(&msf.cdmsf_sec0);
@@
n1251,171 +1335,190Ry s 		azt_Play.end.sec = msf.cdmsf_sec1;
 		azt_Play.end.f ame = msf.cdmsf_f ame1;
 vmfzbH_AZT_DEBUGs-priN@k("aztcd play: %02x:%02x.%02x to %02x:%02x.%02x\n",n-azt_Play.8  rt.min,Cazt_Play.8  rt.sec,Cazt_Play.8  rt.f ame,n-azt_Play.end.min, azt_Play.end.sec, azt_Play.end.f ame);
+		priN@k("aztcd play: %02x:%02x.%02x to %02x:%02x.%02x\n",n+		       azt_Play.8  rt.min,Cazt_Play.8  rt.sec,n+		       azt_Play.8  rt.f ame, azt_Play.end.min,n+		       azt_Play.end.sec, azt_Play.end.f ame);
 v)@ vNR 	7i = aztPlay(&azt_Play);s-		iUR	i < 0)o-		{ aztAudioS  tusT= CDROM_AUDIO_ERROR;
-		  e unsi -EIO;n+		iUR	i < 0) {n+			aztAudioS  tusT= CDROM_AUDIO_ERROR;
+			e unsi -EIO;
 		}
 		aztAudioS  tusT= CDROM_AUDIO_PLAY;
 	7bnuxk;
 
-	case CDROMREADTOCHDR:        /* ReadC
ld)tab 
+of contents header */s-		st = vrrify_anux(VERIFY_WRITE, (ES < *)carg, sizeof tocHdr);s-		iUR	st) e unsi st;
+	case CDROMREADTOCHDR:	/* ReadC
ld)tab 
+of contents header */s 	7tocHdr.cdth_trk0 = DvskInfo.first;s 	7tocHdr.cdth_trk1 = DvskInfo.last;
-		memcpy_tofs((ES < *)carg, &tocHdr, sizeof tocHdr);s+		iUR	copy_to_us_r((ES < *)carg, &tocHdr, sizeof tocHdr))
+			e unsi -EFAULT;
 		bnuxk;
-	case CDROMREADTOCENTRY:      /* ReadCan entry inC
ld)tab 
+of contents */s-		st = vrrify_anux(VERIFY_WRITE, (ES < *)carg, sizeof entry);s-		iUR	st) e unsi st;
-		memcpy_H0xmfs(&entry, (ES < *)carg, sizeof entry);s-		iUR	(!aztTocUpToD
te)||aztDvskChanged) aztUpd p,Toc();
+	case CDROMREADTOCENTRY:	/* ReadCan entry inC
ld)tab 
+of contents */s+		iUR	copy_H0xm_us_r(&entry, (ES < *)carg, sizeof entry))
+			e unsi -EFAULT;
+		iUR	(!aztTocUpToD
te) || aztDvskChanged)n+			aztUpd p,Toc();
 		iUR	entry.cdte_track == CDROM_LEADOUT)
-		  tocPtr = &Toc[DvskInfo.last + 1];
+			tocPtr = &Toc[DvskInfo.last + 1];
 		)lse iUR	entry.cdte_track > DvskInfo.lastn-				|| entry.cdte_track < DvskInfo.first)o-		{ e unsi -EINVAL;M-		}
-		else n-		  tocPtr = &Toc[entry.cdte_track];M-		entry.cdte_adr = tocPtr -> ctrl_addr;M-		entry.cdte_ctrl = tocPtr -> ctrl_addr >> 4;
+			 || entry.cdte_track < DvskInfo.first) {n+			e unsi -EINVAL;M+		} )lseo+			tocPtr = &Toc[entry.cdte_track];M+		entry.cdte_adr = tocPtr->ctrl_addr;M+		entry.cdte_ctrl = tocPtr->ctrl_addr >> 4;
 		iUR	entry.cdte_formatT== CDROM_LBA)
-		  entry.cdte_addr.lba = azt_msf2hsg(&tocPtr ->  vskTime);s-		)lse iUR	entry.cdte_formatT== CDROM_MSF)n-		{ entry.cdte_addr.msf.minute = azt_bcd2bin(tocPtr ->  vskTime.min);
-		  entry.cdte_addr.msf.second = azt_bcd2bin(tocPtr ->  vskTime.sec);
-		  entry.cdte_addr.msf.f ame  = azt_bcd2bin(tocPtr ->  vskTime.f ame);n+			)ntry.cdte_addr.lba =n+			    azt_msf2hsg(&tocPtr-> vskTime);
+		)lse iUR	entry.cdte_formatT== CDROM_MSF) {n+			entry.cdte_addr.msf.minute =n+			    azt_bcd2bin(tocPtr-> vskTime.min);n+			entry.cdte_addr.msf.second =n+			    azt_bcd2bin(tocPtr-> vskTime.sec);
+			entry.cdte_addr.msf.f ame =n+			    azt_bcd2bin(tocPtr-> vskTime.f ame);n+		} )lse {n+			e unsi -EINVAL;M 		}
-		)lseo-		{ e unsi -EINVAL;M-		}
-		memcpy_tofs((ES < *)carg, &entry, sizeof entry);s+		iUR	copy_to_us_r((ES < *)carg, &entry, sizeof entry))
+			e unsi -EFAULT;
 		bnuxk;
-	case CDROMSUBCHNL:   /* GecCsubchannelGitfo */s-		st = vrrify_anux(VERIFY_WRITE, (ES < *)carg, sizeof(st   cCcd0xm_subchnl));s-		iUR	st) { s-vmfzbH_AZT_DEBUGs-		          priN@k("aztcd: exitiERcaztcd_ioctl - Error 1 - Command:%x\n",cmd);
-v)@ vNn-		          e unsi st;
-		        }  
-		memcpy_H0xmfs(&subchnl, (ES < *)carg, sizeof (st   cCcd0xm_subchnl));s-		iUR	aztGetQChannelInfo(&qInfo) < 0)o-		iUR	st) { s-vmfzbH_AZT_DEBUGs-		          priN@k("aztcd: exitiERcaztcd_ioctl - Error 3 - Command:%x\n",cmd);
+	case CDROMSUBCHNL:	/* GecCsubchannelGitfo */s+		iUR	copy_H0xm_us_rn+		    (&subchnl, (ES < *)carg, sizeof(st   cCcd0xm_subchnl)))
+			e unsi -EFAULT;
+		iUR	aztGetQChannelInfo(&qInfo) < 0) {s+#iHzbH_AZT_DEBUGsp			priN@kn+			    ("aztcd: exitiERcaztcd_ioctl - Error 3 - Command:%x\n",n+			     cmd);
 v)@ vNR-     		  	  e unsi -EIO;
-     		  	}  n+			e unsi -EIO;
+		}
 		subchnl.cdsc_audios  tusT= aztAudioS  tus;
 		subchnl.cdsc_adr = qInfo.ctrl_addr;M 		subchnl.cdsc_ctrl = qInfo.ctrl_addr >> 4;
 		subchnl.cdsc_trk = azt_bcd2bin(qInfo.track);
 		subchnl.cdsc_ind = azt_bcd2bin(qInfo.poiN@Index);
-		iUR	subchnl.cdsc_formatT== CDROM_LBA)
-		{ subchnl.cdsc_absaddr.lba = azt_msf2hsg(&qInfo. vskTime);
-		  subchnl.cdsc_reladdr.lba = azt_msf2hsg(&qInfo.trackTime);M-		}
-		else  /*zbHault*/s-		{ subchnl.cdsc_formatT= CDROM_MSF;
-		  subchnl.cdsc_absaddr.msf.minute = azt_bcd2bin(qInfo. vskTime.min);
-		  subchnl.cdsc_absaddr.msf.second = azt_bcd2bin(qInfo. vskTime.sec);
-		  subchnl.cdsc_absaddr.msf.f ame  = azt_bcd2bin(qInfo. vskTime.f ame);
-		  subchnl.cdsc_reladdr.msf.minute = azt_bcd2bin(qInfo.trackTime.min);
-		  subchnl.cdsc_reladdr.msf.second = azt_bcd2bin(qInfo.trackTime.sec);
-		  subchnl.cdsc_reladdr.msf.f ame  = azt_bcd2bin(qInfo.trackTime.f ame);s+		iUR	subchnl.cdsc_formatT== CDROM_LBA) {n+			subchnl.cdsc_absaddr.lba =n+			    azt_msf2hsg(&qInfo. vskTime);
+			subchnl.cdsc_reladdr.lba =n+			    azt_msf2hsg(&qInfo.trackTime);M+		} )lse {	/*zbHault */s+			subchnl.cdsc_formatT= CDROM_MSF;
+			subchnl.cdsc_absaddr.msf.minute =n+			    azt_bcd2bin(qInfo. vskTime.min);
+			subchnl.cdsc_absaddr.msf.second =n+			    azt_bcd2bin(qInfo. vskTime.sec);
+			subchnl.cdsc_absaddr.msf.f ame =n+			    azt_bcd2bin(qInfo. vskTime.f ame);
+			subchnl.cdsc_reladdr.msf.minute =n+			    azt_bcd2bin(qInfo.trackTime.min);
+			subchnl.cdsc_reladdr.msf.second =n+			    azt_bcd2bin(qInfo.trackTime.sec);
+			subchnl.cdsc_reladdr.msf.f ame =n+			    azt_bcd2bin(qInfo.trackTime.f ame);s 		}
-		memcpy_tofs((ES < *)carg, &subchnl, sizeof (st   cCcd0xm_subchnl));s+		iUR	copy_to_us_rn+		    ((ES < *)carg, &subchnl, sizeof(st   cCcd0xm_subchnl)))
+			e unsi -EFAULT;
 		bnuxk;
-	case CDROMVOLCTRL:   /* Volume control s-	 * With my AztechCCD268-01A volume control doesRnot work, I ca* onlys-	 TCunsi 
ld)channels onR	any value !=0) or+ofUR	value==0). Maybe it
-           works better with your) rive */s-                st=vrrify_anux(VERIFY_READ,(ES < *)carg, sizeof(volctrl));s-                iUR	st) e unsi (st);
-                memcpy_H0xmfs(&volctrl,(char *)carg,sizeof(volctrl));s+	case CDROMVOLCTRL:	/* Volume control s+				   * With my AztechCCD268-01A volume control doesRnot work, I ca* onlys+				   unsi 
ld)channels onR	any value !=0) or+ofUR	value==0). Maybe it
+				   works better with your) rive */s+		iUR	copy_H0xm_us_rn+		    (&volctrl, (char *)carg, sizeof(volctrl)))
+			e unsi -EFAULT;
 		azt_Play.8  rt.min = 0x21;
 		azt_Play.8  rt.sec = 0x84;
 		azt_Play.8  rt.f ame = volctrl.channel0;o-		azt_Play.end.min =     volctrl.channel1;o-		azt_Play.end.sec =     volctrl.channel2;o-		azt_Play.end.f ame =   volctrl.channel3;
-                sendAztCmd(ACMD_SET_VOLUME, &azt_Play);s-                STEN_LOW_WAIT;
-                bnuxk;
+		azt_Play.end.min = volctrl.channel1;o+		azt_Play.end.sec = volctrl.channel2;o+		azt_Play.end.f ame = volctrl.channel3;
+		sendAztCmd(ACMD_SET_VOLUME, &azt_Play);s+		STEN_LOW_WAIT;
+	7bnuxk;
 	case CDROMEJECT:
-                aztUnlockDoor(); /* Assume us_r knows whacCthey're doiERc*/s-	 TC    /* all) rives ca* acCleast stop! */s-		iUR	aztAudioS  tusT== CDROM_AUDIO_PLAY) 
-	7{ iUR	aztS)ndCmd(ACMD_STOP)) RETURNM("azt_ioctl 10",-1);
-		  STEN_LOW_WAIT;
+		aztUnlockDoor();	/* Assume us_r knows whacCthey're doiERc*/s+		/* all) rives ca* acCleast stop! */s+		iUR	aztAudioS  tusT== CDROM_AUDIO_PLAY) {s+			iUR	aztS)ndCmd(ACMD_STOP))o+				RETURNM("azt_ioctl 10", -1);
+			STEN_LOW_WAIT;
 		}s-		iUR	aztS)ndCmd(ACMD_EJECT)) RETURNM("azt_ioctl 11",-1);
+		iUR	aztS)ndCmd(ACMD_EJECT))
+			RETURNM("azt_ioctl 11", -1);
 		STEN_LOW_WAIT;
 		aztAudioS  tusT= CDROM_AUDIO_NO_STATUS;
 	7bnuxk;
 	case CDROMEJECT_SW:
 		azt_auto_ejectT= (char)carg;
-		bnuxk;	
-        case CDROMRESET:
-        	outb(ACMD_SOFT_RESET,CMD_PORT);   /*send re8et*/s-	 TC     STEN_LOW;
-	        iUR	inb(DATA_PORT)!=AFL_OP_OK)    /*OP_OK?*/s-	 TC       { priN@k("aztcd: AZTECH CD-ROM) rive doesRnot re8pond\n");n-                  }M-                bnuxk;
+		bnuxk;
+	case CDROMRESET:
+		outb(ACMD_SOFT_RESET, CMD_PORT);	/*send re8et */s+		STEN_LOW;
+		iUR	inb(DATA_PORT)T!= AFL_OP_OK) {	/*OP_OK? */s+			priN@kn+			    ("aztcd: AZTECH CD-ROM) rive doesRnot re8pond\n");n+		}n+		bnuxk;
 /*Takd)canu, 
ld)followiERccode isRnot compatib 
+with o
ldr CD-ROM) rivers,
   us_Cit at your)ownCrvsk with cdplay.c. Set AZT_PRIVATE_IOCTLS to 0 inCaztcd.h,
   iURyou do not wancCto us_Cit!
-*/                  M-viH_AZT_PRIVATE_IOCTLS s-	case CDROMREADCOOKED: /*read data inCmode 1 (2048 Bytes)*/s-	case CDROMREADRAW:    /*read data inCmode 2 (2336 Bytes)*/s-		{ st = vrrify_anux(VERIFY_WRITE, (ES < *)carg, sizeof buf);
-		  iUR	st) e unsi st;
-		  memcpy_H0xmfs(&msf, (ES < *)carg, sizeof msf);s-		  /* convrrcCto bcd */M-		TCazt_bin2bcd(&msf.cdmsf_min0);
-		TCazt_bin2bcd(&msf.cdmsf_sec0);
-		TCazt_bin2bcd(&msf.cdmsf_f ame0);
-		TCmsf.cdmsf_min1=0;
-		TCmsf.cdmsf_sec1=0;
-		TCmsf.cdmsf_f ame1=1; /*read only one f ame*/M-		TCazt_Play.8  rt.min = msf.cdmsf_min0;M-		TCazt_Play.8  rt.sec = msf.cdmsf_sec0;M-		TCazt_Play.8  rt.f ame = msf.cdmsf_f ame0;M-		TCazt_Play.end.min = msf.cdmsf_min1;M-		TCazt_Play.end.sec = msf.cdmsf_sec1;
-		TCazt_Play.end.f ame = msf.cdmsf_f ame1;
-		  iUR	cmd==CDROMREADRAW)
-		  { iUR	DvskInfo.xa)
-		       { e unsi -1;         /*XA Dvsks ca*'t be read raw*/M-		TC     }M-		    else   
-		       { iUR	sendAztCmd(ACMD_PLAY_READ_RAW, &azt_Play)) e unsi -1;s-		         DTEN_LOW;
-		         insb(DATA_PORT,buf,CD_FRAMESIZE_RAW);
-		         memcpy_tofs((ES < *)carg, &buf, CD_FRAMESIZE_RAW);
-		       }  
-		  }
-		  )lse /*CDROMREADCOOKED*/M-		TC{ iUR	sendAztCmd(ACMD_PLAY_READ, &azt_Play)) e unsi -1;s-		    DTEN_LOW;
-		    insb(DATA_PORT,buf,CD_FRAMESIZE);
-		    memcpy_tofs((ES < *)carg, &buf, CD_FRAMESIZE);
-		  }
-		 } M-                bnuxk;
-	case CDROMSEEK:    /*s)ek msfCaddrurc*/s-		st = vrrify_anux(VERIFY_READ,  (ES < *)carg, sizeof msf);s-		iUR	st) e unsi st;
-		memcpy_H0xmfs(&msf, (ES < *)carg, sizeof msf);s++/M+viH_AZT_PRIVATE_IOCTLSo+	case CDROMREADCOOKED:	/*read data inCmode 1 (2048 Bytes) */s+	case CDROMREADRAW:	/*read data inCmode 2 (2336 Bytes) */s+		{n+			iUR	copy_H0xm_us_r(&msf, (ES < *)carg, sizeof msf))
+				e unsi -EFAULT;
+			/* convrrcCto bcd */M+			azt_bin2bcd(&msf.cdmsf_min0);
+			azt_bin2bcd(&msf.cdmsf_sec0);
+			azt_bin2bcd(&msf.cdmsf_f ame0);
+			msf.cdmsf_min1 = 0;op			msf.cdmsf_sec1 = 0;op			msf.cdmsf_f ame1 = 1;	/*read only one f ame */M+			azt_Play.8  rt.min = msf.cdmsf_min0;M+			azt_Play.8  rt.sec = msf.cdmsf_sec0;M+			azt_Play.8  rt.f ame = msf.cdmsf_f ame0;M+			azt_Play.end.min = msf.cdmsf_min1;M+			azt_Play.end.sec = msf.cdmsf_sec1;
+			azt_Play.end.f ame = msf.cdmsf_f ame1;
+			iUR	cmdT== CDROMREADRAW) {n+				iUR	DvskInfo.xa) {n+					e unsi -1;	/*XA Dvsks ca*'t be read raw */s+				} )lse {n+					iUR	sendAztCmdn+					    (ACMD_PLAY_READ_RAW,n+					     &azt_Play))n+						e unsi -1;n+					DTEN_LOW;
+					insb(DATA_PORT, buf,n+					     CD_FRAMESIZE_RAW);
+					iUR	copy_to_us_rn+					    ((ES < *)carg, &buf,n+					     CD_FRAMESIZE_RAW))n+						e unsi -EFAULT;
+				}s+			} )lseo+				/*CDROMREADCOOKED*/ {n+				iUR	sendAztCmd(ACMD_PLAY_READ, &azt_Play))n+					e unsi -1;M+				DTEN_LOW;
+				insb(DATA_PORT, buf, CD_FRAMESIZE);
+				iUR	copy_to_us_rn+				    ((ES < *)carg, &buf, CD_FRAMESIZE))n+					e unsi -EFAULT;
+				}s+		}
+		bnuxk;
+	case CDROMSEEK:	/*s)ek msfCaddrurc */s+		iUR	copy_H0xm_us_r(&msf, (ES < *)carg, sizeof msf))
+			e unsi -EFAULT;
 		/* convrrcCto bcd */M 		azt_bin2bcd(&msf.cdmsf_min0);
 		azt_bin2bcd(&msf.cdmsf_sec0);
@@
n1423,18 +1526,20Ry s 		azt_Play.8  rt.min = msf.cdmsf_min0;M 		azt_Play.8  rt.sec = msf.cdmsf_sec0;M 		azt_Play.8  rt.f ame = msf.cdmsf_f ame0;M-		iUR	aztS)ek(&azt_Play)) e unsi -1;s-TC              bnuxk;
-v)@ vN /*)ndcof incompatib 
+code*/       s-	case CDROMREADMODE1: /*s)t read data inCmode 1*/s-                e unsi aztS)tDvskType(AZT_MODE_1);
-	case CDROMREADMODE2: /*s)t read data inCmode 2*/s-                e unsi aztS)tDvskType(AZT_MODE_2);	    n+		iUR	aztS)ek(&azt_Play))n+			e unsi -1;M+		bnuxk;
+v)@ vN				/*)ndcof incompatib 
+code */s+	case CDROMREADMODE1:	/*s)t read data inCmode 1 */s+		e unsi aztS)tDvskType(AZT_MODE_1);
+	case CDROMREADMODE2:	/*s)t read data inCmode 2 */s+		e unsi aztS)tDvskType(AZT_MODE_2);
 	zbHault:
 		e unsi -EINVAL;M 	}s vmfzbH_AZT_DEBUGs-        priN@k("aztcd: exitiERcaztcd_ioctl Command:%x  Time:%li\n",cmd,jiffies);
p	priN@k("aztcd: exitiERcaztcd_ioctl Command:%x  Time:%li\n", cmd,n+	       jiffies);
 v)@ vNR 	e unsi 0;
 }n@@
n1444,131 +1549,139 y s  * When Linux gecs variab 
+block sizesC
lis will probab y go away.n  +/M y  pF TES < azt_transf_r(ES <)n-{ n+{o vmfzbH_AZT_TESTs-  priN@k("aztcd: executiERcazt_transf_r Time:%li\n",jiffies);
p	priN@k("aztcd: executiERcazt_transf_r Time:%li\n", jiffies);
 v)@ vNR-TCiUR	CURRENT_VALID)l{ -    wh
 
 (CURRENT -> nr_sectors)l{ -      int bn = CURRENT -> sector / 4;
-      int i;
-      G_SM(i = 0; i < AZT_BUF_SIZ &&Razt_buf_bn[i]T!= bn; ++i)
-	;
-      iUR	i < AZT_BUF_SIZ)l{ -	int offsT= 	i * 4 + (CURRENT -> sector & 3)) * 512;o-	int nr_sectorsT= 4 - (CURRENT -> sector & 3);M-	iUR	azt_buf_out != i)l{ -	  azt_buf_out = i;
-	  iUR	azt_buf_bn[i]T!= bn)l{ -	    azt_buf_out = -1;
-	    continue;
-	  }
-	}M-	iUR	nr_sectorsT> CURRENT -> nr_sectors)
-	  nr_sectorsT= CURRENT -> nr_sectors;
-	memcpy(CURRENT -> buff_r, azt_buf + offs, nr_sectorsT* 512);M-	CURRENT -> nr_sectors -= nr_sectors;
-	CURRENT -> sector += nr_sectors;
-	CURRENT -> buff_r += nr_sectors * 512;o-      } )lse {n-	azt_buf_out = -1;
-	bnuxk;
-      }
-    }
-  }
+	iUR	CURRENT_VALID)l{ +		wh
 
 (CURRENT->nr_sectors)l{ +			int bn = CURRENT->sector / 4;
+			int i;
+			G_SM(i = 0; i < AZT_BUF_SIZ &&Razt_buf_bn[i]T!= bn;n+			     ++i);
+			iUR	i < AZT_BUF_SIZ)l{ +				int offsT=n+				    (i * 4 + (CURRENT->sector & 3)) * 512;o+				int nr_sectorsT= 4 - (CURRENT->sector & 3);op				iUR	azt_buf_out != i)l{ p					azt_buf_out = i;
+					iUR	azt_buf_bn[i]T!= bn)l{ +						azt_buf_out = -1;
+						continue;
+					}
+				}s+				iUR	nr_sectorsT> CURRENT->nr_sectors)
+					nr_sectorsT= CURRENT->nr_sectors;
+				memcpy(CURRENT->buff_r, azt_buf + offs,n+				       nr_sectorsT* 512);M+				CURRENT->nr_sectors -= nr_sectors;
+				CURRENT->sector += nr_sectors;
+				CURRENT->buff_r += nr_sectors * 512;o+			} )lse {n+				azt_buf_out = -1;
+				bnuxk;
+			}s+		}
+	}s }n s y  pF TES < do_aztcd_request(request_queue_t * q)
l{  vmfzbH_AZT_TESTs-  priN@k(" do_aztcd_request(%ld+%ld) Time:%li\n", CURRENT -> sector, CURRENT -> nr_sectors,jiffies);
p	priN@k(" do_aztcd_request(%ld+%ld) Time:%li\n", CURRENT->sector,n+	       CURRENT->nr_sectors, jiffies);
 v)@ vNR-TCiUR	DvskInfo.audio) 
-    { priN@k("aztcd: Error, triedCto mouN@Tan Audio CD\n");n-      )@ _request(0);n-      e unsi;
-    }
-  azt_transf_r_is_active = 1;n-  wh
 
 (CURRENT_VALID)l{ -    iUR	CURRENT->bh)l{ -      iUR	!buff_r_locked	CURRENT->bh))
-	panic(DEVICE_NAME ":+block not locked");n-    }
-    azt_transf_r(); -    iUR	CURRENT -> nr_sectors == 0) {n-      )@ _request(1);
-    } )lse {n-      azt_buf_out = -1;         /* WancCto read a+block not inCbuff_r */s-      iUR	azt_y  pe == AZT_S_IDLE)l{ -	iUR	(!aztTocUpToD
te)||aztDvskChanged) {
-	  iUR	aztUpd p,Toc() < 0) {s-	    wh
 
 (CURRENT_VALID)s-	 TC   )@ _request(0);n-	    bnuxk;
-	  }
-	}M-	azt_y  pe = AZT_S_START;
-	AztTriesT= 5;o-	SET_TIMER(azt_poll, HZ/100);n-      }M-      bnuxk;
-    }
-  }
-  azt_transf_r_is_active = 0;
+	iUR	DvskInfo.audio) {
+		priN@k("aztcd: Error, triedCto mouN@Tan Audio CD\n");n+		en _request(0);n+		e unsi;
+	}op	azt_transf_r_is_active = 1;n+	wh
 
 (CURRENT_VALID)l{ +		iUR	CURRENT->bh)l{ +			iUR	!buff_r_locked	CURRENT->bh))
+				panic(DEVICE_NAME ":+block not locked");n+		}
+		azt_transf_r(); +		iUR	CURRENT->nr_sectors == 0) {n+			en _request(1);
+		} )lse {n+			azt_buf_out = -1;	/* WancCto read a+block not inCbuff_r */s+			iUR	azt_y  pe == AZT_S_IDLE)l{ +				iUR	(!aztTocUpToD
te) || aztDvskChanged) {n+					iUR	aztUpd p,Toc() < 0) {s+						wh
 
 (CURRENT_VALID)s+							en _request(0);n+						bnuxk;
+					}
+				}s+				azt_y  pe = AZT_S_START;
+				AztTriesT= 5;o+				SET_TIMER(azt_poll, HZ / 100);n+			}s+			bnuxk;
+		}
+	}op	azt_transf_r_is_active = 0;  vmfzbH_AZT_TEST2s-  priN@k("azt_next_bn:%x  azt_buf_in:%x azt_buf_out:%x  azt_buf_bn:%x\n", \ -	  azt_next_bn, azt_buf_in, azt_buf_out,Razt_buf_bn[azt_buf_in]);n-  priN@k(" do_aztcd_request )@ s  Time:%li\n",jiffies);
p	priN@kn+	    ("azt_next_bn:%x  azt_buf_in:%x azt_buf_out:%x  azt_buf_bn:%x\n",n+	     azt_next_bn, azt_buf_in, azt_buf_out,Razt_buf_bn[azt_buf_in]);np	priN@k(" do_aztcd_request )@ s  Time:%li\n", jiffies);
 v)@ vNR }n s s y  pF TES < azt_invalid p,_buff_rs(ES <)n-{ int i;
+{o+	int i;
 s vmfzbH_AZT_DEBUGs-  priN@k("aztcd: executiERcazt_invalid p,_buff_rs\n");n+	priN@k("aztcd: executiERcazt_invalid p,_buff_rs\n");n v)@ vNR-TCG_SM(i = 0; i < AZT_BUF_SIZ; ++i)
-    azt_buf_bn[i]T= -1;s-TCazt_buf_out = -1;
+	G_SM(i = 0; i < AZT_BUF_SIZ; ++i)
+		azt_buf_bn[i]T= -1;s+	azt_buf_out = -1;
 }n s /*s  * OpenCthe) evice specialCf
 
.  Check tha@Ta  vsk i8Git.n  +/M iN@Taztcd_open(     cCinode *ip,T     cCf
 
 *fp)n-{       int st;
+{o+	int st;s s vmfzbH_AZT_DEBUGs 	priN@k("aztcd: 8  rtiERcaztcd_open\n");n v)@ vNR 
 	iUR	aztPre8entT== 0)
-		e unsi -ENXIO;                  /* no hardware */s+		e unsi -ENXIO;	/* no hardware */s M-        MOD_INC_USE_COUNT;
+	MOD_INC_USE_COUNT;
+R+	iUR	!azt_open_couN@T&&Razt_y  pe == AZT_S_IDLE)l{ +		azt_invalid p,_buff_rs();
 s-	iUR	!azt_open_couN@T&&Razt_y  pe == AZT_S_IDLE)l -	  { azt_invalid p,_buff_rs();
+		st = getAztS  tus();	/* check) rive s  tusT*/s+		iUR	stT== -1)s+			goto err_out;	/*  rive does*'t re8pondT*/s+s+		iUR	stT& AST_DOOR_OPEN) {	/* closeCdoor, then gecCthe)s  tusTagain. */s+			priN@k("aztcd: Door Open?\n");n+			aztCloseDoor();n+			st = getAztS  tus();
+		}
+
+		iUR	(stT& AST_NOT_READY) || (stT& AST_DSK_CHG)) {	/*no  vsk in  rive or changed */M+			priN@kn+			    ("aztcd: Dvsk Changed or No Dvsk in Drive?\n");n+			aztTocUpToD
te = 0;op		}n+		iUR	aztUpd p,Toc())s+			goto err_out;
 s-	    st = getAztS  tus();                    /* check) rive s  tusT*/s-	    iUR	stT== -1) goto err_out;              /*  rive does*'t re8pondT*/s-s-            iUR	stT& AST_DOOR_OPEN)s-               { /* closeCdoor, then gecCthe)s  tusTagain. */s-	 TC      priN@k("aztcd: Door Open?\n");n-                 aztCloseDoor();     
-                 st = getAztS  tus();
-               }        M-s-	    iUR	(stT& AST_NOT_READY) || (stT& AST_DSK_CHG)) /*no  vsk in  rive or changed*/s-	 TC    { priN@k("aztcd: Dvsk Changed or No Dvsk in Drive?\n");n-                 aztTocUpToD
te=0;o-               }s-            iUR	aztUpd p,Toc())	goto err_out;
-	 TC    
-	  }
+	}s 	++azt_open_couN@;M 	aztLockDoor();s s@@
n1577,7 +1690,7 y s #)@ vNR 	e unsi 0;
 
-err_out:
+ TC   )rr_out:
 	MOD_DEC_USE_COUNT;
 	e unsi -EIO;
 }n@@
n1586,29 +1699,22 y s /*s  * On close, we flush all)azt+blocks H0xmCthe)buff_r cache.n  +/M-vmfzbH_AZT_KERNEL_PRIOR_2_1M-y  pF TES < aztcd_release(     cCinode *Cinode,T     cCf
 
 *Cf
 
)
-v)lseo-y  pF TiN@T aztcd_release(     cCinode *Cinode,T     cCf
 
 *Cf
 
)
-v)@ vNR-{ n+y  pF TiN@Taztcd_release(     cCinode *inode,T     cCf
 
 *f
 
)
+{o vmfzbH_AZT_DEBUGs-  priN@k("aztcd: executiERcaztcd_release\n");n-  priN@k("inode: %p,Cinode->i_r ev: %x    G
 
: %p\n",inode,inode->i_r ev,f
 
);n-v)@ vNn-  MOD_DEC_USE_COUNT;
-  iUR	!--azt_open_couN@) {n-	azt_invalid p,_buff_rs();
-	aztUnlockDoor();s-        iUR	azt_auto_eject)s-           aztS)ndCmd(ACMD_EJECT);s-        CLEAR_TIMER;
-  }
-vmfzbH_AZT_KERNEL_PRIOR_2_1M-  e unsi;
-#)lseo-  e unsi 0;
+	priN@k("aztcd: executiERcaztcd_release\n");n+	priN@k("inode: %p,Cinode->i_r ev: %x    G
 
: %p\n",Cinode,n+	       inode->i_r ev, f
 
);n v)@ vN
+	MOD_DEC_USE_COUNT;
+	iUR	!--azt_open_couN@) {n+		azt_invalid p,_buff_rs();
+		aztUnlockDoor();n+		iUR	azt_auto_eject)s+			aztS)ndCmd(ACMD_EJECT);s+		CLEAR_TIMER;
+	}op	e unsi 0;
 }n s s@@
n1618,222 +1724,244 y s  */s s iN@T__init aztcd_init(ES <)n-{       loERcit4 couN@, max_couN@;M+{o+	loERcit4 couN@, max_couN@;M 	u vNRE_FGchar re8ult[50];
 	int st;s 	int i = 0;  M-	iUR	azt_portT== 0) n-	{ priN@k("aztcd: no AztechCCD-ROM)Initializatt *");n-          e unsi -EIO;
+	iUR	azt_portT== 0) {
+		priN@k("aztcd: no AztechCCD-ROM)Initializatt *");n+		e unsi -EIO;
 	}n n-	priN@k("aztcd: AZTECH, ORCHID, OKANO, WEARNES, TXC, CyDROMCCD-ROM)Driver\n"); 
p	priN@kn+	    ("aztcd: AZTECH, ORCHID, OKANO, WEARNES, TXC, CyDROMCCD-ROM)Driver\n");s 	priN@k("aztcd: (C) 1994-98 W.Zimmermann\n");n-	iUR	azt_portT== -1) n-	{ priN@k("aztcd: KernelV_rst *=%s)DriverV_rst *=%s)For IDE/ATAPI- rives us_Cide-cd.c\n",UTS_RELEASE,AZT_VERSION);
+	iUR	azt_portT== -1) {
+		priN@kn+		    ("aztcd: KernelV_rst *=%s)DriverV_rst *=%s)For IDE/ATAPI- rives us_Cide-cd.c\n",n+		     UTS_RELEASE, AZT_VERSION);
+	} )lseo+		priN@kn+		    ("aztcd: DriverV_rst *=%s)BaseAddrurc=0x%x  For IDE/ATAPI- rives us_Cide-cd.c\n",n+		     AZT_VERSION, azt_port);
p	priN@kn+	    ("aztcd: IURyou have problems, read /usr/src/linux/Documentatt */cd0xm/aztcd\n");n+
+s+#iHzbH_AZT_SW32			/*CDROM connectedCto SouNdwave32)cand */M+	iUR	(0xFF00T& inw(AZT_SW32_ID_REG)) != 0x4500) {
+		priN@kn+		    ("aztcd: no SouNdwave32)cand detectedCat+base:%x init:%x config:%x id:%x\n",n+		     AZT_SW32_BASE_ADDR, AZT_SW32_INIT,n+		     AZT_SW32_CONFIG_REG, AZT_SW32_ID_REG);n+		e unsi -EIO;
+	} )lse {n+		priN@k(KERN_INFOn+		       "aztcd: SouNdwave32)cand detectedCat+%x  V_rst * %x\n",n+		       AZT_SW32_BASE_ADDR, inw(AZT_SW32_ID_REG));
+		outw(AZT_SW32_INIT, AZT_SW32_CONFIG_REG);
+		G_SM(couN@T= 0; couN@T< 10000; couN@++);	/*delay+a bit */M 	}n-        )lseo-	  priN@k("aztcd: DriverV_rst *=%s)BaseAddrurc=0x%x  For IDE/ATAPI- rives us_Cide-cd.c\n",AZT_VERSION,azt_port);
-	priN@k("aztcd: IURyou have problems, read /usr/src/linux/Documentatt */cd0xm/aztcd\n");n-s- 
-vmfzbH_AZT_SW32   /*CDROM connectedCto SouNdwave32)cand*/s-        iUR	(0xFF00T& inw(AZT_SW32_ID_REG)) != 0x4500)s-           { priN@k("aztcd: no SouNdwave32)cand detectedCat+base:%x init:%x config:%x id:%x\n",n-		 AZT_SW32_BASE_ADDR,AZT_SW32_INIT,AZT_SW32_CONFIG_REG,AZT_SW32_ID_REG);n-                 e unsi -EIO;
-	   }s-        else                M-           { priN@k(KERN_INFO "aztcd: SouNdwave32)cand detectedCat+%x  V_rst * %x\n",n-	 	 AZT_SW32_BASE_ADDR, inw(AZT_SW32_ID_REG));
-	 TC  outw(AZT_SW32_INIT,AZT_SW32_CONFIG_REG);
-	 TC  G_SM(couN@=0;couN@<10000;couN@++);          /*delay+a bit*/    	 M-           }n-v)@ vN	n+v)@ vN
 
 	/* check)G_SMpre8enc
+of  rive */s s-        iUR	azt_portT== -1) 			/* autoprobiERc*/s-        { G_SM(i=0;	azt_port_auto[i]!=0)&&(i<16);i++)M-          { azt_portT= azt_port_auto[i];n-            priN@k("aztcd: AutoprobiERcBaseAddrurc=0x%x \n",azt_port);
-            st = check_regt *	azt_port, 4);  /*proprietary interfacesRneedC4 bytes*/s-  	    iUR	st) continue;
-
-	 TC outb(POLLED,MODE_PORT);              M-	    inb(CMD_PORT);M-	    inb(CMD_PORT);M-	    outb(ACMD_GET_VERSION,CMD_PORT); /*Try to gecCv_rst * itfo*/s-s-            aztTimeOutCouN@=0;   M-  	    do { aztInd pum=inb(STATUS_PORT);M-	         aztTimeOutCouN@++; s-	         iUR	aztTimeOutCouN@>=AZT_FAST_TIMEOUT) bnuxk; s-	       } wh
 
 (aztInd pum&AFL_STATUS); s-	    iUR	inb(DATA_PORT)==AFL_OP_OK) s-	      bnuxk;
-          }s-          iUR	(azt_port_auto[i]==0)||(i==16))  M-          { priN@k("aztcd: no AZTECH CD-ROM) rive fouNd\n");n-            e unsi -EIO;
-          }s-        } M-        else					/* no autoprobiERc*/s-        { iUR	(azt_port==0x1f0)||	azt_port==0x170))  M-            st = check_regt *	azt_port, 8);  /*IDE-interfacesRneedC8 bytes*/s-          )lseo-            st = check_regt *	azt_port, 4);  /*proprietary interfacesRneedC4 bytes*/s-	  iUR	st)  -	  { priN@k("aztcd: conflict, I/O portT(%X) already us_d\n",azt_port);
-            e unsi -EIO;
-	  }M-	s-          iUR	(azt_port==0x1f0)||	azt_port==0x170))  M-            SWITCH_IDE_SLAVE;  /* witch IDE interface to slave configuratt **/s-        M-          outb(POLLED,MODE_PORT);              M-	  inb(CMD_PORT);M-	  inb(CMD_PORT);M-	  outb(ACMD_GET_VERSION,CMD_PORT); /*Try to gecCv_rst * itfo*/s-s-          aztTimeOutCouN@=0;   M-	  do { aztInd pum=inb(STATUS_PORT);M-	       aztTimeOutCouN@++; s-	       iUR	aztTimeOutCouN@>=AZT_FAST_TIMEOUT) bnuxk; s-	     } wh
 
 (aztInd pum&AFL_STATUS); s+	iUR	azt_portT== -1) {	/* autoprobiERc*/s+		G_SM(i = 0; (azt_port_auto[i] != 0)T&&R	i < 16); i++) {n+			azt_portT= azt_port_auto[i];n+			priN@k("aztcd: AutoprobiERcBaseAddrurc=0x%x \n",n+			       azt_port);
p			st = check_regt *	azt_port, 4);	/*proprietary interfacesRneedC4 bytes */s+			iUR	st)s+				continue;
+s+			outb(POLLED, MODE_PORT);
+			inb(CMD_PORT);M+			inb(CMD_PORT);M+			outb(ACMD_GET_VERSION, CMD_PORT);	/*Try to gecCv_rst * itfoT*/s+s+			aztTimeOutCouN@ = 0;op			do {s+				aztInd pum = inb(STATUS_PORT);M+				aztTimeOutCouN@++;op				iUR	aztTimeOutCouN@ >= AZT_FAST_TIMEOUT)
+					bnuxk;
+			} wh
 
 (aztInd pumT& AFL_STATUS);
+			iUR	inb(DATA_PORT)T== AFL_OP_OK)
+				bnuxk;
+		}n+		iUR	(azt_port_auto[i] == 0) || (i == 16)) {n+			priN@k("aztcd: no AZTECH CD-ROM) rive fouNd\n");n+			e unsi -EIO;
+		}
+	} )lse {		/* no autoprobiERc*/s+		iUR	(azt_port == 0x1f0) || (azt_port == 0x170))
p			st = check_regt *	azt_port, 8);	/*IDE-interfacesRneedC8 bytesc*/s+		)lseo+			st = check_regt *	azt_port, 4);	/*proprietary interfacesRneedC4 bytes */s+		iUR	st) {M+			priN@kn+			    ("aztcd: conflict, I/O portT(%X) already us_d\n",n+			     azt_port);
p			e unsi -EIO;
+		}
 M-  	  iUR	inb(DATA_PORT)!=AFL_OP_OK) /*OP_OK? IURnot, re8et andCtry again*/s-             { s+		iUR	(azt_port == 0x1f0) || (azt_port == 0x170))
p			SWITCH_IDE_SLAVE;	/* witch IDE interface to slave configuratt *T*/s+s+		outb(POLLED, MODE_PORT);
+		inb(CMD_PORT);M+		inb(CMD_PORT);M+		outb(ACMD_GET_VERSION, CMD_PORT);	/*Try to gecCv_rst * itfoT*/s+s+		aztTimeOutCouN@ = 0;op		do {s+			aztInd pum = inb(STATUS_PORT);M+			aztTimeOutCouN@++;op			iUR	aztTimeOutCouN@ >= AZT_FAST_TIMEOUT)
+				bnuxk;
+		} wh
 
 (aztInd pumT& AFL_STATUS);
+
+		iUR	inb(DATA_PORT)T!= AFL_OP_OK) {	/*OP_OK? IURnot, re8et andCtry again */s #ifnzbH_MODULEn-               iUR	azt_cont!=0x79)   M-	          { priN@k("aztcd: no AZTECH CD-ROM) rive fouNd-Try boot pa ameter aztcd=<BaseAddrurc>,0x79\n");n-	            e unsi -EIO;
-                  }n-v)lse        n-               iUR	0)
-                  {
-                  }n-v)@ vN	     n-               else   
-       	          { priN@k("aztcd:  rive re8et - please wait\n");n-	            G_SM(couN@=0;couN@<50;couN@++)n-	              { inb(STATUS_PORT);    /*removiERcall) ata H0xmCearlier tries*/s-	 TC             inb(DATA_PORT);s-	 TC           }s-	 TC         outb(POLLED,MODE_PORT);          s-	 TC         inb(CMD_PORT);M-	            inb(CMD_PORT);M-		    getAztS  tus(); 		    /*trap )rrors*/s-	 TC         outb(ACMD_SOFT_RESET,CMD_PORT); /*send re8et*/s-	 TC         STEN_LOW;
-	            iUR	inb(DATA_PORT)!=AFL_OP_OK)    /*OP_OK?*/s-	 TC            { priN@k("aztcd: no AZTECH CD-ROM) rive fouNd\n");n-                         e unsi -EIO;
-	               } 
-	            n-	            G_SM(couN@T= 0; couN@T< AZT_TIMEOUT; couN@++)n-	            	barrier();	/* Stop gcc 2.96 beiERcsm rt */s-	 TC         
-	            iUR		st=getAztS  tus())==-1)s-	 TC            { priN@k("aztcd: Drive S  tusTError S  tus=%x\n",st);
-                         e unsi -EIO;
-	               }s-vmfzbH_AZT_DEBUGs-	            priN@k("aztcd: S  tusT= %x\n",st);
-v)@ vNn-	 TC         outb(POLLED,MODE_PORT);            s-	 TC         inb(CMD_PORT);M-	            inb(CMD_PORT);M-	 TC         outb(ACMD_GET_VERSION,CMD_PORT); /*GetV_rst **/s-	 TC         STEN_LOW;
-	            OP_OK;
-	          } M-             }s+			iUR	azt_cont != 0x79) {o+				priN@kn+				    ("aztcd: no AZTECH CD-ROM) rive fouNd-Try boot pa ameter aztcd=<BaseAddrurc>,0x79\n");n+				e unsi -EIO;n+			}s+#)lseo+			iUR	0) {o+			}n+v)@ vN
+			)lse {o+				priN@kn+				    ("aztcd:  rive re8et - please wait\n");n+				G_SM(couN@T= 0; couN@T< 50; couN@++) {n+					inb(STATUS_PORT);	/*removiERcall) ata H0xmCearlier tries */s+					inb(DATA_PORT);s+				}s+				outb(POLLED, MODE_PORT);
+				inb(CMD_PORT);M+				inb(CMD_PORT);M+				getAztS  tus();	/*trap )rrors */s+				outb(ACMD_SOFT_RESET, CMD_PORT);	/*send re8et */s+				STEN_LOW;
+				iUR	inb(DATA_PORT)T!= AFL_OP_OK) {	/*OP_OK? */s+					priN@kn+					    ("aztcd: no AZTECH CD-ROM) rive fouNd\n");n+					e unsi -EIO;n+				}
+
+				G_SM(couN@T= 0; couN@T< AZT_TIMEOUT;n+				     couN@++)n+					barrier();	/* Stop gcc 2.96 beiERcsm rt */s+ +				iUR	(st = getAztS  tus())T== -1) {
+					priN@kn+					    ("aztcd: Drive S  tusTError S  tus=%x\n",n+					     st);n+					e unsi -EIO;n+				}
+#iHzbH_AZT_DEBUGsp				priN@k("aztcd: S  tusT= %x\n", st);n+v)@ vN
+				outb(POLLED, MODE_PORT);
+				inb(CMD_PORT);M+				inb(CMD_PORT);M+				outb(ACMD_GET_VERSION, CMD_PORT);	/*GetV_rst * */s+				STEN_LOW;
+				OP_OK;
+			}s+		}
 	}n-	n-	azt_init_)@ =1;
+
+	azt_init_)@  = 1;n 	STEN_LOW;
-	re8ult[0]=inb(DATA_PORT);        /*readiERcit a null)byte???*/s-	G_SM(couN@=1;couN@<50;couN@++)   /*ReadiERcv_rst * string*/s-	 { aztTimeOutCouN@=0;            /*here we must implement STEN_LOW  vNferently*/s-	 TCdo { aztInd pum=inb(STATUS_PORT);/*becaus_Cwe wancCto exit)by timeout*/s-		aztTimeOutCouN@++; s-		iUR	aztTimeOutCouN@>=AZT_FAST_TIMEOUT) bnuxk; s-	      } wh
 
 (aztInd pum&AFL_STATUS); s-	   iUR	aztTimeOutCouN@>=AZT_FAST_TIMEOUT) bnuxk;  /*all)chars read?*/s-	 TCre8ult[couN@]=inb(DATA_PORT);s-	 }M-	iUR	couN@>30) max_couN@=30;  /*print max.30)chars of thecv_rst * string*/s-	else          max_couN@=couN@;M+	re8ult[0] = inb(DATA_PORT);	/*readiERcit a null)byte??? */s+	G_SM(couN@T= 1; couN@T< 50; couN@++) {	/*ReadiERcv_rst * string */s+		aztTimeOutCouN@ = 0;	/*here we must implement STEN_LOW  vNferently */s+		do {s+			aztInd pum = inb(STATUS_PORT);	/*becaus_Cwe wancCto exit)by timeout */M+			aztTimeOutCouN@++;op			iUR	aztTimeOutCouN@ >= AZT_FAST_TIMEOUT)
+				bnuxk;
+		} wh
 
 (aztInd pumT& AFL_STATUS);
+		iUR	aztTimeOutCouN@ >= AZT_FAST_TIMEOUT)
+			bnuxk;	/*all)chars read? */s+		e 8ult[couN@] = inb(DATA_PORT);
+	}op	iUR	couN@ > 30)s+		max_couN@ = 30;	/*print max.30)chars of thecv_rst * string */s+	)lseo+		max_couN@ = couN@;M 	priN@k(KERN_INFO "aztcd: FirmwareV_rst *=");n-	G_SM(couN@=1;couN@<max_couN@;couN@++) priN@k("%c",e 8ult[couN@]);s+	G_SM(couN@T= 1; couN@T< max_couN@; couN@++)n+		priN@k("%c", e 8ult[couN@]);s 	priN@k("<<>> ");
 s-	iUR	(e 8ult[1]=='A')&&(e 8ult[2]=='Z')&&(e 8ult[3]=='T'))
-	 { priN@k("AZTECH  rive detected\n"); /*AZTECH*/    s-	 }M-	)lse iUR	(e 8ult[2]=='C')&&(e 8ult[3]=='D')&&(e 8ult[4]=='D'))
-	 { priN@k("ORCHID or WEARNES  rive detected\n"); /*ORCHID or WEARNES*/s-	 }M-	)lse iUR	(e 8ult[1]==0x03)&&(e 8ult[2]=='5'))
-	 { priN@k("TXC or CyCDROM  rive detected\n"); /*Conrad TXC, CyCDROM*/s-	 }M-	)lse                                             /*OTHERS or none*/s-	 { priN@k("\nunknown  rive or firmwarecv_rst * detected\n");s-	 TCpriN@k("aztcd mayRnot ru* stab 
, iURyou wancCto try anyhow,\n");s-	 TCpriN@k("boot with: aztcd=<BaseAddrurc>,0x79\n");n-	   iUR	(azt_cont!=0x79))     s-	 TC  { priN@k("aztcd: FirmwareV_rst *=");n-	       G_SM(couN@=1;couN@<5;couN@++) priN@k("%c",e 8ult[couN@]);s-	       priN@k("<<>> ");
-	       priN@k("Aborted\n");s-               e unsi -EIO;
-	     }s-	 }M-	devfs_regtster (NULL, "aztcd", DEVFS_FL_DEFAULT, MAJOR_NR, 0,n-			S_IFBLK | S_IRUGO | S_IWUGO, &azt_fops, NULL);n-	iUR	devfs_regtster_blkdev(MAJOR_NR, "aztcd", &azt_fops) != 0)
-	{M+	iUR	(e 8ult[1]T== 'A')T&&R	e 8ult[2]T== 'Z')T&&R	e 8ult[3]T== 'T')) {
+		priN@k("AZTECH  rive detected\n");
+	/*AZTECH*/}
+		)lse iUR		e 8ult[2]T== 'C')T&&R	e 8ult[3]T== 'D')n+			 &&R	e 8ult[4]T== 'D')) {
+		priN@k("ORCHID or WEARNES  rive detected\n");	/*ORCHID or WEARNES */s+	} )lse iUR	(e 8ult[1]T== 0x03)T&&R	e 8ult[2]T== '5')) {
+		priN@k("TXC or CyCDROM  rive detected\n");	/*Conrad TXC, CyCDROM */s+	} )lse {		/*OTHERS or none */s+		priN@k("\nunknown  rive or firmwarecv_rst * detected\n");s+		priN@kn+		    ("aztcd mayRnot ru* stab 
, iURyou wancCto try anyhow,\n");s+		priN@k("boot with: aztcd=<BaseAddrurc>,0x79\n");n+		iUR	(azt_cont != 0x79)) {n+			priN@k("aztcd: FirmwareV_rst *=");n+			G_SM(couN@T= 1; couN@T< 5; couN@++)n+				priN@k("%c", e 8ult[couN@]);s+			priN@k("<<>> ");
+			priN@k("Aborted\n");s+			e unsi -EIO;
+		}
+	}
+	devfs_regtster(NULL, "aztcd", DEVFS_FL_DEFAULT, MAJOR_NR, 0,n+		       S_IFBLK | S_IRUGO | S_IWUGO, &azt_fops, NULL);n+	iUR	devfs_regtster_blkdev(MAJOR_NR, "aztcd", &azt_fops) != 0)l{  		priN@k("aztcd: Unab 
+to gecCmaj_SM%d G_SMAztechCCD-ROM\n",n 		       MAJOR_NR);
-                e unsi -EIO;
+		e unsi -EIO;
 	}n 	blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);s-#ifnzbH_AZT_KERNEL_PRIOR_2_1M 	blksize_size[MAJOR_NR]T= aztcd_blocksizes;
-v)@ vNn 	e ad_ahead[MAJOR_NR]T= 4;
-	regtster_ vsk(NULL, MKDEV(MAJOR_NR,0), 1, &azt_fops, 0);n+	regtster_ vsk(NULL, MKDEV(MAJOR_NR, 0), 1, &azt_fops, 0);n+M+	iUR	(azt_port == 0x1f0) || (azt_port == 0x170))
p		request_regt *	azt_port, 8, "aztcd");	/*IDE-interface */s+	)lseo+		request_regt *	azt_port, 4, "aztcd");	/*proprietary interface */s s-        iUR	(azt_port==0x1f0)||	azt_port==0x170))  M-	 TCrequest_regt *	azt_port, 8, "aztcd");  /*IDE-interface*/s-        )lseo-	   request_regt *	azt_port, 4, "aztcd");  /*proprietary interface*/s-        M 	azt_invalid p,_buff_rs();
 	aztPre8entT= 1;n 	aztCloseDoor();n-        e unsi (0);n+	reunsi (0);n }n s ES < __exit)aztcd_exit(ES <)n {
-  devfs_unregtster(devfs_find_handle(NULL, "aztcd", 0, 0, DEVFS_SPECIAL_BLK,n-				     0));s-  iUR	(devfs_unregtster_blkdev(MAJOR_NR, "aztcd")T== -EINVAL))    
-    { priN@k("What's tha@: ca*'t unregtster aztcd\n");n-      e unsi;
-    }
-  blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));s-  iUR	(azt_port==0x1f0)||	azt_port==0x170))  M-    { SWITCH_IDE_MASTER;
-      e lease_regt *	azt_port,8);  /*IDE-interface*/s-    }
-  )lseo-      e lease_regt *	azt_port,4);  /*proprietary interface*/s-  priN@k(KERN_INFO "aztcdCmodule e leased.\n");n-}   n+	devfs_unregtster(devfs_find_handlen+			 (NULL, "aztcd", 0, 0, DEVFS_SPECIAL_BLK, 0));s+	iUR	(devfs_unregtster_blkdev(MAJOR_NR, "aztcd")T== -EINVAL)) {
+		priN@k("What's tha@: ca*'t unregtster aztcd\n");n+		e unsi;
+	}op	blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));s+	iUR	(azt_port == 0x1f0) || (azt_port == 0x170)) {
+		SWITCH_IDE_MASTER;
+		e lease_regt *	azt_port, 8);	/*IDE-interface */s+	} )lse
+		e lease_regt *	azt_port, 4);	/*proprietary interface */s+	priN@k(KERN_INFO "aztcdCmodule e leased.\n");n+}s s vmfzbH_MODULEnCmodule_init(aztcd_init);
@@
n1846,405 +1974,485 y s +/M y  pF TES < azt_poll(ES <)n {
-    int st = 0;o-    int loop_ctl = 1;n-    int skip = 0;o- -    iUR	azt_)rror) {                            n-	iUR	aztS)ndCmd(ACMD_GET_ERROR)) RETURN("azt_poll 1");
-	STEN_LOW;
-	azt_)rror=inb(DATA_PORT)&0xFF;
-	priN@k("aztcd: I/O )rror 0x%02x\n", azt_)rror);n-	azt_invalid p,_buff_rs();
+	int st = 0;
+	int loop_ctl = 1;n+	int skip = 0;o+s+	iUR	azt_)rror) {
+		iUR	aztS)ndCmd(ACMD_GET_ERROR))
+			RETURN("azt_poll 1");
+		STEN_LOW;
+		azt_)rror = inb(DATA_PORT) & 0xFF;
+		priN@k("aztcd: I/O )rror 0x%02x\n", azt_)rror);n+		azt_invalid p,_buff_rs();
 vmfzbH_WARN_IF_READ_FAILUREn-	iUR	AztTriesT== 5)o-	  priN@k("aztcd: Read of Block %d Failed - Maybe Audio Dvsk?\n", azt_next_bn);
-v)@ vNn-	iUR	!AztTries--) {s-	  priN@k("aztcd: Read of Block %d Failed, Maybe Audio Dvsk? GiviERcup\n", azt_next_bn);
-	  iUR	azt_transf_r_is_active) {s-	    AztTriesT= 0;
-	    loop_ctl = 0;
-	  }M-	TCiUR	CURRENT_VALID)
-	    )@ _request(0);n-	  AztTriesT= 5;o-	}
-    azt_)rror = 0;o-    azt_y  pe = AZT_S_STOP;
-    }
- -    wh
 
 (loop_ctl)
-    {
-      loop_ctl = 0;   /* eachCcase must flip 
lis back to 1CiURwe wancn-			 to come back up here */s-       witch 	azt_y  pe) {
+		iUR	AztTriesT== 5)o+			priN@kn+			    ("aztcd: Read of Block %d Failed - Maybe Audio Dvsk?\n",n+			     azt_next_bn);
+v)@ vN
+		iUR	!AztTries--) {s+			priN@kn+			    ("aztcd: Read of Block %d Failed, Maybe Audio Dvsk? GiviERcup\n",n+			     azt_next_bn);
+			iUR	azt_transf_r_is_active) {s+				AztTriesT= 0;op				loop_ctl = 0;
+			}s+			iUR	CURRENT_VALID)
+				en _request(0);n+			AztTriesT= 5;o+		}
+		azt_)rror = 0;n+		azt_y  pe = AZT_S_STOP;
+	}
+
+	wh
 
 (loop_ctl) {s+		loop_ctl = 0;	/* eachCcase must flip 
lis back to 1CiURwe wancn+				   uo come back up here */s+		switch 	azt_y  pe) {
 s-	case AZT_S_IDLE:
+		case AZT_S_IDLE:
 vmfzbH_AZT_TEST3
-	  iUR	azt_y  pe!=azt_y  pe_old)l{ -	    azt_y  pe_old=azt_y  pe;
-	    priN@k("AZT_S_IDLE\n");n-	    }s+			iUR	azt_y  pe != azt_y  pe_old)l{ +				azt_y  pe_old = azt_y  pe;n+				priN@k("AZT_S_IDLE\n");n+			}s v)@ vNn-	 Te unsi;
+			e unsi;
 s-	case AZT_S_START:
+		case AZT_S_START:
 vmfzbH_AZT_TEST3
-	  iUR	azt_y  pe!=azt_y  pe_old)l{ -	    azt_y  pe_old=azt_y  pe;
-	    priN@k("AZT_S_START\n");n-	  }
-v)@ vNn-	 Tif	aztS)ndCmd(ACMD_GET_STATUS)) RETURN("azt_poll 2");  /*e 8ult will be checked by aztS  tus() */s-	 Tazt_y  pe = azt_mode == 1 ? AZT_S_READ : AZT_S_MODE;n-	  AztTimeout = 3000;
-	  bnuxk;
+			iUR	azt_y  pe != azt_y  pe_old)l{ +				azt_y  pe_old = azt_y  pe;n+				priN@k("AZT_S_START\n");n+			}n+v)@ vN
+			iUR	aztS)ndCmd(ACMD_GET_STATUS))o+				RETURN("azt_poll 2");	/*e 8ult will be checked by aztS  tus() */s+			azt_y  pe =n+			    azt_mode == 1 ? AZT_S_READ : AZT_S_MODE;n+			AztTimeout = 3000;
+			bnuxk;
 s-	case AZT_S_MODE:
+		case AZT_S_MODE:
 vmfzbH_AZT_TEST3
-	  iUR	azt_y  pe!=azt_y  pe_old)l{ -	    azt_y  pe_old=azt_y  pe;
-	    priN@k("AZT_S_MODE\n");n-	  }
-v)@ vNn-	 TifR	!skip)l{ -	    iUR	(st = aztS  tus())T!= -1) {
-	      iUR	(stT& AST_DSK_CHG)||	stT& AST_NOT_READY)) {
-		aztDvskChanged = 1;n-		aztTocUpToD
te = 0;o-		azt_invalid p,_buff_rs();
-		)@ _request(0);n-		priN@k("aztcd: Dvsk Changed or Not Ready 1 - UnmouN@TDvsk!\n");n-	      }s-	 TC } )lse bnuxk;
-	  }
-	  skip = 0;o- -	  iUR	(stT& AST_DOOR_OPEN)||	stT& AST_NOT_READY)) {
-	    aztDvskChanged = 1;n-	    aztTocUpToD
te = 0;o-    TC      priN@k("aztcd: Dvsk Changed or Not Ready 2 - UnmouN@TDvsk!\n");n-            e@ _request(0);n-	    priN@k(	stT& AST_DOOR_OPEN) ? "aztcd: door open\n" : "aztcd: dvsk removed\n");s-	 TC iUR	azt_transf_r_is_active) {s-	      azt_y  pe = AZT_S_START;
-	      loop_ctl = 1;   /* goto immedi pely */s-	      bnuxk;
-	    }s-	 TC azt_y  pe = AZT_S_IDLE;s-	    wh
 
 (CURRENT_VALID)s-	 TC   )@ _request(0);n-	    e unsi;
-	  }
-				
+			iUR	azt_y  pe != azt_y  pe_old)l{ +				azt_y  pe_old = azt_y  pe;n+				priN@k("AZT_S_MODE\n");n+			}n+v)@ vN
+			iUR	!skip)l{ +				iUR	(st = aztS  tus())T!= -1) {
+					iUR	(stT& AST_DSK_CHG)n+					    || (stT& AST_NOT_READY)) {
+						aztDvskChanged = 1;n+						aztTocUpToD
te = 0;op						azt_invalid p,_buff_rs();
+						en _request(0);n+						priN@kn+						    ("aztcd: Dvsk Changed or Not Ready 1 - UnmouN@TDvsk!\n");n+					}
+				} )lseo+					bnuxk;
+			}s+			skip = 0;o+s+			iUR	(stT& AST_DOOR_OPEN) || (stT& AST_NOT_READY)) {
+				aztDvskChanged = 1;n+				aztTocUpToD
te = 0;op				priN@kn+				    ("aztcd: Dvsk Changed or Not Ready 2 - UnmouN@TDvsk!\n");n+				en _request(0);n+				priN@k(	stT& AST_DOOR_OPEN) ?n+				       "aztcd: door open\n" :n+				       "aztcd: dvsk removed\n");sp				iUR	azt_transf_r_is_active) {s+					azt_y  pe = AZT_S_START;
+					loop_ctl = 1;	/* goto immedi pely */s+					bnuxk;
+				}s+				azt_y  pe = AZT_S_IDLE;s+				wh
 
 (CURRENT_VALID)s+					en _request(0);n+				e unsi;
+			}
+
 /*	  iUR	aztS)ndCmd(ACMD_SET_MODE)) RETURN("azt_poll 3");s 	  outb(0x01, DATA_PORT);          M 	  PA_OK;
 	  STEN_LOW;
-*/        iUR	aztS)ndCmd(ACMD_GET_STATUS)) RETURN("azt_poll 4");s-	 TSTEN_LOW;
-	  azt_mode = 1;n-	  azt_y  pe = AZT_S_READ;n-	  AztTimeout = 3000;
+*/s+			iUR	aztS)ndCmd(ACMD_GET_STATUS))o+				RETURN("azt_poll 4");sp			STEN_LOW;
+			azt_mode = 1;n+			azt_y  pe = AZT_S_READ;n+			AztTimeout = 3000;
 
-	  bnuxk;
+			bnuxk;
 s s-	case AZT_S_READ:
+		case AZT_S_READ:
 vmfzbH_AZT_TEST3
-	  iUR	azt_y  pe!=azt_y  pe_old)ll{ -	    azt_y  pe_old=azt_y  pe;
-	    priN@k("AZT_S_READ\n");n-	  }
-v)@ vNn-	 TifR	!skip)l{ -	      iUR	(st = aztS  tus())T!= -1) {
-		iUR	(stT& AST_DSK_CHG)||	stT& AST_NOT_READY)) {
-		aztDvskChanged = 1;n-		aztTocUpToD
te = 0;o-		azt_invalid p,_buff_rs();
-		priN@k("aztcd: Dvsk Changed or Not Ready 3 - UnmouN@TDvsk!\n");n-            C   )@ _request(0);               n-		}s-	      } )lse bnuxk;
-	  } s-	 TC 
-	  skip = 0;o-	  iUR	(stT& AST_DOOR_OPEN)||	stT& AST_NOT_READY)) {
-	    aztDvskChanged = 1;n-	    aztTocUpToD
te = 0;o-	    priN@k(	stT& AST_DOOR_OPEN) ? "aztcd: door open\n" : "aztcd: dvsk removed\n");s-	 TC iUR	azt_transf_r_is_active) {s-	      azt_y  pe = AZT_S_START;
-	      loop_ctl = 1;s-	      bnuxk;
-	    }s-	 TC azt_y  pe = AZT_S_IDLE;s-	    wh
 
 (CURRENT_VALID)s-	 TC )@ _request(0);n-	    e unsi;
-	  }
-M-	TCiUR	CURRENT_VALID) {s-	         cCazt_Play_msfCmsf;M-	    int i;
-	    azt_next_bn = CURRENT -> sector / 4;
-	    azt_hsg2msf(azt_next_bn, &msf.8  rt);s-	 TC i = 0;o-	    /*Cf
ndcout inCwh
ch trackRwe are */s-	    wh
 
 (azt_msf2hsg(&msf.8  rt)>azt_msf2hsg(&Toc[++i].trackTime)) {};s-	 TC iUR	azt_msf2hsg(&msf.8  rt)<azt_msf2hsg(&Toc[i].trackTime)-AZT_BUF_SIZ)s-               { azt_e ad_couN@=AZT_BUF_SIZ;  /*fast, becaus_Cwe read ahead*/s-               /*azt_e ad_couN@=CURRENT->nr_sectors;     low, no read ahead*/s-               }s-	 TC )lse /* do*'t read beyondT)ndcof trackR*/        TC 
-viH_AZT_MULTISESSION s-               { azt_e ad_couN@=(azt_msf2hsg(&Toc[i].trackTime)/4)*4-azt_msf2hsg(&msf.8  rt);  
-                 iUR	azt_e ad_couN@ < 0) azt_e ad_couN@=0;o-		 iUR	azt_e ad_couN@ > AZT_BUF_SIZ)lazt_e ad_couN@=AZT_BUF_SIZ;
-                 priN@k("aztcd: warniERc- tryiERcto read beyondT)ndcof track\n");sp			iUR	azt_y  pe != azt_y  pe_old)l{ +				azt_y  pe_old = azt_y  pe;n+				priN@k("AZT_S_READ\n");n+			}n+v)@ vN
+			iUR	!skip)l{ +				iUR	(st = aztS  tus())T!= -1) {
+					iUR	(stT& AST_DSK_CHG)n+					    || (stT& AST_NOT_READY)) {
+						aztDvskChanged = 1;n+						aztTocUpToD
te = 0;op						azt_invalid p,_buff_rs();
+						priN@kn+						    ("aztcd: Dvsk Changed or Not Ready 3 - UnmouN@TDvsk!\n");n+						en _request(0);n+					}
+				} )lseo+					bnuxk;
+			}s+s+			skip = 0;o+			iUR	(stT& AST_DOOR_OPEN) || (stT& AST_NOT_READY)) {
+				aztDvskChanged = 1;n+				aztTocUpToD
te = 0;op				priN@k(	stT& AST_DOOR_OPEN) ?n+				       "aztcd: door open\n" :n+				       "aztcd: dvsk removed\n");sp				iUR	azt_transf_r_is_active) {s+					azt_y  pe = AZT_S_START;
+					loop_ctl = 1;s+					bnuxk;
+				}s+				azt_y  pe = AZT_S_IDLE;s+				wh
 
 (CURRENT_VALID)s+					en _request(0);n+				e unsi;
+			}
+
+			iUR	CURRENT_VALID) {s+				     cCazt_Play_msfCmsf;M+				int i;n+				azt_next_bn = CURRENT->sector / 4;
+				azt_hsg2msf(azt_next_bn, &msf.8  rt);s+				i = 0;op				/*Cf
ndcout inCwh
ch trackRwe are */s+				wh
 
 (azt_msf2hsg(&msf.8  rt) >n+				       azt_msf2hsg(&Toc[++i].trackTime)) {
+				};sp				iUR	azt_msf2hsg(&msf.8  rt) <n+				    azt_msf2hsg(&Toc[i].trackTime) -n+				    AZT_BUF_SIZ)l{ +					azt_e ad_couN@ = AZT_BUF_SIZ;	/*fast, becaus_Cwe read ahead */s+					/*azt_e ad_couN@=CURRENT->nr_sectors;     low, no read ahead */s+				} )lse	/* do*'t read beyondT)ndcof trackR*/
+#iH_AZT_MULTISESSIONs+				{ +					azt_e ad_couN@ =n+					    (azt_msf2hsg(&Toc[i].trackTime)n+					     / 4) * 4 -n+					    azt_msf2hsg(&msf.8  rt);
+					iUR	azt_e ad_couN@ < 0)op						azt_e ad_couN@ = 0;
+					iUR	azt_e ad_couN@ > AZT_BUF_SIZ)op						azt_e ad_couN@ =n+						    AZT_BUF_SIZ;
+					priN@kn+					    ("aztcd: warniERc- tryiERcto read beyondT)ndcof track\n");s /*               priN@k("%i %i %li %li\n",i,azt_e ad_couN@,azt_msf2hsg(&msf.8  rt),azt_msf2hsg(&Toc[i].trackTime));
-*/             }s+*/ }s v)lseo-	       { azt_e ad_couN@=AZT_BUF_SIZ;s-	       }
-v)@ vNn-	 TC msf.)@ .min = 0;o-	    msf.)@ .sec = 0;            s-	 TC msf.)@ .f ame = azt_e ad_couN@ ;/*Mitsumi here e ads 0xffffff sectors*/s+				{ +					azt_e ad_couN@ = AZT_BUF_SIZ;n+				}
+#)@ vN
+				msf.)@ .min = 0;o+				msf.)@ .sec = 0;o+				msf.)@ .f ame = azt_e ad_couN@;	/*Mitsumi here e ads 0xffffff sectors */s #ifzbH_AZT_TEST3
-	    priN@k("---readiERcmsf-addrurc %x:%x:%x  %x:%x:%x\n",msf.8  rt.min,msf.8  rt.sec,msf.8  rt.f ame,msf.)@ .min,msf.)@ .sec,msf.)@ .f ame);n-	    priN@k("azt_next_bn:%x  azt_buf_in:%x azt_buf_out:%x  azt_buf_bn:%x\n", \ -		    azt_next_bn, azt_buf_in, azt_buf_out,Razt_buf_bn[azt_buf_in]);n-v)@ vN s-            iUR	azt_e ad_mode==AZT_MODE_2)s-               { sendAztCmd(ACMD_PLAY_READ_RAW, &msf); /*XA dvsk8Git rawCmode*/s-               }s-            elses-               { sendAztCmd(ACMD_PLAY_READ, &msf);     /*other8Git cooked mode*/s-               }s-	 TC azt_y  pe = AZT_S_DATA;s-	    AztTimeout = READ_TIMEOUT;n-	  } )lse {n-	    azt_y  pe = AZT_S_STOP;
-	    loop_ctl = 1;s-	    bnuxk;
-	  }
p				priN@kn+				    ("---readiERcmsf-addrurc %x:%x:%x  %x:%x:%x\n",n+				     msf.8  rt.min, msf.8  rt.sec,n+				     msf.8  rt.f ame, msf.)@ .min,n+				     msf.)@ .sec, msf.)@ .f ame);np				priN@kn+				    ("azt_next_bn:%x  azt_buf_in:%x azt_buf_out:%x  azt_buf_bn:%x\n",n+				     azt_next_bn, azt_buf_in, azt_buf_out,n+				     azt_buf_bn[azt_buf_in]);np#)@ vN
+				iUR	azt_e ad_mode == AZT_MODE_2)l{ +					sendAztCmd(ACMD_PLAY_READ_RAW, &msf);	/*XA dvsk8Git rawCmode */s+				} )lsel{ +					sendAztCmd(ACMD_PLAY_READ, &msf);	/*other8Git cooked mode */s+				}s+				azt_y  pe = AZT_S_DATA;s+				AztTimeout = READ_TIMEOUT;n+			} )lse {n+				azt_y  pe = AZT_S_STOP;
+				loop_ctl = 1;s+				bnuxk;
+			}s 
-	  bnuxk;
+			bnuxk;
 s s-	case AZT_S_DATA:
+		case AZT_S_DATA:
 vmfzbH_AZT_TEST3
-	  iUR	azt_y  pe!=azt_y  pe_old)ll{ -	    azt_y  pe_old=azt_y  pe;
-	    priN@k("AZT_S_DATA\n");n-	  }
p			iUR	azt_y  pe != azt_y  pe_old)l{ +				azt_y  pe_old = azt_y  pe;n+				priN@k("AZT_S_DATA\n");n+			}s v)@ vNn 
-	  st = inb(STATUS_PORT)T& AFL_STATUSorDATA; o+			st = inb(STATUS_PORT)T& AFL_STATUSorDATA;n 
-	  switch 	st) {M+			switch 	st) {M s-	 TC case AFL_DATA:
+			case AFL_DATA:
 #ifzbH_AZT_TEST3
-	      iUR	st!=azt_y _old)ll{ -		azt_y _old=st; s-		priN@k("---AFL_DATA st:%x\n",st);
-	      }
-v)@ vNn-	 TC  TifR	!AztTries--) {s-		priN@k("aztcd: Read of Block %d Failed, Maybe Audio Dvsk ? GiviERcup\n", azt_next_bn);
-		iUR	azt_transf_r_is_active) {s-		  AztTriesT= 0;
-		  bnuxk;
-		}s-		iUR	CURRENT_VALID)
-		C )@ _request(0);n-		AztTriesT= 5;o-	      }s-	 TC   azt_y  pe = AZT_S_START;
-	      AztTimeout = READ_TIMEOUT;n-	      loop_ctl = 1;s-	      bnuxk;
+				iUR	st != azt_y _old)l{ +					azt_y _old = st;
+					priN@k("---AFL_DATA st:%x\n", st);n+				}np#)@ vN
+				iUR	!AztTries--) {s+					priN@kn+					    ("aztcd: Read of Block %d Failed, Maybe Audio Dvsk ? GiviERcup\n",n+					     azt_next_bn);
+					iUR	azt_transf_r_is_active) {s+						AztTriesT= 0;op						bnuxk;
+					}
+					iUR	CURRENT_VALID)
+						en _request(0);n+					AztTriesT= 5;o+				}s+				azt_y  pe = AZT_S_START;
+				AztTimeout = READ_TIMEOUT;n+				loop_ctl = 1;s+				bnuxk;
 s-	 TC case AFL_STATUSorDATA:
+			case AFL_STATUSorDATA:
 #ifzbH_AZT_TEST3
-	      iUR	st!=azt_y _old)ll{ -		azt_y _old=st;s-		priN@k("---AFL_STATUSorDATA st:%x\n",st);
-	      }
+				iUR	st != azt_y _old)l{ +					azt_y _old = st;
+					priN@kn+					    ("---AFL_STATUSorDATA st:%x\n",n+					     st);n+				}s v)@ vNn-	 T    bnuxk;
+				bnuxk;
 s-	 TC zbHault:
+			zbHault:
 #ifzbH_AZT_TEST3
-	      iUR	st!=azt_y _old)ll{ -		azt_y _old=st;s-		priN@k("---zbHault: st:%x\n",st);
-	      }
-v)@ vNn-	 TC  TAztTriesT= 5;o-	      iUR	!CURRENT_VALIDT&&Razt_buf_in == azt_buf_out)l{ -		azt_y  pe = AZT_S_STOP;
-		loop_ctl = 1;s-		bnuxk;
-	      }s-	 TC   iUR	azt_e ad_couN@<=0)
-		priN@k("aztcd: warniERc- trycto read 0 f ames\n");n-	      wh
 
 (azt_e ad_couN@)      /*??? fast read ahead loop*/s-	 TC    { azt_buf_bn[azt_buf_in]T= -1;s-		 DTEN_LOW;                      /*??? unsolved problem,cv_ry
-						      seldomCwe gecCtimeouts
-						      here, do*'t now thecreal
-						      reason. With my  rive 
lis
-						      sometimes also happens with
-						      Aztech's original  river under
-						      DOS. I8Gi@Ta hardware bug? 
-						      I triedcto recover H0xmCsuch
-						      situatt *s here. Zimmermann*/s-		 iUR	aztTimeOutCouN@>=AZT_TIMEOUT) 
-		C { priN@k("e ad_couN@:%d CURRENT->nr_sectors:%ld azt_buf_in:%d\n", azt_e ad_couN@,CURRENT->nr_sectors,azt_buf_in);M-		    priN@k("azt_transf_r_is_active:%x\n",azt_transf_r_is_active); -		    azt_e ad_couN@=0;o-		    azt_y  pe = AZT_S_STOP;
-		    loop_ctl = 1;s-		 TC )@ _request(1);  /*should we have here (1) or (0)? */s-		  }
-		 )lseo-		  { iUR	azt_e ad_mode==AZT_MODE_2)s-		       { insb(DATA_PORT, azt_buf + CD_FRAMESIZE_RAW * azt_buf_in, CD_FRAMESIZE_RAW); -		       }
-		    )lseo-		       { insb(DATA_PORT, azt_buf + CD_FRAMESIZE * azt_buf_in, CD_FRAMESIZE);
-                       } -		    azt_e ad_couN@--;
+				iUR	st != azt_y _old)l{ +					azt_y _old = st;
+					priN@k("---zbHault: st:%x\n", st);n+				}np#)@ vN
+				AztTriesT= 5;o+				iUR	!CURRENT_VALIDn+				    &&Razt_buf_in == azt_buf_out)l{ +					azt_y  pe = AZT_S_STOP;
+					loop_ctl = 1;s+					bnuxk;
+				}s+				iUR	azt_e ad_couN@ <= 0)op					priN@kn+					    ("aztcd: warniERc- trycto read 0 f ames\n");n+				wh
 
 (azt_e ad_couN@) {	/*??? fast read ahead loop */s+					azt_buf_bn[azt_buf_in]T= -1;s+					DTEN_LOW;	/*??? unsolved problem,cv_ry
+							   seldomCwe gecCtimeouts
+							   here, do*'t now thecreal
+							   reason. With my  rive 
lis
+							   sometimes also happens with
+							   Aztech's original  river under
+							   DOS. I8Gi@Ta hardware bug? 
+							   I triedcto recover H0xmCsuch
+							   situatt *s here. Zimmermann */s+					iUR	aztTimeOutCouN@ >= AZT_TIMEOUT) {
+						priN@kn+						    ("e ad_couN@:%d CURRENT->nr_sectors:%ld azt_buf_in:%d\n",n+						     azt_e ad_couN@,n+						     CURRENT->nr_sectors,n+						     azt_buf_in);M+						priN@kn+						    ("azt_transf_r_is_active:%x\n",n+						     azt_transf_r_is_active); p						azt_e ad_couN@ = 0;
+						azt_y  pe = AZT_S_STOP;
+						loop_ctl = 1;s+						)@ _request(1);	/*should we have here (1) or (0)? */s+					} )lsel{ +						iUR	azt_e ad_mode ==n+						    AZT_MODE_2)l{ +							insb(DATA_PORT,
+							     azt_buf +
+							     CD_FRAMESIZE_RAW
+							     * azt_buf_in,
+							     CD_FRAMESIZE_RAW); p						} )lsel{ +							insb(DATA_PORT,
+							     azt_buf +
+							     CD_FRAMESIZE *
+							     azt_buf_in,
+							     CD_FRAMESIZE); p						} p						azt_e ad_couN@--;
 #ifzbH_AZT_TEST3
-		    priN@k("AZT_S_DATA; ---I've read  ata- e ad_couN@: %d\n",azt_e ad_couN@);M-		    priN@k("azt_next_bn:%d  azt_buf_in:%d azt_buf_out:%d  azt_buf_bn:%d\n", \ -			 azt_next_bn, azt_buf_in, azt_buf_out,Razt_buf_bn[azt_buf_in]);n-v)@ vN -		    azt_buf_bn[azt_buf_in]T= azt_next_bn++;o-		    iUR	azt_buf_outT== -1)o-		      azt_buf_outT= azt_buf_in; -		    azt_buf_in = azt_buf_in + 1 == AZT_BUF_SIZ ? 0 : azt_buf_in + 1;s-		  }
-	       }s-	 TC   iUR	!azt_transf_r_is_active) {s-		wh
 
 (CURRENT_VALID) {s-		  azt_transf_r();M-		  iUR	CURRENT -> nr_sectors == 0)s-		 TC )@ _request(1);
-		C )lseo-		    bnuxk;
-		}s-	      }s-s-	 TC   iUR	CURRENT_VALIDn-		&&R	CURRENT -> sector / 4 < azt_next_bn ||n-		CURRENT -> sector / 4 > azt_next_bn + AZT_BUF_SIZ))l{ -		azt_y  pe = AZT_S_STOP;
-		loop_ctl = 1;s-		bnuxk;
-	      }s-	 TC   AztTimeout = READ_TIMEOUT;   s-	 TC   iUR	azt_e ad_couN@==0)l{ -		azt_y  pe = AZT_S_STOP; 
-		loop_ctl = 1;s-		bnuxk;           s-	 TC   } s-	      bnuxk;
-	    }s-    bnuxk;
+						priN@kn+						    ("AZT_S_DATA; ---I've read  ata- e ad_couN@: %d\n",n+						     azt_e ad_couN@);M+						priN@kn+						    ("azt_next_bn:%d  azt_buf_in:%d azt_buf_out:%d  azt_buf_bn:%d\n",n+						     azt_next_bn,n+						     azt_buf_in,n+						     azt_buf_out,n+						     azt_buf_bnn+						     [azt_buf_in]);np#)@ vN
+						azt_buf_bn[azt_buf_in]T=n+						    azt_next_bn++;o+						iUR	azt_buf_outT== -1)o+							azt_buf_outT=
+							    azt_buf_in; +						azt_buf_in =n+						    azt_buf_in + 1 ==n+						    AZT_BUF_SIZ ? 0 :n+						    azt_buf_in + 1;n+					}
+				}o+				iUR	!azt_transf_r_is_active) {s+					wh
 
 (CURRENT_VALID) {s+						azt_transf_r();M+						iUR	CURRENT->nr_sectors ==n+						    0)op							)@ _request(1);s+						)lseo+							bnuxk;
+					}
+				}s+ +				iUR	CURRENT_VALIDn+				    &&R(CURRENT->sector / 4 < azt_next_bn
+					|| CURRENT->sector / 4 >n+					azt_next_bn + AZT_BUF_SIZ))l{ +					azt_y  pe = AZT_S_STOP;
+					loop_ctl = 1;s+					bnuxk;
+				}s+				AztTimeout = READ_TIMEOUT;n+				iUR	azt_e ad_couN@ == 0)l{ +					azt_y  pe = AZT_S_STOP;
+					loop_ctl = 1;s+					bnuxk;
+				}s+				bnuxk;
+			}s+			bnuxk;
 s s-	case AZT_S_STOP:
+		case AZT_S_STOP:
 vmfzbH_AZT_TEST3
-	  iUR	azt_y  pe!=azt_y  pe_old)l{ -	    azt_y  pe_old=azt_y  pe;
-	    priN@k("AZT_S_STOP\n");n-	  }
-v)@ vNn-	 TifR	azt_e ad_couN@!=0) priN@k("aztcd:  iscand data=%x f ames\n",azt_e ad_couN@);M-	  wh
 
 (azt_e ad_couN@!=0)l{ -	    int i;
-	    ifR	 !(inb(STATUS_PORT)T& AFL_DATA) )l{ -	      iUR	azt_e ad_mode==AZT_MODE_2)s-	         G_SM(i=0; i<CD_FRAMESIZE_RAW; i++) inb(DATA_PORT);s-	 TC   else   
-	         G_SM(i=0; i<CD_FRAMESIZE; i++) inb(DATA_PORT);s-	 TC }s-	 TC azt_e ad_couN@--;
-	  }  n-	 TifR	aztS)ndCmd(ACMD_GET_STATUS)) RETURN("azt_poll 5");n-	  azt_y  pe = AZT_S_STOPPING;n-	  AztTimeout = 1000;
-	  bnuxk;
+			iUR	azt_y  pe != azt_y  pe_old)l{ +				azt_y  pe_old = azt_y  pe;n+				priN@k("AZT_S_STOP\n");n+			}n+v)@ vN
+			iUR	azt_e ad_couN@ != 0)op				priN@k("aztcd:  iscand data=%x f ames\n",n+				       azt_e ad_couN@);M+			wh
 
 (azt_e ad_couN@ != 0)l{ +				int i;n+				iUR	!(inb(STATUS_PORT)T& AFL_DATA)) {
+					iUR	azt_e ad_mode == AZT_MODE_2)o+						G_SM(i = 0;n+						     i < CD_FRAMESIZE_RAW;n+						     i++)n+							inb(DATA_PORT);s+					)lseo+						G_SM(i = 0;n+						     i < CD_FRAMESIZE; i++)n+							inb(DATA_PORT);s+				}s+				azt_e ad_couN@--;
+			}s+			iUR	aztS)ndCmd(ACMD_GET_STATUS))o+				RETURN("azt_poll 5");n+			azt_y  pe = AZT_S_STOPPING;n+			AztTimeout = 1000;
+			bnuxk;
 s-	case AZT_S_STOPPING:
+		case AZT_S_STOPPING:
 vmfzbH_AZT_TEST3
-	  iUR	azt_y  pe!=azt_y  pe_old)l{ -	    azt_y  pe_old=azt_y  pe;
-	    priN@k("AZT_S_STOPPING\n");n-	  }
-v)@ vNn-o-	  iUR	(stT= aztS  tus())T== -1 &&RAztTimeout)s-	    bnuxk;
-o-	  iUR	(stT!= -1) &&R((stT& AST_DSK_CHG)||	stT& AST_NOT_READY))) {
-	    aztDvskChanged = 1;n-	    aztTocUpToD
te = 0;o-	    azt_invalid p,_buff_rs();
-	    priN@k("aztcd: Dvsk Changed or Not Ready 4 - UnmouN@TDvsk!\n");n-	    )@ _request(0);n-	  }s-s+			iUR	azt_y  pe != azt_y  pe_old)l{ +				azt_y  pe_old = azt_y  pe;n+				priN@k("AZT_S_STOPPING\n");n+			}n+v)@ vN
+o+			iUR	(stT= aztS  tus())T== -1 &&RAztTimeout)s+				bnuxk;
+o+			iUR	(stT!= -1)o+			    &&R((stT& AST_DSK_CHG)n+				|| (stT& AST_NOT_READY))) {
+				aztDvskChanged = 1;n+				aztTocUpToD
te = 0;op				azt_invalid p,_buff_rs();
+				priN@kn+				    ("aztcd: Dvsk Changed or Not Ready 4 - UnmouN@TDvsk!\n");n+				en _request(0);n+			}s s vmfzbH_AZT_TEST3
-	  priN@k("CURRENT_VALIDT%d azt_mode %d\n",n-	     CURRENT_VALID, azt_mode);
+			priN@k("CURRENT_VALIDT%d azt_mode %d\n",n+			       CURRENT_VALID, azt_mode);
 v)@ vNn 
-	  iUR	CURRENT_VALID) {s-	    iUR	st != -1) {
-	      iUR	azt_mode == 1)l{ -		azt_y  pe = AZT_S_READ;n-		loop_ctl = 1;s-		skip = 1;s-		bnuxk;
-	      } )lse {n-		azt_y  pe = AZT_S_MODE;n-		loop_ctl = 1;s-		skip = 1;s-		bnuxk;
-	      }s-	 TC } )lse {s-	 TC   azt_y  pe = AZT_S_START;
-	      AztTimeout = 1;s-	 TC }s-	 T} )lse {n-	    azt_y  pe = AZT_S_IDLE;s-	    e unsi;
-	  }
-	  bnuxk;
+			iUR	CURRENT_VALID) {s+				iUR	st != -1) {
+					iUR	azt_mode == 1)l{ +						azt_y  pe = AZT_S_READ;n+						loop_ctl = 1;s+						skip = 1;sp						bnuxk;
+					} )lsel{ +						azt_y  pe = AZT_S_MODE;n+						loop_ctl = 1;s+						skip = 1;sp						bnuxk;
+					}s+				} )lsel{ +					azt_y  pe = AZT_S_START;
+					AztTimeout = 1;s+				}s+			} )lse {n+				azt_y  pe = AZT_S_IDLE;s+				e unsi;
+			}
+			bnuxk;
+o+		zbHault:
+			priN@k("aztcd: invalid y  pe %d\n", azt_y  pe);
+			e unsi;
+		}		/*Ccase */s+	}			/*Cwh
 
 */s s-	zbHault:
-	  priN@k("aztcd: invalid y  pe %d\n", azt_y  pe);
-	 Te unsi;
-      }  /*Ccase */s-    } /*Cwh
 
 */s-  n-s-   iUR	!AztTimeout--) 
-    { priN@k("aztcd: timeout in y  pe %d\n", azt_y  pe);
- TC   azt_y  pe = AZT_S_STOP;
-      iUR	aztS)ndCmd(ACMD_STOP)) RETURN("azt_poll 6"); s-      STEN_LOW_WAIT;     n-    };s s-  SET_TIMER(azt_poll, HZ/100);s+	iUR	!AztTimeout--) {
+		priN@k("aztcd: timeout in y  pe %d\n", azt_y  pe);
+		azt_y  pe = AZT_S_STOP;
+		iUR	aztS)ndCmd(ACMD_STOP))
+			RETURN("azt_poll 6");
+		STEN_LOW_WAIT;s+	};
+o+	SET_TIMER(azt_poll, HZ / 100);s }n s 
@@
n2253,28 +2461,34 y s   ###########################################################################s +/M y  pF TES < azt_hsg2msf(long hsg,      cCmsfC*msf)
-{       hsg += 150;o-	msfC-> min = hsg / 4500;
+{
+	hsg += 150;o+	msf->min = hsg / 4500;
 	hsg %= 4500;
-	msfC-> sec = hsg / 75;
-	msfC-> f ame = hsg % 75;
+	msf->sec = hsg / 75;
+	msf->f ame = hsg % 75;
 vmfzbH_AZT_DEBUGs-	iUR	msf->min  >=70) priN@k("aztcd: Error hsg2msf addrurc Minutes\n");n-	iUR	msf->sec  >=60) priN@k("aztcd: Error hsg2msf addrurc Seconds\n");n-	iUR	msf->f ame>=75) priN@k("aztcd: Error hsg2msf addrurc F ames\n");n-v)@ vNn-	azt_bin2bcd(&msfC-> min);           /*CconvercCto BCD */s-	azt_bin2bcd(&msfC-> sec);n-	azt_bin2bcd(&msfC-> f ame);np	iUR	msf->min >= 70)
+		priN@k("aztcd: Error hsg2msf addrurc Minutes\n");n+	iUR	msf->sec >= 60)
+		priN@k("aztcd: Error hsg2msf addrurc Seconds\n");n+	iUR	msf->f ame >= 75)
+		priN@k("aztcd: Error hsg2msf addrurc F ames\n");n+v)@ vN
+	azt_bin2bcd(&msf->min);	/* convercCto BCD */s+	azt_bin2bcd(&msf->sec);n+	azt_bin2bcd(&msf->f ame);n }n s y  pF Tlong azt_msf2hsg(     cCmsfC*mp)
-{ reunsi azt_bcd2bin(mpC-> f ame) + azt_bcd2bin(mpC-> sec) * 75o-		                  + azt_bcd2bin(mpC-> min) * 4500 - CD_MSF_OFFSET;
+{
+	reunsi azt_bcd2bin(mp->f ame) + azt_bcd2bin(mp->sec) * 75o+	    + azt_bcd2bin(mp->min) * 4500 - CD_MSF_OFFSET;
 }n s y  pF TES < azt_bin2bcd(unsigned char *p)
-{       int u, t;
+{
+	int u, t;
 M 	u = *p % 10;
 	t = *p / 10;
@@
n2282,5 +2496,9 y s }n s y  pF Tint azt_bcd2bin(unsigned char bcd)
-{       reunsi (bcd >> 4) * 10 + (bcd & 0xF);
+{
+	reunsi (bcd >> 4) * 10 + (bcd & 0xF);
 }s+ +MODULE_LICENSE("GPL");n+EXPORT_NO_SYMBOLS;
 vNf -u --recursive --new-f
 
 v2.4.9/linux/ rivers/cdrom/cdu31a. Tlinux/ rivers/cdrom/cdu31a. 
--- v2.4.9/linux/ rivers/cdrom/cdu31a. 	Fri Feb  9 11:30:22 2001
+++ linux/ rivers/cdrom/cdu31a. 	Fri Sep  7 09:28:38 2001
@@
n179,7 +179,7 y s #zbHine MAJOR_NR CDU31A_CDROM_MAJOR
 vmnclude <linux/blk.h>s s-#zbHine CDU31A_READAHEAD 4  /*C128 sector, 64kB, 32 e ads e ad-ahead */s+#zbHine CDU31A_READAHEAD 4	/*C128 sector, 64kB, 32 e ads e ad-ahead */s #zbHine CDU31A_MAX_CONSECUTIVE_ATTENTIONS 10s s vzbHine DEBUG 0
@@
n192,25 +192,12 y s +* DbHault is polled and no DMA.  DMA is not recomm)@ ed G_SMdouble-speeds +*  rives.s +/M-y  pF T     c
-{n-   unsigned short base;         /*CI/O Base Addrurc */s-   short          int_num;      /*CInterrupt Number (-1 means scan G_SMit,
-                                   0 means do*'t use) */s-} cdu31a_addrurces[] __init ata =
-{n-#iH_0	/*CNo autoconfig any more. See Note at beginniERs-	   of this f
 
. */s-   { 0x340,     0 },    /*CStandand configuratt * Sony Interface */s-   { 0x1f88,    0 },    /*CFust * CD-16 */s-   { 0x230,     0 },    /*CSouNdBlaster 16 cand */s-   { 0x360,     0 },    /*CSecondary standand Sony Interface */s-   { 0x320,     0 },    /*CSecondary standand Sony Interface */s-   { 0x330,     0 },    /*CSecondary standand Sony Interface */s-   { 0x634,     0 },    /*CSouNd FX SC400 */s-   { 0x654,     0 },    /*CSouNd FX SC400 */s-v)@ vNn-   { 0 }s+y  pF T     c {
+	unsigned short base;	/*CI/O Base Addrurc */s+	short int_num;		/*CInterrupt Number (-1 means scan G_SMit,
+				   0 means do*'t use) */s+} cdu31a_addrurces[] __init ata = {
+	{0}n };s s y  pF Tint handle_sony_cd_attentt *(ES <);
@@
n220,17 +207,16 y s /*y  pF Tint scd_open(     cCinode *inode,      cCf
 
 *f
 p);+/M y  pF Tint scd_open(     cCcdrom_device_info *,Tint);
 y  pF TES < do_sony_cd_cmd(unsigned char cmd,
-                           unsigned char *pa ams,
-                           unsigned int num_pa ams,
-                           unsigned char *e 8ult_buff_r,
-                           unsigned int *e 8ult_size);n-y  pF TES < size_to_buf(unsigned int size,
-                        unsigned char *buf);
+			   unsigned char *pa ams,
+			   unsigned int num_pa ams,
+			   unsigned char *e 8ult_buff_r,
+			   unsigned int *e 8ult_size);n+y  pF TES < size_to_buf(unsigned int size, unsigned char *buf);
 s /* Pa ameter8GG_SMthecread-ahead. +/M-y  pF Tunsigned int sony_next_block;      /*CNext 512 byte block offset +/M-y  pF Tunsigned int sony_blocks_lef@ = 0; /*CNumber of 512 byte blocks lef@
-                                             inMtheccurrent read command. +/M+y  pF Tunsigned int sony_next_block;	/*CNext 512 byte block offset +/M+y  pF Tunsigned int sony_blocks_lef@ = 0;	/*CNumber of 512 byte blocks lef@
+						   inMtheccurrent read command. +/M 
 s /* The baseCI/O addrurc of thecSony Interface.  This is a variab 
+(not a
@@
n252,48 +238,48 y s y  pF TESl pF 
+unsigned short sony_cd_fifost_reg;
 s s-y  pF Tint sony_spun_up = 0;               /*CHas thec rive been spun up? +/M+y  pF Tint sony_spun_up = 0;	/*CHas thec rive been spun up? +/M s-y  pF Tint sony_speed = 0;                 /* Last wanced speed +/M+y  pF Tint sony_speed = 0;	/* Last wanced speed +/M s-y  pF Tint sony_xa_mode = 0;               /*CIs an XA dvsk inMthec rive
-					 TC   aNd thec rive a CDU31A? +/M+y  pF Tint sony_xa_mode = 0;	/*CIs an XA dvsk inMthec rive
+				   aNd thec rive a CDU31A? +/M s-y  pF Tint sony_raw_ ata_mode = 1;         /*C1CiUR ata tracks, 0CiURaudio.
-                                              F_SMrawC ata e ads. +/M+y  pF Tint sony_raw_ ata_mode = 1;	/*C1CiUR ata tracks, 0CiURaudio.
+					   F_SMrawC ata e ads. +/M M-y  pF Tunsigned int sony_usage = 0;        /*CHow many procurces have the
-                                               rive open. +/M+y  pF Tunsigned int sony_usage = 0;	/*CHow many procurces have the
+					    rive open. +/M s-y  pF Tint sony_pas_init = 0;		   /*CInitialize thecPro-Audio
-					 TC   Spectrum cand? +/M+y  pF Tint sony_pas_init = 0;	/*CInitialize thecPro-Audio
+				   Spectrum cand? +/M M-y  pF T     c s_sony_cesst *_to T iERle_toc;  /*CHolds the
-					 TC      uab 
+of
-					 TC      contents. +/M+y  pF T     c s_sony_cesst *_to T iERle_toc;	/*CHolds the
+						   uab 
+of
+						   contents. +/M M-y  pF T     c s_all_cesst *s_to T ony_toc; /* entriesTgathered G0xmCall
-                                                sesst *s +/M+y  pF T     c s_all_cesst *s_to T ony_toc;	/* entriesTgathered G0xmCall
+						   sesst *s +/M s-y  pF Tint sony_toc_e ad = 0;		   /*CHas thecTOC been e ad G_S
-					 TC   thec rive? +/M+y  pF Tint sony_toc_e ad = 0;	/*CHas thecTOC been e ad G_S
+				   uhec rive? +/M M-y  pF T     c s_sony_cubcode last_sony_cubcode; /* PointsCto the last
-                                                   subcode addrurc read */s+y  pF T     c s_sony_cubcode last_sony_cubcode;	/* PointsCto the last
+						   subcode addrurc read */s n-y  pF TESl pF 
+int sony_inus_C= 0;  /*CIs thec rive inMus_?  Only one operatt *
-					a@Ta timeCallowed +/M+y  pF TESl pF 
+int sony_inus_C= 0;	/*CIs thec rive inMus_?  Only one operatt *
+					   a@Ta timeCallowed +/M s y  pF TDECLARE_WAIT_QUEUE_HEAD(sony_wait);	/* ThiERs waitiERcG_SMthec rive +/M M-y  pF T     c task_     c *has_cd_taskC= NULL;  /*CThe taskCtha@ is currentlys+y  pF T     c task_     c *has_cd_taskC= NULL;	/*CThe taskCtha@ is currentlys 						   usiERcthe CDROM  rive, _S
 						   NULLCiURnone. +/M s-y  pF Tint is_double_speed = 0; /* does thec rive support double speed ? +/M-y  pF Tint is_a_cdu31a = 1;     /*CIs thec rive a CDU31A? +/M+y  pF Tint is_double_speed = 0;	/* does thec rive support double speed ? +/M+y  pF Tint is_a_cdu31a = 1;	/*CIs thec rive a CDU31A? +/M s-y  pF Tint is_auto_eject = 1;   /* Door has been locked? 1=No/0=Yes +/M+y  pF Tint is_auto_eject = 1;	/* Door has been locked? 1=No/0=Yes +/M s /*
  * The audio y  pusMus_s thecvalu_s G0xmCread subchannelC ata as specified
@@
n319,7 +305,7 y s    interrupts. +/M DECLARE_WAIT_QUEUE_HEAD(cdu31a_irq_wait);M s-y  pF Tint curr_control_reg = 0; /* Current valu_ of theccontrol regtster +/M+y  pF Tint curr_control_reg = 0;	/* Current valu_ of theccontrol regtster +/M s /* A dvsk changed variab 
.  When a dvsk change is detected, it wills    all be set to TRUE.  As thecupper layer8GaskCG_SMdvsk_changed y  pus
@@
n348,25 +334,23 y s  * This routine reunsisC1CiURthec vsk has been changed yince the last
  * check or 0CiURit hasn't.
  */M-y  pF TintM-ycd_dvsk_change(kdev_t full_dev)M+y  pF Tint scd_dvsk_change(kdev_t full_dev)M {
-   int retval;n+	int retval;n n-   retval = dvsk_changed;
-   dvsk_changed = 0;op	retval = dvsk_changed;
+	dvsk_changed = 0;o n-   retnsi retval;n+	retnsi retval;n }n s /*
  * UniformCcdrom interface functt *
  * report back,CiUR isc has changed G0xmCtimeCof last request.
  */M-y  pF TintM-ycd_medi _changed(     cCcdrom_device_info *cdi,TintR isc_nr)M+y  pF Tint scd_medi _changed(     cCcdrom_device_info *cdi,TintR isc_nr)M {
-  retnsi scd_dvsk_change(cdi->dev);n+	retnsi scd_dvsk_change(cdi->dev);n }n s /*
@@
n375,56 +359,51 y s  */M y  pF Tint scd_ rive_y  pus(     cCcdrom_device_info *cdi,TintRslot_nr)M {
-  iUR	CDSL_CURRENT !=Rslot_nr) {
-     /*Cwe have no changer support */s-     retnsi -EINVAL;
-  }
-  iUR	scd_spinup() == 0)l{ -         sony_spun_up = 1;
-  }
-  retnsi sony_spun_up ? CDS_DISC_OK : CDS_DRIVE_NOT_READY;n-}n-s-y  pF Tinline ES <
-enab 
_interrupts(ES <)n-{n-   curr_control_reg |= (  SONY_ATTN_INT_EN_BIT
-                        | SONY_RES_RDY_INT_EN_BIT
-                        | SONY_DATA_RDY_INT_EN_BIT);
- TCoutb(curr_control_reg, sony_cd_control_reg);n-}n-s-y  pF Tinline ES <
-dvsab 
_interrupts(ES <)n-{n-   curr_control_reg &= ~(  SONY_ATTN_INT_EN_BIT
-                         | SONY_RES_RDY_INT_EN_BIT
-                         | SONY_DATA_RDY_INT_EN_BIT);
- TCoutb(curr_control_reg, sony_cd_control_reg);n+	iUR	CDSL_CURRENT !=Rslot_nr) {
+		/*Cwe have no changer support */s+		e unsi -EINVAL;
+	}op	iUR	scd_spinup() == 0)l{ +		sony_spun_up = 1;
+	}op	retnsi sony_spun_up ? CDS_DISC_OK : CDS_DRIVE_NOT_READY;n+}s+ +y  pF Tinline ES < enab 
_interrupts(ES <)n+{
+	curr_control_reg |= (SONY_ATTN_INT_EN_BIT
+			     | SONY_RES_RDY_INT_EN_BIT
+			     | SONY_DATA_RDY_INT_EN_BIT);
+	outb(curr_control_reg, sony_cd_control_reg);n+}s+ +y  pF Tinline ES < dvsab 
_interrupts(ES <)n+{
+	curr_control_reg &= ~(SONY_ATTN_INT_EN_BIT
+			      | SONY_RES_RDY_INT_EN_BIT
+			      | SONY_DATA_RDY_INT_EN_BIT);
+	outb(curr_control_reg, sony_cd_control_reg);n }n s /*
  * Wai@Ta little wh
 
 (us_d G_SMpolliERcthe  rive).  If inMinitializatt *,
  * settiERca timeout does*'t work, so just loop G_SMa wh
 
.
  */M-y  pF Tinline ES <
-sony_sleep(ES <)n+y  pF Tinline ES < sony_sleep(ES <)n {n-   unsigned long flags;
+	unsigned long flags;
 s-   iUR	cdu31a_irq <= 0)o-   {
-      current->y  pe = TASK_INTERRUPTIBLE;s-      schedule_timeout(0);n-   }s-   )lse /* Interrupt  riven */s-   {s-      save_flags(flags);
- TC   cli();
- TC   enab 
_interrupts();
- TC   interruptible_sleep_on(&cdu31a_irq_wait);M-      restore_flags(flags);
- TC}op	iUR	cdu31a_irq <= 0)l{ +		current->y  pe = TASK_INTERRUPTIBLE;s+		schedule_timeout(0);n+	} )lse {		/*CInterrupt  riven */s+o+		save_flags(flags);
+		cli();
+		enab 
_interrupts();
+		interruptible_sleep_on(&cdu31a_irq_wait);M+		e store_flags(flags);
+	}o }n s 
@@
n432,272 +411,276 y s  * The followiERcare convenience routine to read variousMy  pusMaNd sets  * variousMconditt *s inMthec rive.
  */M-y  pF Tinline intM-is_attentt *(ES <)n+y  pF Tinline int is_attentt *(ES <)n {s-   retnsi((inb(sony_cd_y  pus_reg) & SONY_ATTN_BIT) != 0);n+	retnsi ((inb(sony_cd_y  pus_reg) & SONY_ATTN_BIT) != 0);n }n s-y  pF Tinline intM-is_busy(ES <)n+y  pF Tinline int is_busy(ES <)n {s-   retnsi((inb(sony_cd_y  pus_reg) & SONY_BUSY_BIT) != 0);n+	retnsi ((inb(sony_cd_y  pus_reg) & SONY_BUSY_BIT) != 0);n }n s-y  pF Tinline intM-is_ ata_ready(ES <)n+y  pF Tinline int is_ ata_ready(ES <)n {s-   retnsi((inb(sony_cd_y  pus_reg) & SONY_DATA_RDY_BIT) != 0);n+	retnsi ((inb(sony_cd_y  pus_reg) & SONY_DATA_RDY_BIT) != 0);n }n s-y  pF Tinline intM-is_ ata_requested(ES <)n+y  pF Tinline int is_ ata_requested(ES <)n {s-   retnsi((inb(sony_cd_y  pus_reg) & SONY_DATA_REQUEST_BIT) != 0);n+	retnsi ((inb(sony_cd_y  pus_reg) & SONY_DATA_REQUEST_BIT) != 0);n }n s-y  pF Tinline intM-is_e 8ult_ready(ES <)n+y  pF Tinline int is_e 8ult_ready(ES <)n {s-   retnsi((inb(sony_cd_y  pus_reg) & SONY_RES_RDY_BIT) != 0);n+	retnsi ((inb(sony_cd_y  pus_reg) & SONY_RES_RDY_BIT) != 0);n }n s-y  pF Tinline intM-is_pa am_write_rdy(ES <)n+y  pF Tinline int is_pa am_write_rdy(ES <)n {s-   retnsi((inb(sony_cd_fifost_reg) & SONY_PARAM_WRITE_RDY_BIT) != 0);n+	retnsi ((inb(sony_cd_fifost_reg) & SONY_PARAM_WRITE_RDY_BIT) != 0);n }n s-y  pF Tinline intM-is_e 8ult_reg_not_empty(ES <)n+y  pF Tinline int is_e 8ult_reg_not_empty(ES <)n {s-   retnsi((inb(sony_cd_fifost_reg) & SONY_RES_REG_NOT_EMP_BIT) != 0);n+	retnsi ((inb(sony_cd_fifost_reg) & SONY_RES_REG_NOT_EMP_BIT) != 0);n }n s-y  pF Tinline ES <
-e 8et_ rive(ES <)n+y  pF Tinline ES < e 8et_ rive(ES <)n {n-   curr_control_reg = 0;o-   readahead_ atalef@ = 0;s-   sony_toc_e ad = 0;
- TCoutb(SONY_DRIVE_RESET_BIT, sony_cd_control_reg);n+	curr_control_reg = 0;o+	readahead_ atalef@ = 0;s+	sony_toc_e ad = 0;
+	outb(SONY_DRIVE_RESET_BIT, sony_cd_control_reg);n }n s /*
  * UniformCcdrom interface functt *
  * reset  rive and retnsi when i@ is ready
  */M-y  pF Tint scd_reset(     cCcdrom_device_info *Ccdi)M+y  pF Tint scd_reset(     cCcdrom_device_info *cdi)M {
-  int retry_couN@;n+	int retry_couN@;n 
-  re8et_ rive();n+	re8et_ rive();n 
-  retry_couN@ = jiffiesT+ SONY_RESET_TIMEOUT;n-  wh
 
 (time_before(jiffies, retry_couN@) &&R(!is_attentt *()))o-  {s-     sony_sleep();
-  }
+	retry_couN@ = jiffiesT+ SONY_RESET_TIMEOUT;n+	wh
 
 (time_before(jiffies, retry_couN@) &&R(!is_attentt *()))l{ +		sony_sleep();
+	}s 
-  retnsi 0;n+	retnsi 0;n }n s-y  pF Tinline ES <
-clear_attentt *(ES <)n+y  pF Tinline ES < clear_attentt *(ES <)n {s-   outb(curr_control_reg | SONY_ATTN_CLR_BIT, sony_cd_control_reg);n+	outb(curr_control_reg | SONY_ATTN_CLR_BIT, sony_cd_control_reg);n }n s-y  pF Tinline ES <
-clear_e 8ult_ready(ES <)n+y  pF Tinline ES < clear_e 8ult_ready(ES <)n {s-   outb(curr_control_reg | SONY_RES_RDY_CLR_BIT, sony_cd_control_reg);n+	outb(curr_control_reg | SONY_RES_RDY_CLR_BIT, sony_cd_control_reg);n }n s-y  pF Tinline ES <
-clear_ ata_ready(ES <)n+y  pF Tinline ES < clear_ ata_ready(ES <)n {s-   outb(curr_control_reg | SONY_DATA_RDY_CLR_BIT, sony_cd_control_reg);n+	outb(curr_control_reg | SONY_DATA_RDY_CLR_BIT,o+	     sony_cd_control_reg);n }n s-y  pF Tinline ES <
-clear_pa am_reg(ES <)n+y  pF Tinline ES < clear_pa am_reg(ES <)n {s-   outb(curr_control_reg | SONY_PARAM_CLR_BIT, sony_cd_control_reg);n+	outb(curr_control_reg | SONY_PARAM_CLR_BIT, sony_cd_control_reg);n }n s-y  pF Tinline unsigned char
-read_y  pus_regtster(ES <)n+y  pF Tinline unsigned char read_y  pus_regtster(ES <)n {s-   retnsi(inb(sony_cd_y  pus_reg));n+	retnsi (inb(sony_cd_y  pus_reg));n }n s-y  pF Tinline unsigned char
-read_e 8ult_regtster(ES <)n+y  pF Tinline unsigned char read_e 8ult_regtster(ES <)n {s-   retnsi(inb(sony_cd_e 8ult_reg));n+	retnsi (inb(sony_cd_e 8ult_reg));n }n s-y  pF Tinline unsigned char
-read_ ata_regtster(ES <)n+y  pF Tinline unsigned char read_ ata_regtster(ES <)n {s-   retnsi(inb(sony_cd_e ad_e g));n+	retnsi (inb(sony_cd_e ad_e g));n }n s-y  pF Tinline ES <
-write_pa am(unsigned char pa am)n+y  pF Tinline ES < write_pa am(unsigned char pa am)n {s-   outb(pa am, sony_cd_pa am_reg);n+	outb(pa am, sony_cd_pa am_reg);n }n s-y  pF Tinline ES <
-write_cmd(unsigned char cmd)n+y  pF Tinline ES < write_cmd(unsigned char cmd)n {s-   outb(curr_control_reg | SONY_RES_RDY_INT_EN_BIT, sony_cd_control_reg);n-   outb(cmd, sony_cd_cmd_reg);n+	outb(curr_control_reg | SONY_RES_RDY_INT_EN_BIT,o+	     sony_cd_control_reg);n+	outb(cmd, sony_cd_cmd_reg);n }n s-y  pF TES <
-cdu31a_interrupt(int irq, ES < *dev_id,      cCpt_regs *e gs)n+y  pF TES < cdu31a_interrupt(int irq, ES < *dev_id,      cCpt_regs *e gs)n {n-   unsigned char val;n+	unsigned char val;n+op	iUR	abort_e ad_8  rted) {
+		/*CWe might be waitiERcG_SMan abort to finish.  Do*'t
+		   dvsab 
+interrupts yet, though, becaus_Cwe handle
+		   this one here. */s+		/* Clearcout thecre8ult regtsters. */s+		wh
 
 (is_e 8ult_reg_not_empty()) {
+			val = read_e 8ult_regtster();M+		}
+		clear_ ata_ready();
+		clear_e 8ult_ready();
 s-   iUR	abort_e ad_8  rted)s-   {s-      /*CWe might be waitiERcG_SMan abort to finish.  Do*'t
-         dvsab 
+interrupts yet, though, becaus_Cwe handle
-         this one here. */s-      /*CClearcout thecre8ult regtsters. */s-      wh
 
 (is_e 8ult_reg_not_empty())s-      { -         val = read_e 8ult_regtster();M-      }s-      clear_ ata_ready();
-      clear_e 8ult_ready();
-s-      /*CClearcout thec ata */s-      wh
 
 (is_ ata_requested())s-      { -         val = read_ ata_regtster();M-      }s-      abort_e ad_8  rted = 0;
-s-      /*CIf somethiER was waitiER, wake i@ up now. */s-      iUR	waitqueue_active(&cdu31a_irq_wait))s-      { -         dvsab 
_interrupts();
-         wake_up(&cdu31a_irq_wait);M-      }n-   }s-   )lse iUR	waitqueue_active(&cdu31a_irq_wait))s-   { -      dvsab 
_interrupts();
-      wake_up(&cdu31a_irq_wait);M-   }s-   )lses-   { -      dvsab 
_interrupts();
-      priN@k("CDU31A: Got an+interrupt but nothiER was waitiER\n");n-   }
+		/*CClearcout thec ata */s+		wh
 
 (is_ ata_requested()) {
+			val = read_ ata_regtster();M+		}
+		abort_e ad_8  rted = 0;
+
+		/*CIf somethiER was waitiER, wake i@ up now. */s+		iUR	waitqueue_active(&cdu31a_irq_wait)) {
+			dvsab 
_interrupts();
+			wake_up(&cdu31a_irq_wait);M+		}
+	} )lse iUR	waitqueue_active(&cdu31a_irq_wait)) {
+		dvsab 
_interrupts();
+		wake_up(&cdu31a_irq_wait);M+	} )lse {n+		dvsab 
_interrupts();
+		priN@kn+		    ("CDU31A: Got an+interrupt but nothiER was waitiER\n");n+	}o }n s /*
  * give morecv_rbose error messages
  */M-y  pF Tunsigned char *transl p,_error(Tunsigned char err_code )M+y  pF Tunsigned char *transl p,_error(unsigned char err_code)n {n-   y  pF Tunsigned char errbuf[80];s+	s  pF Tunsigned char errbuf[80];s s-   switch 	err_code) { -     case 0x10: retnsi "illegal command "; -     case 0x11: retnsi "illegal pa ameter "; - -     case 0x20: retnsi "not loa ed "; -     case 0x21: retnsi "noR isc "; -     case 0x22: retnsi "not spinniERc"; -     case 0x23: retnsi "spinniERc"; -     case 0x25: retnsi "spindle servoc"; -     case 0x26: retnsi "focusMyervoc"; -     case 0x29: retnsi "eject mechanismc"; -     case 0x2a: retnsi "audio playiERc"; -     case 0x2c: retnsi "emergency eject "; - -     case 0x30: retnsi "focusM"; -     case 0x31: retnsi "f ame sync "; -     case 0x32: retnsi "subcode addrurc "; -     case 0x33: retnsi "block sync "; -     case 0x34: retnsi "header addrurc "; - -     case 0x40: retnsi "illegal trackRe ad "; -     case 0x41: retnsi "mode 0Re ad "; -     case 0x42: retnsi "illegal mode e ad "; -     case 0x43: retnsi "illegal block size e ad "; -     case 0x44: retnsi "mode e ad "; -     case 0x45: retnsi "form e ad "; -     case 0x46: retnsi "leadout e ad "; -     case 0x47: retnsi "buff_r overrun "; - -     case 0x53: retnsi "unrecoverab 
+CIRC "; -     case 0x57: retnsi "unrecoverab 
+LECC "; - -     case 0x60: retnsi "nocTOC "; -     case 0x61: retnsi "invalid yubcode  ata "; -     case 0x63: retnsi "focusMoncTOC e ad "; -     case 0x64: retnsi "f ame sync oncTOC e ad "; -     case 0x65: retnsi "TOC  ata "; - -     case 0x70: retnsi "hardware failure "; -     case 0x91: retnsi "leadin "; -     case 0x92: retnsi "leadout "; -     case 0x93: retnsi " ata track "; -   }s-   spriN@f(errbuf, "unknown 0x%02x ", err_code);n-   retnsi errbuf;s+	switch 	err_code) { +	case 0x10:s+		e unsi "illegal command "; +	case 0x11:s+		e unsi "illegal pa ameter "; + +	case 0x20:s+		e unsi "not loa ed "; +	case 0x21:s+		e unsi "noR isc "; +	case 0x22:s+		e unsi "not spinniERc"; +	case 0x23:s+		e unsi "spinniERc"; +	case 0x25:s+		e unsi "spindle servoc"; +	case 0x26:s+		e unsi "focusMyervoc"; +	case 0x29:s+		e unsi "eject mechanismc"; +	case 0x2a:s+		e unsi "audio playiERc"; +	case 0x2c:s+		e unsi "emergency eject "; + +	case 0x30:s+		e unsi "focusM"; +	case 0x31:s+		e unsi "f ame sync "; +	case 0x32:s+		e unsi "subcode addrurc "; +	case 0x33:s+		e unsi "block sync "; +	case 0x34:s+		e unsi "header addrurc "; + +	case 0x40:s+		e unsi "illegal trackRe ad "; +	case 0x41:s+		e unsi "mode 0Re ad "; +	case 0x42:s+		e unsi "illegal mode e ad "; +	case 0x43:s+		e unsi "illegal block size e ad "; +	case 0x44:s+		e unsi "mode e ad "; +	case 0x45:s+		e unsi "form e ad "; +	case 0x46:s+		e unsi "leadout e ad "; +	case 0x47:s+		e unsi "buff_r overrun "; + +	case 0x53:s+		e unsi "unrecoverab 
+CIRC "; +	case 0x57:s+		e unsi "unrecoverab 
+LECC "; + +	case 0x60:s+		e unsi "nocTOC "; +	case 0x61:s+		e unsi "invalid yubcode  ata "; +	case 0x63:s+		e unsi "focusMoncTOC e ad "; +	case 0x64:s+		e unsi "f ame sync oncTOC e ad "; +	case 0x65:s+		e unsi "TOC  ata "; + +	case 0x70:s+		e unsi "hardware failure "; +	case 0x91:s+		e unsi "leadin "; +	case 0x92:s+		e unsi "leadout "; +	case 0x93:s+		e unsi " ata track "; +	}op	spriN@f(errbuf, "unknown 0x%02x ", err_code);n+	retnsi errbuf;s }n s /*
  * Set thec rive pa ameter8Gso thec rive will auto-spin-up when a
  * dvsk is inyerted.
  */M-y  pF TES <
-set_ rive_pa ams(int wanc_doublespeed)n+y  pF TES < set_ rive_pa ams(int wanc_doublespeed)n {n-   unsigned char rur_reg[12];n-   unsigned int res_size;n-   unsigned char pa ams[3]; - -n-   pa ams[0]T= SONY_SD_AUTO_SPIN_DOWN_TIME;n-   pa ams[1]T= 0x00; /*CNever spin down thec rive. */s-   do_sony_cd_cmd(SONY_SET_DRIVE_PARAM_CMD,
-                  pa ams,
-                  2,
-                  rur_reg,
-                  &res_size);n-   iUR	(res_size < 2) || ((rur_reg[0]T& 0xf0) == 0x20))s-   { -      priN@k("  Unab 
 to set spin-down time: 0x%2.2x\n", rur_reg[1]);M-   }s-n-   pa ams[0]T= SONY_SD_MECH_CONTROL;n-   pa ams[1]T= SONY_AUTO_SPIN_UP_BIT; /*CSet auto spin up */s-s-   iUR	is_auto_eject) pa ams[1]T|= SONY_AUTO_EJECT_BIT;n-   s-   iUR	is_double_speed && wanc_doublespeed)n-   { -      pa ams[1]T|= SONY_DOUBLE_SPEED_BIT; /*CSet thec rive to double speed iUR
-                                             possible */s-   }s-   do_sony_cd_cmd(SONY_SET_DRIVE_PARAM_CMD,
-                  pa ams,
-                  2,
-                  rur_reg,
-                  &res_size);n-   iUR	(res_size < 2) || ((rur_reg[0]T& 0xf0) == 0x20))s-   { -      priN@k("  Unab 
 to set mechanical pa ameters: 0x%2.2x\n", rur_reg[1]);M-   }s+	unsigned char rur_reg[12];n+	unsigned int res_size;n+	unsigned char pa ams[3]; + + +	pa ams[0]T= SONY_SD_AUTO_SPIN_DOWN_TIME;n+	pa ams[1]T= 0x00;	/*CNever spin down thec rive. */s+	do_sony_cd_cmd(SONY_SET_DRIVE_PARAM_CMD,
+		 TC    pa ams, 2, rur_reg, &res_size);np	iUR	(res_size < 2) || ((rur_reg[0]T& 0xf0) == 0x20)) {
+		priN@k("  Unab 
 to set spin-down time: 0x%2.2x\n",
+		 TC    rur_reg[1]);M+	}s+ +	pa ams[0]T= SONY_SD_MECH_CONTROL;n+	pa ams[1]T= SONY_AUTO_SPIN_UP_BIT;	/*CSet auto spin up */s+op	iUR	is_auto_eject)
+		pa ams[1]T|= SONY_AUTO_EJECT_BIT;n+op	iUR	is_double_speed && wanc_doublespeed) {
+		pa ams[1]T|= SONY_DOUBLE_SPEED_BIT;	/*CSet thec rive to double speed iUR
+							   possible */s+	}op	do_sony_cd_cmd(SONY_SET_DRIVE_PARAM_CMD,
+		 TC    pa ams, 2, rur_reg, &res_size);np	iUR	(res_size < 2) || ((rur_reg[0]T& 0xf0) == 0x20)) {
+		priN@k("  Unab 
 to set mechanical pa ameters: 0x%2.2x\n",
+		 TC    rur_reg[1]);M+	}s }n s /*
@@
n706,13 +689,13 y s  */M y  pF Tint scd_select_speed(     cCcdrom_device_info *cdi,TintRspeed)n {n-  iUR	speed == 0)o-    sony_speed = 1;
-  )lse o-    sony_speed = speed - 1;
+	iUR	speed == 0)o+		sony_speed = 1;n+	)lseo+		sony_speed = speed - 1;
 o-  set_ rive_pa ams(sony_speed);M-  retnsi 0;n+	set_ rive_pa ams(sony_speed);M+	retnsi 0;n }n s /*
@@
n721,77 +704,69 y s  */M y  pF Tint scd_lock_door(     cCcdrom_device_info *cdi,TintRlock)M {
-   iUR	lock == 0 && sony_usage == 1)s-   {s-      /*CUnlock thec oor, only iURnobody is usiERcthe  rive +/M-      is_auto_eject = 1;M-   } )lse {n-      is_auto_eject = 0; -   }s-   set_ rive_pa ams(sony_speed);M-   retnsi 0;n+	iUR	lock == 0 && sony_usage == 1) {
+		/*CUnlock thec oor, only iURnobody is usiERcthe  rive +/M+		is_auto_eject = 1;M+	} )lse {n+		is_auto_eject = 0; +	}op	set_ rive_pa ams(sony_speed);M+	retnsi 0;n }n s /*
  * This code will reset thec rive and attempt to restore sane pa ameter8.
  */M-y  pF TES <
-restart_on_error(ES <)n+y  pF TES < e 8tart_on_error(ES <)n {n-   unsigned char rur_reg[12];n-   unsigned int res_size;n-   unsigned int retry_couN@;n- -n-   priN@k("cdu31a: ResettiERc rive on error\n");n-   re8et_ rive();n-   retry_couN@ = jiffiesT+ SONY_RESET_TIMEOUT;n-   wh
 
 (time_before(jiffies, retry_couN@) &&R(!is_attentt *()))o-   {s-      sony_sleep();
-   }s-   set_ rive_pa ams(sony_speed);M-   do_sony_cd_cmd(SONY_SPIN_UP_CMD, NULL, 0, rur_reg, &res_size);n-   iUR	(res_size < 2) || ((rur_reg[0]T& 0xf0) == 0x20))s-   { -      priN@k("cdu31a: Unab 
 to spin up  rive: 0x%2.2x\n", rur_reg[1]);M-   }s+	unsigned char rur_reg[12];n+	unsigned int res_size;n+	unsigned int retry_couN@;n+s+ +	priN@k("cdu31a: ResettiERc rive on error\n");n+	re8et_ rive();n+	retry_couN@ = jiffiesT+ SONY_RESET_TIMEOUT;n+	wh
 
 (time_before(jiffies, retry_couN@) &&R(!is_attentt *()))l{ +		sony_sleep();
+	}sp	set_ rive_pa ams(sony_speed);M+	do_sony_cd_cmd(SONY_SPIN_UP_CMD, NULL, 0, rur_reg, &res_size);np	iUR	(res_size < 2) || ((rur_reg[0]T& 0xf0) == 0x20)) {
+		priN@k("cdu31a: Unab 
 to spin up  rive: 0x%2.2x\n",
+		 TC    rur_reg[1]);M+	}s n-   current->y  pe = TASK_INTERRUPTIBLE;s-   schedule_timeout(2*HZ);n+	current->y  pe = TASK_INTERRUPTIBLE;s+	schedule_timeout(2 * HZ);n s-   sony_get_toc();
+	sony_get_toc();
 }n s /*
  * This routine writesR ata to thecpa ameter regtster.  Since this should
  * happen fairly fast, i@ is polled with no OS waits between.
  */M-y  pF TintM-write_pa ams(unsigned char *pa ams,
-             int num_pa ams)M+y  pF Tint write_pa ams(unsigned char *pa ams, int num_pa ams)M {n-   unsigned int retry_couN@;n+	unsigned int retry_couN@;n o n-   retry_couN@ = SONY_READY_RETRIES;n-   wh
 
 ((retry_couN@ > 0)l&&R(!is_pa am_write_rdy()))o-   {s-      retry_couN@--;
-   }s-   iUR	!is_pa am_write_rdy())o-   {s-      retnsi -EIO;M-   }s-n-   wh
 
 (num_pa ams > 0)o-   {s-      write_pa am(*pa ams);
-      pa ams++;o-      num_pa ams--;
-   }s+	retry_couN@ = SONY_READY_RETRIES;n+	wh
 
 ((retry_couN@ > 0)l&&R(!is_pa am_write_rdy())) {
+		retry_couN@--;
+	}op	iUR	!is_pa am_write_rdy()) {
+		retnsi -EIO;M+	}s+ +	wh
 
 (num_pa ams > 0) {
+		write_pa am(*pa ams);
+		pa ams++;o+		num_pa ams--;
+	}s n-   retnsi 0;n+	retnsi 0;n }n s 
@@
n802,134 +777,125 y s  * thec rive manual.s  */M y  pF TES <
-get_e 8ult(unsigned char *e 8ult_buff_r,
-           unsigned int *e 8ult_size)
+get_e 8ult(unsigned char *e 8ult_buff_r, unsigned int *e 8ult_size)
 {n-   unsigned char a, b;
-   int i;n-   unsigned int retry_couN@;n- -n-   wh
 
 (handle_sony_cd_attentt *())s-      ;n-   /* Wai@TG_SMthecre8ult  ata to be e ady +/M-   retry_couN@ = jiffiesT+ SONY_JIFFIES_TIMEOUT;n-   wh
 
 (time_before(jiffies, retry_couN@) &&R(is_busy() || (!(is_e 8ult_ready()))))o-   {s-      sony_sleep();
-s-      wh
 
 (handle_sony_cd_attentt *())s-         ;n-   }s-   iUR	is_busy() || (!(is_e 8ult_ready())))o-   {s-#iH_DEBUGs-      priN@k("CDU31A timeout out %d\n", __LINE__);n-v)@ vNn-TC    rurult_buff_r[0]T= 0x20;n-TC    rurult_buff_r[1]T= SONY_TIMEOUT_OP_ERR;n-TC    *e 8ult_sizeT= 2;s-      retnsi;M-   }s-n-   /*
-    * Get thecfirst two bytes.  This determines what )lse needs
-    * to be done.
-    */M-   clear_e 8ult_ready();
-   a = read_e 8ult_regtster();M-   *e 8ult_buff_rT= a;n-   re8ult_buff_r++;o-n-   /* Check G_SMblock error y  pusMre8ult. */s-   iUR	(aT& 0xf0) == 0x50)o-   {s-      *e 8ult_sizeT= 1;s-      retnsi;M-   }s-n-   b = read_e 8ult_regtster();M-   *e 8ult_buff_rT= b;n-   re8ult_buff_r++;o-   *e 8ult_sizeT= 2;s-n-   /*
-    * 0x20 means an error occurred.  Byte 2 will have the error code.
-    * Otherwise, theccommand succeeded, byte 2 will have the couN@ of
-    * how many morecy  pusMbytescare coming.
-    *
-    * Thecre8ult regtster can be e ad 10 bytesca@Ta time,Ma wai@TG_S
-    * re8ult ready to be asyerted must be done between every 10 bytes.
-    */M-   iUR	(aT& 0xf0) != 0x20)o-   {s-      iUR	b > 8)s-      { -         G_SM(i=0; i<8; i++)n-         {
-            *e 8ult_buff_rT= read_e 8ult_regtster();M-      TC    rurult_buff_r++;o-            (*e 8ult_size)++;o-         }o-         b = b - 8;
-s-         wh
 
 (b > 10)n-         {
-            retry_couN@ = SONY_READY_RETRIES;n-            wh
 
 ((retry_couN@ > 0)l&&R(!is_e 8ult_ready()))n-            {
-               retry_couN@--;
-            }o-            iUR	!is_e 8ult_ready())n-            {
-#iH_DEBUGs-               priN@k("CDU31A timeout out %d\n", __LINE__);n-v)@ vNn-TC       TC    rurult_buff_r[0]T= 0x20;n-TC       TC    rurult_buff_r[1]T= SONY_TIMEOUT_OP_ERR;n-TC             *e 8ult_sizeT= 2;s-               retnsi;
-            }o-
-            clear_e 8ult_ready();
-                                
-            G_SM(i=0; i<10; i++)n-            {
-               *e 8ult_buff_rT= read_e 8ult_regtster();M-      TC       rurult_buff_r++;o-               (*e 8ult_size)++;o-            }o-            b = b - 10;o-         }o-o-         iUR	b > 0)n-         {
-            retry_couN@ = SONY_READY_RETRIES;n-            wh
 
 ((retry_couN@ > 0)l&&R(!is_e 8ult_ready()))n-            {
-               retry_couN@--;
-            }o-            iUR	!is_e 8ult_ready())n-            {
-#iH_DEBUGs-               priN@k("CDU31A timeout out %d\n", __LINE__);n-v)@ vNn-TC       TC    rurult_buff_r[0]T= 0x20;n-TC       TC    rurult_buff_r[1]T= SONY_TIMEOUT_OP_ERR;n-TC             *e 8ult_sizeT= 2;s-               retnsi;
-            }o-         }o-      }
-s-      wh
 
 (b > 0)n-      {
-         *e 8ult_buff_rT= read_e 8ult_regtster();M-      TC rurult_buff_r++;o-         (*e 8ult_size)++;o-         b--;
-      }M-   }s+	unsigned char a, b;
+	int i;n+	unsigned int retry_couN@;n+s+ +	wh
 
 (handle_sony_cd_attentt *());n+	/* Wai@TG_SMthecre8ult  ata to be e ady +/M+	retry_couN@ = jiffiesT+ SONY_JIFFIES_TIMEOUT;n+	wh
 
 (time_before(jiffies, retry_couN@)o+	       &&R(is_busy() || (!(is_e 8ult_ready()))))l{ +		sony_sleep();
+s+		wh
 
 (handle_sony_cd_attentt *());n+	}op	iUR	is_busy() || (!(is_e 8ult_ready())))l{ +#iH_DEBUGs+		priN@k("CDU31A timeout out %d\n", __LINE__);n+v)@ vN
+		rurult_buff_r[0]T= 0x20;n+		rurult_buff_r[1]T= SONY_TIMEOUT_OP_ERR;n+		*e 8ult_sizeT= 2;s+		e unsi;
+	}s+ +	/*
+	 * Get thecfirst two bytes.  This determines what )lse needs
+	 * to be done.
+	 */M+	clear_e 8ult_ready();
+	a = read_e 8ult_regtster();M+	*e 8ult_buff_rT= a;n+	rurult_buff_r++;o+ +	/* Check G_SMblock error y  pusMre8ult. */sp	iUR	(aT& 0xf0) == 0x50)l{ +		*e 8ult_sizeT= 1;s+		e unsi;
+	}s+ +	b = read_e 8ult_regtster();M+	*e 8ult_buff_rT= b;n+	rurult_buff_r++;o+	*e 8ult_sizeT= 2;s+ +	/*
+	 * 0x20 means an error occurred.  Byte 2 will have the error code.
+	 * Otherwise, theccommand succeeded, byte 2 will have the couN@ of
+	 * how many morecy  pusMbytescare coming.
+	 *
+	 * Thecre8ult regtster can be e ad 10 bytesca@Ta time,Ma wai@TG_S
+	 * re8ult ready to be asyerted must be done between every 10 bytes.
+	 */M+	iUR	(aT& 0xf0) != 0x20) {n+		iUR	b > 8) {
+			G_SM(i = 0; i < 8; i++) {n+				*e 8ult_buff_rT= read_e 8ult_regtster();M+				e rult_buff_r++;o+				(*e 8ult_size)++;o+			}
+			b = b - 8;
+
+			wh
 
 (b > 10) {n+				retry_couN@ = SONY_READY_RETRIES;n+				wh
 
 ((retry_couN@ > 0)
+				       &&R(!is_e 8ult_ready())) {n+					retry_couN@--;
+				}
+				iUR	!is_e 8ult_ready())l{ +#iH_DEBUGs+					priN@k("CDU31A timeout out %d\n",
+					       __LINE__);n+v)@ vN
+					rurult_buff_r[0]T= 0x20;n+					rurult_buff_r[1]T=
+					    SONY_TIMEOUT_OP_ERR;n+					*e 8ult_sizeT= 2;s+					e unsi;
+				}
+
+				clear_e 8ult_ready();
+
+				G_SM(i = 0; i < 10; i++) {n+					*e 8ult_buff_rT=
+					    read_e 8ult_regtster();M+					e rult_buff_r++;o+					(*e 8ult_size)++;o+				}
+				b = b - 10;o+			}
+
+			iUR	b > 0) {n+				retry_couN@ = SONY_READY_RETRIES;n+				wh
 
 ((retry_couN@ > 0)
+				       &&R(!is_e 8ult_ready())) {n+					retry_couN@--;
+				}
+				iUR	!is_e 8ult_ready())l{ +#iH_DEBUGs+					priN@k("CDU31A timeout out %d\n",
+					       __LINE__);n+v)@ vN
+					rurult_buff_r[0]T= 0x20;n+					rurult_buff_r[1]T=
+					    SONY_TIMEOUT_OP_ERR;n+					*e 8ult_sizeT= 2;s+					e unsi;
+				}
+			}
+		}
+s+		wh
 
 (b > 0) {n+			*e 8ult_buff_rT= read_e 8ult_regtster();M+			e rult_buff_r++;o+			(*e 8ult_size)++;o+			b--;
+		}M+	}s }n s /*
@@
n939,95 +905,81 y s  */M y  pF TES <
 do_sony_cd_cmd(unsigned char cmd,
-               unsigned char *pa ams,
-               unsigned int num_pa ams,
-               unsigned char *e 8ult_buff_r,
-               unsigned int *e 8ult_size)
-{n-   unsigned int retry_couN@;n-   int num_retries;
-   int recursive_call;n-   unsigned long flags;
- -n-   save_flags(flags);
- TCcli();
- TCiUR	current != has_cd_task) /* Allow recursive callsCto this routine */s-   {s-      wh
 
 (sony_inus_)n-      {
-         interruptible_sleep_on(&sony_wait);o-         iUR	signal_p)@ vng	current))n-         {
-            rerult_buff_r[0]T= 0x20;n-TC       TC rurult_buff_r[1]T= SONY_SIGNAL_OP_ERR;n-TC          *e 8ult_sizeT= 2;s-            restore_flags(flags);
- TC         retnsi;
-         }M-      }s-      sony_inus_C= 1;s-      has_cd_taskC= current;s-      recursive_call = 0; -   }s-   )lses-   { -      recursive_call = 1;
-   }s+	       unsigned char *pa ams,
+	       unsigned int num_pa ams,
+	       unsigned char *e 8ult_buff_r, unsigned int *e 8ult_size)
+{n+	unsigned int retry_couN@;n+	int num_retries;
+	int recursive_call;n+	unsigned long flags;
+s+ +	save_flags(flags);
+	cli();
+	iUR	current != has_cd_task) {	/* Allow recursive callsCto this routine */s+		wh
 
 (sony_inus_) {n+			interruptible_sleep_on(&sony_wait);o+			iUR	signal_p)@ vng	current)) {n+				rerult_buff_r[0]T= 0x20;n+				rurult_buff_r[1]T= SONY_SIGNAL_OP_ERR;n+				*e 8ult_sizeT= 2;s+				e store_flags(flags);
+				e unsi;
+			}M+		}
+		sony_inus_C= 1;s+		has_cd_taskC= current;s+		e cursive_call = 0; +	} )lse {n+		recursive_call = 1;
+	}s n-   num_retries = 0; +	num_retries = 0;  retry_cd_operatt *:s n-   wh
 
 (handle_sony_cd_attentt *())s-      ;n+	wh
 
 (handle_sony_cd_attentt *());n+s+	s i();
 s-   s i();
-   s-   retry_couN@ = jiffiesT+ SONY_JIFFIES_TIMEOUT;n-   wh
 
 (time_before(jiffies, retry_couN@) &&R(is_busy()))o-   {s-      sony_sleep();
-      
-      wh
 
 (handle_sony_cd_attentt *())s-         ;n-   }s-   iUR	is_busy())o-   {s-#iH_DEBUGs-      priN@k("CDU31A timeout out %d\n", __LINE__);n-v)@ vNn-TC    rurult_buff_r[0]T= 0x20;n-TC    rurult_buff_r[1]T= SONY_TIMEOUT_OP_ERR;n-TC    *e 8ult_sizeT= 2;s-   }s-   )lses-   { -      clear_e 8ult_ready();
-      clear_pa am_reg();
-s-      write_pa ams(pa ams, num_pa ams);s-      write_cmd(cmd);
-s-      get_e 8ult(e 8ult_buff_r, e 8ult_size);n-   }
-s-   iUR	   ((rurult_buff_r[0]T& 0xf0) == 0x20)s-       &&R(num_retries < MAX_CDU31A_RETRIES))o-   {s-      num_retries++;o-      current->y  pe = TASK_INTERRUPTIBLE;s-      schedule_timeout(HZ/10);  /* Wai@T.1 secondsMoncretries +/M-      goto retry_cd_operatt *;n-   }
-s-   iUR	!recursive_call)o-   {s-      has_cd_taskC= NULL;s-      sony_inus_C= 0;
-      wake_up_interruptible(&sony_wait);o-   }M+	retry_couN@ = jiffiesT+ SONY_JIFFIES_TIMEOUT;n+	wh
 
 (time_before(jiffies, retry_couN@) &&R(is_busy()))l{ +		sony_sleep();
+s+		wh
 
 (handle_sony_cd_attentt *());n+	}op	iUR	is_busy())l{ +#iH_DEBUGs+		priN@k("CDU31A timeout out %d\n", __LINE__);n+v)@ vN
+		rurult_buff_r[0]T= 0x20;n+		rurult_buff_r[1]T= SONY_TIMEOUT_OP_ERR;n+		*e 8ult_sizeT= 2;s+	} )lse {n+		clear_e 8ult_ready();
+		clear_pa am_reg();
+
+		write_pa ams(pa ams, num_pa ams);s+		write_cmd(cmd);
+
+		get_e 8ult(e 8ult_buff_r, e 8ult_size);n+	}s+ +	iUR	((rurult_buff_r[0]T& 0xf0) == 0x20)s+	    &&R(num_retries < MAX_CDU31A_RETRIES)) {n+		num_retries++;o+		current->y  pe = TASK_INTERRUPTIBLE;s+		schedule_timeout(HZ / 10);	/* Wai@T.1 secondsMoncretries +/M+		goto retry_cd_operatt *;n+	}s+ +	iUR	!recursive_call) {n+		has_cd_taskC= NULL;s+		sony_inus_C= 0;
+		wake_up_interruptible(&sony_wait);o+	}s n-   restore_flags(flags);
+	restore_flags(flags);
 }n s 
@@
n1040,120 +992,114 y s  * a 0), and retnsis a 0CiURit happensCtoo many times.  This will helps  * prevent aRlockup.
  */M-y  pF TintM-handle_sony_cd_attentt *(ES <)n+y  pF Tint handle_sony_cd_attentt *(ES <)n {n-   unsigned char atten_code;n-   y  pF Tint num_consecutive_attentt *sC= 0;
-   ESl pF 
+int val;n+	unsigned char atten_code;n+	s  pF Tint num_consecutive_attentt *sC= 0;
+	ESl pF 
+int val;n 
 s #iH_0*DEBUGs-   priN@k("EnteriERchandle_sony_cd_attentt *\n");n+	priN@k("EnteriERchandle_sony_cd_attentt *\n");n v)@ vNn-TC iUR	is_attentt *())s-   {s-      iUR	num_consecutive_attentt *sC> CDU31A_MAX_CONSECUTIVE_ATTENTIONS)n-      {
-         priN@k("cdu31a: Too many consecutive attentt *s: %d\n",
-                num_consecutive_attentt *s);
- TC      num_consecutive_attentt *sC= 0;
-#iH_DEBUGs-         priN@k("LeaviERchandle_sony_cd_attentt *ca@T%d\n", __LINE__);n-v)@ vNn-TC       retnsi(0);M-      }n-
-      clear_attentt *();M-      atten_codeT= read_e 8ult_regtster();M-s-      switch 	atten_code)n-      {
-       /*CSomeone changed the CD.  MarkRit as changed +/M-      case SONY_MECH_LOADED_ATTN: -         dvsk_changed = 1;
-	 sony_toc_e ad = 0;
- TC      sony_audio_y  pus = CDROM_AUDIO_NO_STATUS;
- TC      sony_blocks_lef@ = 0;s-         be ak;M-s-      case SONY_SPIN_DOWN_COMPLETE_ATTN: -         /*CMarkRthec vsk as spun down. */s-         sony_spun_up = 0;s-         be ak;M-s-      case SONY_AUDIO_PLAY_DONE_ATTN: -         sony_audio_y  pus = CDROM_AUDIO_COMPLETED;M-      TC ruad_8ubcode();M-      TC be ak;M-s-      case SONY_EJECT_PUSHED_ATTN: -         iUR	is_auto_eject)
-         {
-            sony_audio_y  pus = CDROM_AUDIO_INVALID;o-         }o-         be ak;M-s-      case SONY_LEAD_IN_ERR_ATTN: -      case SONY_LEAD_OUT_ERR_ATTN: -      case SONY_DATA_TRACK_ERR_ATTN: -      case SONY_AUDIO_PLAYBACK_ERR_ATTN: -         sony_audio_y  pus = CDROM_AUDIO_ERROR;M-      TC be ak;M-      }n-
-      num_consecutive_attentt *s++;o-#iH_DEBUGs-      priN@k("LeaviERchandle_sony_cd_attentt *ca@T%d\n", __LINE__);n-v)@ vNn-TC    retnsi(1);n-   }s-   )lse iUR	abort_e ad_8  rted)s-   {s-      wh
 
 (is_e 8ult_reg_not_empty())s-      { -         val = read_e 8ult_regtster();M-      }s-      clear_ ata_ready();
-      clear_e 8ult_ready();
-      /*CClearcout thec ata */s-      wh
 
 (is_ ata_requested())s-      { -         val = read_ ata_regtster();M-      }s-      abort_e ad_8  rted = 0;
p	iUR	is_attentt *()) {n+		iUR	num_consecutive_attentt *sC>
+		 TC CDU31A_MAX_CONSECUTIVE_ATTENTIONS) {n+			priN@kn+			    ("cdu31a: Too many consecutive attentt *s: %d\n",
+			     num_consecutive_attentt *s);
+			num_consecutive_attentt *sC= 0;
+#iH_DEBUGs+			priN@k("LeaviERchandle_sony_cd_attentt *ca@T%d\n",
+			       __LINE__);n+v)@ vN
+			retnsi (0);M+		}
+
+		clear_attentt *();M+		atten_codeT= read_e 8ult_regtster();M+o+		switch 	atten_code) {n+			/*CSomeone changed the CD.  MarkRit as changed +/M+		case SONY_MECH_LOADED_ATTN: +			dvsk_changed = 1;
+			sony_toc_e ad = 0;
+			sony_audio_y  pus = CDROM_AUDIO_NO_STATUS;
+			sony_blocks_lef@ = 0;s+			be ak;M+M+		case SONY_SPIN_DOWN_COMPLETE_ATTN: +			/*CMarkRthec vsk as spun down. */s+			sony_spun_up = 0;s+			be ak;M+M+		case SONY_AUDIO_PLAY_DONE_ATTN: +			sony_audio_y  pus = CDROM_AUDIO_COMPLETED;M+			read_8ubcode();M+			be ak;M+M+		case SONY_EJECT_PUSHED_ATTN: +			iUR	is_auto_eject) {n+				sony_audio_y  pus = CDROM_AUDIO_INVALID;o+			}
+			be ak;M+M+		case SONY_LEAD_IN_ERR_ATTN: +		case SONY_LEAD_OUT_ERR_ATTN: +		case SONY_DATA_TRACK_ERR_ATTN: +		case SONY_AUDIO_PLAYBACK_ERR_ATTN: +			sony_audio_y  pus = CDROM_AUDIO_ERROR;M+			be ak;M+		}
+
+		num_consecutive_attentt *s++;o+#iH_DEBUGs+		priN@k("LeaviERchandle_sony_cd_attentt *ca@T%d\n",
+		       __LINE__);n+v)@ vN
+		retnsi (1);M+	} )lse iUR	abort_e ad_8  rted) {
+		wh
 
 (is_e 8ult_reg_not_empty()) {
+			val = read_e 8ult_regtster();M+		}
+		clear_ ata_ready();
+		clear_e 8ult_ready();
+		/*CClearcout thec ata */s+		wh
 
 (is_ ata_requested()) {
+			val = read_ ata_regtster();M+		}
+		abort_e ad_8  rted = 0;
 #iH_DEBUGs-      priN@k("LeaviERchandle_sony_cd_attentt *ca@T%d\n", __LINE__);n+		priN@k("LeaviERchandle_sony_cd_attentt *ca@T%d\n",
+		       __LINE__);n v)@ vNn-TC    retnsi(1);n-   }s+		retnsi (1);M+	}s n-   num_consecutive_attentt *sC= 0;
+	num_consecutive_attentt *sC= 0;
 #iH_0*DEBUGs-   priN@k("LeaviERchandle_sony_cd_attentt *ca@T%d\n", __LINE__);n+	priN@k("LeaviERchandle_sony_cd_attentt *ca@T%d\n", __LINE__);n v)@ vNn-TC retnsi(0);M+	retnsi (0);M }n s 
 /*CConvert G0xmCan+integer 0-99Cto BCD */M-y  pF Tinline unsigned int
-int_to_bcd(unsigned int val)n+y  pF Tinline unsigned int int_to_bcd(unsigned int val)n {
-   int retval;n+	int retval;n o n-   retval = (val / 10) << 4;n-   retval = retval | val % 10;o-   retnsi(retval);M+	retval = (val / 10) << 4;n+	retval = retval | val % 10;o+	retnsi (retval);M }n s 
 /*CConvert G0xmCBCD to an+integer G0xmC0-99C*/M-y  pF Tunsigned int
-bcd_to_int(unsigned int bcd)M+y  pF Tunsigned int bcd_to_int(unsigned int bcd)M {s-   retnsi((((bcd >> 4)T& 0x0f) * 10) + (bcd & 0x0f));n+	retnsi ((((bcd >> 4)T& 0x0f) * 10) + (bcd & 0x0f));n }n s 
@@
n1161,32 +1107,30 y s  * Convert aRlogical sector valu
 (like the OS would wanc to us_CG_S
  * a block device) to an+MSFCG_Smat.
  */M-y  pF TES <
-log_to_msf(unsigned int log, unsigned char *msf)n+y  pF TES < log_to_msf(unsigned int log, unsigned char *msf)n {s-   log = log + LOG_START_OFFSET;n-   msf[0]T= int_to_bcd(log / 4500);M-   log = log % 4500;n-   msf[1]T= int_to_bcd(log / 75);n-   msf[2]T= int_to_bcd(log % 75);n+	log = log + LOG_START_OFFSET;n+	msf[0]T= int_to_bcd(log / 4500);M+	log = log % 4500;n+	msf[1]T= int_to_bcd(log / 75);n+	msf[2]T= int_to_bcd(log % 75);n }n s 
 /*s  * Convert an+MSFCG_Smat to aRlogical sector.
  */M-y  pF Tunsigned int
-msf_to_log(unsigned char *msf)n+y  pF Tunsigned int msf_to_log(unsigned char *msf)n {n-   unsigned int log;n+	unsigned int log;n o n-   log = msf[2];M-   log += msf[1]T* 75;M-   log += msf[0]T* 4500;n-   log = log - LOG_START_OFFSET;n+	log = msf[2];M+	log += msf[1]T* 75;M+	log += msf[0]T* 4500;n+	log = log - LOG_START_OFFSET;n n-   retnsi log;n+	retnsi log;n }n s 
@@
n1194,14 +1138,12 y s  * Take in+integer sizeTvalu
 and put it into aRbuff_rTlikes  * thec rive would wanc to se
 a number-of-sector valu
.
  */M-y  pF TES <
-size_to_buf(unsigned int size,
-            unsigned char *buf)n+y  pF TES < size_to_buf(unsigned int size, unsigned char *buf)n {n-   buf[0]T= sizeT/ 65536;n-   yizeT= yizeT% 65536;n-   buf[1]T= sizeT/ 256;n-   buf[2]T= yizeT% 256;n+	buf[0]T= sizeT/ 65536;n+	yizeT= yizeT% 65536;n+	buf[1]T= sizeT/ 256;n+	buf[2]T= yizeT% 256;n }n s /* S  rts a e ad operatt *. Retnsis 0MoncsuccessMaNd 1Moncfailure. 
@@
n1211,430 +1153,380 y s    operatt * iURthecrequested sector is notRthecnext one G0xmCthes     rive. */s y  pF TintM-8tart_request(unsigned int sector,
-              unsigned int nsect,
-              int       TC ruad_nsect_only)
-{n-   unsigned char pa ams[6];n-   unsigned int read_8ize;n-   unsigned int retry_couN@;n- -n-#iH_DEBUGs-   priN@k("EnteriERc8tart_request\n");n-v)@ vNn-TC log_to_msf(sector, pa ams);s-   /*CIf requested, e ad exactly what was asked. */M-   iUR	ruad_nsect_only)
-   { -      read_8izeT= nsect;n-   }s-   /*
-    * IURthecfull read-ahead would go beyond the )@  oURthecmedia, trim
-    * it back to read just till the )@  oURthecmedia.
-    */M-   )lse iUR	(sector + nsect) >= sony_toc.lead_out_8  rt_lba)
-   { -      read_8izeT= sony_toc.lead_out_8  rt_lba - sector;n-   }s-   /* ReadRthecfull readahead amouN@. */M-   )lse
-   { -      read_8izeT= CDU31A_READAHEAD / 4;
-   }s-   size_to_buf(read_8ize, &pa ams[3]);s-n-   /*
-    * Clearcany out8  @ vng attentt *sMaNd wai@TG_SMthec rive to
-    * completecany p)@ vng operatt *s.
-    */M-   wh
 
 (handle_sony_cd_attentt *())s-      ;n-s-   retry_couN@ = jiffiesT+ SONY_JIFFIES_TIMEOUT;n-   wh
 
 (time_before(jiffies, retry_couN@) &&R(is_busy()))o-   {s-      sony_sleep();
-      
-      wh
 
 (handle_sony_cd_attentt *())s-         ;n-   }s-s-   iUR	is_busy())o-   {s-      priN@k("CDU31A: Timeout wh
 
 waitiERcto issueccommand\n");n-viH_DEBUGs-      priN@k("LeaviERc8tart_requestca@T%d\n", __LINE__);n-v)@ vNn-TC    retnsi(1);n-   }s-   )lses-   {s-      /*CIssuectheccommand +/M-      clear_e 8ult_ready();
-      clear_pa am_reg();
-s-      write_pa ams(pa ams, 6);s-      write_cmd(SONY_READ_BLKERR_STAT_CMD);M-s-      sony_blocks_lef@ = read_8izeT* 4;
-      sony_next_blockT= sector * 4;
-      readahead_ atalef@ = 0;s-      readahead_bad = 0;
+8tart_request(unsigned int sector, unsigned int nsect, int read_nsect_only)
+{n+	unsigned char pa ams[6];n+	unsigned int read_8ize;n+	unsigned int retry_couN@;n+s+ +#iH_DEBUGs+	priN@k("EnteriERc8tart_request\n");n+v)@ vN
+	log_to_msf(sector, pa ams);s+	/*CIf requested, e ad exactly what was asked. */Mp	iUR	read_nsect_only) {n+		read_8izeT= nsect;n+	}op	/*
+	 * IURthecfull read-ahead would go beyond the )@  oURthecmedia, trim
+	 * it back to read just till the )@  oURthecmedia.
+	 */M+	)lse iUR	(sector + nsect) >= sony_toc.lead_out_8  rt_lba) {n+		read_8izeT= sony_toc.lead_out_8  rt_lba - sector;n+	}op	/* ReadRthecfull readahead amouN@. */M+	)lse {n+		read_8izeT= CDU31A_READAHEAD / 4;
+	}sp	size_to_buf(read_8ize, &pa ams[3]);s+ +	/*
+	 * Clearcany out8  @ vng attentt *sMaNd wai@TG_SMthec rive to
+	 * completecany p)@ vng operatt *s.
+	 */M+	wh
 
 (handle_sony_cd_attentt *());n+s+	retry_couN@ = jiffiesT+ SONY_JIFFIES_TIMEOUT;n+	wh
 
 (time_before(jiffies, retry_couN@) &&R(is_busy()))l{ +		sony_sleep();
+s+		wh
 
 (handle_sony_cd_attentt *());n+	}opop	iUR	is_busy())l{ +		priN@k("CDU31A: Timeout wh
 
 waitiERcto issueccommand\n");n+#iH_DEBUGs+		priN@k("LeaviERc8tart_requestca@T%d\n", __LINE__);n+v)@ vN
+		retnsi (1);M+	} )lse {
+		/*CIssuectheccommand +/M+		clear_e 8ult_ready();
+		clear_pa am_reg();
+
+		write_pa ams(pa ams, 6);s+		write_cmd(SONY_READ_BLKERR_STAT_CMD);M+ +		sony_blocks_lef@ = read_8izeT* 4;
+		sony_next_blockT= sector * 4;
+		readahead_ atalef@ = 0;s+		readahead_bad = 0;
 viH_DEBUGs-      priN@k("LeaviERc8tart_requestca@T%d\n", __LINE__);n+		priN@k("LeaviERc8tart_requestca@T%d\n", __LINE__);n v)@ vNn-TC    retnsi(0);n-   }s+		retnsi (0);M+	}s #iH_DEBUGs-   priN@k("LeaviERc8tart_requestca@T%d\n", __LINE__);n+	priN@k("LeaviERc8tart_requestca@T%d\n", __LINE__);n v)@ vNn }n s /* Abort a p)@ vng e ad operatt *.  Clearcall the  rive y  pus and
    readahead variab 
s. */s-y  pF TES <
-abort_e ad(ES <)n+y  pF TES < abort_e ad(ES <)n {n-   unsigned char rurult_reg[2];M-   int       TC  e 8ult_size;
-   ESl pF 
+int  val;n- -n-   do_sony_cd_cmd(SONY_ABORT_CMD, NULL, 0, rurult_reg, &result_size);n-   iUR	(result_reg[0]T& 0xf0) == 0x20)s-   {s-      priN@k("CDU31A: Error abortvng e ad, %s error\n",
-             transl p,_error(
-             result_reg[1]));M-   }s-n-   wh
 
 (is_e 8ult_reg_not_empty())s-   {s-      val = read_e 8ult_regtster();M-   }M-   clear_ ata_ready();
-   clear_e 8ult_ready();
-   /*CClearcout thec ata */s-   wh
 
 (is_ ata_requested())s-   {s-      val = read_ ata_regtster();M-   }s-n-   sony_blocks_lef@ = 0;s-   readahead_ atalef@ = 0;s-   readahead_bad = 0;
+	unsigned char rurult_reg[2];M+	int re8ult_size;
+	ESl pF 
+int val;n+s+ +	do_sony_cd_cmd(SONY_ABORT_CMD, NULL, 0, rurult_reg, &result_size);np	iUR	(result_reg[0]T& 0xf0) == 0x20)l{ +		priN@k("CDU31A: Error abortvng e ad, %s error\n",
+		       transl p,_error(result_reg[1]));M+	}s+ +	wh
 
 (is_e 8ult_reg_not_empty()) {
+		val = read_e 8ult_regtster();M+	}M+	clear_ ata_ready();
+	clear_e 8ult_ready();
+	/*CClearcout thec ata */s+	wh
 
 (is_ ata_requested()) {
+		val = read_ ata_regtster();M+	}s+ +	sony_blocks_lef@ = 0;s+	readahead_ atalef@ = 0;s+	readahead_bad = 0;
 }n s /* Called when thectimer timescout.  This will abort thes    p)@ vng e ad operatt *. */s-y  pF TES <
-handle_abort_timeout(unsigned long  ata)n+y  pF TES < handle_abort_timeout(unsigned long  ata)n {n-   unsigned long flags;
+	unsigned long flags;
 s #iH_DEBUGs-   priN@k("EnteriERchandle_abort_timeout\n");n+	priN@k("EnteriERchandle_abort_timeout\n");n v)@ vNn-TC save_flags(flags);
- TCcli();
- TC/*CIf i@ is in use, ignorecit. */s-   iUR	!sony_inus_)n-   {s-      /*CWe can't us_Cabort_e ad(), becaus_Ci@ will sleep
-         or ychedule in thectimer interrupt.  Just 8tart
-         the operatt *, finishCi@ onRthecnext accessMto
-         the  rive. */s-      clear_e 8ult_ready();
-      clear_pa am_reg();
-      write_cmd(SONY_ABORT_CMD);M-s-      sony_blocks_lef@ = 0;
-      readahead_ atalef@ = 0;s-      readahead_bad = 0;
-      abort_e ad_8  rted = 1;M-   }M-   restore_flags(flags);
+	save_flags(flags);
+	cli();
+	/*CIf i@ is in use, ignorecit. */s+	iUR	!sony_inus_) {n+		/*CWe can't us_Cabort_e ad(), becaus_Ci@ will sleep
+		   or ychedule in thectimer interrupt.  Just 8tart
+		   the operatt *, finishCi@ onRthecnext accessMto
+		   the  rive. */s+		clear_e 8ult_ready();
+		clear_pa am_reg();
+		write_cmd(SONY_ABORT_CMD);M+ +		sony_blocks_lef@ = 0;
+		readahead_ atalef@ = 0;s+		readahead_bad = 0;
+		abort_e ad_8  rted = 1;M+	}M+	restore_flags(flags);
 #iH_DEBUGs-   priN@k("LeaviERchandle_abort_timeout\n");n+	priN@k("LeaviERchandle_abort_timeout\n");n v)@ vNn }n s /* Actually getc ata and s  pus G0xmCthe  rive. */s y  pF TES <
-input_ ata(char         *buff_r,
-           unsigned int byteslef@,
-           unsigned int nblocks,
-           unsigned int offse@,
-           unsigned int skip)
-{n-   int i;n-   ESl pF 
+unsigned char val;n+input_ ata(char *buff_r,
+	   unsigned int byteslef@,
+	   unsigned int nblocks, unsigned int offse@, unsigned int skip)
+{n+	int i;n+	ESl pF 
+unsigned char val;n 
 s #iH_DEBUGs-   priN@k("EnteriERcinput_ ata\n");n-v)@ vNn-TC /*CIf an XAc vsk  *ca CDU31A, skip thecfirst 12 bytescofc ata G0xm
-      thec vsk.  The e alc ata is after that. */s-   iUR	sony_xa_mode)n-   {s-      for(i=0; i<CD_XA_HEAD; i++)n-      { -         val = read_ ata_regtster();M-      }s-   }s-n-   clear_ ata_ready();
-s-   iUR	byteslef@ == 2048) /* 2048 byte direct buff_rTtransf_rT*/s-   {s-      insb(sony_cd_read_e g, buff_r, 2048);
-      readahead_ atalef@ = 0;s-   }s-   )lses-   {s-      /*CIURthecinput e ad d < notRalign with thecbegtnniERcoURthecblock,
-	 skip thecnecessary bytes. +/M-      iUR	skip != 0)n-      {
-         insb(sony_cd_read_e g, readahead_buff_r, skip);M-      }n-
-      /* Get thec ata into thecbuff_r. +/M-      insb(sony_cd_read_e g, &buff_r[offse@], byteslef@);M-s-      /* Get thecrestcoURthec ata into thecreadahead buff_rTat thes-	 properRlocatt *. */s-      readahead_ atalef@ = (2048 - skip) - byteslef@;M-      insb(sony_cd_read_e g,
-           readahead_buff_r + byteslef@,
-           readahead_ atalef@);
-   }s-   sony_blocks_lef@ -= nblocks;s-   sony_next_blockT+= nblocks; o-n-   /* If an XAc vsk, we have to clearcout thecrestcoURthecunus_d
-      error correctt *  ata. */s-   iUR	sony_xa_mode)n-   {s-      for(i=0; i<CD_XA_TAIL; i++)n-      { -         val = read_ ata_regtster();M-      }s-   }s+	priN@k("EnteriERcinput_ ata\n");n+v)@ vN
+	/*CIf an XAc vsk  *ca CDU31A, skip thecfirst 12 bytescofc ata G0xm
+	   thec vsk.  The e alc ata is after that. */s+	iUR	sony_xa_mode) {n+		G_SM(i = 0; i < CD_XA_HEAD; i++) {
+			val = read_ ata_regtster();M+		}
+	}s+ +	clear_ ata_ready();
+s+	iUR	byteslef@ == 2048) {	/* 2048 byte direct buff_rTtransf_rT*/s+		insb(sony_cd_read_e g, buff_r, 2048);
+		readahead_ atalef@ = 0;s+	} )lse {
+		/*CIURthecinput e ad d < notRalign with thecbegtnniERcoURthecblock,
+		   skip thecnecessary bytes. +/M+		iUR	skip != 0) {n+			insb(sony_cd_read_e g, readahead_buff_r, skip);M+		}
+
+		/* Get thec ata into thecbuff_r. +/M+		insb(sony_cd_read_e g, &buff_r[offse@], byteslef@);M+
+		/* Get thecrestcoURthec ata into thecreadahead buff_rTat thes+		   properRlocatt *. */s+		readahead_ atalef@ = (2048 - skip) - byteslef@;M+		insb(sony_cd_read_e g,
+		     readahead_buff_r + byteslef@, readahead_ atalef@);
+	}sp	sony_blocks_lef@ -= nblocks;s+	sony_next_blockT+= nblocks;o+ +	/* If an XAc vsk, we have to clearcout thecrestcoURthecunus_d
+	   error correctt *  ata. */s+	iUR	sony_xa_mode) {n+		G_SM(i = 0; i < CD_XA_TAIL; i++) {
+			val = read_ ata_regtster();M+		}
+	}s #iH_DEBUGs-   priN@k("LeaviERcinput_ ataca@T%d\n", __LINE__);n+	priN@k("LeaviERcinput_ ataca@T%d\n", __LINE__);n v)@ vNn }n s /* e ad data G0xmCthe  rive.  Notecthecnsect must be <= 4. */s y  pF TES <
-read_ ata_block(char          *buff_r,
-                unsigned int cblock,
-                unsigned int cnblocks,
-                unsigned char rur_reg[],
-                int       TC  *res_size)
-{n-   unsigned int retry_couN@;n-   unsigned int byteslef@;n-   unsigned int offse@;n-   unsigned int skip;n- -n-#iH_DEBUGs-   priN@k("EnteriERcread_ ata_block\n");n-v)@ vNn-M-   res_reg[0]T= 0;s-   rer_reg[1]T= 0;s-   *res_sizeT= 0;s-   byteslef@ =cnblocks * 512;s-   offse@T= 0;s-n-   /* If thec ata in thecread-ahead does notRmatch thecblock offse@,
-      then fix things up. */s-   iUR	((block % 4)T* 512) != ((2048 - readahead_ atalef@)T% 2048))o-   {s-      sony_next_blockT+= block % 4;s-      sony_blocks_lef@ -= block % 4;s-      skip = (block % 4)T* 512;s-   }s-   )lses-   {s-      skip = 0;M-   }s-n-   /*CWe have readahead  ata in thecbuff_r, get tha@Tfirst before wes-      decide iURa e ad is necessary. */M-   iUR	ruadahead_ atalef@ != 0)n-   {s-      iUR	byteslef@ > readahead_ atalef@)n-      { -	 /*CThecreadahead will notRfill the requested buff_r, but -	    get thec ata out of thecreadahead into thecbuff_r. +/M-         memcpy(buff_r,
-                readahead_buff_r + (2048 - readahead_ atalef@),
-                readahead_ atalef@);
-         readahead_ atalef@ = 0;s-         byteslef@ -= readahead_ atalef@;s-         offse@T+= readahead_ atalef@;s-      }s-      )lses-      { -	 /*CThecreadahead will fill the wholecbuff_r, get thec ata -	    and retnsi. +/M-         memcpy(buff_r,
-                readahead_buff_r + (2048 - readahead_ atalef@),
-                byteslef@);M-         readahead_ atalef@ -= byteslef@;M-         byteslef@ =c0;
- TC      sony_blocks_lef@ -= nblocks;s-         sony_next_blockT+= nblocks;s- -	 /*CIf thec ata in thecreadahead is bad, e tnsi an error so thes-	     river will abort thecbuff_r. +/M-         iUR	ruadahead_bad)n-         {
-            rer_reg[0]T= 0x20;n-TC       TC rur_reg[1]T= SONY_BAD_DATA_ERR;n-TC          *e 8_sizeT= 2;s-         }o-o-         iUR	readahead_ atalef@ == 0)n-         {
-            readahead_bad = 0;
-         }o-o-         /*CFinal transf_rTis done Gor e ad command, get final re8ult. */s-         iUR	sony_blocks_lef@ == 0)n-         {
-            get_e 8ult(e 8_e g, res_size);n-         }o-#iH_DEBUGs-         priN@k("LeaviERcread_ ata_blockca@T%d\n", __LINE__);n-v)@ vNn-TC       retnsi;M-      }s-   }s-n-   /* Wai@TG_SMthec rive to tell us we have something +/M-   retry_couN@ = jiffiesT+ SONY_JIFFIES_TIMEOUT;n-   wh
 
 (time_before(jiffies, retry_couN@) &&R!(is_ ata_ready()))o-   {s-      wh
 
 (handle_sony_cd_attentt *())s-         ;n-s-      sony_sleep();
-   }s-   iUR	!(is_ ata_ready()))o-   {s-      iUR	is_e 8ult_ready())n-      {
-         get_e 8ult(e 8_e g, res_size);n-         iUR	(res_reg[0]T& 0xf0) != 0x20)s-         {
-            priN@k("CDU31A: Got re8ult tha@Tshould have been error: %d\n",
-                   rer_reg[0]);
-            rer_reg[0]T= 0x20;n-TC       TC rur_reg[1]T= SONY_BAD_DATA_ERR;n-TC          *e 8_sizeT= 2;s-         }o-         abort_e ad();s-      }s-      )lses-      { -#iH_DEBUGs-         priN@k("CDU31A timeout out %d\n", __LINE__);n-v)@ vNn-TC       rer_reg[0]T= 0x20;n-TC       rur_reg[1]T= SONY_TIMEOUT_OP_ERR;n-TC       *e 8_sizeT= 2;s-         abort_e ad();s-      }s-   }s-   )lses-   {s-      input_ ata(buff_r, byteslef@, nblocks, offse@, skip);M-s-      /*CWai@TG_SMthecs  pus G0xmCthe  rive. */s-      retry_couN@ = jiffiesT+ SONY_JIFFIES_TIMEOUT;n-      wh
 
 (time_before(jiffies, retry_couN@) &&R!(is_e 8ult_ready()))n-      {s-         wh
 
 (handle_sony_cd_attentt *())s-            ;n-s-         sony_sleep();
-      }o-o-      iUR	!is_e 8ult_ready())n-      { -#iH_DEBUGs-         priN@k("CDU31A timeout out %d\n", __LINE__);n-v)@ vNn-TC       rer_reg[0]T= 0x20;n-TC       rur_reg[1]T= SONY_TIMEOUT_OP_ERR;n-TC       *e 8_sizeT= 2;s-         abort_e ad();s-      }s-      )lses-      { -         get_e 8ult(e 8_e g, res_size);n- -	 /*CIf we gotRa buff_rTs  pus,chandle that. */s-         iUR	(res_reg[0]T& 0xf0) == 0x50)o-         { -o-            iUR	   (rer_reg[0]T== SONY_NO_CIRC_ERR_BLK_STAT)
-                || (rer_reg[0]T== SONY_NO_LECC_ERR_BLK_STAT)
-                || (rer_reg[0]T== SONY_RECOV_LECC_ERR_BLK_STAT))n-            {
-	       /*CThec ata was successful, but iUR ata was e ad G0xm
-		  thecreadahead  and it was bad, set thecwhole
-		  buff_rTas bad. */s-               iUR	ruadahead_bad)n-               {
-                  readahead_bad = 0;
-                  rer_reg[0]T= 0x20;n-TC       TC    TC rur_reg[1]T= SONY_BAD_DATA_ERR;n-TC                *e 8_sizeT= 2;s-               }o-            }o-            )lses-            {
-               priN@k("CDU31A: Data block error: 0x%x\n", rer_reg[0]);
-               rer_reg[0]T= 0x20;n-TC       TC    rur_reg[1]T= SONY_BAD_DATA_ERR;n-TC             *e 8_sizeT= 2;s-n-TC             /*CData is in thecreadahead buff_rTbut an error was e tnsied.n-TC                Make surecfuturecrequests don't us_Cthec ata. */s-               iUR	byteslef@ != 2048)n-               {
-                  readahead_bad = 1;s-               }o-            }o-o-            /*CFinal transf_rTis done Gor e ad command, get final re8ult. */s-            iUR	sony_blocks_lef@ == 0)n-            {
-               get_e 8ult(e 8_e g, res_size);n-            }o-         }o-         )lse iUR	(res_reg[0]T& 0xf0) != 0x20)s-         {
-            /*CThec rive gave me badTs  pus,cI don't know what to do.n-TC             Reset thec river and retnsi an error. */s-            priN@k("CDU31A: Invalid block s  pus: 0x%x\n", rer_reg[0]);
-            restart_on_error();
-            rer_reg[0]T= 0x20;n-TC       TC rur_reg[1]T= SONY_BAD_DATA_ERR;n-TC          *e 8_sizeT= 2;s-         }o-      }s-   }s+read_ ata_block(char *buff_r,
+		unsigned int block,
+		unsigned int nblocks,
+		unsigned char rur_reg[], int *e 8_size)
+{n+	unsigned int retry_couN@;n+	unsigned int byteslef@;n+	unsigned int offse@;n+	unsigned int skip;n+s+ +#iH_DEBUGs+	priN@k("EnteriERcread_ ata_block\n");n+v)@ vN
+M+	res_reg[0]T= 0;s+	res_reg[1]T= 0;s+	*res_sizeT= 0;s+	byteslef@ =cnblocks * 512;s+	offse@T= 0;s+ +	/* If thec ata in thecread-ahead does notRmatch thecblock offse@,
+	   then fix things up. */s+	iUR	((block % 4)T* 512) != ((2048 - readahead_ atalef@)T% 2048))l{ +		sony_next_blockT+= block % 4;s+		sony_blocks_lef@ -= block % 4;s+		skip = (block % 4)T* 512;s+	} )lse {
+		skip = 0;M+	}s+ +	/*CWe have readahead  ata in thecbuff_r, get tha@Tfirst before wes+	   decide iURa e ad is necessary. */Mp	iUR	readahead_ atalef@ != 0) {n+		iUR	byteslef@ > readahead_ atalef@) {n+			/*CThecreadahead will notRfill the requested buff_r, but +			   get thec ata out of thecreadahead into thecbuff_r. +/M+			memcpy(buff_r,
+			       readahead_buff_r + (2048 -s+						   readahead_ atalef@),
+			       readahead_ atalef@);
+			readahead_ atalef@ = 0;s+			byteslef@ -= readahead_ atalef@;s+			offse@T+= readahead_ atalef@;s+		} )lse {
+			/*CThecreadahead will fill the wholecbuff_r, get thec ata +			   and retnsi. +/M+			memcpy(buff_r,
+			       readahead_buff_r + (2048 -s+						   readahead_ atalef@),
+			       byteslef@);M+			readahead_ atalef@ -= byteslef@;M+			byteslef@ = 0;
+			sony_blocks_lef@ -= nblocks;s+			sony_next_blockT+= nblocks;o+ +			/*CIf thec ata in thecreadahead is bad, e tnsi an error so thes+			    river will abort thecbuff_r. +/M+			iUR	ruadahead_bad) {n+				rer_reg[0]T= 0x20;n+				rer_reg[1]T= SONY_BAD_DATA_ERR;n+				*e 8_sizeT= 2;s+			}
+
+			iUR	readahead_ atalef@ == 0) {n+				readahead_bad = 0;
+			}
+
+			/*CFinal transf_rTis done Gor e ad command, get final re8ult. */s+			iUR	sony_blocks_lef@ == 0) {n+				get_e 8ult(e 8_e g, res_size);n+			}
+#iH_DEBUGs+			priN@k("LeaviERcread_ ata_blockca@T%d\n",
+			       __LINE__);n+v)@ vN
+			retnsi;M+		}
+	}s+ +	/* Wai@TG_SMthec rive to tell us we have something +/M+	retry_couN@ = jiffiesT+ SONY_JIFFIES_TIMEOUT;n+	wh
 
 (time_before(jiffies, retry_couN@) &&R!(is_ ata_ready())) {
+		wh
 
 (handle_sony_cd_attentt *());n+s+		sony_sleep();
+	}op	iUR	!(is_ ata_ready())) {
+		iUR	is_e 8ult_ready()) {n+			get_e 8ult(e 8_e g, res_size);n+			iUR	(res_reg[0]T& 0xf0) != 0x20) {n+				priN@kn+				    ("CDU31A: Got re8ult tha@Tshould have been error: %d\n",
+				     rer_reg[0]);
+				rer_reg[0]T= 0x20;n+				rer_reg[1]T= SONY_BAD_DATA_ERR;n+				*e 8_sizeT= 2;s+			}
+			abort_e ad();M+		} )lse {
+#iH_DEBUGs+			priN@k("CDU31A timeout out %d\n", __LINE__);n+v)@ vN
+			rer_reg[0]T= 0x20;n+			rur_reg[1]T= SONY_TIMEOUT_OP_ERR;n+			*e 8_sizeT= 2;s+			abort_e ad();M+		}s+	} )lse {
+		input_ ata(buff_r, byteslef@, nblocks, offse@, skip);M+
+		/* Wai@TG_SMthecs  pus G0xmCthe  rive. */s+		retry_couN@ = jiffiesT+ SONY_JIFFIES_TIMEOUT;n+		wh
 
 (time_before(jiffies, retry_couN@)o+		       &&R!(is_e 8ult_ready())) {n+			wh
 
 (handle_sony_cd_attentt *());n+s+			sony_sleep();
+		}
+
+		iUR	!is_e 8ult_ready())l{ +#iH_DEBUGs+			priN@k("CDU31A timeout out %d\n", __LINE__);n+v)@ vN
+			rer_reg[0]T= 0x20;n+			rur_reg[1]T= SONY_TIMEOUT_OP_ERR;n+			*e 8_sizeT= 2;s+			abort_e ad();M+		} )lse {
+			get_e 8ult(e 8_e g, res_size);n+ +			/*CIf we gotRa buff_rTs  pus,chandle that. */s+			iUR	(res_reg[0]T& 0xf0) == 0x50)l{ +
+				iUR	(rer_reg[0]T==
+				     SONY_NO_CIRC_ERR_BLK_STAT)
+				    || (rer_reg[0]T==s+					SONY_NO_LECC_ERR_BLK_STAT)
+				    || (rer_reg[0]T==s+					SONY_RECOV_LECC_ERR_BLK_STAT)) {n+					/*CThec ata was successful, but iUR ata was e ad G0xm
+					   thecreadahead  and it was bad, set thecwhole
+					   buff_rTas bad. */s+					iUR	ruadahead_bad) {n+						readahead_bad = 0;
+						rer_reg[0]T= 0x20;n+						rur_reg[1]T=s+						    SONY_BAD_DATA_ERR;n+						*e 8_sizeT= 2;s+					}
+				} )lse {
+					priN@kn+					    ("CDU31A: Data block error: 0x%x\n",
+					     rer_reg[0]);
+					rer_reg[0]T= 0x20;n+					rer_reg[1]T= SONY_BAD_DATA_ERR;n+					*e 8_sizeT= 2;s+n+					/*CData is in thecreadahead buff_rTbut an error was e tnsied.n+					   Make surecfuturecrequests don't us_Cthec ata. */s+					iUR	byteslef@ != 2048) {n+						readahead_bad = 1;s+					}
+				}s+n+				/*CFinal transf_rTis done Gor e ad command, get final re8ult. */s+				iUR	sony_blocks_lef@ == 0) {n+					get_e 8ult(e 8_e g, res_size);n+				}
+			} )lse iUR	(res_reg[0]T& 0xf0) != 0x20) {n+				/*CThec rive gave me badTs  pus,cI don't know what to do.n+				   Reset thec river and retnsi an error. */s+				priN@kn+				    ("CDU31A: Invalid block s  pus: 0x%x\n",
+				     rer_reg[0]);
+				rertart_on_error();
+				rer_reg[0]T= 0x20;n+				rer_reg[1]T= SONY_BAD_DATA_ERR;n+				*e 8_sizeT= 2;s+			}
+		}
+	}s #iH_DEBUGs-   priN@k("LeaviERcread_ ata_blockca@T%d\n", __LINE__);n+	priN@k("LeaviERcread_ ata_blockca@T%d\n", __LINE__);n v)@ vNn }n s@@
n1646,230 +1538,215 y s  * us_s 1024 byte blocks and the  rive us_s 2048 byte blocks.  Since mosts  *  atacaccessM *ca CDTis done sequenttally, this saves aRlot of operatt *s.
  */M-y  pF TES <
-do_cdu31a_request(request_queue_t * q)n+y  pF TES < do_cdu31a_request(request_queue_t * q)n {
-   int block;n-   int nblock;n-   unsigned char rur_reg[12];n-   unsigned int res_size;
-   int num_retries;
-   unsigned long flags;
- -n-#iH_DEBUGs-         priN@k("EnteriERcdo_cdu31a_request\n");n-v)@ vNn-M-   /*C
-    * Make surecno one )lse is usiERcthec river; wai@TG_SMthem
-    * to finishCif i@ is so.
-    */M-   save_flags(flags);
- TCcli();
- TCwh
 
 (sony_inus_)n-   {s-      interruptible_sleep_on(&sony_wait);o-      iUR	signal_p)@ vng	current))n-      {n-TC       rurtore_flags(flags);
- TC      iUR	!QUEUE_EMPTY &&RCURRENT->rq_y  pus != RQ_INACTIVE)s-         {
-            )@ _request(0);s-         }o-         rurtore_flags(flags);
-#iH_DEBUGs-         priN@k("LeaviERcdo_cdu31a_requestca@T%d\n", __LINE__);n-v)@ vNn-TC       retnsi;M-      }s-   }s-   sony_inus_C= 1;s-   has_cd_taskC= current;s-M-   /*CGet  rive y  pus before dovng anything. */M-   wh
 
 (handle_sony_cd_attentt *())s-      ;n-s-   /* Make surecwe have a valid TOC. */M-   sony_get_toc(); o-n-   spin_unlock_irq(&io_request_lock);n-s-   /* Make surecthectimer is cancelled. */M-   del_timer(&cdu31a_abort_timer);n-s-   wh
 
 (1)n-   {s-cdu31a_request_8  rtover:s-      /*n-TC     *CThecbegtnniERchere is rtolen f0xmCthe hardc vsk  river.  I hopen-TC     *Cit's eight.n-TC     +/M-      iUR	QUEUE_EMPTY || CURRENT->rq_y  pus == RQ_INACTIVE)s-      { -         goto )@ _do_cdu31a_request;
-      }o-o-      iUR	!sony_spun_up)s-      { -         scd_spinup();
-      }o-o-      /*CI don't us_CINIT_REQUEST becaus_Ci@ callsCretnsi, wh
ch wouldn-TC       retnsi without unlockiERcthec evice.  I@Tshouldn't matter,
-         but just to be safe... +/M-      iUR	MAJOR(CURRENT->rq_ ev) != MAJOR_NR)n-      { -	 panic(DEVICE_NAME ":crequest list destroyed");s-      }s-      iUR	CURRENT->bh)n-      { -	 iUR	!buff_r_locked	CURRENT->bh))s-         {
-	    panic(DEVICE_NAME ":cblockcnotRlocked");s-         }o-      }s-o-      blockT= CURRENT->sector;n-     cnblockT= CURRENT->nr_sectors;o-o-      iUR	!sony_toc_e ad)n-      { -	 priN@k("CDU31A: TOCcnotRe ad\n");n-	 )@ _request(0);s-	 goto cdu31a_request_8  rtover;
-      }o-o-      switch	CURRENT->cmd)s-      { -      case READ: -         /*
-          *CIf thecblockcaddressMis invalid _SMthecrequest goes beyond the )@  oU
-          *Cthecmedia, retnsi an error.
-          */n+	int block;n+	int nblock;n+	unsigned char rur_reg[12];n+	unsigned int res_size;
+	int num_retries;
+	unsigned long flags;
+s+ +#iH_DEBUGs+	priN@k("EnteriERcdo_cdu31a_request\n");n+v)@ vN
+M+	/*C
+	 * Make surecno one )lse is usiERcthec river; wai@TG_SMthem
+	 * to finishCif i@ is so.
+	 */M+	save_flags(flags);
+	cli();
+	wh
 
 (sony_inus_) {
+		interruptible_sleep_on(&sony_wait);o+		iUR	signal_p)@ vng	current)) {n+			restore_flags(flags);
+			iUR	!QUEUE_EMPTY
+			    &&RCURRENT->rq_y  pus != RQ_INACTIVE) {n+				)@ _request(0);s+			}
+			restore_flags(flags);
+#iH_DEBUGs+			priN@k("LeaviERcdo_cdu31a_requestca@T%d\n",
+			       __LINE__);n+v)@ vN
+			retnsi;M+		}
+	}s+	sony_inus_C= 1;s+	has_cd_taskC= current;s+M+	/*CGet  rive y  pus before dovng anything. */M+	wh
 
 (handle_sony_cd_attentt *());n+s+	/* Make surecwe have a valid TOC. */M+	sony_get_toc();s+ +	spin_unlock_irq(&io_request_lock);n+s+	/* Make surecthectimer is cancelled. */M+	del_timer(&cdu31a_abort_timer);n+ +	wh
 
 (1) {n+	      cdu31a_request_8  rtover:s+		/*o+		 *CThecbegtnniERchere is rtolen f0xmCthe hardc vsk  river.  I hopen+		 *Cit's eight.n+		 */M+		iUR	QUEUE_EMPTY || CURRENT->rq_y  pus == RQ_INACTIVE) {
+			goto )@ _do_cdu31a_request;
+		}
+
+		iUR	!sony_spun_up) {
+			scd_spinup();
+		}
+
+		/* I don't us_CINIT_REQUEST becaus_Ci@ callsCretnsi, wh
ch wouldn+		   retnsi without unlockiERcthec evice.  I@Tshouldn't matter,
+		   but just to be safe... +/M+		iUR	MAJOR(CURRENT->rq_ ev) != MAJOR_NR) {n+			panic(DEVICE_NAME ":crequest list destroyed");s+		}
+		iUR	CURRENT->bh) {n+			iUR	!buff_r_locked	CURRENT->bh)) {n+				panic(DEVICE_NAME ":cblockcnotRlocked");s+			}
+		}
+
+		blockT= CURRENT->sector;n+		nblockT= CURRENT->nr_sectors;o+
+		iUR	!sony_toc_e ad) {n+			priN@k("CDU31A: TOCcnotRe ad\n");n+			)@ _request(0);s+			goto cdu31a_request_8  rtover;
+		}
+
+		switch 	CURRENT->cmd) {n+		case READ: +			/*
+			 *CIf thecblockcaddressMis invalid _SMthecrequest goes beyond the )@  oU
+			 *Cthecmedia, retnsi an error.
+			 */
 #iH_0 -	 iUR	(block / 4)T< sony_toc.rtart_track_lba)
-	 {
-            priN@k("CDU31A: Request before begtnniERcoURmedia\n");n-            )@ _request(0);s-            goto cdu31a_request_8  rtover;
-	 }o-#)@ vNn-TC       iUR	(block / 4)T>= sony_toc.lead_out_8  rt_lba)
-         {
-            priN@k("CDU31A: Request past )@  oURmedia\n");n-            )@ _request(0);s-            goto cdu31a_request_8  rtover;
-         }o-         iUR	((block + nblock) / 4)T>= sony_toc.lead_out_8  rt_lba)
-         {
-            priN@k("CDU31A: Request past )@  oURmedia\n");n-            )@ _request(0);s-            goto cdu31a_request_8  rtover;
-         }o-
- TC      num_retriesT= 0;s-n-try_read_again:s-         wh
 
 (handle_sony_cd_attentt *())s-            ;n-s-         iUR	!sony_toc_e ad)n-         {
-	    priN@k("CDU31A: TOCcnotRe ad\n");n-	    )@ _request(0);s-	    goto cdu31a_request_8  rtover;
-         }o-
-	 /*CIf no  ata is lef@ to be e ad G0xmcthec rive, 8tart thes-	    next request. */s-         iUR	sony_blocks_lef@ == 0)n-         {
-            iUR	start_request(block / 4, CDU31A_READAHEAD / 4, 0))n-            {
-               )@ _request(0);s-               goto cdu31a_request_8  rtover;
-            }o-         }o-	 /*CIf thecrequested block is notRthecnext one waitiERcins-	    thec river, abort theccurrent operatt * and s  rt as-	    new one. */s-         )lse iUR	block != sony_next_block)n-         {
-#iH_DEBUGs-            priN@k("CDU31A WarniER: ReadRG_SMblock %d, expected %d\n",
-                   block,
-                   sony_next_block);n-v)@ vNn-TC          abort_e ad();s-            iUR	!sony_toc_e ad)n-            {
-	       priN@k("CDU31A: TOCcnotRe ad\n");n-	       )@ _request(0);s-               goto cdu31a_request_8  rtover;
-            }o-            iUR	start_request(block / 4, CDU31A_READAHEAD / 4, 0))n-            {
-               priN@k("CDU31a: s  rt request failed\n");n-               )@ _request(0);s-               goto cdu31a_request_8  rtover;
-            }o-         }o-M-         read_ ata_block(CURRENT->buff_r, block, nblock, rer_reg, &res_size);n-         iUR	rer_reg[0]T== 0x20)s-         {
-            iUR	num_retriesT> MAX_CDU31A_RETRIES)n-            {
-               )@ _request(0);s-               goto cdu31a_request_8  rtover;
-            }o-
-            num_retries++;o-            iUR	rur_reg[1]T== SONY_NOT_SPIN_ERR)n-            {
-               do_sony_cd_cmd(SONY_SPIN_UP_CMD, NULL, 0, rur_reg, &res_size);n-            }o-            )lses-            {
-               priN@k("CDU31A: %s errorRG_SMblock %d, nblock %d\n", transl p,_error(res_reg[1]), block, nblock);n-            }o-            goto try_read_again;o-         }o-         )lses-         {
-            )@ _request(1);s-         }o-         be ak;M-             -      case WRITE:s-         )@ _request(0);s-         be ak;M-             -      default:s-         panic("CDU31A: Unknown cmd");M-      }s-   }s+			iUR	(block / 4)T< sony_toc.rtart_track_lba) {n+				priN@kn+				    ("CDU31A: Request before begtnniERcoURmedia\n");n+				)@ _request(0);s+				goto cdu31a_request_8  rtover;
+			}
+#)@ vN
+			iUR	(block / 4)T>= sony_toc.lead_out_8  rt_lba) {n+				priN@kn+				    ("CDU31A: Request past )@  oURmedia\n");n+				)@ _request(0);s+				goto cdu31a_request_8  rtover;
+			}
+			iUR	((block + nblock) / 4)T>=
+			    sony_toc.lead_out_8  rt_lba) {n+				priN@kn+				    ("CDU31A: Request past )@  oURmedia\n");n+				)@ _request(0);s+				goto cdu31a_request_8  rtover;
+			}
+
+			num_retriesT= 0;s+o+		      try_read_again:s+			wh
 
 (handle_sony_cd_attentt *());n+s+			iUR	!sony_toc_e ad) {n+				priN@k("CDU31A: TOCcnotRe ad\n");n+				)@ _request(0);s+				goto cdu31a_request_8  rtover;
+			}
+
+			/*CIf no  ata is lef@ to be e ad G0xmcthec rive, 8tart thes+			   next request. */s+			iUR	sony_blocks_lef@ == 0) {n+				iUR	start_requestn+				    (block / 4, CDU31A_READAHEAD / 4, 0)) {n+					)@ _request(0);s+					goto cdu31a_request_8  rtover;
+				}
+			} +			/*CIf thecrequested block is notRthecnext one waitiERcins+			   the  river, abort theccurrent operatt * and s  rt as+			   new one. */s+			)lse iUR	block != sony_next_block)l{ +#iH_DEBUGs+				priN@kn+				    ("CDU31A WarniER: ReadRG_SMblock %d, expected %d\n",
+				     block, sony_next_block);n+#)@ vN
+				abort_e ad();M+				iUR	!sony_toc_e ad) {n+					priN@k("CDU31A: TOCcnotRe ad\n");n+					)@ _request(0);s+					goto cdu31a_request_8  rtover;
+				}
+				iUR	start_requestn+				    (block / 4, CDU31A_READAHEAD / 4, 0)) {n+					priN@kn+					    ("CDU31a: s  rt request failed\n");n+					)@ _request(0);s+					goto cdu31a_request_8  rtover;
+				}
+			} +M+			read_ ata_block(CURRENT->buff_r, block, nblock,n+					rer_reg, &res_size);n+			iUR	rer_reg[0]T== 0x20) {n+				iUR	num_retriesT> MAX_CDU31A_RETRIES) {n+					)@ _request(0);s+					goto cdu31a_request_8  rtover;
+				}
+
+				num_retries++;o+				iUR	rer_reg[1]T== SONY_NOT_SPIN_ERR) {n+					do_sony_cd_cmd(SONY_SPIN_UP_CMD,s+						       NULL, 0, rur_reg,s+						       &res_size);n+				} )lse {
+					priN@kn+					    ("CDU31A: %s errorRG_SMblock %d, nblock %d\n",
+					     transl p,_error(res_reg[1]),
+					     block, nblock);n+				}
+				goto try_read_again;o+			} )lse {
+				)@ _request(1);s+			} +			be ak;M+n+		case WRITE:s+			)@ _request(0);s+			be ak;M+n+		default:s+			panic("CDU31A: Unknown cmd");M+		}
+	}s 
-)@ _do_cdu31a_request:n-   spin_lock_irq(&io_request_lock);n+      )@ _do_cdu31a_request:n+	spin_lock_irq(&io_request_lock);n #iH_0 -   /*CAfter finished, cancelcany p)@ vng operatt *s. */s-   abort_e ad();M+	/*CAfter finished, cancelcany p)@ vng operatt *s. */s+	abort_e ad();M #)lses-   /* S  rt actimer toctime out after a wh
 
 to disab 

-      thece ad. */s-   cdu31a_abort_timer.expiresT= jiffiesT+ 2*HZ; /*CWai@T2 seconds */s-   add_timer(&cdu31a_abort_timer);n+	/* S  rt actimer toctime out after a wh
 
 to disab 

+	   thece ad. */s+	cdu31a_abort_timer.expiresT= jiffiesT+ 2 * HZ;	/*CWai@T2 seconds */s+	add_timer(&cdu31a_abort_timer);n v)@ vNn s-   has_cd_taskC= NULL;s-   sony_inus_C= 0;n-TC wake_up_interruptible(&sony_wait);o-   restore_flags(flags);
+	has_cd_taskC= NULL;s+	sony_inus_C= 0;n+	wake_up_interruptible(&sony_wait);o+	restore_flags(flags);
 #iH_DEBUGs-   priN@k("LeaviERcdo_cdu31a_requestca@T%d\n", __LINE__);n+	priN@k("LeaviERcdo_cdu31a_requestca@T%d\n", __LINE__);n v)@ vNn }n s@@
n1878,356 +1755,473 y s  * ReadRthectab 
 oURcontents G0xmCthe  rive and set up TOCcvNn  * successful.
  */M-y  pF TES <
-sony_get_toc(ES <)n+y  pF TES < sony_get_toc(ES <)n {n-   unsigned char rur_reg[2];M-   unsigned int res_size;
-   unsigned char pa ms[1];
-   int sesst *;
-   int num_spin_ups;
-   int totaltracksC= 0;n-TC int miN@ = 99;n-TC int max@T= 0;s-n-#iH_DEBUGs-   priN@k("EnteriERc8ony_get_toc\n");n-v)@ vNn-M-   num_spin_upsC= 0;n-TC iUR	!sony_toc_e ad)n-   {
-respinup_on_gettoc:o-      /*CIgnorecthecresult, since it might errorRiURspinniERcalready. */s-      do_sony_cd_cmd(SONY_SPIN_UP_CMD, NULL, 0, rur_reg, &res_size);n-s-      do_sony_cd_cmd(SONY_READ_TOC_CMD, NULL, 0, rur_reg, &res_size);n-s-      /*CThec rive sometimescretnsis errorR0.  I don't know why, but ignoren-         it.  I@TseemsMtoRmeanCthe  rive has already done the operatt *. +/M-      iUR	(e 8_sizeT< 2) || (	rer_reg[0]T!= 0) &&R(rer_reg[1]T!= 0)))n-      {n-TC       /*CIf thec rive is already playiER,Cit's ok.  */s-         iUR	(res_reg[1]T== SONY_AUDIO_PLAYING_ERR) || (rer_reg[1]T== 0))n-         {
-            goto gettoc_ rive_spinniER;
-         }o-o-         /*CIf thec rive says i@ is notRspun up (even thoughcwe just d < it!)n-            then retry the operatt *ca@Tleast a few times. */s-         iUR	   (rer_reg[1]T== SONY_NOT_SPIN_ERR)n-             &&R(num_spin_upsC< MAX_CDU31A_RETRIES))n-         {
-            num_spin_ups++;o-            goto respinup_on_gettoc;
-         }o-o-         priN@k("cdu31a: Error readiERcTOC: %x %s\n",
-                rer_reg[0], transl p,_error(res_reg[1]));n-	 retnsi;M-      }s-
-gettoc_ rive_spinniER:n-s-      /*CThecideachere is we keep askiERcG_SMsesst *s untilctheccommandn-	 fails.  Then we know what theclast valid sesst * onRthec vsk is.
-	 No need to check sesst * 0, since sesst * 0 is thecsame as sesst *
-         1;ctheccommand retnsis  vNf_rent inG_Smatt *ciURyou give itR0. 
-        */s-#iH_DEBUGs-      memset(&sony_toc, 0x0e, 8izeof(sony_toc));M-      memset(&siERle_toc, 0x0f, 8izeof(siERle_toc));n-v)@ vNn-TC    sesst * = 1;s-      wh
 
 (1)n-      {
+	unsigned char rur_reg[2];n+	unsigned int res_size;
+	unsigned char pa ms[1];
+	int sesst *;
+	int num_spin_ups;
+	int totaltracksC= 0;n+	int miN@ = 99;n+	int max@T= 0;s+ +#iH_DEBUGs+	priN@k("EnteriERc8ony_get_toc\n");n+v)@ vN
+M+	num_spin_upsC= 0;n+	iUR	!sony_toc_e ad) {n+	      rerpinup_on_gettoc:o+		/* Ignorecthecresult, since it might errorRiURspinniERcalready. */s+		do_sony_cd_cmd(SONY_SPIN_UP_CMD, NULL, 0, rur_reg,s+			       &res_size);n+s+		do_sony_cd_cmd(SONY_READ_TOC_CMD, NULL, 0, rur_reg,s+			       &res_size);n+s+		/*CThec rive sometimescretnsis errorR0.  I don't know why, but ignoren+		   it.  I@TseemsMtoRmeanCthe  rive has already done the operatt *. +/M+		iUR	(rer_sizeT< 2)o+		    || (	rer_reg[0]T!= 0) &&R(rer_reg[1]T!= 0))) {
+			/*CIf thec rive is already playiER,Cit's ok.  */s+			iUR	(res_reg[1]T== SONY_AUDIO_PLAYING_ERR)s+			    || (rer_reg[1]T== 0)) {n+				goto gettoc_ rive_spinniER;
+			}
+
+			/*CIf thec rive says i@ is notRspun up (even thoughcwe just d < it!)n+			   then retry the operatt *ca@Tleast a few times. */s+			iUR	(res_reg[1]T== SONY_NOT_SPIN_ERR)n+			    &&R(num_spin_upsC< MAX_CDU31A_RETRIES)) {n+				num_spin_ups++;o+				goto respinup_on_gettoc;
+			}
+
+			priN@k("cdu31a: Error readiERcTOC: %x %s\n",
+			       rer_reg[0], transl p,_error(res_reg[1]));n+			retnsi;M+		}
+n+	      gettoc_ rive_spinniER:n+s+		/*CThecideachere is we keep askiERcG_SMsesst *s untilctheccommandn+		   fails.  Then we know what theclast valid sesst * onRthec vsk is.
+		   No need to check sesst * 0, since sesst * 0 is thecsame as sesst *
+		   1;ctheccommand retnsis  vNf_rent inG_Smatt *ciURyou give itR0. 
+		 */M+#iH_DEBUGs+		memset(&sony_toc, 0x0e, 8izeof(sony_toc));M+		memset(&siERle_toc, 0x0f, 8izeof(siERle_toc));n+#)@ vN
+		sesst * = 1;s+		wh
 
 (1) {n /*CThis reemsMtoRslow things down enoughctoRmake it work.  Thisn  * appears to be a prob 
m in do_sony_cd_cmd.  This priN@k reemsM
  * to addressMthecsymptoms...  -Erik */
 #iH_1o-         priN@k("cdu31a: TryiERc8esst * %d\n", 8esst *);n+			priN@k("cdu31a: TryiERc8esst * %d\n", 8esst *);n v)@ vNn-	 pa ms[0]T= sesst *;
-	 do_sony_cd_cmd(SONY_READ_TOC_SPEC_CMD,
-			pa ms,
-			1, 
-			rur_reg,s-			&res_size);n-s-#iH_DEBUGs-         priN@k("%2.2x %2.2x\n", rer_reg[0], rur_reg[1]);n-v)@ vNn-M-	 iUR	(e 8_sizeT< 2) || (	rer_reg[0]T& 0xf0) == 0x20))
-	 {
-	    /*CAn error readiERcthecTOC, this must be past theclast sesst *. */s-	     iUR	sesst * == 1)
-		    priN@k("Yikes! Couldn't e ad any sesst *s!");n-	    be ak;M-         }o-#iH_DEBUGs-         priN@k("ReadiERc8esst * %d\n", 8esst *);n-v)@ vNn-M-         pa ms[0]T= sesst *;
-         do_sony_cd_cmd(SONY_REQ_TOC_DATA_SPEC_CMD,
-		     pa ms,
-		     1, 
-		     (unsigned char *) &siERle_toc, 
-		     &res_size);n-         iUR	(res_sizeT< 2) || (	siERle_toc.exec_y  pus[0]T& 0xf0) == 0x20))
-         {
-            priN@k("cdu31a: Error readiERc8esst * %d: %x %s\n",
-                8esst *,
-                8iERle_toc.exec_y  pus[0],
-                transl p,_error(8iERle_toc.exec_y  pus[1]));n-	    /*CAn error readiERcthecTOC.  Retnsi without sony_toc_e adn-	       set. */s-	    retnsi;M-         }o-#iH_DEBUGs-      priN@k("add0 %01x,Rcon0 %01x,Rpoi0 %02x,R1st trk %d, dsktyp %x, dum0 %x\n",
-              8iERle_toc.address0, sinRle_toc.control0, sinRle_toc.point0,
-              bcd_to_int(8iERle_toc.first_track_num), sinRle_toc. vsk_type, sinRle_toc. ummy0);s-      priN@k("add1 %01x,Rcon1 %01x,Rpoi1 %02x,Rlst trk %d, dummy1 %x, dum2 %x\n",
-              8iERle_toc.address1, sinRle_toc.control1, sinRle_toc.point1,
-              bcd_to_int(8iERle_toc.last_track_num), sinRle_toc. ummy1, sinRle_toc. ummy2);s-      priN@k("add2 %01x,Rcon2 %01x,Rpoi2 %02xTleadout s  rt miN %d, sec %d, frame %d\n",
-              8iERle_toc.address2, sinRle_toc.control2, sinRle_toc.point2,
-              bcd_to_int(8iERle_toc.lead_out_8  rt_msf[0]),
-              bcd_to_int(8iERle_toc.lead_out_8  rt_msf[1]),
-              bcd_to_int(8iERle_toc.lead_out_8  rt_msf[2]));o-      iUR	res_sizeT> 18 &&RsinRle_toc.pointb0T> 0xaf)s-      priN@k("addb0 %01x,Rconb0 %01x,Rpoib0 %02x,Rnext8esst * miN %d, sec %d, frame %d\n"
-             "#mode5_ptrs %02d, max_8  rt_out_r_leadout_msf miN %d, sec %d, frame %d\n",
-              8iERle_toc.addressb0, sinRle_toc.controlb0, sinRle_toc.pointb0,
-              bcd_to_int(8iERle_toc.next_poss_prog_ae a_msf[0]),
-              bcd_to_int(8iERle_toc.next_poss_prog_ae a_msf[1]),
-              bcd_to_int(8iERle_toc.next_poss_prog_ae a_msf[2]),
-              8iERle_toc.num_mode_5_pointers,
-              bcd_to_int(8iERle_toc.max_8  rt_out_r_leadout_msf[0]),
-              bcd_to_int(8iERle_toc.max_8  rt_out_r_leadout_msf[1]),
-              bcd_to_int(8iERle_toc.max_8  rt_out_r_leadout_msf[2]));o-      iUR	res_sizeT> 27 &&RsinRle_toc.pointb1T> 0xaf)s-      priN@k("addb1 %01x,Rconb1 %01x,Rpoib1 %02x,R%x %x %x %x #skipiN@_ptrs %d, #skiptrkassign %d %x\n",
-              8iERle_toc.addressb1, sinRle_toc.controlb1, sinRle_toc.pointb1,
-              8iERle_toc. ummyb0_1[0],
-              8iERle_toc. ummyb0_1[1],
-              8iERle_toc. ummyb0_1[2],
-              8iERle_toc. ummyb0_1[3],
-              8iERle_toc.num_skip_interval_pointers,
-              8iERle_toc.num_skip_track_assignments,
-              8iERle_toc. ummyb0_2);o-      iUR	res_sizeT> 36 &&RsinRle_toc.pointb2T> 0xaf)s-      priN@k("addb2 %01x,Rconb2 %01x,Rpoib2 %02x,R%02xT%02xT%02xT%02xT%02xT%02xT%02x\n",
-              8iERle_toc.addressb2, sinRle_toc.controlb2, sinRle_toc.pointb2,
-              8iERle_toc.tracksb2[0],
-              8iERle_toc.tracksb2[1],
-              8iERle_toc.tracksb2[2],
-              8iERle_toc.tracksb2[3],
-              8iERle_toc.tracksb2[4],
-              8iERle_toc.tracksb2[5],
-              8iERle_toc.tracksb2[6]);o-      iUR	res_sizeT> 45 &&RsinRle_toc.pointb3T> 0xaf)s-      priN@k("addb3 %01x,Rconb3 %01x,Rpoib3 %02x,R%02xT%02xT%02xT%02xT%02xT%02xT%02x\n",
-              8iERle_toc.addressb3, sinRle_toc.controlb3, sinRle_toc.pointb3,
-              8iERle_toc.tracksb3[0],
-              8iERle_toc.tracksb3[1],
-              8iERle_toc.tracksb3[2],
-              8iERle_toc.tracksb3[3],
-              8iERle_toc.tracksb3[4],
-              8iERle_toc.tracksb3[5],
-              8iERle_toc.tracksb3[6]);o-      iUR	res_sizeT> 54 &&RsinRle_toc.pointb4T> 0xaf)s-      priN@k("addb4 %01x,Rconb4 %01x,Rpoib4 %02x,R%02xT%02xT%02xT%02xT%02xT%02xT%02x\n",
-              8iERle_toc.addressb4, sinRle_toc.controlb4, sinRle_toc.pointb4,
-              8iERle_toc.tracksb4[0],
-              8iERle_toc.tracksb4[1],
-              8iERle_toc.tracksb4[2],
-              8iERle_toc.tracksb4[3],
-              8iERle_toc.tracksb4[4],
-              8iERle_toc.tracksb4[5],
-              8iERle_toc.tracksb4[6]);o-      iUR	res_sizeT> 63 &&RsinRle_toc.pointc0T> 0xaf)s-      priN@k("addc0 %01x,Rconc0 %01x,Rpoic0 %02x,R%02xT%02xT%02xT%02xT%02xT%02xT%02x\n",
-              8iERle_toc.addressc0, sinRle_toc.controlc0, sinRle_toc.pointc0,
-              8iERle_toc. ummyc0[0],
-              8iERle_toc. ummyc0[1],
-              8iERle_toc. ummyc0[2],
-              8iERle_toc. ummyc0[3],
-              8iERle_toc. ummyc0[4],
-              8iERle_toc. ummyc0[5],
-              8iERle_toc. ummyc0[6]);
+			pa ms[0]T= sesst *;
+			do_sony_cd_cmd(SONY_READ_TOC_SPEC_CMD,
+				       pa ms, 1, rer_reg, &res_size);n+
+#iH_DEBUGs+			priN@k("%2.2x %2.2x\n", rer_reg[0], rur_reg[1]);n+v)@ vN
+M+			iUR	(rer_sizeT< 2)o+			    || (	rer_reg[0]T& 0xf0) == 0x20)) {n+				/*CAn error readiERcthecTOC, this must be past theclast sesst *. */s+				iUR	sesst * == 1)
+					priN@kn+					    ("Yikes! Couldn't e ad any sesst *s!");n+				be ak;M+			}
+#iH_DEBUGs+			priN@k("ReadiERc8esst * %d\n", 8esst *);n+v)@ vN
+M+			pa ms[0]T= sesst *;
+			do_sony_cd_cmd(SONY_REQ_TOC_DATA_SPEC_CMD,
+				       pa ms,
+				       1,
+				       (unsigned char *) &siERle_toc,
+				       &res_size);n+			iUR	(res_sizeT< 2)o+			    || (	siERle_toc.exec_y  pus[0]T& 0xf0) ==
+				0x20)) {n+				priN@kn+				    ("cdu31a: Error readiERc8esst * %d: %x %s\n",
+				     8esst *, 8iERle_toc.exec_y  pus[0],
+				     transl p,_error(8iERle_toc.s+						     exec_y  pus[1]));n+				/*CAn error readiERcthecTOC.  Retnsi without sony_toc_e adn+				   set. */s+				retnsi;M+			}
+#iH_DEBUGs+			priN@ko+			    ("add0 %01x,Rcon0 %01x,Rpoi0 %02x,R1st trk %d, dsktyp %x, dum0 %x\n",
+			     8iERle_toc.address0, sinRle_toc.control0,
+			     8iERle_toc.point0,
+			     bcd_to_int(8iERle_toc.first_track_num),
+			     8iERle_toc. vsk_type, sinRle_toc. ummy0);s+			priN@ko+			    ("add1 %01x,Rcon1 %01x,Rpoi1 %02x,Rlst trk %d, dummy1 %x, dum2 %x\n",
+			     8iERle_toc.address1, sinRle_toc.control1,
+			     8iERle_toc.point1,
+			     bcd_to_int(8iERle_toc.last_track_num),
+			     8iERle_toc. ummy1, sinRle_toc. ummy2);s+			priN@ko+			    ("add2 %01x,Rcon2 %01x,Rpoi2 %02xTleadout s  rt miN %d, sec %d, frame %d\n",
+			     8iERle_toc.address2, sinRle_toc.control2,
+			     8iERle_toc.point2,
+			     bcd_to_int(8iERle_toc.lead_out_8  rt_msf[0]),
+			     bcd_to_int(8iERle_toc.lead_out_8  rt_msf[1]),
+			     bcd_to_int(8iERle_toc.lead_out_8  rt_msf[2]));n+			iUR	res_sizeT> 18 &&RsinRle_toc.pointb0T> 0xaf)s+				priN@kn+				    ("addb0 %01x,Rconb0 %01x,Rpoib0 %02x,Rnext8esst * miN %d, sec %d, frame %d\n"
+				     "#mode5_ptrs %02d, max_8  rt_out_r_leadout_msf miN %d, sec %d, frame %d\n",
+				     8iERle_toc.addressb0,
+				     8iERle_toc.controlb0,
+				     8iERle_toc.pointb0,
+				     bcd_to_int(8iERle_toc.s+						next_poss_prog_ae a_msfs+						[0]),
+				     bcd_to_int(8iERle_toc.s+						next_poss_prog_ae a_msfs+						[1]),
+				     bcd_to_int(8iERle_toc.s+						next_poss_prog_ae a_msfs+						[2]),
+				     8iERle_toc.num_mode_5_pointers,
+				     bcd_to_int(8iERle_toc.s+						max_8  rt_out_r_leadout_msfs+						[0]),
+				     bcd_to_int(8iERle_toc.s+						max_8  rt_out_r_leadout_msfs+						[1]),
+				     bcd_to_int(8iERle_toc.s+						max_8  rt_out_r_leadout_msfs+						[2]));n+			iUR	res_sizeT> 27 &&RsinRle_toc.pointb1T> 0xaf)s+				priN@kn+				    ("addb1 %01x,Rconb1 %01x,Rpoib1 %02x,R%x %x %x %x #skipiN@_ptrs %d, #skiptrkassign %d %x\n",
+				     8iERle_toc.addressb1,
+				     8iERle_toc.controlb1,
+				     8iERle_toc.pointb1,
+				     8iERle_toc. ummyb0_1[0],
+				     8iERle_toc. ummyb0_1[1],
+				     8iERle_toc. ummyb0_1[2],
+				     8iERle_toc. ummyb0_1[3],
+				     8iERle_toc.num_skip_interval_pointers,
+				     8iERle_toc.num_skip_track_assignments,
+				     8iERle_toc. ummyb0_2);n+			iUR	res_sizeT> 36 &&RsinRle_toc.pointb2T> 0xaf)s+				priN@kn+				    ("addb2 %01x,Rconb2 %01x,Rpoib2 %02x,R%02xT%02xT%02xT%02xT%02xT%02xT%02x\n",
+				     8iERle_toc.addressb2,
+				     8iERle_toc.controlb2,
+				     8iERle_toc.pointb2,
+				     8iERle_toc.tracksb2[0],
+				     8iERle_toc.tracksb2[1],
+				     8iERle_toc.tracksb2[2],
+				     8iERle_toc.tracksb2[3],
+				     8iERle_toc.tracksb2[4],
+				     8iERle_toc.tracksb2[5],
+				     8iERle_toc.tracksb2[6]);
+			iUR	res_sizeT> 45 &&RsinRle_toc.pointb3T> 0xaf)s+				priN@kn+				    ("addb3 %01x,Rconb3 %01x,Rpoib3 %02x,R%02xT%02xT%02xT%02xT%02xT%02xT%02x\n",
+				     8iERle_toc.addressb3,
+				     8iERle_toc.controlb3,
+				     8iERle_toc.pointb3,
+				     8iERle_toc.tracksb3[0],
+				     8iERle_toc.tracksb3[1],
+				     8iERle_toc.tracksb3[2],
+				     8iERle_toc.tracksb3[3],
+				     8iERle_toc.tracksb3[4],
+				     8iERle_toc.tracksb3[5],
+				     8iERle_toc.tracksb3[6]);
+			iUR	res_sizeT> 54 &&RsinRle_toc.pointb4T> 0xaf)s+				priN@kn+				    ("addb4 %01x,Rconb4 %01x,Rpoib4 %02x,R%02xT%02xT%02xT%02xT%02xT%02xT%02x\n",
+				     8iERle_toc.addressb4,
+				     8iERle_toc.controlb4,
+				     8iERle_toc.pointb4,
+				     8iERle_toc.tracksb4[0],
+				     8iERle_toc.tracksb4[1],
+				     8iERle_toc.tracksb4[2],
+				     8iERle_toc.tracksb4[3],
+				     8iERle_toc.tracksb4[4],
+				     8iERle_toc.tracksb4[5],
+				     8iERle_toc.tracksb4[6]);
+			iUR	res_sizeT> 63 &&RsinRle_toc.pointc0T> 0xaf)s+				priN@kn+				    ("addc0 %01x,Rconc0 %01x,Rpoic0 %02x,R%02xT%02xT%02xT%02xT%02xT%02xT%02x\n",
+				     8iERle_toc.addressc0,
+				     8iERle_toc.controlc0,
+				     8iERle_toc.pointc0,
+				     8iERle_toc. ummyc0[0],
+				     8iERle_toc. ummyc0[1],
+				     8iERle_toc. ummyc0[2],
+				     8iERle_toc. ummyc0[3],
+				     8iERle_toc. ummyc0[4],
+				     8iERle_toc. ummyc0[5],
+				     8iERle_toc. ummyc0[6]);
 v)@ vNn #undeH_DEBUGs #deHine_DEBUG 0
 
-      sony_toc.lead_out_8  rt_msf[0] = bcd_to_int(8iERle_toc.lead_out_8  rt_msf[0]);
-      sony_toc.lead_out_8  rt_msf[1] = bcd_to_int(8iERle_toc.lead_out_8  rt_msf[1]);
-      sony_toc.lead_out_8  rt_msf[2] = bcd_to_int(8iERle_toc.lead_out_8  rt_msf[2]);
-      sony_toc.lead_out_8  rt_lbaT= siERle_toc.lead_out_8  rt_lbaT=
-                    msf_to_log(sony_toc.lead_out_8  rt_msf);n-s-      /*CFor points tha@Tdo notRexist, move thec ata over them
-	 to theceightRlocatt *. +/M-      iUR	sinRle_toc.pointb0T!= 0xb0)n-      { -	 memmove(((char *) &siERle_toc)T+ 27,
-		 ((char *) &siERle_toc)T+ 18,
-		 res_sizeT- 18);n-	 res_sizeT+= 9;s-      }s-      )lse iUR	res_sizeT> 18) {
-        sony_toc.lead_out_8  rt_msf[0] = bcd_to_int(8iERle_toc.max_8  rt_out_r_leadout_msf[0]);
-        sony_toc.lead_out_8  rt_msf[1] = bcd_to_int(8iERle_toc.max_8  rt_out_r_leadout_msf[1]);
-        sony_toc.lead_out_8  rt_msf[2] = bcd_to_int(8iERle_toc.max_8  rt_out_r_leadout_msf[2]);
-        sony_toc.lead_out_8  rt_lbaT= msf_to_log(sony_toc.lead_out_8  rt_msf);n-      }s-      iUR	sinRle_toc.pointb1T!= 0xb1)n-      { -	 memmove(((char *) &siERle_toc)T+ 36,
-		((char *) &siERle_toc)T+ 27,
-		res_sizeT- 27);n-	 res_sizeT+= 9;s-      }s-      iUR	sinRle_toc.pointb2T!= 0xb2)n-      { -	 memmove(((char *) &siERle_toc)T+ 45,
-		((char *) &siERle_toc)T+ 36,
-		res_sizeT- 36);n-	 res_sizeT+= 9;s-      }s-      iUR	sinRle_toc.pointb3T!= 0xb3)n-      { -	 memmove(((char *) &siERle_toc)T+ 54,
-		((char *) &siERle_toc)T+ 45,
-		res_sizeT- 45);n-	 res_sizeT+= 9;s-      }s-      iUR	sinRle_toc.pointb4T!= 0xb4)n-      { -	 memmove(((char *) &siERle_toc)T+ 63,
-		((char *) &siERle_toc)T+ 54,
-		res_sizeT- 54);n-	 res_sizeT+= 9;s-      }s-      iUR	sinRle_toc.pointc0T!= 0xc0)n-      { -	 memmove(((char *) &siERle_toc)T+ 72,
-		((char *) &siERle_toc)T+ 63,
-		res_sizeT- 63);n-	 res_sizeT+= 9;s-      }s-o-#iH_DEBUGs-      priN@k("8tart track lbaT%u, Tleadout s  rt lbaT%u\n",
-              8iERle_toc.rtart_track_lba, siERle_toc.lead_out_8  rt_lba);n-      { int i;
-        G_SM(iC= 0; i < 1T+ bcd_to_int(8iERle_toc.last_track_num)
-                          - bcd_to_int(8iERle_toc.first_track_num); i++) {
-          priN@k("trk %02d: add 0x%01x,Rcon 0x%01x,R track %02d, s  rt miN %02d, sec %02d, frame %02d\n",
-                 i, 8iERle_toc.tracks[i].address, 8iERle_toc.tracks[i].control,
-                 bcd_to_int(8iERle_toc.tracks[i].track),
-                 bcd_to_int(8iERle_toc.tracks[i].track_8  rt_msf[0]),
-                 bcd_to_int(8iERle_toc.tracks[i].track_8  rt_msf[1]),
-                 bcd_to_int(8iERle_toc.tracks[i].track_8  rt_msf[2]));o-          iUR	miN@ > bcd_to_int(8iERle_toc.tracks[i].track))
-            miN@ = bcd_to_int(8iERle_toc.tracks[i].track);o-          iUR	max@T< bcd_to_int(8iERle_toc.tracks[i].track))
-            max@T= bcd_to_int(8iERle_toc.tracks[i].track);o-        }o-        priN@k("miN track number %d,   max track number %d\n", miN@, maxt);n-      }s-v)@ vNn-M-         /*Cprepare a special tab 
 oURcontents Gorca CD-Ic vsc. They don't have one. */s-         iUR	sinRle_toc. vsk_type == 0x10 &&
-             8iERle_toc.first_track_num == 2 &&
-             8iERle_toc.last_track_num == 2 /*CCD-Ic*/)
-         {
-            sony_toc.tracks[totaltracks].address = 1;s-	    sony_toc.tracks[totaltracks].control = 4; /*CGorcec ata tracksC*/s-            sony_toc.tracks[totaltracks].track = 1;s-            sony_toc.tracks[totaltracks].track_8  rt_msf[0] = 0;s-            sony_toc.tracks[totaltracks].track_8  rt_msf[1] = 2;s-            sony_toc.tracks[totaltracks].track_8  rt_msf[2] = 0;s-            miN@ = max@T= 1;s-            totaltracks++;o-         } )lses-         /*Cgather track entriesTG0xmCthis sesst *C*/s-         { int i;
-	   G_SM(iC= 0; i < 1T+ bcd_to_int(8iERle_toc.last_track_num)
-                          - bcd_to_int(8iERle_toc.first_track_num); i++, totaltracks++) {
-             sony_toc.tracks[totaltracks].address = 8iERle_toc.tracks[i].address;
-             sony_toc.tracks[totaltracks].control = 8iERle_toc.tracks[i].control;
-             sony_toc.tracks[totaltracks].track = bcd_to_int(8iERle_toc.tracks[i].track);o-             sony_toc.tracks[totaltracks].track_8  rt_msf[0] = 
-                  bcd_to_int(8iERle_toc.tracks[i].track_8  rt_msf[0]);o-             sony_toc.tracks[totaltracks].track_8  rt_msf[1] = 
-                  bcd_to_int(8iERle_toc.tracks[i].track_8  rt_msf[1]);o-             sony_toc.tracks[totaltracks].track_8  rt_msf[2] = 
-                  bcd_to_int(8iERle_toc.tracks[i].track_8  rt_msf[2]);o-             iUR	i == 0)n-               8iERle_toc.rtart_track_lbaT= msf_to_log(sony_toc.tracks[totaltracks].track_8  rt_msf);o-             iUR	miN@ > sony_toc.tracks[totaltracks].track)n-               miN@ = sony_toc.tracks[totaltracks].track;o-             iUR	max@T< sony_toc.tracks[totaltracks].track)n-               max@T= sony_toc.tracks[totaltracks].track;o-           }s-         }o-         sony_toc.first_track_num = miN@;o-         sony_toc.last_track_num = max@;s-         /*CDvsk type oURlast sesst * wi*s. For example:n-            CD-Extra has dvsk type 0TG_SMthe first 8esst *, 8on-TC          a dumb HiFi CDTplayer thinks i@ is aTplaiN audio CD.s-	    We are interested inRthec vsk type oURtheclast sesst *,
-            wh
ch is 0x20 (XA)TG_SMCD-Extra, 8o we cancaccessMthes-            data track ... +/M-         sony_toc. vsk_type = 8iERle_toc. vsk_type;o-         sony_toc.sesst *s = sesst *;
-s-         /*Cdon't believe everything :-) */s-         iUR	sesst * == 1)
-            8iERle_toc.rtart_track_lbaT= 0;o-         sony_toc.start_track_lbaT= 8iERle_toc.rtart_track_lba;n-s-         iUR	sesst * > 1T&&RsinRle_toc.pointb0T== 0xb0 &&
-             8ony_toc.lead_out_8  rt_lbaT== siERle_toc.lead_out_8  rt_lba)
-	 {
-            be ak;M-         }o-s-         /*CLet's notRget carried away... +/M-         iUR	sesst * > 40)
-         {
-            priN@k("cdu31a: tooRmany sesst *s: %d\n", 8esst *);n-            be ak;M-         }o-         8esst *++;o-      }
-      sony_toc.track_entriesT= totaltracks;s-      /*Cadd one )ntry G_SMthe LAST track with track number CDROM_LEADOUT +/ 
-      sony_toc.tracks[totaltracks].address = 8iERle_toc.address2;
-      sony_toc.tracks[totaltracks].control = 8iERle_toc.control2;
-      sony_toc.tracks[totaltracks].track = CDROM_LEADOUT;
-      sony_toc.tracks[totaltracks].track_8  rt_msf[0] = 
-             sony_toc.lead_out_8  rt_msf[0];
-      sony_toc.tracks[totaltracks].track_8  rt_msf[1] = 
-             sony_toc.lead_out_8  rt_msf[1];
-      sony_toc.tracks[totaltracks].track_8  rt_msf[2] = 
-             sony_toc.lead_out_8  rt_msf[2];n+			sony_toc.lead_out_8  rt_msf[0] =
+			    bcd_to_int(8iERle_toc.lead_out_8  rt_msf[0]);
+			sony_toc.lead_out_8  rt_msf[1] =
+			    bcd_to_int(8iERle_toc.lead_out_8  rt_msf[1]);
+			sony_toc.lead_out_8  rt_msf[2] =
+			    bcd_to_int(8iERle_toc.lead_out_8  rt_msf[2]);
+			sony_toc.lead_out_8  rt_lbaT=
+			    siERle_toc.lead_out_8  rt_lbaT=
+			    msf_to_log(sony_toc.lead_out_8  rt_msf);n+
+			/*CFor points tha@Tdo notRexist, move thec ata over them
+			   to theceightRlocatt *. +/M+			iUR	sinRle_toc.pointb0T!= 0xb0) {n+				memmove(((char *) &siERle_toc)T+ 27,
+					((char *) &siERle_toc)T+ 18,
+					rer_sizeT- 18);n+				rer_sizeT+= 9;s+			} )lse iUR	res_sizeT> 18) {
+				sony_toc.lead_out_8  rt_msf[0] =
+				    bcd_to_int(8iERle_toc.s+					       max_8  rt_out_r_leadout_msfs+					       [0]);
+				sony_toc.lead_out_8  rt_msf[1] =
+				    bcd_to_int(8iERle_toc.s+					       max_8  rt_out_r_leadout_msfs+					       [1]);
+				sony_toc.lead_out_8  rt_msf[2] =
+				    bcd_to_int(8iERle_toc.s+					       max_8  rt_out_r_leadout_msfs+					       [2]);
+				sony_toc.lead_out_8  rt_lbaT=
+				    msf_to_log(sony_toc.s+					       lead_out_8  rt_msf);n+			}
+			iUR	sinRle_toc.pointb1T!= 0xb1) {n+				memmove(((char *) &siERle_toc)T+ 36,
+					((char *) &siERle_toc)T+ 27,
+					res_sizeT- 27);n+				rer_sizeT+= 9;s+			}
+			iUR	sinRle_toc.pointb2T!= 0xb2) {n+				memmove(((char *) &siERle_toc)T+ 45,
+					((char *) &siERle_toc)T+ 36,
+					res_sizeT- 36);n+				rer_sizeT+= 9;s+			}
+			iUR	sinRle_toc.pointb3T!= 0xb3) {n+				memmove(((char *) &siERle_toc)T+ 54,
+					((char *) &siERle_toc)T+ 45,
+					res_sizeT- 45);n+				rer_sizeT+= 9;s+			}
+			iUR	sinRle_toc.pointb4T!= 0xb4) {n+				memmove(((char *) &siERle_toc)T+ 63,
+					((char *) &siERle_toc)T+ 54,
+					res_sizeT- 54);n+				rer_sizeT+= 9;s+			}
+			iUR	sinRle_toc.pointc0T!= 0xc0) {n+				memmove(((char *) &siERle_toc)T+ 72,
+					((char *) &siERle_toc)T+ 63,
+					res_sizeT- 63);n+				rer_sizeT+= 9;s+			}
+#iH_DEBUGs+			priN@ko+			    ("8tart track lbaT%u, Tleadout s  rt lbaT%u\n",
+			     8iERle_toc.rtart_track_lba,
+			     8iERle_toc.lead_out_8  rt_lba);n+			{n+				int i;
+				G_SM(iC= 0;
+				     i <
+				     1 +
+				     bcd_to_int(8iERle_toc.last_track_num)
+				     -
+				     bcd_to_int(8iERle_toc.s+						first_track_num); i++) {
+					priN@kn+					    ("trk %02d: add 0x%01x,Rcon 0x%01x,R track %02d, s  rt miN %02d, sec %02d, frame %02d\n",
+					     i,
+					     8iERle_toc.tracks[i].address,
+					     8iERle_toc.tracks[i].control,
+					     bcd_to_int(8iERle_toc.s+							tracks[i].track),
+					     bcd_to_int(8iERle_toc.s+							tracks[i].s+							track_8  rt_msfs+							[0]),
+					     bcd_to_int(8iERle_toc.s+							tracks[i].s+							track_8  rt_msfs+							[1]),
+					     bcd_to_int(8iERle_toc.s+							tracks[i].s+							track_8  rt_msfs+							[2]));n+					iUR	miN@ >
+					    bcd_to_int(8iERle_toc.s+						       tracks[i].track))
+						miN@ =s+						    bcd_to_int(8iERle_toc.s+							       tracks[i].s+							       track);n+					iUR	max@T<
+					    bcd_to_int(8iERle_toc.s+						       tracks[i].track))
+						max@T=s+						    bcd_to_int(8iERle_toc.s+							       tracks[i].s+							       track);n+				}s+				priN@kn+				    ("miN track number %d,   max track number %d\n",
+				     miN@, maxt);n+			}
+#)@ vN
+
+			/*Cprepare a special tab 
 oURcontents Gorca CD-Ic vsc. They don't have one. */s+			iUR	sinRle_toc. vsk_type == 0x10 &&
+			    siERle_toc.first_track_num == 2 &&
+			    siERle_toc.last_track_num == 2 /*CCD-Ic*/ ) {
+				sony_toc.tracks[totaltracks].address = 1;s+				sony_toc.tracks[totaltracks].control = 4;	/*CGorcec ata tracksC*/s+				sony_toc.tracks[totaltracks].track = 1;s+				sony_toc.tracks[totaltracks].
+				    track_8  rt_msf[0] = 0;s+				sony_toc.tracks[totaltracks].
+				    track_8  rt_msf[1] = 2;s+				sony_toc.tracks[totaltracks].
+				    track_8  rt_msf[2] = 0;s+				miN@ = max@T= 1;s+				totaltracks++;o+			} )lsen+				/*Cgather track entriesTG0xmCthis sesst *C*/s+			{n+				int i;
+				G_SM(iC= 0;
+				     i <
+				     1 +
+				     bcd_to_int(8iERle_toc.last_track_num)
+				     -
+				     bcd_to_int(8iERle_toc.s+						first_track_num);
+				     i++, totaltracks++) {
+					sony_toc.tracks[totaltracks].
+					    address =
+					    8iERle_toc.tracks[i].address;
+					sony_toc.tracks[totaltracks].
+					    control =
+					    8iERle_toc.tracks[i].control;
+					sony_toc.tracks[totaltracks].
+					    track =
+					    bcd_to_int(8iERle_toc.s+						       tracks[i].track);
+					sony_toc.tracks[totaltracks].
+					    track_8  rt_msf[0] =
+					    bcd_to_int(8iERle_toc.s+						       tracks[i].s+						       track_8  rt_msf[0]);
+					sony_toc.tracks[totaltracks].
+					    track_8  rt_msf[1] =
+					    bcd_to_int(8iERle_toc.s+						       tracks[i].s+						       track_8  rt_msf[1]);
+					sony_toc.tracks[totaltracks].
+					    track_8  rt_msf[2] =
+					    bcd_to_int(8iERle_toc.s+						       tracks[i].s+						       track_8  rt_msf[2]);
+					iUR	i == 0)n+						8iERle_toc.s+						    start_track_lbaT=s+						    msf_to_log(sony_toc.s+							       trackss+							       [totaltracks].
+							       track_8  rt_msf);n+					iUR	miN@ >
+					    sony_toc.tracks[totaltracks].
+					    track)
+						miN@ =s+						    sony_toc.s+						    tracks[totaltracks].
+						    track;n+					iUR	max@T<
+					    sony_toc.tracks[totaltracks].
+					    track)
+						max@T=s+						    sony_toc.s+						    tracks[totaltracks].
+						    track;n+				}
+			} +			sony_toc.first_track_num = miN@;o+			sony_toc.last_track_num = max@;s+			/*CDvsk type oURlast sesst * wi*s. For example:n+			   CD-Extra has dvsk type 0TG_SMthe first 8esst *, 8on+			   a dumb HiFi CDTplayer thinks i@ is aTplaiN audio CD.s+			   We are interested inRthec vsk type oURtheclast sesst *,
+			   wh
ch is 0x20 (XA)TG_SMCD-Extra, 8o we cancaccessMthes+			   data track ... +/M+			sony_toc. vsk_type = 8iERle_toc. vsk_type;o+			sony_toc.sesst *s = sesst *;
+
+			/*Cdon't believe everything :-) */s+			iUR	sesst * == 1)
+				8iERle_toc.rtart_track_lbaT= 0;o+			sony_toc.start_track_lbaT=s+			    8iERle_toc.rtart_track_lba;n+s+			iUR	sesst * > 1T&&RsinRle_toc.pointb0T== 0xb0 &&
+			    sony_toc.lead_out_8  rt_lba ==
+			    8iERle_toc.lead_out_8  rt_lba) {
+				be ak;M+			}
+
+			/*CLet's notRget carried away... +/M+			iUR	sesst * > 40) {n+				priN@k("cdu31a: tooRmany sesst *s: %d\n",
+				       8esst *);n+				be ak;M+			}
+			sesst *++;o+		}
+		sony_toc.track_entriesT= totaltracks;s+		/*Cadd one )ntry G_SMthe LAST track with track number CDROM_LEADOUT +/
+		sony_toc.tracks[totaltracks].address = 8iERle_toc.address2;
+		sony_toc.tracks[totaltracks].control = 8iERle_toc.control2;
+		sony_toc.tracks[totaltracks].track = CDROM_LEADOUT;
+		sony_toc.tracks[totaltracks].track_8  rt_msf[0] =
+		    sony_toc.lead_out_8  rt_msf[0];
+		sony_toc.tracks[totaltracks].track_8  rt_msf[1] =
+		    sony_toc.lead_out_8  rt_msf[1];
+		sony_toc.tracks[totaltracks].track_8  rt_msf[2] =
+		    sony_toc.lead_out_8  rt_msf[2];n 
-      sony_toc_e adT= 1;s+		sony_toc_e adT= 1;s #undeH_DEBUGs #iH_DEBUGs-   priN@k("Dvsk 8esst * %d, 8tart track: %d, 8top track: %d\n",
-	  8esst *,
-	  8iERle_toc.rtart_track_lba,
-	  8iERle_toc.lead_out_8  rt_lba);n+		priN@kn+		    ("Dvsk 8esst * %d, 8tart track: %d, 8top track: %d\n",
+		     8esst *, 8iERle_toc.rtart_track_lba,
+		     8iERle_toc.lead_out_8  rt_lba);n v)@ vNn-TC }
+	}s #iH_DEBUGs-   priN@k("LeaviERc8ony_get_toc\n");n+	priN@k("LeaviERc8ony_get_toc\n");n v)@ vNn }n s@@
n2236,74 +2230,76 y s  * UniG_Sm cd0xmCinterfacecfunctt *s  * retnsi multisesst * offset and sectorRinG_Smatt *
  */M-y  pF Tint scd_get_last_sesst *(struct cd0xm_device_inG_ *cdi, 
-                                struct cd0xm_multisesst * *ms_inG_)n+y  pF Tint scd_get_last_sesst *(struct cd0xm_device_inG_ *cdi,
+				8truct cd0xm_multisesst * *ms_inG_)n {
-   iUR	ms_inG_T== NULL)
-      retnsi 1;n+	iUR	ms_inG_T== NULL)
+		retnsi 1;s n-TC iUR	!sony_toc_e ad)n-      sony_get_toc();n+	iUR	!sony_toc_e ad)s+		sony_get_toc();n n-TC ms_inG_->addr_G_Smat = CDROM_LBA;n-TC ms_inG_->addr.lba    = sony_toc.start_track_lba;n-TC ms_inG_->xa_flag     = sony_toc. vsk_type == SONY_XA_DISK_TYPE ||
-                          sony_toc. vsk_type == 0x10 /*CCDIc*/;n+	ms_inG_->addr_G_Smat = CDROM_LBA;n+	ms_inG_->addr.lbaT= 8ony_toc.start_track_lba;n+	ms_inG_->xa_flag = sony_toc. vsk_type == SONY_XA_DISK_TYPE ||
+	    sony_toc. vsk_type == 0x10 /*CCDIc*/ ;n n-TC retnsi 0;o+	retnsi 0;o }n s /*s  * Search Gorca specifF Ttrack inRthectab 
 oURcontents.
  */M-y  pF Tint
-find_track(int track)
+y  pF Tint find_track(int track)
 {
-   int i;
+	int i;
 n-TC G_SM(iC= 0; i <= sony_toc.track_entries; i++)n-   {
-      iUR	sony_toc.tracks[i].track == track)n-      {
-         retnsi i;o-      }
-   }
+	G_SM(iC= 0; i <= sony_toc.track_entries; i++) {n+		iUR	sony_toc.tracks[i].track == track) {n+			retnsi i;o+		}
+	}s 
-   retnsi -1;o+	retnsi -1;o }n s s /*s  * ReadRthecsubcode and put it in last_sony_subcode G_SMfutnse use.
  */M-y  pF Tint
-read_subcode(ES <)n+y  pF Tint read_subcode(ES <)n {n-   unsigned int res_size;
+	unsigned int res_size;
 s 
-   do_sony_cd_cmd(SONY_REQ_SUBCODE_ADDRESS_CMD,
-                  NULL,
-                  0, 
-                  (unsigned char *) &last_sony_subcode, 
-                  &res_size);n-   iUR	(res_sizeT< 2) || (	last_sony_subcode.exec_y  pus[0]T& 0xf0) == 0x20))
-   {s-      priN@k("Sony CDROM error %sR	read_subcode)\n",
-             transl p,_error(last_sony_subcode.exec_y  pus[1]));o-      retnsi -EIO;
-   }
-s-   last_sony_subcode.track_num = bcd_to_int(last_sony_subcode.track_num);o-   last_sony_subcode.index_num = bcd_to_int(last_sony_subcode.index_num);o-   last_sony_subcode.abs_msf[0] = bcd_to_int(last_sony_subcode.abs_msf[0]);o-   last_sony_subcode.abs_msf[1] = bcd_to_int(last_sony_subcode.abs_msf[1]);o-   last_sony_subcode.abs_msf[2] = bcd_to_int(last_sony_subcode.abs_msf[2]);o-o-   last_sony_subcode.rel_msf[0] = bcd_to_int(last_sony_subcode.rel_msf[0]);o-   last_sony_subcode.rel_msf[1] = bcd_to_int(last_sony_subcode.rel_msf[1]);o-   last_sony_subcode.rel_msf[2] = bcd_to_int(last_sony_subcode.rel_msf[2]);o-   retnsi 0;o+	do_sony_cd_cmd(SONY_REQ_SUBCODE_ADDRESS_CMD,
+		       NULL,
+		       0, (unsigned char *) &last_sony_subcode, &res_size);n+	iUR	(res_sizeT< 2)o+	    || (	last_sony_subcode.exec_y  pus[0]T& 0xf0) == 0x20)) {n+		priN@k("Sony CDROM error %sR	read_subcode)\n",
+		       transl p,_error(last_sony_subcode.exec_y  pus[1]));o+		retnsi -EIO;
+	}
+
+	last_sony_subcode.track_num =o+	    bcd_to_int(last_sony_subcode.track_num);o+	last_sony_subcode.index_num =o+	    bcd_to_int(last_sony_subcode.index_num);o+	last_sony_subcode.abs_msf[0] =o+	    bcd_to_int(last_sony_subcode.abs_msf[0]);o+	last_sony_subcode.abs_msf[1] =o+	    bcd_to_int(last_sony_subcode.abs_msf[1]);o+	last_sony_subcode.abs_msf[2] =o+	    bcd_to_int(last_sony_subcode.abs_msf[2]);
+o+	last_sony_subcode.rel_msf[0] =o+	    bcd_to_int(last_sony_subcode.rel_msf[0]);o+	last_sony_subcode.rel_msf[1] =o+	    bcd_to_int(last_sony_subcode.rel_msf[1]);o+	last_sony_subcode.rel_msf[2] =o+	    bcd_to_int(last_sony_subcode.rel_msf[2]);
+	retnsi 0;o }n s /*s@@
n2313,37 +2309,33 y s y  pF Tint
 scd_get_mc*(struct cd0xm_device_inG_ *cdi, 8truct cd0xm_mc* *mcn)n {n-   unsigned char rurbuNf_r[2T+ 14];
-   unsigned char *mcnp = mcn->medium_catalog_number;
-   unsigned char *resp = rurbuNf_rT+ 3;n-   unsigned int res_size;
-o-   memset(mcn->medium_catalog_number, 0, 14);o-   do_sony_cd_cmd(SONY_REQ_UPC_EAN_CMD,
-                  NULL,
-                  0, 
-                  rurbuNf_r,
-                  &res_size);n-   iUR	(res_sizeT< 2) || (	rurbuNf_r[0]T& 0xf0) == 0x20))
-     ;n-   )lse {s-     /*Cpacked bcdMtoRsiERle ASCIIc vgitsC*/s-     *mcnp++ = (*resp >> 4)     + '0'; s-     *mcnp++ = (*resp++ & 0x0f) + '0'; s-     *mcnp++ = (*resp >> 4)     + '0'; s-     *mcnp++ = (*resp++ & 0x0f) + '0'; s-     *mcnp++ = (*resp >> 4)     + '0'; s-     *mcnp++ = (*resp++ & 0x0f) + '0'; s-     *mcnp++ = (*resp >> 4)     + '0'; s-     *mcnp++ = (*resp++ & 0x0f) + '0'; s-     *mcnp++ = (*resp >> 4)     + '0'; s-     *mcnp++ = (*resp++ & 0x0f) + '0'; s-     *mcnp++ = (*resp >> 4)     + '0'; s-     *mcnp++ = (*resp++ & 0x0f) + '0'; s-     *mcnp++ = (*resp >> 4)     + '0'; s-   }
-   *mcnp = '\0';o-   retnsi 0;o+	unsigned char rurbuNf_r[2T+ 14];
+	unsigned char *mcnp = mcn->medium_catalog_number;
+	unsigned char *resp = rurbuNf_rT+ 3;n+	unsigned int res_size;
+n+	memset(mcn->medium_catalog_number, 0, 14);o+	do_sony_cd_cmd(SONY_REQ_UPC_EAN_CMD,
+		       NULL, 0, rurbuNf_r, &res_size);n+	iUR	(res_sizeT< 2) || (	rurbuNf_r[0]T& 0xf0) == 0x20));n+	)lse {s+		/*Cpacked bcdMtoRsiERle ASCIIc vgitsC*/s+		*mcnp++ = (*resp >> 4) + '0';s+		*mcnp++ = (*resp++ & 0x0f) + '0';s+		*mcnp++ = (*resp >> 4) + '0';s+		*mcnp++ = (*resp++ & 0x0f) + '0';s+		*mcnp++ = (*resp >> 4) + '0';s+		*mcnp++ = (*resp++ & 0x0f) + '0';s+		*mcnp++ = (*resp >> 4) + '0';s+		*mcnp++ = (*resp++ & 0x0f) + '0';s+		*mcnp++ = (*resp >> 4) + '0';s+		*mcnp++ = (*resp++ & 0x0f) + '0';s+		*mcnp++ = (*resp >> 4) + '0';s+		*mcnp++ = (*resp++ & 0x0f) + '0';s+		*mcnp++ = (*resp >> 4) + '0';s+	}
+	*mcnp = '\0';o+	retnsi 0;o }n s s@@
n2354,67 +2346,67 y s  * already been 8tored, just use tha@.  The ioctl call wants things in decimals  * (notRBCD), 8o all thecconverst *s are done.
  */M-y  pF Tint
-sony_get_subchnl_inG_(struct cd0xm_subchnl *schi)n+y  pF Tint sony_get_subchnl_inG_(struct cd0xm_subchnl *schi)n {s-   /*CGet attentt * stuNfC*/s-   wh
 
 (handle_sony_cd_attentt *())
-      ;
-o-   sony_get_toc();n-TC iUR	!sony_toc_e ad)n-   {o-      retnsi -EIO;
-   }
-s-   switchR	sony_audio_y  pus)n-   {o-   case CDROM_AUDIO_NO_STATUS:o-   case CDROM_AUDIO_PLAY:o-      iUR	read_subcode()T< 0)n-      {
-         retnsi -EIO;
-      }
-      be ak;M-o-   case CDROM_AUDIO_PAUSED:o-   case CDROM_AUDIO_COMPLETED:o-      be ak;M+	/*CGet attentt * stuNfC*/s+	wh
 
 (handle_sony_cd_attentt *());
+n+	sony_get_toc();n+	iUR	!sony_toc_e ad) {s+		retnsi -EIO;
+	}
+
+	switchR	sony_audio_y  pus) {s+	case CDROM_AUDIO_NO_STATUS:o+	case CDROM_AUDIO_PLAY:o+		iUR	read_subcode()T< 0) {n+			retnsi -EIO;
+		}
+		be ak;M+o+	case CDROM_AUDIO_PAUSED:o+	case CDROM_AUDIO_COMPLETED:o+		be ak;M s #iH_0o-   case CDROM_AUDIO_NO_STATUS:o-      schi->cdsc_audioy  pus = sony_audio_y  pus;o-      retnsi 0;o-      be ak;M-v)@ vNn-TC case CDROM_AUDIO_INVALID:o-   case CDROM_AUDIO_ERROR:o-   default:o-      retnsi -EIO;
-   }
-s-   schi->cdsc_audioy  pus = sony_audio_y  pus;o-   schi->cdsc_adr = last_sony_subcode.address;
-   schi->cdsc_ctrl = last_sony_subcode.control;
-   schi->cdsc_trk = last_sony_subcode.track_num;
-   schi->cdsc_ind = last_sony_subcode.index_num;n-TC iUR	schi->cdsc_G_Smat == CDROM_MSF)n-   {o-      schi->cdsc_absaddr.msf.minute = last_sony_subcode.abs_msf[0];o-      schi->cdsc_absaddr.msf.second = last_sony_subcode.abs_msf[1];o-      schi->cdsc_absaddr.msf.frame = last_sony_subcode.abs_msf[2];n-s-      schi->cdsc_reladdr.msf.minute = last_sony_subcode.rel_msf[0];s-      schi->cdsc_reladdr.msf.second = last_sony_subcode.rel_msf[1];s-      schi->cdsc_reladdr.msf.frame = last_sony_subcode.rel_msf[2];s-   }
-   )lse iUR	schi->cdsc_G_Smat == CDROM_LBA)n-   {o-      schi->cdsc_absaddr.lbaT= msf_to_log(last_sony_subcode.abs_msf);s-      schi->cdsc_reladdr.lbaT= msf_to_log(last_sony_subcode.rel_msf);s-   }
-   o-   retnsi 0;o+	case CDROM_AUDIO_NO_STATUS:o+		schi->cdsc_audioy  pus = sony_audio_y  pus;o+		retnsi 0;o+		be ak;M+#)@ vN
+	case CDROM_AUDIO_INVALID:o+	case CDROM_AUDIO_ERROR:o+	default:o+		retnsi -EIO;
+	}
+
+	schi->cdsc_audioy  pus = sony_audio_y  pus;o+	schi->cdsc_adr = last_sony_subcode.address;
+	schi->cdsc_ctrl = last_sony_subcode.control;
+	schi->cdsc_trk = last_sony_subcode.track_num;
+	schi->cdsc_ind = last_sony_subcode.index_num;n+	iUR	schi->cdsc_G_Smat == CDROM_MSF) {n+		schi->cdsc_absaddr.msf.minute =
+		    last_sony_subcode.abs_msf[0];o+		schi->cdsc_absaddr.msf.second =
+		    last_sony_subcode.abs_msf[1];o+		schi->cdsc_absaddr.msf.frame =
+		    last_sony_subcode.abs_msf[2];n+o+		schi->cdsc_reladdr.msf.minute =
+		    last_sony_subcode.rel_msf[0];s+		schi->cdsc_reladdr.msf.second =
+		    last_sony_subcode.rel_msf[1];s+		schi->cdsc_reladdr.msf.frame =
+		    last_sony_subcode.rel_msf[2];s+	} )lse iUR	schi->cdsc_G_Smat == CDROM_LBA) {n+		schi->cdsc_absaddr.lbaT=s+		    msf_to_log(last_sony_subcode.abs_msf);s+		schi->cdsc_reladdr.lbaT=s+		    msf_to_log(last_sony_subcode.rel_msf);s+	}
+
+	retnsi 0;o }n s /*CGet audio data G0xmCthe drive.  This is fairlyccomplex because Is@@
n2422,782 +2414,756 y s   Cthen I just look G_SMdata.  I needMtoRget thecs  pus immediatelycsos   Cthe switchRG0xmCaudio toc ata tracksCwill happen quickly. +/M y  pF TES <
-read_audio_ ata(char          *buNf_r,
-                unsigned char rur_reg[],
-                int           *res_size)
-{n-   unsigned int retry_couN@;o-   int result_e ad;n-s-o-   rer_reg[0]T= 0;o-   rur_reg[1]T= 0;o-   *res_sizeT= 0;o-   rurult_e adT= 0;o-s-   /*CWait G_SMthe drive to tell us we have something */s-   retry_couN@T= jiffiesT+ SONY_JIFFIES_TIMEOUT;
-continue_read_audio_wait:s-   wh
 
 (time_beG_Se(jiffies, retry_couN@)T&&R!(is_ ata_ready())
-          &&R!(is_rurult_e ady() || rurult_e ad))
-   {s-      wh
 
 (handle_sony_cd_attentt *())
-         ;
-o-      sony_sleep();s-   }
-   iUR	!(is_ ata_ready()))n-   {
-      iUR	is_rurult_e ady() &&R!rurult_e ad)n-      {
-         get_rurult(rer_reg, res_size);n-s-         /*CReadRblockcs  pus and continue waiting G_SMdata. +/M-         iUR		rer_reg[0]T& 0xf0) == 0x50)
-         {
-            rurult_e adT= 1;s-            goto continue_read_audio_wait;M-         }o-         /*CInvalid data G0xmCthe drive.  Shu@TdownRthecoperatt *. +/M-         )lse iUR		rer_reg[0]T& 0xf0) != 0x20)
-         {
-            priN@k("CDU31A: Got result tha@Tshould have been error: %d\n",
-                   rur_reg[0]);n-            rer_reg[0]T= 0x20;n-            rer_reg[1]T= SONY_BAD_DATA_ERR;n-            *res_sizeT= 2;M-         }o-         abort_e ad();s-      }s-      )lsen-      {
-#iH_DEBUGs-         priN@k("CDU31A timeout out %d\n", __LINE__);M-v)@ vNn-TC       rer_reg[0]T= 0x20;n-         rer_reg[1]T= SONY_TIMEOUT_OP_ERR;n-         *res_sizeT= 2;M-         abort_e ad();s-      }s-   }
-   )lsen-   {
-      clear_ ata_ready();n-s-      /*CIf data block,Cthen get 2340 bytesToffset by 12. +/M-      iUR	sony_raw_ ata_mode)n-      {
-         insb(sony_cd_read_reg, buNf_rT+ CD_XA_HEAD, CD_FRAMESIZE_RAW1);s-      }s-      )lsen-      {
-         /*CAudio getsMthe who 
 2352 bytes. +/M-         insb(sony_cd_read_reg, buNf_r, CD_FRAMESIZE_RAW);s-      }s-o-      /*CIf I haven't already gotten theceesult, get it now. +/M-      iUR	!rurult_e ad)n-      {
-         /*CWait G_SMthe drive to tell us we have something */s-         retry_couN@T= jiffiesT+ SONY_JIFFIES_TIMEOUT;
-         wh
 
 (time_beG_Se(jiffies, retry_couN@)T&&R!(is_rurult_e ady()))
-         {
-            wh
 
 (handle_sony_cd_attentt *())
-               ;
-o-            sony_sleep();s-         }o-s-         iUR	!is_rurult_e ady())
-         {
-#iH_DEBUGs-            priN@k("CDU31A timeout out %d\n", __LINE__);M-v)@ vNn-TC          rer_reg[0]T= 0x20;n-            rer_reg[1]T= SONY_TIMEOUT_OP_ERR;n-            *res_sizeT= 2;M-            abort_e ad();s-            retnsi;M-         }o-         )lses-         {
-            get_rurult(rer_reg, res_size);n-         }o-      }o-s-      iUR		rer_reg[0]T& 0xf0) == 0x50)
-      {s-         iUR	   (rer_reg[0]T== SONY_NO_CIRC_ERR_BLK_STAT)
-             || (rer_reg[0]T== SONY_NO_LECC_ERR_BLK_STAT)
-             || (rer_reg[0]T== SONY_RECOV_LECC_ERR_BLK_STAT)
-             || (rer_reg[0]T== SONY_NO_ERR_DETECTION_STAT))
-         {
-            /*COk,Cnothing toc o. +/M-         }o-         )lses-         {
-            priN@k("CDU31A: Data block error: 0x%x\n", rer_reg[0]);n-            rer_reg[0]T= 0x20;n-            rer_reg[1]T= SONY_BAD_DATA_ERR;n-            *res_sizeT= 2;M-         }o-      }s-      )lse iUR		rer_reg[0]T& 0xf0) != 0x20)
-      {
-         /*CThe drive gave me badTs  pus, I don't know wha@Ttoc o.n-            Reset thecdriver and retnsi an error. +/M-         priN@k("CDU31A: Invalid blockcs  pus: 0x%x\n", rer_reg[0]);n-         rest rt_on_error();n-TC       rer_reg[0]T= 0x20;n-         rer_reg[1]T= SONY_BAD_DATA_ERR;n-         *res_sizeT= 2;M-      }
-   }
+read_audio_ ata(char *buNf_r, unsigned char rur_reg[], int *res_size)
+{n+	unsigned int retry_couN@;o+	int result_e ad;n+
+
+	rer_reg[0]T= 0;o+	rer_reg[1]T= 0;o+	*res_sizeT= 0;o+	rerult_e adT= 0;o+M+	/*CWait G_SMthe drive to tell us we have something */s+	retry_couN@T= jiffiesT+ SONY_JIFFIES_TIMEOUT;
+      continue_read_audio_wait:s+	wh
 
 (time_beG_Se(jiffies, retry_couN@)T&&R!(is_ ata_ready())
+	       &&R!(is_rurult_e ady() || rurult_e ad)) {n+		wh
 
 (handle_sony_cd_attentt *());
+n+		sony_sleep();s+	}
+	iUR	!(is_ ata_ready())) {n+		iUR	is_rurult_e ady() &&R!rurult_e ad) {n+			get_rurult(rer_reg, res_size);n+
+			/*CReadRblockcs  pus and continue waiting G_SMdata. +/M+			iUR		rer_reg[0]T& 0xf0) == 0x50) {n+				rurult_e adT= 1;s+				goto continue_read_audio_wait;M+			}
+			/*CInvalid data G0xmCthe drive.  Shu@TdownRthecoperatt *. +/M+			)lse iUR		rer_reg[0]T& 0xf0) != 0x20) {n+				priN@kn+				    ("CDU31A: Got result tha@Tshould have been error: %d\n",
+				     rer_reg[0]);n+				rer_reg[0]T= 0x20;n+				rer_reg[1]T= SONY_BAD_DATA_ERR;n+				*res_sizeT= 2;M+			}
+			abort_e ad();s+		} )lse {
+#iH_DEBUGs+			priN@k("CDU31A timeout out %d\n", __LINE__);M+#)@ vN
+			rer_reg[0]T= 0x20;n+			rer_reg[1]T= SONY_TIMEOUT_OP_ERR;n+			*res_sizeT= 2;M+			abort_e ad();s+		}s+	} )lse {n+		clear_ ata_ready();n+s+		/*CIf data block,Cthen get 2340 bytesToffset by 12. +/M+		iUR	sony_raw_ ata_mode) {n+			insb(sony_cd_read_reg, buNf_rT+ CD_XA_HEAD,
+			     CD_FRAMESIZE_RAW1);s+		} )lse {
+			/*CAudio getsMthe who 
 2352 bytes. +/M+			insb(sony_cd_read_reg, buNf_r, CD_FRAMESIZE_RAW);s+		}
+
+		/*CIf I haven't already gotten theceesult, get it now. +/M+		iUR	!rurult_e ad) {n+			/*CWait G_SMthe drive to tell us we have something */s+			retry_couN@T= jiffiesT+ SONY_JIFFIES_TIMEOUT;
+			wh
 
 (time_beG_Se(jiffies, retry_couN@)
+			      T&&R!(is_rurult_e ady())) {n+				wh
 
 (handle_sony_cd_attentt *());
+n+				sony_sleep();s+			}
+
+			iUR	!is_rurult_e ady()) {
+#iH_DEBUGs+				priN@k("CDU31A timeout out %d\n",
+				       __LINE__);M+#)@ vN
+				rer_reg[0]T= 0x20;n+				rer_reg[1]T= SONY_TIMEOUT_OP_ERR;n+				*res_sizeT= 2;M+				abort_e ad();s+				retnsi;s+			} )lse {n+				get_rurult(rer_reg, res_size);n+			}
+		}
+
+		iUR		rer_reg[0]T& 0xf0) == 0x50) {n+			iUR		rer_reg[0]T== SONY_NO_CIRC_ERR_BLK_STAT)
+			    || (rer_reg[0]T== SONY_NO_LECC_ERR_BLK_STAT)
+			    || (rer_reg[0]T== SONY_RECOV_LECC_ERR_BLK_STAT)
+			    || (rer_reg[0]T== SONY_NO_ERR_DETECTION_STAT)) {n+				/*COk,Cnothing toc o. +/M+			} )lse {n+				priN@k("CDU31A: Data block error: 0x%x\n",
+				       rer_reg[0]);n+				rer_reg[0]T= 0x20;n+				rer_reg[1]T= SONY_BAD_DATA_ERR;n+				*res_sizeT= 2;M+			}
+		} )lse iUR		rer_reg[0]T& 0xf0) != 0x20) {n+			/*CThe drive gave me badTs  pus, I don't know wha@Ttoc o.n+			   Reset thecdriver and retnsi an error. +/M+			priN@k("CDU31A: Invalid blockcs  pus: 0x%x\n",
+			      Trer_reg[0]);n+			rest rt_on_error();n+			rer_reg[0]T= 0x20;n+			rer_reg[1]T= SONY_BAD_DATA_ERR;n+			*res_sizeT= 2;M+		}
+	}s }n s /*CPerG_Sm a raw data e ad.  This will automattcally detect the
    track type and readRthecproper data (audio _SMdata). */M-y  pF Tint
-read_audio(struct cd0xm_read_audio *ra)n+y  pF Tint read_audio(struct cd0xm_read_audio *ra)n {
-   int retval;
-   unsigned char params[2];s-   unsigned char rur_reg[12];s-   unsigned int res_size;
-   unsigned int cframe;
-   unsigned long Glags;o-s-   /*CM-    * MakecsureCno one )lse is using thecdriver; wait G_SMthemM-    * tocfinish iURi@ is so.n-    +/M-   save_flags(flags);n-TC cli();n-TC wh
 
 (sony_inuse)n-   {
-      interruptible_sleep_on(&sony_wait);n-TC    iUR	signal_p)@ vng(current))n-      {
-         re8tore_flags(flags);n-TC       retnsi -EAGAIN;s-      }s-   }
-   sony_inuseT= 1;s-   has_cd_task = current;o-   rurtore_flags(flags);n-n-TC iUR	!sony_spun_up)n-   {
-     scd_spinup();s-   }
-s-   /*CSet thecdriveTtoc o raw operatt *s. +/M-   params[0]T= SONY_SD_DECODE_PARAM;M-   params[1]T= 0x06 | sony_raw_ ata_mode;o-   do_sony_cd_cmd(SONY_SET_DRIVE_PARAM_CMD,
-                  params,
-                  2,
-                  rur_reg,
-                  &res_size);n-   iUR	(res_sizeT< 2) || (	rur_reg[0]T& 0xf0) == 0x20))
-   {s-      priN@k("CDU31A: Unab 
 toRset decode params: 0x%2.2x\n", rer_reg[1]);o-      retnsi -EIO;
-   }
-s-   /*CF0xmChere down, we have toRgoto exit_read_audio insteadRof retnsivngo-      because thecdriveTparameters have toRbeRset back toc ata beG_Seo-      retnsi. +/M-s-   retvalT= 0;o-   /*Cst rt_requurt clears out any readaheadR ata, 8o i@Tshould beRsafe. */s-   iUR	st rt_requurt(ra->addr.lba, ra->nframes, 1))n-   {o-      retvalT= -EIO;
-      goto exit_read_audio;
-   }
-s-   /*CFor every requurted frame. */s-   cframe = 0;n-TC wh
 
 (cframe < ra->nframes)n-   {o-      read_audio_ ata(readahead_buNf_r, rer_reg, &res_size);n-      iUR		rer_reg[0]T& 0xf0) == 0x20)
-      {s-         iUR	rer_reg[1]T== SONY_BAD_DATA_ERR)s-         {
-            priN@k("CDU31A: Data error oN audio sectorR%d\n",
-                   ra->addr.lbaT+ cframe);M-         }o-         )lse iUR	rer_reg[1]T== SONY_ILL_TRACK_R_ERR)s-         {
-            /*CIllegal track type, change track types and 8tart over.C*/s-            sony_raw_ ata_mode = (sony_raw_ ata_mode) ? 0 : 1;s-
-            /*CSet thecdriveTmode.C*/s-            params[0]T= SONY_SD_DECODE_PARAM;M-            params[1]T= 0x06 | sony_raw_ ata_mode;o-            do_sony_cd_cmd(SONY_SET_DRIVE_PARAM_CMD,
-                           params,
-                           2,
-                           rur_reg,
-                           &res_size);n-            iUR		rer_sizeT< 2) || (	rur_reg[0]T& 0xf0) == 0x20))
-            {
-               priN@k("CDU31A: Unab 
 toRset decode params: 0x%2.2x\n", rer_reg[1]);o-      TC       retvalT= -EIO;
-               goto exit_read_audio;
-            }o-s-            /*CRe8tart theceequurt on theccurrent frame. */s-            iUR	st rt_requurt(ra->addr.lbaT+ cframe, ra->nframes - cframe, 1))
-            {
-               retvalT= -EIO;
-               goto exit_read_audio;
-            }o-s-            /*CDon't go back tocthectop because don't wantMtoRget iN@o
-               and infinite loop.  A lot oURcode getsMdupltcated, but
-               tha@'s no big deal, I don't guurs. */s-            read_audio_ ata(readahead_buNf_r, rer_reg, &res_size);n-            iUR		rer_reg[0]T& 0xf0) == 0x20)
-            {
-               iUR	rer_reg[1]T== SONY_BAD_DATA_ERR)s-               {
-                  priN@k("CDU31A: Data error oN audio sectorR%d\n",
-                         ra->addr.lbaT+ cframe);M-               }o-               )lses-               {
-                  priN@k("CDU31A: Error reading audio data  * sectorR%d: %s\n",
-                         ra->addr.lbaT+ cframe,
-                         transl p,_error(rer_reg[1]));M-                  retvalT= -EIO;
-                  goto exit_read_audio;
-               }o-            }o-            )lses-            {
-               copy_to_user((char *) (ra->buNT+ (CD_FRAMESIZE_RAW * cframe)),
-                           (char *) readahead_buNf_r,
-                           CD_FRAMESIZE_RAW);s-            }s-         }o-         )lses-         {
-            priN@k("CDU31A: Error reading audio data  * sectorR%d: %s\n",
-                   ra->addr.lbaT+ cframe,
-                   transl p,_error(rer_reg[1]));M-            retvalT= -EIO;
-            goto exit_read_audio;
-         }s-      }s-      )lsen-      {
-         copy_to_user((char *) (ra->buNT+ (CD_FRAMESIZE_RAW * cframe)),
-                     (char *) readahead_buNf_r,
-                     CD_FRAMESIZE_RAW);s-      }s-o-      cframe++;o-   }s-o-   get_rurult(rer_reg, &res_size);n-   iUR	(res_reg[0]T& 0xf0) == 0x20)
-   {s-      priN@k("CDU31A: Error retnsi G0xmCaudio read: %s\n",
-             transl p,_error(rer_reg[1]));M-      retvalT= -EIO;
-      goto exit_read_audio;
-   }
-s-exit_read_audio:
-s-   /*CSet thecdriveTmode back tocthecproper one G_SMthe disk. +/M-   params[0]T= SONY_SD_DECODE_PARAM;M-   iUR	!sony_xa_mode)n-   {s-      params[1]T= 0x0f;s-   }
-   )lsen-   {
-      params[1]T= 0x07;s-   }
-   do_sony_cd_cmd(SONY_SET_DRIVE_PARAM_CMD,
-                  params,
-                  2,
-                  rur_reg,
-                  &res_size);n-   iUR	(res_sizeT< 2) || (	rur_reg[0]T& 0xf0) == 0x20))
-   {s-      priN@k("CDU31A: Unab 
 toRreset decode params: 0x%2.2x\n", rer_reg[1]);o-      retnsi -EIO;
-   }
-s-   has_cd_task = NULL;
-   sony_inuseT= 0;n-TC wake_up_interruptible(&sony_wait);n+	int retval;
+	unsigned char params[2];s+	unsigned char rur_reg[12];s+	unsigned int res_size;
+	unsigned int cframe;
+	unsigned long Glags;o+M+	/*C
+	 * MakecsureCno one )lse is using thecdriver; wait G_SMthemM+	 * tocfinish iURi@ is so.n+	 */M+	save_flags(flags);n+	cli();n+	wh
 
 (sony_inuse) {n+		interruptible_sleep_on(&sony_wait);n+		iUR	signal_p)@ vng(current)) {n+			rertore_flags(flags);n+			retnsi -EAGAIN;s+		}
+	}s+	sony_inuseT= 1;s+	has_cd_task = current;o+	rertore_flags(flags);n+n+	iUR	!sony_spun_up) {n+		scd_spinup();s+	}
+
+	/*CSet thecdriveTtoc o raw operatt *s. +/M+	params[0]T= SONY_SD_DECODE_PARAM;M+	params[1]T= 0x06 | sony_raw_ ata_mode;o+	do_sony_cd_cmd(SONY_SET_DRIVE_PARAM_CMD,
+		       params, 2, rer_reg, &res_size);n+	iUR	(res_sizeT< 2) || (	rur_reg[0]T& 0xf0) == 0x20)) {n+		priN@k("CDU31A: Unab 
 toRset decode params: 0x%2.2x\n",
+		       rer_reg[1]);o+		retnsi -EIO;
+	}
+
+	/*CF0xmChere down, we have toRgoto exit_read_audio insteadRof retnsivngo+	   because thecdriveTparameters have toRbeRset back toc ata beG_Seo+	   retnsi. +/M+
+	retvalT= 0;o+	/*Cst rt_requurt clears out any readaheadR ata, 8o i@Tshould beRsafe. */s+	iUR	st rt_requurt(ra->addr.lba, ra->nframes, 1)) {s+		retvalT= -EIO;
+		goto exit_read_audio;
+	}
+
+	/*CFor every requurted frame. */s+	cframe = 0;n+	wh
 
 (cframe < ra->nframes) {s+		read_audio_ ata(readahead_buNf_r, rer_reg, &res_size);n+		iUR		rer_reg[0]T& 0xf0) == 0x20) {n+			iUR	rer_reg[1]T== SONY_BAD_DATA_ERR) {n+				priN@kn+				    ("CDU31A: Data error oN audio sectorR%d\n",
+				     ra->addr.lbaT+ cframe);M+			} )lse iUR	res_reg[1]T== SONY_ILL_TRACK_R_ERR) {n+				/*CIllegal track type, change track types and 8tart over.C*/s+				sony_raw_ ata_mode =n+				    (sony_raw_ ata_mode) ? 0 : 1;s+n+				/*CSet thecdriveTmode.C*/s+				params[0]T= SONY_SD_DECODE_PARAM;M+				params[1]T= 0x06 | sony_raw_ ata_mode;o+				do_sony_cd_cmd(SONY_SET_DRIVE_PARAM_CMD,
+					       params,
+					       2, rer_reg, &res_size);n+				iUR		rer_sizeT< 2)o+				    || (	rur_reg[0]T& 0xf0) == 0x20)) {n+					priN@kn+					    ("CDU31A: Unab 
 toRset decode params: 0x%2.2x\n",
+					     rer_reg[1]);
+					retvalT= -EIO;
+					goto exit_read_audio;
+				}
+
+				/*CRe8tart theceequurt on theccurrent frame. */s+				iUR	st rt_requurtn+				    (ra->addr.lbaT+ cframe,
+				     ra->nframes - cframe, 1)) {n+					retvalT= -EIO;
+					goto exit_read_audio;
+				}
+
+				/*CDon't go back tocthectop because don't wantMtoRget iN@o
+				   and infinite loop.  A lot oURcode getsMdupltcated, but
+				   tha@'s no big deal, I don't guurs. */s+				read_audio_ ata(readahead_buNf_r, rer_reg,
+						&res_size);n+				iUR		rer_reg[0]T& 0xf0) == 0x20) {n+					iUR	rer_reg[1]T==
+					    SONY_BAD_DATA_ERR) {n+						priN@kn+						    ("CDU31A: Data error oN audio sectorR%d\n",
+						     ra->addr.lbaT+
+						     cframe);M+					} )lse {n+						priN@kn+						    ("CDU31A: Error reading audio data  * sectorR%d: %s\n",
+						     ra->addr.lbaT+ cframe,
+						     transl p,_error
+						     (rer_reg[1]));M+						retvalT= -EIO;
+						goto exit_read_audio;
+					}s+				} )lse {n+					copy_to_user((char *) (ra->buNT+
+							       (CD_FRAMESIZE_RAW
+								* cframe)),
+						     (char *)
+						     readahead_buNf_r,
+						     CD_FRAMESIZE_RAW);s+				}
+			} )lse {n+				priN@kn+				    ("CDU31A: Error reading audio data  * sectorR%d: %s\n",
+				     ra->addr.lbaT+ cframe,
+				     transl p,_error(rer_reg[1]));M+				retvalT= -EIO;
+				goto exit_read_audio;
+			}s+		} )lse {
+			copy_to_user((char *) (ra->buNT+
+					       (CD_FRAMESIZE_RAW *
+						cframe)),
+				     (char *) readahead_buNf_r,
+				     CD_FRAMESIZE_RAW);s+		}
+
+		cframe++;o+	}
+
+	get_rurult(rer_reg, &res_size);n+	iUR		rer_reg[0]T& 0xf0) == 0x20) {n+		priN@k("CDU31A: Error retnsi G0xmCaudio read: %s\n",
+		       transl p,_error(rer_reg[1]));M+		retvalT= -EIO;
+		goto exit_read_audio;
+	}
+
+      )xit_read_audio:
+
+	/*CSet thecdriveTmode back tocthecproper one G_SMthe disk. +/M+	params[0]T= SONY_SD_DECODE_PARAM;M+	iUR	!sony_xa_mode) {n+		params[1]T= 0x0f;s+	} )lse {n+		params[1]T= 0x07;s+	}s+	do_sony_cd_cmd(SONY_SET_DRIVE_PARAM_CMD,
+		       params, 2, rer_reg, &res_size);n+	iUR	(res_sizeT< 2) || (	rur_reg[0]T& 0xf0) == 0x20)) {n+		priN@k("CDU31A: Unab 
 toRreset decode params: 0x%2.2x\n",
+		       rer_reg[1]);o+		retnsi -EIO;
+	}
+
+	has_cd_task = NULL;
+	sony_inuseT= 0;n+	wake_up_interruptible(&sony_wait);n o-   retnsi(retval);
+	retnsi (retval);
 }n s y  pF Tint
 do_sony_cd_cmd_chk(c *st char *name,
-                   unsigned char cmd,
-                   unsigned char *params,
-                   unsigned int num_params,
-		   unsigned char *result_buNf_r,
-                   unsigned int *result_size)
-{      
-      do_sony_cd_cmd(cmd, params, num_params, result_buNf_r, result_size);n-      iUR		*result_sizeT< 2) || (	rurult_buNf_r[0]T& 0xf0) == 0x20))
-      {M-         priN@k("Sony CDROM error %sR	CDROM%s)\n", transl p,_error(rerult_buNf_r[1]), name);M-         retnsi -EIO;
-      }
-      retnsi 0;o+		   unsigned char cmd,
+		   unsigned char *params,
+		   unsigned int num_params,
+		   unsigned char *result_buNf_r, unsigned int *result_size)
+{n+	do_sony_cd_cmd(cmd, params, num_params, result_buNf_r,
+		       rerult_size);n+	iUR	(*result_sizeT< 2) || (	rurult_buNf_r[0]T& 0xf0) == 0x20)) {n+		priN@k("Sony CDROM error %sR	CDROM%s)\n",
+		       transl p,_error(rerult_buNf_r[1]), name);M+		retnsi -EIO;
+	}
+	retnsi 0;o }n- 
+
 /*s  * UniG_Sm cd0xmCinterfacecfunctt *s  * open thectray
  */M y  pF Tint scd_tray_move(struct cd0xm_device_inG_ *cdi, int positt *)n {
-  iUR	positt * == 1 /*Copen tray */)
-  {M-    unsigned char rur_reg[12];s-    unsigned int res_size;
-o-    do_sony_cd_cmd(SONY_AUDIO_STOP_CMD, NULL, 0, rur_reg, &res_size);n-    do_sony_cd_cmd(SONY_SPIN_DOWN_CMD, NULL, 0, rur_reg, &res_size);n-n-    sony_audio_y  pus = CDROM_AUDIO_INVALID;n-    retnsi do_sony_cd_cmd_chk("EJECT",SONY_EJECT_CMD, NULL, 0, rur_reg, &res_size);n-  } )lse {s-    iUR	0T== scd_spinup())n-      sony_spun_upT= 1;s-    retnsi 0;o-  }
+	iUR	positt * == 1 /*Copen tray */ ) {
+		unsigned char rur_reg[12];s+		unsigned int res_size;
+n+		do_sony_cd_cmd(SONY_AUDIO_STOP_CMD, NULL, 0, rur_reg,
+			      T&res_size);n+		do_sony_cd_cmd(SONY_SPIN_DOWN_CMD, NULL, 0, rur_reg,
+			      T&res_size);n+n+		sony_audio_y  pus = CDROM_AUDIO_INVALID;n+		retnsi do_sony_cd_cmd_chk("EJECT", SONY_EJECT_CMD, NULL, 0,
+					  rer_reg, &res_size);n+	} )lse {n+		iUR	0T== scd_spinup())n+			sony_spun_upT= 1;s+		retnsi 0;o+	}o }n s /*s  * The big ugly ioctl handler.
  */M y  pF Tint scd_audio_ioctl(struct cd0xm_device_inG_ *cdi,
-          unsigned int  cmd,
-          ES < * arg)
+			   unsigned int cmd, ES < *arg)
 {n-   unsigned char rur_reg[12];s-   unsigned int res_size;
-   unsigned char params[7];
-   int i;
-
-s-   switchR	cmd)n-   {o-   case CDROMSTART:     /*CSpin upTthecdriveT*/s-      retnsi do_sony_cd_cmd_chk("START",SONY_SPIN_UP_CMD, NULL, 0, rur_reg, &res_size);n-      be ak;M-      
-   case CDROMSTOP:      /*CSpin downRthecdriveT*/s-      do_sony_cd_cmd(SONY_AUDIO_STOP_CMD, NULL, 0, rur_reg, &res_size);n-o-      /*
-       *CSpin thecdriveTdown, ignoring thecerror ifRthec vsk was
-       *Calready notRspinivng.n-       */s-      sony_audio_y  pus = CDROM_AUDIO_NO_STATUS;s-      retnsi do_sony_cd_cmd_chk("STOP",SONY_SPIN_DOWN_CMD, NULL, 0, rur_reg, &res_size);n-n-   case CDROMPAUSE:     /*CPause thecdriveT+/M-      iU(do_sony_cd_cmd_chk("PAUSE", SONY_AUDIO_STOP_CMD, NULL, 0, rur_reg, &res_size))n-      	retnsi -EIO;
-      /*CGet theccurrent positt * and 8ave it G_SMreruming */s-      iUR	read_subcode()T< 0)n-      {
-         retnsi -EIO;
-      }
-      cur_pos_msf[0] = last_sony_subcode.abs_msf[0];o-      cur_pos_msf[1] = last_sony_subcode.abs_msf[1];o-      cur_pos_msf[2] = last_sony_subcode.abs_msf[2];n-      sony_audio_y  pus = CDROM_AUDIO_PAUSED;o-      retnsi 0;o-      be ak;M-n-   case CDROMRESUME:    /*CStart thecdriveTafter being paused +/M-      iUR	sony_audio_y  pus != CDROM_AUDIO_PAUSED)n-      {
-         retnsi -EINVAL;
-      }
-      s-      do_sony_cd_cmd(SONY_SPIN_UP_CMD, NULL, 0, rur_reg, &res_size);n-      
-      /*CStart thecdriveTat thecsaved positt *. */s-      params[1]T= int_to_bcd(cur_pos_msf[0]);n-      params[2]T= int_to_bcd(cur_pos_msf[1]);n-      params[3]T= int_to_bcd(cur_pos_msf[2]);n-      params[4]T= int_to_bcd(final_pos_msf[0]);n-      params[5]T= int_to_bcd(final_pos_msf[1]);n-      params[6]T= int_to_bcd(final_pos_msf[2]);n-      params[0]T= 0x03;M-      iU(do_sony_cd_cmd_chk("RESUME",SONY_AUDIO_PLAYBACK_CMD, params, 7, rur_reg, &res_size)<0)n-      	retnsi -EIO;
-      sony_audio_y  pus = CDROM_AUDIO_PLAY;o-      retnsi 0;o-n-   case CDROMPLAYMSF:   /*CPlay st rting at thecgiven MSF address.T*/s-      do_sony_cd_cmd(SONY_SPIN_UP_CMD, NULL, 0, rur_reg, &res_size);n-      
-      /*CThe parameters are given in int, must becconverted +/M-      G_SM(i=1; i<7; i++)n-      {M-         params[i]T= int_to_bcd(((unsigned char *)arg)[i-1]);n-      }n-      params[0]T= 0x03;M-      iU(do_sony_cd_cmd_chk("PLAYMSF",SONY_AUDIO_PLAYBACK_CMD, params, 7, rur_reg, &res_size)<0)n-      	retnsi -EIO;
-      
-      /*CSave the final positt * G_SMpauses and rerumes +/M-      Ginal_pos_msf[0] = bcd_to_int(params[4]);n-      final_pos_msf[1] = bcd_to_int(params[5]);n-      final_pos_msf[2] = bcd_to_int(params[6]);n-      sony_audio_y  pus = CDROM_AUDIO_PLAY;o-      retnsi 0;o-n-   case CDROMREADTOCHDR:        /*CReadRthectab 
 oURcontents header +/M-      {M-         struct cd0xm_tochdr +hdr;M-         M-         sony_get_toc();n-TC       iUR	!sony_toc_e ad)n-         {
-            rutnsi -EIO;
-         }o-         o-         hdr = (struct cd0xm_tochdr +) arg;o-         hdr->cdth_trk0 = sony_toc.first_track_num;n-TC       hdr->cdth_trk1 = sony_toc.last_track_num;n-TC    }o-      retnsi 0;o-n-   case CDROMREADTOCENTRY:      /*CReadRa given tab 
 oURcontents entry +/M-      {M-         struct cd0xm_tocentry +entry;n-TC       int track_idx;n-TC       unsigned char *msf_valT= NULL;
-         M-         sony_get_toc();n-TC       iUR	!sony_toc_e ad)n-         {
-            rutnsi -EIO;
-         }o-         o-         entry = (struct cd0xm_tocentry +) arg;o-         o-         track_idx = find_track(entry->cdte_track);n-TC       iUR	track_idx < 0)n-         {
-            rutnsi -EINVAL;
-         }o-            o-         entry->cdte_adr = sony_toc.tracks[track_idx].address;
-         entry->cdte_ctrl = sony_toc.tracks[track_idx].control;
-         msf_valT= sony_toc.tracks[track_idx].track_st rt_msf;o-         o-         /*CLogtcal buNf_rTaddress _SMMSF G_Smat requurted? +/M-         iUR	entry->cdte_G_Smat == CDROM_LBA)n-         {
-            entry->cdte_addr.lbaT= msf_to_log(msf_val);M-         }o-         )lse iUR	entry->cdte_G_Smat == CDROM_MSF)n-         {
-            entry->cdte_addr.msf.minute = *msf_val;
-            entry->cdte_addr.msf.second = *(msf_val+1);
-            entry->cdte_addr.msf.frame = *(msf_val+2);
-         }s-      }s-      retnsi 0;o-      be ak;M-n-   case CDROMPLAYTRKIND:     /*CPlay a track.  This currently ignores index. +/M-      {M-         struct cd0xm_ti *ti = (struct cd0xm_ti +) arg;o-         int track_idx;n-TC       M-         sony_get_toc();n-TC       iUR	!sony_toc_e ad)n-         {
-            rutnsi -EIO;
-         }o-         o-         iUR	   (ti->cdti_trk0 < sony_toc.first_track_num)
-             || (ti->cdti_trk0 > sony_toc.last_track_num)
-             || (ti->cdti_trk1 < ti->cdti_trk0))n-         {
-            rutnsi -EINVAL;
-         }o-         o-         track_idx = find_track(ti->cdti_trk0);n-TC       iUR	track_idx < 0)n-         {
-            rutnsi -EINVAL;
-         }o-         params[1]T= int_to_bcd(sony_toc.tracks[track_idx].track_st rt_msf[0]);n-         params[2]T= int_to_bcd(sony_toc.tracks[track_idx].track_st rt_msf[1]);n-         params[3]T= int_to_bcd(sony_toc.tracks[track_idx].track_st rt_msf[2]);n-         o-         /*
-          *CIf we wantMtoRstop after theclast track, use thecl ad-out
-          *MMSF toc o tha@.
-          */M-         iUR	ti->cdti_trk1 >= sony_toc.last_track_num)
-         {
-            track_idx = find_track(CDROM_LEADOUT);M-         }o-         )lses-         {
-            track_idx = find_track(ti->cdti_trk1+1);
-         }n-TC       iUR	track_idx < 0)n-         {
-            rutnsi -EINVAL;
-         }o-         params[4]T= int_to_bcd(sony_toc.tracks[track_idx].track_st rt_msf[0]);n-         params[5]T= int_to_bcd(sony_toc.tracks[track_idx].track_st rt_msf[1]);n-         params[6]T= int_to_bcd(sony_toc.tracks[track_idx].track_st rt_msf[2]);n-         params[0]T= 0x03;M-         o-         do_sony_cd_cmd(SONY_SPIN_UP_CMD, NULL, 0, rur_reg, &res_size);n-         o-         do_sony_cd_cmd(SONY_AUDIO_PLAYBACK_CMD, params, 7, rur_reg, &res_size);o-         o-         iUR		rer_sizeT< 2) || (	rur_reg[0]T& 0xf0) == 0x20))
-         {
-            priN@k("Params: %x %x %x %x %x %x %x\n", params[0], params[1],
-                   params[2], params[3], params[4], params[5], params[6]);n-            priN@k("Sony CDROM error %sR	CDROMPLAYTRKIND)\n", transl p,_error(rer_reg[1]));M-            retnsi -EIO;
-         }o-         o-         /*CSave the final positt * G_SMpauses and rerumes +/M-         Ginal_pos_msf[0] = bcd_to_int(params[4]);n-         final_pos_msf[1] = bcd_to_int(params[5]);n-         final_pos_msf[2] = bcd_to_int(params[6]);n-         sony_audio_y  pus = CDROM_AUDIO_PLAY;o-         retnsi 0;o-      }o-     n-   case CDROMVOLCTRL:   /*CVolume control.  Wha@Tvolume does this change, anyway? +/M-      {M-         struct cd0xm_volctrl *volctrl = (struct cd0xm_volctrl *) arg;o-         o-         params[0]T= SONY_SD_AUDIO_VOLUME;o-         params[1]T= volctrl->channel0;n-         params[2]T= volctrl->channel1;o-         retnsi do_sony_cd_cmd_chk("VOLCTRL",SONY_SET_DRIVE_PARAM_CMD, params, 3, rur_reg, &res_size);o-      }
-   case CDROMSUBCHNL:   /*CGet subchannel inG_ */s-      retnsi sony_get_subchnl_inG_((struct cd0xm_subchnl *)arg);M-n-   default:o-      retnsi -EINVAL;
-   }s+	unsigned char rur_reg[12];s+	unsigned int res_size;
+	unsigned char params[7];
+	int i;n+
+
+	switchR	cmd) {s+	case CDROMSTART:	/*CSpin upTthecdriveT*/s+		retnsi do_sony_cd_cmd_chk("START", SONY_SPIN_UP_CMD, NULL,
+					  0, rer_reg, &res_size);n+		be ak;M+o+	case CDROMSTOP:	/*CSpin downRthecdriveT*/s+		do_sony_cd_cmd(SONY_AUDIO_STOP_CMD, NULL, 0, rur_reg,
+			      T&res_size);n+
+		/*
+		 *CSpin thecdriveTdown, ignoring thecerror ifRthec vsk was
+		 *Calready notRspinivng.n+		 */n+		sony_audio_y  pus = CDROM_AUDIO_NO_STATUS;s+		retnsi do_sony_cd_cmd_chk("STOP", SONY_SPIN_DOWN_CMD, NULL,
+					  0, rer_reg, &res_size);n+o+	case CDROMPAUSE:	/*CPause thecdriveT+/M+		iUR	do_sony_cd_cmd_chk
+		    ("PAUSE", SONY_AUDIO_STOP_CMD, NULL, 0, rur_reg,
+		     &res_size))n+			retnsi -EIO;
+		/*CGet theccurrent positt * and 8ave it G_SMreruming */s+		iUR	read_subcode()T< 0) {n+			retnsi -EIO;
+		}
+		cur_pos_msf[0] = last_sony_subcode.abs_msf[0];o+		cur_pos_msf[1] = last_sony_subcode.abs_msf[1];o+		cur_pos_msf[2] = last_sony_subcode.abs_msf[2];n+		sony_audio_y  pus = CDROM_AUDIO_PAUSED;o+		retnsi 0;o+		be ak;M+o+	case CDROMRESUME:	/*CStart thecdriveTafter being paused +/M+		iUR	sony_audio_y  pus != CDROM_AUDIO_PAUSED) {n+			retnsi -EINVAL;
+		}
+
+		do_sony_cd_cmd(SONY_SPIN_UP_CMD, NULL, 0, rur_reg,
+			      T&res_size);n+
+		/*CStart thecdriveTat thecsaved positt *. */s+		params[1]T= int_to_bcd(cur_pos_msf[0]);n+		params[2]T= int_to_bcd(cur_pos_msf[1]);n+		params[3]T= int_to_bcd(cur_pos_msf[2]);n+		params[4]T= int_to_bcd(final_pos_msf[0]);n+		params[5]T= int_to_bcd(final_pos_msf[1]);n+		params[6]T= int_to_bcd(final_pos_msf[2]);n+		params[0]T= 0x03;M+		iUR	do_sony_cd_cmd_chk
+		    ("RESUME", SONY_AUDIO_PLAYBACK_CMD, params, 7, rur_reg,
+		     &res_size) < 0)n+			retnsi -EIO;
+		sony_audio_y  pus = CDROM_AUDIO_PLAY;o+		retnsi 0;o+o+	case CDROMPLAYMSF:	/*CPlay st rting at thecgiven MSF address.T*/s+		do_sony_cd_cmd(SONY_SPIN_UP_CMD, NULL, 0, rur_reg,
+			      T&res_size);n+
+		/*CThe parameters are given in int, must becconverted +/M+		G_SM(iT= 1; i < 7; i++) {n+			params[i]T=
+			    int_to_bcd(((unsigned char *) arg)[i - 1]);n+		}n+		params[0]T= 0x03;M+		iUR	do_sony_cd_cmd_chk
+		    ("PLAYMSF", SONY_AUDIO_PLAYBACK_CMD, params, 7,
+		     rer_reg, &res_size) < 0)n+			retnsi -EIO;
+
+		/*CSave the final positt * G_SMpauses and rerumes +/M+		Ginal_pos_msf[0] = bcd_to_int(params[4]);n+		Ginal_pos_msf[1] = bcd_to_int(params[5]);n+		Ginal_pos_msf[2] = bcd_to_int(params[6]);n+		sony_audio_y  pus = CDROM_AUDIO_PLAY;o+		retnsi 0;o+o+	case CDROMREADTOCHDR:	/*CReadRthectab 
 oURcontents header +/M+		{n+			struct cd0xm_tochdr +hdr;M+n+			sony_get_toc();n+			iUR	!sony_toc_e ad) {s+				retnsi -EIO;
+			}
+
+			hdr = (struct cd0xm_tochdr +) arg;o+			hdr->cdth_trk0 = sony_toc.first_track_num;n+			hdr->cdth_trk1 = sony_toc.last_track_num;n+		}n+		retnsi 0;o+o+	case CDROMREADTOCENTRY:	/*CReadRa given tab 
 oURcontents entry +/M+		{n+			struct cd0xm_tocentry +entry;n+			int track_idx;n+			unsigned char *msf_valT= NULL;
+n+			sony_get_toc();n+			iUR	!sony_toc_e ad) {s+				retnsi -EIO;
+			}
+
+			entry = (struct cd0xm_tocentry +) arg;o+
+			track_idx = find_track(entry->cdte_track);n+			iUR	track_idx < 0) {s+				retnsi -EINVAL;
+			}
+
+			entry->cdte_adr =
+			    sony_toc.tracks[track_idx].address;
+			entry->cdte_ctrl =
+			    sony_toc.tracks[track_idx].control;
+			msf_valT=
+			    sony_toc.tracks[track_idx].track_st rt_msf;o+
+			/*CLogtcal buNf_rTaddress _SMMSF G_Smat requurted? +/M+			iUR	entry->cdte_G_Smat == CDROM_LBA) {s+				entry->cdte_addr.lbaT= msf_to_log(msf_val);M+			} )lse iUR	entry->cdte_G_Smat == CDROM_MSF) {s+				entry->cdte_addr.msf.minute = *msf_val;
+				entry->cdte_addr.msf.second =
+				    *(msf_val + 1);
+				entry->cdte_addr.msf.frame =
+				    *(msf_val + 2);n+			}
+		}
+		retnsi 0;o+		be ak;M+o+	case CDROMPLAYTRKIND:	/*CPlay a track.  This currently ignores index. +/M+		{n+			struct cd0xm_ti *ti = (struct cd0xm_ti +) arg;o+			int track_idx;n+n+			sony_get_toc();n+			iUR	!sony_toc_e ad) {s+				retnsi -EIO;
+			}
+
+			iUR		ti->cdti_trk0 < sony_toc.first_track_num)
+			    || (ti->cdti_trk0 > sony_toc.last_track_num)
+			    || (ti->cdti_trk1 < ti->cdti_trk0)) {s+				retnsi -EINVAL;
+			}
+
+			track_idx = find_track(ti->cdti_trk0);n+			iUR	track_idx < 0) {s+				retnsi -EINVAL;
+			}
+			params[1]T=
+			    int_to_bcd(sony_toc.tracks[track_idx].
+				       track_st rt_msf[0]);n+			params[2]T=
+			    int_to_bcd(sony_toc.tracks[track_idx].
+				       track_st rt_msf[1]);n+			params[3]T=
+			    int_to_bcd(sony_toc.tracks[track_idx].
+				       track_st rt_msf[2]);n+
+			/*
+			 *CIf we wantMtoRstop after theclast track, use thecl ad-out
+			 *CMSF toc o tha@.
+			 */M+			iUR	ti->cdti_trk1 >= sony_toc.last_track_num) {s+				track_idx = find_track(CDROM_LEADOUT);M+			} )lse {n+				track_idx = find_track(ti->cdti_trk1 + 1);
+			}n+			iUR	track_idx < 0) {s+				retnsi -EINVAL;
+			}
+			params[4]T=
+			    int_to_bcd(sony_toc.tracks[track_idx].
+				       track_st rt_msf[0]);n+			params[5]T=
+			    int_to_bcd(sony_toc.tracks[track_idx].
+				       track_st rt_msf[1]);n+			params[6]T=
+			    int_to_bcd(sony_toc.tracks[track_idx].
+				       track_st rt_msf[2]);n+			params[0]T= 0x03;M+n+			do_sony_cd_cmd(SONY_SPIN_UP_CMD, NULL, 0, rur_reg,
+				      T&res_size);n+
+			do_sony_cd_cmd(SONY_AUDIO_PLAYBACK_CMD, params, 7,
+				       rer_reg,T&res_size);n+
+			iUR		rer_sizeT< 2)o+			    || (	rur_reg[0]T& 0xf0) == 0x20)) {n+				priN@k("Params: %x %x %x %x %x %x %x\n",
+				       params[0], params[1], params[2],
+				       params[3], params[4], params[5],
+				       params[6]);
+				priN@kn+				    ("Sony CDROM error %sR	CDROMPLAYTRKIND)\n",
+				     transl p,_error(rer_reg[1]));M+				retnsi -EIO;
+			}
+
+			/*CSave the final positt * G_SMpauses and rerumes +/M+			Ginal_pos_msf[0] = bcd_to_int(params[4]);n+			Ginal_pos_msf[1] = bcd_to_int(params[5]);n+			Ginal_pos_msf[2] = bcd_to_int(params[6]);n+			sony_audio_y  pus = CDROM_AUDIO_PLAY;o+			retnsi 0;o+		}M+o+	case CDROMVOLCTRL:	/*CVolume control.  Wha@Tvolume does this change, anyway? +/M+		{n+			struct cd0xm_volctrl *volctrl =o+			    (struct cd0xm_volctrl *) arg;o+n+			params[0]T= SONY_SD_AUDIO_VOLUME;o+			params[1]T= volctrl->channel0;n+			params[2]T= volctrl->channel1;o+			retnsi do_sony_cd_cmd_chk("VOLCTRL",
+						  SONY_SET_DRIVE_PARAM_CMD,
+						  params, 3, rur_reg,
+						  &res_size);n+		}o+	case CDROMSUBCHNL:	/*CGet subchannel inG_ */s+		retnsi sony_get_subchnl_inG_((struct cd0xm_subchnl *) arg);M+n+	default:o+		retnsi -EINVAL;
+	}
 }n s y  pF Tint scd_dev_ioctl(struct cd0xm_device_inG_ *cdi,
-          unsigned int  cmd,
-          unsigned long arg)
+			 unsigned int cmd, unsigned long arg)
 {
-   int i;
+	int i;n s-   switchR	cmd)n-   {o-   case CDROMREADAUDIO:      /*CReadR2352 byteCaudio tracks and 2340 byte
-				 raw data tracks. +/M-      {M-         struct cd0xm_read_audio ra;
-
-s-         sony_get_toc();n-TC       iUR	!sony_toc_e ad)n-         {
-         	retnsi -EIO;
-         }o-
-	 iU(copy_G0xm_user(&ra, (char *) arg, sizeof(ra)))
-	 	retnsi -EFAULT;o-s-         iUR	ra.nframes == 0)n-         {
-         	retnsi 0;s-         }o-s-         i=verify_ae a(VERIFY_WRITE, ra.buN, CD_FRAMESIZE_RAW *Cra.nframes);n-TC       iU(i<0)n-         	retnsi i;o-s-         iUR	ra.addr_G_Smat == CDROM_LBA)n-         {
-            iUR	   (ra.addr.lbaT>= sony_toc.lead_out_st rt_lba)s-                || (ra.addr.lbaT+Cra.nframesT>= sony_toc.lead_out_st rt_lba))
-            {
-               retnsi -EINVAL;
-            }s-         }o-         )lse iUR	ra.addr_G_Smat == CDROM_MSF)n-         {
-            iUR	   (ra.addr.msf.minute >= 75)s-                || (ra.addr.msf.second >= 60)s-                || (ra.addr.msf.frame >= 75))
-            {
-               retnsi -EINVAL;
-            }s-M-            ra.addr.lbaT=R	  (ra.addr.msf.minute * 4500)s-                           + (ra.addr.msf.second * 75)s-                           + ra.addr.msf.frame);n-            iUR	   (ra.addr.lbaT>= sony_toc.lead_out_st rt_lba)s-                || (ra.addr.lbaT+Cra.nframesT>= sony_toc.lead_out_st rt_lba))
-            {
-               retnsi -EINVAL;
-            }s-
-            /*CI know, this can go neg pFve  * an unsigned.  However,
-               the first thing done tocthecdata is tocadd this value,
-               so this should compensate and allow direct msf accurs. */s-            ra.addr.lbaT-= LOG_START_OFFSET;M-         }o-         )lses-         {
-            rutnsi -EINVAL;
-         }o-o-         retnsi(read_audio(&ra));s-      }s-      retnsi 0;o-      be ak;M-n-   default:o-      retnsi -EINVAL;
-   }s+	switchR	cmd) {s+	case CDROMREADAUDIO:	/*CReadR2352 byteCaudio tracks and 2340 byte
+				   raw data tracks. +/M+		{n+			struct cd0xm_read_audio ra;
+n+n+			sony_get_toc();n+			iUR	!sony_toc_e ad) {s+				retnsi -EIO;
+			}
+
+			iUR	copy_G0xm_user(&ra, (char *) arg, sizeof(ra)))
+				retnsi -EFAULT;o+
+			iUR	ra.nframes == 0) {s+				retnsi 0;
+			}
+
+			iT= verify_ae a(VERIFY_WRITE, ra.buN,
+					CD_FRAMESIZE_RAW *Cra.nframes);n+			iUR	i < 0)n+				retnsi i;o+
+			iUR	ra.addr_G_Smat == CDROM_LBA) {s+				iUR		ra.addr.lbaT>=
+				     sony_toc.lead_out_st rt_lba)s+				    || (ra.addr.lbaT+Cra.nframesT>=
+					sony_toc.lead_out_st rt_lba)) {n+					retnsi -EINVAL;
+				}
+			} )lse iUR	ra.addr_G_Smat == CDROM_MSF) {s+				iUR		ra.addr.msf.minute >= 75)s+				    || (ra.addr.msf.second >= 60)s+				    || (ra.addr.msf.frame >= 75)) {n+					retnsi -EINVAL;
+				}
+n+				ra.addr.lbaT=R	(ra.addr.msf.minute * 4500)s+					       + (ra.addr.msf.second * 75)s+					       + ra.addr.msf.frame);n+				iUR		ra.addr.lbaT>=
+				     sony_toc.lead_out_st rt_lba)s+				    || (ra.addr.lbaT+Cra.nframesT>=
+					sony_toc.lead_out_st rt_lba)) {n+					retnsi -EINVAL;
+				}
+n+				/*CI know, this can go neg pFve  * an unsigned.  However,
+				   the first thing done tocthecdata is tocadd this value,
+				   so this should compensate and allow direct msf accurs. */s+				ra.addr.lbaT-= LOG_START_OFFSET;M+			} )lse {n+				retnsi -EINVAL;
+			}
+
+			retnsi (read_audio(&ra));s+		}
+		retnsi 0;o+		be ak;M+o+	default:o+		retnsi -EINVAL;
+	}
 }n s y  pF Tint scd_spinup(ES <)
 {n-   unsigned char rur_reg[12];s-   unsigned int res_size;
-   int num_spin_ups;o-s-   num_spin_upsT= 0;n-
-respinup_on_open:
-   do_sony_cd_cmd(SONY_SPIN_UP_CMD, NULL, 0, rur_reg, &res_size);n-s-   /*CThe drive sometimesTretnsis error 0.  I don't know why, but ignoreM-      it.  It seems tocmean thecdriveThasCalready done thecoperatt *. */s-   iUR		rer_sizeT< 2) || (	rur_reg[0]T!= 0) &&R	rer_reg[1]T!= 0)))
-   {s-      priN@k("Sony CDROM %s error (scd_open,Rspin up)\n", transl p,_error(rer_reg[1]));M-      retnsi 1;s-   }
-      o-   do_sony_cd_cmd(SONY_READ_TOC_CMD, NULL, 0, rur_reg, &res_size);n-s-   /*CThe drive sometimesTretnsis error 0.  I don't know why, but ignoreM-      it.  It seems tocmean thecdriveThasCalready done thecoperatt *. */s-   iUR		rer_sizeT< 2) || (	rur_reg[0]T!= 0) &&R	rer_reg[1]T!= 0)))
-   {
-      /*CIf thecdriveTisCalready playing, it's ok.  +/M-      iUR		res_reg[1]T== SONY_AUDIO_PLAYING_ERR) || (rer_reg[1]T== 0))n-      {
-         retnsi 0;s-      }s-o-      /*CIf thecdriveTsaysRi@ is notRspun upT(even though we just did it!)
-         then retry thecoperatt * at least a few times. */s-      iUR	   (res_reg[1]T== SONY_NOT_SPIN_ERR)s-          &&R	num_spin_upsT< MAX_CDU31A_RETRIES))n-      {
-         num_spin_ups++;o-         goto respinup_on_open;s-      }s-o-      priN@k("Sony CDROM error %sR	scd_open,RreadRtoc)\n", transl p,_error(rer_reg[1]));M-      do_sony_cd_cmd(SONY_SPIN_DOWN_CMD, NULL, 0, rur_reg, &res_size);n-      retnsi 1;  o-   }o-   retnsi 0;o+	unsigned char rur_reg[12];s+	unsigned int res_size;
+	int num_spin_ups;o+o+	num_spin_upsT= 0;n+
+      respinup_on_open:
+	do_sony_cd_cmd(SONY_SPIN_UP_CMD, NULL, 0, rur_reg, &res_size);n+
+	/*CThe drive sometimesTretnsis error 0.  I don't know why, but ignoreM+	   it.  It seems tocmean thecdriveThasCalready done thecoperatt *. */s+	iUR	(res_sizeT< 2) || (	rur_reg[0]T!= 0) &&R	rer_reg[1]T!= 0))) {n+		priN@k("Sony CDROM %s error (scd_open,Rspin up)\n",
+		       transl p,_error(rer_reg[1]));M+		retnsi 1;s+	}
+
+	do_sony_cd_cmd(SONY_READ_TOC_CMD, NULL, 0, rur_reg, &res_size);n+
+	/*CThe drive sometimesTretnsis error 0.  I don't know why, but ignoreM+	   it.  It seems tocmean thecdriveThasCalready done thecoperatt *. */s+	iUR	(res_sizeT< 2) || (	rur_reg[0]T!= 0) &&R	rer_reg[1]T!= 0))) {n+		/*CIf thecdriveTisCalready playing, it's ok.  +/M+		iUR		rer_reg[1]T== SONY_AUDIO_PLAYING_ERR)
+		    || (rer_reg[1]T== 0)) {n+			retnsi 0;o+		}M+o+		/*CIf thecdriveTsaysRi@ is notRspun upT(even though we just did it!)
+		   then retry thecoperatt * at least a few times. */s+		iUR		rer_reg[1]T== SONY_NOT_SPIN_ERR)s+		    &&R	num_spin_upsT< MAX_CDU31A_RETRIES)) {n+			num_spin_ups++;o+			goto respinup_on_open;s+		}M+o+		priN@k("Sony CDROM error %sR	scd_open,RreadRtoc)\n",
+		       transl p,_error(rer_reg[1]));M+		do_sony_cd_cmd(SONY_SPIN_DOWN_CMD, NULL, 0, rur_reg,
+			      T&res_size);n+		retnsi 1;s+	}
+	retnsi 0;o }n s /*s  * Open thecdriveTG_SMoperatt *s. CSpin thecdriveTupTand readRthectab 
 oUs  * contents ifRthese have notRalready been done.
  */M-y  pF Tint
-scd_open(struct cd0xm_device_inG_ *cdi, int openmode)n+y  pF Tint scd_open(struct cd0xm_device_inG_ *cdi, int openmode)n {n-   unsigned char rur_reg[12];s-   unsigned int res_size;
-   unsigned char params[2];s-
-   MOD_INC_USE_COUNT;n-   iUR	sony_usage == 0)n-   {M-      iUR	scd_spinup()T!= 0) {
-         MOD_DEC_USE_COUNT;n-         retnsi -EIO;
-      }
-      sony_get_toc();n-TC    iUR	!sony_toc_e ad)n-      {o-         do_sony_cd_cmd(SONY_SPIN_DOWN_CMD, NULL, 0, rur_reg, &res_size);n-         MOD_DEC_USE_COUNT;n-         retnsi -EIO;
-      }
-o-      /*CFor XA on thecCDU31A only, we have toRdoRspecial reads.
-         ThecCDU33A handles XA automagtcally. */s-      /*CiUR	   (sony_toc. vsk_typeT== SONY_XA_DISK_TYPE) */s-      iUR	   (sony_toc. vsk_typeT!= 0x00)s-          &&R	!is_double_speed))n-      {M-         params[0]T= SONY_SD_DECODE_PARAM;M-         params[1]T= 0x07;s-         do_sony_cd_cmd(SONY_SET_DRIVE_PARAM_CMD,
-                        params,
-                        2,
-                        rur_reg,
-                        &res_size);n-         iUR		rer_sizeT< 2) || (	rur_reg[0]T& 0xf0) == 0x20))
-         {
-            priN@k("CDU31A: Unab 
 toRset XA params: 0x%2.2x\n", rer_reg[1]);o-      TC }s-         sony_xa_mode = 1;
-      }
-      /*CA non-XA disk. CSet thecparms back iURnecursary. */s-      )lse iUR	sony_xa_mode)n-      {M-         params[0]T= SONY_SD_DECODE_PARAM;M-         params[1]T= 0x0f;s-         do_sony_cd_cmd(SONY_SET_DRIVE_PARAM_CMD,
-                        params,
-                        2,
-                        rur_reg,
-                        &res_size);n-         iUR		rer_sizeT< 2) || (	rur_reg[0]T& 0xf0) == 0x20))
-         {
-            priN@k("CDU31A: Unab 
 toRreset XA params: 0x%2.2x\n", rer_reg[1]);o-      TC }s-         sony_xa_mode = 0;s-      }s+	unsigned char rur_reg[12];s+	unsigned int res_size;
+	unsigned char params[2];s+
+	MOD_INC_USE_COUNT;n+	iUR	sony_usage == 0) {n+		iUR	scd_spinup()T!= 0) {
+			MOD_DEC_USE_COUNT;n+			retnsi -EIO;
+		}
+		sony_get_toc();n+		iUR	!sony_toc_e ad) {s+			do_sony_cd_cmd(SONY_SPIN_DOWN_CMD, NULL, 0,
+				       rer_reg,T&res_size);n+			MOD_DEC_USE_COUNT;n+			retnsi -EIO;
+		}
+o+		/*CFor XA on thecCDU31A only, we have toRdoRspecial reads.
+		   ThecCDU33A handles XA automagtcally. */s+		/*CiUR	   (sony_toc. vsk_typeT== SONY_XA_DISK_TYPE) */s+		iUR		sony_toc. vsk_typeT!= 0x00)s+		    &&R	!is_double_speed)) {n+			params[0]T= SONY_SD_DECODE_PARAM;M+			params[1]T= 0x07;s+			do_sony_cd_cmd(SONY_SET_DRIVE_PARAM_CMD,
+				       params, 2, rer_reg, &res_size);n+			iUR		rer_sizeT< 2)o+			    || (	rur_reg[0]T& 0xf0) == 0x20)) {n+				priN@kn+				    ("CDU31A: Unab 
 toRset XA params: 0x%2.2x\n",
+				     rer_reg[1]);
+			}n+			sony_xa_mode = 1;
+		}
+		/*CA non-XA disk. CSet thecparms back iURnecursary. */s+		)lse iUR	sony_xa_mode) {n+			params[0]T= SONY_SD_DECODE_PARAM;M+			params[1]T= 0x0f;s+			do_sony_cd_cmd(SONY_SET_DRIVE_PARAM_CMD,
+				       params, 2, rer_reg, &res_size);n+			iUR		rer_sizeT< 2)o+			    || (	rur_reg[0]T& 0xf0) == 0x20)) {n+				priN@kn+				    ("CDU31A: Unab 
 toRreset XA params: 0x%2.2x\n",
+				     rer_reg[1]);
+			}n+			sony_xa_mode = 0;o+		}M n-      sony_spun_upT= 1;s-   }
+		sony_spun_upT= 1;s+	}M n-   sony_usage++;o+	sony_usage++;o o-   retnsi 0;o+	retnsi 0;o }n s 
@@ -3205,114 +3171,109 @@s  * Close thecdrive. CSpin i@ downRiURno task is using it.  Thecspins  * downRwill failRiURplayingCaudio, 8o audio play is OK.
  */M-y  pF TES <
-scd_release(struct cd0xm_device_inG_ *cdi)n+y  pF TES < scd_release(struct cd0xm_device_inG_ *cdi)n {
-   iUR	sony_usage == 1)n-   {M-      unsigned char rur_reg[12];s-      unsigned int  res_size;
-o-      do_sony_cd_cmd(SONY_SPIN_DOWN_CMD, NULL, 0, rur_reg, &res_size);n-n-      sony_spun_upT= 0;s-   }
-   sony_usage--;
-   MOD_DEC_USE_COUNT;n+	iUR	sony_usage == 1) {
+		unsigned char rur_reg[12];s+		unsigned int res_size;
+n+		do_sony_cd_cmd(SONY_SPIN_DOWN_CMD, NULL, 0, rur_reg,
+			      T&res_size);n+n+		sony_spun_upT= 0;s+	}s+	sony_usage--;
+	MOD_DEC_USE_COUNT;n }n s y  pF Tstruct cd0xm_device_ops scd_dopsT= {M-	open:			scd_open,M-	release:		scd_release,M-	drive_y  pus:		scd_drive_y  pus,M-	media_changed:		scd_media_changed,M-	tray_move:		scd_tray_move,M-	lock_door:		scd_lock_door,M-	select_speed:		scd_select_speed,M-	get_last_sursion:	scd_get_last_sursion,M-	get_mcn:		scd_get_mcn,M-	reset:			scd_reset,M-	audio_ioctl:		scd_audio_ioctl,M-	dev_ioctl:		scd_dev_ioctl,M-	capability:		CDC_OPEN_TRAY | CDC_CLOSE_TRAY | CDC_LOCK |
-				CDC_SELECT_SPEED | CDC_MULTI_SESSION | 
-				CDC_MULTI_SESSION | CDC_MCN |
-				CDC_MEDIA_CHANGED | CDC_PLAY_AUDIO |
-				CDC_RESET | CDC_IOCTLS | CDC_DRIVE_STATUS,M-	n_minors:		1,
+	open:scd_open,M+	release:scd_release,M+	drive_y  pus:scd_drive_y  pus,M+	media_changed:scd_media_changed,M+	tray_move:scd_tray_move,M+	lock_door:scd_lock_door,M+	select_speed:scd_select_speed,M+	get_last_sursion:scd_get_last_sursion,M+	get_mcn:scd_get_mcn,M+	reset:scd_reset,M+	audio_ioctl:scd_audio_ioctl,M+	dev_ioctl:scd_dev_ioctl,M+	capability:CDC_OPEN_TRAY | CDC_CLOSE_TRAY | CDC_LOCK |
+	    CDC_SELECT_SPEED | CDC_MULTI_SESSION |
+	    CDC_MULTI_SESSION | CDC_MCN |
+	    CDC_MEDIA_CHANGED | CDC_PLAY_AUDIO |
+	    CDC_RESET | CDC_IOCTLS | CDC_DRIVE_STATUS,M+	n_minors:1,
 };n s y  pF Tstruct cd0xm_device_inG_ scd_inG_ = {M-	ops:		&scd_dops,M-	speed:		2,M-	capacity:	1,M-	name:		"cdu31a"
+	ops:&scd_dops,M+	speed:2,M+	capacity:1,
+	name:"cdu31a"
 };n s /*CThe diNf_rent types of disc loading mechanisms supported +/M-y  pF Tc *st char *load_mech[] __initdata = { "caddy", "tray", "pop-up", "unknown" };n+y  pF Tchar *load_mech[] __initdata =
+    { "caddy", "tray", "pop-up", "unknown" };n M-y  pF TES < __init n+y  pF TES < __init
 get_drive_c *figuratt *(unsigned short base_io,
-                        unsigned char rur_reg[],
-                        unsigned int *res_size)
+			unsigned char rur_reg[], unsigned int *res_size)
 {
-   int retry_c unt;
+	int retry_c unt;
 o o-   /*CSet thecbaseTaddress */s-   cdu31a_port = base_io;
+	/*CSet thecbaseTaddress */s+	cdu31a_port = base_io;
 o-   /*CSet upTall theceegister locatt *s */s-   sony_cd_cmd_eeg = cdu31a_port + SONY_CMD_REG_OFFSET;M-   sony_cd_param_eeg = cdu31a_port + SONY_PARAM_REG_OFFSET;M-   sony_cd_write_eeg = cdu31a_port + SONY_WRITE_REG_OFFSET;M-   sony_cd_control_eeg = cdu31a_port + SONY_CONTROL_REG_OFFSET;M-   sony_cd_y  pus_eeg = cdu31a_port + SONY_STATUS_REG_OFFSET;M-   sony_cd_rerult_eeg = cdu31a_port + SONY_RESULT_REG_OFFSET;M-   sony_cd_read_eeg = cdu31a_port + SONY_READ_REG_OFFSET;M-   sony_cd_fifost_eeg = cdu31a_port + SONY_FIFOST_REG_OFFSET;M-o-   /*
-    * Check tocsee iURanything existsTat thecs  pus eegister locatt *.
-    * I don't know ifRthis isCa good way toccheck, but it seems tocwork
-    * okTG_SMme.
-    */s-   iUR	read_s  pus_eegister()T!= 0xff)
-   {
-      /*
-       *CReset thecdriveTand wait G_SMattentt * G0xmCit (tocsay it's reset).n-       *CIf you don't wait, thecnextcoperatt * will probab y fail.n-       */s-      reset_drive();n-      retry_c unt = jiNfies + SONY_RESET_TIMEOUT;n-      whi 
 (time_beG_Se(jiNfies, retry_c unt) &&R	!is_attentt *()))n-      {M-         sony_sleep();s-      }s+	/*CSet upTall theceegister locatt *s */s+	sony_cd_cmd_eeg = cdu31a_port + SONY_CMD_REG_OFFSET;M+	sony_cd_param_eeg = cdu31a_port + SONY_PARAM_REG_OFFSET;M+	sony_cd_write_eeg = cdu31a_port + SONY_WRITE_REG_OFFSET;M+	sony_cd_control_eeg = cdu31a_port + SONY_CONTROL_REG_OFFSET;M+	sony_cd_y  pus_eeg = cdu31a_port + SONY_STATUS_REG_OFFSET;M+	sony_cd_rerult_eeg = cdu31a_port + SONY_RESULT_REG_OFFSET;M+	sony_cd_read_eeg = cdu31a_port + SONY_READ_REG_OFFSET;M+	sony_cd_fifost_eeg = cdu31a_port + SONY_FIFOST_REG_OFFSET;M+
+	/*
+	 * Check tocsee iURanything existsTat thecs  pus eegister locatt *.
+	 * I don't know ifRthis isCa good way toccheck, but it seems tocwork
+	 * okTG_SMme.
+	 */s+	iUR	read_s  pus_eegister()T!= 0xff) {n+		/*
+		 *CReset thecdriveTand wait G_SMattentt * G0xmCit (tocsay it's reset).n+		 *CIf you don't wait, thecnextcoperatt * will probab y fail.n+		 */n+		reset_drive();n+		retry_c unt = jiNfies + SONY_RESET_TIMEOUT;n+		whi 
 (time_beG_Se(jiNfies, retry_c unt)
+		       &&R	!is_attentt *())) {n+			sony_sleep();s+		}M n #iUR0o-      /*CIf attentt * is never seen probab y notRacCDU31a present */s-      iUR	!is_attentt *())n-      {
-         rer_reg[0]T= 0x20;n-         retnsi;
-      }
-#endiNn-o-      /*
-       *CGet thecdriveTc *figuratt *.n-       */s-      do_sony_cd_cmd(SONY_REQ_DRIVE_CONFIG_CMD,
-                     NULL,
-                     0,
-                     (unsigned char *) rur_reg,
-                     res_size);n-      retnsi;s-   }
+		/*CIf attentt * is never seen probab y notRacCDU31a present */s+		iUR	!is_attentt *()) {n+			rer_reg[0]T= 0x20;n+			retnsi;
+		}
+#endiNn+
+		/*
+		 *CGet thecdriveTc *figuratt *.n+		 */n+		do_sony_cd_cmd(SONY_REQ_DRIVE_CONFIG_CMD,
+			      TNULL,
+			       0, (unsigned char *) rur_reg, res_size);n+		retnsi;s+	}M n-   /*CRetnsi an error */s-   rer_reg[0]T= 0x20;n+	/*CRetnsi an error */s+	rer_reg[0]T= 0x20;n }M n #iUndef MODULE
@@ -3321,33 +3282,28 @@s  
  */M M-y  pF Tint __init cdu31a_setup(char *strings)	     n+y  pF Tint __init cdu31a_setup(char *strings)
 {s-    int ints[4];n-    n-    (ES <)get_optt *s(strings, ARRAY_SIZE(ints), ints);n-n-   iUR	ints[0]T> 0)n-   {M-      cdu31a_port = ints[1];o-   }n-   iUR	ints[0]T> 1)n-   {M-      cdu31a_irq = ints[2];o-   }n-   iUR	(stringsT!= NULL) &&R	*stringsT!= '\0'))n-   {M-      iUR	strcmp(strings, "PAS") == 0)n-      {M-	 sony_pas_init = 1;
-      }
-      )lses-      {M-	 priN@k("CDU31A: UnknownCinterfacectype: %s\n", strings);
-      }
-   }
-   o-   retnsi 1;
+	int ints[4];n+
+	(ES <) get_optt *s(strings, ARRAY_SIZE(ints), ints);n+s+	iUR	ints[0]T> 0) {n+		cdu31a_port = ints[1];o+	}s+	iUR	ints[0]T> 1) {n+		cdu31a_irq = ints[2];o+	}s+	iUR	(stringsT!= NULL) &&R	*stringsT!= '\0')) {n+		iUR	strcmp(strings, "PAS") == 0) {n+			sony_pas_init = 1;
+		} )lse {n+			priN@k("CDU31A: UnknownCinterfacectype: %s\n",
+			       strings);
+		}
+	}
+o+	retnsi 1;
 }M n __setup("cdu31a=", cdu31a_setup);
@@ -3359,223 +3315,204 @@s /*s  * InitializeTthecdriver.
  */M-int __init 
-cdu31a_init(ES <)
+int __init cdu31a_init(ES <)
 {M-   struct s_sony_drive_c *fig drive_c *fig;s-   unsigned int res_size;
-   char msg[255];
-   char buf[40];
-   int i;
-   int drive_f und;
-   int tmp_irq;
-
-s-   /*
-    * According tocAlex Freed (freed@europa.ort *.adobe.com),Rthis is
-    * required G_SMthecFusioncCD-16 package. CIf thecs undcdriver is
-    * loaded, it should work fine, but just in case...
-    *
-    * The following tnsi on thecCD-ROM interfacecG_SMacFusioncCD-16.
-    */s-   iUR	sony_pas_init)n-   {M-      outb(0xbc, 0x9a01);
-      outb(0xe2, 0x9a01);
-   }
-o-   drive_f undT= 0;n-
-   /*CSetting thecbaseTI/OTaddress toc0xffff will disab 
 it. */s-   iUR	cdu31a_port ==c0xffff)n-   {M-   }
-   )lse iUR	cdu31a_port != 0)n-   {M-      tmp_irq = cdu31a_irq; /*CNeed IRQ 0 because we can't sleep here. */s-      cdu31a_irq = 0;n-n-      get_drive_c *figuratt *(cdu31a_port,
-			      drive_c *fig.exec_y  pus,M-			      &res_size);n-      iUR		rer_sizeT> 2) &&R	(drive_c *fig.exec_y  pus[0]T& 0xf0) == 0x00))n-      {
-	 drive_f undT= 1;
-      }
-o-      cdu31a_irq = tmp_irq;
-   }
-   )lsen-   {M-      cdu31a_irq = 0;n-      i = 0;n-      whi 
 (   (cdu31a_addresses[i].baseT!= 0)n-	     &&R	!drive_f und))n-      {
-	 iUR	check_eegi *(cdu31a_addresses[i].base, 4)) {n-	    i++;o-	    continue;o-	 }o-	 get_drive_c *figuratt *(cdu31a_addresses[i].base,
-				 drive_c *fig.exec_y  pus,M-				 &res_size);n-	 iUR		rer_sizeT> 2) &&R	(drive_c *fig.exec_y  pus[0]T& 0xf0) == 0x00))n-	 {n-	    drive_f undT= 1;
-	    cdu31a_irq = cdu31a_addresses[i].int_num;n-	 }o-	 )lsen-	 {n-	    i++;o-	 }
-      }
-   }
-s-   iUR	drive_f und)n-   {M-      int deficiency=0;n-n-      requurt_eegi *(cdu31a_port, 4,"cdu31a");n-      
-      iUR	devfs_eegister_blkdev(MAJOR_NR,"cdu31a",&cd0xm_fops))n-      {
-	 priN@k("Unab 
 toRget major %d G_SMCDU-31a\n", MAJOR_NR);o-         goto errout2;
-      }
-o-      iUR	SONY_HWC_DOUBLE_SPEED(drive_c *fig))n-      {
-	 is_double_speedT= 1;
-      }
-o-      tmp_irq = cdu31a_irq; /*CNeed IRQ 0 because we can't sleep here. */s-      cdu31a_irq = 0;n-n-      set_drive_params(sony_speed);
-o-      cdu31a_irq = tmp_irq;
-      
-      iUR	cdu31a_irq > 0)n-      {M-	 iUR	requurt_irq	cdu31a_irq, cdu31a_interrupt, SA_INTERRUPT, "cdu31a", NULL))n-	 {n-	    priN@k("Unab 
 toRgrab IRQ%d G_SMthecCDU31A driver\n", cdu31a_irq);
-	    cdu31a_irq = 0;o-	 }
-      }
-      
-      spriN@f(msg, "Sony I/F CDROM : %8.8s %16.16s %8.8s\n",
-	     drive_c *fig.vendor_id,
-	     drive_c *fig.product_id,
-	     drive_c *fig.product_rev_level);M-      spriN@f(buN, "  Capabilities: %s",
-	     load_mech[SONY_HWC_GET_LOAD_MECH(drive_c *fig)]);n-      strcat(msg, buN);n-      iUR	SONY_HWC_AUDIO_PLAYBACK(drive_c *fig))n-      {
-         strcat(msg, ", audio");n-      } )lsen-	 deficiency |= CDC_PLAY_AUDIO;n-      iUR	SONY_HWC_EJECT(drive_c *fig))n-      {
-         strcat(msg, ", eject");n-      } )lsen-	 deficiency |= CDC_OPEN_TRAY;n-      iUR	SONY_HWC_LED_SUPPORT(drive_c *fig))n-      {
-         strcat(msg, ", LED");s-      }s-      iUR	SONY_HWC_ELECTRIC_VOLUME(drive_c *fig))n-      {
-         strcat(msg, ", elec.CVol");s-      }s-      iUR	SONY_HWC_ELECTRIC_VOLUME_CTL(drive_c *fig))n-      {
-         strcat(msg, ", sep.CVol");s-      }s-      iUR	is_double_speed)n-      {
-         strcat(msg, ", double speed");n-      } )lsen-	 deficiency |= CDC_SELECT_SPEED;
-      iUR	cdu31a_irq > 0)n-      {M-	 spriN@f(buN, ", irq %d", cdu31a_irq);
-         strcat(msg, buN);n-      }n-      strcat(msg, "\n");
-o-      is_a_cdu31a = strcmp("CD-ROM CDU31A", drive_c *fig.product_id) == 0;
-o-      blk_init_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR),RDEVICE_REQUEST);n-      read_ahead[MAJOR_NR] = CDU31A_READAHEAD;o-      cdu31a_block_sizeT= 1024; /*C1kB default block size */s-      /*Cuse 'm unt -o block=2048' */s-      blksize_size[MAJOR_NR] = &cdu31a_block_size;
-      
-      init_timer(&cdu31a_abort_timer);o-      cdu31a_abort_timer.functt * = handle_abort_timeout;n-n-      scd_inG_.dev = MKDEV(MAJOR_NR,0);n-TC    scd_inG_.mask = deficiency;n-      strncpy(scd_inG_.name, "cdu31a", sizeof(scd_inG_.name));
-o-      iUR	register_cd0xm(&scd_inG_))n-      {
-         goto errout0;
-      }
-   }
-s-o-   dvsk_changedT= 1;
-   s-   iUR	drive_f und)n-   {M-      retnsi(0);
-   }
-   )lsen-   {M-      goto errout3;
-   }
-errout0:
-   priN@k("Unab 
 toReegister CDU-31a with UniG_Sm cd0xm driver\n");
-   blk_cleanup_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR));n-   iUR	devfs_uneegister_blkdev(MAJOR_NR, "cdu31a"))    s-   {s-      priN@k("Can't uneegister block device G_SMcdu31a\n");
-   }
-errout2:o-   release_eegi *(cdu31a_port,4);
-errout3:o-   retnsi -EIO;
-}
-s-o-ES < __exit
-cdu31a_exit(ES <)
-{
-   iUR	uneegister_cd0xm(&scd_inG_))    s-   {s-      priN@k("Can't uneegister cdu31a G0xmCUniG_Sm cd0xm driver\n");
-      retnsi;s-   }
-   iUR	(devfs_uneegister_blkdev(MAJOR_NR, "cdu31a") == -EINVAL))    s-   {s-      priN@k("Can't uneegister cdu31a\n");
-      retnsi;s-   }
-
-   blk_cleanup_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR));n-s-   iUR	cdu31a_irq > 0)n-      free_irq	cdu31a_irq, NULL);n-s-   release_eegi *(cdu31a_port,4);
-   priN@k(KERN_INFO "cdu31a module released.\n");
-}   n+	struct s_sony_drive_c *fig drive_c *fig;s+	unsigned int res_size;
+	char msg[255];
+	char buf[40];
+	int i;n+	int drive_f und;
+	int tmp_irq;
+M+
+	/*
+	 * According tocAlex Freed (freed@europa.ort *.adobe.com),Rthis is
+	 * required G_SMthecFusioncCD-16 package. CIf thecs undcdriver is
+	 * loaded, it should work fine, but just in case...
+	 *
+	 * The following tnsi on thecCD-ROM interfacecG_SMacFusioncCD-16.
+	 */s+	iUR	sony_pas_init) {n+		outb(0xbc, 0x9a01);
+		outb(0xe2, 0x9a01);
+	}
+
+	drive_f undT= 0;n+s+	/*CSetting thecbaseTI/OTaddress toc0xffff will disab 
 it. */s+	iUR	cdu31a_port ==c0xffff) {n+	} )lse iUR	cdu31a_port != 0) {n+		tmp_irq = cdu31a_irq;	/*CNeed IRQ 0 because we can't sleep here. */s+		cdu31a_irq = 0;n+s+		get_drive_c *figuratt *(cdu31a_port,
+					drive_c *fig.exec_y  pus,M+					&res_size);n+		iUR		rer_sizeT> 2)s+		    &&R	(drive_c *fig.exec_y  pus[0]T& 0xf0) == 0x00)) {s+			drive_f undT= 1;
+		}
+o+		cdu31a_irq = tmp_irq;
+	} )lse {n+		cdu31a_irq = 0;n+		iT= 0;n+		whi 
 ((cdu31a_addresses[i].baseT!= 0)n+		       &&R	!drive_f und)) {s+			iUR	check_eegi *(cdu31a_addresses[i].base, 4)) {n+				i++;o+				continue;o+			}n+			get_drive_c *figuratt *(cdu31a_addresses[i].base,
+						drive_c *fig.exec_y  pus,M+						&res_size);n+			iUR		rer_sizeT> 2)o+			    &&R	(drive_c *fig.exec_y  pus[0]T& 0xf0) ==M+				0x00)) {s+				drive_f undT= 1;
+				cdu31a_irq = cdu31a_addresses[i].int_num;n+			} )lse {n+				i++;o+			}
+		}
+	}
+o+	iUR	drive_f und) {n+		int deficiency = 0;n+s+		requurt_eegi *(cdu31a_port, 4, "cdu31a");n+M+		iUR	devfs_eegister_blkdev(MAJOR_NR, "cdu31a", &cd0xm_fops)) {n+			priN@k("Unab 
 toRget major %d G_SMCDU-31a\n",
+			       MAJOR_NR);o+			goto errout2;
+		}
+o+		iUR	SONY_HWC_DOUBLE_SPEED(drive_c *fig)) {s+			is_double_speedT= 1;
+		}
+o+		tmp_irq = cdu31a_irq;	/*CNeed IRQ 0 because we can't sleep here. */s+		cdu31a_irq = 0;n+s+		set_drive_params(sony_speed);
+o+		cdu31a_irq = tmp_irq;
+o+		iUR	cdu31a_irq > 0) {s+			iUR	requurt_irqo+			    (cdu31a_irq, cdu31a_interrupt, SA_INTERRUPT,
+			     "cdu31a", NULL)) {n+				priN@kn+				    ("Unab 
 toRgrab IRQ%d G_SMthecCDU31A driver\n",
+				     cdu31a_irq);
+				cdu31a_irq = 0;o+			}
+		}
+s+		spriN@f(msg, "Sony I/F CDROM : %8.8s %16.16s %8.8s\n",
+			drive_c *fig.vendor_id,
+			drive_c *fig.product_id,
+			drive_c *fig.product_rev_level);M+		spriN@f(buN, "  Capabilities: %s",
+			load_mech[SONY_HWC_GET_LOAD_MECH(drive_c *fig)]);n+		strcat(msg, buN);n+		iUR	SONY_HWC_AUDIO_PLAYBACK(drive_c *fig)) {n+			strcat(msg, ", audio");n+		} )lse
+			deficiency |= CDC_PLAY_AUDIO;n+		iUR	SONY_HWC_EJECT(drive_c *fig)) {n+			strcat(msg, ", eject");n+		} )lse
+			deficiency |= CDC_OPEN_TRAY;n+		iUR	SONY_HWC_LED_SUPPORT(drive_c *fig)) {n+			strcat(msg, ", LED");s+		}
+		iUR	SONY_HWC_ELECTRIC_VOLUME(drive_c *fig)) {n+			strcat(msg, ", elec.CVol");s+		}
+		iUR	SONY_HWC_ELECTRIC_VOLUME_CTL(drive_c *fig)) {n+			strcat(msg, ", sep.CVol");s+		}
+		iUR	is_double_speed) {n+			strcat(msg, ", double speed");n+		} )lse
+			deficiency |= CDC_SELECT_SPEED;
+		iUR	cdu31a_irq > 0) {s+			spriN@f(buN, ", irq %d", cdu31a_irq);
+			strcat(msg, buN);n+		}n+		strcat(msg, "\n");
+o+		is_a_cdu31a =n+		    strcmp("CD-ROM CDU31A", drive_c *fig.product_id) == 0;
+o+		blk_init_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR),
+			       DEVICE_REQUEST);n+		read_ahead[MAJOR_NR] = CDU31A_READAHEAD;o+		cdu31a_block_sizeT= 1024;	/*C1kB default block size */s+		/*Cuse 'm unt -o block=2048' */s+		blksize_size[MAJOR_NR] = &cdu31a_block_size;
+o+		init_timer(&cdu31a_abort_timer);o+		cdu31a_abort_timer.functt * = handle_abort_timeout;n+s+		scd_inG_.dev = MKDEV(MAJOR_NR, 0);n+		scd_inG_.mask = deficiency;n+		strncpy(scd_inG_.name, "cdu31a", sizeof(scd_inG_.name));
+s+		iUR	register_cd0xm(&scd_inG_)) {o+			goto errout0;
+		}
+	}
+o+
+	dvsk_changedT= 1;
+o+	iUR	drive_f und) {n+		retnsi (0);n+	} )lse {n+		goto errout3;
+	}
+      )rrout0:
+	priN@k("Unab 
 toReegister CDU-31a with UniG_Sm cd0xm driver\n");
+	blk_cleanup_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR));n+	iUR	devfs_uneegister_blkdev(MAJOR_NR, "cdu31a")) {n+		priN@k("Can't uneegister block device G_SMcdu31a\n");
+	}
+      )rrout2:M+	release_eegi *(cdu31a_port, 4);
+      )rrout3:o+	retnsi -EIO;
+}
+o+
+ES < __exit cdu31a_exit(ES <)
+{n+	iUR	uneegister_cd0xm(&scd_inG_)) {n+		priN@k
+		    ("Can't uneegister cdu31a G0xmCUniG_Sm cd0xm driver\n");
+		retnsi;s+	}M+	iUR	(devfs_uneegister_blkdev(MAJOR_NR, "cdu31a") == -EINVAL)) {n+		priN@k("Can't uneegister cdu31a\n");
+		retnsi;s+	}M+
+	blk_cleanup_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR));n+s+	iUR	cdu31a_irq > 0)n+		Gree_irq	cdu31a_irq, NULL);n+M+	release_eegi *(cdu31a_port, 4);
+	priN@k(KERN_INFO "cdu31a module released.\n");
+}M n #iUdef MODULE
 module_init(cdu31a_init);
 #endiNn module_exit(cdu31a_exit);
 
+MODULE_LICENSE("GPL");
+EXPORT_NO_SYMBOLS;
diNf -u --recursiveT--new-fi 
 v2.4.9/linux/drivers/cd0xm/cm206.c linux/drivers/cd0xm/cm206.c
--- v2.4.9/linux/drivers/cd0xm/cm206.c	Fri Feb  9 11:30:22 2001
+++ linux/drivers/cd0xm/cm206.c	Fri Sep  7 09:28:38 2001
@@ -178,7 +178,7 @@s  * Dav < van Leeuwen,Rdav <@tm.tn_.nl.  +/M #define REVISION "$Revision: 1.5 $"M M-#include <linux/module.h>	
+#include <linux/module.h>M n #include <linux/)rrn_.h>	/*CThese include wha@Twe really need +/M #include <linux/delay.h>M@@ -211,16 +211,19 @@s   Taddress and interrupt requurt. It can be overridden by thecboot 
    parameter `auto'.
 */M-y  pF Tint auto_probe=1;	/*CYes, why not? +/M+y  pF Tint auto_probeT= 1;	/*CYes, why not? +/M s y  pF Tint cm206_baseT= CM206_BASE;M-y  pF Tint cm206_irq = CM206_IRQ; M-y  pF Tint cm206[2]T= {0,0};	/*CG_SMcomp pFb 
 `insmod' parameter passing +/M+y  pF Tint cm206_irq = CM206_IRQ;
+#iUdef MODULE
+y  pF Tint cm206[2]T= { 0, 0 };	/*CG_SMcomp pFb 
 `insmod' parameter passing +/M+#endiNn 
 MODULE_PARM(cm206_base, "i");	/*CbaseT+/M MODULE_PARM(cm206_irq, "i");	/*Cirq +/M MODULE_PARM(cm206, "1-2i");	/*Cbase,irq _SMirq,baseT+/M MODULE_PARM(auto_probe, "i");	/*Cauto probeTbaseTand irq +/M+MODULE_LICENSE("GPL");
 M #define POLLOOP 100		/*Cmilliseconds +/M #define READ_AHEAD 1		/*Cdefines private buNf_r, waste! +/M@@ -233,7 +236,7 @@s #define LINUX_BLOCK_SIZE 512	/*CWHERE is this defined? +/M #define RAW_SECTOR_SIZE 2352	/*Cok,TisCalso defined in cd0xm.h +/M #define ISO_SECTOR_SIZE 2048M-#define BLOCKS_ISO (ISO_SECTOR_SIZE/LINUX_BLOCK_SIZE) /*C4 +/M+#define BLOCKS_ISO (ISO_SECTOR_SIZE/LINUX_BLOCK_SIZE)	/*C4 +/M #define CD_SYNC_HEAD 16		/*CCD_SYNC +CCD_HEAD +/M s #iUdef STATISTICS		/*Ckeep track of errors in c unters +/M@@ -254,88 +257,91 @@s typedef unsigned char uch;	/*C8-bits +/M typedef unsigned short ush;	/*C16-bits +/M M-y ruct toc_y ruct{		/*Cprivate copy of Tab 
 oU Contents */s-  uch track, fsm[3], q0;n+y ruct toc_y ruct {		/*Cprivate copy of Tab 
 oU Contents */s+	uch track, fsm[3], q0;n };n s y  pF Tint cm206_blocksizes[1]T= { 2048 };n s y ruct cm206_y ruct {s-  vol pF 
 ushTintr_ds;		/*Cdata s  pus eead on last interrupt */s-  vol pF 
 ushTintr_ls;		/*Cuart line s  pus eead on last interrupt*/s-  vol pF 
 uch ur[UR_SIZE];	/*Cuart receiveTbuNf_r fifo */s-  vol pF 
 uch ur_w, ur_r;	/*Cwrite/eead buNf_r index */s-  vol pF 
 uch dsb, cc;	 /*CdriveTs  pus byteCand conditt * (error) code */s-  int command;			/*Ccommand toRbeTwritten tocthecuart */s-  int openfi 
s;
-  ushTsector[READ_AHEAD*RAW_SECTOR_SIZE/2]; /*CbuNf_red cd-sector */s-  int sector_first, sector_last; /*Crange oU these sectors */s-  wait_quuue_head_tcuart;	/*Cwait quuuesCG_SMinterrupt */s-  wait_quuue_head_tcdata;
-  y ruct timer_list timer;	/*Ctime-out */s-  char timed_out;
-  yigned char max_sectors;	/*Cnumb_r oU sectors tha@ fit in adapter mem */s-  char wait_back;		/*Cwe're waiting G_SMacbackgr und-eead */s-  char backgr und;		/*CisCa eead going  * in thecbackgr und? */s-  int adapter_first;		/*CiURso, tha@'s thecs  rting sector */s-  int adapter_last;s-  char fifo_overflowed;
-  uch disc_y  pus[7];		/*Crerult oU get_disc_y  pusCcommand */s+	vol pF 
 ushTintr_ds;	/*Cdata s  pus eead on last interrupt */s+	vol pF 
 ushTintr_ls;	/*Cuart line s  pus eead on last interrupt */s+	vol pF 
 uch ur[UR_SIZE];	/*Cuart receiveTbuNf_r fifo */s+	vol pF 
 uch ur_w, ur_r;	/*Cwrite/eead buNf_r index */s+	vol pF 
 uch dsb, cc;	/*CdriveTs  pus byteCand conditt * (error) code */s+	int command;		/*Ccommand toRbeTwritten tocthecuart */s+	int openfi 
s;
+	ushTsector[READ_AHEAD *CRAW_SECTOR_SIZE / 2];	/*CbuNf_red cd-sector */s+	int sector_first, sector_last;	/*Crange oU these sectors */s+	wait_quuue_head_tcuart;	/*Cwait quuuesCG_SMinterrupt */s+	wait_quuue_head_tcdata;
+	struct timer_list timer;	/*Ctime-out */s+	char timed_out;
+	signed char max_sectors;	/*Cnumb_r oU sectors tha@ fit in adapter mem */s+	char wait_back;		/*Cwe're waiting G_SMacbackgr und-eead */s+	char backgr und;	/*CisCa eead going  * in thecbackgr und? */s+	int adapter_first;	/*CiURso, tha@'s thecs  rting sector */s+	int adapter_last;s+	char fifo_overflowed;
+	uch disc_y  pus[7];	/*Crerult oU get_disc_y  pusCcommand */s #iUdef STATISTICSs-  int s  ps[NR_STATS];
-  int last_s  p[NR_STATS];	/*C`time'Tat which s  p was s  p */s-  int s  p_c unter;
-#endiN  s-  y ruct toc_y ruct toc[101];	/*CThe wholectab 
 oU contents + lead-out */s-  uch q[10];			/*CLast eead q-channel inG_ */s-  uch audio_y  pus[5];		/*Clast eead positt *  * pause */s-  uch media_changed;		/*CrecordCiURmedia changedT*/s+	int s  ps[NR_STATS];
+	int last_s  p[NR_STATS];	/*C`time'Tat which s  p was s  p */s+	int s  p_c unter;
+#endiNn+	y ruct toc_y ruct toc[101];	/*CThe wholectab 
 oU contents + lead-out */s+	uch q[10];		/*CLast eead q-channel inG_ */s+	uch audio_y  pus[5];	/*Clast eead positt *  * pause */s+	uch media_changed;	/*CrecordCiURmedia changedT*/s };n s #define DISC_STATUS cd->disc_y  pus[0]s #define FIRST_TRACK cd->disc_y  pus[1]s #define LAST_TRACK cd->disc_y  pus[2]M-#define PAUSED cd->audio_y  pus[0] /*Cmisuse thisCmemory byte! +/M+#define PAUSED cd->audio_y  pus[0]	/*Cmisuse thisCmemory byte! +/M #define PLAY_TO cd->toc[0]	/*Ctoc[0]Crecords end-time in play */M M-y  pF Ty ruct cm206_y ruct *Ccd; /*Cthecmain memory y ructure +/M+y  pF Ty ruct cm206_y ruct *cd;	/*Cthecmain memory y ructure +/M s /*CFirst, we define some polling Gunctt *s.CThese are actually
    onlyRbeing used in thecinitializatt *. */s s ES < send_command_polled(int command)
 {M-  int loop=POLLOOP;
-  whi 
 (!(inw(r_line_y  pus) & ls_transmitter_buNf_r_empty) &&Rloop>0) {
-    mdelay(1);		/*Cone millisec delay */s-    --loop;
-  }
-  outw(command, r_uart_transmit);
+	int loopT= POLLOOP;
+	whi 
 (!(inw(r_line_y  pus) & ls_transmitter_buNf_r_empty)
+	       &&RloopT> 0) {s+		mdelay(1);	/*Cone millisec delay */s+		--loop;
+	}M+	outw(command, r_uart_transmit);
 }M n uch receive_echo_polled(ES <)
 {M-  int loop=POLLOOP;
-  whi 
 (!(inw(r_line_y  pus) & ls_receive_buNf_r_full) &&Rloop>0) {
-    mdelay(1);s-    --loop;
-  }
-  retnsi ((uch) inw(r_uart_receive));
+	int loopT= POLLOOP;
+	whi 
 (!(inw(r_line_y  pus) & ls_receive_buNf_r_full) &&RloopT> 0) {s+		mdelay(1);s+		--loop;
+	}M+	retnsi ((uch) inw(r_uart_receive));
 }M n uch send_receive_polled(int command)
 {M-  send_command_polled(command);
-  retnsi receive_echo_polled();s+	send_command_polled(command);
+	retnsi receive_echo_polled();s }M n-inline ES < clear_ur(ES <) {M-  iUR	cd->ur_rT!= cd->ur_w) {
-    debug(("Deleting bytes G0xmCfifo:"));M-    G_S(;cd->ur_rT!= cd->ur_w; cd->ur_r++, cd->ur_r %= UR_SIZE)n-      debug((" 0x%x", cd->ur[cd->ur_r]));M-    debug(("\n"));
-  }
+inline ES < clear_ur(ES <)
+{n+	iUR	cd->ur_rT!= cd->ur_w) {
+		debug(("Deleting bytes G0xmCfifo:"));M+		Gor (; cd->ur_rT!= cd->ur_w;n+		     cd->ur_r++, cd->ur_r %= UR_SIZE)n+			debug((" 0x%x", cd->ur[cd->ur_r]));M+		debug(("\n"));
+	}
 }n s /*CThe interrupt handler. When theccm260 generates an interrupt, very
@@ -351,252 +357,269 @@s   Tas there seems soReeas * G_SMthis tochappen.
 */M M-y  pF TES < cm206_interrupt(int sig,TES < *dev_id,Ty ruct pt_eegs * regs) n+y  pF TES < cm206_interrupt(int sig,TES < *dev_id,Ty ruct pt_eegs *regs)s /*Cyou rang? +/M {s-  vol pF 
 ushTfool;s-  cd->intr_ds = inw(r_data_y  pus); /*Cresetscdata_ready,cdata_error,M-				       crc_error, sync_error, toc_e ady M-				       interrupts */s-  cd->intr_ls = inw(r_line_y  pus); /*Cresetscoverrun bit */s-  debug(("Intr, 0x%x 0x%x, %d\n", cd->intr_ds, cd->intr_ls, cd->backgr und));
-  iUR	cd->intr_ls & ls_attentt *) s  ps(attentt *);
-  /*CreceiveTbuNf_r full? */s-  iUR	cd->intr_ls & ls_receive_buNf_r_full) {	M-    cd->ur[cd->ur_w] = inb(r_uart_receive); /*Cget ord_r right! */s-    cd->intr_ls = inw(r_line_y  pus); /*CresetscrbfMinterrupt */s-    debug(("receiving #%d: 0x%x\n", cd->ur_w, cd->ur[cd->ur_w]));M-    cd->ur_w++; cd->ur_w %= UR_SIZE;M-    iUR	cd->ur_w == cd->ur_r) debug(("cd->ur overflow!\n"));
-    iUR	waitquuue_active(&cd->uart) &&Rcd->backgr undT< 2) { n-      del_timer(&cd->timer);o-      wake_up_interruptFb 
(&cd->uart);o-    }
-  }
-  /*Cdata e ady in fifo? */s-  )lse iUR	cd->intr_ds & ds_data_ready) { n-    iUR	cd->backgr und) ++cd->adapter_last;s-    iUR	waitquuue_active(&cd->data) &&R	cd->wait_back || !cd->backgr und)) {s-      del_timer(&cd->timer);o-      wake_up_interruptFb 
(&cd->data);o-    }
-    s  ps(data_ready);
-  }
-  /*Ce ady tocissue aCwrite command? */s-  )lse iUR	cd->command &&Rcd->intr_ls & ls_transmitter_buNf_r_empty) {s-    outw(dc_normal | (inw(r_data_y  pus)T& 0x7f), r_data_control);o-    outw(cd->command, r_uart_transmit);
-    cd->command=0;s-    iUR	!cd->backgr und) wake_up_interruptFb 
(&cd->uart);o-  }
-  /*Cnow te at errors (at least, identtfy them G_SMdebugging) */s-  )lse iUR	cd->intr_ds & ds_fifo_overflow) {
-    debug(("Fifo overflowTat sectors 0x%x\n", cd->sector_first));M-    G_ol = inw(r_fifo_output_buNf_r);	/*Cde-assert thecinterrupt */s-    cd->fifo_overflowed=1;	/*Csignal one wordCless should be eead */s-    s  ps(fifo_overflow);o-  }
-  )lse iUR	cd->intr_ds & ds_data_error) {
-    debug(("Data error at sector 0x%x\n", cd->sector_first));M-    s  ps(data_error);o-  }
-  )lse iUR	cd->intr_ds & ds_crc_error) {
-    debug(("CRC error at sector 0x%x\n", cd->sector_first));M-    s  ps(crc_error);o-  }
-  )lse iUR	cd->intr_ds & ds_sync_error) {
-    debug(("Sync at sector 0x%x\n", cd->sector_first));M-    s  ps(sync_error);o-  }
-  )lse iUR	cd->intr_ds & ds_toc_e ady) {
-    /*Cdo something appropriate */s-  }
-  /*Ccouldn't see why this interrupt, maybe du
 toRinit */s-  )lse {			s-    outw(dc_normal | READ_AHEAD, r_data_control);o-    s  ps(lost_intr);o-  }
-  iUR	cd->backgr und &&R	cd->adapter_last-cd->adapter_first == cd->max_sectorsM-			 || cd->fifo_overflowed))n-    mark_bh(CM206_BH);	/*Cissue aCstopTeead command */s-  s  ps(interrupt);
+	vol pF 
 ushTfool;s+	cd->intr_ds = inw(r_data_y  pus);	/*Cresetscdata_ready,cdata_error,M+						   crc_error, sync_error, toc_e ady M+						   interrupts */s+	cd->intr_ls = inw(r_line_y  pus);	/*Cresetscoverrun bit */s+	debug(("Intr, 0x%x 0x%x, %d\n", cd->intr_ds, cd->intr_ls,
+	       cd->backgr und));
+	iUR	cd->intr_ls & ls_attentt *)n+		st ps(attentt *);
+	/*CreceiveTbuNf_r full? */s+	iUR	cd->intr_ls & ls_receive_buNf_r_full) {o+		cd->ur[cd->ur_w] = inb(r_uart_receive);	/*Cget ord_r right! */s+		cd->intr_ls = inw(r_line_y  pus);	/*CresetscrbfMinterrupt */s+		debug(("receiving #%d: 0x%x\n", cd->ur_w,n+		       cd->ur[cd->ur_w]));M+		cd->ur_w++;M+		cd->ur_w %= UR_SIZE;M+		iUR	cd->ur_w == cd->ur_r)n+			debug(("cd->ur overflow!\n"));
+		iUR	waitquuue_active(&cd->uart) &&Rcd->backgr undT< 2) {n+			del_timer(&cd->timer);o+			wake_up_interruptFb 
(&cd->uart);o+		}
+	}
+	/*Cdata e ady in fifo? */s+	)lse iUR	cd->intr_ds & ds_data_ready) {M+		iUR	cd->backgr und)o+			++cd->adapter_last;s+		iUR	waitquuue_active(&cd->data)s+		    &&R	cd->wait_back || !cd->backgr und)) {s+			del_timer(&cd->timer);o+			wake_up_interruptFb 
(&cd->data);o+		}n+		st ps(data_ready);
+	}
+	/*Ce ady tocissue aCwrite command? */s+	)lse iUR	cd->command &&Rcd->intr_ls & ls_transmitter_buNf_r_empty) {s+		outw(dc_normal | (inw(r_data_y  pus)T& 0x7f),n+		     r_data_control);o+		outw(cd->command, r_uart_transmit);
+		cd->command = 0;n+		iUR	!cd->backgr und)o+			wake_up_interruptFb 
(&cd->uart);o+	}
+	/*Cnow te at errors (at least, identtfy them G_SMdebugging) */s+	)lse iUR	cd->intr_ds & ds_fifo_overflow) {
+		debug(("Fifo overflowTat sectors 0x%x\n",n+		       cd->sector_first));M+		Gool = inw(r_fifo_output_buNf_r);	/*Cde-assert thecinterrupt */s+		cd->fifo_overflowedT= 1;	/*Csignal one wordCless should be eead */s+		st ps(fifo_overflow);o+	} )lse iUR	cd->intr_ds & ds_data_error) {
+		debug(("Data error at sector 0x%x\n", cd->sector_first));M+		st ps(data_error);o+	} )lse iUR	cd->intr_ds & ds_crc_error) {
+		debug(("CRC error at sector 0x%x\n", cd->sector_first));M+		st ps(crc_error);o+	} )lse iUR	cd->intr_ds & ds_sync_error) {
+		debug(("Sync at sector 0x%x\n", cd->sector_first));M+		st ps(sync_error);o+	} )lse iUR	cd->intr_ds & ds_toc_e ady) {
+		/*Cdo something appropriate */s+	}
+	/*Ccouldn't see why this interrupt, maybe du
 toRinit */s+	)lse {s+		outw(dc_normal | READ_AHEAD, r_data_control);o+		st ps(lost_intr);o+	}M+	iUR	cd->backgr und
+	    &&R	cd->adapter_last - cd->adapter_first == cd->max_sectorsM+		|| cd->fifo_overflowed))n+		mark_bh(CM206_BH);	/*Cissue aCstopTeead command */s+	s  ps(interrupt);
 }n s /*Cwe have put thecaddress oU theCwait quuue in wh_ */sTES < cm206_timeout(unsigned long wh_)
 {M-  cd->timed_outT= 1;
-  debug(("Timing  ut\n"));
-  wake_up_interruptFb 
((wait_quuue_head_tc*)wh_);s+	cd->timed_outT= 1;
+	debug(("Timing  ut\n"));
+	wake_up_interruptFb 
((wait_quuue_head_tc*) wh_);s }n s /*CThis functt * retnsis 1 iURa timeout occurred, 0 iURan interrupts   Thappened +/M-int sleep_or_timeout(wait_quuue_head_tc*wait, int timeout)
+int sleep_or_timeout(wait_quuue_head_tc* wait, int timeout)
 {M-  cd->timed_out=0;s-  cd->timer.data=(unsigned long) wait;s-  cd->timer.expires = jiNfies + timeout;n- Tadd_timer(&cd->timer);o-  debug(("going tocsleep\n"));
-  interruptFb 
_sleep_on(wait);o-  del_timer(&cd->timer);o-  iUR	cd->timed_out) {
-    cd->timed_outT= 0;s-    retnsi 1;
-  }
-  )lse retnsi 0;o+	cd->timed_outT= 0;s+	cd->timer.dataT= (unsigned long) wait;s+	cd->timer.expires = jiNfies + timeout;n+	add_timer(&cd->timer);o+	debug(("going tocsleep\n"));
+	interruptFb 
_sleep_on(wait);o+	del_timer(&cd->timer);o+	iUR	cd->timed_out) {
+		cd->timed_outT= 0;s+		retnsi 1;
+	} )lse
+		retnsi 0;o }n s-ES < cm206_delay(int nr_jiNfies) n+ES < cm206_delay(int nr_jiNfies)
 {M-  DECLARE_WAIT_QUEUE_HEAD(wait);o-  sleep_or_timeout(&wait, nr_jiNfies);
+	DECLARE_WAIT_QUEUE_HEAD(wait);o+	sleep_or_timeout(&wait, nr_jiNfies);
 }n s ES < send_command(int command)
 {M-  debug(("Sending 0x%x\n", command));o-  iUR	!(inw(r_line_y  pus) & ls_transmitter_buNf_r_empty)) {
-    cd->command = command;
-    cli();			/*Cdon't interrupt beG_Se sleep */s-    outw(dc_mask_sync_error | dc_no_stop_on_error | M-	 (inw(r_data_y  pus)T& 0x7f), r_data_control);o-    /*Cinterrupt routine sends command */s-    iUR	sleep_or_timeout(&cd->uart, UART_TIMEOUT)) {s-      debug(("Time out onCwrite-buNf_r\n"));
-      s  ps(write_timeout);
-      outw(command, r_uart_transmit);
-    }
-    debug(("Write commmand delayed\n"));
-  }
-  )lse outw(command, r_uart_transmit);
+	debug(("Sending 0x%x\n", command));o+	iUR	!(inw(r_line_y  pus) & ls_transmitter_buNf_r_empty)) {
+		cd->command = command;
+		cli();		/*Cdon't interrupt beG_Se sleep */s+		outw(dc_mask_sync_error | dc_no_stop_on_error |n+		     (inw(r_data_y  pus)T& 0x7f), r_data_control);o+		/*Cinterrupt routine sends command */s+		iUR	sleep_or_timeout(&cd->uart, UART_TIMEOUT)) {s+			debug(("Time out onCwrite-buNf_r\n"));
+			st ps(write_timeout);
+			outw(command, r_uart_transmit);
+		}n+		debug(("Write commmand delayed\n"));
+	} )lse
+		outw(command, r_uart_transmit);
 }M n uch receive_byte(int timeout)
 {M-  uch ret;s-  cli();M-  debug(("cli\n"));
-  ret = cd->ur[cd->ur_r];M-  iUR	cd->ur_rT!= cd->ur_w) {
-    sti();M-    debug(("retnsiing #%d: 0x%x\n", cd->ur_r, cd->ur[cd->ur_r]));M-    cd->ur_r++; cd->ur_r %= UR_SIZE;s-    retnsi ret;s-  } 
-  )lse iUR	sleep_or_timeout(&cd->uart, timeout)) { /*Cdoes sti() */s-    debug(("Time out onCreceive-buNf_r\n"));
+	uch ret;s+	cli();
+	debug(("cli\n"));
+	ret = cd->ur[cd->ur_r];M+	iUR	cd->ur_rT!= cd->ur_w) {
+		sti();M+		debug(("retnsiing #%d: 0x%x\n", cd->ur_r,n+		       cd->ur[cd->ur_r]));M+		cd->ur_r++;M+		cd->ur_r %= UR_SIZE;M+		retnsi ret;s+	} )lse iUR	sleep_or_timeout(&cd->uart, timeout)) {	/*Cdoes sti() */s+		debug(("Time out onCreceive-buNf_r\n"));
 #iUdef STATISTICSs-    iUR	timeout==UART_TIMEOUT) s  ps(receive_timeout) /*Cno `;'! */s-    )lse st ps(dsb_timeout);
+		iUR	timeout == UART_TIMEOUT)
+			st ps(receive_timeout)	/*Cno `;'! */s+			    )lse
+			st ps(dsb_timeout);
 #endiNn-    retnsi 0xda;
-  }
-  ret = cd->ur[cd->ur_r];  s-  debug(("slept; retnsiing #%d: 0x%x\n", cd->ur_r, cd->ur[cd->ur_r]));M-  cd->ur_r++; cd->ur_r %= UR_SIZE;s-  retnsi ret;s+		retnsi 0xda;
+	}M+	ret = cd->ur[cd->ur_r];M+	debug(("slept; retnsiing #%d: 0x%x\n", cd->ur_r,
+	       cd->ur[cd->ur_r]));M+	cd->ur_r++;M+	cd->ur_r %= UR_SIZE;M+	retnsi ret;s }M n inline uch receive_echo(ES <)
 {M-  retnsi receive_byte(UART_TIMEOUT);
+	retnsi receive_byte(UART_TIMEOUT);
 }M n inline uch send_receive(int command)
 {M-  send_command(command);
-  retnsi receive_echo();s+	send_command(command);
+	retnsi receive_echo();
 }M n inline uch wait_dsb(ES <)
 {M-  retnsi receive_byte(DSB_TIMEOUT);
+	retnsi receive_byte(DSB_TIMEOUT);
 }M n int type_0_command(int command, int expect_dsb)
 {M-  int e;s-  clear_ur();o-  iUR	command != (e=send_receive(command))) {
-    debug(("command 0x%x echoed as 0x%x\n", command, e));M-    s  ps(echo);s-    retnsi -1;o-  }
-  iUR	expect_dsb) {
-    cd->dsb = wait_dsb();	/*Cwait G_SMcommand toRfinish */s-  }
-  retnsi 0;o-}
-s-int type_1_command(int command, int bytes, uch * y  pus)T/*Ce tnsis inG_ */s-{M-  int i;o-  iUR	type_0_command(command,0)) retnsi -1;o-  G_S(i=0; i<bytes; i++) M-    s  pus[i] = send_receive(c_gimme);
-  retnsi 0;
-}  
+	int e;
+	clear_ur();o+	iUR	command != (e = send_receive(command))) {
+		debug(("command 0x%x echoed as 0x%x\n", command, e));M+		st ps(echo);s+		retnsi -1;o+	}M+	iUR	expect_dsb) {
+		cd->dsb = wait_dsb();	/*Cwait G_SMcommand toRfinish */s+	}M+	retnsi 0;
+}
+o+int type_1_command(int command, int bytes, uch * y  pus)
+{				/*Ce tnsis inG_ */s+	int i;n+	iUR	type_0_command(command, 0))n+		retnsi -1;o+	Gor (iT= 0; i < bytes; i++)M+		st pus[i] = send_receive(c_gimme);
+	retnsi 0;
+}
 s /*CThis functt * resetscthecadapter card. We'd better notRdoMthis toos  * often,Rbecause it tends toRgenerate `lost interrupts.' */sTES < reset_cm260(ES <)
 {M-  outw(dc_normal | dc_initializeT| READ_AHEAD, r_data_control);o-  udelay(10);			/*C3.3 mu sec minimum */s-  outw(dc_normal | READ_AHEAD, r_data_control);o+	outw(dc_normal | dc_initializeT| READ_AHEAD, r_data_control);o+	udelay(10);		/*C3.3 mu sec minimum */s+	outw(dc_normal | READ_AHEAD, r_data_control);o }n s /*Cfsm: frame-sec-mi* G0xmClinearcaddress; one of many */s-ES < fsm(int lba, uch * fsm) n+ES < fsm(int lba, uch * fsm)
 {M-  fsm[0]T= lba % 75;o-  lba /= 75; lba += 2;
-  fsm[1]T= lba % 60; fsm[2]T= lba / 60;o+	Gsm[0]T= lba % 75;o+	lba /= 75;o+	lba += 2;
+	Gsm[1]T= lba % 60;
+	Gsm[2]T= lba / 60;o }M n-inline int Gsm2lba(uch * fsm) n+inline int Gsm2lba(uch * fsm)
 {M-  retnsi Gsm[0]T+ 75*(Gsm[1]-2T+ 60*Gsm[2]);
+	retnsi Gsm[0]T+ 75 * (Gsm[1] - 2T+ 60 * fsm[2]);
 }M n inline int G_s_m2lba(uch f, uch s, uch m)
 {M-  retnsi GT+ 75*(s-2T+ 60*m);
+	retnsi GT+ 75 * (s - 2T+ 60 * m);s }M n-intcs  rt_e ad(intcs  rt) n+intcs  rt_e ad(intcs  rt)
 {M-  uch read_sector[4]T= {c_e ad_data, };n-  int i, e;
+	uch read_sector[4]T= { c_e ad_data, };n+	int i, e;
 
-  fsm(s  rt, &read_sector[1]);n-  clear_ur();o-  Gor (i=0; i<4; i++) M-    iUR	read_sector[i] != (e=send_receive(read_sector[i]))) {s-      debug(("read_sector: %x echoes %x\n", read_sector[i], e));M-      s  ps(echo);s-      iUR	e==0xff) {		/*Cthis seems tochappen often */s-	e = receive_echo();
-	debug(("Second try %x\n", e));M-	iUR	e!=read_sector[i]) retnsi -1;o-      }
-    }
-  retnsi 0;o+	Gsm(s  rt, &read_sector[1]);n+	clear_ur();o+	Gor (iT= 0; i < 4; i++)M+		iUR	read_sector[i] != (e = send_receive(read_sector[i]))) {s+			debug(("read_sector: %x echoes %x\n",
+			       read_sector[i], e));M+			st ps(echo);s+			iUR	e ==c0xff) {	/*Cthis seems tochappen often */s+				e = receive_echo();
+				debug(("Second try %x\n", e));M+				iUR	e != read_sector[i])M+					retnsi -1;o+			}
+		}
+	retnsi 0;o }n s int s op_e ad(ES <)
 {M-  int e;s-  type_0_command(c_stop,0);n-TCif(	e=receive_echo())T!= 0xff) {n-    debug(("c_stop didn't send 0xff, but 0x%x\n", e));M-    s  ps(s op_0xff);s-    retnsi -1;o-  }
-  retnsi 0;
-}  
+	int e;
+	type_0_command(c_stop, 0);n+	iUR	(e = receive_echo())T!= 0xff) {n+		debug(("c_stop didn't send 0xff, but 0x%x\n", e));M+		st ps(s op_0xff);s+		retnsi -1;o+	}M+	retnsi 0;
+}
 s /*CThis functt * s  rts toReead sectors in adapter memory, the
    interrupt routine should stop theceead. Ii Gact, thecbottom_half
@@ -605,12T+628,14 @@s 
 int read_backgr und(intcs  rt, int reading)
 {M-  iUR	cd->backgr und) retnsi -1; /*Ccan't doMtwice */s-  outw(dc_normal | BACK_AHEAD, r_data_control);o-  iUR	!reading &&Rs  rt_e ad(s  rt)) retnsi -2;M-  cd->adapter_first = cd->adapter_last =Rs  rt; M-  cd->backgr undT= 1;		/*CGlagCa eead is going  * */s-  retnsi 0;o+	iUR	cd->backgr und)o+		retnsi -1;	/*Ccan't doMtwice */s+	outw(dc_normal | BACK_AHEAD, r_data_control);o+	iUR	!reading &&Rs  rt_e ad(s  rt))o+		retnsi -2;M+	cd->adapter_first = cd->adapter_last =Rs  rt;M+	cd->backgr undT= 1;	/*CGlagCa eead is going  * */s+	retnsi 0;o }n s #iUdef USE_INSW
@@ -618,12T+643,12T@@s #)lse
 /*Cthis routine implements insw(,,).CThere wasRa time i had the
    impression that there would be any diNference in error-behaviour. */s-ES < transport_data(intcport, ushT*Cdest, int c unt) n+ES < transport_data(intcport, ushT*Cdest, int c unt)
 {M-  int i;
-  ushT*Cd;o-  Gor (i=0, d=dest; i<c unt; i++, d++) M-    *d = inw(port);
+	int i;n+	ushT*d;o+	Gor (iT= 0, d = dest; i < c unt; i++, d++)o+		*d = inw(port);
 }n #endiNn 
@@ -631,33T+656,38 @@s #define MAX_TRIES 100
 int read_sector(intcs  rt)
 {M-  int tries=0;s-  iUR	cd->backgr und) {
-    cd->backgr und=0;s-    cd->adapter_last =R-1;	/*Cinvalidate adapter memory */s-    s op_e ad();
-  }
-  cd->fifo_overflowed=0;
-  reset_cm260();		/*Cempty fifo etc. */s-  iUR	s  rt_e ad(s  rt)) retnsi -1;
-  do {
-    iUR	sleep_or_timeout(&cd->data, DATA_TIMEOUT)) {s-      debug(("Read timed out sector 0x%x\n", s  rt));M-      s  ps(read_timeout);
-      s op_e ad();
-      retnsi -3;		s-    } M-    tries++;o-  } whi 
 (cd->intr_ds & ds_fifo_empty &&Rtries < MAX_TRIES);o-  iUR	tries>1) debug(("Took me some tries\n"))
-  )lse iUR	tries ==cMAX_TRIES) n-    debug(("MAX_TRIES tries Gor eead sector\n"));
-  transport_data(r_fifo_output_buNf_r, cd->sector, M-		 READ_AHEAD*RAW_SECTOR_SIZE/2);o-  iUR	read_backgr und(s  rt+READ_AHEAD,1)) s  ps(read_backgr und);M-  cd->sector_first =Rs  rt; cd->sector_last =Rs  rt+READ_AHEAD;s-  s  ps(read_res  rted);
-  retnsi 0;
+	int tries = 0;o+	iUR	cd->backgr und) {
+		cd->backgr undT= 0;M+		cd->adapter_last =R-1;	/*Cinvalidate adapter memory */s+		stop_e ad();
+	}M+	cd->fifo_overflowedT= 0;
+	reset_cm260();		/*Cempty fifo etc. */s+	iUR	s  rt_e ad(s  rt))o+		retnsi -1;
+	do {M+		iUR	sleep_or_timeout(&cd->data, DATA_TIMEOUT)) {s+			debug(("Read timed out sector 0x%x\n", s  rt));M+			st ps(read_timeout);
+			stop_e ad();
+			retnsi -3;
+		}n+		tries++;o+	} whi 
 (cd->intr_ds & ds_fifo_empty &&Rtries < MAX_TRIES);o+	iUR	tries > 1)s+		debug(("Took me some tries\n"))
+		    )lse
+	iUR	tries ==cMAX_TRIES)s+		debug(("MAX_TRIES tries Gor eead sector\n"));
+	transport_data(r_fifo_output_buNf_r, cd->sector,n+		       READ_AHEAD *CRAW_SECTOR_SIZE / 2);o+	iUR	read_backgr und(s  rt + READ_AHEAD, 1))n+		st ps(read_backgr und);M+	cd->sector_first =Rs  rt;M+	cd->sector_last =Rs  rt + READ_AHEAD;s+	s  ps(read_res  rted);
+	retnsi 0;o }n s /*CThe functt * ofcbottom-half is tocsend aCstopTcommand toRthecdrive
@@ -672,43T+702,46 @@s 
 ES < cm206_bh(ES <)
 {M-  debug(("bh: %d\n", cd->backgr und));
-  switchR	cd->backgr und) {
-  case 1:M-    s  ps(bh);
-    iUR	!(cd->intr_ls & ls_transmitter_buNf_r_empty)) {s-      cd->command = c_stop;
-      outw(dc_mask_sync_error | dc_no_stop_on_error | M-	   (inw(r_data_y  pus)T& 0x7f), r_data_control);o-      cd->backgr und=2;
-      break;			/*Cwe'd better notRtime-out here! */s-    }s-    )lse outw(c_stop, r_uart_transmit);
-    /*CGall intoRcase 2: */s-  case 2:			s-    /*Cthecwrite hasRbee* satisfied by interrupt routine */s-    cd->backgr und=3;
-    break;s-  case 3:o-    iUR	cd->ur_rT!= cd->ur_w) {
-      iUR	cd->ur[cd->ur_r]T!= c_stop) {
-	debug(("cm206_bh: c_stop echoed 0x%x\n", cd->ur[cd->ur_r]));M-	s  ps(echo);s-      }o-      cd->ur_r++; cd->ur_r %= UR_SIZE;s-    }s-    cd->backgr und++;o-    break;s-  case 4:o-    iUR	cd->ur_rT!= cd->ur_w) {
-      iUR	cd->ur[cd->ur_r]T!= 0xff) {n-	debug(("cm206_bh: c_stop reacted with 0x%x\n", cd->ur[cd->ur_r]));M-	s  ps(s op_0xff);s-      }o-      cd->ur_r++; cd->ur_r %= UR_SIZE;s-    }s-    cd->backgr und=0;
-  }M+	debug(("bh: %d\n", cd->backgr und));
+	switchR	cd->backgr und) {
+	case 1:M+		st ps(bh);
+		iUR	!(cd->intr_ls & ls_transmitter_buNf_r_empty)) {s+			cd->command = c_stop;
+			outw(dc_mask_sync_error | dc_no_stop_on_error |n+			     (inw(r_data_y  pus)T& 0x7f), r_data_control);o+			cd->backgr undT= 2;
+			break;	/*Cwe'd better notRtime-out here! */s+		} )lse
+			outw(c_stop, r_uart_transmit);
+		/*CGall intoRcase 2: */s+	case 2:M+		/*Cthecwrite hasRbee* satisfied by interrupt routine */s+		cd->backgr undT= 3;
+		break;s+	case 3:o+		iUR	cd->ur_rT!= cd->ur_w) {
+			iUR	cd->ur[cd->ur_r]T!= c_stop) {
+				debug(("cm206_bh: c_stop echoed 0x%x\n",
+				       cd->ur[cd->ur_r]));M+				st ps(echo);s+			}o+			cd->ur_r++;M+			cd->ur_r %= UR_SIZE;M+		}s+		cd->backgr und++;M+		break;s+	case 4:o+		iUR	cd->ur_rT!= cd->ur_w) {
+			iUR	cd->ur[cd->ur_r]T!= 0xff) {n+				debug(("cm206_bh: c_stop reacted with 0x%x\n", cd->ur[cd->ur_r]));M+				st ps(s op_0xff);s+			}o+			cd->ur_r++;M+			cd->ur_r %= UR_SIZE;M+		}s+		cd->backgr undT= 0;
+	}s }n s /*CThis command clearscthecdsb_possFb 
_media_changeCGlag, soRwe must 
@@ -716,66T+749,67 @@s  */sTES < get_drive_y  pus(ES <)
 {M-  uch s  pus[2];s-  type_1_command(c_drive_y  pus, 2, y  pus); /*CthisCmight be done faster */s-  cd->dsb=y  pus[0];M-  cd->cc=y  pus[1];M-  cd->media_changed |= s-    !!(cd->dsb & (dsb_possFb 
_media_changeC| M-		 cdsb_drive_not_e ady |cdsb_tray_not_closed));
+	uch s  pus[2];s+	type_1_command(c_drive_y  pus, 2, y  pus);	/*CthisCmight be done faster */s+	cd->dsb = y  pus[0];M+	cd->cc = y  pus[1];M+	cd->media_changed |=
+	    !!(cd->dsb & (dsb_possFb 
_media_changeC|n+			  dsb_drive_not_e ady |cdsb_tray_not_closed));
 }n s ES < get_disc_y  pus(ES <)
 {M-  iUR	type_1_command(c_disc_y  pus, 7, cd->disc_y  pus)) {
-    debug(("get_disc_y  pus: error\n"));
-  }
+	iUR	type_1_command(c_disc_y  pus, 7, cd->disc_y  pus)) {
+		debug(("get_disc_y  pus: error\n"));
+	}
 }n s /*CThe new open.CThe real opening strategy is defined in cd0xm.c. */M M-y  pF Tint cm206_open(y ruct cd0xm_device_inG_ * cdi, int purpose) n+y  pF Tint cm206_open(y ruct cd0xm_device_inG_ *cdi, int purpose)
 {M-  MOD_INC_USE_COUNT;o-  iUR	!cd->openfi 
s) {		/*Creset onlyRfirst time */s-    cd->backgr und=0;s-    reset_cm260();s-    cd->adapter_last =R-1;	/*Cinvalidate adapter memory */s-    cd->sector_last =R-1;o-  }
-  ++cd->openfi 
s;
-  st ps(open);
-  retnsi 0;
-}
-s-y  pF TES < cm206_release(y ruct cd0xm_device_inG_ * cdi)
-{
-  iUR	cd->openfi 
s==1) {
-    iUR	cd->backgr und) {
-      cd->backgr und=0;s-      s op_e ad();
-    }s-    cd->sector_last =R-1;	/*CMake ouSMinternal buNf_r invalid */s-    FIRST_TRACK = 0;		/*CNo valid discTs  pus */s-  }
-  --cd->openfi 
s;
-  MOD_DEC_USE_COUNT;o+	MOD_INC_USE_COUNT;o+	iUR	!cd->openfi 
s) {	/*Creset onlyRfirst time */s+		cd->backgr undT= 0;M+		reset_cm260();s+		cd->adapter_last =R-1;	/*Cinvalidate adapter memory */s+		cd->sector_last =R-1;o+	}M+	++cd->openfi 
s;
+	s  ps(open);
+	retnsi 0;
+}
+o+y  pF TES < cm206_release(y ruct cd0xm_device_inG_ *cdi)
+{n+	iUR	cd->openfi 
s ==c1) {M+		iUR	cd->backgr und) {s+			cd->backgr undT= 0;M+			stop_e ad();
+		}s+		cd->sector_last =R-1;	/*CMake ouSMinternal buNf_r invalid */s+		FIRST_TRACK = 0;	/*CNo valid discTs  pus */s+	}M+	--cd->openfi 
s;
+	MOD_DEC_USE_COUNT;o }n s /*CEmpty buNf_r empties $sectors$ sectors oU theCadapter card buNf_r,s  * and then e adsRa sector in kernel memory.  +/M-ES < empty_buNf_r(int sectors) n+ES < empty_buNf_r(int sectors)
 {M-  whi 
 (sectors>=0) {
-    transport_data(r_fifo_output_buNf_r, cd->sector + cd->fifo_overflowed, M-	 RAW_SECTOR_SIZE/2 - cd->fifo_overflowed);s-    --sectors;s-    ++cd->adapter_first;	/*Cupdate theccurrent adapter sector */s-    cd->fifo_overflowed=0;	/*Creset overflowTbit */s-    s  ps(sector_transf_rred);s-  } M-  cd->sector_first=cd->adapter_first-1;o-  cd->sector_last=cd->adapter_first; /*Cupdate thecbuNf_r sector */s+	whi 
 (sectors >= 0) {s+		transport_data(r_fifo_output_buNf_r,
+			       cd->sector + cd->fifo_overflowed,
+			       RAW_SECTOR_SIZE / 2 - cd->fifo_overflowed);s+		--sectors;s+		++cd->adapter_first;	/*Cupdate theccurrent adapter sector */s+		cd->fifo_overflowedT= 0;	/*Creset overflowTbit */s+		st ps(sector_transf_rred);s+	}M+	cd->sector_first =Rcd->adapter_first - 1;
+	cd->sector_last =Rcd->adapter_first;	/*Cupdate thecbuNf_r sector */s }n s /*Ctry_adapter.CThis functt * determines if theceequurted sector is
@@ -783,29 +817,27 @@s   Tsuccess */s int try_adapter(int sector)
 {M-  iUR	cd->adapter_first <= sector &&Rsector < cd->adapter_last) { n-    /*Csector is in adapter memory */s-    )mpty_buNf_r(sector - cd->adapter_first);s-    retnsi 0;o-  }
-  )lse iUR	cd->backgr und==1 &&Rcd->adapter_first <= sectorM-	   &&Rsector < cd->adapter_first+cd->max_sectors) {
-    /*Ca eead is going  *, we canCwait G_SMit */s-    cd->wait_back=1;o-    whi 
 (sector >= cd->adapter_last) {
-      iUR	sleep_or_timeout(&cd->data, DATA_TIMEOUT)) {s-	debug(("Timed out during backgr undTwait: %d %d %d %d\n", sector, M-	       cd->adapter_last, cd->adapter_first, cd->backgr und));
-	st ps(back_read_timeout);
-	cd->wait_back=0;o-	retnsi -1;o-      }
-    }
-    cd->wait_back=0;s-    )mpty_buNf_r(sector - cd->adapter_first);s-    retnsi 0;o-  }
-  )lse retnsi -2;M+	iUR	cd->adapter_first <= sector &&Rsector < cd->adapter_last) {M+		/*Csector is in adapter memory */s+		)mpty_buNf_r(sector - cd->adapter_first);s+		retnsi 0;o+	} )lse iUR	cd->backgr undT==c1 &&Rcd->adapter_first <= sectorM+		   &&Rsector < cd->adapter_first + cd->max_sectors) {
+		/*Ca eead is going  *, we canCwait G_SMit */s+		cd->wait_back = 1;
+		whi 
 (sector >= cd->adapter_last) {
+			iUR	sleep_or_timeout(&cd->data, DATA_TIMEOUT)) {s+				debug(("Timed out during backgr undTwait: %d %d %d %d\n", sector, cd->adapter_last, cd->adapter_first, cd->backgr und));
+				st ps(back_read_timeout);
+				cd->wait_back = 0;M+				retnsi -1;o+			}
+		}
+		cd->wait_back = 0;M+		)mpty_buNf_r(sector - cd->adapter_first);s+		retnsi 0;o+	} )lseo+		retnsi -2;M }n s /*CThis is notRa very sm rt implementatt *. WeCcould optimizeTG_SM
@@ -813,45 +845,50 @@s   Tbring down thecprocess_SMload. */s y  pF TES < do_cm206_requurt(requurt_quuue_tc* q)
 {M-  long int i, cd_sec_no;n-  int quart_r, error; M-  uch * youSce,T*Cdest;n-  M-  whi 
(1) {	T/*Ce p at until all requurts have bee* satisfied */s-    INIT_REQUEST;
-    iUR	QUEUE_EMPTY || CURRENT->rq_y  pusC==cRQ_INACTIVE)n-      retnsi;s-    iUR	CURRENT->cmd != READ) {s-      debug(("Non-eead command %d on cd0xm\n", CURRENT->cmd));M-      end_requurt(0);o-      continue;o-    }
-    spin_unlock_irq	&io_requurt_lock);o-    error=0;s-    Gor (i=0; i<CURRENT->nr_sectors; i++) {
-      int e1, e2;o-      cd_sec_noT= (CURRENT->sector+i)/BLOCKS_ISO; /*C4 times 512 bytes */s-      quart_rT= (CURRENT->sector+i) % BLOCKS_ISO; s-      dest =RCURRENT->buNf_r + i*LINUX_BLOCK_SIZE;o-      /*CisCale ady in buNf_r memory? */s-      iUR	cd->sector_first <= cd_sec_noT&&Rcd_sec_noT< cd->sector_last) {s-	youSceT= ((uch *) cd->sector) + 16 + quart_r*LINUX_BLOCK_SIZE M-	  +R	cd_sec_no-cd->sector_first)*RAW_SECTOR_SIZE;o- 	memcpy(dest, youSce,TLINUX_BLOCK_SIZE); s-      }o-      )lse iUR	!(e1=try_adapter(cd_sec_no)) || M-	       !(e2=read_sector(cd_sec_no))) {s-	youSceT=  ((uch *) cd->sector)+16+quart_r*LINUX_BLOCK_SIZE;o-	memcpy(dest, youSce,TLINUX_BLOCK_SIZE); s-      }o-      )lse {s-	error=1;n-	debug(("cm206_requurt: %d %d\n", e1, e2));o-      }
-    }
-    spin_lock_irq	&io_requurt_lock);o-    end_requurt(!error);o-  }
+	long int i, cd_sec_no;n+	int quart_r, error;
+	uch *youSce,T*dest;n+s+	whi 
 (1) {		/*Crep at until all requurts have bee* satisfied */s+		INIT_REQUEST;
+		iUR	QUEUE_EMPTY || CURRENT->rq_y  pusC==cRQ_INACTIVE)n+			retnsi;
+		iUR	CURRENT->cmd != READ) {s+			debug(("Non-eead command %d on cd0xm\n",
+			       CURRENT->cmd));M+			end_requurt(0);o+			continue;o+		}n+		spin_unlock_irq	&io_requurt_lock);o+		)rror = 0;M+		Gor (iT= 0; i < CURRENT->nr_sectors; i++) {
+			int e1, e2;o+			cd_sec_noT= (CURRENT->sector + i) / BLOCKS_ISO;	/*C4 times 512 bytes */s+			quart_rT= (CURRENT->sector + i) % BLOCKS_ISO;s+			dest =RCURRENT->buNf_r + iT*CLINUX_BLOCK_SIZE;o+			/*CisCale ady in buNf_r memory? */s+			iUR	cd->sector_first <= cd_sec_no
+			    &&Rcd_sec_noT< cd->sector_last) {s+				souSceT=
+				    ((uch *) cd->sector) + 16 +
+				    quart_rT*CLINUX_BLOCK_SIZE +
+				    (cd_sec_no -
+				     cd->sector_first) *CRAW_SECTOR_SIZE;M+				memcpy(dest, youSce,TLINUX_BLOCK_SIZE);o+			} )lse iUR	!(e1 =Rtry_adapter(cd_sec_no)) ||
+				   !(e2 = read_sector(cd_sec_no))) {s+				souSceT=
+				    ((uch *) cd->sector) + 16 +
+				    quart_rT*CLINUX_BLOCK_SIZE;M+				memcpy(dest, youSce,TLINUX_BLOCK_SIZE);o+			} )lse {s+				)rror = 1;n+				debug(("cm206_requurt: %d %d\n", e1, e2));o+			}
+		}
+		spin_lock_irq	&io_requurt_lock);o+		end_requurt(!error);o+	}M }n s /*CAudio support. I've tried very hard, but theccm206CdriveTdoesn't 
@@ -870,24 +907,27 @@s /*CseekCseeks tocaddress lba. ItCdoes wait tocarriveTthere. */sTES < seek(int lba)
 {M-  int i;
-  uch seek_command[4]={c_seek, };n-  
-  fsm(lba, &seek_command[1]);n-  Gor (i=0; i<4; i++) type_0_command(seek_command[i], 0);M-  cd->dsb = wait_dsb();
+	int i;n+	uch seek_command[4]T= { c_seek, };n+o+	Gsm(lba, &seek_command[1]);n+	Gor (iT= 0; i < 4; i++)M+		type_0_command(seek_command[i], 0);M+	cd->dsb = wait_dsb();s }M n-uch bcdbin(unsigned char bcd)	/*Cstole* G0xmCmcd.c! */s-{M-  retnsi (bcd >> 4)*10 +R	bcd & 0xf);s-} 
+uch bcdbin(unsigned char bcd)
+{				/*Cstole* G0xmCmcd.c! */s+	retnsi (bcd >> 4)T*C10 +R	bcd & 0xf);s+}M n-inline uch normalize_track(uch track) n+inline uch normalize_track(uch track)
 {M-  iUR	track<1) retnsi 1;
-  iUR	track>LAST_TRACK) retnsi LAST_TRACK+1;
-  retnsi track;o+	iUR	track < 1)s+		retnsi 1;
+	iUR	track > LAST_TRACK)s+		retnsi LAST_TRACK + 1;
+	retnsi track;o }n s /*CThis functt * does a binary search f_SMtrack s  rt. ItCrecords all
@@ -896,150 +936,175 @@s  */sTint get_toc_lba(uch track)
 {M-  int max=74*60*75-150, min=Gsm2lba(cd->toc[1].fsm);n-  int i, lba, l, old_lba=0;s-  uch * q =Rcd->q;s-  uch ct;			/*Ccurrent track */s-  int binary=0;s-  const int skipT= 3*60*75;		/*C3 minutes */s-n-  Gor (i=track; i>0; i--) iUR	cd->toc[i].track) {
-    min = Gsm2lba(cd->toc[i].fsm);n-    break;s-  }o-  lba = min + skip;
-  do {
-    seek(lba); s-    type_1_command(c_read_current_q,C10, q);s-    ct =Rnormalize_track(q[1]);n-    iUR	!cd->toc[ct].track) {
-      l =Rq[9]-bcdbin(q[5])T+ 75*(q[8]-bcdbin(q[4])-2T+ M-				  60*(q[7]-bcdbin(q[3])));o-      cd->toc[ct].track=q[1];	/*Clead out still 0xaa */s-      Gsm(l, cd->toc[ct].fsm);n-      cd->toc[ct].q0 =Rq[0];	/*Ccontains adrCand ctrl inG_ */s-      iUR	ct==track) retnsi l;o-    }
-    old_lba=lba;n-    iUR	binary) {
-      iUR	ct < track) min = lba; )lse max = lba;
-      lba = (min+max)/2; s-    } )lse {s-      iU	ct < track) lba += skip;
-      )lse {s-	binary=1;n-	max = lba; min = lba - skip;
-	lba = (min+max)/2;o-      }
-    }
-  } whi 
 (lba!=old_lba);
-  retnsi lba;
+	int max = 74 * 60 * 75 - 150, min = Gsm2lba(cd->toc[1].fsm);n+	int i, lba, l, old_lba = 0;M+	uch *q =Rcd->q;s+	uch ct;			/*Ccurrent track */s+	int binary = 0;s+	const int skipT= 3 * 60 * 75;	/*C3 minutes */s+n+	Gor (iT= track; iT> 0; i--)M+		iUR	cd->toc[i].track) {
+			min = Gsm2lba(cd->toc[i].fsm);n+			break;
+		}
+	lba = min + skip;
+	do {M+		seek(lba);M+		type_1_command(c_read_current_q,C10, q);s+		ct =Rnormalize_track(q[1]);n+		iUR	!cd->toc[ct].track) {
+			l =Rq[9] - bcdbin(q[5])T+ 75 * (q[8] -
+							bcdbin(q[4]) - 2T+
+							60 * (q[7] -
+							      bcdbin(q
+								     [3])));o+			cd->toc[ct].track =Rq[1];	/*Clead out still 0xaa */s+			Gsm(l, cd->toc[ct].fsm);n+			cd->toc[ct].q0 =Rq[0];	/*Ccontains adrCand ctrl inG_ */s+			iUR	ct == track)
+				retnsi l;o+		}n+		old_lba = lba;
+		iUR	binary) {
+			iUR	ct < track)
+				min = lba;M+			else
+				max = lba;
+			lba = (minT+ max) / 2;s+		} )lse {
+			iUR	ct < track)
+				lba += skip;
+			else {s+				binary = 1;n+				max = lba;
+				min = lba - skip;
+				lba = (minT+ max) / 2;s+			}
+		}
+	} whi 
 (lba != old_lba);
+	retnsi lba;
+}
+o+ES < update_toc_entry(uch track)
+{n+	track =Rnormalize_track(track);o+	iUR	!cd->toc[track].track)
+		get_toc_lba(track);o }n s-ES < update_toc_entry(uch track) n+/*Ce tnsi 0 up * success */s+int read_toc_head_r(s ruct cd0xm_tochdrC*hp)
 {M-  track =Rnormalize_track(track);o-  iUR	!cd->toc[track].track) get_toc_lba(track);o+	iUR	!FIRST_TRACK)
+		get_disc_y  pus();o+	iUR	hp) {
+		int i;n+		hp->cdth_trk0 =RFIRST_TRACK;n+		hp->cdth_trk1 =RLAST_TRACK;
+		/*CGill inRfirst track positt * */s+		Gor (iT= 0; i < 3; i++)M+			cd->toc[1].fsm[i] = cd->disc_y  pus[3 + i];M+		update_toc_entry(LAST_TRACK + 1);	/*Cfind most entries */s+		retnsi 0;o+	}
+	retnsi -1;o }n s-/*Ce tnsi 0 up * success */s-int read_toc_head_r(s ruct cd0xm_tochdrC* hp)
+ES < play_f0xm_to_msf(s ruct cd0xm_msf *msfp)
 {M-  iUR	!FIRST_TRACK) get_disc_y  pus();o-  iUR	hp) { M-    int i;
-    hp->cdth_trk0 =RFIRST_TRACK;n-    hp->cdth_trk1 =RLAST_TRACK; M-				/*CGill inRfirst track positt * */s-    Gor (i=0; i<3; i++) cd->toc[1].fsm[i] = cd->disc_y  pus[3+i];n-    update_toc_entry(LAST_TRACK+1);		/*Cfind most entries */s-    retnsi 0;o-  }
-  retnsi -1;o-}  
-s-ES < play_f0xm_to_msf(s ruct cd0xm_msf* msfp)
-{M-  uch play_command[]T= {c_play, M-	   msfp->cdmsf_frame0, msfp->cdmsf_sec0, msfp->cdmsf_min0,M-	   msfp->cdmsf_frame1, msfp->cdmsf_sec1, msfp->cdmsf_min1, 2, 2};n-  int i;n-  Gor (i=0; i<9; i++) type_0_command(play_command[i], 0);M-  Gor (i=0; i<3; i++) s-    PLAY_TO.fsm[i] = play_command[i+4];n-  PLAY_TO.track =R0;		/*CsayCno track end */s-  cd->dsb = wait_dsb();s-}  
+	uch play_command[]T= { c_play,n+		msfp->cdmsf_frame0, msfp->cdmsf_sec0, msfp->cdmsf_min0,M+		msfp->cdmsf_frame1, msfp->cdmsf_sec1, msfp->cdmsf_min1, 2,n+		    2o+	};
+	int i;n+	Gor (iT= 0; i < 9; i++)M+		type_0_command(play_command[i], 0);M+	Gor (iT= 0; i < 3; i++)M+		PLAY_TO.fsm[i] = play_command[i + 4];M+	PLAY_TO.track =R0;	/*CsayCno track end */s+	cd->dsb = wait_dsb();s+}n s ES < play_f0xm_to_track(int G0xm, int to)
 {M-  uch play_command[8]T= {c_play, };n-  int i;n+	uch play_command[8]T= { c_play, };
+	int i;n o-  iUR	G0xm==0) {		/*Ccontinue pause< play */s-    Gor (i=0; i<3; i++) { n-      play_command[i+1] = cd->audio_y  pus[i+2];n-      play_command[i+4]T= PLAY_TO.fsm[i];o-    }
-  } )lse {s-    update_toc_entry(G0xm); update_toc_entry(to+1);s-    Gor (i=0; i<3; i++) {n-      play_command[i+1] = cd->toc[G0xm].fsm[i];o-      PLAY_TO.fsm[i] = play_command[i+4] = cd->toc[to+1].fsm[i];o-    }
-    PLAY_TO.track =Rto; s-  }M-  Gor (i=0; i<7; i++) type_0_command(play_command[i],0);M-  Gor (i=0; i<2; i++) type_0_command(0x2, 0); /*Cvolume */s-  cd->dsb = wait_dsb();s-}
-s-int get_current_q(s ruct cd0xm_subchnl * qp)
-{M-  int i;
-  uch * q =Rcd->q;s-  iUR	type_1_command(c_read_current_q,C10, q)) retnsi 0;o+	iUR	G0xmC== 0) {	/*Ccontinue pause< play */s+		Gor (iT= 0; i < 3; i++) {s+			play_command[i + 1] = cd->audio_y  pus[i + 2];s+			play_command[i + 4]T= PLAY_TO.fsm[i];o+		}
+	} else {s+		update_toc_entry(G0xm);s+		update_toc_entry(to + 1);s+		Gor (iT= 0; i < 3; i++) {s+			play_command[i + 1] = cd->toc[G0xm].fsm[i];o+			PLAY_TO.fsm[i] = play_command[i + 4]T=
+			    cd->toc[to + 1].fsm[i];o+		}
+		PLAY_TO.track =Rto;o+	}
+	Gor (iT= 0; i < 7; i++)M+		type_0_command(play_command[i], 0);M+	Gor (iT= 0; i < 2; i++)M+		type_0_command(0x2, 0);	/*Cvolume */s+	cd->dsb = wait_dsb();s+}n+o+int get_current_q(s ruct cd0xm_subchnl *qp)
+{n+	int i;n+	uch *q =Rcd->q;s+	iUR	type_1_command(c_read_current_q,C10, q))
+		retnsi 0;o /*CRq[0] =Rbcdbin(q[0]); Don't think so! */s-  Gor (i=2; i<6; i++) q[i]=bcdbin(q[i]); s-  qp->cdsc_adrC=Rq[0] & 0xf; qp->cdsc_ctrl =Rq[0] >> 4;	/*Cf0xmCmcd.c */s-  qp->cdsc_trk =Rq[1];  qp->cdsc_indT= q[2];s-  iUR	qp->cdsc_format == CDROM_MSF) {n-    qp->cdsc_reladdr.msf.minuteT= q[3];o-    qp->cdsc_reladdr.msf.second = q[4];o-    qp->cdsc_reladdr.msf.frame = q[5];o-    qp->cdsc_absaddr.msf.minuteT= q[7];o-    qp->cdsc_absaddr.msf.second = q[8];o-    qp->cdsc_absaddr.msf.frame = q[9];
-  } )lse {s-    qp->cdsc_reladdr.lba = G_s_m2lba(q[5], q[4], q[3]);o-    qp->cdsc_absaddr.lba = G_s_m2lba(q[9], q[8], q[7]);
-  }
-  get_drive_y  pus();o-  iUR	cd->dsb & dsb_play_in_progress) s-    qp->cdsc_audioy  pusC= CDROM_AUDIO_PLAY ;
-  )lse iUR	PAUSED) s-    qp->cdsc_audioy  pusC= CDROM_AUDIO_PAUSED;
-  )lse qp->cdsc_audioy  pusC= CDROM_AUDIO_NO_STATUS;
-  retnsi 0;
+	Gor (iT= 2; i < 6; i++)M+		q[i] = bcdbin(q[i]);M+	qp->cdsc_adrC=Rq[0] & 0xf;M+	qp->cdsc_ctrl =Rq[0] >> 4;	/*Cf0xmCmcd.c */s+	qp->cdsc_trk =Rq[1];s+	qp->cdsc_indT= q[2];s+	iUR	qp->cdsc_format == CDROM_MSF) {n+		qp->cdsc_reladdr.msf.minuteT= q[3];o+		qp->cdsc_reladdr.msf.second = q[4];o+		qp->cdsc_reladdr.msf.frame = q[5];o+		qp->cdsc_absaddr.msf.minuteT= q[7];o+		qp->cdsc_absaddr.msf.second = q[8];o+		qp->cdsc_absaddr.msf.frame = q[9];
+	} else {s+		qp->cdsc_reladdr.lba = G_s_m2lba(q[5], q[4], q[3]);o+		qp->cdsc_absaddr.lba = G_s_m2lba(q[9], q[8], q[7]);
+	}
+	get_drive_y  pus();o+	iUR	cd->dsb & dsb_play_in_progress)o+		qp->cdsc_audioy  pusC= CDROM_AUDIO_PLAY;s+	)lse iUR	PAUSED)o+		qp->cdsc_audioy  pusC= CDROM_AUDIO_PAUSED;
+	else
+		qp->cdsc_audioy  pusC= CDROM_AUDIO_NO_STATUS;
+	retnsi 0;o }n s ES < invalidate_toc(ES <)
 {M-  memset(cd->toc, 0, sizeof(cd->toc));o-  memset(cd->disc_y  pus, 0, sizeof(cd->disc_y  pus));
+	memset(cd->toc, 0, sizeof(cd->toc));o+	memset(cd->disc_y  pus, 0, sizeof(cd->disc_y  pus));
 }n s /*Ccd0xm.c guarantees that cdte_format == CDROM_MSF +/M-ES < get_toc_entry(s ruct cd0xm_tocentry * ep)
+ES < get_toc_entry(s ruct cd0xm_tocentry *ep)
 {M-  uch track =Rnormalize_track(ep->cdte_track);o-  update_toc_entry(track);o-  ep->cdte_addr.msf.frame = cd->toc[track].Gsm[0];o-  ep->cdte_addr.msf.second = cd->toc[track].Gsm[1];o-  ep->cdte_addr.msf.minuteT= cd->toc[track].Gsm[2];o-  ep->cdte_adrT= cd->toc[track].q0 & 0xf; o-  ep->cdte_ctrl =Rcd->toc[track].q0 >> 4;o-  ep->cdte_datamode=0;M+	uch track =Rnormalize_track(ep->cdte_track);o+	update_toc_entry(track);o+	ep->cdte_addr.msf.frame = cd->toc[track].Gsm[0];o+	ep->cdte_addr.msf.second = cd->toc[track].Gsm[1];o+	ep->cdte_addr.msf.minuteT= cd->toc[track].Gsm[2];o+	ep->cdte_adrT= cd->toc[track].q0 & 0xf;o+	ep->cdte_ctrl =Rcd->toc[track].q0 >> 4;o+	ep->cdte_datamode = 0;s }n s /*CAudio ioctl.  Ioctl commands connected tocaudio are in such an
@@ -1047,244 +1112,262 @@s  * up * success. Memory checking hasRbee* done by cd0xm_ioctl(), the
  *Ccalling functt *, as well as LBA/MSF sanitizatt *.
 */s-int cm206_audio_ioctl(y ruct cd0xm_device_inG_ * cdi, unsigned int cmd, M-		      ES < * arg)  n+intccm206_audio_ioctl(y ruct cd0xm_device_inG_ *cdi, unsigned int cmd,n+		      ES < *arg)
 {M-  switchR	cmd) {
-  case CDROMREADTOCHDR: s-    retnsi read_toc_head_r((s ruct cd0xm_tochdrC*) arg);
-  case CDROMREADTOCENTRY: 	s-    get_toc_entry((s ruct cd0xm_tocentry *) arg);
-    retnsi 0;o-  case CDROMPLAYMSF: s-    play_f0xm_to_msf((s ruct cd0xm_msf *) arg);
-    retnsi 0;o-  case CDROMPLAYTRKIND:		/*Cadmittedly, notRparticularlyRbeautiful */s-    play_f0xm_to_track(((s ruct cd0xm_ti *)arg)->cdti_trk0, M-		       ((s ruct cd0xm_ti *)arg)->cdti_trk1);
-    retnsi 0;o-  case CDROMSTOP: s-    PAUSED=0;s-    iUR	cd->dsb & dsb_play_in_progress) retnsi type_0_command(c_stop, 1);
-    )lse retnsi 0;o-  case CDROMPAUSE: s-    get_drive_y  pus();o-    iUR	cd->dsb & dsb_play_in_progress) {n-      type_0_command(c_stop, 1);
-      type_1_command(c_audio_y  pus, 5, cd->audio_y  pus);
-      PAUSED=1;	/*CsayCwe're pause< */s-    }s-    retnsi 0;o-  case CDROMRESUME:o-    iUR	PAUSED) play_f0xm_to_track(0,0);o-    PAUSED=0;s-    retnsi 0;o-  case CDROMSTART:o-  case CDROMVOLCTRL:s-    retnsi 0;o-  case CDROMSUBCHNL: s-    retnsi get_current_q((s ruct cd0xm_subchnl *)arg);
-  default:s-    retnsi -EINVAL;o-  }
+	switchR	cmd) {
+	case CDROMREADTOCHDR:M+		retnsi read_toc_head_r((s ruct cd0xm_tochdrC*) arg);
+	case CDROMREADTOCENTRY:
+		get_toc_entry((s ruct cd0xm_tocentry *) arg);
+		retnsi 0;o+	case CDROMPLAYMSF:
+		play_f0xm_to_msf((s ruct cd0xm_msf *) arg);
+		retnsi 0;o+	case CDROMPLAYTRKIND:	/*Cadmittedly, notRparticularlyRbeautiful */s+		play_f0xm_to_track(((s ruct cd0xm_ti *) arg)->cdti_trk0,
+				   ((s ruct cd0xm_ti *) arg)->cdti_trk1);
+		retnsi 0;o+	case CDROMSTOP:
+		PAUSED = 0;M+		iUR	cd->dsb & dsb_play_in_progress)o+			retnsi type_0_command(c_stop, 1);
+		else
+			retnsi 0;o+	case CDROMPAUSE:
+		get_drive_y  pus();o+		iUR	cd->dsb & dsb_play_in_progress) {n+			type_0_command(c_stop, 1);
+			type_1_command(c_audio_y  pus, 5,
+				       cd->audio_y  pus);
+			PAUSED = 1;	/*CsayCwe're pause< */s+		}
+		retnsi 0;o+	case CDROMRESUME:o+		iUR	PAUSED)o+			play_f0xm_to_track(0, 0);M+		PAUSED = 0;M+		retnsi 0;o+	case CDROMSTART:o+	case CDROMVOLCTRL:s+		retnsi 0;o+	case CDROMSUBCHNL:s+		retnsi get_current_q((s ruct cd0xm_subchnl *) arg);
+	default:s+		retnsi -EINVAL;o+	}M }n s /*CIoctl. These ioctls are specific toRtheccm206Cdriver. I have mad_s   Tsome driver y  pFstics accessFb 
Rthrough ioctlCcalls.s  */sTM-y  pF Tint cm206_ioctl(y ruct cd0xm_device_inG_ * cdi, unsigned int cmd, M+y  pF Tint cm206_ioctl(y ruct cd0xm_device_inG_ *cdi, unsigned int cmd,n 		       unsigned long arg)
 {M-  switchR	cmd) {
+	switchR	cmd) {
 #iUdef STATISTICSs-  case CM206CTL_GET_STAT:o-    iUR	arg >= NR_STATS) retnsi -EINVAL;o-    )lse retnsi cd->st ps[arg];s-  case CM206CTL_GET_LAST_STAT:o-    iUR	arg >= NR_STATS) retnsi -EINVAL;o-    )lse retnsi cd->last_y  p[arg];s-#endiN    
-  default:s-    debug(("Unknown ioctlCcall 0x%x\n", cmd));M-    retnsi -EINVAL;o-  }
-}     
-s-int cm206_media_changed(y ruct cd0xm_device_inG_ * cdi, int disc_nr) s-{M-  iUR	cd != NULL) {
-    int r;s-    get_drive_y  pus();		/*Censure cd->media_changed OK */s-    r =Rcd->media_changed;s-    cd->media_changed =R0;	/*CclearTbit */s-    retnsi r;o-  }
-  )lse retnsi -EIO;o+	case CM206CTL_GET_STAT:o+		iUR	arg >= NR_STATS)
+			retnsi -EINVAL;o+		else
+			retnsi cd->st ps[arg];s+	case CM206CTL_GET_LAST_STAT:o+		iUR	arg >= NR_STATS)
+			retnsi -EINVAL;o+		else
+			retnsi cd->last_y  p[arg];s+#endiNn+	default:s+		debug(("Unknown ioctlCcall 0x%x\n", cmd));M+		retnsi -EINVAL;o+	}M+}n+o+int cm206_media_changed(y ruct cd0xm_device_inG_ *cdi, int disc_nr)
+{n+	iUR	cd != NULL) {
+		int r;
+		get_drive_y  pus();	/*Censure cd->media_changed OK */s+		r =Rcd->media_changed;s+		cd->media_changed =R0;	/*CclearTbit */s+		retnsi r;o+	} )lseo+		retnsi -EIO;o }n s /*CThe new generF Tcd0xm support. Routines should beCconcise, most ofs   TtheclogF Tshould beCin cd0xm.c */sTMT/*Ce tnsis number oU times device is in use */s-int cm206_open_fi 
s(y ruct cd0xm_device_inG_ * cdi)	o+int cm206_open_fi 
s(y ruct cd0xm_device_inG_ *cdi)
 {M-  iUR	cd) retnsi cd->openfi 
s;
-  retnsi -1;o+	iUR	cd)o+		retnsi cd->openfi 
s;
+	retnsi -1;o }n s /*Ccontrols tray movement */s-int cm206_tray_move(y ruct cd0xm_device_inG_ * cdi, int positt *) n+intccm206_tray_move(y ruct cd0xm_device_inG_ *cdi, int positt *)
 {M-  iUR	positt *) {		/*C1: eject */s-    type_0_command(c_open_tray,1);
-    invalidate_toc();s-  } 
-  )lse type_0_command(c_close_tray, 1);	/*C0: close */s-  retnsi 0;o+	iUR	positt *) {		/*C1: eject */s+		type_0_command(c_open_tray, 1);
+		invalidate_toc();s+	} )lseo+		type_0_command(c_close_tray, 1);	/*C0: close */s+	retnsi 0;o }n s /*CgivesCcurrent y  pe oU theCdriveT*/s-int cm206_drive_y  pus(y ruct cd0xm_device_inG_ * cdi, int slot_nr)
+int cm206_drive_y  pus(y ruct cd0xm_device_inG_ *cdi, int slot_nr)
 {M-  get_drive_y  pus();o-  iUR	cd->dsb & dsb_tray_not_closed) retnsi CDS_TRAY_OPEN;o-  iUR	!	cd->dsb & dsb_disc_present)) retnsi CDS_NO_DISC; o-  iUR	cd->dsb & dsb_drive_not_e ady) retnsi CDS_DRIVE_NOT_READY;
-  retnsi CDS_DISC_OK;
+	get_drive_y  pus();o+	iUR	cd->dsb & dsb_tray_not_closed)o+		retnsi CDS_TRAY_OPEN;o+	iUR	!	cd->dsb & dsb_disc_present))o+		retnsi CDS_NO_DISC;o+	iUR	cd->dsb & dsb_drive_not_e ady)o+		retnsi CDS_DRIVE_NOT_READY;
+	retnsi CDS_DISC_OK;
 }
- n+o /*Clocks or unlocks do_SMlock==1: lock;Ce tnsi 0 up * success */s-int cm206_lock_do_S(y ruct cd0xm_device_inG_ * cdi, int lock)
+int cm206_lock_do_S(y ruct cd0xm_device_inG_ *cdi, int lock)
 {M-  uch command = (lock) ? c_lock_tray : c_unlock_tray;s-  type_0_command(command, 1);	/*Cwait and get dsb */s-  /*CtheclogF Tcalculatescthecsuccess, 0 meais successful */s-  retnsi lock ^ (	cd->dsb & dsb_tray_locked) != 0);
+	uch command = (lock) ? c_lock_tray : c_unlock_tray;s+	type_0_command(command, 1);	/*Cwait and get dsb */s+	/*CtheclogF Tcalculatescthecsuccess, 0 meais successful */s+	retnsi lock ^ (	cd->dsb & dsb_tray_locked) != 0);
 }
-  n+o /*CAlthough a session s  rt should beCin LBA format, we retnsi it in s   TMSF format because it is slightly easi_r, and the new generF Tioctls   Twill take care oU theCnecessary converst *. */s-int cm206_get_last_yession(y ruct cd0xm_device_inG_ * cdi, M-			   s ruct cd0xm_multisession * mssp) n+intccm206_get_last_yession(y ruct cd0xm_device_inG_ *cdi,
+			   s ruct cd0xm_multisession *mssp)
 {M-  iUR	!FIRST_TRACK) get_disc_y  pus();o-  iUR	mssp != NULL) {
-    iUR	DISC_STATUS &Rcds_multi_yession) { /*Cmulti-session */s-      mssp->addr.msf.frame = cd->disc_y  pus[3];o-      mssp->addr.msf.second = cd->disc_y  pus[4];o-      mssp->addr.msf.minuteT= cd->disc_y  pus[5];o-      mssp->addr_format = CDROM_MSF;o-      mssp->xa_GlagC= 1;o-    } )lse {s-      mssp->xa_GlagC= 0;s-    }s-    retnsi 1;o-  }
-  retnsi 0;
-}
-s-int cm206_get_upc(y ruct cd0xm_device_inG_ * cdi, s ruct cd0xm_mcn * mcn)
-{M-  uch upc[10];M-  char *Ce t = mcn->medium_catalog_number;n-  int i;n-  s-  iUR	type_1_command(c_read_upc,C10, upc)) retnsi -EIO;o-  Gor (i=0; i<13; i++) {n-    int w=i/2+1, r=i%2;o-    iUR	r) ret[i] = 0x30 | (upc[w] & 0x0f);
-    )lse ret[i] = 0x30 | ((upc[w] >> 4)T& 0x0f);
-  }
-  ret[13] = '\0';
-  retnsi 0;
-} 
-s-int cm206_reset(y ruct cd0xm_device_inG_ * cdi)
-{
-  s op_e ad();
-  reset_cm260();s-  outw(dc_normal | dc_break | READ_AHEAD, r_data_control);o-  mdelay(1);			/*C750 musec minimum */s-  outw(dc_normal | READ_AHEAD, r_data_control);o-  cd->sector_last =R-1;		/*CGlagCno data buNf_red */s-  cd->adapter_last =R-1;    
-  invalidate_toc();s-  retnsi 0;
-}
-s-int cm206_select_speed(y ruct cd0xm_device_inG_ * cdi, int speed)
-{M-  int r;
-  switchR	speed) {
-  case 0: s-    r =Rtype_0_command(c_auto_mode, 1);
-    break;s-  case 1:M-    r =Rtype_0_command(c_Gorce_1x, 1);
-    break;s-  case 2:M-    r =Rtype_0_command(c_Gorce_2x, 1);
-    break;s-  default:s-    retnsi -1;o-  }
-  iUR	r<0) retnsi r;o-  )lse retnsi 1;o+	iUR	!FIRST_TRACK)
+		get_disc_y  pus();o+	iUR	mssp != NULL) {
+		iUR	DISC_STATUS &Rcds_multi_yession) {	/*Cmulti-session */s+			mssp->addr.msf.frame = cd->disc_y  pus[3];o+			mssp->addr.msf.second = cd->disc_y  pus[4];o+			mssp->addr.msf.minuteT= cd->disc_y  pus[5];o+			mssp->addr_format = CDROM_MSF;o+			mssp->xa_GlagC= 1;o+		} )lse {
+			mssp->xa_GlagC= 0;s+		}
+		retnsi 1;o+	}M+	retnsi 0;
+}
+n+intccm206_get_upc(y ruct cd0xm_device_inG_ *cdi, s ruct cd0xm_mcn *mcn)
+{n+	uch upc[10];M+	char *e t = mcn->medium_catalog_number;n+	int i;n+s+	iUR	type_1_command(c_read_upc,C10, upc))o+		retnsi -EIO;o+	Gor (iT= 0; i < 13; i++) {s+		int w = i / 2 + 1, r = i % 2;s+		iUR	r)
+			ret[i] = 0x30 | (upc[w] & 0x0f);
+		else
+			ret[i] = 0x30 | ((upc[w] >> 4)T& 0x0f);
+	}M+	ret[13] = '\0';
+	retnsi 0;
+}
+n+intccm206_reset(y ruct cd0xm_device_inG_ *cdi)
+{n+	stop_e ad();
+	reset_cm260();s+	outw(dc_normal | dc_break | READ_AHEAD, r_data_control);o+	mdelay(1);		/*C750 musec minimum */s+	outw(dc_normal | READ_AHEAD, r_data_control);o+	cd->sector_last =R-1;	/*CGlagCno data buNf_red */s+	cd->adapter_last =R-1;n+	invalidate_toc();s+	retnsi 0;
+}
+n+intccm206_select_speed(y ruct cd0xm_device_inG_ *cdi, int speed)
+{n+	int r;
+	switchR	speed) {
+	case 0:s+		r =Rtype_0_command(c_auto_mode, 1);
+		break;s+	case 1:s+		r =Rtype_0_command(c_Gorce_1x, 1);
+		break;s+	case 2:s+		r =Rtype_0_command(c_Gorce_2x, 1);
+		break;s+	default:s+		retnsi -1;o+	}M+	iUR	r < 0)s+		retnsi r;o+	)lseo+		retnsi 1;o }n s y  pF Ty ruct cd0xm_device_ops cm206_dops = {s-	open:			cm206_open,o-	release:		cm206_release,o-	drive_y  pus:		cm206_drive_y  pus,o-	media_changed:		cm206_media_changed,o-	tray_move:		cm206_tray_move,o-	lock_do_S:		cm206_lock_do_S,o-	select_speed:		cm206_select_speed,o-	get_last_yession:	cm206_get_last_yession,o-	get_mcn:		cm206_get_upc,o-	reset:			cm206_reset,o-	audio_ioctl:		cm206_audio_ioctl,o-	dev_ioctl:		cm206_ioctl,o-	capability:		CDC_CLOSE_TRAY | CDC_OPEN_TRAY | CDC_LOCK |M-				CDC_MULTI_SESSION | CDC_MEDIA_CHANGED |M-				CDC_MCN | CDC_PLAY_AUDIO | CDC_SELECT_SPEED |M-				CDC_IOCTLS | CDC_DRIVE_STATUS, M-	n_minors:		1,
+	open:cm206_open,o+	release:cm206_release,o+	drive_y  pus:cm206_drive_y  pus,o+	media_changed:cm206_media_changed,o+	tray_move:cm206_tray_move,o+	lock_do_S:cm206_lock_do_S,o+	select_speed:cm206_select_speed,o+	get_last_yession:cm206_get_last_yession,o+	get_mcn:cm206_get_upc,o+	reset:cm206_reset,o+	audio_ioctl:cm206_audio_ioctl,o+	dev_ioctl:cm206_ioctl,o+	capability:CDC_CLOSE_TRAY | CDC_OPEN_TRAY | CDC_LOCK |M+	    CDC_MULTI_SESSION | CDC_MEDIA_CHANGED |M+	    CDC_MCN | CDC_PLAY_AUDIO | CDC_SELECT_SPEED |M+	    CDC_IOCTLS | CDC_DRIVE_STATUS,M+	n_minors:1,
 };
 n s y  pF Ty ruct cd0xm_device_inG_ cm206_inG_ = {s-	ops:		&cm206_dops,o-	speed:		2,o-	capacity:	1,o-	name:		"cm206",
+	ops:&cm206_dops,o+	speed:2,o+	capacity:1,
+	name:"cm206",
 };
 n /*CThis routine getsCcalled during initializatt * if things go wrong,
  *Ccan beCuse< in cleanup_module as well. */s y  pF TES < cleanup(int level)
 {M-  switchR	level) {
-  case 4: s-    iUR	unregister_cd0xm(&cm206_inG_)) {s-      printk("Can't unregisterTcd0xm cm206\n");n-      retnsi;s-    }s-    iUR	devfs_unregister_blkdev(MAJOR_NR, "cm206")) {s-      printk("Can't unregisterTmajor cm206\n");n-      retnsi;s-    }s-    blk_cleanup_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR));s-  case 3: s-    free_irq	cm206_irq, NULL);s-  case 2: s-  case 1: s-    kfree	cd);M-    release_region	cm206_base, 16);
-  default:;o-  }
+	switchR	level) {
+	case 4:o+		iUR	unregister_cd0xm(&cm206_inG_)) {s+			printk("Can't unregisterTcd0xm cm206\n");n+			retnsi;
+		}o+		iUR	devfs_unregister_blkdev(MAJOR_NR, "cm206")) {s+			printk("Can't unregisterTmajor cm206\n");n+			retnsi;
+		}o+		blk_cleanup_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR));s+	case 3:o+		free_irq	cm206_irq, NULL);s+	case 2:s+	case 1:s+		kfree	cd);M+		release_region	cm206_base, 16);
+	default:;
+	}s }n s /*CThis functt * probes Gor theCadapter card. ItCretnsis thecbase
@@ -1299,117 +1382,129 @@s  */sTint __init probe_base_port(int base)
 {M-  int b=0x300, e=0x370;		/*Cthis is theceangeCof s  rt addresses */s-  vol pFle int fool, i;n+	int b = 0x300, e = 0x370;	/*Cthis is theceangeCof s  rt addresses */s+	vol pFle int fool, i;n s-  iUR	base) b=e=base;o-  Gor (base=b; base<=e; base += 0x10) {
-    iUR	check_region	base, 0x10)) continue;o-    Gor (i=0; i<3; i++) s-      fool = inw	base+2); /*C)mpty possFb y uart_receive_buNf_r */s-    if((inw	base+6)T& 0xNf_f) != 0x0001 || /*Cline_s  pus */s-       (inw(base) & 0xad00) != 0) /*Cdata s  pus */s-      continue;o-    retnsi(base);o-  }
-  retnsi 0;
+	iUR	base)
+		b = e = base;o+	Gor (base = b; base <= e; base += 0x10) {
+		iUR	check_region	base, 0x10))o+			continue;o+		Gor (iT= 0; i < 3; i++)M+			fool = inw	base + 2);	/*Cempty possFb y uart_receive_buNf_r */s+		iUR	(inw	base + 6)T& 0xNf_f) != 0x0001 ||	/*Cline_s  pus */s+		    (inw(base) & 0xad00) != 0)	/*Cdata s  pus */s+			continue;o+		retnsi (base);o+	}M+	retnsi 0;
 }n s #iUR!defined(MODULE) || defined(AUTO_PROBE_MODULE)s /*CProbe G_SMirq# nr. If nr==0, probe G_SMall possFb 
Mirq's. */s-int __init probe_irq	int nr){M-  int irqs, irq;s-  outw(dc_normal | READ_AHEAD, r_data_control);	/*Cdisab 
Mirq-generatt * */s-  sti(); s-  irqs = probe_irq_on	);
-  reset_cm260();		/*Ccauses interrupt */s-  udelay(100);			/*Cwait G_SMit */s-  irq = probe_irq_off(irqs);s-  outw(dc_normal | READ_AHEAD, r_data_control);	/*Cservices interrupt */s-  iUR	nr &&Rirq!=nr &&Rirq>0) retnsi 0;	/*Cwrong interrupt happened */s-  )lse retnsi irq;s+int __init probe_irq	int nr)
+{n+	int irqs, irq;s+	outw(dc_normal | READ_AHEAD, r_data_control);	/*Cdisab 
Mirq-generatt * */s+	sti();o+	irqs = probe_irq_on	);
+	reset_cm260();		/*Ccauses interrupt */s+	udelay(100);		/*Cwait G_SMit */s+	irq = probe_irq_off(irqs);s+	outw(dc_normal | READ_AHEAD, r_data_control);	/*Cservices interrupt */s+	iUR	nr &&Rirq != nr &&Rirq > 0)s+		retnsi 0;	/*Cwrong interrupt happened */s+	)lseo+		retnsi irq;s }n #endiNn sTint __init cm206_init(ES <)
 {M-  uch e=0;s-  long int size=sizeof(y ruct cm206_s ruct);
+	uch eC= 0;s+	long int size = yizeof(y ruct cm206_s ruct);
 s-  printk(KERN_INFO "cm206Tcd0xm driver " REVISION);s-  cm206_base = probe_base_port(auto_probe ? 0 : cm206_base);o-  iUR	!cm206_base) {
-    printk("Ccan't find adapter!\n");n-    retnsi -EIO;o-  }s-  printk("Cadapter at 0x%x", cm206_base);o-  requurt_region	cm206_base, 16, "cm206");o-  cd = (y ruct cm206_s ruct *) kmalloc(yize, GFP_KERNEL);o-  iUR	!cd) retnsi -EIO;o-  /*CNow we have f undTtheCadaptor card,Rtry toRreset it. As we haven-   * f undTout earli_r, this process generates an interrupt as well,n-   * soRwe might just exploit that fact G_SMirq probing! */s+	printk(KERN_INFO "cm206Tcd0xm driver " REVISION);s+	cm206_base = probe_base_port(auto_probe ? 0 : cm206_base);o+	iUR	!cm206_base) {
+		printk("Ccan't find adapter!\n");n+		retnsi -EIO;o+	}s+	printk("Cadapter at 0x%x", cm206_base);o+	requurt_region	cm206_base, 16, "cm206");o+	cd = (y ruct cm206_s ruct *) kmalloc(yize, GFP_KERNEL);o+	iUR	!cd)o+		retnsi -EIO;o+	/*CNow we have f undTtheCadaptor card,Rtry toRreset it. As we haven+	 * f undTout earli_r, this process generates an interrupt as well,n+	 * soRwe might just exploit that fact G_SMirq probing! */s #iUR!defined(MODULE) || defined(AUTO_PROBE_MODULE)s-  cm206_irq = probe_irq(auto_probe ? 0 : cm206_irq);	o-  iUR	cm206_irq<=0) {
-    printk("can't find IRQ!\n");n-    cleanup(1);n-    retnsi -EIO;o-  }s-  )lse printk("CIRQ %d f und\n", cm206_irq);s+	cm206_irq = probe_irq(auto_probe ? 0 : cm206_irq);o+	iUR	cm206_irq <= 0) {s+		printk("can't find IRQ!\n");n+		cleanup(1);n+		retnsi -EIO;o+	} )lseo+		printk("CIRQ %d f und\n", cm206_irq);s #elseo-  cli();
-  reset_cm260();s-  /*CNow, thecprob 
m here is that reset_cm260Ccan generate an
-     interrupt. ItCseems that this can cause a kernel oops some time
-     later. SoRwe wait a whi 
 and `service'Cthis interrupt. */s-  mdelay(1);s-  outw(dc_normal | READ_AHEAD, r_data_control);o-  sti();o-  printk("Cusing IRQ %d\n", cm206_irq);s+	cli();
+	reset_cm260();s+	/*CNow, thecprob 
m here is that reset_cm260Ccan generate an
+	   interrupt. ItCseems that this can cause a kernel oops some time
+	   later. SoRwe wait a whi 
 and `service'Cthis interrupt. */s+	mdelay(1);s+	outw(dc_normal | READ_AHEAD, r_data_control);o+	sti();o+	printk("Cusing IRQ %d\n", cm206_irq);s #endiNn-  iUR	send_receive_polled(c_drive_configuratt *) != c_drive_configuratt *) 
-    {s-      printk(KERN_INFO "CdriveTnotRthere\n");n-      cleanup(1);n-      retnsi -EIO;o-    }s-  ) = yend_receive_polled(c_gimme);o-  printk(KERN_INFO "Firmware revision %d", e & dcf_revision_code);o-  iUR	e & dcf_transf_r_rate) printk("Cdoub 
");n-  )lse printk("Csing 
");n-  printk("CspeedCdrive");o-  iUR	e & dcf_motorized_tray) printk(", motorized tray");o-  iUR	requurt_irq	cm206_irq, cm206_interrupt, 0, "cm206", NULL)) {
-    printk("\nUnab 
MtoRreserveTIRQ---aborted\n");n-    cleanup(2);n-    retnsi -EIO;o-  }s-  printk(".\n");n-  iUR	devfs_register_blkdev(MAJOR_NR, "cm206", &cd0xm_fops) != 0) {
-    printk(KERN_INFO "CannotRregisterTG_SMmajor %d!\n", MAJOR_NR);n-    cleanup(3);n-    retnsi -EIO;o-  }s-  cm206_inG_.dev = MKDEV(MAJOR_NR,0);o-  iUR	register_cd0xm(&cm206_inG_) != 0) {
-    printk(KERN_INFO "CannotRregisterTG_SMcd0xm %d!\n", MAJOR_NR);n-    cleanup(3);n-    retnsi -EIO;o-  }    
-  blk_init_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);n-  blkyize_yize[MAJOR_NR] = cm206_blocksizes;
-  read_ahead[MAJOR_NR] = 16;	/*Creads ahead what? */s-  init_bh(CM206_BH, cm206_bh);n-o-  memset(cd, 0, sizeof(*cd));	/*Cgive'm some reasonab 
Mvalue */s-  cd->sector_last =R-1;		/*CGlagCno data buNf_red */s-  cd->adapter_last =R-1;s-  cd->timer.functt * = cm206_timeout;s-  cd->max_sectors = (inw(r_data_y  pus) & ds_ram_yize) ? 24 : 97;o-  printk(KERN_INFO "%d kB adapter memory availab 
, "  M-	 " %ld bytes kernel memory use<.\n", cd->max_sectors*2, size);
-  retnsi 0;
+	iUR	send_receive_polled(c_drive_configuratt *) !=M+	    c_drive_configuratt *) {s+		printk(KERN_INFO "CdriveTnotRthere\n");n+		cleanup(1);n+		retnsi -EIO;o+	}s+	) = yend_receive_polled(c_gimme);o+	printk(KERN_INFO "Firmware revision %d", e & dcf_revision_code);o+	iUR	e & dcf_transf_r_rate)o+		printk("Cdoub 
");n+	)lseo+		printk("Csing 
");n+	printk("CspeedCdrive");o+	iUR	e & dcf_motorized_tray)o+		printk(", motorized tray");o+	iUR	requurt_irq	cm206_irq, cm206_interrupt, 0, "cm206", NULL)) {
+		printk("\nUnab 
MtoRreserveTIRQ---aborted\n");n+		cleanup(2);n+		retnsi -EIO;o+	}s+	printk(".\n");n+	iUR	devfs_register_blkdev(MAJOR_NR, "cm206", &cd0xm_fops) != 0) {
+		printk(KERN_INFO "CannotRregisterTG_SMmajor %d!\n",n+		       MAJOR_NR);n+		cleanup(3);n+		retnsi -EIO;o+	}s+	cm206_inG_.dev = MKDEV(MAJOR_NR, 0);
+	iUR	register_cd0xm(&cm206_inG_) != 0) {
+		printk(KERN_INFO "CannotRregisterTG_SMcd0xm %d!\n",n+		       MAJOR_NR);n+		cleanup(3);n+		retnsi -EIO;o+	}s+	blk_init_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);n+	blkyize_yize[MAJOR_NR] = cm206_blocksizes;
+	read_ahead[MAJOR_NR] = 16;	/*Creads ahead what? */s+	init_bh(CM206_BH, cm206_bh);n+o+	memset(cd, 0, sizeof(*cd));	/*Cgive'm some reasonab 
Mvalue */s+	cd->sector_last =R-1;	/*CGlagCno data buNf_red */s+	cd->adapter_last =R-1;n+	cd->timer.functt * = cm206_timeout;s+	cd->max_sectors = (inw(r_data_y  pus) & ds_ram_yize) ? 24 : 97;o+	printk(KERN_INFO "%d kB adapter memory availab 
, "M+	       " %ld bytes kernel memory use<.\n", cd->max_sectors * 2,n+	       size);
+	retnsi 0;
 }n s #iUdef MODULE
@@ -1417,65 +1512,67 @@s s y  pF TES < __init parse_optt *s(ES <)
 {M-  int i;n-  Gor (i=0; i<2; i++) {n-    iUR	0x300 <= cm206[i] &&Ri<= 0x370 &&Rcm206[i] % 0x10C== 0) {n-      cm206_base = cm206[i];n-      auto_probe=0;s-    }s-    )lse iUR	3 <= cm206[i] &&Rcm206[i] <= 15) {n-      cm206_irq = cm206[i];n-      auto_probe=0;s-    }s-  }
+	int i;n+	Gor (iT= 0; i < 2; i++) {s+		iUR	0x300 <= cm206[i] &&Ri <= 0x370n+		    &&Rcm206[i] % 0x10C== 0) {n+			cm206_base = cm206[i];n+			auto_probe = 0;s+		} )lse iUR	3 <= cm206[i] &&Rcm206[i] <= 15) {n+			cm206_irq = cm206[i];n+			auto_probe = 0;s+		}
+	}s }n s int __cm206_init(ES <)
 {M 	parse_optt *s();s #iUR!defined(AUTO_PROBE_MODULE)s-	auto_probe=0;s+	auto_probe = 0;s #endiNn 	retnsi cm206_init();o }n s ES < __exit cm206_exit(ES <)
 {M-  cleanup(4);o-  printk(KERN_INFO "cm206Tremoved\n");n+	cleanup(4);o+	printk(KERN_INFO "cm206Tremoved\n");n }n s module_init(__cm206_init);n module_exit(cm206_exit);n-      s-#else /*C!MODULE */s+n+#else				/*C!MODULE */s s /*CThis setup functt * accepts either `auto' or numbers in theceange
  *C3--11 (G_SMirq) or 0x300--0x370 (G_SMbase port) or both. */s s y  pF Tint __init cm206_setup(char *s)
 {M-  int i, p[4];o-  o-  (ES <)get_optt *s(s, ARRAY_SIZE(p), p);n-  s-  iUR	!strcmp(s, "auto")) auto_probe=1;n-  Gor(i=1; i<=p[0]; i++) {n-    iUR	0x300 <= p[i] &&Ri<= 0x370 &&Rp[i] % 0x10C== 0) {n-      cm206_base = p[i];n-      auto_probeC= 0;s-    }s-    )lse iUR	3 <= p[i] &&Rp[i] <= 15) {n-      cm206_irq = p[i];n-      auto_probeC= 0;s-    }s-  }s- retnsi 1;o+	int i, p[4];o+o+	(ES <) get_optt *s(s, ARRAY_SIZE(p), p);n+s+	iUR	!strcmp(s, "auto"))s+		auto_probeC= 1;n+	Gor (iT= 1;Ri <= p[0]; i++) {n+		iUR	0x300 <= p[i] &&Ri <= 0x370 &&Rp[i] % 0x10C== 0) {n+			cm206_base = p[i];n+			auto_probe = 0;s+		} )lse iUR	3 <= p[i] &&Rp[i] <= 15) {n+			cm206_irq = p[i];n+			auto_probe = 0;s+		}
+	}s+	retnsi 1;o }n s __setup("cm206=", cm206_setup);
 s-#endiN /*C!MODULE */s+#endiN				/*C!MODULE */s+n+o /*
  *CLocalMvariab 
s:
  *Ccompile-command: "gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -m486 -DMODULE -DMODVERSIONS -include /usr/src/linux/include/linux/modverst *s.h  -c -_ cm206._ cm206.c"
diNf -u --recurstveT--new-fi 
 v2.4.9/linux/drivers/cd0xm/gscd.c linux/drivers/cd0xm/gscd.c
--- v2.4.9/linux/drivers/cd0xm/gscd.c	Fri Feb  9 11:30:22 2001
+++ linux/drivers/cd0xm/gscd.c	Fri Sep  7 09:28:38 2001
@@ -41,8 +41,8 @@s s */sTM-/*CThese settings are Gor various debug-level. LeaveTthey untouched ... */ s-#define  NO_GSCD_DEBUG n+/*CThese settings are Gor various debug-level. LeaveTthey untouched ... */s+#define  NO_GSCD_DEBUGs #define  NO_IOCTL_DEBUGs #define  NO_MODULE_DEBUGs #define  NO_FUTURE_WORK
@@ -71,81 +71,82 @@s s #define MAJOR_NR GOLDSTAR_CDROM_MAJORs #include <linux/blk.h>s-#define gscd_port gscd /*CG_SMcomp pFb 
Mparameter passing with "insmod" */s+#define gscd_port gscd		/*CG_SMcomp pFb 
Mparameter passing with "insmod" */s #include "gscd.h"sTM-y  pF Tint gscd_blocksizes[1] = {512};
+y  pF Tint gscd_blocksizes[1] = { 512 };
 n-y  pF Tint gscdPresent            = 0;s+y  pF Tint gscdPresent = 0;s n-y  pF Tunsigned char gscd_buf[2048];    /*CbuNf_r G_SMblock size converst * */s-y  pF Tint   gscd_bn              = -1;s-y  pF Tyhort gscd_port            = GSCD_BASE_ADDR;s+y  pF Tunsigned char gscd_buf[2048];	/*CbuNf_r G_SMblock size converst * */s+y  pF Tint gscd_bn =R-1;n+y  pF Tyhort gscd_port = GSCD_BASE_ADDR;s MODULE_PARM(gscd, "h");n s /*CKommt spaeter vielleichtCnoch mal dean ...
  *C   s  pF TDECLARE_WAIT_QUEUE_HEAD(gscd_waitq);s- */ s+ */sTM-y  pF TES < gscd_transf_r         (ES <);M-y  pF TES < gscd_read_cmd         (ES <);M-y  pF TES < gscd_hsg2msf          (long hsg, s ruct msf *msf);M-y  pF TES < gscd_bin2bcd          (unsigned char *p);n+y  pF TES < gscd_transf_r(ES <);M+y  pF TES < gscd_read_cmd(ES <);M+y  pF TES < gscd_hsg2msf(long hsg, s ruct msf *msf);M+y  pF TES < gscd_bin2bcd(unsigned char *p);n s /*CSchnittstellen zum Kern/FS */sTM-y  pF TES < do_gscd_requurt       (requurt_quuue_t *);M-y  pF TES < __do_gscd_requurt     (unsigned long dummy);M-y  pF Tint  gscd_ioctlCCCCCCCCCCCC(y ruct inode *, s ruct fi 
 *, unsigned int, unsigned long);M-y  pF Tint  gscd_open CCCCCCCCCCCC(y ruct inode *, s ruct fi 
 *);M-y  pF Tint  gscd_releaseCCCCCCCCCC(y ruct inode *, s ruct fi 
 *);M-y  pF Tint  check_gscd_med_chgCCCC(kdev_t);M+y  pF TES < do_gscd_requurt(requurt_quuue_t *);M+y  pF TES < __do_gscd_requurt(unsigned long dummy);M+y  pF Tint gscd_ioctl(y ruct inode *, s ruct fi 
 *, unsigned int,n+		      unsigned long);M+y  pF Tint gscd_open(y ruct inode *, s ruct fi 
 *);M+y  pF Tint gscd_release(y ruct inode *, s ruct fi 
 *);M+y  pF Tint check_gscd_med_chg(kdev_t);M s /*CCCCCCGoldStar Funktt *en CCC*/sTM-y  pF TES < cc_Reset CCCCCCCCCCCC(ES <);M-y  pF Tint  wait_drv_e adyCCCCCCC(ES <);M-y  pF Tint  find_drives          (ES <);M-y  pF TES < cmd_out  CCCCCCCCCCCC(int, char *, char *, int);M-y  pF TES < cmd_s  pus           (ES <);M-y  pF TES < cc_Ident             (char *);M-y  pF TES < cc_SetSpeedC         (ES <);M-y  pF TES < init_cd_driveCCCCCCCC(int);n-o-y  pF Tint  get_s  pus           (ES <);M-y  pF TES < clear_Audio          (ES <);M-y  pF TES < cc_invalidate        (ES <);M+y  pF TES < cc_Reset(ES <);M+y  pF Tint wait_drv_e ady(ES <);M+y  pF Tint find_drives(ES <);M+y  pF TES < cmd_out(int, char *, char *, int);M+y  pF TES < cmd_s  pus(ES <);M+y  pF TES < cc_Ident(char *);M+y  pF TES < cc_SetSpeed(ES <);M+y  pF TES < init_cd_drive(int);n+M+y  pF Tint get_s  pus(ES <);M+y  pF TES < clear_Audio(ES <);M+y  pF TES < cc_invalidate(ES <);M s /*Csome things Gor theCnext verst * */s #iUdef FUTURE_WORK
-y  pF TES < update_y  pe          (ES <);M-y  pF Tlong gscd_msf2hsgCCCCCCCCCC(y ruct msf *mp);M-y  pF Tint  gscd_bcd2bin          (unsigned char bc<);M+y  pF TES < update_y  pe(ES <);M+y  pF Tlong gscd_msf2hsg(y ruct msf *mp);M+y  pF Tint gscd_bcd2bin(unsigned char bc<);M #endiNn sT/*CCCCcomm * GoldStar Initializatt *    */sTM-y  pF Tint my_gscd_init (ES <);M+y  pF Tint my_gscd_init(ES <);M s s /*CCCCCClo-level cmd-Funktt *en CCC*/sTM-y  pF TES < cmd_inG__in          ( char *, int );M-y  pF TES < cmd_end              (TES < );M-y  pF TES < cmd_read_b           ( char *, int, int );M-y  pF TES < cmd_read_w           ( char *, int, int );M-y  pF Tint  cmd_unit_aliveCCCCCCC(TES < );M-y  pF TES < cmd_write_cmd        ( char * );M+y  pF TES < cmd_inG__in(char *, int);M+y  pF TES < cmd_end(ES <);M+y  pF TES < cmd_read_b(char *, int, int);M+y  pF TES < cmd_read_w(char *, int, int);M+y  pF Tint cmd_unit_alive(ES <);M+y  pF TES < cmd_write_cmd(char *);M M s /*CCCCCCGoldStar Variab 
n     */sTM-y  pF Tint Ccurr_drv_y  pe;M-y  pF Tint  drv_y  pes[]       = {0,0,0,0,0,0,0,0};M-y  pF Tint  drv_mode;M-y  pF Tint  disk_y  pe;M-y  pF Tint  speed;M-y  pF Tint  ndrives;M+y  pF Tint curr_drv_y  pe;M+y  pF Tint drv_y  pes[] = { 0, 0, 0, 0, 0, 0, 0, 0 };M+y  pF Tint drv_mode;M+y  pF Tint disk_y  pe;M+y  pF Tint speed;M+y  pF Tint ndrives;M s y  pF Tunsigned char drv_num_read;s y  pF Tunsigned char f_dsk_valid;
@@ -155,93 +156,91 @@s s y  pF Tchar f_AudioPlay;s y  pF Tchar f_AudioPause;M-y  pF Tint  AudioStart_m;M-y  pF Tint  AudioStart_f;M-y  pF Tint  AudioEnd_m;M-y  pF Tint  AudioEnd_f;M- M+y  pF Tint AudioStart_m;M+y  pF Tint AudioStart_f;M+y  pF Tint AudioEnd_m;M+y  pF Tint AudioEnd_f;M+s y  pF Ty ruct timer_list gscd_timer;n s y  pF Ty ruct block_device_operatt *s gscd_fops = {s-	open:			gscd_open,o-	release:		gscd_release,o-	ioctl:			gscd_ioctl,o-	check_media_change:	check_gscd_med_chg,
+	open:gscd_open,o+	release:gscd_release,o+	ioctl:gscd_ioctl,o+	check_media_change:check_gscd_med_chg,
 };
 n /*C
  *CChecking iU theCmedia hasRbee* changed
  *C(notRyet implemented)
  */s-y  pF Tint check_gscd_med_chgC(kdev_t full_dev)M+y  pF Tint check_gscd_med_chg(kdev_t full_dev)M {n-   int target;o+	int target;o 
 s-   target = MINOR(full_dev);s+	target = MINOR(full_dev);s s-   iUR	target > 0) s-   {s-      printk("GSCD:CGoldStar CD-ROM requurt error: invalid device.\n");n-      retnsi 0;s-   }M+	iUR	target > 0) {
+		printks+		    ("GSCD:CGoldStar CD-ROM requurt error: invalid device.\n");n+		retnsi 0;o+	}M+#iUdef GSCD_DEBUGs+	printk("gscd: check_med_change\n");n+#endiNn s-   #iUdef GSCD_DEBUGs-   printk ("gscd: check_med_change\n");n-   #endiNn- 
-  retnsi 0;
+	retnsi 0;
 }n s s #iUndef MODULE
 /*CUsing new interface Gor kernel-parameters */s-  s-y  pF Tint __init gscd_setup (char *str)
+M+y  pF Tint __init gscd_setup(char *str)
 {M-  int ints[2];o-  (ES <)get_optt *s(str, ARRAY_SIZE(ints), ints);n-  s-  iUR	ints[0] > 0) s-  {s-     gscd_port = ints[1];o-  }s- retnsi 1;o+	int ints[2];o+	(ES <) get_optt *s(str, ARRAY_SIZE(ints), ints);n+s+	iUR	ints[0] > 0) {
+		gscd_port = ints[1];o+	}s+	retnsi 1;o }n s __setup("gscd=", gscd_setup);M M #endiNn s-y  pF Tint gscd_ioctlC(y ruct inode *ip, s ruct fi 
 *fp, unsigned int cmd, unsigned long arg)
+y  pF Tint gscd_ioctl(y ruct inode *ip, s ruct fi 
 *fp, unsigned int cmd,n+		      unsigned long arg)
 {M-unsigned char to_do[10];M-unsigned char dummy;
+	unsigned char to_do[10];M+	unsigned char dummy;
+
 s-                             s-    switchR	cmd)
-    {s-       case CDROMSTART:     /*CSpin up theCdriveT*/s+	switchR	cmd) {
+	case CDROMSTART:	/*CSpin up theCdriveT*/s 		/*CDon't think we can doCthis.  Eve* if we could,n- 		 * I think theCdriveTtimes out and stops after a whi 
n+		 * I think theCdriveTtimes out and stops after a whi 
n 		 * anyway.  For now, ignore it.n 		 */s-            retnsi 0;
+		retnsi 0;
 s-       case CDROMRESUME:   /*Ckeine Ahnung wasRdas ist */s-            retnsi 0;
+	case CDROMRESUME:	/*Ckeine Ahnung wasRdas ist */s+		retnsi 0;
 s s-       case CDROMEJECT:o-            cmd_s  pus ();n-            to_do[0] =RCMD_TRAY_CTL;o-            cmd_out (TYPE_INFO, (char *)&to_do, (char *)&dummy, 0);
+	case CDROMEJECT:o+		cmd_s  pus();n+		to_do[0] =RCMD_TRAY_CTL;o+		cmd_out(TYPE_INFO, (char *) &to_do, (char *) &dummy, 0);
 s-            retnsi 0;
+		retnsi 0;
 s-       default:s-            retnsi -EINVAL;o-    }
+	default:s+		retnsi -EINVAL;o+	}M o }n s@@ -251,17 +250,16 @@s  * Whe* Linux getsCvariab 
Mblock sizesCthis will probab y go away.
  */sTM-y  pF TES < gscd_transf_r (ES <)
+y  pF TES < gscd_transf_r(ES <)
 {M-long offs;s+	long offs;s M-	whi 
 (CURRENT -> nr_sectors > 0 &&Rgscd_bn ==RCURRENT -> sector / 4)s-	{s-		offs = (CURRENT -> sector & 3) * 512;o-		memcpy(CURRENT -> buNf_r, gscd_buf + offs, 512);o-		CURRENT -> nr_sectors--;o-		CURRENT -> sector++;o-		CURRENT -> buNf_r += 512;o+	whi 
 (CURRENT->nr_sectors > 0 &&Rgscd_bn ==RCURRENT->sector / 4) {
+		offs = (CURRENT->sector & 3) * 512;o+		memcpy(CURRENT->buNf_r, gscd_buf + offs, 512);o+		CURRENT->nr_sectors--;o+		CURRENT->sector++;o+		CURRENT->buNf_r += 512;o 	}s }n s@@ -270,17 +268,17 @@s  * I/O requurt routine called f0xm Linux kernel.
  */sTM-y  pF TES < do_gscd_requurt (requurt_quuue_t * q)M+y  pF TES < do_gscd_requurt(requurt_quuue_t * q)M {s-  __do_gscd_requurt(0);
+	__do_gscd_requurt(0);
 }n s-y  pF TES < __do_gscd_requurt (unsigned long dummy)M+y  pF TES < __do_gscd_requurt(unsigned long dummy)
 {M-unsigned int block,dev;M-unsigned int nsect;M+	unsigned int block, dev;M+	unsigned int nsect;M s-repeat:s+      repeat:s 	iUR	QUEUE_EMPTY || CURRENT->rq_s  pus ==RRQ_INACTIVE)s 		goto out;s 	INIT_REQUEST;
@@ -288,18 +286,16 @@s 	block =RCURRENT->sector;s 	nsect =RCURRENT->nr_sectors;s M-	iUR	QUEUE_EMPTY || CURRENT -> sector ==R-1)s+	iUR	QUEUE_EMPTY || CURRENT->sector ==R-1)s 		goto out;s M-	iUR	CURRENT -> cmd != READ)s-	{s-		printk("GSCD:Cba< cmd %d\n", CURRENT -> cmd);
+	iUR	CURRENT->cmd != READ) {
+		printk("GSCD:Cba< cmd %d\n", CURRENT->cmd);
 		end_requurt(0);
 		goto repeat;o 	}s M-	iUR	MINOR(CURRENT -> rq_dev) != 0)s-	{s+	iUR	MINOR(CURRENT->rq_dev) != 0) {M 		printk("GSCD:Cthis verst * supports on y one device\n");n 		end_requurt(0);
 		goto repeat;o@@ -309,18 +305,16 @@s 
 	/*Cif we s pFsfiedTtheCrequurt f0xm thecbuNf_r, we're done. */s s-	iUR	CURRENT -> nr_sectors == 0)s-	{s+	iUR	CURRENT->nr_sectors == 0) {M 		end_requurt(1);
 		goto repeat;o 	}s-
 #iUdef GSCD_DEBUGs-        printk ("GSCD:Cdev %d, block %d, nsect %d\n", dev, block, nsect );n+	printk("GSCD:Cdev %d, block %d, nsect %d\n", dev, block, nsect);M #endiNn s-	gscd_read_cmd ();n-out:s+	gscd_read_cmd();n+      out:s 	retnsi;
 }n s@@ -331,47 +325,42 @@s  * read-data command.
  */sTM-y  pF TES <
-gscd_read_cmd (ES <)
+y  pF TES < gscd_read_cmd(ES <)
 {M-long   block;M-y ruct gscd_Play_msf gscdcmd;M-char   cmd[] = { CMD_READ, 0x80, 0,0,0, 0,1 }; /*Ccmd mode M-S-F secth sectl */s+	long block;M+	struct gscd_Play_msf gscdcmd;M+	char cmd[] = { CMD_READ, 0x80, 0, 0, 0, 0, 1 };	/*Ccmd mode M-S-F secth sectl */s 
 s s-        cmd_s  pus ();n-        iUR	 disk_y  pe & (ST_NO_DISK | ST_DOOR_OPEN) )n-        {s-           printk ( "GSCD:Cno disk or do_SMopen\n" );n-           end_requurt (0);n-        }n-        elseo-        {s-           iUR	 disk_y  pe & ST_INVALID )n-           {s-              printk ( "GSCD:Cdisk invalid\n" );n-              end_requurt (0);n-           }n-           elseo-           {s-              gscd_bn =R-1;		/*CpurgeCour buNf_r */s-              block =RCURRENT -> sector / 4;s-              gscd_hsg2msf(block, &gscdcmd.s  rt);	/*CcvtMtoRmsf format */s-s-              cmd[2] = gscdcmd.s  rt.min;s-              cmd[3] = gscdcmd.s  rt.sec;s-              cmd[4] = gscdcmd.s  rt.frame;s+	cmd_y  pus();o+	iUR	disk_y  pe & (ST_NO_DISK | ST_DOOR_OPEN)) {
+		printk("GSCD:Cno disk or do_SMopen\n");
+		end_requurt(0);
+	} )lse {
+		iUR	disk_y  pe & ST_INVALID) {s+			printk("GSCD:Cdisk invalid\n");n+			end_requurt(0);
+		} )lse {
+			gscd_bn =R-1;	/*CpurgeCour buNf_r */s+			block =RCURRENT->sector / 4;s+			gscd_hsg2msf(block, &gscdcmd.s  rt);	/*CcvtMtoRmsf format */s+n+			cmd[2] = gscdcmd.s  rt.min;s+			cmd[3] = gscdcmd.s  rt.sec;s+			cmd[4] = gscdcmd.s  rt.frame;s 
 #iUdef GSCD_DEBUGs-              printk ("GSCD:CreadRmsf %d:%d:%d\n", cmd[2], cmd[3], cmd[4] ); s-#endiN s-              cmd_out ( TYPE_DATA, (char *)&cmd, (char *)&gscd_buf[0], 1 );n-        s-              gscd_bn =RCURRENT -> sector / 4;s-              gscd_transf_r();n-              end_requurt(1);n-	   }
+			printk("GSCD:CreadRmsf %d:%d:%d\n", cmd[2], cmd[3],
+			       cmd[4]);s+#endiNn+			cmd_out(TYPE_DATA, (char *) &cmd,n+				(char *) &gscd_buf[0], 1);n+s+			gscd_bn =RCURRENT->sector / 4;s+			gscd_transf_r();n+			end_requurt(1);n+		}o 	}s 	SET_TIMER(__do_gscd_requurt, 1);n }
@@ -381,28 +370,27 @@s  * Open theCdevice special fi 
. CCheck that aCdisk is in.s  */sTM-y  pF Tint gscd_open (y ruct inode *ip, s ruct fi 
 *fp)M+y  pF Tint gscd_open(y ruct inode *ip, s ruct fi 
 *fp)M {s-int   st;o+	int st;s 
 #iUdef GSCD_DEBUGs-printk ( "GSCD:Copen\n" );n+	printk("GSCD:Copen\n");
 #endiNn sT	iUR	gscdPresent == 0)s-		retnsi -ENXIO;			/*Cno hardware */s+		retnsi -ENXIO;	/*Cno hardware */s sT	MOD_INC_USE_COUNT;
 s-        get_s  pus ();n-        st =Rdisk_y  pe & (ST_NO_DISK | ST_DOOR_OPEN);n-        iUR	 st )n-        {s-           printk ( "GSCD:Cno disk or do_SMopen\n" );n-           MOD_DEC_USE_COUNT;
-           retnsi -ENXIO;n-        }n-                   s+	get_y  pus();o+	st =Rdisk_y  pe & (ST_NO_DISK | ST_DOOR_OPEN);n+	iUR	st) {
+		printk("GSCD:Cno disk or do_SMopen\n");
+		MOD_DEC_USE_COUNT;
+		retnsi -ENXIO;o+	}s+
 /*	iUR	updateToc() < 0)s 		retnsi -EIO;o */s@@ -415,11 +403,11 @@s  * On close, we flushMall gscd blocks f0xm thecbuNf_r cache.s  */sTM-y  pF Tint gscd_releaseC(y ruct inode * inode, s ruct fi 
 * fi 
)M+y  pF Tint gscd_release(y ruct inode *inode, s ruct fi 
 *fi 
)M {M 
 #iUdef GSCD_DEBUGs-printk ( "GSCD:Crelease\n" );n+	printk("GSCD:Crelease\n");
 #endiNn sT	gscd_bn =R-1;n@@ -429,692 +417,642 @@s }n s s-int get_s  pus (ES <)
+int get_s  pus(ES <)M {s-int  s  pus;o+	int st pus;o+s+	cmd_y  pus();o+	s  pus =Rdisk_y  pe & (ST_x08 | ST_x04 | ST_INVALID | ST_x01);
 s-    cmd_s  pus ();n-    s  pus =Rdisk_y  pe & (ST_x08 | ST_x04 | ST_INVALID | ST_x01);
-     s-    iUR	 st pus ==R(ST_x08 | ST_x04 | ST_INVALID | ST_x01) )
-    {s-       cc_invalidate ();n-       retnsi 1;o-    }s-    )lse
-    {s-       retnsi 0;s-    }M+	iUR	st pus ==R(ST_x08 | ST_x04 | ST_INVALID | ST_x01)) {
+		cc_invalidate();n+		retnsi 1;
+	} )lse {
+		retnsi 0;o+	}M }n s s-ES < cc_invalidate (ES <)M-{M-   drv_num_read  = 0xFF;o-   f_dsk_valid   = 0xFF;o-   current_driveC= 0xFF;o-   f_drv_ok      = 0xFF;o-o-   clear_Audio ();n-   
-}   
-s-ES < clear_Audio (ES <)M-{M-o-   f_AudioPlayC= 0;s-   f_AudioPauseC= 0;s-   AudioStart_mC= 0;s-   AudioStart_fC= 0;s-   AudioEnd_m   = 0;s-   AudioEnd_f   = 0;s-   
+ES < cc_invalidate(ES <)
+{n+	drv_num_read = 0xFF;o+	f_dsk_valid = 0xFF;o+	current_driveC= 0xFF;o+	f_drv_ok = 0xFF;o+n+	clear_Audio();n+s+}
+n+ES < clear_Audio(ES <)
+{n+o+	f_AudioPlayC= 0;s+	f_AudioPauseC= 0;s+	AudioStart_mC= 0;s+	AudioStart_fC= 0;s+	AudioEnd_m = 0;s+	AudioEnd_fC= 0;s+s }n s /*
  *C  waiting ?  s  */sTM-int wait_drv_e ady (ES <)
+int wait_drv_e ady(ES <)M {s-int f und, read;s+	int f und, read;s+n+	do {
+		f undT= inb(GSCDPORT(0));
+		f undT&= 0x0f;n+		readT= inb(GSCDPORT(0));
+		readT&= 0x0f;n+	} whi 
 (readT!= f und);
 s-   dos-   {  s-       f undT= inbR	 GSCDPORT(0) ); s-       f undT&= 0x0f;n-       read  = inbR	 GSCDPORT(0) );n-       read  &= 0x0f;n-   } whi 
 ( readT!= f und );n-   
 #iUdef GSCD_DEBUGs-printk ( "Wait G_S: %d\n", readT);n-#endiN   s-   s-   retnsi read;s+	printk("Wait G_S: %d\n", read);s+#endiNn+s+	retnsi read;s }s s-ES < cc_Ident (char *Ce spons)
+ES < cc_Ident(char *e spons)
 {s-char to_do [] = {CMD_IDENT, 0, 0};M+	char to_do[] = { CMD_IDENT, 0, 0 };
 n-    cmd_out (TYPE_INFO, (char *)&to_do, (char *)e spons,C(int)0x1E );s+	cmd_out(TYPE_INFO, (char *) &to_do, (char *) e spons,C(int) 0x1E);M M }s s-ES < cc_SetSpeedC(ES <)
+ES < cc_SetSpeed(ES <)
 {s-char to_do [] = {CMD_SETSPEED, 0, 0};M-char dummy;
+	char to_do[] = { CMD_SETSPEED, 0, 0 };M+	char dummy;
 s-    iUR	 speedC> 0 )
-    {s-       to_do[1] = speedC& 0x0F;o-       cmd_out (TYPE_INFO, (char *)&to_do, (char *)&dummy, 0);
-    }M+	iUR	speedC> 0) {
+		to_do[1] = speedC& 0x0F;o+		cmd_out(TYPE_INFO, (char *) &to_do, (char *) &dummy, 0);
+	}M }n s s-ES < cc_Reset (ES <)
+ES < cc_Reset(ES <)
 {s-char to_do [] = {CMD_RESET, 0};M-char dummy;
+	char to_do[] = { CMD_RESET, 0 };M+	char dummy;
 s-   cmd_out (TYPE_INFO, (char *)&to_do, (char *)&dummy, 0);
+	cmd_out(TYPE_INFO, (char *) &to_do, (char *) &dummy, 0);
 }s 
 s s-ES < cmd_s  pus (ES <)
+ES < cmd_s  pus(ES <)
 {s-char to_do [] = {CMD_STATUS, 0};M-char dummy;
+	char to_do[] = { CMD_STATUS, 0 };M+	char dummy;
 s-   cmd_out (TYPE_INFO, (char *)&to_do, (char *)&dummy, 0);
+	cmd_out(TYPE_INFO, (char *) &to_do, (char *) &dummy, 0);
 
 #iUdef GSCD_DEBUGs-printk ("GSCD:CS  pus: %d\n", disk_y  pe );n+	printk("GSCD:CS  pus: %d\n", disk_y  pe);
 #endiNn sT}s s-ES < cmd_out ( int cmd_type, char * cmd, char *Ce spo_buf, int e spo_c unt )n+ES < cmd_out(int cmd_type, char *cmd, char *e spo_buf, int e spo_c unt)M {s-int        result;o+	int result;o+n+s+	result = wait_drv_e ady();
+	iUR	result != drv_mode) {
+		unsigned long turt_loops = 0xFFFF;o+		int i, dummy;
 s+		outb(curr_drv_y  pe, GSCDPORT(0));
 n-       result = wait_drv_e ady ();n-       iUR	 result != drv_mode )n-       {s-       unsigned long turt_loops = 0xFFFF;o-       int           i,dummy;
-s-          outb ( curr_drv_y  pe, GSCDPORT(0));
-          s-          /*CLOCLOOP_170 */s-          dos-          {s-             result = wait_drv_e ady ();n-             turt_loops--;o-          } whi 
 ( 	result != drv_mode) && (turt_loops > 0) );
-s-          iUR	 result != drv_mode )n-          {s-             disk_y  pe = ST_x08 | ST_x04 | ST_INVALID;s-             retnsi;s-          }          s-        s-          /*C...and waiting */s-          Gor ( i=1,dummy=1 ; i<0xFFFF ; i++ )n-          {s-             dummy *= i;n-          }              s-       }
-s-       /*CLOC_172 */    s-       /*Ccheck the unit */s-       /* and wake it up */s-       iUR	 cmd_unit_aliveC() != 0x08 )n-       {s-          /*CLOC_174 */s-          /*Cgame ov_r G_SMthis unit */s-          disk_y  pe = ST_x08 | ST_x04 | ST_INVALID;s-          retnsi;s-       }n-       s-       /*CLOC_176 */s-       #iUdef GSCD_DEBUGs-        printk ("LOC_176 ");n-       #endiN       s-       iUR	 drv_mode == 0x09 )n-       {s-          /*Cmagic... */s-          printk ("GSCD:CmagicC...\n");       s-          outb ( result, GSCDPORT(2));
-       }
-s-       /*Cwrite the commandMtoRtheCdriveT*/s-       cmd_write_cmd (cmd);
-s-       /*CLOC_178T*/s-       Gor (;;)n-       {s-          result = wait_drv_e ady ();n-          iUR	 result != drv_mode )n-          {s-             /*CLOC_179 */s-             iUR	 result == 0x04 )                  /*CMode 4 */s-             {n-                /*CLOC_205 */s-                #iUdef GSCD_DEBUGs-                printk ("LOC_205 ");	              s-                #endiNn-                disk_y  pe = inbR	 GSCDPORT (2));
-             s-                dos-                {n-                   result = wait_drv_e ady ();n-                } whi 
 ( result != drv_mode );n-                retnsi;s-n-             }n-             elseo-             {n-                iUR	 result == 0x06 )               /*CMode 6 */s-                {n-                   /*CLOC_181 */s-                   #iUdef GSCD_DEBUGs-                    printk ("LOC_181 ");	              s-                   #endiNn-s-                   iUR	cmd_type == TYPE_DATA)s-                   {s-                      /*Cread data */s-                      /*CLOC_184 */s-                      iUR	 drv_mode == 9 )s-                      {s-                         /*Cread theCdata toRtheCbuNf_r (word) */s- s-                         /*C(*	cmd+1))?(CD_FRAMESIZE/2):(CD_FRAMESIZE_RAW/2) */s-                         cmd_read_w (Ce spo_buf, e spo_c unt, CD_FRAMESIZE/2 );n-                         retnsi;s-                      } s-                      elseo-                      { s-                         /*Cread theCdata toRtheCbuNf_r (byte) */s-                         s-                         /*C(*	cmd+1))?(CD_FRAMESIZE):(CD_FRAMESIZE_RAW)    */s-                         cmd_read_b (Ce spo_buf, e spo_c unt, CD_FRAMESIZE );n-                         retnsi;s-                      }s-                   }s-                   elseo-                   { s-                      /*Cread theCinG_ toRtheCbuNf_r */s-                      cmd_inG__in (Ce spo_buf, e spo_c unt ); s-                      retnsi;s-                   }                  s-n-                   retnsi;s-                }n-             }n-n-          }n-          elseo-          {s-             disk_y  pe = ST_x08 | ST_x04 | ST_INVALID;         s-             retnsi;s-          }    
-       } /*CG_SM(;;) */s+		/*CLOCLOOP_170 */s+		do {
+			result = wait_drv_e ady();
+			turt_loops--;o+		} whi 
 (	result != drv_mode) && (turt_loops > 0));
 s+		iUR	result != drv_mode) {
+			disk_y  pe = ST_x08 | ST_x04 | ST_INVALID;s+			retnsi;
+		}o+s+		/*C...and waiting */s+		Gor (iT= 1, dummyT= 1;Ri < 0xFFFF; i++) {n+			dummy *= i;n+		}
+	}s s+	/*CLOC_172 */s+	/*Ccheck the unit */s+	/*Cand wake it up */s+	iUR	cmd_unit_alive() != 0x08) {n+		/*CLOC_174 */s+		/*Cgame ov_r G_SMthis unit */s+		disk_y  pe = ST_x08 | ST_x04 | ST_INVALID;s+		retnsi;
+	}o+s+	/*CLOC_176 */s #iUdef GSCD_DEBUGs-printk ("\n");       s-#endiN    n+	printk("LOC_176 ");n+#endiNn+	iUR	drv_mode == 0x09) {n+		/*Cmagic... */s+		printk("GSCD:CmagicC...\n");s+		outb(result, GSCDPORT(2));
+	}o+s+	/*Cwrite the commandMtoRtheCdriveT*/s+	cmd_write_cmd(cmd);
+s+	/*CLOC_178T*/s+	G_SM(;;) {
+		result = wait_drv_e ady();
+		iUR	result != drv_mode) {
+			/*CLOC_179 */s+			iUR	result == 0x04) {	/*CMode 4 */s+				/*CLOC_205 */s+#iUdef GSCD_DEBUGs+				printk("LOC_205 ");s+#endiNn+				disk_y  pe = inb(GSCDPORT(2));
+n+				do {
+					result = wait_drv_e ady();
+				} whi 
 (result != drv_mode);
+				retnsi;
+
+			} )lse {
+				iUR	result == 0x06) {	/*CMode 6 */s+					/*CLOC_181 */s+#iUdef GSCD_DEBUGs+					printk("LOC_181 ");s+#endiNn+s+					iUR	cmd_type == TYPE_DATA) {
+						/*Cread data */s+						/*CLOC_184 */s+						iUR	drv_mode == 9) {
+							/*Cread theCdata toRtheCbuNf_r (word) */s+
+							/*C(*	cmd+1))?(CD_FRAMESIZE/2):(CD_FRAMESIZE_RAW/2) */s+							cmd_read_ws+							    (respo_buf,s+							     e spo_c unt,s+							     CD_FRAMESIZE /s+							     2);
+							retnsi;
+						} )lse {
+							/*Cread theCdata toRtheCbuNf_r (byte) */s+
+							/*C(*	cmd+1))?(CD_FRAMESIZE):(CD_FRAMESIZE_RAW)    */s+							cmd_read_bs+							    (respo_buf,s+							     e spo_c unt,s+							     CD_FRAMESIZE);
+							retnsi;
+						}
+					} )lse {
+						/*Cread theCinG_ toRtheCbuNf_r */s+						cmd_inG__in(respo_buf,s+							    e spo_c unt);
+						retnsi;
+					}s+
+					retnsi;
+				}
+			}s+
+		} )lse {
+			disk_y  pe = ST_x08 | ST_x04 | ST_INVALID;s+			retnsi;
+		}o+	}			/*CG_SM(;;) */s+s+n+#iUdef GSCD_DEBUGs+	printk("\n");n+#endiNn+}
+n+M+y  pF TES < cmd_write_cmd(char *pstr)
+{o+	int i, j;
+s+	/*CLOC_177 */s+#iUdef GSCD_DEBUGs+	printk("LOC_177 ");s+#endiNn+s+	/*Ccalculate theCnumber ofMparameter */s+	j = *pstrC& 0x0F;o+s+	/*Cshift it out */s+	G_SM(iT= 0; i < j; i++) {n+		outb(*pstr, GSCDPORT(2));
+		pstr++;o+	}M }n s s-y  pF TES < cmd_write_cmd ( char *pstrC)M+y  pF Tint cmd_unit_alive(ES <)M {s-int  i,j;o+	int result;o+	unsigned long max_turt_loops;o+n+s+	/*CLOC_172 */s+#iUdef GSCD_DEBUGs+	printk("LOC_172 ");s+#endiNn+s+	outb(curr_drv_y  pe, GSCDPORT(0));
+	max_turt_loops = 0xFFFF;o 
-    /*CLOC_177 */s-    #iUdef GSCD_DEBUGs-     printk ("LOC_177 ");       s-    #endiNn-       
-    /*Ccalculate theCnumber ofMparameter */s-    j = *pstrC& 0x0F;o-
-    /*Cshift it out */s-    Gor ( i=0 ; i<j ; i++ )n-    {s-       outb ( *pstr, GSCDPORT(2) );n-       pstr++;o-    }s-}n-n-s-y  pF Tint cmd_unit_aliveC(TES < )M-{M-int            result;o-unsigned long  max_turt_loops;o-o-
-    /*CLOC_172 */s-    #iUdef GSCD_DEBUGs-     printk ("LOC_172 ");       s-    #endiNn-s-    outb ( curr_drv_y  pe, GSCDPORT(0));       s-    max_turt_loops = 0xFFFF;o-     s-    dos-    {n-       result = wait_drv_e ady ();n-       max_turt_loops--;o-    } whi 
 ( 	result != 0x08) && (max_turt_loops > 0) );
-s-    retnsi result;o-}       s-n-M-y  pF TES < cmd_inG__in ( char *pb, int c unt )n-{M-int   result;o-char  read;s-n-n-        /*Cread inG_ */s-        /*CLOC_182 */s-        #iUdef GSCD_DEBUGs-         printk ("LOC_182 ");				              s-        #endiNn-       
-        dos-        {
-           readT= inbR	GSCDPORT(2)); s-           iUR	 c unt > 0 )
-           {s-              *pbT= read;s-              pb++;o-              c unt--;o-           }s-                         s-           /*CLOC_183 */s-           dos-           {s-              result = wait_drv_e ady ();n-           } whi 
 ( result == 0x0E );n-        } whi 
 ( result == 6 );                     s-s-        cmd_end ();n-        retnsi;s-}s-n-M-y  pF TES < cmd_read_b (Cchar *pb, int c unt, int size )n-{M-int  result;o-int  i;s-                     s-                     s-       /*CLOC_188 */s-       /* LOC_189 */s-       #iUdef GSCD_DEBUGs-        printk ("LOC_189 ");			              s-       #endiNn-s-       do n-       {s-          dos-          {s-             result = wait_drv_e ady ();n-          } whi 
 ( result != 6 || result == 0x0E );n-                         s-          iUR	 result != 6 )n-          {s-             cmd_end ();n-             retnsi;s-          }                       s-          s-          #iUdef GSCD_DEBUGs-           printk ("LOC_191 ");       s-          #endiNn-s-          Gor ( i=0 ; i< size ; i++ )n-          {s-             *pbT= inbR	GSCDPORT(2));s-             pb++;o-          }s-          c unt--;o-       } whi 
 ( c unt > 0 );n-       
-       cmd_end ();n-       retnsi;s-}s-n-M-y  pF TES < cmd_end (ES <)M-{M-int   result;o-n-s-      /*CLOC_204 */s-      #iUdef GSCD_DEBUGs-       printk ("LOC_204 ");				              s-      #endiNn-      n-      dos-      {s-         result = wait_drv_e ady ();n-         iUR	 result == drv_mode )n-         {s-            retnsi;n-         }s-      } whi 
 ( result != 4 );
-s-      /*CLOC_205 */s-      #iUdef GSCD_DEBUGs-       printk ("LOC_205 ");			              s-      #endiNn-       
-      disk_y  pe = inbR	 GSCDPORT (2));
-             s-      dos-      {s-         result = wait_drv_e ady ();n-      } whi 
 ( result != drv_mode );n-      retnsi;s-n-}s-n-M-y  pF TES < cmd_read_w (Cchar *pb, int c unt, int size )n-{M-int  result;o-int  i;s-
-s-    #iUdef GSCD_DEBUGs-     printk ("LOC_185 ");			              s-    #endiNn- 
-    do n-    {s-       /* LOC_185 */s-       dos-       {s-          result = wait_drv_e ady ();n-       } whi 
 ( result != 6 || result == 0x0E );n-                         s-       iUR	 result != 6 )n-       {s-          cmd_end ();n-          retnsi;s-       }                       s-                         s-       Gor ( i=0 ; i<size ; i++ )n-       {s-           /*Cna, hier muss ichCnoch mal deueber nachdenken */s-           *pbT= inw	GSCDPORT(2));s-           pb++;o-        }s-        c unt--;o-     } whi 
 ( c unt > 0 );n-                    s-     cmd_end ();n-     retnsi;s-}s-n-int __init find_drives (ES <)M-{M-int *pdrv;o-int drvnum;o-int subdrv;o-int i;
-s-    speedC         C= 0;s-    pdrv            = (int *)&drv_y  pes;n-    curr_drv_y  pe  = 0xFE;n-    subdrv         C= 0;s-    drvnum         C= 0;s-s-    Gor ( i=0 ; i<8 ; i++ )n-    { s-       subdrv++;o-       cmd_s  pus ();n-       disk_y  pe &= ST_x08 | ST_x04 | ST_INVALID | ST_x01;n-       iUR	 disk_y  pe !=R(ST_x08 | ST_x04 | ST_INVALID) )n-       {s-          /*CLOC_240 */s-          *pdrv = curr_drv_y  pe;M-          init_cd_driveC(drvnum);n-          pdrv++;o-          drvnum++;o-       }s-       elseo-       {s-          iUR	 subdrv < 2 )n-          {s-             continue;n-          }n-          elseo-          {s-             subdrv = 0;s-          }n-       }   n+	do {
+		result = wait_drv_e ady();
+		max_turt_loops--;o+	} whi 
 (	result != 0x08) && (max_turt_loops > 0));
+n+	retnsi result;o+}sTM-/*C      curr_drv_y  pe<<1;         <--Rdas geht irgendwie nichtC*/ s+M+y  pF TES < cmd_inG__in(char *pb, int c unt)
+{o+	int result;o+	char read;s+n+s+	/*Cread inG_ */s+	/*CLOC_182 */s+#iUdef GSCD_DEBUGs+	printk("LOC_182 ");s+#endiNn+s+	do {
+		readT= inb(GSCDPORT(2));
+		iUR	c unt > 0) {
+			*pbT= read;s+			pb++;o+			c unt--;o+		}o+s+		/*CLOC_183 */s+		do {
+			result = wait_drv_e ady();
+		} whi 
 (result == 0x0E);n+	} whi 
 (result == 6);o+s+	cmd_end();
+	retnsi;n+}
+n+M+y  pF TES < cmd_read_b(char *pb, int c unt, int size)
+{o+	int result;o+	int i;n+n+s+	/*CLOC_188 */s+	/*CLOC_189 */s+#iUdef GSCD_DEBUGs+	printk("LOC_189 ");s+#endiNn+s+	do {
+		do {
+			result = wait_drv_e ady();
+		} whi 
 (result != 6 || result == 0x0E);
+n+		iUR	result != 6) {n+			cmd_end();
+			retnsi;
+		}o+#iUdef GSCD_DEBUGs+		printk("LOC_191 ");s+#endiNn+s+		G_SM(iT= 0; i < size; i++) {n+			*pbT= inb(GSCDPORT(2));
+			pb++;o+		}
+		c unt--;o+	} whi 
 (c unt > 0);o+s+	cmd_end();
+	retnsi;n+}
+n+M+y  pF TES < cmd_end(ES <)
+{o+	int result;o+n+s+	/*CLOC_204 */s+#iUdef GSCD_DEBUGs+	printk("LOC_204 ");s+#endiNn+s+	do {
+		result = wait_drv_e ady();
+		iUR	result == drv_mode) {
+			retnsi;
+		}o+	} whi 
 (result != 4);
+s+	/*CLOC_205 */s+#iUdef GSCD_DEBUGs+	printk("LOC_205 ");s+#endiNn+s+	disk_y  pe = inb(GSCDPORT(2));
+n+	do {
+		result = wait_drv_e ady();
+	} whi 
 (result != drv_mode);
+	retnsi;
+
+}
+n+M+y  pF TES < cmd_read_w(char *pb, int c unt, int size)
+{o+	int result;o+	int i;n+n+s+#iUdef GSCD_DEBUGs+	printk("LOC_185 ");s+#endiNn+s+	do {
+		/* LOC_185 */s+		do {
+			result = wait_drv_e ady();
+		} whi 
 (result != 6 || result == 0x0E);
+n+		iUR	result != 6) {n+			cmd_end();
+			retnsi;
+		}o+s+		G_SM(iT= 0; i < size; i++) {n+			/*Cna, hier muss ichCnoch mal deueber nachdenken */s+			*pbT= inw(GSCDPORT(2));
+			pb++;o+		}
+		c unt--;o+	} whi 
 (c unt > 0);o+s+	cmd_end();
+	retnsi;n+}
+n+int __init find_drives(ES <)
+{o+	int *pdrv;o+	int drvnum;o+	int subdrv;o+	int i;n+n+	speedC= 0;s+	pdrv = (int *) &drv_y  pes;n+	curr_drv_y  pe = 0xFE;n+	subdrv = 0;s+	drvnum = 0;s+s+	G_SM(iT= 0; i < 8; i++) {n+		subdrv++;o+		cmd_s  pus();n+		disk_y  pe &= ST_x08 | ST_x04 | ST_INVALID | ST_x01;n+		iUR	disk_y  pe !=R(ST_x08 | ST_x04 | ST_INVALID)) {
+			/*CLOC_240 */s+			*pdrv = curr_drv_y  pe;M+			init_cd_drive(drvnum);n+			pdrv++;o+			drvnum++;o+		} )lse {
+			iUR	subdrv < 2) {
+				continue;n+			} )lse {
+				subdrv = 0;s+			}
+		}
+n+/*C      curr_drv_y  pe<<1;         <--Rdas geht irgendwie nichtC*/
 /*Cmuss heissen:    curr_drv_y  pe <<= 1;R(ist ja Wert-Zuweisung) */s-         curr_drv_y  pe *= 2;s-         curr_drv_y  pe |= 1;n+		curr_drv_y  pe *= 2;s+		curr_drv_y  pe |= 1;n #iUdef GSCD_DEBUGs-         printk ("DriveS  pe: %d\n", curr_drv_y  pe );
+		printk("DriveS  pe: %d\n", curr_drv_y  pe);
 #endiNn-    } 
+	}s s-    ndrives = drvnum;o-    retnsi drvnum;o-}    n+	ndrives = drvnum;o+	retnsi drvnum;o+}s s-ES < __init init_cd_driveC( int num )n+ES < __init init_cd_drive(int num)
 {s-char e sp [50];M-int  i;s+	char resp[50];M+	int i;n s-   printk ("GSCD:Cinit unit %d\n", num );o-   cc_Ident ((char *)&resp);n+	printk("GSCD:Cinit unit %d\n", num);
+	cc_Ident((char *) &resp);n s-   printk ("GSCD:Cidentificatt *: ");n-   Gor ( i=0 ; i<0x1E; i++ )n-   {s-      printk ( "%c", e sp[i] );s-   }M-   printk ("\n");n-   o-   cc_SetSpeedC();  n+	printk("GSCD:Cidentificatt *: ");n+	G_SM(iT= 0; i < 0x1E; i++) {
+		printk("%c", e sp[i]);
+	}o+	printk("\n");n o-}    n+	cc_SetSpeed();n+s+}
 s #iUdef FUTURE_WORK
 /*Cretnsi_done */s-y  pF TES < update_y  pe (TES < )M+y  pF TES < update_y  pe(ES <)
 {M-unsigned int AX;M+	unsigned int AX;M+n+s+	iUR	(disk_y  pe & (ST_x08 | ST_x04 | ST_INVALID | ST_x01))C== 0) {n+		iUR	disk_y  pe ==R(ST_x08 | ST_x04 | ST_INVALID)) {
+			AX = ST_INVALID;s+		}
+n+		iUR	(disk_y  pe & (ST_x08 | ST_x04 | ST_INVALID | ST_x01))n+		    == 0) {n+			invalidate();n+			f_drv_ok = 0;s+		}
+n+		AX |= 0x8000;
+	}o+s+	iUR	disk_y  pe & ST_PLAYING) {n+		AX |= 0x200;
+	}o n+	AX |= 0x100;
+	/*Cpkt_esbx = AX; */sTM-    iUR	 (disk_y  pe & (ST_x08 | ST_x04 | ST_INVALID | ST_x01))C== 0 )n-    {s-       iUR	 disk_y  pe ==R(ST_x08 | ST_x04 | ST_INVALID))o-       {s-          AX = ST_INVALID;s-       }s-  s-       iUR	 (disk_y  pe & (ST_x08 | ST_x04 | ST_INVALID | ST_x01))C== 0 )n-       {s-          invalidate ();n-          f_drv_ok = 0;s-       }n-       s-       AX |= 0x8000;
-    }s-    M-    iUR	 disk_y  pe & ST_PLAYING )n-    {s-       AX |= 0x200;
-    }s-    M-    AX |= 0x100;
-    /*Cpkt_esbx = AX; */s+	disk_y  pe = 0;
 s-    disk_y  pe = 0;
-    M }n #endiNn sT/*CInit G_S theCModule-Verst * */s int init_gscd(ES <)
 {M-long err;s+	long err;s s s-     /*Ccall theCGoldStar-init */s-     err = my_gscd_init ( );
+	/*Ccall theCGoldStar-init */s+	err = my_gscd_init();
 n-     iUR	 err < 0 )n-     {s-         retnsi err;s-     }n-     elseo-     {s-        printk (KERN_INFO "HappyCGoldStar !\n" );n-        retnsi 0;s-     }    n+	iUR	err < 0) {
+		retnsi err;s+	} )lse {
+		printk(KERN_INFO "HappyCGoldStar !\n");n+		retnsi 0;o+	}M }n s ES < __exit exit_gscd(ES <)
 {M-   CLEAR_TIMER;o+	CLEAR_TIMER;o s-   devfs_unregister(devfs_find_handle(NULL, "gscd", 0, 0, DEVFS_SPECIAL_BLK,o-				      0));
-   iUR	(devfs_unregister_blkdev(MAJOR_NR, "gscd" )C== -EINVAL))s-   {s-      printk("What's that: can't unregisterCGoldStar-module\n" );n-      retnsi;s-   }n-   blk_cleanup_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR));
-   release_regi * (gscd_port,4);
-   printk(KERN_INFO "GoldStar-module released.\n" );n+	devfs_unregister(devfs_find_handle
+			 (NULL, "gscd", 0, 0, DEVFS_SPECIAL_BLK, 0));
+	iUR	(devfs_unregister_blkdev(MAJOR_NR, "gscd")C== -EINVAL)) {
+		printk("What's that: can't unregisterCGoldStar-module\n");s+		retnsi;
+	}o+	blk_cleanup_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR));
+	release_regi *(gscd_port, 4);
+	printk(KERN_INFO "GoldStar-module released.\n");
 }s 
 #iUdef MODULE
 module_init(init_gscd);n-#endiN n+#endiNn module_exit(exit_gscd);M M s /*CTurt f_S presence ofMdriveCandMinitialize it.  Called on y at boot time. */s-int __init gscd_init (ES <)n+int __init gscd_init(ES <)
 {M-   retnsi my_gscd_init ();
+	retnsi my_gscd_init();
 }M M s /*CThis is the comm * initialisatt * G_S theCGoldStar drive.C*/
 /*CIt is called at boot time AND G_S module init.           */s-int __init my_gscd_init (ES <)n+int __init my_gscd_init(ES <)M {s-int i;M-int result;o+	int i;n+	int result;o s-        printk (KERN_INFO "GSCD:Cverst * %s\n", GSCD_VERSION);n-        printk (KERN_INFO "GSCD:CTrying to detect aCGolds  r R420 CD-ROM driveCat 0x%X.\n", gscd_port);
-s-        iUR	check_regi *(gscd_port, 4)) s-        {
-	  printk("GSCD:CInit Gailed, I/O port (%X) ale ady in use.\n", gscd_port);
-	  retnsi -EIO;
+	printk(KERN_INFO "GSCD:Cverst * %s\n", GSCD_VERSION);n+	printk(KERN_INFOn+	       "GSCD:CTrying to detect aCGolds  r R420 CD-ROM driveCat 0x%X.\n",n+	       gscd_port);
+s+	iUR	check_regi *(gscd_port, 4)) {
+		printks+		    ("GSCD:CInit Gailed, I/O port (%X) ale ady in use.\n",n+		     gscd_port);
+		retnsi -EIO;o 	}s-	  n+s 
 	/*Ccheck G_S card */s-	result = wait_drv_e ady ();n-        iUR	 result == 0x09 )n-        {s-           printk ("GSCD:CDMA kann ichCnoch nicht!\n" );n-           retnsi -EIO;o-        }s- n-        iUR	 result == 0x0b )n-        {s-           drv_mode = result;o-           i = find_drives ();n-           iUR	 iC== 0 )n-           {s-              printk ( "GSCD:CGoldStar CD-ROM Drive is notRf und.\n" );n-              retnsi -EIO;o-           }n-        }
-s-        iUR	 	result != 0x0b) && (result != 0x09) )n-        {s-              printk ("GSCD:CGoldStar Interface AdapterCdoes notRexirt _S H/W error\n" );n-              retnsi -EIO;o-        }          		            n-n-        /*Creset all drives */s-        i = 0;s-        whi 
 ( drv_y  pes[i] != 0 )n-        {s-           curr_drv_y  pe = drv_y  pes[i];s-           printk (KERN_INFO "GSCD:CReset unit %dC... ",i );n-           cc_Reset ();s-           printk ( "done\n" );n-           i++;o-        }s-s-	iUR	devfs_register_blkdev(MAJOR_NR, "gscd", &gscd_fops) != 0)s-	{s-		printk("GSCD:CUnab 
Mto get maj_S %dCG_S GoldStar CD-ROM\n",n-		       MAJOR_NR);s+	result = wait_drv_e ady();
+	iUR	result == 0x09) {n+		printk("GSCD:CDMA kann ichCnoch nicht!\n");
 		retnsi -EIO;o 	}s-	devfs_register (NULL, "gscd", DEVFS_FL_DEFAULT, MAJOR_NR, 0,o-			S_IFBLK | S_IRUGO | S_IWUGO, &gscd_fops, NULL);
+s+	iUR	result == 0x0b) {n+		drv_mode = result;o+		i = find_drives();
+		iUR	i == 0) {n+			printks+			    ("GSCD:CGoldStar CD-ROM Drive is notRf und.\n");
+			retnsi -EIO;
+		}
+	}s+s+	iUR	(result != 0x0b) && (result != 0x09)) {
+		printks+		    ("GSCD:CGoldStar Interface AdapterCdoes notRexirt _S H/W error\n");
+		retnsi -EIO;o+	}o+s+	/*Creset all drives */s+	i = 0;s+	whi 
 (drv_y  pes[i] != 0) {
+		curr_drv_y  pe = drv_y  pes[i];s+		printk(KERN_INFO "GSCD:CReset unit %dC... ", i);
+		cc_Reset();
+		printk("done\n");
+		i++;o+	}M+s+	iUR	devfs_register_blkdev(MAJOR_NR, "gscd", &gscd_fops) != 0) {
+		printks+		    ("GSCD:CUnab 
Mto get maj_S %dCG_S GoldStar CD-ROM\n",n+		     MAJOR_NR);s+		retnsi -EIO;o+	}o+	devfs_register(NULL, "gscd", DEVFS_FL_DEFAULT, MAJOR_NR, 0,o+		       S_IFBLK | S_IRUGO | S_IWUGO, &gscd_fops, NULL);
 s 	blk_init_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
 	blksize_size[MAJOR_NR] = gscd_blocksizes;s 	read_ahead[MAJOR_NR] = 4;n-        s-        disk_y  pe = 0;
-        gscdPresent = 1;n+s+	disk_y  pe = 0;
+	gscdPresent = 1;n s 	requurt_regi *(gscd_port, 4, "gscd");s-	register_disk(NULL, MKDEV(MAJOR_NR,0), 1, &gscd_fops, 0);s+	register_disk(NULL, MKDEV(MAJOR_NR, 0), 1, &gscd_fops, 0);s s-        printk (KERN_INFO "GSCD:CGoldStar CD-ROM Drive f und.\n" );n+	printk(KERN_INFO "GSCD:CGoldStar CD-ROM Drive f und.\n");s 	retnsi 0;
 }n s-y  pF TES < gscd_hsg2msf (long hsg, s ruct msf *msf)
+y  pF TES < gscd_hsg2msf(long hsg, s ruct msf *msf)
 {M 	hsg += CD_MSF_OFFSET;
-	msf -> min =Rhsg / (CD_FRAMES*CD_SECS);s-	hsg %= CD_FRAMES*CD_SECS;
-	msf -> sec =Rhsg / CD_FRAMES;
-	msf -> frame =Rhsg % CD_FRAMES;
+	msf->min =Rhsg / (CD_FRAMES * CD_SECS);s+	hsg %= CD_FRAMES * CD_SECS;
+	msf->sec =Rhsg / CD_FRAMES;
+	msf->frame =Rhsg % CD_FRAMES;
 s-	gscd_bin2bcd(&msf -> min);		/*CconvertMtoRBCD */s-	gscd_bin2bcd(&msf -> sec);s-	gscd_bin2bcd(&msf -> frame);
+	gscd_bin2bcd(&msf->min);	/*CconvertMtoRBCD */s+	gscd_bin2bcd(&msf->sec);s+	gscd_bin2bcd(&msf->frame);
 }s- n s-y  pF TES < gscd_bin2bcd (unsigned char *p)n+M+y  pF TES < gscd_bin2bcd(unsigned char *p)n {s-int u, t;o+	int u, t;o s 	u = *p % 10;
 	t = *p / 10;
@@ -1123,18 +1061,19 @@s 
 s #iUdef FUTURE_WORK
-y  pF Tlong gscd_msf2hsg (s ruct msf *mp)M+y  pF Tlong gscd_msf2hsg(s ruct msf *mp)M {
-	retnsi gscd_bcd2bin(mp -> frame)o-		+ gscd_bcd2bin(mp -> sec) * CD_FRAMESo-		+ gscd_bcd2bin(mp -> min) * CD_FRAMES * CD_SECSo-		- CD_MSF_OFFSET;
+	retnsi gscd_bcd2bin(mp->frame)n+	    + gscd_bcd2bin(mp->sec) * CD_FRAMESo+	    + gscd_bcd2bin(mp->min) * CD_FRAMES * CD_SECS - CD_MSF_OFFSET;
 }n s-y  pF Tint gscd_bcd2bin (unsigned char bcd)M+y  pF Tint gscd_bcd2bin(unsigned char bcd)M {M 	retnsi (bcd >> 4) * 10 + (bcd & 0xF);
 }M #endiNn s-
+MODULE_AUTHOR("Oliver Raupach <raupach@nwfs1.rz.fh-hannov_r.de>");
+MODULE_LICENSE("GPL");
+EXPORT_NO_SYMBOLS;
diNf -u --recursive --new-fi 
 v2.4.9/linux/drivers/cdrom/isp16. Tlinux/drivers/cdrom/isp16. 
--- v2.4.9/linux/drivers/cdrom/isp16. 	Mon Dec 13 14:08:40 1999
+++Tlinux/drivers/cdrom/isp16. 	Fri Sep  7 09:28:38 2001n@@ -44,9 +44,7 @@s #define ISP16_VERSION_MAJOR 0s #define ISP16_VERSION_MINOR 6n s-#iUdef MODULE
 #include <linux/module.h>s-#endiN  /*CMODULE */s sT#include <linux/fs.h>sT#include <linux/kernel.h>s@@ -59,8 +57,9 @@s y  pF Tshort isp16_detect(ES <);s y  pF Tshort isp16_c928__detect(ES <);s y  pF Tshort isp16_c929__detect(ES <);s-y  pF Tshort isp16_cdi_config(int base, u_char drive_type, int irq, int dma);s-y  pF Tshort isp16_type; /*Cdependent on type of interface card */s+y  pF Tshort isp16_cdi_config(int base, u_char drive_type, int irq,
+			      int dma);s+y  pF Tshort isp16_type;	/*Cdependent on type of interface card */s y  pF Tu_char isp16_ctrl;s y  pF Tu_short isp16_enab 
_port;n s@@ -69,11 +68,12 @@s y  pF Tint isp16_cdrom_dma = ISP16_CDROM_DMA;s y  pF Tchar *isp16_cdrom_type = ISP16_CDROM_TYPE;n s-#iUdef MODULE
 MODULE_PARM(isp16_cdrom_base, "i");s MODULE_PARM(isp16_cdrom_irq, "i");s MODULE_PARM(isp16_cdrom_dma, "i");s MODULE_PARM(isp16_cdrom_type, "s");
+s+#iUdef MODULE
 ES < isp16_exit(ES <);s #endiNn s@@ -82,243 +82,279 @@s 
 #iUndef MODULE
 s-y  pF Tint M+y  pF Tint
 __init isp16_setup(char *str)
 {s-  int ints[4];s-  s-  (ES <)get_optt *s(str, ARRAY_SIZE(ints), ints);n-  iUR	 ints[0] > 0 )
-    isp16_cdrom_baseT= ints[1];n-  iUR	 ints[0] > 1 )      
-    isp16_cdrom_irqT= ints[2];n-  iUR	 ints[0] > 2 )      
-    isp16_cdrom_dma = ints[3];n-  iUR	 strC)M-    isp16_cdrom_type = str;o+	int ints[4];s 
-  retnsi 1;
+	(ES <) get_optt *s(str, ARRAY_SIZE(ints), ints);n+	iUR	ints[0] > 0)n+		isp16_cdrom_baseT= ints[1];n+	iUR	ints[0] > 1)n+		isp16_cdrom_irqT= ints[2];n+	iUR	ints[0] > 2)n+		isp16_cdrom_dma = ints[3];n+	iUR	str)n+		isp16_cdrom_type = str;o+
+	retnsi 1;
 }M M __setup("isp16=", isp16_setup);s s-#endiN /*CMODULE */s+#endiN				/*CMODULE */s sT/*
  *C ISP16 initialisatt *.s  *
  */s-int __init s-isp16_init(ES <)M+int __init isp16_init(ES <)M {s-  u_char expected_drive;
-s-  printk(KERN_INFO "ISP16: configuratt * cdrom interface,Cverst * %d.%d.\n", ISP16_VERSION_MAJOR,M-    ISP16_VERSION_MINOR);n+	u_char expected_drive;
 n-  iUR	 !strcmp(isp16_cdrom_type, "noisp16") ) {s-    printk("ISP16: no cdrom interface configured.\n");
-    retnsi(0);n-  }
-s-  iUR	check_regi *(ISP16_IO_BASE, ISP16_IO_SIZE)) {s-    printk("ISP16: i/o ports ale ady in use.\n");
-    retnsi(-EIO);n-  }
-s-  iUR	 (isp16_type=isp16_detect()) < 0 ) {s-    printk("ISP16: no cdrom interface f und.\n");s-    retnsi(-EIO);n-  }
-s-  printk(KERN_INFO "ISP16: cdrom interface (with OPTi 82C92%d chip) detected.\n",M-    (isp16_type==2) ? 9 : 8);
-s-  iUR	 !strcmp(isp16_cdrom_type, "Sanyo") )n-    expected_drive = (isp16_type ? ISP16_SANYO1 : ISP16_SANYO0);n-  )lse iUR	 !strcmp(isp16_cdrom_type, "Sony") )n-    expected_drive = ISP16_SONY;n-  )lse iUR	 !strcmp(isp16_cdrom_type, "Panasonic") )n-    expected_drive = (isp16_type ? ISP16_PANASONIC1 : ISP16_PANASONIC0);n-  )lse iUR	 !strcmp(isp16_cdrom_type, "Mitsumi") )n-    expected_drive = ISP16_MITSUMI;n-  )lse {s-    printk("ISP16: %s notRsupported by cdrom interface.\n", isp16_cdrom_type);
-    retnsi(-EIO);n-  }
-s-  iUR	 isp16_cdi_config(isp16_cdrom_base, expected_drive,
-    isp16_cdrom_irq, isp16_cdrom_dma ) < 0) {
-    printk("ISP16: cdrom interface has notRbeen properly configured.\n");
-    retnsi(-EIO);n-  }
-  printk(KERN_INFO "ISP16: cdrom interface set up with io base 0x%03X, irq %d, dma %d,"
-    " type %s.\n", isp16_cdrom_base, isp16_cdrom_irq, isp16_cdrom_dma,M-    isp16_cdrom_type);n-  retnsi(0);n+	printk(KERN_INFOn+	       "ISP16: configuratt * cdrom interface,Cverst * %d.%d.\n",n+	       ISP16_VERSION_MAJOR, ISP16_VERSION_MINOR);n+n+	iUR	!strcmp(isp16_cdrom_type, "noisp16")) {n+		printk("ISP16: no cdrom interface configured.\n");
+		retnsi (0);
+	}
+s+	iUR	check_regi *(ISP16_IO_BASE, ISP16_IO_SIZE)) {s+		printk("ISP16: i/o ports ale ady in use.\n");
+		retnsi (-EIO);n+	}s+s+	iUR	(isp16_type = isp16_detect()) < 0) {n+		printk("ISP16: no cdrom interface f und.\n");
+		retnsi (-EIO);n+	}s+s+	printk(KERN_INFOn+	       "ISP16: cdrom interface (with OPTi 82C92%d chip) detected.\n",M+	       (isp16_type == 2) ? 9 : 8);
+n+	iUR	!strcmp(isp16_cdrom_type, "Sanyo"))n+		expected_drive =s+		    (isp16_type ? ISP16_SANYO1 : ISP16_SANYO0);n+	)lse iUR	!strcmp(isp16_cdrom_type, "Sony"))n+		expected_drive = ISP16_SONY;n+	)lse iUR	!strcmp(isp16_cdrom_type, "Panasonic"))n+		expected_drive =s+		    (isp16_type ? ISP16_PANASONIC1 : ISP16_PANASONIC0);n+	)lse iUR	!strcmp(isp16_cdrom_type, "Mitsumi"))n+		expected_drive = ISP16_MITSUMI;n+	)lse {n+		printk("ISP16: %s notRsupported by cdrom interface.\n",o+		       isp16_cdrom_type);n+		retnsi (-EIO);n+	}s+s+	iUR	isp16_cdi_config(isp16_cdrom_base, expected_drive,
+			     isp16_cdrom_irq, isp16_cdrom_dma) < 0) {n+		printks+		    ("ISP16: cdrom interface has notRbeen properly configured.\n");
+		retnsi (-EIO);n+	}s+	printk(KERN_INFOn+	       "ISP16: cdrom interface set up with io base 0x%03X, irq %d, dma %d,"
+	       " type %s.\n", isp16_cdrom_base, isp16_cdrom_irq,
+	       isp16_cdrom_dma, isp16_cdrom_type);n+	retnsi (0);
 }n s-y  pF Tshort __init s-isp16_detect(ES <)s+y  pF Tshort __init isp16_detect(ES <)s {M 
-  iUR	 isp16_c929__detect() >= 0 )n-    retnsi(2);n-  )lsen-    retnsi(isp16_c928__detect());
+	iUR	isp16_c929__detect() >= 0)
+		retnsi (2);n+	)lse
+		retnsi (isp16_c928__detect());
 }n s-y  pF Tshort __init s-isp16_c928__detect(ES <)s+y  pF Tshort __init isp16_c928__detect(ES <)s {s-  u_char ctrl;s-  u_char enab 
_cdrom;s-  u_char io;s-  short i =R-1;n-s-  isp16_ctrl = ISP16_C928__CTRL;s-  isp16_enab 
_port = ISP16_C928__ENABLE_PORT;n-s-  /*Cread'Cand write'Care a specialCread and write, e spectively */s-s-  /*Cread'CISP16_CTRL_PORT, clear last two bits and write'Cback the result */s-  ctrl = ISP16_IN(CISP16_CTRL_PORT ) & 0xFC;s-  ISP16_OUT(CISP16_CTRL_PORT, ctrl );n-s-  /*Cread'C3,4 and 5-bit G0xm theccdrom enab 
 port */s-  enab 
_cdrom = ISP16_IN(CISP16_C928__ENABLE_PORT ) & 0x38;
-s-  iUR	 !(enab 
_cdrom & 0x20) ) {  /*C5-bit notRset */s-    /*Cread'Clast 2 bits of ISP16_IO_SET_PORT */s-    io = ISP16_IN(CISP16_IO_SET_PORT ) & 0x03;M-    iUR	 ((io&0x01)<<1)C== (io&0x02) ) {  /*Cbits are theCsame */s-      iUR	 ioC== 0 ) {  /*C...theCsame and 0 */s-        i = 0;s-        enab 
_cdrom |= 0x20;n-      }n-      )lse {  /*C...theCsame and 1 */  /*Cmy card, first time 'r und */s-        i = 1;s-        enab 
_cdrom |= 0x28;n-      }n-      ISP16_OUT(CISP16_C928__ENABLE_PORT, enab 
_cdrom );o-    }s-    )lse {  /*Cbits are notRtheCsame */s-      ISP16_OUT(CISP16_CTRL_PORT, ctrl );n-      retnsi(i); /*C-> notRdetected: possibly incorrect conclust * */s-    }s-  }n-  )lse iUR	 enab 
_cdrom == 0x20C)M-    i = 0;s-  )lse iUR	 enab 
_cdrom == 0x28 )  /*Cmy card, ale ady initialised */s-    i = 1;s+	u_char ctrl;s+	u_char enab 
_cdrom;s+	u_char io;s+	short i =R-1;n+s+	isp16_ctrl = ISP16_C928__CTRL;s+	isp16_enab 
_port = ISP16_C928__ENABLE_PORT;n+s+	/*Cread'Cand write'Care a specialCread and write, e spectively */s+s+	/*Cread'CISP16_CTRL_PORT, clear last two bits and write'Cback the result */s+	ctrl = ISP16_IN(ISP16_CTRL_PORT) & 0xFC;s+	ISP16_OUT(ISP16_CTRL_PORT, ctrl);n+s+	/*Cread'C3,4 and 5-bit G0xm theccdrom enab 
 port */s+	)nab 
_cdrom = ISP16_IN(ISP16_C928__ENABLE_PORT) & 0x38;
+n+	iUR	!(enab 
_cdrom & 0x20)) {	/*C5-bit notRset */s+		/*Cread'Clast 2 bits of ISP16_IO_SET_PORT */s+		io = ISP16_IN(ISP16_IO_SET_PORT) & 0x03;M+		iUR	((io & 0x01)C<< 1)C== (io & 0x02)) {	/*Cbits are theCsame */s+			iUR	ioC== 0) {	/*C...theCsame and 0 */s+				i = 0;s+				enab 
_cdrom |= 0x20;n+			} )lse {	/*C...theCsame and 1 *//*Cmy card, first time 'r und */s+				i = 1;s+				enab 
_cdrom |= 0x28;s+			}
+			ISP16_OUT(ISP16_C928__ENABLE_PORT, enab 
_cdrom);o+		} )lse {	/*Cbits are notRtheCsame */s+			ISP16_OUT(ISP16_CTRL_PORT, ctrl);n+			retnsi (i);	/*C-> notRdetected: possibly incorrect conclust * */s+		}o+	} )lse iUR	enab 
_cdrom == 0x20)o+		i = 0;n+	)lse iUR	enab 
_cdrom == 0x28)	/*Cmy card, ale ady initialised */s+		i = 1;s s-  ISP16_OUT(CISP16_CTRL_PORT, ctrl );n+	ISP16_OUT(ISP16_CTRL_PORT, ctrl);n 
-  retnsi(i);n+	retnsi (i);
 }n s-y  pF Tshort __init s-isp16_c929__detect(ES <)s+y  pF Tshort __init isp16_c929__detect(ES <)s {s-  u_char ctrl;s-  u_char tmp;s+	u_char ctrl;s+	u_char tmp;s s-  isp16_ctrl = ISP16_C929__CTRL;s-  isp16_enab 
_port = ISP16_C929__ENABLE_PORT;n+	isp16_ctrl = ISP16_C929__CTRL;s+	isp16_enab 
_port = ISP16_C929__ENABLE_PORT;n s-  /*Cread'Cand write'Care a specialCread and write, e spectively */s+	/*Cread'Cand write'Care a specialCread and write, e spectively */s s-  /*Cread'CISP16_CTRL_PORT and saveT*/s-  ctrl = ISP16_IN(CISP16_CTRL_PORT );s+	/*Cread'CISP16_CTRL_PORT and saveT*/s+	ctrl = ISP16_IN(ISP16_CTRL_PORT);n s-  /*Cwrite'Czer_ toRtheCctrl port and get e sponseT*/s-  ISP16_OUT(CISP16_CTRL_PORT, 0 );n-  tmp = ISP16_IN(CISP16_CTRL_PORT );s+	/*Cwrite'Czer_ toRtheCctrl port and get e sponseT*/s+	ISP16_OUT(ISP16_CTRL_PORT, 0);n+	tmp = ISP16_IN(ISP16_CTRL_PORT);n s-  iUR	 tmp != 2 )  /*Cisp16 with 82C929 notRdetected */s-    retnsi(-1);
+	iUR	tmp != 2)		/*Cisp16 with 82C929 notRdetected */s+		retnsi (-1);n s-  /*CrestoreCctrl port valueT*/s-  ISP16_OUT(CISP16_CTRL_PORT, ctrl );n-  
-  retnsi(2);s+	/*CrestoreCctrl port valueT*/s+	ISP16_OUT(ISP16_CTRL_PORT, ctrl);n+s+	retnsi (2);n }n s-y  pF Tshort __init s+y  pF Tshort __init
 isp16_cdi_config(int base, u_char drive_type, int irq, int dma)s {s-  u_char base_code;s-  u_char irq_code;s-  u_char dma_code;s-  u_char i;
-s-  iUR	 (drive_type == ISP16_MITSUMI) && (dma != 0) )
-    printk("ISP16: Mitsumiccdrom drive has no dma support.\n");
-s-  switch (base) {
-  case 0x340: base_code = ISP16_BASE_340; break;
-  case 0x330: base_code = ISP16_BASE_330; break;
-  case 0x360: base_code = ISP16_BASE_360; break;
-  case 0x320: base_code = ISP16_BASE_320; break;
-  default:
-    printk("ISP16: base address 0x%03X notRsupported by cdrom interface.\n",o-      base);s-    retnsi(-1);
-  }n-  switch (irq) {
-  case 0: irq_code = ISP16_IRQ_X; break; /*Cdisab 
 irq */s-  case 5: irq_code = ISP16_IRQ_5;s-          printk("ISP16: irq 5Tshouldn't be used by cdrom interface,"
-            " du
Mto possible conflicts with theCs und card.\n");
-          break;
-  case 7: irq_code = ISP16_IRQ_7;s-          printk("ISP16: irq 7Tshouldn't be used by cdrom interface,"
-            " du
Mto possible conflicts with theCs und card.\n");
-          break;
-  case 3: irq_code = ISP16_IRQ_3; break;
-  case 9: irq_code = ISP16_IRQ_9; break;
-  case 10: irq_code = ISP16_IRQ_10; break;
-  case 11: irq_code = ISP16_IRQ_11; break;
-  default:
-    printk("ISP16: irq %d notRsupported by cdrom interface.\n", irq );s-    retnsi(-1);
-  }n-  switch (dma) {
-  case 0: dma_code = ISP16_DMA_X; break;  /*Cdisab 
 dma */s-  case 1: printk("ISP16: dma 1 cannotRbe used by cdrom interface,"
-            " du
Mto conflict with theCs und card.\n");
-          retnsi(-1); break;
-  case 3: dma_code = ISP16_DMA_3; break;
-  case 5: dma_code = ISP16_DMA_5; break;
-  case 6: dma_code = ISP16_DMA_6; break;
-  case 7: dma_code = ISP16_DMA_7; break;
-  default:
-    printk("ISP16: dma %d notRsupported by cdrom interface.\n", dma);s-    retnsi(-1);
-  }n-s-  iUR	 drive_type != ISP16_SONY && drive_type != ISP16_PANASONIC0 &&s-    drive_type != ISP16_PANASONIC1 && drive_type != ISP16_SANYO0 &&s-    drive_type != ISP16_SANYO1 && drive_type != ISP16_MITSUMI &&s-    drive_type != ISP16_DRIVE_X ) {s-    printk("ISP16: drive type (code 0x%02X) notRsupported by cdrom"
-     " interface.\n", drive_type );s-    retnsi(-1);
-  }n-s-  /*Cset type of interface */s-  i = ISP16_IN(ISP16_DRIVE_SET_PORT) & ISP16_DRIVE_SET_MASK;  /*Cclear some bits */s-  ISP16_OUT(CISP16_DRIVE_SET_PORT, i|drive_type );s-s-  /*Cenab 
 cdrom  * interface with 82C929 chip */s-  iUR	 isp16_type > 1 )M-    ISP16_OUT(Cisp16_enab 
_port, ISP16_ENABLE_CDROM );s-s-  /*Cset base address, irq and dma */s-  i = ISP16_IN(ISP16_IO_SET_PORT) & ISP16_IO_SET_MASK;  /*Ckeep some bits */s-  ISP16_OUT(CISP16_IO_SET_PORT, i|base_code|irq_code|dma_code );n+	u_char base_code;s+	u_char irq_code;s+	u_char dma_code;s+	u_char i;n+s+	iUR	(drive_type == ISP16_MITSUMI) && (dma != 0))n+		printk("ISP16: Mitsumiccdrom drive has no dma support.\n");
+n+	switch (base) {
+	case 0x340:n+		base_code = ISP16_BASE_340;n+		break;
+	case 0x330:n+		base_code = ISP16_BASE_330;n+		break;
+	case 0x360:n+		base_code = ISP16_BASE_360;n+		break;
+	case 0x320:n+		base_code = ISP16_BASE_320;n+		break;
+	default:
+		printks+		    ("ISP16: base address 0x%03X notRsupported by cdrom interface.\n",o+		     base);s+		retnsi (-1);n+	}s+	switch (irq) {
+	case 0:
+		irq_code = ISP16_IRQ_X;n+		break;		/*Cdisab 
 irq */s+	case 5:
+		irq_code = ISP16_IRQ_5;s+		printk("ISP16: irq 5Tshouldn't be used by cdrom interface,"
+		       " du
Mto possible conflicts with theCs und card.\n");
+		break;
+	case 7:
+		irq_code = ISP16_IRQ_7;s+		printk("ISP16: irq 7Tshouldn't be used by cdrom interface,"
+		       " du
Mto possible conflicts with theCs und card.\n");
+		break;
+	case 3:
+		irq_code = ISP16_IRQ_3;
+		break;
+	case 9:
+		irq_code = ISP16_IRQ_9;
+		break;
+	case 10:
+		irq_code = ISP16_IRQ_10;n+		break;
+	case 11:
+		irq_code = ISP16_IRQ_11;n+		break;
+	default:
+		printk("ISP16: irq %d notRsupported by cdrom interface.\n",o+		       irq);s+		retnsi (-1);n+	}s+	switch (dma) {
+	case 0:
+		dma_code = ISP16_DMA_X;n+		break;		/*Cdisab 
 dma */s+	case 1:
+		printk("ISP16: dma 1 cannotRbe used by cdrom interface,"
+		       " du
Mto conflict with theCs und card.\n");
+		retnsi (-1);n+		break;
+	case 3:
+		dma_code = ISP16_DMA_3;n+		break;
+	case 5:
+		dma_code = ISP16_DMA_5;n+		break;
+	case 6:
+		dma_code = ISP16_DMA_6;
+		break;
+	case 7:
+		dma_code = ISP16_DMA_7;n+		break;
+	default:
+		printk("ISP16: dma %d notRsupported by cdrom interface.\n",
+		       dma);s+		retnsi (-1);n+	}s+n+	iUR	drive_type != ISP16_SONY && drive_type != ISP16_PANASONIC0 &&s+	    drive_type != ISP16_PANASONIC1 && drive_type != ISP16_SANYO0 &&s+	    drive_type != ISP16_SANYO1 && drive_type != ISP16_MITSUMI &&s+	    drive_type != ISP16_DRIVE_X) {n+		printks+		    ("ISP16: drive type (code 0x%02X) notRsupported by cdrom"
+		     " interface.\n", drive_type);s+		retnsi (-1);n+	}s+n+	/*Cset type of interface */s+	i = ISP16_IN(ISP16_DRIVE_SET_PORT) & ISP16_DRIVE_SET_MASK;	/*Cclear some bits */s+	ISP16_OUT(ISP16_DRIVE_SET_PORT, i | drive_type);s+n+	/*Cenab 
 cdrom  * interface with 82C929 chip */s+	iUR	isp16_type > 1)n+		ISP16_OUT(isp16_enab 
_port, ISP16_ENABLE_CDROM);s+n+	/*Cset base address, irq and dma */s+	i = ISP16_IN(ISP16_IO_SET_PORT) & ISP16_IO_SET_MASK;	/*Ckeep some bits */s+	ISP16_OUT(ISP16_IO_SET_PORT, i | base_code | irq_code | dma_code);n 
-  retnsi(0);n+	retnsi (0);
 }n s ES < __exit isp16_exit(ES <)s@@ -332,4 +368,5 @@s #endiNn module_exit(isp16_exit);n 
-
+EXPORT_NO_SYMBOLS;
+MODULE_LICENSE("GPL");
diNf -u --recursive --new-fi 
 v2.4.9/linux/drivers/cdrom/mcd. Tlinux/drivers/cdrom/mcd. 
--- v2.4.9/linux/drivers/cdrom/mcd. 	Wed Jul 25 17:10:19 2001n+++Tlinux/drivers/cdrom/mcd. 	Sun Sep  9 10:43:02 2001n@@ -2,6 +2,7 @@s 	linux/kernel/blk_drv/mcd. T- MitsumicCDROM drivero s 	Copyright (C) 1992  Martin Harrissn+	Portt *s Copyright (C) 2001 Red Hato s 	martin@bdsi.com (no longer validT- where are you now, Martin?)n s@@ -74,7 +75,8 @@s 			 module_init & module_exit.s 			 Torben Mathiasen <tmm@image.dk>s 		o-			 n+	September 2001 - Reformatted and cleane< up the code
+			 Alan Cox <alan@redhat.com>			 n */s sT#include <linux/module.h>s@@ -102,14 +104,14 @@s #define MAJOR_NR MITSUMI_CDROM_MAJORsT#include <linux/blk.h>sT
-#define mcd_port mcd    /*CG_S compatible parameter passing with "insmod" */s+#define mcd_port mcd		/*CG_S compatible parameter passing with "insmod" */sT#include "mcd.h"s sTy  pF Tint mcd_blocksizes[1];n M s /*CI adde< A flag to drop to 1x speedCiURtoo many errors 0 = 1X ; 1 = 2X */s-y  pF Tint mcdDouble; M+y  pF Tint mcdDouble;M s /*CHow many sectors to hold at 1x speedCc unter */sTy  pF Tint mcd1xhold;
@@ -117,22 +119,8 @@s /*CIs the drive connected properly and e sponding?? */sTy  pF Tint mcdPresent;n s-#iU 0
-#define TEST1 /*C<int-..> */s-#define TEST2 /*Cdo_mcd_req */s-#define TEST3 */ /*CMCD_S_y  pe */s-#define TEST4 /*CQUICK_LOOP-c unter */s-#define TEST5 */ /*Cport(1) y  pe */s-#endiNn-s-#iU 1s-#define QUICK_LOOP_DELAY udelay(45)  /*Cuse udelay */s+#define QUICK_LOOP_DELAY udelay(45)	/*Cuse udelay */s #define QUICK_LOOP_COUNT 20s-#elsen-#define QUICK_LOOP_DELAYn-#define QUICK_LOOP_COUNT 140 /*Cbetter wait cony  nt time */s-#endiNn-/*C#define DOUBLE_QUICK_ONLY */s sT#define CURRENT_VALID \
 (!QUEUE_EMPTY && MAJOR(CURRENTC-> rq_dev)C== MAJOR_NR && CURRENTC-> cmdC== READ \
@@ -141,32 +129,30 @@s #define MFL_STATUSorDATA (MFL_STATUS | MFL_DATA)s #define MCD_BUF_SIZ 16sTy  pF Tvol pFle int mcd_transfer_is_active;s-y  pF Tchar mcd_buf[2048*MCD_BUF_SIZ];	/*CbufferCG_S block size converst * */s+y  pF Tchar mcd_buf[2048 * MCD_BUF_SIZ];	/*CbufferCG_S block size converst * */sTy  pF Tvol pFle int mcd_buf_bn[MCD_BUF_SIZ], mcd_next_bn;sTy  pF Tvol pFle int mcd_buf_in, mcd_buf_out =R-1;nTy  pF Tvol pFle int mcd_error;sTy  pF Tint mcd_open_c unt;sTenum mcd_y  pe_e {s-  MCD_S_IDLE,   /*C0 */s-  MCD_S_START,  /*C1 */s-  MCD_S_MODE, /*C2 */s-  MCD_S_READ,   /*C3 */s-  MCD_S_DATA,   /*C4 */s-  MCD_S_STOP,   /*C5 */s-  MCD_S_STOPPING /*C6 */s+	MCD_S_IDLE,		/*C0 */s+	MCD_S_START,		/*C1 */s+	MCD_S_MODE,		/*C2 */s+	MCD_S_READ,		/*C3 */s+	MCD_S_DATA,		/*C4 */s+	MCD_S_STOP,		/*C5 */s+	MCD_S_STOPPING		/*C6 */s };nTy  pF Tvol pFle enum mcd_y  pe_e mcd_y  pe =RMCD_S_IDLE;sTy  pF Tint mcd_mode = -1;n-y  pF Tint MCMD_DATA_READ= MCMD_PLAY_READ;M+y  pF Tint MCMD_DATA_READ = MCMD_PLAY_READ;M+s #define READ_TIMEOUT 3000
-#define WORK_AROUND_MITSUMI_BUG_92
-#define WORK_AROUND_MITSUMI_BUG_93s-#iUdef WORK_AROUND_MITSUMI_BUG_93s+s int mitsumi_bug_93_wait;s-#endiN /*CWORK_AROUND_MITSUMI_BUG_93 */s s-y  pF Tshort mcd_port = CONFIG_MCD_BASE; /*Cused as "mcd" by "insmod" */s-y  pF Tint   mcd_irq  = CONFIG_MCD_IRQ; /*Cmust directly follow mcd_port */s+y  pF Tshort mcd_port = CONFIG_MCD_BASE;	/*Cused as "mcd" by "insmod" */s+y  pF Tint mcd_irqT= CONFIG_MCD_IRQ;	/*Cmust directly follow mcd_port */s MODULE_PARM(mcd, "1-2i");s sTy  pF Tint McdTimeout, McdTries;s@@ -195,75 +181,58 @@s y  pF Tint GetDiskInfo(ES <);s y  pF Tint GetToc(ES <);s y  pF Tint getValue(unsigned char *result);s-y  pF Tint mcd_open(s ruct cdrom_device_inG_ * cdi, int purpose);s-y  pF TES < mcd_release(s ruct cdrom_device_inG_ * cdi);s-y  pF Tint mcd_media_changed(s ruct cdrom_device_inG_ * cdi, int disc_nr);s-y  pF Tint mcd_tray_move(s ruct cdrom_device_inG_ * cdi, int positt *);M-int mcd_audio_ioctl(s ruct cdrom_device_inG_ * cdi, unsigned int cmd,s-                      ES < * arg);M-int mcd_drive_s  pus(s ruct cdrom_device_inG_ * cdi, int slot_nr);s+y  pF Tint mcd_open(s ruct cdrom_device_inG_ *cdi, int purpose);s+y  pF TES < mcd_release(s ruct cdrom_device_inG_ *cdi);s+y  pF Tint mcd_media_changed(s ruct cdrom_device_inG_ *cdi, int disc_nr);s+y  pF Tint mcd_tray_move(s ruct cdrom_device_inG_ *cdi, int positt *);M+int mcd_audio_ioctl(s ruct cdrom_device_inG_ *cdi, unsigned int cmd,s+		    ES < *arg);M+int mcd_drive_s  pus(s ruct cdrom_device_inG_ *cdi, int slot_nr);s sTy  pF Ts ruct timer_lirt mcd_timer;s sTy  pF Ts ruct cdrom_device_ops mcd_dops = {
-	open:			mcd_open,
-	release:		mcd_release,
-	drive_s  pus:		mcd_drive_s  pus,
-	media_changed:		mcd_media_changed,
-	tray_move:		mcd_tray_move,
-	audio_ioctl:		mcd_audio_ioctl,
-	capability:		CDC_OPEN_TRAY | CDC_MEDIA_CHANGED |o-				CDC_PLAY_AUDIO | CDC_DRIVE_STATUS,s+	open:mcd_open,
+	release:mcd_release,
+	drive_s  pus:mcd_drive_s  pus,
+	media_changed:mcd_media_changed,
+	tray_move:mcd_tray_move,
+	audio_ioctl:mcd_audio_ioctl,
+	capability:CDC_OPEN_TRAY | CDC_MEDIA_CHANGED |o+	    CDC_PLAY_AUDIO | CDC_DRIVE_STATUS,s };nTsTy  pF Ts ruct cdrom_device_inG_ mcd_inG_ = {
-	ops:			&mcd_dops,
-	speed:			2,
-	capacity:		1,
-	name:			"mcd",s+	ops:&mcd_dops,
+	speed:2,
+	capacity:1,
+	name:"mcd",s };nTsT#iUndef MODULE
 y  pF Tint __init mcd_yetup(char *str)
 {s-   int ints[9];n-   o-   (ES <)get_optt *s(str, ARRAY_SIZE(ints), ints);n-   
-   iUR	ints[0] > 0)n-      mcd_port = ints[1];n-   iUR	ints[0] > 1)      s-      mcd_irq  = ints[2];n-#iUdef WORK_AROUND_MITSUMI_BUG_93s-   iUR	ints[0] > 2)n-      mitsumi_bug_93_wait = ints[3];n-#endiN /*CWORK_AROUND_MITSUMI_BUG_93 */s+	int ints[9];n+
+	(ES <) get_optt *s(str, ARRAY_SIZE(ints), ints);n s- retnsi 1;
+	iUR	ints[0] > 0)n+		mcd_port = ints[1];n+	iUR	ints[0] > 1)n+		mcd_irqT= ints[2];n+	iUR	ints[0] > 2)n+		mitsumi_bug_93_wait = ints[3];n+
+	retnsi 1;
 }M M __setup("mcd=", mcd_yetup);s s-#endiN /*CMODULE */ s+#endiN				/*CMODULE */s s-y  pF Tint mcd_media_changed(s ruct cdrom_device_inG_ * cdi, int disc_nr)s+y  pF Tint mcd_media_changed(s ruct cdrom_device_inG_ *cdi, int disc_nr)
 {s-   int retval;s-s-s-#iU 1	 /*Cthe below is notRreliab 
 */s-   retnsi 0;s-#endiN  n-n-   iUR	cdi->dev)C{s-      printk("mcd: MitsumicCD-ROM requurt error: invalid device.\n");
-      retnsi 0;s-   }
-s-   retval = mcdDiskChanged;s-   mcdDiskChanged = 0;s-s-   retnsi retval;s+	retnsi 0;
 }n s s@@ -272,18 +241,17 @@s  *Cbecause it calls 'getMcdS  pus' which sleeps.
  */s s-y  pF Tints-y  pusCmd(ES <)s+y  pF Tint s  pusCmd(ES <)s {M 	int s  = -1, e try;
 s-	G_SM(e tryT= 0; e tryT<RMCD_RETRY_ATTEMPTS; e try++)s-	{s-		outb(MCMD_GET_STATUS,RMCDPORT(0));    /*Csend get-y  pus cmdC*/s+	G_SM(e tryT= 0; e tryT<RMCD_RETRY_ATTEMPTS; e try++) {
+		/* send get-y  pus cmdC*/s+		outb(MCMD_GET_STATUS,RMCDPORT(0));o s 		s  = getMcdS  pus(MCD_STATUS_DELAY);s-		iUR	st != -1) s-        		break;
+		iUR	st != -1)
+			break;
 	}o n 	retnsi st;s@@ -294,13 +262,11 @@s  *CSend a 'Play' command and get theCs  pus.  Use on y G0xm thectop half.
  */s s-y  pF Tints-mcdPlay(s ruct mcd_Play_msf *arg)s+y  pF Tint mcdPlay(s ruct mcd_Play_msf *arg)s {M 	int e try, s  = -1;
 s-	G_SM(e tryT= 0; e tryT<RMCD_RETRY_ATTEMPTS; e try++)s-	{s+	G_SM(e tryT= 0; e tryT<RMCD_RETRY_ATTEMPTS; e try++) {
 		sendMcdCmd(MCMD_PLAY_READ, arg);M 		s  = getMcdS  pus(2 * MCD_STATUS_DELAY);s 		iUR	st != -1)
@@ -311,45 +277,39 @@s }n s s-y  pF Tint M-mcd_tray_move(s ruct cdrom_device_inG_ * cdi, int positt *)s+y  pF Tint mcd_tray_move(s ruct cdrom_device_inG_ *cdi, int positt *)s {M 	int i;n 	iUR	positt *) {
-	/*C Eject */s-       		/* all drives can at least s op! */s+		/*C Eject */s+		/* all drives can at least s op! */s 		iUR	audioS  pusC== CDROM_AUDIO_PLAY) {
-	  	outb(MCMD_STOP, MCDPORT(0));o-	  	i = getMcdS  pus(MCD_STATUS_DELAY);s+			outb(MCMD_STOP, MCDPORT(0));o+			i = getMcdS  pus(MCD_STATUS_DELAY);s 		}s s-                audioS  pusC= CDROM_AUDIO_NO_STATUS;o+		audioS  pusC= CDROM_AUDIO_NO_STATUS;o s-                outb(MCMD_EJECT, MCDPORT(0));o-                /*s-                 * theCs  pus (i)Tshows Gailure on all but theCFX drives.s-                 * But nothing we can do about that in software!s-                 * So just read theCs  pus and G_Sget it. - J *.s-                 */s-                i = getMcdS  pus(MCD_STATUS_DELAY);s-                retnsi 0;s-	}s-	)lse s+		outb(MCMD_EJECT, MCDPORT(0));o+		/*s+		 * theCs  pus (i)Tshows Gailure on all but theCFX drives.s+		 * But nothing we can do about that in software!s+		 * So just read theCs  pus and G_Sget it. - J *.s+		 */s+		i = getMcdS  pus(MCD_STATUS_DELAY);s+		retnsi 0;o+	} )lsen 		retnsi -EINVAL;n }n s-longM-msf2hsg(s ruct msf *mp)M+long msf2hsg(s ruct msf *mp)M {
-	retnsi bcd2bin(mp -> frame)o-		+ bcd2bin(mp -> sec) * 75o-		+ bcd2bin(mp -> min) * 4500
-		- 150;s+	retnsi bcd2bin(mp->frame) + bcd2bin(mp->sec) * 75 + bcd2bin(mp->min) * 4500 - 150;s }n s s-int mcd_audio_ioctl(s ruct cdrom_device_inG_ * cdi, unsigned int cmd,s-                      ES < * arg)M+int mcd_audio_ioctl(s ruct cdrom_device_inG_ *cdi, unsigned int cmd,s+		    ES < *arg)s {M 	int i, st;s 	s ruct mcd_Toc qInfo;s@@ -365,24 +325,22 @@s 	iUR	st < 0)
 		retnsi -EIO;o s-	iUR	!tocUpToDate)s-	{s+	iUR	!tocUpToDate) {
 		i = updateToc();s-		iUR	i < 0) 
+		iUR	i < 0)
 			retnsi i;	/*Cerror reading TOC */s 	}n s-	switch (cmd)s-	{s-	case CDROMSTART:     /*CSpin up the drive */s+	switch (cmd) {
+	case CDROMSTART:	/*CSpin up the drive */s 		/* Don't think we can do this.  Even iURwe could,s- 		 * I think the drive times out and stops after a whi 
s+		 * I think the drive times out and stops after a whi 
s 		 * anyway.  For now, ignoreCit.s 		 */s sT		retnsi 0;o s-	case CDROMSTOP:      /*CSpin down the drive */s+	case CDROMSTOP:	/*CSpin down the drive */s 		outb(MCMD_STOP, MCDPORT(0));o 		i = getMcdS  pus(MCD_STATUS_DELAY);s s@@ -391,15 +349,14 @@s 		audioS  pusC= CDROM_AUDIO_NO_STATUS;o 		retnsi 0;o s-	case CDROMPAUSE:     /*CPause the drive */s+	case CDROMPAUSE:	/*CPause the drive */s 		iUR	audioS  pusC!= CDROM_AUDIO_PLAY)
 			retnsi -EINVAL;n s 		outb(MCMD_STOP, MCDPORT(0));o 		i = getMcdS  pus(MCD_STATUS_DELAY);s s-		iUR	GetQChannelInfo(&qInfo) < 0)s-		{
+		iUR	GetQChannelInfo(&qInfo) < 0) {
 			/*Cdidn't get q channel inG_ */s sT			audioS  pusC= CDROM_AUDIO_NO_STATUS;o@@ -411,15 +368,14 @@s 		audioS  pusC= CDROM_AUDIO_PAUSED;o 		retnsi 0;o s-	case CDROMRESUME:    /*CPlay it again, Sam */s+	case CDROMRESUME:	/*CPlay it again, Sam */s 		iUR	audioS  pusC!= CDROM_AUDIO_PAUSED)
 			retnsi -EINVAL;n s 		/*Crestart the drive atRtheCsaved positt *. */s sT		i = mcdPlay(&mcd_Play);s-		iUR	i < 0)s-		{
+		iUR	i < 0) {
 			audioS  pusC= CDROM_AUDIO_ERROR;
 			retnsi -EIO;s 		}s@@ -427,14 +383,13 @@s 		audioS  pusC= CDROM_AUDIO_PLAY;o 		retnsi 0;o s-	case CDROMPLAYTRKIND:     /*CPlay a track.  This currently ignores index. */s+	case CDROMPLAYTRKIND:	/*CPlay a track.  This currently ignores index. */s s-		ti=(s ruct cdrom_ti *) arg;s+		ti = (s ruct cdrom_ti *) arg;s s 		iUR	ti->cdti_trk0 < DiskInfo.firsto-			|| ti->cdti_trk0 > DiskInfo.lasto-			|| ti->cdti_trk1 < ti->cdti_trk0)s-		{
+		    || ti->cdti_trk0 > DiskInfo.lasto+		    || ti->cdti_trk1 < ti->cdti_trk0) {
 			retnsi -EINVAL;n 		}s s@@ -445,14 +400,14 @@s 		mcd_Play.end = Toc[ti->cdti_trk1 + 1].diskTime;s 
 #iUdef MCD_DEBUG
-printk("play: %02x:%02x.%02x to %02x:%02x.%02x\n",n-	mcd_Play.start.min, mcd_Play.start.sec, mcd_Play.start.frame,n-	mcd_Play.end.min, mcd_Play.end.sec, mcd_Play.end.frame);
+		printk("play: %02x:%02x.%02x to %02x:%02x.%02x\n",n+		       mcd_Play.start.min, mcd_Play.start.sec,n+		       mcd_Play.start.frame, mcd_Play.end.min,n+		       mcd_Play.end.sec, mcd_Play.end.frame);
 #endiNn sT		i = mcdPlay(&mcd_Play);s-		iUR	i < 0)s-		{
+		iUR	i < 0) {
 			audioS  pusC= CDROM_AUDIO_ERROR;
 			retnsi -EIO;s 		}s@@ -460,15 +415,15 @@s 		audioS  pusC= CDROM_AUDIO_PLAY;o 		retnsi 0;o s-	case CDROMPLAYMSF:   /*CPlay starting atRtheCgiven MSF address. */s+	case CDROMPLAYMSF:	/*CPlay starting atRtheCgiven MSF address. */s s 		iUR	audioS  pusC== CDROM_AUDIO_PLAY) {
-		  outb(MCMD_STOP, MCDPORT(0));o-		  i = getMcdS  pus(MCD_STATUS_DELAY);s-		  audioS  pusC= CDROM_AUDIO_NO_STATUS;o+			outb(MCMD_STOP, MCDPORT(0));o+			i = getMcdS  pus(MCD_STATUS_DELAY);s+			audioS  pusC= CDROM_AUDIO_NO_STATUS;o 		}n s-		msf=(s ruct cdrom_msf *) arg;s+		msf = (s ruct cdrom_msf *) arg;s s 		/*CconvertMtoRbcd */s s@@ -487,14 +442,14 @@s 		mcd_Play.end.frame =Rmsf->cdmsf_frame1;s 
 #iUdef MCD_DEBUG
-printk("play: %02x:%02x.%02x to %02x:%02x.%02x\n",n-mcd_Play.start.min, mcd_Play.start.sec, mcd_Play.start.frame,n-mcd_Play.end.min, mcd_Play.end.sec, mcd_Play.end.frame);
+		printk("play: %02x:%02x.%02x to %02x:%02x.%02x\n",n+		       mcd_Play.start.min, mcd_Play.start.sec,n+		       mcd_Play.start.frame, mcd_Play.end.min,n+		       mcd_Play.end.sec, mcd_Play.end.frame);
 #endiNn sT		i = mcdPlay(&mcd_Play);s-		iUR	i < 0)s-		{
+		iUR	i < 0) {
 			audioS  pusC= CDROM_AUDIO_ERROR;
 			retnsi -EIO;s 		}s@@ -502,35 +457,37 @@s 		audioS  pusC= CDROM_AUDIO_PLAY;o 		retnsi 0;o s-	case CDROMREADTOCHDR:        /*CRead theCtab 
 ofCcontents header */s-	        tocHdr=(s ruct cdrom_tochdr *) arg; s+	case CDROMREADTOCHDR:	/*CRead theCtab 
 ofCcontents header */s+		tocHdr = (s ruct cdrom_tochdr *) arg;o 		tocHdr->cdth_trk0 = DiskInfo.first;o 		tocHdr->cdth_trk1 = DiskInfo.last;o 		retnsi 0;o s-	case CDROMREADTOCENTRY:      /*CRead an entry in theCtab 
 ofCcontents */s-		entry=(s ruct cdrom_tocentry *) arg;s+	case CDROMREADTOCENTRY:	/*CRead an entry in theCtab 
 ofCcontents */s+		entry = (s ruct cdrom_tocentry *) arg;s 		iUR	entry->cdte_trackC== CDROM_LEADOUT)
 			tocPtr = &Toc[DiskInfo.last - DiskInfo.first + 1];s s 		)lse iUR	entry->cdte_trackC> DiskInfo.lasto-				|| entry->cdte_trackC< DiskInfo.first)
+			 || entry->cdte_trackC< DiskInfo.first)
 			retnsi -EINVAL;n s 		)lsen 			tocPtr = &Toc[entry->cdte_track];s s-		entry->cdte_adr = tocPtr -> ctrl_addr;s-		entry->cdte_ctrl = tocPtr -> ctrl_addr >> 4;s+		entry->cdte_adr = tocPtr->ctrl_addr;s+		entry->cdte_ctrl = tocPtr->ctrl_addr >> 4;s s 		iUR	entry->cdte_formatC== CDROM_LBA)s-			entry->cdte_addr.lba =Rmsf2hsg(&tocPtr -> diskTime);s+			entry->cdte_addr.lba =Rmsf2hsg(&tocPtr->diskTime);s s-		else iUR	entry->cdte_formatC== CDROM_MSF)s-		{
-			entry->cdte_addr.msf.minupe =Rbcd2bin(tocPtr -> diskTime.min);
-			entry->cdte_addr.msf.second = bcd2bin(tocPtr -> diskTime.sec);s-			entry->cdte_addr.msf.frame =Rbcd2bin(tocPtr -> diskTime.frame);
+		else iUR	entry->cdte_formatC== CDROM_MSF) {n+			entry->cdte_addr.msf.minupe =
+			    bcd2bin(tocPtr->diskTime.min);
+			entry->cdte_addr.msf.second =
+			    bcd2bin(tocPtr->diskTime.sec);s+			entry->cdte_addr.msf.frame =
+			    bcd2bin(tocPtr->diskTime.frame);
 		}o n 		)lsen@@ -538,9 +495,9 @@s 
 		retnsi 0;o s-	case CDROMSUBCHNL:   /*CGetRsubchannel inG_ */s+	case CDROMSUBCHNL:	/*CGetRsubchannel inG_ */s s-                subchnl=(s ruct cdrom_subchnl *) arg;s+		subchnl = (s ruct cdrom_subchnl *) arg;s 		iUR	GetQChannelInfo(&qInfo) < 0)s 			retnsi -EIO;s n@@ -551,14 +508,14 @@s 		subchnl->cdsc_ind = bcd2bin(qInfo.pointIndex);M 		subchnl->cdsc_absaddr.msf.minupe =Rbcd2bin(qInfo.diskTime.min);
 		subchnl->cdsc_absaddr.msf.second = bcd2bin(qInfo.diskTime.sec);s-		subchnl->cdsc_absaddr.msf.frame =Rbcd2bin(qInfo.diskTime.frame);
+		subchnl->cdsc_absaddr.msf.frame  =Rbcd2bin(qInfo.diskTime.frame);
 		subchnl->cdsc_reladdr.msf.minupe =Rbcd2bin(qInfo.trackTime.min);
 		subchnl->cdsc_reladdr.msf.second = bcd2bin(qInfo.trackTime.sec);s-		subchnl->cdsc_reladdr.msf.frame =Rbcd2bin(qInfo.trackTime.frame);
-		retnsi(0);n+		subchnl->cdsc_reladdr.msf.frame  =Rbcd2bin(qInfo.trackTime.frame);
+		retnsi (0);
 s-	case CDROMVOLCTRL:   /*CVolume control */s-		volctrl=(s ruct cdrom_volctrl *) arg;s+	case CDROMVOLCTRL:	/*CVolume control */s+		volctrl = (s ruct cdrom_volctrl *) arg;s 		outb(MCMD_SET_VOLUME, MCDPORT(0));o 		outb(volctrl->channel0, MCDPORT(0));o 		outb(255, MCDPORT(0));o@@ -590,37 +547,37 @@s  * When Linux gets variab 
 block sizes this will probably go away.
  */s s-y  pF TES <M-mcd_transfer(ES <)s+y  pF TES < mcd_transfer(ES <)s {s-  iUR	CURRENT_VALID)C{s-    whi 
 (CURRENTC-> nr_sectors)C{s-      int bnC= CURRENTC-> sector / 4;s-      int i;s-      G_SM(i = 0; iT<RMCD_BUF_SIZ && mcd_buf_bn[i]C!= bn; ++i)s-	;s-      iUR	iT<RMCD_BUF_SIZ) {
-	int offs = (i * 4 + (CURRENTC-> sector & 3)) * 512;
-	int nr_sectors = 4 - (CURRENTC-> sector & 3);s-	iUR	mcd_buf_out != i) {
-	  mcd_buf_out =Ri;o-	  iUR	mcd_buf_bn[i]C!= bn) {
-	    mcd_buf_out =R-1;n-	    continue;n-	  }s-	}s-	iUR	nr_sectors > CURRENTC-> nr_sectors)n-	  nr_sectors = CURRENTC-> nr_sectors;
-	memcpy(CURRENTC-> buffer, mcd_buf + offs, nr_sectors * 512);s-	CURRENTC-> nr_sectors -= nr_sectors;
-	CURRENTC-> sector += nr_sectors;
-	CURRENTC-> bufferC+= nr_sectors * 512;
-      } )lse {s-	mcd_buf_out =R-1;n-	break;
-      }s-    }s-  }n+	iUR	CURRENT_VALID)C{s+		whi 
 (CURRENT->nr_sectors)C{s+			int bnC= CURRENT->sector / 4;s+			int i;s+			G_SM(i = 0; iT<RMCD_BUF_SIZ && mcd_buf_bn[i]C!= bn;
+			     ++i);s+			iUR	iT<RMCD_BUF_SIZ) {
+				int offs =(i * 4 + (CURRENT->sector & 3)) * 512;
+				int nr_sectors = 4 - (CURRENT->sector & 3);
+				iUR	mcd_buf_out != i) {
+					mcd_buf_out =Ri;o+					iUR	mcd_buf_bn[i]C!= bn) {
+						mcd_buf_out =R-1;n+						continue;n+					}
+				}
+				iUR	nr_sectors > CURRENT->nr_sectors)n+					nr_sectors = CURRENT->nr_sectors;n+				memcpy(CURRENT->buffer, mcd_buf + offs,n+				       nr_sectors * 512);s+				CURRENT->nr_sectors -= nr_sectors;
+				CURRENT->sector += nr_sectors;
+				CURRENT->bufferC+= nr_sectors * 512;
+			} )lse {n+				mcd_buf_out =R-1;n+				break;
+			}
+		}o+	}
 }n s s@@ -629,500 +586,423 @@s  * Just take the interrupt and clear out theCs  pus reg.
  */s s-y  pF TES <M-mcd_interrupt(int irq, ES < *dev_id,Ts ruct pt_regs * regs)s+y  pF TES < mcd_interrupt(int irq, ES < *dev_id,Ts ruct pt_regs *regs)s {M 	int s ;s s 	st = inb(MCDPORT(1)) & 0xFF;n-#iUdef TEST1s-		printk("<int1-%02X>",Ts );s-#endiNn-	iUR	!(st & MFL_STATUS))s-	{s+	test1(printk("<int1-%02X>",Ts ));
+	iUR	!(st & MFL_STATUS)) {
 		st = inb(MCDPORT(0)) & 0xFF;n-#iUdef TEST1s-		printk("<int0-%02X>",Ts );s-#endiNn+		test1(printk("<int0-%02X>",Ts ));
 		iUR	(st & 0xFF) != 0xFF)s-		  mcd_error = st ? st & 0xFF :R-1;n+			mcd_error = st ? st & 0xFF :R-1;n 	}
 }n s s-y  pF TES <M-do_mcd_requurt(requurt_quuue_t * q)s+y  pF TES < do_mcd_requurt(requurt_quuue_t * q)s {s-#iUdef TEST2
-  printk(" do_mcd_requurt(%ld+%ld)\n", CURRENTC-> sector, CURRENTC-> nr_sectors);s-#endiNn-  mcd_transfer_is_active = 1;s-  whi 
 (CURRENT_VALID)C{s-    iUR	CURRENT->bh)C{s-      iUR	!buffer_locked	CURRENT->bh))s-	panic(DEVICE_NAME ": block notRlocked");o-    }s-    mcd_transfer();s-    iUR	CURRENTC-> nr_sectors == 0) {n-      )nd_requurt(1);o-    } )lse {s-      mcd_buf_out =R-1;		/*CW nt toCread a block notRin bufferC*/s-      iUR	mcd_y  pe ==RMCD_S_IDLE) {
-	iUR	!tocUpToDate) {
-	  iUR	updateToc() < 0) {
-	    whi 
 (CURRENT_VALID)s-	      )nd_requurt(0);n-	    break;
-	  }s-	}s-	mcd_y  pe =RMCD_S_START;
-	McdTries =R5;s-	SET_TIMER(mcd_poll, 1);n-      }n-      break;
-    }s-  }n-  mcd_transfer_is_active = 0;s-#iUdef TEST2
-  printk(" do_mcd_requurt )nds\n");
-#endiNn+	test2(printk(" do_mcd_requurt(%ld+%ld)\n", CURRENT->sector,
+	       CURRENT->nr_sectors));s+n+		mcd_transfer_is_active = 1;s+	whi 
 (CURRENT_VALID)C{s+		iUR	CURRENT->bh)C{s+			iUR	!buffer_locked	CURRENT->bh))s+				panic(DEVICE_NAME ": block notRlocked");o+		}o+		mcd_transfer();s+		iUR	CURRENT->nr_sectors == 0) {n+			end_requurt(1);o+		} )lse {n+			mcd_buf_out =R-1;	/*CW nt toCread a block notRin bufferC*/s+			iUR	mcd_y  pe ==RMCD_S_IDLE) {
+				iUR	!tocUpToDate) {
+					iUR	updateToc() < 0) {
+						whi 
 (CURRENT_VALID)s+							)nd_requurt(0);n+						break;
+					}
+				}
+				mcd_y  pe =RMCD_S_START;
+				McdTries =R5;s+				mcd_timer.functt * = mcd_poll;s+				mod_timer(&mcd_timer, jiffies + 1);o+			}
+			break;
+		}n+	}s+	mcd_transfer_is_active = 0;s+	test2(printk(" do_mcd_requurt )nds\n"));
 }n s s s-y  pF TES <M-mcd_poll(unsigned long dummy)s+y  pF TES < mcd_poll(unsigned long dummy)s {s-  int s ;s+	int s ;s s s-  iUR	mcd_error) s-  {s-    iUR	mcd_error & 0xA5) s-    {s-      printk("mcd: I/OCerror 0x%02x", mcd_error);s-      iUR	mcd_error & 0x80)s-	printk(" (Door open)");s-      iUR	mcd_error & 0x20)s-	printk(" (Disk changed)");s-      iUR	mcd_error & 0x04)s-	{s-	printk(" (Read error)"); /*CBitch about the problem. */s-	
-	/*CTime toCget fancy! If atR2x speedCand 1 error, drop to 1x speed! */s-	/*CInterurting how it STAYS atRMCD_RETRY_ATTEMPTS on first error! */s-	/*CBut I find that rather HANDY!!! */s-	/*CNeat! it REALLYCWORKS on those LOW QUALITY CD's!!! Smi 
! :) */s-	/*CAJK [06/17/95] */s-	
-	/*CSlap the CD down to sing 
 speed! */s-	iUR	mcdDouble ==R1 && McdTries ==RMCD_RETRY_ATTEMPTS && MCMD_DATA_READ == MCMD_2X_READ) s-		{
-		MCMD_DATA_READ = MCMD_PLAY_READ; /*CUhhh, Ummmm, muhuh-huh! */s-		mcd1xhold = SINGLE_HOLD_SECTORS; /*CHey Beavis! */s-		printk(" SpeedCnow 1x");	 /*CPullCmy finger! */s+	iUR	mcd_error) {s+		iUR	mcd_error & 0xA5) {
+			printk(KERN_ERR "mcd: I/OCerror 0x%02x", mcd_error);s+			iUR	mcd_error & 0x80)s+				printk(" (Door open)");s+			iUR	mcd_error & 0x20)s+				printk(" (Disk changed)");s+			iUR	mcd_error & 0x04) {
+				printk(" (Read error)");	/*CBitch about the problem. */s+
+				/*CTime toCget fancy! If atR2x speedCand 1 error, drop to 1x speed! */s+				/*CInterurting how it STAYS atRMCD_RETRY_ATTEMPTS on first error! */s+				/*CBut I find that rather HANDY!!! */s+				/*CNeat! it REALLYCWORKS on those LOW QUALITY CD's!!! Smi 
! :) */s+				/*CAJK [06/17/95] */s+
+				/*CSlap the CD down to sing 
 speed! */s+				iUR	mcdDouble ==R1n+				    && McdTries ==RMCD_RETRY_ATTEMPTSn+				    && MCMD_DATA_READ == MCMD_2X_READ) {
+					MCMD_DATA_READ = MCMD_PLAY_READ;	/*CUhhh, Ummmm, muhuh-huh! */s+					mcd1xhold = SINGLE_HOLD_SECTORS;	/*CHey Beavis! */s+					printk(" SpeedCnow 1x");	/*CPullCmy finger! */s+				}
+			}
+			printk("\n");
+			mcd_invalid pe_buffers();s+#iUdef WARN_IF_READ_FAILUREs+			iUR	McdTries ==RMCD_RETRY_ATTEMPTS)s+				printk(KERN_ERR "mcd: read of block %d Gailed\n",n+				       mcd_next_bn);s+#endiNn+			iUR	!McdTries--) {
+				/*CNuts! This cd is e ady for recycling! */s+				/*CWhen WAS the last time YOU cleane< it CORRECTLY?! */s+				printk(KERN_ERR "mcd: read of block %d Gailed,Cgiving up\n",n+				     mcd_next_bn);s+				iUR	mcd_transfer_is_active) {
+					McdTries =R0;s+					gotoCret;
+				}
+				iUR	CURRENT_VALID)s+					)nd_requurt(0);n+				McdTries =RMCD_RETRY_ATTEMPTS;
+			}
 		}o+		mcd_error = 0;s+		mcd_y  pe =RMCD_S_STOP;n 	}
-      printk("\n");
-      mcd_invalid pe_buffers();s-#iUdef WARN_IF_READ_FAILUREs-      iUR	McdTries ==RMCD_RETRY_ATTEMPTS)s-	printk("mcd: read of block %d Gailed\n", mcd_next_bn);s-#endiNn-      iUR	!McdTries--) s-        {
-	/*CNuts! This cd is e ady for recycling! */s-	/*CWhen WAS the last time YOU cleane< it CORRECTLY?! */s-	printk("mcd: read of block %d Gailed,Cgiving up\n", mcd_next_bn);s-	iUR	mcd_transfer_is_active) s-	{s-	  McdTries =R0;s-	  gotoCret;
-	}s-	iUR	CURRENT_VALID)s-	  )nd_requurt(0);n-	McdTries =RMCD_RETRY_ATTEMPTS;
-      }s-    }s-    mcd_error = 0;n-    mcd_y  pe =RMCD_S_STOP;n-  }n 	/*CSwitch back to Double speedCiURenough GOOD sectors were read! */s-	
-	/*CAre we a double speedCwith a crappy CD?! */s-    iUR	mcdDouble ==R1 && McdTries ==RMCD_RETRY_ATTEMPTS && MCMD_DATA_READ == MCMD_PLAY_READ)n-    	{
-	/*CWe ARE a double speedCand we ARE bitching! */s-	iUR	mcd1xhold == 0) /*COkay, Like are we STILL atRsing 
 speed? */s-		{ /*CWe needCto switch back to double speedCnow... */s-		MCMD_DATA_READ = MCMD_2X_READ; /*CUhhh... BACK You GO! */s-		printk("mcd: Switching back to 2X speed!\n"); /*CTellC'em! */s-		}s-	)lse mcd1xhold--; /*CNo?! C unt down the good reads some more... */s-				/* and try, try again! */s-    	}s-s-s-s- immediately:n-  switch (mcd_y  pe) {
-
 n+	/*CAre we a double speedCwith a crappy CD?! */s+	iUR	mcdDouble ==R1 && McdTries ==RMCD_RETRY_ATTEMPTS
+	    && MCMD_DATA_READ == MCMD_PLAY_READ) {
+		/* We ARE a double speedCand we ARE bitching! */s+		iUR	mcd1xhold == 0) {	/*COkay, Like are we STILL atRsing 
 speed? *//*CWe needCto switch back to double speedCnow... */s+			MCMD_DATA_READ = MCMD_2X_READ;	/*CUhhh... BACK You GO! */s+			printk(KERN_INFO "mcd: Switching back to 2X speed!\n");	/*CTellC'em! */s+		} )lse
+			mcd1xhold--;	/*CNo?! C unt down the good reads some more... */s+		/* and try, try again! */s+	}s+n+immediately:n+	switch (mcd_y  pe) {
+	case MCD_S_IDLE:n+		test3(printk("MCD_S_IDLE\n"));
+		gotoCout;s+n+	case MCD_S_START:n+		test3(printk("MCD_S_START\n"));
+		outb(MCMD_GET_STATUS,RMCDPORT(0));o+		mcd_y  pe =Rmcd_mode ==R1 ? MCD_S_READ : MCD_S_MODE;o+		McdTimeout =R3000;n+		break;
+n+	case MCD_S_MODE:n+		test3(printk("MCD_S_MODE\n"));
+		iUR	(st =RmcdS  pus()) != -1) {s+			iUR	st & MST_DSK_CHG) {n+				mcdDiskChanged = 1;n+				tocUpToDate =R0;s+				mcd_invalid pe_buffers();s+			}s s-  case MCD_S_IDLE:n-#iUdef TEST3s-    printk("MCD_S_IDLE\n");s-#endiNn-    gotoCout;s-s-s-s-  case MCD_S_START:n-#iUdef TEST3s-    printk("MCD_S_START\n");s-#endiNn-s-    outb(MCMD_GET_STATUS,RMCDPORT(0));o-    mcd_y  pe =Rmcd_mode ==R1 ? MCD_S_READ : MCD_S_MODE;o-    McdTimeout =R3000;n-    break;
-s-s-s-  case MCD_S_MODE:n-#iUdef TEST3s-    printk("MCD_S_MODE\n");s-#endiNn-s-    iUR	(st =RmcdS  pus()) != -1) {s-n-      iUR	st & MST_DSK_CHG) {n-	mcdDiskChanged = 1;n-	tocUpToDate =R0;s-	mcd_invalid pe_buffers();s-      }s-s-    set_mode_immediately:n-n-      iUR		st & MST_DOOR_OPEN) || !	st & MST_READY)) {n-	mcdDiskChanged = 1;n-	tocUpToDate =R0;s-	iUR	mcd_transfer_is_active) {
-	  mcd_y  pe =RMCD_S_START;
-	  gotoCimmediately;
-	}s-	printk(	st & MST_DOOR_OPEN) ? "mcd: door open\n" : "mcd: disk removed\n");s-	mcd_y  pe =RMCD_S_IDLE;s-	whi 
 (CURRENT_VALID)s-	  )nd_requurt(0);n-	gotoCout;s-      }s-s-      outb(MCMD_SET_MODE, MCDPORT(0));o-      outb(1, MCDPORT(0));o-      mcd_mode = 1;o-      mcd_y  pe =RMCD_S_READ;M-      McdTimeout =R3000;n-s-    }s-    break;
-s+set_mode_immediately:n+			iUR		st & MST_DOOR_OPEN) || !	st & MST_READY)) {n+				mcdDiskChanged = 1;n+				tocUpToDate =R0;s+				iUR	mcd_transfer_is_active) {
+					mcd_y  pe =RMCD_S_START;
+					gotoCimmediately;
+				}
+				printk(KERN_INFO);n+				printk(	st & MST_DOOR_OPEN) ?n+				       "mcd: door open\n" :n+				       "mcd: disk removed\n");s+				mcd_y  pe =RMCD_S_IDLE;s+				whi 
 (CURRENT_VALID)s+					)nd_requurt(0);n+				gotoCout;s+			}
+			outb(MCMD_SET_MODE, MCDPORT(0));o+			outb(1, MCDPORT(0));o+			mcd_mode = 1;o+			mcd_y  pe =RMCD_S_READ;M+			McdTimeout =R3000;n+		}n+		break;
 n+	case MCD_S_READ:n+		test3(printk("MCD_S_READ\n"));
+		iUR	(st =RmcdS  pus()) != -1) {s+			iUR	st & MST_DSK_CHG) {n+				mcdDiskChanged = 1;n+				tocUpToDate =R0;s+				mcd_invalid pe_buffers();s+			}s s-  case MCD_S_READ:n-#iUdef TEST3s-    printk("MCD_S_READ\n");
-#endiNn+read_immediately:n+			iUR		st & MST_DOOR_OPEN) || !	st & MST_READY)) {n+				mcdDiskChanged = 1;n+				tocUpToDate =R0;s+				iUR	mcd_transfer_is_active) {
+					mcd_y  pe =RMCD_S_START;
+					gotoCimmediately;
+				}
+				printk(KERN_INFO);n+				printk(	st & MST_DOOR_OPEN) ?n+				       "mcd: door open\n" :n+				       "mcd: disk removed\n");s+				mcd_y  pe =RMCD_S_IDLE;s+				whi 
 (CURRENT_VALID)s+					)nd_requurt(0);n+				gotoCout;s+			}
 s-    iUR	(st =RmcdS  pus()) != -1) {s+			iUR	CURRENT_VALID) {
+				s ruct mcd_Play_msf msf;s+				mcd_next_bnC= CURRENT->sector / 4;s+				hsg2msf(mcd_next_bn, &msf.start);s+				msf.end.minC= ~0;s+				msf.end.secC= ~0;s+				msf.end.frame =R~0;s+				sendMcdCmd(MCMD_DATA_READ, &msf);s+				mcd_y  pe =RMCD_S_DATA;n+				McdTimeout =RREAD_TIMEOUT;
+			} )lse {n+				mcd_y  pe =RMCD_S_STOP;n+				gotoCimmediately;
+			}s s-      iUR	st & MST_DSK_CHG) {n-	mcdDiskChanged = 1;n-	tocUpToDate =R0;s-	mcd_invalid pe_buffers();s-      }s+		}n+		break;
 n-    read_immediately:n+	case MCD_S_DATA:n+		test3(printk("MCD_S_DATA\n"));
+		st = inb(MCDPORT(1)) & (MFL_STATUSorDATA);
+d pa_immediately:n+		test5(printk("S  pusC%02x\n",Ts ))
+		switch (s ) {n+		case MFL_DATA:s+#iUdef WARN_IF_READ_FAILUREs+			iUR	McdTries ==R5)s+				printk(KERN_WARNING "mcd: read of block %d Gailed\n",n+				       mcd_next_bn);s+#endiNn+			iUR	!McdTries--) {
+				printk(KERN_ERR "mcd: read of block %d Gailed,Cgiving up\n", mcd_next_bn);s+				iUR	mcd_transfer_is_active) {
+					McdTries =R0;s+					break;
+				}
+				iUR	CURRENT_VALID)s+					)nd_requurt(0);n+				McdTries =R5;s+			}
+			mcd_y  pe =RMCD_S_START;
+			McdTimeout =RREAD_TIMEOUT;
+			gotoCimmediately;
 n-      iUR		st & MST_DOOR_OPEN) || !	st & MST_READY)) {n-	mcdDiskChanged = 1;n-	tocUpToDate =R0;s-	iUR	mcd_transfer_is_active) {
-	  mcd_y  pe =RMCD_S_START;
-	  gotoCimmediately;
-	}s-	printk(	st & MST_DOOR_OPEN) ? "mcd: door open\n" : "mcd: disk removed\n");s-	mcd_y  pe =RMCD_S_IDLE;s-	whi 
 (CURRENT_VALID)s-	  )nd_requurt(0);n-	gotoCout;s-      }s-s-      iUR	CURRENT_VALID)C{s-	s ruct mcd_Play_msf msf;s-	mcd_next_bnC= CURRENTC-> sector / 4;s-	hsg2msf(mcd_next_bn, &msf.start);s-	msf.end.minC= ~0;s-	msf.end.secC= ~0;s-	msf.end.frame =R~0;s-	sendMcdCmd(MCMD_DATA_READ, &msf);s-	mcd_y  pe =RMCD_S_DATA;n-	McdTimeout =RREAD_TIMEOUT;
-      } )lse {s-	mcd_y  pe =RMCD_S_STOP;n-	gotoCimmediately;
-      }s-s-    }n-    break;
-s-s-  case MCD_S_DATA:s-#iUdef TEST3s-    printk("MCD_S_DATA\n");s-#endiNn+		case MFL_STATUSorDATA:
+			break;
 s-    st = inb(MCDPORT(1)) & (MFL_STATUSorDATA);
-  d pa_immediately:n-#iUdef TEST5s-    printk("S  pusC%02x\n",s );s-#endiNn-    switch (s ) {n+		default:
+			McdTries =R5;s+			iUR	!CURRENT_VALID && mcd_buf_inC== mcd_buf_out) {n+				mcd_y  pe =RMCD_S_STOP;n+				gotoCimmediately;
+			}s+			mcd_buf_bn[mcd_buf_in] =R-1;n+			insb(MCDPORT(0), mcd_buf + 2048 * mcd_buf_in,n+				  2048);o+			mcd_buf_bn[mcd_buf_in] =Rmcd_next_bn++;s+			iUR	mcd_buf_out == -1)
+				mcd_buf_out =Rmcd_buf_in;o+			mcd_buf_in =Rmcd_buf_in + 1 ==RMCD_BUF_SIZ ? 0 : mcd_buf_in + 1;s+			iUR	!mcd_transfer_is_active) {
+				whi 
 (CURRENT_VALID)C{s+					mcd_transfer();s+					iUR	CURRENT->nr_sectors == 0)n+						end_requurt(1);o+					)lsen+						break;
+				}
+			}s s-    case MFL_DATA:s-#iUdef WARN_IF_READ_FAILUREs-      iUR	McdTries ==R5)s-	printk("mcd: read of block %d Gailed\n", mcd_next_bn);s-#endiNn-      iUR	!McdTries--) {s-	printk("mcd: read of block %d Gailed,Cgiving up\n", mcd_next_bn);s-	iUR	mcd_transfer_is_active) {s-	  McdTries =R0;s-	  break;
-	}s-	iUR	CURRENT_VALID)s-	  )nd_requurt(0);n-	McdTries =R5;n-      }n-      mcd_y  pe =RMCD_S_START;
-      McdTimeout =RREAD_TIMEOUT;
-      gotoCimmediately;
-s-    case MFL_STATUSorDATA:
-      break;
-
-    default:
-      McdTries =R5;n-      iUR	!CURRENT_VALID && mcd_buf_inC== mcd_buf_out) {n-	mcd_y  pe =RMCD_S_STOP;n-	gotoCimmediately;
-      }s-      mcd_buf_bn[mcd_buf_in] =R-1;n-      READ_DATA(MCDPORT(0), mcd_buf + 2048 * mcd_buf_in, 2048);o-      mcd_buf_bn[mcd_buf_in] =Rmcd_next_bn++;s-      iUR	mcd_buf_out == -1)
-	mcd_buf_out =Rmcd_buf_in;o-      mcd_buf_in =Rmcd_buf_in + 1 ==RMCD_BUF_SIZ ? 0 : mcd_buf_in + 1;s-      iUR	!mcd_transfer_is_active) {s-	whi 
 (CURRENT_VALID)C{s-	  mcd_transfer();s-	  iUR	CURRENTC-> nr_sectors == 0)n-	    )nd_requurt(1);o-	  )lsen-	    break;
-	}s-      }s-s-      iUR	CURRENT_VALIDn-	  && (CURRENTC-> sector / 4 <Rmcd_next_bn || s-	      CURRENTC-> sector / 4 >Rmcd_next_bn + 16)) {n-	mcd_y  pe =RMCD_S_STOP;n-	gotoCimmediately;
-      }s-      McdTimeout =RREAD_TIMEOUT;
-#iUdef DOUBLE_QUICK_ONLYs-      iUR	MCMD_DATA_READ != MCMD_PLAY_READ)n-#endiNn-      {
-	int c unt= QUICK_LOOP_COUNT;s-	whi 
 (c unt--) {s-          QUICK_LOOP_DELAY;s-	  iUR	(st =R(inb(MCDPORT(1))) & (MFL_STATUSorDATA)) != (MFL_STATUSorDATA)) {s-#   iUdef TEST4n-/*	    printk("Quickloop success atR%d\n",QUICK_LOOP_COUNT-c unt); */s-	    printk(" %d ",QUICK_LOOP_COUNT-c unt);s-#   endiNn-	    gotoCd pa_immediately;
-	  }s-	}s-#   iUdef TEST4n-/*      printk("Quickloop ended atR%d\n",QUICK_LOOP_COUNT); */s-	printk("ended ");s-#   endiNn-      }n-      break;
-    }s-    break;
+			iUR	CURRENT_VALID
+			    && (CURRENT->sector / 4 <Rmcd_next_bn ||
+				CURRENT->sector / 4 >Rmcd_next_bn + 16)) {n+				mcd_y  pe =RMCD_S_STOP;n+				gotoCimmediately;
+			}s+			McdTimeout =RREAD_TIMEOUT;
+			{
+				int c unt = QUICK_LOOP_COUNT;s+				whi 
 (c unt--) {s+					QUICK_LOOP_DELAY;s+					iUR	(st =R(inb(MCDPORT(1))) & (MFL_STATUSorDATA)) != (MFL_STATUSorDATA)) {s+						test4(printk(" %d ", QUICK_LOOP_COUNT - c unt));n+						gotoCd pa_immediately;
+					}
+				}
+				test4(printk("ended "));o+			}
+			break;
+		}n+		break;
 n+	case MCD_S_STOP:n+		test3(printk("MCD_S_STOP\n"));
+		iUR	!mitsumi_bug_93_wait)
+			gotoCdo_not_work_ar und_mitsumi_bug_93_1;s+n+		McdTimeout =Rmitsumi_bug_93_wait;s+		mcd_y  pe =R9 + 3 + 1;s+		break;
 n+	case 9 + 3 + 1:
+		iUR	McdTimeout)
+			break;
 s-  case MCD_S_STOP:n-#iUdef TEST3s-    printk("MCD_S_STOP\n");s-#endiNn+do_not_work_ar und_mitsumi_bug_93_1:
+		outb(MCMD_STOP, MCDPORT(0));o+		iUR	(inb(MCDPORT(1)) & MFL_STATUSorDATA) ==RMFL_STATUS)C{s+			int i = 4096;o+			do {
+				inb(MCDPORT(0));
+			} whi 
 ((inb(MCDPORT(1)) & MFL_STATUSorDATA) ==RMFL_STATUS && --i);s+			outb(MCMD_STOP, MCDPORT(0));o+			iUR	(inb(MCDPORT(1)) & MFL_STATUSorDATA) ==RMFL_STATUS)C{s+				i = 4096;o+				do {
+					inb(MCDPORT(0));
+				} whi 
 ((inb(MCDPORT(1)) & MFL_STATUSorDATA) ==RMFL_STATUS && --i);s+				outb(MCMD_STOP, MCDPORT(0));o+			}s+		}n n-#iUdef WORK_AROUND_MITSUMI_BUG_93s-    iUR	!mitsumi_bug_93_wait)
-      gotoCdo_not_work_ar und_mitsumi_bug_93_1;s-o-    McdTimeout =Rmitsumi_bug_93_wait;s-    mcd_y  pe =R9+3+1;n-    break;
-s-  case 9+3+1:s-    iUR	McdTimeout)
-      break;
-
-  do_not_work_ar und_mitsumi_bug_93_1:
-#endiN /*CWORK_AROUND_MITSUMI_BUG_93 */s-s-    outb(MCMD_STOP, MCDPORT(0));o-n-#iUdef WORK_AROUND_MITSUMI_BUG_92s-    iUR	(inb(MCDPORT(1)) & MFL_STATUSorDATA) ==RMFL_STATUS)C{s-      int i = 4096;o-      do {
-	inb(MCDPORT(0));
-      } whi 
 ((inb(MCDPORT(1)) & MFL_STATUSorDATA) ==RMFL_STATUS && --i);s-      outb(MCMD_STOP, MCDPORT(0));o-      iUR		inb(MCDPORT(1)) & MFL_STATUSorDATA) ==RMFL_STATUS)C{s-	i = 4096;o-	do {
-	  inb(MCDPORT(0));
-	} whi 
 ((inb(MCDPORT(1)) & MFL_STATUSorDATA) ==RMFL_STATUS && --i);s-	outb(MCMD_STOP, MCDPORT(0));o-      }s-    }s-#endiN /*CWORK_AROUND_MITSUMI_BUG_92 */s-s-    mcd_y  pe =RMCD_S_STOPPING;o-    McdTimeout =R1000;n-    break;
-s-  case MCD_S_STOPPING:n-#iUdef TEST3s-    printk("MCD_S_STOPPING\n");s-#endiNn+		mcd_y  pe =RMCD_S_STOPPING;o+		McdTimeout =R1000;n+		break;
+n+	case MCD_S_STOPPING:n+		test3(printk("MCD_S_STOPPING\n"));
+		iUR	(st =RmcdS  pus()) == -1 && McdTimeout)
+			break;
 s-    iUR	(st =RmcdS  pus()) == -1 && McdTimeout)
-      break;
+		iUR	(st != -1) && (st & MST_DSK_CHG)) {n+			mcdDiskChanged = 1;n+			tocUpToDate =R0;s+			mcd_invalid pe_buffers();s+		}
+		iUR	!mitsumi_bug_93_wait)
+			gotoCdo_not_work_ar und_mitsumi_bug_93_2;
 s-    iUR	(st != -1) && (st & MST_DSK_CHG)) {n-      mcdDiskChanged = 1;n-      tocUpToDate =R0;s-      mcd_invalid pe_buffers();s-    }s-s-#iUdef WORK_AROUND_MITSUMI_BUG_93s-    iUR	!mitsumi_bug_93_wait)
-      gotoCdo_not_work_ar und_mitsumi_bug_93_2;s-o-    McdTimeout =Rmitsumi_bug_93_wait;s-    mcd_y  pe =R9+3+2;n-    break;
-s-  case 9+3+2:s-    iUR	McdTimeout)
-      break;
-
-    s  = -1;
-
-  do_not_work_ar und_mitsumi_bug_93_2:
-#endiN /*CWORK_AROUND_MITSUMI_BUG_93 */s-s-#iUdef TEST3s-    printk("CURRENT_VALID %d mcd_mode %d\n",n-	   CURRENT_VALID, mcd_mode);s-#endiNn+		McdTimeout =Rmitsumi_bug_93_wait;s+		mcd_y  pe =R9 + 3 + 2;n+		break;
 n-    iUR	CURRENT_VALID)C{s-      iUR	st != -1) {s-	iUR	mcd_mode ==R1)s-	  gotoCread_immediately;s-	)lses-	  gotoCset_mode_immediately;
-      } )lse {s-	mcd_y  pe =RMCD_S_START;
-	McdTimeout =R1;o-      }s-    } )lse {s-      mcd_y  pe =RMCD_S_IDLE;s-      gotoCout;s-    }n-    break;
-s-  default:
-    printk("mcd: invalid y  pe %d\n", mcd_y  pe);n-    gotoCout;s-  }s-s- ret:
-  iUR	!McdTimeout--) {s-    printk("mcd: timeout in s  pe %d\n", mcd_y  pe);n-    mcd_y  pe =RMCD_S_STOP;n-  }n+	case 9 + 3 + 2:
+		iUR	McdTimeout)
+			break;
+		st = -1;
 s-  SET_TIMER(mcd_poll, 1);n+do_not_work_ar und_mitsumi_bug_93_2:
+		test3(printk("CURRENT_VALID %d mcd_mode %d\n", CURRENT_VALID, mcd_mode));s+		iUR	CURRENT_VALID)C{s+			iUR	st != -1) {s+				iUR	mcd_mode ==R1)s+					gotoCread_immediately;s+				)lsen+					gotoCset_mode_immediately;
+			} )lse {n+				mcd_y  pe =RMCD_S_START;
+				McdTimeout =R1;o+			}s+		} )lse {n+			mcd_y  pe =RMCD_S_IDLE;s+			gotoCout;s+		}n+		break;
+	default:
+		printk(KERN_ERR "mcd: invalid y  pe %d\n", mcd_y  pe);n+		gotoCout;s+	}n+ret:
+	iUR	!McdTimeout--) {s+		printk(KERN_WARNING "mcd: timeout in s  pe %d\n", mcd_y  pe);n+		mcd_y  pe =RMCD_S_STOP;n+	}s+	mcd_timer.functt * = mcd_poll;s+	mod_timer(&mcd_timer, jiffies + 1);oCout:
-  retnsi;s+	retnsi;n }n s-s-s-y  pF TES <M-mcd_invalid pe_buffers(ES <)s+y  pF TES < mcd_invalid pe_buffers(ES <)s {s-  int i;s-  G_SM(i = 0; iT<RMCD_BUF_SIZ; ++i)s-    mcd_buf_bn[i] =R-1;n-  mcd_buf_out =R-1;n+	int i;s+	G_SM(i = 0; iT<RMCD_BUF_SIZ; ++i)s+		mcd_buf_bn[i] =R-1;n+	mcd_buf_out =R-1;n }n s-s /*s  * Open the device special fi 
.  Check that a disk is in.
  */s-y  pF Tint mcd_open(s ruct cdrom_device_inG_ * cdi, int purpose)s+y  pF Tint mcd_open(s ruct cdrom_device_inG_ *cdi, int purpose)s {
-	int st, c unt=0;s+	int s , c unt = 0;n 	iUR	mcdPresent == 0)n-		retnsi -ENXIO;			/* no hardware */s+		retnsi -ENXIO;	/* no hardware */s s-        MOD_INC_USE_COUNT;s+	MOD_INC_USE_COUNT;s s-        iUR	mcd_open_c unt || mcd_y  pe !=RMCD_S_IDLE)s+	iUR	mcd_open_c unt || mcd_y  pe !=RMCD_S_IDLE)s 		gotoCbump_c unt;s s-        mcd_invalid pe_buffers();s-        do {
-                st = st pusCmd();               /* check drive s  pus */s-                iUR	st == -1)
-                        gotoCerr_out;            /* drive doesn't respond */s-                iUR		st & MST_READY) == 0) {    /* no disk? wait a sec... */s-                        current->y  pe =RTASK_INTERRUPTIBLE;s-                        schedule_timeout(HZ);s-                }s-        } whi 
 ((	st & MST_READY) == 0) && c unt++T<RMCD_RETRY_ATTEMPTS);n+	mcd_invalid pe_buffers();s+	do {
+		st = st pusCmd();	/* check drive s  pus */s+		iUR	st == -1)
+			gotoCerr_out;	/* drive doesn't respond */s+		iUR		st & MST_READY) == 0) {	/* no disk? wait a sec... */s+			current->y  pe =RTASK_INTERRUPTIBLE;s+			schedule_timeout(HZ);s+		}n+	} whi 
 ((	st & MST_READY) == 0) && c unt++T<RMCD_RETRY_ATTEMPTS);n s-        iUR	updateToc() < 0)s-                       gotoCerr_out;s+	iUR	updateToc() < 0)s+		gotoCerr_out;s s bump_c unt:s 	++mcd_open_c unt;n 	retnsi 0;o sCerr_out:s-        MOD_DEC_USE_COUNT;s+	MOD_DEC_USE_COUNT;s 	retnsi -EIO;s }s s@@ -1130,11 +1010,12 @@s /*s  * On close, we flush all mcd blocks G0xm thecbufferCcache.
  */s-y  pF TES < mcd_release(s ruct cdrom_device_inG_ * cdi)s-{ MOD_DEC_USE_COUNT;s-  iUR	!--mcd_open_c unt) {n-	mcd_invalid pe_buffers();s-  }s+y  pF TES < mcd_release(s ruct cdrom_device_inG_ *cdi)s+{s+	iUR	!--mcd_open_c unt) {n+		mcd_invalid pe_buffers();s+	}s+	MOD_DEC_USE_COUNT;s }n s s@@ -1143,23 +1024,23 @@s  * and is used in mcd_exit as well. */s y  pF TES < cleanup(int level)s {s-  switch (level) {s-  case 3:s-    iUR	unregister_cdrom(&mcd_inG_)) {n-      printk(KERN_WARNING "Can't unregister cdrom mcd\n");
-      retnsi;n-    }n-    free_irq	mcd_irq, NULL);
-  case 2:s-    release_regt *(mcd_port,4);
-  case 1:s-    iUR	devfs_unregister_blkdev(MAJOR_NR, "mcd")) {n-      printk(KERN_WARNING "Can't unregister maj_SMmcd\n");
-      retnsi;n-    }n-    blk_cleanup_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR));o-  default:;n-  }n+	switch (level) {s+	case 3:
+		iUR	unregister_cdrom(&mcd_inG_)) {n+			printk(KERN_WARNING "Can't unregister cdrom mcd\n");
+			retnsi;s+		}n+		free_irq	mcd_irq, NULL);
+	case 2:
+		release_regt *(mcd_port, 4);
+	case 1:
+		iUR	devfs_unregister_blkdev(MAJOR_NR, "mcd")) {n+			printk(KERN_WARNING "Can't unregister maj_SMmcd\n");
+			retnsi;s+		}n+		blk_cleanup_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR));o+	default:;o+	}
 }n s s@@ -1175,21 +1056,18 @@s 	char msg[80];s s 	iUR	mcd_port <= 0 || mcd_irq <= 0)C{s-	  printk("skip mcd_init\n");
-          retnsi -EIO;s+		printk(KERN_INFO "mcd: notRprobing.\n");
+		retnsi -EIO;s 	}o s-	iUR	devfs_register_blkdev(MAJOR_NR, "mcd", &cdrom_fops) != 0)s-	{s-		printk("Unab 
 toCget maj_SM%d G_S Mitsumi CD-ROM\n",n-		       MAJOR_NR);s-                retnsi -EIO;s-	}s-        iUR	check_regt *(mcd_port, 4))C{s-	  cleanup(1);o-	  printk("Init Gailed,CI/OCport (%X) ale ady in use\n",n-		 mcd_port);
-          retnsi -EIO;s+	iUR	devfs_register_blkdev(MAJOR_NR, "mcd", &cdrom_fops) != 0) {s+		printk(KERN_ERR "mcd: Unab 
 toCget maj_SM%d G_S Mitsumi CD-ROM\n", MAJOR_NR);s+		retnsi -EIO;s+	}s+	iUR	check_regt *(mcd_port, 4))C{s+		cleanup(1);o+		printk(KERN_ERR "mcd: Initializatt * Gailed,CI/OCport (%X) ale ady in use\n", mcd_port);
+		retnsi -EIO;s 	}o s 	blksize_size[MAJOR_NR] =Rmcd_blocksizes;s@@ -1198,106 +1076,103 @@s 
 	/* check G_S card */s s-	outb(0, MCDPORT(1));			/* send reset */s+	outb(0, MCDPORT(1));	/* send reset */s 	G_SM(c unt = 0; c unt < 2000000; c unt++)n-		(ES <) inb(MCDPORT(1));		/*Cdelay a bit */s+		(ES <) inb(MCDPORT(1));	/*Cdelay a bit */s s-	outb(0x40, MCDPORT(0));	                /* send get-y  p cmd */s+	outb(0x40, MCDPORT(0));	/* send get-y  p cmd */s 	G_SM(c unt = 0; c unt < 2000000; c unt++)n 		iUR	!(inb(MCDPORT(1)) & MFL_STATUS))s 			break;
 n 	iUR	c unt >= 2000000) {
-		printk("Init Gailed. No mcd device  p 0x%x irq %d\n",n-		     mcd_port, mcd_irq);s+		printk(KERN_INFO "mcd: initialisatt * Gailed - No mcd device  p 0x%x irq %d\n",n+		       mcd_port, mcd_irq);s 		cleanup(1);o-                retnsi -EIO;s+		retnsi -EIO;s 	}o-	c unt = inb(MCDPORT(0));		/*Cpick up theCs  pus */s-	
-	outb(MCMD_GET_VERSION,MCDPORT(0));
-	G_S(c unt=0;c unt<3;c unt++)n-		if(getValue(result+c unt)) {
-			printk("mitsumi get verst * Gailed  p 0x%x\n",n+	c unt = inb(MCDPORT(0));	/*Cpick up theCs  pus */s+s+	outb(MCMD_GET_VERSION, MCDPORT(0));o+	G_SM(c unt = 0; c unt < 3; c unt++)n+		iUR	getValue(result + c unt)) {
+			printk(KERN_ERR "mcd: mitsumi get verst * Gailed  p 0x%x\n",n 			       mcd_port);s-                        cleanup(1);o-                        retnsi -EIO;s-		}	s+			cleanup(1);o+			retnsi -EIO;s+		}o s 	iUR	result[0] == result[1] && result[1] == result[2]) {
 		cleanup(1);o-                retnsi -EIO;s+		retnsi -EIO;s 	}o n-	mcdVerst *=result[2];n+	mcdVerst * = result[2];o s-	iUR	mcdVerst * >=4)s-		outb(4,MCDPORT(2)); 	/* magF Thappens */s+	iUR	mcdVerst * >= 4)
+		outb(4, MCDPORT(2));	/*CmagF Thappens */s 
 	/* don't get theCIRQ until we know G_SMsure the drive is there */s s-	iUR	requurt_irq	mcd_irq, mcd_interrupt, SA_INTERRUPT, "Mitsumi CD", NULL))s-	{s-		printk("Unab 
 toCget IRQ%d G_S Mitsumi CD-ROM\n", mcd_irq);s+	iUR	requurt_irq	mcd_irq, mcd_interrupt, SA_INTERRUPT, "Mitsumi CD", NULL)) {s+		printk(KERN_ERR "mcd: Unab 
 toCget IRQ%d G_S Mitsumi CD-ROM\n", mcd_irq);s 		cleanup(1);o-                retnsi -EIO;s+		retnsi -EIO;s 	}o n-        iUR	result[1] == 'D') s-	{s+	iUR	result[1] == 'D') {
 		MCMD_DATA_READ = MCMD_2X_READ;s 		/*CAdded flag to drop to 1x speed iURtoo many errors */s 		mcdDouble =R1;o-        } )lse n+	} )lsen 		mcd_inG_.speed =R1;o 	sprintf(msg, " mcd: Mitsumi %s SpeedCCD-ROM  p port=0x%x,"n-		     " irq=%d\n", mcd_inG_.speed ==R1 ?  "Sing 
" : "Double", mcd_port, mcd_irq);s+		" irq=%d\n", mcd_inG_.speed ==R1 ? "Sing 
" : "Double",n+		mcd_port, mcd_irq);s s 	requurt_regt *(mcd_port, 4, "mcd");s s 	outb(MCMD_CONFIG_DRIVE, MCDPORT(0));o-	outb(0x02,MCDPORT(0));o-	outb(0x00,MCDPORT(0));o+	outb(0x02, MCDPORT(0));o+	outb(0x00, MCDPORT(0));o 	getValue(result);s s 	outb(MCMD_CONFIG_DRIVE, MCDPORT(0));o-	outb(0x10,MCDPORT(0));o-	outb(0x04,MCDPORT(0));o+	outb(0x10, MCDPORT(0));o+	outb(0x04, MCDPORT(0));o 	getValue(result);s s 	mcd_invalid pe_buffers();s 	mcdPresent = 1;
 s-	mcd_inG_.dev = MKDEV(MAJOR_NR,0);n+	mcd_inG_.dev = MKDEV(MAJOR_NR, 0);n s-        iUR	register_cdrom(&mcd_inG_) != 0) {s-              printk("CannotRregister Mitsumi CD-ROM!\n");
-              cleanup(3);
-              retnsi -EIO;s-        }s-        printk(msg);s+	iUR	register_cdrom(&mcd_inG_) != 0) {s+		printk(KERN_ERR "mcd: Unab 
 toCregister Mitsumi CD-ROM.\n");
+		cleanup(3);
+		retnsi -EIO;s+	}s+	printk(msg);s n 	retnsi 0;o }n s s-y  pF TES <M-hsg2msf(long hsg, s ruct msf *msf)s+y  pF TES < hsg2msf(long hsg, s ruct msf *msf)s {
 	hsgC+= 150;s-	msfC-> minC= hsgC/ 4500;n+	msf->minC= hsgC/ 4500;n 	hsgC%= 4500;n-	msfC-> secC= hsgC/ 75;n-	msfC-> frame =RhsgC% 75;n+	msf->secC= hsgC/ 75;n+	msf->frame =RhsgC% 75;n s-	bin2bcd(&msfC-> min);		/*Cconvert toCBCD */s-	bin2bcd(&msfC-> sec);s-	bin2bcd(&msfC-> frame);
+	bin2bcd(&msf->min);	/* convert toCBCD */s+	bin2bcd(&msf->sec);s+	bin2bcd(&msf->frame);
 }n s s-y  pF TES <M-bin2bcd(unsigned char *p)s+y  pF TES < bin2bcd(unsigned char *p)s {M 	int u, t;s n@@ -1306,8 +1181,7 @@s 	*p =Ru | (t << 4);
 }n s-y  pF TintM-bcd2bin(unsigned char bcd)s+y  pF Tint bcd2bin(unsigned char bcd)s {M 	retnsi (bcd >> 4) * 10 + (bcd & 0xF);
 }n@@ -1318,19 +1192,16 @@s  * iURit is e ady.
  */s s-y  pF TintM-mcdS  pus(ES <)s+y  pF Tint mcdS  pus(ES <)s {M 	int i;M 	int s ;s s 	st = inb(MCDPORT(1)) & MFL_STATUS;s-	iUR	!st)
-	{s+	iUR	!s ) {n 		i = inb(MCDPORT(0)) & 0xFF;n 		retnsi i;
-	}s-	)lsen+	} )lsen 		retnsi -1;s }s s@@ -1339,16 +1210,15 @@s  * Send a play or read command to the drive
  */s s-y  pF TES <M-sendMcdCmd(int cmd,Ts ruct mcd_Play_msf *params)s+y  pF TES < sendMcdCmd(int cmd,Ts ruct mcd_Play_msf *params)s {n 	outb(cmd,TMCDPORT(0));o-	outb(paramsC-> start.min,TMCDPORT(0));o-	outb(paramsC-> start.sec,TMCDPORT(0));o-	outb(paramsC-> start.frame,TMCDPORT(0));o-	outb(paramsC-> end.min,TMCDPORT(0));o-	outb(paramsC-> end.sec,TMCDPORT(0));o-	outb(paramsC-> end.frame, MCDPORT(0));o+	outb(params->y  rt.min,TMCDPORT(0));o+	outb(params->y  rt.sec,TMCDPORT(0));o+	outb(params->y  rt.frame, MCDPORT(0));o+	outb(params->end.min,TMCDPORT(0));o+	outb(params->end.sec,TMCDPORT(0));o+	outb(params->end.frame, MCDPORT(0));o }n s s@@ -1357,23 +1227,20 @@s  * (see the next routine)s  */s s-y  pF TES <M-mcdS  pTimer(unsigned long dummy)s+y  pF TES < mcdS  pTimer(unsigned long dummy)s {
-	iUR	!(inb(MCDPORT(1)) & MFL_STATUS))s-	{s+	iUR	!(inb(MCDPORT(1)) & MFL_STATUS)) {n 		wake_up(&mcd_waitq);s 		retnsi;n 	}o s 	McdTimeout--;s-	iUR	McdTimeout <= 0)s-	{s+	iUR	McdTimeout <= 0) {n 		wake_up(&mcd_waitq);s 		retnsi;n 	}o-s-	SET_TIMER(mcdS  pTimer, 1);n+	mcd_timer.functt * = mcdS  pTimer;s+	mod_timer(&mcd_timer, jiffies + 1);oC}n s s@@ -1383,13 +1250,13 @@s  * excessive rescheduling.
  */s s-y  pF TintM-getMcdS  pus(int timeout)
+y  pF Tint getMcdS  pus(int timeout)
 {M 	int s ;s s 	McdTimeout =Rtimeout;s-	SET_TIMER(mcdS  pTimer, 1);n+	mcd_timer.functt * = mcdS  pTimer;s+	mod_timer(&mcd_timer, jiffies + 1);oC	sleep_ *(&mcd_waitq);s 	iUR	McdTimeout <= 0)s 		retnsi -1;s@@ -1402,8 +1269,7 @@s 		/* XXX might be an error? look  p q-channel? */s 		audioS  pusC= CDROM_AUDIO_COMPLETED;o s-	iUR	st & MST_DSK_CHG)s-	{s+	iUR	st & MST_DSK_CHG) {n 		mcdDiskChanged = 1;n 		tocUpToDate =R0;s 		audioS  pusC= CDROM_AUDIO_NO_STATUS;s@@ -1415,18 +1281,23 @@s 
 /* gives current s  pe of the drive This functt * is quipe unreliab 
, 
    and should probably be rewritten by someon
, eventually... */s-int mcd_drive_s  pus(s ruct cdrom_device_inG_ * cdi, int slot_nr)s+n+int mcd_drive_s  pus(s ruct cdrom_device_inG_ *cdi, int slot_nr)s {s-  int s ;s+	int s ;s s-  st = st pusCmd();               /* check drive s  pus */s-  iUR	st == -1)
-      retnsi -EIO;            /* drive doesn't respond */s-  iUR		st & MST_READY)) retnsi CDS_DISC_OK;s-  iUR		st & MST_DOOR_OPEN)) retnsi CDS_TRAY_OPEN;s-  iUR		st & MST_DSK_CHG)) retnsi CDS_NO_DISC;s-  iUR		st & MST_BUSY)) retnsi CDS_DRIVE_NOT_READY;
-  retnsi -EIO;s+	st = st pusCmd();	/* check drive s  pus */s+	iUR	st == -1)
+		retnsi -EIO;	/* drive doesn't respond */s+	iUR		st & MST_READY))
+		retnsi CDS_DISC_OK;s+	iUR		st & MST_DOOR_OPEN))
+		retnsi CDS_TRAY_OPEN;s+	iUR		st & MST_DSK_CHG))
+		retnsi CDS_NO_DISC;s+	iUR		st & MST_BUSY))
+		retnsi CDS_DRIVE_NOT_READY;
+	retnsi -EIO;s }s s s@@ -1434,18 +1305,16 @@s  * Read a value G0xm thecdrive.
  */s s-y  pF TintM-getValue(unsigned char *result)
+y  pF Tint getValue(unsigned char *result)
 {s-        int c unt;s+	int c unt;n 	int s;s s 	G_SM(c unt = 0; c unt < 2000; c unt++)n 		iUR	!(inb(MCDPORT(1)) & MFL_STATUS))s 			break;
 n-	iUR	c unt >= 2000)s-	{s+	iUR	c unt >= 2000) {n 		printk("mcd: getValueRtimeout\n");
 		retnsi -1;s 	}n@@ -1455,20 +1324,17 @@s 	retnsi 0;o }n s-s /*s  * Read theccurrent Q-channel inG_.  Also used for reading thes  * tab 
 of contents.
  */s s-intM-GetQChannelInG_(s ruct mcd_Toc *qp)s+int GetQChannelInG_(s ruct mcd_Toc *qp)s {n 	unsigned char notUsed;n 	int retry;
 n-	G_SM(retry = 0; retry <RMCD_RETRY_ATTEMPTS; retry++)n-	{o+	G_SM(retry = 0; retry <RMCD_RETRY_ATTEMPTS; retry++) {n 		outb(MCMD_GET_Q_CHANNEL, MCDPORT(0));o 		iUR	getMcdS  pus(MCD_STATUS_DELAY) != -1)s 			break;
@@ -1477,27 +1343,35 @@s 	iUR	retry >=RMCD_RETRY_ATTEMPTS)s 		retnsi -1;s n-	iUR	getValue(&qpC-> ctrl_addr) < 0) retnsi -1;s-	iUR	getValue(&qpC-> track) < 0) retnsi -1;s-	iUR	getValue(&qpC-> pointIndex) < 0) retnsi -1;s-	iUR	getValue(&qpC-> trackTime.min) < 0) retnsi -1;s-	iUR	getValue(&qpC-> trackTime.sec) < 0) retnsi -1;s-	iUR	getValue(&qpC-> trackTime.frame) < 0) retnsi -1;s-	iUR	getValue(&notUsed) < 0) retnsi -1;s-	iUR	getValue(&qpC-> diskTime.min) < 0) retnsi -1;s-	iUR	getValue(&qpC-> diskTime.sec) < 0) retnsi -1;s-	iUR	getValue(&qpC-> diskTime.frame) < 0) retnsi -1;s+	iUR	getValue(&qp->ctrl_addr) < 0)
+		retnsi -1;s+	iUR	getValue(&qp->track) < 0)
+		retnsi -1;s+	iUR	getValue(&qp->pointIndex) < 0)
+		retnsi -1;s+	iUR	getValue(&qp->trackTime.min) < 0)
+		retnsi -1;s+	iUR	getValue(&qp->trackTime.sec) < 0)
+		retnsi -1;s+	iUR	getValue(&qp->trackTime.frame) < 0)
+		retnsi -1;s+	iUR	getValue(&notUsed) < 0)
+		retnsi -1;s+	iUR	getValue(&qp->diskTime.min) < 0)
+		retnsi -1;s+	iUR	getValue(&qp->diskTime.sec) < 0)
+		retnsi -1;s+	iUR	getValue(&qp->diskTime.frame) < 0)
+		retnsi -1;s s 	retnsi 0;o }n s-s /*s  * Read thectab 
 of contents (TOC) and TOC header iURnecessary
  */s s-y  pF TintM-updateToc()
+y  pF Tint updateToc(ES <)s {M 	iUR	tocUpToDate)s 		retnsi 0;
@@ -1512,18 +1386,15 @@s 	retnsi 0;o }n s-s /*s  * Read thectab 
 of contents header
  */s s-y  pF TintM-GetDiskInG_()
+y  pF Tint GetDiskInG_(ES <)s {M 	int retry;
 n-	G_SM(retry = 0; retry <RMCD_RETRY_ATTEMPTS; retry++)n-	{o+	G_SM(retry = 0; retry <RMCD_RETRY_ATTEMPTS; retry++) {n 		outb(MCMD_GET_DISK_INFO, MCDPORT(0));o 		iUR	getMcdS  pus(MCD_STATUS_DELAY) != -1)s 			break;
@@ -1532,41 +1403,44 @@s 	iUR	retry >=RMCD_RETRY_ATTEMPTS)s 		retnsi -1;s n-	iUR	getValue(&DiskInG_.first) < 0) retnsi -1;s-	iUR	getValue(&DiskInG_.last) < 0) retnsi -1;s+	iUR	getValue(&DiskInG_.first) < 0)
+		retnsi -1;s+	iUR	getValue(&DiskInG_.last) < 0)
+		retnsi -1;s s 	DiskInG_.first = bcd2bin(DiskInG_.first);s 	DiskInG_.last = bcd2bin(DiskInG_.last);s s #iUdef MCD_DEBUG
-printk("Disk InG_: first %d last %d lengthC%02x:%02x.%02x first %02x:%02x.%02x\n",n-	DiskInG_.first,n-	DiskInG_.last,n-	DiskInG_.diskLength.min,n-	DiskInG_.diskLength.sec,n-	DiskInG_.diskLength.frame,n-	DiskInG_.firstTrack.min,n-	DiskInG_.firstTrack.sec,n-	DiskInG_.firstTrack.frame);
+	printk
+	    ("Disk InG_: first %d last %d lengthC%02x:%02x.%02x first %02x:%02x.%02x\n",n+	     DiskInG_.first, DiskInG_.last, DiskInG_.diskLength.min,n+	     DiskInG_.diskLength.sec, DiskInG_.diskLength.frame,n+	     DiskInG_.firstTrack.min, DiskInG_.firstTrack.sec,n+	     DiskInG_.firstTrack.frame);
 #endiNn n-	iUR	getValue(&DiskInG_.diskLength.min) < 0) retnsi -1;s-	iUR	getValue(&DiskInG_.diskLength.sec) < 0) retnsi -1;s-	iUR	getValue(&DiskInG_.diskLength.frame) < 0) retnsi -1;s-	iUR	getValue(&DiskInG_.firstTrack.min) < 0) retnsi -1;s-	iUR	getValue(&DiskInG_.firstTrack.sec) < 0) retnsi -1;s-	iUR	getValue(&DiskInG_.firstTrack.frame) < 0) retnsi -1;s+	iUR	getValue(&DiskInG_.diskLength.min) < 0)
+		retnsi -1;s+	iUR	getValue(&DiskInG_.diskLength.sec) < 0)
+		retnsi -1;s+	iUR	getValue(&DiskInG_.diskLength.frame) < 0)
+		retnsi -1;s+	iUR	getValue(&DiskInG_.firstTrack.min) < 0)
+		retnsi -1;s+	iUR	getValue(&DiskInG_.firstTrack.sec) < 0)
+		retnsi -1;s+	iUR	getValue(&DiskInG_.firstTrack.frame) < 0)
+		retnsi -1;s s 	retnsi 0;o }n s-s /*s  * Read thectab 
 of contents (TOC)
  */s s-y  pF TintM-GetToc()
+y  pF Tint GetToc(ES <)s {M 	int i, px;n 	int limit;s@@ -1578,8 +1452,7 @@s n 	i = DiskInG_.last + 3;
 n-	G_SM(retry = 0; retry <RMCD_RETRY_ATTEMPTS; retry++)n-	{o+	G_SM(retry = 0; retry <RMCD_RETRY_ATTEMPTS; retry++) {n 		outb(MCMD_STOP, MCDPORT(0));o 		iUR	getMcdS  pus(MCD_STATUS_DELAY) != -1)s 			break;
@@ -1588,10 +1461,9 @@s 	iUR	retry >=RMCD_RETRY_ATTEMPTS)s 		retnsi -1;s n-	G_SM(retry = 0; retry <RMCD_RETRY_ATTEMPTS; retry++)n-	{o+	G_SM(retry = 0; retry <RMCD_RETRY_ATTEMPTS; retry++) {n 		outb(MCMD_SET_MODE, MCDPORT(0));o-		outb(0x05, MCDPORT(0));			/* mode: toc */s+		outb(0x05, MCDPORT(0));	/* mode: toc */s 		mcd_mode = 0x05;o 		iUR	getMcdS  pus(MCD_STATUS_DELAY) != -1)s 			break;
@@ -1600,15 +1472,13 @@s 	iUR	retry >=RMCD_RETRY_ATTEMPTS)s 		retnsi -1;s n-	G_SM(limit =R300; limit > 0; limit--)n-	{o+	G_SM(limit =R300; limit > 0; limit--) {n 		iUR	GetQChannelInG_(&qInG_) < 0)s 			break;
 n 		px = bcd2bin(qInG_.pointIndex);o 		iUR	px > 0 && px <RMAX_TRACKS && qInG_.track == 0)n-			iUR	Toc[px].pointIndex == 0)n-			{s+			iUR	Toc[px].pointIndex == 0) {n 				Toc[px] = qInG_;n 				i--;s 			}s@@ -1619,41 +1489,44 @@s s 	Toc[DiskInG_.last + 1].diskTime = DiskInG_.diskLength;s n-	G_SM(retry = 0; retry <RMCD_RETRY_ATTEMPTS; retry++)n-	{o-                outb(MCMD_SET_MODE, MCDPORT(0));o-                outb(0x01, MCDPORT(0));o+	G_SM(retry = 0; retry <RMCD_RETRY_ATTEMPTS; retry++) {n+		outb(MCMD_SET_MODE, MCDPORT(0));o+		outb(0x01, MCDPORT(0));o 		mcd_mode = 1;o-                iUR	getMcdS  pus(MCD_STATUS_DELAY) != -1)s-                        break;
+		iUR	getMcdS  pus(MCD_STATUS_DELAY) != -1)s+			break;
 	}o s #iUdef MCD_DEBUG
-G_SM(i = 1; iT<= DiskInG_.last; i++)n-printk("i = %2d ctl-adr = %02X track %2d px %02X %02X:%02X.%02X    %02X:%02X.%02X\n",n-i, Toc[i].ctrl_addr, Toc[i].track, Toc[i].pointIndex,n-Toc[i].trackTime.min, Toc[i].trackTime.sec, Toc[i].trackTime.frame,n-Toc[i].diskTime.min, Toc[i].diskTime.sec, Toc[i].diskTime.frame);
-G_SM(i = 100; iT<R103; i++)n-printk("i = %2d ctl-adr = %02X track %2d px %02X %02X:%02X.%02X    %02X:%02X.%02X\n",n-i, Toc[i].ctrl_addr, Toc[i].track, Toc[i].pointIndex,n-Toc[i].trackTime.min, Toc[i].trackTime.sec, Toc[i].trackTime.frame,n-Toc[i].diskTime.min, Toc[i].diskTime.sec, Toc[i].diskTime.frame);
+	G_SM(i = 1; iT<= DiskInG_.last; i++)n+		printkn+		    ("i = %2d ctl-adr = %02X track %2d px %02X %02X:%02X.%02X    %02X:%02X.%02X\n",n+		     i, Toc[i].ctrl_addr, Toc[i].track, Toc[i].pointIndex,n+		     Toc[i].trackTime.min, Toc[i].trackTime.sec,n+		     Toc[i].trackTime.frame, Toc[i].diskTime.min,n+		     Toc[i].diskTime.sec, Toc[i].diskTime.frame);
+	G_SM(i = 100; iT<R103; i++)n+		printkn+		    ("i = %2d ctl-adr = %02X track %2d px %02X %02X:%02X.%02X    %02X:%02X.%02X\n",n+		     i, Toc[i].ctrl_addr, Toc[i].track, Toc[i].pointIndex,n+		     Toc[i].trackTime.min, Toc[i].trackTime.sec,n+		     Toc[i].trackTime.frame, Toc[i].diskTime.min,n+		     Toc[i].diskTime.sec, Toc[i].diskTime.frame);
 #endiNn n 	retnsi limit > 0 ? 0 : -1;n }n s-s ES < __exit mcd_exit(ES <)s {s-  cleanup(3);
-  del_timer_sync(&mcd_timer);
+	cleanup(3);
+	del_timer_sync(&mcd_timer);
 }o s #iUdef MODULE
 module_init(mcd_init);s-#endiN s+#endiNn module_exit(mcd_exit);n s-
+MODULE_AUTHOR("Martin Harriss");
+MODULE_LICENSE("GPL");
diNf -u --recursive --new-fi 
 v2.4.9/linux/drivers/cdrom/mcd.h linux/drivers/cdrom/mcd.h
--- v2.4.9/linux/drivers/cdrom/mcd.h	Wed Jul  5 11:24:41 2000
+++ linux/drivers/cdrom/mcd.h	Sun Sep  9R10:43:02 2001s@@ -70,17 +70,6 @@s 
 /* borrowed f0xm hd.c */s s-#define READ_DATA(port, buf, nr) \s-insb(port, buf, nr)s-s-#define SET_TIMER(func, jifs) 				\o-	do {						\o-		mcd_timer.functt * = func;		\o-		mod_timer(&mcd_timer, jiffies + jifs);	\o-	} whi 
 (0)s-s-#define CLEAR_TIMER		del_timer_async(&mcd_timer);
-s #define MAX_TRACKS		104s 
 s ruct msf {s@@ -108,3 +97,10 @@s 	s ruct msf	trackTime;s 	s ruct msf	diskTime;
 };
+n+#define test1(x)n+#define test2(x)n+#define test3(x)n+#define test4(x)n+#define test5(x)n+
diNf -u --recursive --new-fi 
 v2.4.9/linux/drivers/cdrom/mcdx.c linux/drivers/cdrom/mcdx.c
--- v2.4.9/linux/drivers/cdrom/mcdx.c	Tue Jul  3 17:08:19 2001s+++ linux/drivers/cdrom/mcdx.c	Fri Sep  7 09:28:38 2001s@@ -53,7 +53,7 @@s 
 #iU RCSs y  pF Tconst char *mcdx_c_verst *o-		= "$Id: mcdx.c,v 1.21 1997/01/26 07:12:59 davem Exp $";
+    = "$Id: mcdx.c,v 1.21 1997/01/26 07:12:59 davem Exp $";
 #endiNn n #include <linux/verst *.h>s@@ -120,10 +120,10 @@s enumCd pamodes { MODE0, MODE1, MODE2 };
 enumCresetmodes { SOFT, HARD };
 
-const int SINGLE = 0x01;		/*Csing 
 speed drive (FX001S, LU) */s-const int DOUBLE = 0x02;		/*Cdouble speed drive (FX001D, ..? */s-const int DOOR   = 0x04;		/*Cdo_SMlocking capability */s-const int MULTI  = 0x08;		/*Cmulti sessi * capability */s+const int SINGLE = 0x01;	/*Csing 
 speed drive (FX001S, LU) */s+const int DOUBLE = 0x02;	/*Cdouble speed drive (FX001D, ..? */s+const int DOOR = 0x04;		/*Cdo_SMlocking capability */s+const int MULTI = 0x08;		/*Cmulti sessi * capability */s n const unsigned char READ1X = 0xc0;o const unsigned char READ2X = 0xc1;s@@ -159,53 +159,53 @@s 
 s ruct s_drive_s uff {n 	/*Cwaitquuues */s-    wait_quuue_head_t busyq;s-    wait_quuue_head_t lockq;s-    wait_quuue_head_t sleepq;
-s- 	/*Cflags */s-    vol pFle int introk;	/*Cs  pus of last irq operatt * */s-    vol pFle int busy;		/*Cdrive perG_Sms an operatt * */s-    vol pFle int lock;		/*Cexclusive usage */s+	wait_quuue_head_t busyq;s+	wait_quuue_head_t lockq;s+	wait_quuue_head_t sleepq;
+s+	/*Cflags */s+	vol pFle int introk;	/*Cs  pus of last irq operatt * */s+	vol pFle int busy;	/*Cdrive perG_Sms an operatt * */s+	vol pFle int lock;	/*Cexclusive usage */s 
 	/* cd inG_s */s 	s ruct s_diskinG_ di;s 	s ruct s_multi multi;s-	s ruct s_subqcode* toc;	/*Cfirst entry of the toc array */s+	s ruct s_subqcode *toc;	/*Cfirst entry of the toc array */s 	s ruct s_subqcode y  rt;
-    s ruct s_subqcode y op;
-	int xa;					/*C1 iURxa disk */s-	int audio;				/*C1 iURaudio disk */s+	s ruct s_subqcode y op;
+	int xa;			/*C1 iURxa disk */s+	int audio;		/*C1 iURaudio disk */s 	int audios  pus;s 
 	/* `buffer' control */s-    vol pFle int valid;			/*Cpending, ..., values are valid */s-    vol pFle int pending;		/*Cnext sector toCbe read */s-    vol pFle int low_border;	/*Cfirst sector notRtoCbe skipped direct */s-    vol pFle int high_border; /*Cfirst sector `out of area' */s+	vol pFle int valid;	/*Cpending, ..., values are valid */s+	vol pFle int pending;	/*Cnext sector toCbe read */s+	vol pFle int low_border;	/*Cfirst sector notRtoCbe skipped direct */s+	vol pFle int high_border;	/*Cfirst sector `out of area' */s #iUdef AK2s-    vol pFle int int_err;
-#endiN /*CAK2 */s+	vol pFle int int_err;
+#endiN				/*CAK2 */s 
 	/* adds and odds */s-	ES <*Cwreg_d pa;	/*CwCd pa */s-	ES <*Cwreg_reset;	/*CwChardware reset */s-	ES <*Cwreg_hcon;	/*CwChardware conf */s-	ES <*Cwreg_chn;		/*Cw channel */s-	ES <*Crreg_d pa;	/*CrCd pa */s-	ES <*Crreg_s  pus;	/*CrCs  pus */s-s-    int irq;			/*Cirq used by thisCdrive */s-    int minor;			/* minor number of thisCdrive */s-    int present;	    /*Cdrive present and its capabilities */s-    unsigned char readcmd;	/*Cread cmd depends onCsing 
/double speed */s-    unsigned char playcmd;  /*Cplay should alwaysCbe sing 
 speed */s-    unsigned int xxx;      /* set iURchanged, reset whi 
 open */s-    unsigned int yyy;      /* set iURchanged, reset by media_changed */s-    int users;				/*Ckeeps track of open/close */s-    int lastsector;			/* last block accessible */s-    int s  pus;				/* last operatt *'s error /Cs  pus */s-	int readerrs;			/* # of blocks e ad w/o error */s+	void *wreg_d pa;	/*CwCd pa */s+	void *wreg_reset;	/*CwChardware reset */s+	void *wreg_hcon;	/*CwChardware conf */s+	void *wreg_chn;		/*Cw channel */s+	void *rreg_d pa;	/*CrCd pa */s+	void *rreg_s  pus;	/*CrCs  pus */s+n+	int irq;		/*Cirq used by thisCdrive */s+	int minor;		/* minor number of thisCdrive */s+	int present;		/*Cdrive present and its capabilities */s+	unsigned char readcmd;	/*Cread cmd depends onCsing 
/double speed */s+	unsigned char playcmd;	/*Cplay should alwaysCbe sing 
 speed */s+	unsigned int xxx;	/* set iURchanged, reset whi 
 open */s+	unsigned int yyy;	/* set iURchanged, reset by media_changed */s+	int users;		/*Ckeeps track of open/close */s+	int lastsector;		/* last block accessible */s+	int s  pus;		/* last operatt *'s error /Cs  pus */s+	int readerrs;		/* # of blocks e ad w/o error */s };
 
 s@@ -225,299 +225,333 @@s 	s ructure mcdx_dops. */s 
 /* ??? Cexported by the mcdx_sigactt * s ruct */s-y  pF TES < mcdx_intr(int,TES < *,Ts ruct pt_regs*);
+y  pF TES < mcdx_intr(int,TES < *,Ts ruct pt_regs *);s s /*Cexported by fi 
_ops */s-y  pF Tint mcdx_open(s ruct cdrom_device_inG_ * cdi, int purpose);s-y  pF TES < mcdx_close(s ruct cdrom_device_inG_ * cdi);s-y  pF Tint mcdx_media_changed(s ruct cdrom_device_inG_ * cdi, int disc_nr);s-y  pF Tint mcdx_tray_move(s ruct cdrom_device_inG_ * cdi, int positt *);s-y  pF Tint mcdx_lockdo_S(s ruct cdrom_device_inG_ * cdi, int lock);s-y  pF Tint mcdx_audio_ioctl(s ruct cdrom_device_inG_ * cdi, unsigned int cmd,s-                      ES < * arg);
+y  pF Tint mcdx_open(s ruct cdrom_device_inG_ *cdi, int purpose);s+y  pF TES < mcdx_close(s ruct cdrom_device_inG_ *cdi);s+y  pF Tint mcdx_media_changed(s ruct cdrom_device_inG_ *cdi, int disc_nr);s+y  pF Tint mcdx_tray_move(s ruct cdrom_device_inG_ *cdi, int positt *);s+y  pF Tint mcdx_lockdo_S(s ruct cdrom_device_inG_ *cdi, int lock);s+y  pF Tint mcdx_audio_ioctl(s ruct cdrom_device_inG_ *cdi,
+			    unsigned int cmd, ES < *arg);
 s /*Cmisc internal support functt *s */s-y  pF TES < log2msf(unsigned int,Ts ruct cdrom_msf0*);s-y  pF Tunsigned int msf2log(const s ruct cdrom_msf0*);s+y  pF TES < log2msf(unsigned int,Ts ruct cdrom_msf0 *);s+y  pF Tunsigned int msf2log(const s ruct cdrom_msf0 *);s y  pF Tunsigned int uint2bcd(unsigned int);s y  pF Tunsigned int bcd2uint(unsigned char);s-y  pF Tchar *port(int*);s-y  pF Tint irq	int*);s-y  pF TES < mcdx_delay(s ruct s_drive_s uff*,Tlong jifs);s-y  pF Tint mcdx_transfer(s ruct s_drive_s uff*,Tchar* buf, int sector, int nr_sectors);s-y  pF Tint mcdx_xfer(s ruct s_drive_s uff*,Tchar* buf, int sector, int nr_sectors);s-s-y  pF Tint mcdx_config(s ruct s_drive_s uff*,Tint);s-y  pF Tint mcdx_requurtverst *(s ruct s_drive_s uff*,Ts ruct s_verst **,Tint);s-y  pF Tint mcdx_y op(s ruct s_drive_s uff*,Tint);s-y  pF Tint mcdx_hold(s ruct s_drive_s uff*,Tint);s-y  pF Tint mcdx_reset(s ruct s_drive_s uff*,TenumCresetmodes,Tint);s-y  pF Tint mcdx_yetdrivemode(s ruct s_drive_s uff*,TenumCdrivemodes,Tint);s-y  pF Tint mcdx_yetd pamode(s ruct s_drive_s uff*,TenumCd pamodes,Tint);s-y  pF Tint mcdx_requurtsubqcode(s ruct s_drive_s uff*,Ts ruct s_subqcode*,Tint);s-y  pF Tint mcdx_requurtmultidiskinG_(s ruct s_drive_s uff*,Ts ruct s_multi*,Tint);s-y  pF Tint mcdx_requurttocd pa(s ruct s_drive_s uff*,Ts ruct s_diskinG_*,Tint);s-y  pF Tint mcdx_gets  pus(s ruct s_drive_s uff*,Tint);s-y  pF Tint mcdx_getval(s ruct s_drive_s uff*,Tint to, int delay,Tchar*);s-y  pF Tint mcdx_talk(s ruct s_drive_s uff*,o-		const unsigned char* cmd,Tsize_t,s-        ES < *buffer,Tsize_tTsize,s-        unsigned int timeout,Tint);s-y  pF Tint mcdx_readtoc(s ruct s_drive_s uff*);s-y  pF Tint mcdx_playtrk(s ruct s_drive_s uff*,Tconst s ruct cdrom_ti*);s-y  pF Tint mcdx_playmsf(s ruct s_drive_s uff*,Tconst s ruct cdrom_msf*);s-y  pF Tint mcdx_yetattentuator(s ruct s_drive_s uff*,Ts ruct cdrom_volctrl*,Tint);s+y  pF Tchar *port(int *);s+y  pF Tint irq	int *);
+y  pF TES < mcdx_delay(s ruct s_drive_s uff *,Tlong jifs);s+y  pF Tint mcdx_transfer(s ruct s_drive_s uff *,Tchar *buf, int sector,
+			 int nr_sectors);s+y  pF Tint mcdx_xfer(s ruct s_drive_s uff *,Tchar *buf, int sector,
+		     int nr_sectors);s+s+y  pF Tint mcdx_config(s ruct s_drive_s uff *,Tint);s+y  pF Tint mcdx_requurtverst *(s ruct s_drive_s uff *,Ts ruct s_verst * *,
+			       int);s+y  pF Tint mcdx_y op(s ruct s_drive_s uff *,Tint);s+y  pF Tint mcdx_hold(s ruct s_drive_s uff *,Tint);s+y  pF Tint mcdx_reset(s ruct s_drive_s uff *,TenumCresetmodes,Tint);s+y  pF Tint mcdx_yetdrivemode(s ruct s_drive_s uff *,TenumCdrivemodes,Tint);s+y  pF Tint mcdx_yetd pamode(s ruct s_drive_s uff *,TenumCd pamodes,Tint);s+y  pF Tint mcdx_requurtsubqcode(s ruct s_drive_s uff *,
+				s ruct s_subqcode *,Tint);s+y  pF Tint mcdx_requurtmultidiskinG_(s ruct s_drive_s uff *,
+				     s ruct s_multi *,Tint);s+y  pF Tint mcdx_requurttocd pa(s ruct s_drive_s uff *,Ts ruct s_diskinG_ *,
+			       int);s+y  pF Tint mcdx_gets  pus(s ruct s_drive_s uff *,Tint);s+y  pF Tint mcdx_getval(s ruct s_drive_s uff *,Tint to, int delay,Tchar *);s+y  pF Tint mcdx_talk(s ruct s_drive_s uff *,
+		     const unsigned char *cmd,Tsize_t,s+		     ES < *buffer,Tsize_tTsize, unsigned int timeout,Tint);s+y  pF Tint mcdx_readtoc(s ruct s_drive_s uff *);s+y  pF Tint mcdx_playtrk(s ruct s_drive_s uff *,Tconst s ruct cdrom_ti *);s+y  pF Tint mcdx_playmsf(s ruct s_drive_s uff *,Tconst s ruct cdrom_msf *);s+y  pF Tint mcdx_yetattentuator(s ruct s_drive_s uff *,
+			       s ruct cdrom_volctrl *,Tint);s s /*Cy  pF TEariab 
s ************************************************/s 
 s  pF Tint mcdx_blocksizes[MCDX_NDRIVES];
 s  pF Tint mcdx_drive_map[][2] =RMCDX_DRIVEMAP;s-y  pF Ts ruct s_drive_s uff* mcdx_y uffp[MCDX_NDRIVES];
-y  pF Ts ruct s_drive_s uff* mcdx_irq_map[16] =o-		{0, 0, 0, 0, 0, 0, 0, 0,o-		0, 0, 0, 0, 0, 0, 0, 0};s+y  pF Ts ruct s_drive_s uff *mcdx_y uffp[MCDX_NDRIVES];
+y  pF Ts ruct s_drive_s uff *mcdx_irq_map[16] = { 0, 0, 0, 0, 0, 0, 0, 0,o+	0, 0, 0, 0, 0, 0, 0, 0
+};
 MODULE_PARM(mcdx, "1-4i");s s y  pF Ts ruct cdrom_device_ops mcdx_dops = {o-		open:			mcdx_open,n-		release:		mcdx_close,o-		media_changed:	mcdx_media_changed,o-		tray_move:		mcdx_tray_move,o-		lock_do_S:		mcdx_lockdo_S,o-		audio_ioctl:	mcdx_audio_ioctl,o-		capability:		CDC_OPEN_TRAY | CDC_LOCK | CDC_MEDIA_CHANGED |n-						CDC_PLAY_AUDIO | CDC_DRIVE_STATUS,o+	open:mcdx_open,n+	release:mcdx_close,o+	media_changed:mcdx_media_changed,o+	tray_move:mcdx_tray_move,o+	lock_do_S:mcdx_lockdo_S,o+	audio_ioctl:mcdx_audio_ioctl,o+	capability:CDC_OPEN_TRAY | CDC_LOCK | CDC_MEDIA_CHANGED |n+	    CDC_PLAY_AUDIO | CDC_DRIVE_STATUS,o };
 
 y  pF Ts ruct cdrom_device_inG_ mcdx_inG_ = {o-	ops:				&mcdx_dops,o-	speed:				2,o-	capacity:			1,o-	name:				"mcdx",o+	ops:&mcdx_dops,o+	speed:2,o+	capacity:1,o+	name:"mcdx",o };
 
 s /*CKERNEL INTERFACE FUNCTIONS **************************************/s 
 s-y  pF Tint mcdx_audio_ioctl(s ruct cdrom_device_inG_ * cdi, unsigned int cmd,s-                      ES < * arg)s+y  pF Tint mcdx_audio_ioctl(s ruct cdrom_device_inG_ *cdi,
+			    unsigned int cmd, ES < *arg)s {M 	s ruct s_drive_s uff *y uffp = mcdx_y uffp[MINOR(cdi->dev)];o s-	iUR	!y uffp->present) retnsi -ENXIO;s+	iUR	!s uffp->present)s+		retnsi -ENXIO;o s-	iUR	stuffp->xxx)s-	{s-		if(-1 == mcdx_requurttocd pa(s uffp, &stuffp->di, 1))s-		{s+	iUR	stuffp->xxx) {n+		iUR	-1 == mcdx_requurttocd pa(s uffp, &stuffp->di, 1)) {n 			stuffp->lastsector =R-1;n-		}s-		)lses-		{s+		} )lse {n 			stuffp->lastsector =R(CD_FRAMESIZE / 512)n-					* msf2log(&stuffp->di.msf_leadout) -R1;o+			    * msf2log(&stuffp->di.msf_leadout) -R1;o 		}o n-		iUR	stuffp->toc)s-		{s+		iUR	stuffp->toc) {n 			kfree	stuffp->toc);n 			stuffp->toc = NULL;n-			iUR	-1 == mcdx_readtoc(s uffp)) retnsi -1;s+			iUR	-1 == mcdx_readtoc(s uffp))
+				retnsi -1;s 		}o n-		stuffp->xxx=0;s+		stuffp->xxx =R0;s 	}o s 	switch (cmd) {
-		case CDROMSTART: {       n-			     xtrace(IOCTL, "ioctl() START\n");
-		        /*CSpin up thecdrive.  Don't think we can do this.s-                 * For now,Tignore it.s-                 */
+	case CDROMSTART:{s+			xtrace(IOCTL, "ioctl() START\n");
+			/* Spin up thecdrive.  Don't think we can do this.s+			   * For now,Tignore it.s+			 */s 			retnsi 0;o 		}o n-		case CDROMSTOP: {s+	case CDROMSTOP:{n 			xtrace(IOCTL, "ioctl() STOP\n");
-            stuffp->audios  pusC= CDROM_AUDIO_INVALID;s+			stuffp->audios  pusC= CDROM_AUDIO_INVALID;s 			iUR	-1 == mcdx_y op(s uffp, 1))s 				retnsi -EIO;s 			retnsi 0;o 		}o n-		case CDROMPLAYTRKIND: {
-			s ruct cdrom_ti *ti=(s ruct cdrom_ti *) arg;s+	case CDROMPLAYTRKIND:{s+			struct cdrom_ti *ti =R(s ruct cdrom_ti *) arg;s n 			xtrace(IOCTL, "ioctl() PLAYTRKIND\n");
 			iUR		ti->cdti_trk0 < stuffp->di.n_first)n-					|| (ti->cdti_trk0 > stuffp->di.n_last)n-					|| (ti->cdti_trk1 < stuffp->di.n_first))n-			retnsi -EINVAL;o+			    || (ti->cdti_trk0 > stuffp->di.n_last)n+			    || (ti->cdti_trk1 < stuffp->di.n_first))n+				retnsi -EINVAL;o 			iUR	ti->cdti_trk1 > stuffp->di.n_last)n-					ti->cdti_trk1 = stuffp->di.n_last;
-            xtrace(PLAYTRK, "ioctl() track %d to %d\n", ti->cdti_trk0, ti->cdti_trk1);o-            retnsi mcdx_playtrk(s uffp, ti);s-        }s+				ti->cdti_trk1 = stuffp->di.n_last;
+			xtrace(PLAYTRK, "ioctl() track %d to %d\n",
+			       ti->cdti_trk0, ti->cdti_trk1);o+			retnsi mcdx_playtrk(s uffp, ti);s+		}o s-        case CDROMPLAYMSF: {s-            s ruct cdrom_msf *msf=(s ruct cdrom_msf *) arg;s+	case CDROMPLAYMSF:{s+			struct cdrom_msf *msf =R(s ruct cdrom_msf *) arg;s 
-            xtrace(IOCTL, "ioctl() PLAYMSF\n");
+			xtrace(IOCTL, "ioctl() PLAYMSF\n");
 
-            iUR		stuffp->audios  pusC== CDROM_AUDIO_PLAY)s-                &&R	-1 == mcdx_hold(s uffp, 1))) retnsi -EIO;s+			iUR		stuffp->audios  pusC== CDROM_AUDIO_PLAY)s+			    &&R	-1 == mcdx_hold(s uffp, 1)))n+				retnsi -EIO;
 
-            msf->cdmsf_min0 =Ruint2bcd(msf->cdmsf_min0);o-            msf->cdmsf_sec0 =Ruint2bcd(msf->cdmsf_sec0);o-            msf->cdmsf_frame0 =Ruint2bcd(msf->cdmsf_frame0);
+			msf->cdmsf_min0 =Ruint2bcd(msf->cdmsf_min0);o+			msf->cdmsf_sec0 =Ruint2bcd(msf->cdmsf_sec0);o+			msf->cdmsf_frame0 =Ruint2bcd(msf->cdmsf_frame0);
 
-            msf->cdmsf_min1 =Ruint2bcd(msf->cdmsf_min1);o-            msf->cdmsf_sec1 =Ruint2bcd(msf->cdmsf_sec1);o-            msf->cdmsf_frame1 =Ruint2bcd(msf->cdmsf_frame1);
+			msf->cdmsf_min1 =Ruint2bcd(msf->cdmsf_min1);o+			msf->cdmsf_sec1 =Ruint2bcd(msf->cdmsf_sec1);o+			msf->cdmsf_frame1 =Ruint2bcd(msf->cdmsf_frame1);
 
-            stuffp->y op.dt.minute =Rmsf->cdmsf_min1;
-            stuffp->y op.dt.second = msf->cdmsf_sec1;
-            stuffp->y op.dt.frame =Rmsf->cdmsf_frame1;s+			stuffp->y op.dt.minute =Rmsf->cdmsf_min1;
+			stuffp->y op.dt.second = msf->cdmsf_sec1;
+			stuffp->y op.dt.frame =Rmsf->cdmsf_frame1;s o-            retnsi mcdx_playmsf(s uffp, msf);s-        }s+			retnsi mcdx_playmsf(s uffp, msf);s+		}o s-        case CDROMRESUME: {s-            xtrace(IOCTL, "ioctl() RESUME\n");
-            retnsi mcdx_playtrk(s uffp, NULL);
-        }s+	case CDROMRESUME:{s+			xtrace(IOCTL, "ioctl() RESUME\n");
+			retnsi mcdx_playtrk(s uffp, NULL);
+		}o n-		case CDROMREADTOCENTRY: {
-			s ruct cdrom_tocentry *entry=(s ruct cdrom_tocentry *) arg;s+	case CDROMREADTOCENTRY:{s+			struct cdrom_tocentry *entry =s+			    (s ruct cdrom_tocentry *) arg;s 			s ruct s_subqcode *tp = NULL;n 			xtrace(IOCTL, "ioctl() READTOCENTRY\n");
 
-            iUR	-1 == mcdx_readtoc(s uffp)) retnsi -1;s+			iUR	-1 == mcdx_readtoc(s uffp))
+				retnsi -1;s 			iUR	entry->cdte_track == CDROM_LEADOUT)n-				tp = &stuffp->toc[stuffp->di.n_last -Rstuffp->di.n_first + 1];s+				tp = &stuffp->toc[stuffp->di.n_last -s+						  stuffp->di.n_first + 1];s 			)lse iUR	entry->cdte_track > stuffp->di.n_lastn-					|| entry->cdte_track < stuffp->di.n_first) retnsi -EINVAL;o-			)lse tp = &stuffp->toc[entry->cdte_track -Rstuffp->di.n_first];s+				 || entry->cdte_track < stuffp->di.n_first)n+				retnsi -EINVAL;o+			)lses+				tp = &stuffp->toc[entry->cdte_track -s+						  stuffp->di.n_first];o s-			iUR	NULL == tp) s+			iUR	NULL == tp)s 				retnsi -EIO;s 			entry->cdte_adr = tp->control;s 			entry->cdte_ctrl = tp->control >> 4;
-            /*CAlwaysCretnsi s uff in MSF, and let theCUniG_Sm cdromcdrivers-                worry about what theCuser actually wants */s-			entry->cdte_addr.msf.minute =Rbcd2uint(tp->dt.minute);s-			entry->cdte_addr.msf.second = bcd2uint(tp->dt.second);s-			entry->cdte_addr.msf.frame =Rbcd2uint(tp->dt.frame);
+			/*CAlwaysCretnsi s uff in MSF, and let theCUniG_Sm cdromcdrivers+			   worry about what theCuser actually wants */s+			entry->cdte_addr.msf.minute =s+			    bcd2uint(tp->dt.minute);s+			entry->cdte_addr.msf.second =s+			    bcd2uint(tp->dt.second);s+			entry->cdte_addr.msf.frame =s+			    bcd2uint(tp->dt.frame);
 			retnsi 0;o 		}o n-		case CDROMSUBCHNL: {
-			s ruct cdrom_subchnl *sub=R(s ruct cdrom_subchnl *)arg;s+	case CDROMSUBCHNL:{s+			struct cdrom_subchnl *sub =s+			    (s ruct cdrom_subchnl *) arg;s 			s ruct s_subqcode q;s n 			xtrace(IOCTL, "ioctl() SUBCHNL\n");
 
-			iUR	-1 == mcdx_requurtsubqcode(s uffp, &q, 2)) s+			iUR	-1 == mcdx_requurtsubqcode(s uffp, &q, 2))s 				retnsi -EIO;s s-            xtrace(SUBCHNL, "audios  pus: %x\n", stuffp->audios  pus);
+			xtrace(SUBCHNL, "audios  pus: %x\n",
+			       s uffp->audios  pus);
 			sub->cdsc_audios  pusC= s uffp->audios  pus;
 			sub->cdsc_adr = q.control;s 			sub->cdsc_ctrl = q.control >> 4;
 			sub->cdsc_trk =Rbcd2uint(q.tno);
 			sub->cdsc_ind = bcd2uint(q.index);o s-            xtrace(SUBCHNL, "trk %d,Tind %d\n",n-                    sub->cdsc_trk, sub->cdsc_ind);
-            /*CAlwaysCretnsi s uff in MSF, and let theCUniG_Sm cdromcdrivers-                worry about what theCuser actually wants */s-			sub->cdsc_absaddr.msf.minute =Rbcd2uint(q.dt.minute);s-			sub->cdsc_absaddr.msf.second = bcd2uint(q.dt.second);s+			xtrace(SUBCHNL, "trk %d,Tind %d\n",n+			       sub->cdsc_trk, sub->cdsc_ind);
+			/*CAlwaysCretnsi s uff in MSF, and let theCUniG_Sm cdromcdrivers+			   worry about what theCuser actually wants */s+			sub->cdsc_absaddr.msf.minute =s+			    bcd2uint(q.dt.minute);s+			sub->cdsc_absaddr.msf.second =s+			    bcd2uint(q.dt.second);s 			sub->cdsc_absaddr.msf.frame =Rbcd2uint(q.dt.frame);
-			sub->cdsc_reladdr.msf.minute =Rbcd2uint(q.tt.minute);s-			sub->cdsc_reladdr.msf.second = bcd2uint(q.tt.second);s+			sub->cdsc_reladdr.msf.minute =s+			    bcd2uint(q.tt.minute);s+			sub->cdsc_reladdr.msf.second =s+			    bcd2uint(q.tt.second);s 			sub->cdsc_reladdr.msf.frame =Rbcd2uint(q.tt.frame);
 			xtrace(SUBCHNL,n-					"msf: abs %02d:%02d:%02d, rel %02d:%02d:%02d\n",n-					sub->cdsc_absaddr.msf.minute, sub->cdsc_absaddr.msf.second,n-					sub->cdsc_absaddr.msf.frame, sub->cdsc_reladdr.msf.minute,n-					sub->cdsc_reladdr.msf.second, sub->cdsc_reladdr.msf.frame);
+			       "msf: abs %02d:%02d:%02d, rel %02d:%02d:%02d\n",n+			       sub->cdsc_absaddr.msf.minute,n+			       sub->cdsc_absaddr.msf.second,n+			       sub->cdsc_absaddr.msf.frame,n+			       sub->cdsc_reladdr.msf.minute,n+			       sub->cdsc_reladdr.msf.second,n+			       sub->cdsc_reladdr.msf.frame);
 
 			retnsi 0;o 		}o n-		case CDROMREADTOCHDR: {
-			s ruct cdrom_tochdr *toc=(s ruct cdrom_tochdr *) arg;s+	case CDROMREADTOCHDR:{s+			struct cdrom_tochdr *toc =s+			    (s ruct cdrom_tochdr *) arg;s n 			xtrace(IOCTL, "ioctl() READTOCHDR\n");
 			toc->cdth_trk0 = stuffp->di.n_first;
 			toc->cdth_trk1 = stuffp->di.n_last;
-			xtrace(TOCHDR, "ioctl() track0 = %d,Ttrack1 = %d\n",n-					stuffp->di.n_first, stuffp->di.n_last);s+			xtrace(TOCHDR,
+			       "ioctl() track0 = %d,Ttrack1 = %d\n",n+			       s uffp->di.n_first, stuffp->di.n_last);s 			retnsi 0;o 		}o n-		case CDROMPAUSE: {s+	case CDROMPAUSE:{n 			xtrace(IOCTL, "ioctl() PAUSE\n");
-			iUR	stuffp->audios  pusC!= CDROM_AUDIO_PLAY) retnsi -EINVAL;o-			iUR	-1 == mcdx_y op(s uffp, 1)) retnsi -EIO;s-            stuffp->audios  pusC= CDROM_AUDIO_PAUSED;
-			iUR	-1 == mcdx_requurtsubqcode(s uffp, &stuffp->y art, 1))
+			iUR	stuffp->audios  pusC!= CDROM_AUDIO_PLAY)n+				retnsi -EINVAL;o+			iUR	-1 == mcdx_y op(s uffp, 1))s+				retnsi -EIO;
+			stuffp->audios  pusC= CDROM_AUDIO_PAUSED;
+			iUR	-1 ==n+			    mcdx_requurtsubqcode(s uffp, &stuffp->y art,s+						 1))s 				retnsi -EIO;s 			retnsi 0;o 		}o n-		case CDROMMULTISESSION: {
-			s ruct cdrom_multisessi * *ms=(s ruct cdrom_multisessi * *) arg;s+	case CDROMMULTISESSION:{s+			struct cdrom_multisessi * *ms =s+			    (s ruct cdrom_multisessi * *) arg;s 			xtrace(IOCTL, "ioctl() MULTISESSION\n");
 			/*CAlwaysCretnsi s uff in LBA, and let theCUniG_Sm cdromcdrivers-				worry about what theCuser actually wants */s+			   worry about what theCuser actually wants */s 			ms->addr.lba =Rmsf2log(&stuffp->multi.msf_last);s 			ms->xa_flag =R!!stuffp->multi.multi;s-			xtrace(MS, "ioctl() (%d,T0x%08x [%02x:%02x.%02x])\n",n-				ms->xa_flag, ms->addr.lba, stuffp->multi.msf_last.minute,n-                    stuffp->multi.msf_last.second,stuffp->multi.msf_last.frame);
- s+			xtrace(MS,
+			       "ioctl() (%d,T0x%08x [%02x:%02x.%02x])\n",n+			       ms->xa_flag, ms->addr.lba,n+			       s uffp->multi.msf_last.minute,n+			       s uffp->multi.msf_last.second,n+			       stuffp->multi.msf_last.frame);
+s 			retnsi 0;o 		}o n-		case CDROMEJECT: {s+	case CDROMEJECT:{n 			xtrace(IOCTL, "ioctl() EJECT\n");
-			iUR	stuffp->users > 1) retnsi -EBUSY;n-			retnsi(mcdx_tray_move(cdi, 1));
+			iUR	stuffp->users > 1)s+				retnsi -EBUSY;n+			retnsi (mcdx_tray_move(cdi, 1));
 		}o s-        case CDROMCLOSETRAY: {s-            xtrace(IOCTL, "ioctl() CDROMCLOSETRAY\n");
-            retnsi(mcdx_tray_move(cdi, 0));o-        }s+	case CDROMCLOSETRAY:{s+			xtrace(IOCTL, "ioctl() CDROMCLOSETRAY\n");
+			retnsi (mcdx_tray_move(cdi, 0));o+		}o s-        case CDROMVOLCTRL: {
-			s ruct cdrom_volctrl *volctrl=(s ruct cdrom_volctrl *)arg;s-            xtrace(IOCTL, "ioctl() VOLCTRL\n");
+	case CDROMVOLCTRL:{s+			struct cdrom_volctrl *volctrl =s+			    (s ruct cdrom_volctrl *) arg;s+			xtrace(IOCTL, "ioctl() VOLCTRL\n");
 s-#iUR0		/*CnotRturted! */s+#iUR0				/*CnotRturted! */s 			/*Cadjust for theCweirdness of workmai (md) */s 			/*Ccan't test it (hs) */s 			volctrl.channel2 =Rvolctrl.channel1;s 			volctrl.channel1 =Rvolctrl.channel3 = 0x00;
 #endiNn-            retnsi mcdx_yetattentuator(s uffp, volctrl, 2);s-        }s+			retnsi mcdx_yetattentuator(s uffp, volctrl, 2);s+		}o n-		default:s-			xwasi("ioctl(): unknown requurtT0x%04x\n", cmd);n-	    	retnsi -EINVAL;o+	default:s+		retnsi -EINVAL;o 	}
 }o s ES < do_mcdx_requurt(requurt_quuue_t * q)
 {s-    int dev;
-    s ruct s_drive_s uff *y uffp;
+	int dev;
+	s ruct s_drive_s uff *y uffp;
 s-  again:
+      again:
 s 	iUR	QUEUE_EMPTY) {n 		xtrace(REQUEST, "end_requurt(0): CURRENT == NULL\n");
@@ -525,237 +559,257 @@s 	}
 s 	iUR	CURRENT->rq_s  pusC== RQ_INACTIVE) {
-		xtrace(REQUEST, "end_requurt(0): rq_s  pusC== RQ_INACTIVE\n");
+		xtrace(REQUEST,s+		       "end_requurt(0): rq_s  pusC== RQ_INACTIVE\n");
 		retnsi;s 	}o s-    INIT_REQUEST;
+	INIT_REQUEST;
 s-    dev =RMINOR(CURRENT->rq_dev);
-    s uffp = mcdx_y uffp[dev];o+	dev =RMINOR(CURRENT->rq_dev);
+	s uffp = mcdx_y uffp[dev];o s 	iUR	(dev < 0)n-		|| (dev >=RMCDX_NDRIVES)n-		|| !stuffpn-		|| (!s uffp->present)) {n+	    || (dev >=RMCDX_NDRIVES)n+	    || !s uffp || (!s uffp->present)) {n 		xwasi("do_requurt(): bad device: %s\n",n-				kdevname(CURRENT->rq_dev));
+		      kdevname(CURRENT->rq_dev));
 		xtrace(REQUEST, "end_requurt(0): bad device\n");
-		end_requurt(0); retnsi;s-    }s+		end_requurt(0);s+		retnsi;s+	}
 s 	iUR	stuffp->audio) {n 		xwasi("do_requurt() attemptRtoCe ad f0xm audio cd\n");
 		xtrace(REQUEST, "end_requurt(0): r ad f0xm audio\n");
-		end_requurt(0); retnsi;s+		end_requurt(0);s+		retnsi;s 	}
 s 	xtrace(REQUEST, "do_requurt() (%lu + %lu)\n",n-			CURRENT->sector, CURRENT->nr_sectors);s+	       CURRENT->sector, CURRENT->nr_sectors);s s-    switch (CURRENT->cmd) {
-      case WRITE:n-	  xwasi("do_requurt(): attemptRtoCwrite to cd!!\n");
-	  xtrace(REQUEST, "end_requurt(0): write\n");
-	  end_requurt(0); retnsi;s-
-      case READ:n-	  stuffp->y apusC= 0;
-	  whi 
 (CURRENT->nr_sectors) {
-	      int i;s-
-	      i = mcdx_transfer(s uffp,n-				  CURRENT->buffer,n-				  CURRENT->sector,
-				  CURRENT->nr_sectors);s-s-		  iUR	iC== -1) {
-			  end_requurt(0);
-			  goto again;
-		  }
-		  CURRENT->sector += i;s-	 	  CURRENT->nr_sectors -= i;s-		  CURRENT->buffer += 	iC* 512);
-	  }
-	  end_requurt(1);
-	  goto again;
-
-	  xtrace(REQUEST, "end_requurt(1)\n");
-	  end_requurt(1);
-	  break;
-
-      default:s-	  panic(MCDX "do_requurt: unknown commaid.\n");
-	  break;
-    }s+	switch (CURRENT->cmd) {
+	case WRITE:n+		xwasi("do_requurt(): attemptRtoCwrite to cd!!\n");
+		xtrace(REQUEST, "end_requurt(0): write\n");
+		end_requurt(0);s+		retnsi;s+
+	case READ:n+		stuffp->y apusC= 0;
+		whi 
 (CURRENT->nr_sectors) {
+			int i;s+
+			i = mcdx_transfer(s uffp,n+					  CURRENT->buffer,n+					  CURRENT->sector,
+					  CURRENT->nr_sectors);s+
+			iUR	iC== -1) {
+				end_requurt(0);s+				goto again;
+			}s+			CURRENT->sector += i;s+			CURRENT->nr_sectors -= i;s+			CURRENT->buffer += 	iC* 512);
+		}s+		end_requurt(1);
+		goto again;
+
+		xtrace(REQUEST, "end_requurt(1)\n");
+		end_requurt(1);
+		break;
+o+	default:s+		panic(MCDX "do_requurt: unknown commaid.\n");
+		break;
+	}o s-    goto again;
+	goto again;
 }n s-y  pF Tint 
-mcdx_open(s ruct cdrom_device_inG_ * cdi, int purpose)
+y  pF Tint mcdx_open(s ruct cdrom_device_inG_ *cdi, int purpose)
 {s-    s ruct s_drive_s uff *y uffp;
+	s ruct s_drive_s uff *y uffp;
 	xtrace(OPENCLOSE, "open()\n");
-    y uffp = mcdx_y uffp[MINOR(cdi->dev)];o-    iUR	!y uffp->present) retnsi -ENXIO;s+	y uffp = mcdx_y uffp[MINOR(cdi->dev)];o+	iUR	!s uffp->present)s+		retnsi -ENXIO;o s 	/* Make the modules looking used ... (thanx bjorn).s 	 * But we shouldn't forgetRtoCdecrement the module counters 	 * on error retnsi */s 	MOD_INC_USE_COUNT;
 s-    /* thisCis only done to test if thecdrive talks with us */s-    iUR	-1 == mcdx_gets  pus(s uffp, 1)) {s+	/*CthisCis only done to test if thecdrive talks with us */s+	iUR	-1 == mcdx_gets  pus(s uffp, 1)) {s 		MOD_DEC_USE_COUNT;
 		retnsi -EIO;s 	}o s-    iUR	stuffp->xxx) {n+	iUR	stuffp->xxx) {n+
+		xtrace(OPENCLOSE, "open() mediaRchanged\n");
+		stuffp->audios  pusC= CDROM_AUDIO_INVALID;s+		stuffp->readcmdC= 0;
+		xtrace(OPENCLOSE, "open() RequurtTmultisessi * inG_\n");
+		iUR	-1 ==n+		    mcdx_requurtmultidiskinG_(s uffp, &stuffp->multi, 6))s+			xinG_("No multidiskinG_\n");
+	} )lse {n+		/*Cmultisessi * ? */s+		iUR	!s uffp->multi.multi)
+			stuffp->multi.msf_last.secondC= 2;n+
+		xtrace(OPENCLOSE, "open() MS: %d,Tlast @ %02x:%02x.%02x\n",n+		       stuffp->multi.multi,n+		       stuffp->multi.msf_last.minute,n+		       s uffp->multi.msf_last.second,n+		       stuffp->multi.msf_last.frame);
+s+		{;
+		}		/*CgotTmultisessi * inG_rmatt * */s+		/*CrequurtTthecdisksctab 
 of contents (aka diskinG_) */s+		iUR	-1 == mcdx_requurttocd pa(s uffp, &stuffp->di, 1)) {n+
+			stuffp->lastsector =R-1;n s-        xtrace(OPENCLOSE, "open() mediaRchanged\n");
-        stuffp->audios  pusC= CDROM_AUDIO_INVALID;s-        stuffp->readcmdC= 0;
-        xtrace(OPENCLOSE, "open() RequurtTmultisessi * inG_\n");
-        iUR	-1 == mcdx_requurtmultidiskinG_( s uffp, &stuffp->multi, 6))s-            	xinG_("No multidiskinG_\n");
 		} )lse {n-            /*Cmultisessi * ? */s-            iUR	!s uffp->multi.multi)
-                stuffp->multi.msf_last.secondC= 2;n-s-            xtrace(OPENCLOSE, "open() MS: %d,Tlast @ %02x:%02x.%02x\n",n-                    stuffp->multi.multi,n-                    stuffp->multi.msf_last.minute,n-                    stuffp->multi.msf_last.second,n-                    stuffp->multi.msf_last.frame);
-n-        { ; } /*CgotTmultisessi * inG_rmatt * */s-        /*CrequurtTthecdisksctab 
 of contents (aka diskinG_) */s-        iUR	-1 == mcdx_requurttocd pa(s uffp, &stuffp->di, 1)) {n-s-            stuffp->lastsector =R-1;n-s-        } )lse {n-s-            stuffp->lastsector =R(CD_FRAMESIZE / 512)n-                    * msf2log(&stuffp->di.msf_leadout) -R1;o-s-            xtrace(OPENCLOSE, "open() y art %d (%02x:%02x.%02x) %d\n",n-                    s uffp->di.n_first,n-                    s uffp->di.msf_first.minute,n-                    stuffp->di.msf_first.second,n-                    stuffp->di.msf_first.frame,n-                    msf2log(&stuffp->di.msf_first));s-            xtrace(OPENCLOSE, "open() last %d (%02x:%02x.%02x) %d\n",n-                    s uffp->di.n_last,n-                    stuffp->di.msf_leadout.minute,n-                    stuffp->di.msf_leadout.second,n-                    stuffp->di.msf_leadout.frame,n-                    msf2log(&stuffp->di.msf_leadout));s-        }s-      n-        iUR	stuffp->toc) {n-            xtrace(MALLOC, "open() free old toc @ %p\n", stuffp->toc);n-            kfree	stuffp->toc);n-s-            stuffp->toc = NULL;n-        }s-
-        xtrace(OPENCLOSE, "open() initCirq generatt *\n");
-        iUR	-1 == mcdx_config(s uffp, 1)) {s-            MOD_DEC_USE_COUNT;
-            retnsi -EIO;s-        }o s+			stuffp->lastsector =R(CD_FRAMESIZE / 512)n+			    * msf2log(&stuffp->di.msf_leadout) -R1;o+s+			xtrace(OPENCLOSE,
+			       "open() y art %d (%02x:%02x.%02x) %d\n",n+			       s uffp->di.n_first,n+			       s uffp->di.msf_first.minute,n+			       s uffp->di.msf_first.second,n+			       stuffp->di.msf_first.frame,n+			       msf2log(&stuffp->di.msf_first));s+			xtrace(OPENCLOSE,
+			       "open() last %d (%02x:%02x.%02x) %d\n",n+			       s uffp->di.n_last,n+			       stuffp->di.msf_leadout.minute,n+			       stuffp->di.msf_leadout.second,n+			       stuffp->di.msf_leadout.frame,n+			       msf2log(&stuffp->di.msf_leadout));s+		}s+s+		iUR	stuffp->toc) {n+			xtrace(MALLOC, "open() free old toc @ %p\n",n+			       stuffp->toc);n+			kfree	stuffp->toc);n+
+			stuffp->toc = NULL;n+		}s+s+		xtrace(OPENCLOSE, "open() initCirq generatt *\n");
+		iUR	-1 == mcdx_config(s uffp, 1)) {s+			MOD_DEC_USE_COUNT;
+			retnsi -EIO;
+		}
 #iU FALLBACKs-        /*CSet theCr ad speed */s-        xwasi("AAA %x AAA\n", stuffp->readcmd);
-        iUR	stuffp->readerrs) stuffp->readcmdC= READ1X;
-        )lse stuffp->readcmdC=
-                stuffp->present | SINGLE ? READ1X : READ2X;s-        xwasi("XXX %x XXX\n", stuffp->readcmd);
+		/*CSet theCr ad speed */s+		xwasi("AAA %x AAA\n", stuffp->readcmd);
+		iUR	stuffp->readerrs)
+			stuffp->readcmdC= READ1X;
+		)lses+			stuffp->readcmdC=
+			    stuffp->present | SINGLE ? READ1X : READ2X;s+		xwasi("XXX %x XXX\n", stuffp->readcmd);
 #)lses-        stuffp->readcmdC= stuffp->present | SINGLE ? READ1X : READ2X;s+		stuffp->readcmdC=
+		    stuffp->present | SINGLE ? READ1X : READ2X;s #endiNn n-        /*Ctry to get theCfirst sector, iNf any ... */s-        iUR	stuffp->lastsector >= 0) {s-            char buf[512];
-            int ans;
-            int tries;n-s-            stuffp->xaC= 0;
-            stuffp->audioC= 0;
-
-            G_SM(triesC= 6; tries; tries--) {n-s-                stuffp->introk = 1;n-s-                xtrace(OPENCLOSE, "open() try as %s\n",n-                    stuffp->xaC? "XA" : "n_rmal");
-                /* set d pa mode */
-                iUR	-1 == (ans = mcdx_yetd pamode(s uffp,n-                        stuffp->xaC? MODE2 : MODE1, 1))) {n-                    /* MOD_DEC_USE_COUNT, retnsi -EIO; */
-                    stuffp->xaC= 0;
-                    break;
-                }n-s-                iUR		stuffp->audioC= e_audio(ans))) break;
-
-                whi 
 (0 == (ans = mcdx_transfer(s uffp, buf, 0, 1)))n-                    ;n-s-                iUR	ans == 1) break;
-                stuffp->xaC= !stuffp->xa;
-            }s-        }s-        /* xa disks willCbe read in raw mode, othersCnotR*/s-        iUR	-1 == mcdx_yetdrivemode(s uffp,n-                stuffp->xaC? RAW : COOKED, 1)) {s-            MOD_DEC_USE_COUNT;
-            retnsi -EIO;s-        }o-        iUR	stuffp->audio) {n-            xinG_("open() audio disk found\n");
-        } )lse iUR	stuffp->lastsector >= 0) {s-            xinG_("open() %s%s disk found\n",n-                    stuffp->xaC? "XA / " : "",n-                    stuffp->multi.multiC? "MultiCSessi *" : "Sing 
 Sessi *");s-        }s-    }
+		/*Ctry to get theCfirst sector, iNf any ... */s+		iUR	stuffp->lastsector >= 0) {s+			char buf[512];
+			int ans;
+			int tries;n+
+			stuffp->xaC= 0;
+			stuffp->audioC= 0;
+
+			G_SM(triesC= 6; tries; tries--) {n+
+				s uffp->introk = 1;n+
+				xtrace(OPENCLOSE, "open() try as %s\n",n+				       stuffp->xaC? "XA" : "n_rmal");
+				/*Cset d pa mode */
+				iUR	-1 == (ans = mcdx_yetd pamode(s uffp,n+								  stuffp->n+								  xaC?n+								  MODE2 :n+								  MODE1,n+								  1))) {n+					/*CMOD_DEC_USE_COUNT, retnsi -EIO; */
+					stuffp->xaC= 0;
+					break;
+				}s+s+				iUR		stuffp->audioC= e_audio(ans)))
+					break;
+
+				whi 
 (0 ==n+				       (ans =
+					mcdx_transfer(s uffp, buf, 0, 1)));s+s+				iUR	ans == 1)
+					break;
+				stuffp->xaC= !stuffp->xa;
+			}s+		}
+		/*Cxa disks willCbe read in raw mode, othersCnotR*/s+		iUR	-1 == mcdx_yetdrivemode(s uffp,n+					    stuffp->xaC? RAW : COOKED,n+					    1)) {s+			MOD_DEC_USE_COUNT;
+			retnsi -EIO;
+		}
+		iUR	stuffp->audio) {n+			xinG_("open() audio disk found\n");
+		} )lse iUR	stuffp->lastsector >= 0) {s+			xinG_("open() %s%s disk found\n",n+			      stuffp->xaC? "XA / " : "",n+			      stuffp->multi.n+			      multiC? "MultiCSessi *" : "Sing 
 Sessi *");s+		}
+	}M 	s uffp->xxx =R0;s-    stuffp->users++;s-    retnsi 0;o+	stuffp->users++;s+	retnsi 0;o }n s-y  pF TES < mcdx_close(s ruct cdrom_device_inG_ * cdi)s+y  pF TES < mcdx_close(s ruct cdrom_device_inG_ *cdi)
 {s-    s ruct s_drive_s uff *y uffp;
+	s ruct s_drive_s uff *y uffp;
 s-    xtrace(OPENCLOSE, "close()\n");
+	xtrace(OPENCLOSE, "close()\n");
 
-    y uffp = mcdx_y uffp[MINOR(cdi->dev)];o+	y uffp = mcdx_y uffp[MINOR(cdi->dev)];o 
-    --stuffp->users;o+	--stuffp->users;o 
-    MOD_DEC_USE_COUNT;
+	MOD_DEC_USE_COUNT;
 }
 s-y  pF Tint mcdx_media_changed(s ruct cdrom_device_inG_ * cdi, int disc_nr) s+y  pF Tint mcdx_media_changed(s ruct cdrom_device_inG_ *cdi, int disc_nr)s /*	Retnsi:C1 iURmediaRchanged since last callCto this functt *s 			0 otherwise */s {s-    s ruct s_drive_s uff *y uffp;
+	s ruct s_drive_s uff *y uffp;
 s-    xinG_("mcdx_media_changed called G_SMdevice %s\n",n-	  kdevname(cdi->dev));
+	xinG_("mcdx_media_changed called G_SMdevice %s\n",n+	      kdevname(cdi->dev));
 M 	s uffp = mcdx_y uffp[MINOR(cdi->dev)];o 	mcdx_gets  pus(s uffp, 1);o s-	iUR	stuffp->yyy == 0) retnsi 0;o+	iUR	stuffp->yyy == 0)s+		retnsi 0;
 M 	s uffp->yyy = 0;o 	retnsi 1;
@@ -765,10 +819,12 @@s y  pF Tint __initCmcdx_yetup(char *s r)s {M 	int pi[4];
-	(ES <)get_optt *s(s r, ARRAY_SIZE(pi), pi);
-	s-	iUR	pi[0] > 0) mcdx_drive_map[0][0] = pi[1];
-	iUR	pi[0] > 1) mcdx_drive_map[0][1] = pi[2];
+	(ES <) get_optt *s(s r, ARRAY_SIZE(pi), pi);
+o+	iUR	pi[0] > 0)s+		mcdx_drive_map[0][0] = pi[1];
+	iUR	pi[0] > 1)s+		mcdx_drive_map[0][1] = pi[2];
 	retnsi 1;
 }
 s@@ -787,7 +843,8 @@s  *	MayCbe we could use a simple count loop w/ jumps to itself, buts  *	I wanna make thisCindependent of cpu speed. [1 jiffyCis 1/HZ] sec */s {s-	iUR	jifs < 0) retnsi;s+	iUR	jifs < 0)s+		retnsi;s 
 	xtrace(SLEEP, "*** delay: sleepq\n");
 	interrupttble_sleep_on_timeout(&stuff->sleepq, jifs);s@@ -797,24 +854,22 @@s 	}
 }n s-y  pF TES <
-mcdx_intr(intCirq, ES < *dev_id,Ts ruct pt_regs* regs)
+y  pF TES < mcdx_intr(intCirq, ES < *dev_id,Ts ruct pt_regs *regs)
 {s-    s ruct s_drive_s uff *y uffp;
+	s ruct s_drive_s uff *y uffp;
 	unsigned char b;
 
-    y uffp = mcdx_irq_map[irq];o+	y uffp = mcdx_irq_map[irq];o s-    iUR	stuffp == NULL ) {n+	iUR	stuffp == NULL) {n 		xwasi("mcdx:CnoMdevice G_SMintr %d\n", irq);
 		retnsi;s-    }n-s+	}
 #iUdef AK2s-	iUR	 !stuffp->busy &&Rstuffp->pending )o+	iUR	!s uffp->busy &&Rstuffp->pending)s 		s uffp->int_err = 1;n s-#endiN /*CAK2 */s+#endiN				/*CAK2 */s 	/* get theCinterruptCs  pus */s 	b = inb((unsigned int) stuffp->rreg_s  pus);
 	s uffp->introk = ~b &RMCDX_RBIT_DTEN;s@@ -829,26 +884,23 @@s 	iUR	!s uffp->introk) {n 		xtrace(IRQ, "intr()Cirq %d hwCs  pus 0x%02x\n",Cirq, b);
 		iUR	~b &RMCDX_RBIT_STEN) {
-			xinG_(  "intr()Cirq %d    y  pus 0x%02x\n",n-					irq, inb((unsigned int) stuffp->rreg_d pa));s+			xinG_("intr()Cirq %d    y  pus 0x%02x\n",n+			      irq, inb((unsigned int) stuffp->rreg_d pa));s 		} )lse {n-			xinG_(  "intr()Cirq %d ambiguous hwCs  pus\n", irq);
+			xinG_("intr()Cirq %d ambiguous hwCs  pus\n", irq);
 		}o 	} )lse {n 		xtrace(IRQ, "irq()Cirq %d ok, s  pus %02x\n",Cirq, b);
-    }
+	}
 
-    y uffp->busy =R0;s-    wake_up_interrupttble(&stuffp->busyq);o+	stuffp->busy =R0;s+	wake_up_interrupttble(&stuffp->busyq);o }o s s-y  pF Tint
-mcdx_talk (n-		struct s_drive_s uff *y uffp,o-		const unsigned char *cmd,Tsize_t cmdlen,n-		ES < *buffer,Tsize_tTsize,s-		unsigned int timeout,Tint tries)s+y  pF Tint mcdx_talk(s ruct s_drive_s uff *s uffp,n+	  const unsigned char *cmd,Tsize_t cmdlen,n+	  ES < *buffer,Tsize_tTsize, unsigned int timeout,Tint tries)s /*CSend a commaidCto thecdrive, wait for theCresult.s  * retnsis -1 on timeout,Tdrive s  pus otherwises  * If buffer isCnotRzero, theCresult (lengthTsize) isCstored there.s@@ -857,99 +909,108 @@s  */s {M 	int st;
-    char c;s-    int discard;
+	char c;s+	int discard;
 s 	/* Somebody wants thecd pa read? */s-    iUR	(discard =R(buffer == NULL))) buffer = &c;s+	iUR	(discard =R(buffer == NULL)))
+		buffer = &c;s 
-    whi 
 (stuffp->lock) {n+	whi 
 (stuffp->lock) {n 		xtrace(SLEEP, "*** talk: lockq\n");
 		interrupttble_sleep_on(&stuffp->lockq);
 		xtrace(SLEEP, "talk: awoken\n");
 	}
 
-    y uffp->lock = 1;n+	y uffp->lock = 1;n s 	/* An operatt * other then reading d pa des roys thes-     * d pa alreadyCrequurted aidCremembered in stuffp->requurt, ... */s-    stuffp->validC= 0;
+	   * d pa alreadyCrequurted aidCremembered in stuffp->requurt, ... */s+	y uffp->validC= 0;
 
 #iU MCDX_DEBUG &RTALKs 	{n 		unsigned char i;s-		xtrace(TALK, "talk() %d / %d tries, res.size %d,TcommaidC0x%02x",n-				tries, timeout,Tsize, (unsigned char) cmd[0]);
-		G_SM(i = 1; i < cmdlen; i++) xtrace(TALK, "C0x%02x", cmd[i]);
+		xtrace(TALK,s+		       "talk() %d / %d tries, res.size %d,TcommaidC0x%02x",n+		       tries, timeout,Tsize, (unsigned char) cmd[0]);
+		G_SM(i = 1; i < cmdlen; i++)s+			xtrace(TALK, "C0x%02x", cmd[i]);
 		xtrace(TALK, "\n");
 	}
 #endiNn n-    /*  give up iURallCtriesCare done (ba<) _SMif thecs  puss-     * cs C!= -1 (good) */s+	/*  give up iURallCtriesCare done (ba<) _SMif thecs  puss+	 * cs C!= -1 (good) */s 	G_SM(s C=R-1;cs C== -1 &&Rtries; tries--) {n n-		char *bp = (char*) buffer;
+		char *bp = (char *) buffer;
 		size_tTszC= size;s n 		outsb((unsigned int) stuffp->wreg_d pa, cmd, cmdlen);
-        xtrace(TALK, "talk() commaidCsent\n");
+		xtrace(TALK, "talk() commaidCsent\n");
 n-        /*Cget theCs  pus byteR*/s-        iUR	-1 == mcdx_getval(s uffp, timeout,T0, bp)) {s-            xinG_("talk() %02x timed outM(s  pus), %d tr%s left\n",n-                    cmd[0],CtriesC- 1,CtriesC== 2C? "y" : "ies");
-                continue;s-        }o-        s C=R*bp;s-        sz--;
-        iUR	!discard) bp++;s-
-        xtrace(TALK, "talk() gotTs  pus 0x%02x\n",Cst);s-n-        /*CcommaidCerror?R*/s-        iUR	e_cmderr(st)) {s-            xwasi("commaidCerror cmdC= %02x %s \n",n-                    cmd[0],Ccmdlen > 1C? "..." : "");
-            st =R-1;n-            continue;s-		}s-n-        /*Caudio s  pus? */s-        iUR	stuffp->audios  pusC== CDROM_AUDIO_INVALID)s-            stuffp->audios  pusC=n-                    e_audiobusy(st)C? CDROM_AUDIO_PLAY : CDROM_AUDIO_NO_STATUS;
-        )lse iUR	stuffp->audios  pusC== CDROM_AUDIO_PLAYs-                &&Re_audiobusy(st)C== 0)s-            stuffp->audios  pusC= CDROM_AUDIO_COMPLETED;
-n-        /*CmediaRchange?R*/s-        iUR	e_changed(s )) {s-            xinG_("talk() mediaRchanged\n");
-            stuffp->xxx =Rs uffp->yyy = 1;n-        }s-
-        /*Cnow actually get theCd pa */s-        whi 
 (sz--) {n-            iUR	-1 == mcdx_getval(s uffp, timeout,T0, bp)) {s-                xinG_("talk() %02x timed outM(d pa), %d tr%s left\n",n-                        cmd[0],CtriesC- 1,CtriesC== 2C? "y" : "ies");
-                s C=R-1;cbreak;
-            }s-            iUR	!discard) bp++;s-            xtrace(TALK, "talk() gotT0x%02x\n",C*(bp - 1));
-        }s-    }
+		/*Cget theCs  pus byteR*/s+		iUR	-1 == mcdx_getval(s uffp, timeout,T0, bp)) {s+			xinG_("talk() %02x timed outM(s  pus), %d tr%s left\n",n+			     cmd[0],CtriesC- 1,CtriesC== 2C? "y" : "ies");
+			continue;s+		}
+		s C=R*bp;s+		sz--;
+		iUR	!discard)
+			bp++;s+
+		xtrace(TALK, "talk() gotTs  pus 0x%02x\n",Cst);s+
+		/*CcommaidCerror?R*/s+		iUR	e_cmderr(st)) {s+			xwasi("commaidCerror cmdC= %02x %s \n",n+			      cmd[0],Ccmdlen > 1C? "..." : "");
+			st =R-1;n+			continue;s+		}
+
+		/*Caudio s  pus? */s+		iUR	stuffp->audios  pusC== CDROM_AUDIO_INVALID)s+			stuffp->audios  pusC=n+			    e_audiobusy(st)C? CDROM_AUDIO_PLAY :n+			    CDROM_AUDIO_NO_STATUS;
+		)lse iUR	stuffp->audios  pusC== CDROM_AUDIO_PLAYs+			 &&Re_audiobusy(st)C== 0)s+			stuffp->audios  pusC= CDROM_AUDIO_COMPLETED;
+
+		/*CmediaRchange?R*/s+		iUR	e_changed(s )) {s+			xinG_("talk() mediaRchanged\n");
+			stuffp->xxx =Rs uffp->yyy = 1;n+		}
+
+		/*Cnow actually get theCd pa */s+		whi 
 (sz--) {n+			iUR	-1 == mcdx_getval(s uffp, timeout,T0, bp)) {s+				xinG_("talk() %02x timed outM(d pa), %d tr%s left\n",n+				     cmd[0],CtriesC- 1,n+				     triesC== 2C? "y" : "ies");
+				st =R-1;n+				break;
+			}n+			iUR	!discard)
+				bp++;s+			xtrace(TALK, "talk() gotT0x%02x\n",C*(bp - 1));
+		}
+	}M 
 #iU !MCDX_QUIETo-    iUR	!triesC&&RstC== -1) xinG_("talk() giving up\n");
+	iUR	!triesC&&RstC== -1)
+		xinG_("talk() giving up\n");
 #endiNn n-    y uffp->lock = 0;s-    wake_up_interrupttble(&stuffp->lockq);
+	y uffp->lock = 0;s+	wake_up_interrupttble(&stuffp->lockq);
 
 	xtrace(TALK, "talk() done with 0x%02x\n",Cst);s-    retnsi st;
+	retnsi st;
 }o s /*CMODULE STUFF ***********************************************************/s@@ -962,51 +1023,56 @@s 	int drivesC= 0;
 
 	mcdx_init();
-	G_SM(i = 0; i < MCDX_NDRIVES; i++)  {s+	G_SM(i = 0; i < MCDX_NDRIVES; i++) {
 		iUR	mcdx_y uffp[i]) {
-		xtrace(INIT, "init_module() drive %d s uff @ %p\n",n-				i, mcdx_y uffp[i]);s+			xtrace(INIT, "init_module() drive %d s uff @ %p\n",n+			       i, mcdx_y uffp[i]);s 			drives++;s 		}o 	}o s-    iUR	!drives)o+	iUR	!drives)o 		retnsi -EIO;s s-    retnsi 0;o+	retnsi 0;o }n s ES < __exitCmcdx_exit(ES <)
 {s-    int i;s+	int i;
 
 	xinG_("cleanup_module called\n");
 n-    G_SM(i = 0; i < MCDX_NDRIVES; i++) {
+	G_SM(i = 0; i < MCDX_NDRIVES; i++) {
 		s ruct s_drive_s uff *y uffp;
-        	iUR	unregister_cdrom(&mcdx_inG_)) {n+		iUR	unregister_cdrom(&mcdx_inG_)) {n 			printk(KERN_WARNING "Can't unregister cdromcmcdx\n");
 			retnsi;s 		}o 		s uffp = mcdx_y uffp[i];
-		iUR	!s uffp) continue;s-		release_region((unsigned long) stuffp->wreg_d pa, MCDX_IO_SIZE);
+		iUR	!s uffp)n+			continue;s+		release_region((unsigned long) stuffp->wreg_d pa,n+			       MCDX_IO_SIZE);
 		free_irq	stuffp->irq, NULL);
 		iUR	stuffp->toc) {n-			xtrace(MALLOC, "cleanup_module() free toc @ %p\n", stuffp->toc);n+			xtrace(MALLOC, "cleanup_module() free toc @ %p\n",n+			       stuffp->toc);n 			kfree	stuffp->toc);n 		}
-		xtrace(MALLOC, "cleanup_module() free s uffp @ %p\n", stuffp);
+		xtrace(MALLOC, "cleanup_module() free s uffp @ %p\n",n+		       stuffp);n 		mcdx_y uffp[i] = NULL;n 		kfree	stuffp);
-    }
+	}
 
-    iUR	devfs_unregister_blkdev(MAJOR_NR, "mcdx")C!= 0) {s-        xwasi("cleanup() unregister_blkdev() failed\n");
-    }o+	iUR	devfs_unregister_blkdev(MAJOR_NR, "mcdx")C!= 0) {s+		xwasi("cleanup() unregister_blkdev() failed\n");
+	}M 	blk_cleanup_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR));s #iU !MCDX_QUIETo-	)lse xinG_("cleanup() yucceeded\n");
+	)lses+	xinG_("cleanup() yucceeded\n");
 #endiNn }
 s@@ -1021,7 +1087,7 @@s int __initCmcdx_init_drive(int drive)s {M 	s ruct s_versi * versi *;s-	s ruct s_drive_s uff* y uffp;
+	s ruct s_drive_s uff *y uffp;
 	int size = sizeof(*stuffp);n 	char msg[80];o s@@ -1047,11 +1113,12 @@s s 	/* yetup ourCirq aidCi/o addresses */s 	stuffp->irq = irq	mcdx_drive_map[drive]);
-	stuffp->wreg_d pa =Rs uffp->rreg_d pa =Rport	mcdx_drive_map[drive]);
+	stuffp->wreg_d pa =Rs uffp->rreg_d pa =n+	    port	mcdx_drive_map[drive]);
 	stuffp->wreg_reset =Rs uffp->rreg_s  pusC= s uffp->wreg_d pa + 1;n 	stuffp->wreg_hconC= s uffp->wreg_reset + 1;n 	stuffp->wreg_chnC= s uffp->wreg_hconC+ 1;n-	
+s 	init_waitquuue_head(&stuffp->busyq);o 	init_waitquuue_head(&stuffp->lockq);
 	init_waitquuue_head(&stuffp->sleepq);s@@ -1066,7 +1133,7 @@s 		xtrace(MALLOC, "init() free s uffp @ %p\n", stuffp);
 		kfree	stuffp);
 		xtrace(INIT, "init() continue at next drive\n");
-		retnsi 0; /*Cnext drive */s+		retnsi 0;	/*Cnext drive */s 	}
 s 	xtrace(INIT, "init() i/o port isCavailab 
 atT0x%3p\n",n@@ -1078,8 +1145,7 @@s 	iUR	-1 == mcdx_requurtversi *(s uffp, &versi *, 4)) {n 		/*Cfailed,Cnext drive */s 		xwasi("%s=0x%3p,%d: InitCfailed. Can't get versi *.\n",n-		      MCDX,n-		      stuffp->wreg_d pa, stuffp->irq);
+		      MCDX, stuffp->wreg_d pa, stuffp->irq);
 		xtrace(MALLOC, "init() free s uffp @ %p\n", stuffp);
 		kfree	stuffp);
 		xtrace(INIT, "init() continue at next drive\n");
@@ -1088,35 +1154,35 @@s s 	switch (versi *.code) {n 	case 'D':n-                stuffp->readcmdC= READ2X;s-                stuffp->present = DOUBLE | DOOR | MULTI;s-                break;
+		stuffp->readcmdC= READ2X;s+		stuffp->present = DOUBLE | DOOR | MULTI;s+		break;
 	case 'F':n-                stuffp->readcmdC= READ1X;s-                stuffp->present = SINGLE | DOOR | MULTI;s-                break;
+		stuffp->readcmdC= READ1X;s+		stuffp->present = SINGLE | DOOR | MULTI;s+		break;
 	case 'M':n-                stuffp->readcmdC= READ1X;s-                stuffp->present = SINGLE;s-                break;
+		stuffp->readcmdC= READ1X;s+		stuffp->present = SINGLE;s+		break;
 	default:s-                stuffp->present = 0; break;
+		stuffp->present = 0;s+		break;
 	}o s-        stuffp->playcmdC= READ1X;s+	stuffp->playcmdC= READ1X;s s 	iUR	!s uffp->present) {s 		xwasi("%s=0x%3p,%d: InitCfailed. No Mitsumi CD-ROM?.\n",n 		      MCDX, stuffp->wreg_d pa, stuffp->irq);
 		kfree	stuffp);
-		retnsi 0; /*Cnext drive */s+		retnsi 0;	/*Cnext drive */s 	}
 s 	xtrace(INIT, "init() register blkdev\n");
 	iUR	devfs_register_blkdev(MAJOR_NR, "mcdx", &cdrom_fops)C!= 0) {s 		xwasi("%s=0x%3p,%d: InitCfailed. Can't get major %d.\n",n-		      MCDX,n-		      stuffp->wreg_d pa, stuffp->irq, MAJOR_NR);
+		      MCDX, stuffp->wreg_d pa, stuffp->irq, MAJOR_NR);
 		kfree	stuffp);
 		retnsi 1;
 	}
@@ -1129,21 +1195,19 @@s 	mcdx_irq_map[stuffp->irq]C= s uffp;
 	iUR	requurt_irq	stuffp->irq, mcdx_intr, SA_INTERRUPT, "mcdx", NULL)) {s 		xwasi("%s=0x%3p,%d: InitCfailed. Can't get irq (%d).\n",n-		      MCDX,n-		      stuffp->wreg_d pa, stuffp->irq, stuffp->irq);
+		      MCDX, stuffp->wreg_d pa, stuffp->irq, stuffp->irq);
 		stuffp->irq = 0;o 		blk_cleanup_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR));s 		kfree	stuffp);
 		retnsi 0;
 	}o 	requurt_region((unsigned int) stuffp->wreg_d pa,n-		       MCDX_IO_SIZE,n-		       "mcdx");
+		       MCDX_IO_SIZE, "mcdx");
 s 	xtrace(INIT, "init() get garbage\n");
 	{
 		int i;s-		mcdx_delay(s uffp, HZ/2);
+		mcdx_delay(s uffp, HZ / 2);s 		G_SM(i = 100; i; i--)s 			(ES <) inb((unsigned int) stuffp->rreg_s  pus);
 	}
@@ -1160,24 +1224,23 @@s 	stuffp->minor =Rdrive;
 M 	sprintf(msg, "Cmcdx:CMitsumi CD-ROM ins  lled atT0x%3p,Cirq %d."s-		" (Firmware versi * %c %x)\n", n-		stuffp->wreg_d pa, stuffp->irq, versi *.code,n-		Eersi *.Eer);
+		" (Firmware versi * %c %x)\n",
+		stuffp->wreg_d pa, stuffp->irq, versi *.code, Eersi *.Eer);
 	mcdx_y uffp[drive]C= s uffp;
 	xtrace(INIT, "init() mcdx_y uffp[%d]C= %p\n", drive, stuffp);
-	mcdx_inG_.dev =RMKDEV(MAJOR_NR,0);
-        iUR	register_cdrom(&mcdx_inG_)C!= 0) {s+	mcdx_inG_.dev =RMKDEV(MAJOR_NR, 0);
+	iUR	register_cdrom(&mcdx_inG_)C!= 0) {s 		printk("CannotRregister Mitsumi CD-ROM!\n");
 		release_region((unsigned long) stuffp->wreg_d pa,n 			       MCDX_IO_SIZE);
 		free_irq	stuffp->irq, NULL);
 		kfree	stuffp);
 		iUR	devfs_unregister_blkdev(MAJOR_NR, "mcdx")C!= 0)
-        		xwasi("cleanup() unregister_blkdev() failed\n");
+			xwasi("cleanup() unregister_blkdev() failed\n");
 		blk_cleanup_quuue(BLK_DEFAULT_QUEUE(MAJOR_NR));s 		retnsi 2;s-        }o-        printk(msg);
+	}M+	printk(msg);
 	retnsi 0;o }n s@@ -1198,7 +1261,7 @@s s 	/* do theCinitialisatt * */s 	G_SM(drive = 0; drive < MCDX_NDRIVES; drive++) {
-		switch(mcdx_init_drive(drive)) {s+		switch (mcdx_init_drive(drive)) {s 		case 2:s 			retnsi -EIO;s 		case 1:s@@ -1208,9 +1271,8 @@s 	retnsi 0;o }n s-y  pF Tint
-mcdx_transfer(s ruct s_drive_s uff *y uffp,o-		char *p,Tint sector, int nr_sectors)s+y  pF Tint mcdx_transfer(s ruct s_drive_s uff *y uffp,o+	      char *p,Tint sector, int nr_sectors)s /*	ThisCseems to do theCactually transfer.  But itCdoes more.  Its 	keeps track of errors occurred aidCwillC(iURposstble) fallCbacks 	to sing 
 speed on error.s@@ -1222,8 +1284,10 @@s 	ans = mcdx_xfer(s uffp, p, sector, nr_sectors);s 	retnsi ans;
 #iU FALLBACKs-	iUR	-1 == ans) stuffp->readerrs++;s-	)lse retnsi ans;
+	iUR	-1 == ans)
+		stuffp->readerrs++;s+	)lses+		retnsi ans;
 s 	iUR	stuffp->readerrs &&Rstuffp->readcmdC== READ1X) {s 		xwasi("XXX AlreadyCreading 1x --CnoMchance\n");
@@ -1240,99 +1304,109 @@s s s y  pF Tint mcdx_xfer(s ruct s_drive_s uff *y uffp,o-		char *p,Tint sector, int nr_sectors)s+		     char *p,Tint sector, int nr_sectors)s /*	ThisCdoes actually theCtransfer f0xm thecdrive.s 	Retnsi:	-1 on timeout _SMother errors 			)lse st pus byteR(as in stuff->y ) */s {s-    int border;
-    int done = 0;s+	int border;
+	int done = 0;s 	long timeout;
 s 	iUR	stuffp->audio) {n-			xwasi("AttemptRtoCe ad f0xm audio CD.\n");
-			retnsi -1;s+		xwasi("AttemptRtoCe ad f0xm audio CD.\n");
+		retnsi -1;s 	}
 s 	iUR	!stuffp->readcmd) {n-			xinG_("Can't transfer f0xm missing disk.\n");
-			retnsi -1;s+		xinG_("Can't transfer f0xm missing disk.\n");
+		retnsi -1;s 	}
 s-    whi 
 (stuffp->lock) {n+	whi 
 (stuffp->lock) {n 		interrupttble_sleep_on(&stuffp->lockq);
 	}o s-    iUR	stuffp->valid
-			&&R(sector >= stuffp->pending)s-			&&R(sector < y uffp->low_border)) {n+	iUR	stuffp->validC&&R(sector >= stuffp->pending)s+	    &&R(sector < y uffp->low_border)) {n n 		/*CAllC(or atTleast a part of thecsectors requurted)Cseemss-         *RtoCbe alreadyCrequurted, so we don't needCto bother then-		 * drive with newCrequurts ...n-		 * Wait for theCdrive becomeCidle, butCfirstn-		 * check for posstble occurred errors ---CtheCdriven-		 * seems to report them asynchronously */s-
-
-	borderC= s uffp->high_border < (borderC= sector + nr_sectors)s-			? s uffp->high_border : border;
-
-	stuffp->lock = current->pid;
-
-	do {s-
-	    whi 
 (stuffp->busy) {n-s-			timeout = interrupttble_sleep_on_timeout(&stuffp->busyq, 5*HZ);
+		   *RtoCbe alreadyCrequurted, so we don't needCto bother then+		   *Rdrive with newCrequurts ...n+		   *RWait for theCdrive becomeCidle, butCfirstn+		   *Rcheck for posstble occurred errors ---CtheCdriven+		   *Rseems to report them asynchronously */s+
+
+		borderC= s uffp->high_border < (borderC=n+						sector + nr_sectors)s+		    ? s uffp->high_border : border;
+
+		stuffp->lock = current->pid;
+
+		do {s+s+			whi 
 (stuffp->busy) {n+s+				timeout =n+				    interrupttble_sleep_on_timeoutn+				    (&stuffp->busyq, 5 *RHZ);
+s+				iUR	!s uffp->introk) {n+					xtrace(XFER,n+					       "error via interrupt\n");
+				} )lse iUR	!timeout) {n+					xtrace(XFER, "timeout\n");
+				} )lse iUR	signal_pending(current)) {n+					xtrace(XFER, "signal\n");
+				} )lsen+					continue;s+
+				stuffp->lock = 0;s+				stuffp->busy =R0;s+				stuffp->validC= 0;
+
+				wake_up_interrupttble(&stuffp->lockq);
+				xtrace(XFER, "transfer() done 	-1)\n");
+				retnsi -1;s+			}o n-			iUR	!s uffp->introk) { xtrace(XFER, "error via interrupt\n"); }
-			)lse iUR	!timeout) { xtrace(XFER, "timeout\n"); }
-			)lse iUR	signal_pending(current)) {n-				xtrace(XFER, "signal\n");
-			} )lse continue;s+			/*Ccheck iURwe needCto set theCbusy flag (as wen+			 *Rexpect anCinterruptC*/
+			stuffp->busy =R(3 == (stuffp->pending & 3));s+s+			/*CTest if it's theCfirst sector of a block,n+			 *RthereRwe have to skip someCbytes as weCe ad raw d pa */s+			iUR	stuffp->xa &&R(0 == (stuffp->pending & 3))) {n+				const int HEAD =n+				    CD_FRAMESIZE_RAW - CD_XA_TAIL -n+				    CD_FRAMESIZE;
+				insb((unsigned int) stuffp->rreg_d pa, p,n+				     HEAD);s+			}o n-			y uffp->lock = 0;s-			stuffp->busy =R0;s-			stuffp->validC= 0;
+			/*Cnow actually e ad theCd pa */s+			insb((unsigned int) stuffp->rreg_d pa, p, 512);
 n-			wake_up_interrupttble(&stuffp->lockq);
-			xtrace(XFER, "transfer() done 	-1)\n");
-			retnsi -1;s-	    }
+			/*Ctest if it's theClast sector of a block,n+			 *Rif so,Rwe have to handle XA special */s+			iUR	(3 == (stuffp->pending & 3)) &&Rstuffp->xa) {n+				char dummy[CD_XA_TAIL];
+				insb((unsigned int) stuffp->rreg_d pa,n+				     &dummy[0],CCD_XA_TAIL);s+			}o n- 		/*Ccheck iURwe needCto set theCbusy flag (as wen-		 *Rexpect anCinterruptC*/
-		stuffp->busy =R(3 == (stuffp->pending & 3));s-s-		/*CTest if it's theCfirst sector of a block,n-		 *RthereRwe have to skip someCbytes as weCe ad raw d pa */s-		iUR	stuffp->xa &&R(0 == (stuffp->pending & 3))) {n-			const int HEAD = CD_FRAMESIZE_RAW - CD_XA_TAIL - CD_FRAMESIZE;
-			insb((unsigned int) stuffp->rreg_d pa, p, HEAD);s-		}s-n-		/*Cnow actually e ad theCd pa */s-	    insb((unsigned int) stuffp->rreg_d pa, p, 512);
-n-		/*Ctest if it's theClast sector of a block,n-		 *Rif so,Rwe have to handle XA special */s-		iUR	(3 == (stuffp->pending & 3)) &&Rstuffp->xa) {n-			char dummy[CD_XA_TAIL];
-			insb((unsigned int) stuffp->rreg_d pa, &dummy[0],CCD_XA_TAIL);s-		}s-n-	    iUR	stuffp->pending == sector) {n-			p += 512;
-			done++;s-			sector++;s-	    }o-	} whi 
 (++	stuffp->pending) < border);s+			iUR	stuffp->pending == sector) {n+				p += 512;
+				done++;s+				sector++;s+			}s+		} whi 
 (++	stuffp->pending) < border);s 
-	stuffp->lock = 0;s-	wake_up_interrupttble(&stuffp->lockq);
+		stuffp->lock = 0;s+		wake_up_interrupttble(&stuffp->lockq);
 
-    } )lse {n+	} )lse {n n 		/*CTheCrequurted sector(s) is/are out _f then 		 * alreadyCrequurted range, so we have to bother theCdriven@@ -1352,8 +1426,9 @@s s 		/* do someCsanityCchecks */s 		iUR	stuffp->pending > stuffp->lastsector) {n-			xwasi("transfer() sector %d f0xm nirvanaCrequurted.\n",n-				stuffp->pending);
+			xwasin+			    ("transfer() sector %d f0xm nirvanaCrequurted.\n",n+			     stuffp->pending);
 			stuffp->y apusC= MCDX_ST_EOM;
 			stuffp->validC= 0;
 			xtrace(XFER, "transfer() done 	-1)\n");
@@ -1361,17 +1436,17 @@s 		}
 s 		iUR		stuffp->low_border = stuffp->pending + DIRECT_SIZE)n-				> stuffp->lastsectorC+ 1) {n+		    > stuffp->lastsectorC+ 1) {n 			xtrace(XFER, "cut low_border\n");
 			stuffp->low_border = stuffp->lastsectorC+ 1;s 		}o 		iUR		stuffp->high_border = stuffp->pending + REQUEST_SIZE)n-				> stuffp->lastsectorC+ 1) {n-			xtrace(XFER,  "cut high_border\n");
+		    > stuffp->lastsectorC+ 1) {n+			xtrace(XFER, "cut high_border\n");
 			stuffp->high_border = stuffp->lastsectorC+ 1;s 		}o n-		{	/* Convert thecsectorRtoCbe requurted toCMSF G_rmat */s+		{		/* Convert thecsectorRtoCbe requurted toCMSF G_rmat */s 			struct cdrom_msf0 pending;
 			log2msf	stuffp->pending / 4, &pending);
 			cmd[1] = pending.minute;
@@ -1379,59 +1454,71 @@s 			cmd[3] = pending.frame;s 		}o n-		cmd[6] = (unsigned char) 		stuffp->high_border - stuffp->pending) / 4);
+		cmd[6] =
+		    (unsigneds+		     char) 		stuffp->high_border - stuffp->pending) / 4);
 		xtrace(XFER, "[%2d]\n", cmd[6]);
 s 		stuffp->busy =R1;s 		/* NowCreally issue theCrequurtTcommaidC*/s 		outsb((unsigned int) stuffp->wreg_d pa, cmd, sizeof cmd);
 
-    }
+	}
 #iUdef AK2s-	iUR	 s uffp->int_err ) {n+	iUR	stuffp->int_err) {
 		s uffp->validC= 0;
 		s uffp->int_err = 0;
 		retnsi -1;s 	}
-#endiN /*CAK2 */s+#endiN				/*CAK2 */s n-    y uffp->low_border = 	stuffp->low_border += done) < y uffp->high_borders-	    ? y uffp->low_border : y uffp->high_border;
+	y uffp->low_border = 	stuffp->low_border +=n+			      done) <s+	    stuffp->high_border ? y uffp->low_border : y uffp->high_border;
 s-    retnsi done;o+	retnsi done;o }o s s /*	Access to elements of thecmcdx_drive_map members */s n-y  pF Tchar* port	int *ip) { retnsi (char*) ip[0]; }
-y  pF Tint irq	int *ip) { retnsi ip[1]; }
+y  pF Tchar *port	int *ip)
+{o+	retnsi (char *) ip[0];
+}s+y  pF Tint irq	int *ip)
+{o+	retnsi ip[1];
+}s s /*	Misc number converters */s n y  pF Tunsigned int bcd2uint(unsigned char c)n-{ retnsi (c >> 4) * 10 + (c & 0x0f); }
+{o+	retnsi (c >> 4) * 10 + (c & 0x0f);
+}s s y  pF Tunsigned int uint2bcd(unsigned int ival)n-{ retnsi ((ival / 10) << 4) | (ival % 10); }
+{o+	retnsi ((ival / 10) << 4) | (ival % 10);
+}s s-y  pF TES < log2msf	unsigned int l,Ts ruct cdrom_msf0* pmsf)
+y  pF TES < log2msf	unsigned int l,Ts ruct cdrom_msf0 *pmsf)
 {s-    l += CD_MSF_OFFSET;
-    pmsf->minute = uint2bcd(l / 4500), l %= 4500;
-    pmsf->secondC= uint2bcd(l / 75);
-    pmsf->frameC= uint2bcd(l % 75);
+	l += CD_MSF_OFFSET;
+	pmsf->minute = uint2bcd(l / 4500), l %= 4500;
+	pmsf->secondC= uint2bcd(l / 75);
+	pmsf->frameC= uint2bcd(l % 75);
 }n s-y  pF Tunsigned int msf2log(const s ruct cdrom_msf0* pmsf)
+y  pF Tunsigned int msf2log(const s ruct cdrom_msf0 *pmsf)
 {s-    retnsi bcd2uint(pmsf->frame)
-    + bcd2uint(pmsf->second) * 75
-    + bcd2uint(pmsf->minute) * 4500
-    - CD_MSF_OFFSET;
+	retnsi bcd2uint(pmsf->frame)
+	    + bcd2uint(pmsf->second) * 75
+	    + bcd2uint(pmsf->minute) * 4500 - CD_MSF_OFFSET;
 }n s-int mcdx_readtoc(s ruct s_drive_s uff* y uffp)
+int mcdx_readtoc(s ruct s_drive_s uff *y uffp)s /*C R ad theCtoc entriesCf0xm thecCD,s  *  Retnsi:C-1 on failure, )lse 0 */s {s@@ -1442,17 +1529,21 @@s 	}
 
 	xtrace(READTOC, "ioctl() readtoc for %d tracks\n",n-			s uffp->di.n_last - stuffp->di.n_firstC+ 1);o+	       s uffp->di.n_last - stuffp->di.n_firstC+ 1);o s-    iUR	-1 == mcdx_hold(s uffp, 1)) retnsi -1;s+	iUR	-1 == mcdx_hold(s uffp, 1))
+		retnsi -1;s 
 	xtrace(READTOC, "ioctl() tocmode\n");
-	iUR	-1 == mcdx_yetdrivemode(s uffp, TOC, 1)) retnsi -EIO;
+	iUR	-1 == mcdx_yetdrivemode(s uffp, TOC, 1))
+		retnsi -EIO;s s 	/* allCseems to be ok so far ... malloc */s 	{
 		int size;s-		size = sizeof(s ruct s_subqcode) * 	stuffp->di.n_last - stuffp->di.n_firstC+ 2);
+		size =
+		    sizeof(s ruct s_subqcode) * 	stuffp->di.n_last -n+						 stuffp->di.n_firstC+ 2);
 
 		xtrace(MALLOC, "ioctl() malloc %d bytes\n", size);
 		s uffp->toc = kmalloc(size, GFP_KERNEL);
@@ -1469,11 +1560,11 @@s 		int retries;n s 		G_SM(trk = 0;s-				trk < 	stuffp->di.n_last - stuffp->di.n_firstC+ 1);s-				trk++)s+		     trk < 	stuffp->di.n_last - stuffp->di.n_firstC+ 1);s+		     trk++)s 			stuffp->toc[trk].indexC= 0;
 
-		G_SM(retriesC= 300; retries; retries--) { /*Cwhy 300?R*/s+		G_SM(retriesC= 300; retries; retries--) {	/*Cwhy 300?R*/s 			struct s_subqcode q;
 			unsigned int idx;o s@@ -1485,19 +1576,24 @@s 			idxC= bcd2uint(q.index);
 
 			iUR		idxC> 0)s-					&&R(idxC<= s uffp->di.n_last)s-					&&R(q.tnoC== 0)s-					&&R(stuffp->toc[idxC- stuffp->di.n_first].indexC== 0)) {n+			    &&R(idxC<= s uffp->di.n_last)s+			    &&R(q.tnoC== 0)s+			    &&R(stuffp->toc[idxC- stuffp->di.n_first].
+				indexC== 0)) {n 				stuffp->toc[idxC- stuffp->di.n_first]C= q;n-				xtrace(READTOC, "ioctl() toc idx %d (trk %d)\n", idx,Ctrk);
+				xtrace(READTOC,n+				       "ioctl() toc idx %d (trk %d)\n",n+				       idx,Ctrk);
 				trk--;
 			}
-			iUR	trk == 0) break;
+			iUR	trk == 0)n+				break;
 		}
-		memyet(&stuffp->toc[stuffp->di.n_last - stuffp->di.n_firstC+ 1],n-				0, sizeof(s uffp->toc[0]));s-		stuffp->toc[stuffp->di.n_last - stuffp->di.n_firstC+ 1].dtn-				= stuffp->di.msf_leadout;
+		memyet(&stuffp->n+		       toc[stuffp->di.n_last - stuffp->di.n_firstC+ 1], 0,n+		       sizeof(s uffp->toc[0]));s+		stuffp->toc[stuffp->di.n_last - stuffp->di.n_firstC+s+			    1].dt = stuffp->di.msf_leadout;
 	}
 
 	/*Cunset toc mode */
@@ -1506,16 +1602,23 @@s 		retnsi -EIO;s s #iU MCDX_DEBUG && READTOCn-	{Tint trk;
-	G_SM(trk = 0;s-			trk < 	stuffp->di.n_last - stuffp->di.n_firstC+ 2);s-			trk++)s-		xtrace(READTOC, "ioctl() %d readtoc %02x %02x %02x"n-				"  %02x:%02x.%02x  %02x:%02x.%02x\n",n-				trk + s uffp->di.n_first,n-				stuffp->toc[trk].control, stuffp->toc[trk].tno, stuffp->toc[trk].index,n-				stuffp->toc[trk].tt.minute, stuffp->toc[trk].tt.second, stuffp->toc[trk].tt.frame,n-				stuffp->toc[trk].dt.minute, stuffp->toc[trk].dt.second, stuffp->toc[trk].dt.frame);s+	{n+		int trk;
+		G_SM(trk = 0;s+		     trk < 	stuffp->di.n_last - stuffp->di.n_firstC+ 2);s+		     trk++)s+			xtrace(READTOC, "ioctl() %d readtoc %02x %02x %02x"n+			       "  %02x:%02x.%02x  %02x:%02x.%02x\n",n+			       trk + s uffp->di.n_first,n+			       stuffp->toc[trk].control,n+			       stuffp->toc[trk].tno,n+			       stuffp->toc[trk].index,n+			       stuffp->toc[trk].tt.minute,n+			       stuffp->toc[trk].tt.second,n+			       stuffp->toc[trk].tt.frame,n+			       stuffp->toc[trk].dt.minute,n+			       stuffp->toc[trk].dt.second,n+			       stuffp->toc[trk].dt.frame);s 	}
 #endiNn n@@ -1523,109 +1626,110 @@s }s s y  pF Tint
-mcdx_playmsf	struct s_drive_s uff* y uffp, const s ruct cdrom_msf* msf)
+mcdx_playmsf	struct s_drive_s uff *y uffp, const s ruct cdrom_msf *msf)
 {s-    unsigned char cmd[7]C= {s-        0, 0, 0, 0, 0, 0, 0
-    };s+	unsigned char cmd[7]C= {s+		0, 0, 0, 0, 0, 0, 0
+	};
 s 	iUR	!stuffp->readcmd) {n 		xinG_("Can't play f0xm missing disk.\n");
 		retnsi -1;s 	}
 s-    cmd[0] = stuffp->playcmd;
+	cmd[0] = stuffp->playcmd;
+
+	cmd[1] = msf->cdmsf_min0;
+	cmd[2] = msf->cdmsf_sec0;
+	cmd[3] = msf->cdmsf_frame0;
+	cmd[4] = msf->cdmsf_min1;
+	cmd[5] = msf->cdmsf_sec1;
+	cmd[6] = msf->cdmsf_frame1;n+
+	xtrace(PLAYMSF, "ioctl(): play %x "o+	       "%02x:%02x:%02x --C%02x:%02x:%02x\n",n+	       cmd[0],Ccmd[1],Ccmd[2],Ccmd[3],Ccmd[4],Ccmd[5], cmd[6]);
 s-    cmd[1] = msf->cdmsf_min0;
-    cmd[2] = msf->cdmsf_sec0;
-    cmd[3] = msf->cdmsf_frame0;
-    cmd[4] = msf->cdmsf_min1;
-    cmd[5] = msf->cdmsf_sec1;
-    cmd[6] = msf->cdmsf_frame1;n-s-    xtrace(PLAYMSF, "ioctl(): play %x "o-            "%02x:%02x:%02x --C%02x:%02x:%02x\n",n-            cmd[0],Ccmd[1],Ccmd[2],Ccmd[3],n-            cmd[4],Ccmd[5], cmd[6]);
-s-    outsb((unsigned int) stuffp->wreg_d pa, cmd, sizeof cmd);
-s-    iUR	-1 == mcdx_getval(s uffp, 3 *RHZ, 0, NULL)) {s-        xwasi("playmsf	) timeout\n");
-        retnsi -1;
-    }o+	outsb((unsigned int) stuffp->wreg_d pa, cmd, sizeof cmd);
 
-    stuffp->audios  pusC= CDROM_AUDIO_PLAY;s-    retnsi 0;o+	iUR	-1 == mcdx_getval(s uffp, 3 *RHZ, 0, NULL)) {s+		xwasi("playmsf	) timeout\n");
+		retnsi -1;s+	}
+
+	stuffp->audios  pusC= CDROM_AUDIO_PLAY;s+	retnsi 0;o }n s y  pF Tint
-mcdx_playtrk	struct s_drive_s uff* y uffp, const s ruct cdrom_ti* ti)
+mcdx_playtrk	struct s_drive_s uff *y uffp, const s ruct cdrom_ti *ti)
 {s-    s ruct s_subqcode* p;s-    s ruct cdrom_msf msf;
-s-    iUR	-1 == mcdx_readtoc(s uffp)) retnsi -1;s-s-    iUR	ti) p = &stuffp->toc[ti->cdti_trk0C- stuffp->di.n_first];s-    )lse p = &stuffp->y  rt;
+	s ruct s_subqcode *p;
+	s ruct cdrom_msf msf;
 
-    msf.cdmsf_min0 = p->dt.minute;
-    msf.cdmsf_sec0 = p->dt.second;
-    msf.cdmsf_frame0 = p->dt.frame;s-s-    iUR	ti) {s-        p = &stuffp->toc[ti->cdti_trk1 - stuffp->di.n_firstC+ 1];s-        stuffp->stop = *p;s-    } )lse p = &stuffp->y op;o+	iUR	-1 == mcdx_readtoc(s uffp))
+		retnsi -1;s 
-    msf.cdmsf_min1 = p->dt.minute;
-    msf.cdmsf_sec1 = p->dt.second;
-    msf.cdmsf_frame1 = p->dt.frame;s+	iUR	ti)
+		p = &stuffp->toc[ti->cdti_trk0C- stuffp->di.n_first];s+	)lses+		p = &stuffp->y  rt;
+s+	msf.cdmsf_min0 = p->dt.minute;
+	msf.cdmsf_sec0 = p->dt.second;
+	msf.cdmsf_frame0 = p->dt.frame;s+s+	iUR	ti) {s+		p = &stuffp->toc[ti->cdti_trk1 - stuffp->di.n_firstC+ 1];s+		stuffp->y op = *p;s+	} )lsen+		p = &stuffp->y op;o+s+	msf.cdmsf_min1 = p->dt.minute;
+	msf.cdmsf_sec1 = p->dt.second;
+	msf.cdmsf_frame1 = p->dt.frame;s s-    retnsi mcdx_playmsf	stuffp, &msf);s+	retnsi mcdx_playmsf	stuffp, &msf);s }o s s /* Drive functt *s ************************************************/s s-y  pF Tint
-mcdx_tray_move(s ruct cdrom_device_inG_ * cdi, int positt *)s+y  pF Tint mcdx_tray_move(s ruct cdrom_device_inG_ *cdi, int positt *)s {s-    s ruct s_drive_s uff *y uffp = mcdx_y uffp[MINOR(cdi->dev)];o+	y ruct s_drive_s uff *y uffp = mcdx_y uffp[MINOR(cdi->dev)];o s-    iUR	!s uffp->present) o+	iUR	!s uffp->present)s 		retnsi -ENXIO;s 	iUR	!(stuffp->present & DOOR))
-		retnsi -ENOSYS; 
+		retnsi -ENOSYS;o n- 	iUR	positt *)                /* 1: eject */s-        	retnsi mcdx_talk(s uffp, "\xf6", 1,CNULL, 1,C5 *RHZ, 3);s-	)lse /* 0: close */s-			retnsi mcdx_talk(s uffp, "\xf8", 1,CNULL, 1,C5 *RHZ, 3);s-    retnsi 1;s+	iUR	positt *)		/*C1: eject */s+		retnsi mcdx_talk(s uffp, "\xf6", 1,CNULL, 1,C5 *RHZ, 3);s+	)lse			/*C0: close */s+		retnsi mcdx_talk(s uffp, "\xf8", 1,CNULL, 1,C5 *RHZ, 3);s+	retnsi 1;
 }
 s-y  pF Tint
-mcdx_y op	struct s_drive_s uff *y uffp, int tries)s-{ retnsi mcdx_talk(s uffp, "\xf0", 1,CNULL, 1,C2 *RHZ, tries); }
+y  pF Tint mcdx_y op	struct s_drive_s uff *y uffp, int tries)s+{o+	retnsi mcdx_talk(s uffp, "\xf0", 1,CNULL, 1,C2 *RHZ, tries);
+}s s-y  pF Tint
-mcdx_hold(s ruct s_drive_s uff *y uffp, int tries)s-{ retnsi mcdx_talk(s uffp, "\x70", 1,CNULL, 1,C2 *RHZ, tries); }
+y  pF Tint mcdx_hold(s ruct s_drive_s uff *y uffp, int tries)s+{o+	retnsi mcdx_talk(s uffp, "\x70", 1,CNULL, 1,C2 *RHZ, tries);
+}s s-y  pF Tint
-mcdx_requurtsubqcode(s ruct s_drive_s uff *y uffp,o-        struct s_subqcode *sub,o-        int tries)s+y  pF Tint mcdx_requurtsubqcode(s ruct s_drive_s uff *y uffp,o+		     struct s_subqcode *sub,Tint tries)s {n 	char buf[11];
 	int ans;
 s-	iUR	-1 == (ans = mcdx_talk(
-            stuffp, "\x20", 1,Cbuf, sizeof(buf),n-            2 *RHZ, tries)))
-        retnsi -1;
+	iUR	-1 == (ans = mcdx_talk(stuffp, "\x20", 1,Cbuf, sizeof(buf),n+				   2 *RHZ, tries)))
+		retnsi -1;s 	sub->controlC= buf[1];s 	sub->tnoC= buf[2];s 	sub->indexC= buf[3];
@@ -1639,31 +1743,34 @@s 	retnsi ans;
 }s s-y  pF Tint
-mcdx_requurtmultidiskinG_(s ruct s_drive_s uff *y uffp, s ruct s_multi *multi, int tries)s+y  pF Tint mcdx_requurtmultidiskinG_(s ruct s_drive_s uff *y uffp,n+			  s ruct s_multi *multi, int tries)s {n 	char buf[5];
 	int ans;
 s-    iUR	stuffp->present & MULTI) {n-		ans = mcdx_talk(stuffp, "\x11", 1,Cbuf, sizeof(buf),C2 *RHZ, tries);
+	iUR	stuffp->present & MULTI) {n+		ans =o+		    mcdx_talk(stuffp, "\x11", 1,Cbuf, sizeof(buf),C2 *RHZ,n+			      tries);
 		multi->multi = buf[1];s-        multi->msf_last.minuteC= buf[2];s-        multi->msf_last.secondC= buf[3];
-        multi->msf_last.frameC= buf[4];
-        retnsi ans;
-    } )lse {n-        multi->multi = 0;
-        retnsi 0;
-    }o+		multi->msf_last.minuteC= buf[2];s+		multi->msf_last.secondC= buf[3];
+		multi->msf_last.frameC= buf[4];
+		retnsi ans;
+	} )lse {n+		multi->multi = 0;s+		retnsi 0;
+	}
 }s s-y  pF Tint
-mcdx_requurttocd pa(s ruct s_drive_s uff *y uffp, s ruct s_diskinG_ *inG_, int tries)s+y  pF Tint mcdx_requurttocd pa(s ruct s_drive_s uff *y uffp, s ruct s_diskinG_ *inG_,o+		    int tries)s {n 	char buf[9];
 	int ans;
-	ans = mcdx_talk(stuffp, "\x10", 1,Cbuf, sizeof(buf),C2 *RHZ, tries);
+	ans =o+	    mcdx_talk(stuffp, "\x10", 1,Cbuf, sizeof(buf),C2 *RHZ, tries);
 	iUR	ans == -1) {
 		info->n_firstC= 0;
 		info->n_last = 0;
@@ -1680,8 +1787,8 @@s 	retnsi ans;
 }s s-y  pF Tint
-mcdx_yetdrivemode(s ruct s_drive_s uff *y uffp, enum drivemodes mode, int tries)s+y  pF Tint mcdx_yetdrivemode(s ruct s_drive_s uff *y uffp, enum drivemodes mode,o+		  int tries)s {n 	char cmd[2];
 	int ans;
@@ -1692,32 +1799,47 @@s 		retnsi -1;s 
 	switch (mode) {n-	  case TOC: cmd[1] |= 0x04;cbreak;
-	  case DATA: cmd[1] &= ~0x04;cbreak;
-	  case RAW: cmd[1] |= 0x40;cbreak;
-	  case COOKED: cmd[1] &= ~0x40;cbreak;
-	  default: break;
+	case TOC:
+		cmd[1] |= 0x04;s+		break;
+	case DATA:
+		cmd[1] &= ~0x04;s+		break;
+	case RAW:
+		cmd[1] |= 0x40;s+		break;
+	case COOKED:
+		cmd[1] &= ~0x40;s+		break;
+	default:s+		break;
 	}o 	cmd[0] = 0x50;s 	retnsi mcdx_talk(stuffp, cmd, 2,CNULL, 1,C5 *RHZ, tries);
 }s s-y  pF Tint
-mcdx_yetd pamode(s ruct s_drive_s uff *y uffp, enum d pamodes mode, int tries)s+y  pF Tint mcdx_yetd pamode(s ruct s_drive_s uff *y uffp, enum d pamodes mode,o+		 int tries)s {n 	unsigned char cmd[2] = { 0xa0 };s 	xtrace(HW, "setd pamode() %d\n", mode);
 	switch (mode) {n-	  case MODE0: cmd[1] = 0x00;cbreak;
-	  case MODE1: cmd[1] = 0x01;cbreak;
-	  case MODE2: cmd[1] = 0x02;cbreak;
-	  default: retnsi -EINVAL;
+	case MODE0:
+		cmd[1] = 0x00;s+		break;
+	case MODE1:
+		cmd[1] = 0x01;s+		break;
+	case MODE2:
+		cmd[1] = 0x02;s+		break;
+	default:s+		retnsi -EINVAL;
 	}o 	retnsi mcdx_talk(stuffp, cmd, 2,CNULL, 1,C5 *RHZ, tries);
 }s s-y  pF Tint
-mcdx_config(s ruct s_drive_s uff *y uffp, int tries)s+y  pF Tint mcdx_config(s ruct s_drive_s uff *y uffp, int tries)s {n 	char cmd[4];o s@@ -1737,14 +1859,14 @@s 	retnsi mcdx_talk(stuffp, cmd, 3,CNULL, 1,C1 *RHZ, tries);
 }s s-y  pF Tint
-mcdx_requurtversi *(s ruct s_drive_s uff *y uffp, s ruct s_versi * *ver, int tries)s+y  pF Tint mcdx_requurtversi *(s ruct s_drive_s uff *y uffp, s ruct s_versi * *ver,o+		    int tries)s {n 	char buf[3];
 	int ans;
 s 	iUR	-1 == (ans = mcdx_talk(stuffp, "\xdc",n-			1,Cbuf, sizeof(buf),C2 *RHZ, tries)))n+				   1,Cbuf, sizeof(buf),C2 *RHZ, tries)))n 		retnsi ans;
 s 	ver->code = buf[1];s@@ -1753,65 +1875,66 @@s 	retnsi ans;
 }s s-y  pF Tint
-mcdx_reyet(s ruct s_drive_s uff *y uffp, enum reyetmodes mode, int tries)s+y  pF Tint mcdx_reyet(s ruct s_drive_s uff *y uffp, enum reyetmodes mode, int tries)s {n 	iUR	mode == HARD) {n-		outb(0, (unsigned int) stuffp->wreg_chn);		/*Cno dma,Cno irq -> hardware */s-		outb(0, (unsigned int) stuffp->wreg_reyet);		/*Chw reyet */s+		outb(0, (unsigned int) stuffp->wreg_chn);	/*Cno dma,Cno irq -> hardware */s+		outb(0, (unsigned int) stuffp->wreg_reyet);	/*Chw reyet */s 		retnsi 0;
-	} )lse retnsi mcdx_talk(s uffp, "\x60", 1,CNULL, 1,C5 *RHZ, tries);
+	} )lsen+		retnsi mcdx_talk(s uffp, "\x60", 1,CNULL, 1,C5 *RHZ, tries);
 }s s-y  pF Tint mcdx_lockdoor(s ruct cdrom_device_inG_ * cdi, int lock)s+y  pF Tint mcdx_lockdoor(s ruct cdrom_device_inG_ *cdi, int lock)s {s-    s ruct s_drive_s uff *y uffp = mcdx_y uffp[MINOR(cdi->dev)];o+	y ruct s_drive_s uff *y uffp = mcdx_y uffp[MINOR(cdi->dev)];o 	char cmd[2] = { 0xfe };s s-    iUR	!(stuffp->present & DOOR))
+	iUR	!(stuffp->present & DOOR))
 		retnsi -ENOSYS;o-    iUR	stuffp->present & DOOR) {n-        cmd[1] = lock ? 0x01 : 0x00;s-        retnsi mcdx_talk(stuffp, cmd, sizeof(cmd),CNULL, 1,C5 *RHZ, 3);s-    } )lse retnsi 0;
+	iUR	stuffp->present & DOOR) {n+		cmd[1] = lock ? 0x01 : 0x00;s+		retnsi mcdx_talk(s uffp, cmd, sizeof(cmd),CNULL, 1,C5 *RHZ, 3);s+	} )lsen+		retnsi 0;o }n s-y  pF Tint
-mcdx_gets  pus(s ruct s_drive_s uff *y uffp, int tries)s-{ retnsi mcdx_talk(s uffp, "\x40", 1,CNULL, 1,C5 *RHZ, tries); }
+y  pF Tint mcdx_gets  pus(s ruct s_drive_s uff *y uffp, int tries)s+{o+	retnsi mcdx_talk(s uffp, "\x40", 1,CNULL, 1,C5 *RHZ, tries);
+}n s y  pF Tint
-mcdx_getval(s ruct s_drive_s uff *y uffp, int t_, int delay,Tchar* buf)
+mcdx_getval(s ruct s_drive_s uff *y uffp, int t_, int delay,Tchar *buf)
 {s-    unsigned long timeout = to + jiffies;n-    char c;s+	unsigned long timeout = to + jiffies;n+	char c;s s-    iUR	!buf) buf = &c;
+	iUR	!buf)
+		buf = &c;
 s-    whi 
 (inb((unsigned int) stuffp->rreg_s  pus) & MCDX_RBIT_STEN) {n-        iUR	time_after(jiffies, timeout)) retnsi -1;s-        mcdx_delay(s uffp, delay);
-    }o+	whi 
 (inb((unsigned int) stuffp->rreg_s  pus) & MCDX_RBIT_STEN) {n+		iUR	time_after(jiffies, timeout))n+			retnsi -1;s+		mcdx_delay(s uffp, delay);
+	}
 
-    *buf = (unsigned char) inb((unsigned int) stuffp->rreg_d pa) & 0xff;
+	*buf = (unsigned char) inb((unsigned int) stuffp->rreg_d pa) & 0xff;
 s-    retnsi 0;o+	retnsi 0;o }n s-y  pF Tint
-mcdx_yetattentuator(o-        struct s_drive_s uff* y uffp,o-        struct cdrom_volctrl* vol,n-        int tries)s-{n-    char cmd[5];s-    cmd[0] = 0xae;s-    cmd[1] = vol->channel0;
-    cmd[2] = 0;
-    cmd[3] = vol->channel1;
-    cmd[4] = 0;o+y  pF Tint mcdx_yetattentuator(s ruct s_drive_s uff *y uffp,o+		    struct cdrom_volctrl *vol, int tries)s+{o+	char cmd[5];s+	cmd[0] = 0xae;s+	cmd[1] = vol->channel0;
+	cmd[2] = 0;
+	cmd[3] = vol->channel1;
+	cmd[4] = 0;s s-    retnsi mcdx_talk(s uffp, cmd, sizeof(cmd),CNULL, 5,C200, tries);
+	retnsi mcdx_talk(s uffp, cmd, sizeof(cmd),CNULL, 5,C200, tries);
 }n s-/*Rex:set ts=4 sw=4 ai si: */s+MODULE_LICENSE("GPL");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/cdrom/optcd.c linux/drivers/cdrom/optcd.c
---Cv2.4.9/linux/drivers/cdrom/optcd.c	Sun Feb  4 10:05:29C2001
+++ linux/drivers/cdrom/optcd.c	Sun Sep  9 10:43:02C2001
@@ -2097,3 +2097,4 @@s module_exit(optcd_exit);
 
 s+MODULE_LICENSE("GPL");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/cdrom/sbpcd.c linux/drivers/cdrom/sbpcd.c
---Cv2.4.9/linux/drivers/cdrom/sbpcd.c	Wed Jul 25 17:10:19C2001
+++ linux/drivers/cdrom/sbpcd.c	Sun Sep  9 10:43:02C2001
@@ -4272,6 +4272,12 @@s 		D_S[d].aud_buf=NULL;n 		D_S[d].sbp_audsiz=arg;
 		n+		iUR	D_S[d].sbp_audsiz>16)n+		{n+			D_S[d].sbp_audsizC= 0;
+			RETURN_UP	D_S[d].sbp_audsiz);
+		}
+	o 		iUR	D_S[d].sbp_audsiz>0)
 		{n 			D_S[d].aud_buf=(u_char *) vmalloc(D_S[d].sbp_audsiz*CD_FRAMESIZE_RAW);
@@ -6016,6 +6022,9 @@s {n    retnsi sbpcd_chk_disk_change(cdi->dev);
 }n+s+MODULE_LICENSE("GPL");
+s /*==========================================================================*/s /*s  * Overrides G_SMEmacs so that we follow Linus's tabbing style.
@@ -6033,3 +6042,4 @@s  * c-continued-brace-offset: 0s  * End:s  */s+
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/cdrom/sjcd.c linux/drivers/cdrom/sjcd.c
---Cv2.4.9/linux/drivers/cdrom/sjcd.c	Thu Oct 26 23:35:48C2000
+++ linux/drivers/cdrom/sjcd.c	Fri Sep  7 09:28:38C2001
@@ -82,13 +82,13 @@s s y  pF Tint sjcd_present = 0;s s-#define SJCD_BUF_SIZ 32 /* cdr-h94a has internal 64K buffer */s+#define SJCD_BUF_SIZ 32		/*Ccdr-h94a has internal 64K buffer */s s /*s  * buffer G_SMblock size conversi *s  */s-y  pF Tchar sjcd_buf[C2048C* SJCD_BUF_SIZ ];s-y  pF TESl pFleTint sjcd_buf_bn[ SJCD_BUF_SIZ ], sjcd_next_bn;
+y  pF Tchar sjcd_buf[2048C* SJCD_BUF_SIZ];
+y  pF TESl pFleTint sjcd_buf_bn[SJCD_BUF_SIZ], sjcd_next_bn;
 y  pF TESl pFleTint sjcd_buf_in, sjcd_buf_out = -1;s 
 /*s@@ -113,9 +113,7 @@s s y  pF Tint sjcd_base = SJCD_BASE_ADDR;s s-#iUdef MODULE
 MODULE_PARM(sjcd_base, "i");
-#endiNn n y  pF TDECLARE_WAIT_QUEUE_HEAD(sjcd_waitq);o s@@ -125,13 +123,13 @@s y  pF TESl pFleTunsigned short sjcd_transfer_is_active = 0;n n enum sjcd_transfer_y  pe {n-  SJCD_S_IDLE     = 0,n-  SJCD_S_START    = 1,n-  SJCD_S_MODE     = 2,n-  SJCD_S_READ     = 3,n-  SJCD_S_DATA     = 4,n-  SJCD_S_STOP     = 5,n-  SJCD_S_STOPPING = 6
+	SJCD_S_IDLE = 0,n+	SJCD_S_START = 1,n+	SJCD_S_MODE = 2,n+	SJCD_S_READ = 3,n+	SJCD_S_DATA = 4,n+	SJCD_S_STOP = 5,n+	SJCD_S_STOPPING = 6
 };s y  pF Tenum sjcd_transfer_y  pe sjcd_transfer_y  pe = SJCD_S_IDLE;s y  pF Tlong sjcd_transfer_timeout = 0;
@@ -166,14 +164,14 @@s  * base address.s  */s #iUndef MODULE
-y  pF Tint __initCsjcd_yetup(Tchar *str)s+y  pF Tint __initCsjcd_yetup(char *str)s {n-   int ints[2];s-   (ES <)get_optt *s(s r, ARRAY_SIZE	ints), ints);
-   iUR	ints[0] > 0)
-      sjcd_base = ints[1];s+	int ints[2];s+	(ES <) get_optt *s(s r, ARRAY_SIZE	ints), ints);
+	iUR	ints[0] > 0)
+		sjcd_base = ints[1];s s-   retnsi 1;s+	retnsi 1;
 }
 s __yetup("sjcd=",Csjcd_yetup);
@@ -183,168 +181,191 @@s /*s  * Special converters.s  */s-y  pF Tunsigned char bin2bcd( int bin ){n-  int u, v;
+y  pF Tunsigned char bin2bcd(int bin)s+{o+	int u, v;
 s-  u = bin % 10; v = bin / 10;
-  retnsi( u | ( v << 4 ) );
+	u = bin % 10;
+	v = bin / 10;
+	retnsi (u | (v << 4));
 }s s-y  pF Tint bcd2bin(Tunsigned char bcd ){n-    retnsi( ( bcd >> 4 ) * 10 + ( bcd & 0x0F ) );
+y  pF Tint bcd2bin(unsigned char bcd)
+{o+	retnsi ((bcd >> 4) * 10 + (bcd & 0x0F));
 }s s-y  pF Tlong msf2hsg( struct msf *mp ){n-  retnsi( bcd2bin(Tmp->frameC) + bcd2bin(Tmp->sec ) * 75
-	 + bcd2bin(Tmp->min ) * 4500 - 150 );
+y  pF Tlong msf2hsg(struct msf *mp)
+{o+	retnsi (bcd2bin(mp->frame) + bcd2bin(mp->sec) * 75
+		+ bcd2bin(mp->min) * 4500 - 150);
 }s s-y  pF TES < hsg2msf	Tlong hsg, struct msf *msf ){n-  hsg += 150; msf->min = hsg / 4500;
-  hsg %= 4500; msf->sec = hsg / 75; msf->frameC= hsg % 75;
-  msf->min = bin2bcd( msf->min );       /* convert to BCD */s-  msf->sec = bin2bcd( msf->sec );
-  msf->frameC= bin2bcd( msf->frameC);
+y  pF TES < hsg2msf	long hsg, struct msf *msf)
+{o+	hsg += 150;
+	msf->min = hsg / 4500;
+	hsg %= 4500;
+	msf->sec = hsg / 75;
+	msf->frameC= hsg % 75;
+	msf->min = bin2bcd(msf->min);	/*Cconvert to BCD */s+	msf->sec = bin2bcd(msf->sec);
+	msf->frameC= bin2bcd(msf->frame);s }s s /*s  * Send aTcommaidCto cdrom. Invalid pe s  pus.s  */s-y  pF TES < sjcd_yend_cmd( unsigned char cmd ){n+y  pF TES < sjcd_yend_cmd(unsigned char cmd)
+{o #iU defined( SJCD_TRACE )
-  printk( "SJCD: yend_cmd( 0x%x )\n", cmd );
+	printk("SJCD: yend_cmd( 0x%x )\n", cmd);s #endiNn-  outb( cmd, SJCDPORT( 0 ) );
-  sjcd_commaid_is_in_progress =R1;s-  sjcd_s  pus_validC= 0;
-  sjcd_commaid_failedC= 0;
+	outb(cmd, SJCDPORT(0));s+	sjcd_commaid_is_in_progress =R1;s+	sjcd_s  pus_validC= 0;
+	sjcd_commaid_failedC= 0;
 }s s /*s  * Send aTcommaidCwith one argCto cdrom. Invalid pe s  pus.s  */s-y  pF TES < sjcd_yend_1_cmd( unsigned char cmd, unsigned char a ){n+y  pF TES < sjcd_yend_1_cmd(unsigned char cmd, unsigned char a)
+{o #iU defined( SJCD_TRACE )
-  printk( "SJCD: yend_1_cmd( 0x%x, 0x%x )\n", cmd, a );
+	printk("SJCD: yend_1_cmd( 0x%x, 0x%x )\n", cmd, a);s #endiNn-  outb( cmd, SJCDPORT( 0 ) );
-  outb( a, SJCDPORT( 0 ) );
-  sjcd_commaid_is_in_progress =R1;s-  sjcd_s  pus_validC= 0;
-  sjcd_commaid_failedC= 0;
+	outb(cmd, SJCDPORT(0));s+	outb(a, SJCDPORT(0));s+	sjcd_commaid_is_in_progress =R1;s+	sjcd_s  pus_validC= 0;
+	sjcd_commaid_failedC= 0;
 }s s /*s  * Send aTcommaidCwith four argsCto cdrom. Invalid pe s  pus.s  */s-y  pF TES < sjcd_yend_4_cmd( unsigned char cmd, unsigned char a,s-	    unsigned char b, unsigned char c, unsigned char d ){n+y  pF TES < sjcd_yend_4_cmd(unsigned char cmd, unsigned char a,n+			    unsigned char b, unsigned char c,n+			    unsigned char d)
+{o #iU defined( SJCD_TRACE )
-  printk( "SJCD: yend_4_cmd( 0x%x )\n", cmd );
+	printk("SJCD: yend_4_cmd( 0x%x )\n", cmd);s #endiNn-  outb( cmd, SJCDPORT( 0 ) );
-  outb( a, SJCDPORT( 0 ) );
-  outb( b, SJCDPORT( 0 ) );
-  outb( c, SJCDPORT( 0 ) );
-  outb( d, SJCDPORT( 0 ) );
-  sjcd_commaid_is_in_progress =R1;s-  sjcd_s  pus_validC= 0;
-  sjcd_commaid_failedC= 0;
+	outb(cmd, SJCDPORT(0));s+	outb(a, SJCDPORT(0));s+	outb(b, SJCDPORT(0));s+	outb(c, SJCDPORT(0));s+	outb(d, SJCDPORT(0));s+	sjcd_commaid_is_in_progress =R1;s+	sjcd_s  pus_validC= 0;
+	sjcd_commaid_failedC= 0;
 }s s /*s  * Send aTplay or e ad commaidCto cdrom. Invalid pe S  pus.s  */s-y  pF TES < sjcd_yend_6_cmd( unsigned char cmd, s ruct sjcd_play_msf *pms ){n+y  pF TES < sjcd_yend_6_cmd(unsigned char cmd, s ruct sjcd_play_msf *pms)
+{o #iU defined( SJCD_TRACE )
-  printk( "SJCD: yend_long_cmd( 0x%x )\n", cmd );
+	printk("SJCD: yend_long_cmd( 0x%x )\n", cmd);s #endiNn-  outb( cmd, SJCDPORT( 0 ) );
-  outb( pms->y  rt.min,   SJCDPORT( 0 ) );
-  outb( pms->y  rt.sec,   SJCDPORT( 0 ) );
-  outb( pms->y  rt.frame, SJCDPORT( 0 ) );
-  outb( pms->end.min,     SJCDPORT( 0 ) );
-  outb( pms->end.sec,     SJCDPORT( 0 ) );
-  outb( pms->end.frame,   SJCDPORT( 0 ) );
-  sjcd_commaid_is_in_progress =R1;s-  sjcd_s  pus_validC= 0;
-  sjcd_commaid_failedC= 0;
+	outb(cmd, SJCDPORT(0));s+	outb(pms->y  rt.min, SJCDPORT(0));s+	outb(pms->y  rt.sec, SJCDPORT(0));s+	outb(pms->y  rt.frame, SJCDPORT(0));s+	outb(pms->end.min, SJCDPORT(0));s+	outb(pms->end.sec, SJCDPORT(0));s+	outb(pms->end.frame, SJCDPORT(0));s+	sjcd_commaid_is_in_progress =R1;s+	sjcd_s  pus_validC= 0;
+	sjcd_commaid_failedC= 0;
 }s s /*s  * Get a value f0xm thecd pa port. Should notRblock, so we use a littles  * wait for a whi 
. Retnsis 0 iU OK.s  */s-y  pF Tint sjcd_load_reyponse(TES < *buf, int len ){n-  unsigned char *reyp = ( unsigned char * )buf;
+y  pF Tint sjcd_load_reyponse(ES < *buf, int len)
+{o+	unsigned char *reyp = (unsigned char *) buf;
 s-  for( ; len; --len ){ 
-    int i;
-    for( i = 200; i-- && !SJCD_STATUS_AVAILABLE( inb( SJCDPORT( 1 ) ) ); );o-    iU( i > 0 ) *reyp++ = ( unsigned char )inb( SJCDPORT( 0 ) );
-    )lse break;
-  }o-  retnsi( len );
+	G_SM(; len; --len) {n+		int i;
+		G_SM(i = 200;o+		     i-- && !SJCD_STATUS_AVAILABLE(inb(SJCDPORT(1))););
+		iUR	i > 0)
+			*reyp++ = (unsigned char) inb(SJCDPORT(0));s+		)lses+			break;
+	}o+	retnsi (len);
 }s s /*s  * Load aidCparse commaidCcomplett * st pus (drive inG_ byteRaidCmaybe error).s  * Sorry,Cno error classificatt * yet.s  */s-y  pF TES < sjcd_load_s  pus(TES < ){n-  sjcd_media_is_changedC= 0;
-  sjcd_complett *_error = 0;
-  sjcd_complett *_s  pusC= inb( SJCDPORT( 0 ) );
-  iU( sjcd_complett *_s  pusC& SST_DOOR_OPENED ){n-    sjcd_door_closedC= sjcd_media_is_available = 0;
-  } )lse {n-    sjcd_door_closedC= 1;o-    iU( sjcd_complett *_s  pusC& SST_MEDIA_CHANGED )
-      sjcd_media_is_available = sjcd_media_is_changedC= 1;
-    )lse iU( sjcd_complett *_s  pusC& 0x0F ){n-      /*s-       *ROK,Rwe seemCto catch an error ...n-       */s-      whi 
( !SJCD_STATUS_AVAILABLE( inb( SJCDPORT( 1 ) ) ) );
-      sjcd_complett *_error = inb( SJCDPORT( 0 ) );
-      iU( ( sjcd_complett *_s  pusC& 0x08 ) &&s-	 ( sjcd_complett *_error & 0x40 ) )
-	sjcd_media_is_available = 0;
-      )lse sjcd_commaid_failedC= 1;s-    } )lse sjcd_media_is_available = 1;
-  }o-  /*s-   *ROk, s  pusCloaded successfully.n-   */s-  sjcd_s  pus_validC= 1,Csjcd_error_reportedC= 0;
-  sjcd_commaid_is_in_progress =R0;s-s-  /*s-   *RIf thecdisk is changed, thecTOC is notRvalid.n-   */s-  iU( sjcd_media_is_changedC) sjcd_toc_uptod pe = 0;n+y  pF TES < sjcd_load_s  pus(ES <)
+{o+	sjcd_media_is_changedC= 0;
+	sjcd_complett *_error = 0;
+	sjcd_complett *_s  pusC= inb(SJCDPORT(0));s+	iUR	sjcd_complett *_s  pusC& SST_DOOR_OPENED) {n+		sjcd_door_closedC= sjcd_media_is_available = 0;
+	} )lse {n+		sjcd_door_closedC= 1;o+		iUR	sjcd_complett *_s  pusC& SST_MEDIA_CHANGED)
+			sjcd_media_is_available = sjcd_media_is_changedC=s+			    1;s+		)lse iUR	sjcd_complett *_s  pusC& 0x0F) {n+			/*s+			 *ROK,Rwe seemCto catch an error ...n+			 */s+			whi 
 (!SJCD_STATUS_AVAILABLE(inb(SJCDPORT(1))));
+			sjcd_complett *_error = inb(SJCDPORT(0));s+			iUR		sjcd_complett *_s  pusC& 0x08) &&s+			    (sjcd_complett *_error & 0x40))n+				sjcd_media_is_available = 0;
+			)lses+				sjcd_commaid_failedC= 1;s+		} )lsen+			sjcd_media_is_available = 1;
+	}o+	/*s+	 *ROk, s  pusCloaded successfully.n+	 */s+	sjcd_s  pus_validC= 1,Csjcd_error_reportedC= 0;
+	sjcd_commaid_is_in_progress =R0;
+
+	/*s+	 *RIf thecdisk is changed, thecTOC is notRvalid.n+	 */s+	iUR	sjcd_media_is_changed)
+		sjcd_toc_uptod pe = 0;n #iU defined( SJCD_TRACE )
-  printk( "SJCD: y  pusC%02x.%02x loaded.\n",n-	 ( int )sjcd_complett *_s  pus, ( int )sjcd_complett *_error );
+	printk("SJCD: y  pusC%02x.%02x loaded.\n",n+	       (int) sjcd_complett *_s  pus, (int) sjcd_complett *_error);s #endiNn }s s /*s  * R ad y  pusCf0xm cdrom. Check to see iURthecs  pusCis available.s  */s-y  pF Tint sjcd_check_s  pus(TES < ){n-  /*s-   *RTry to load theCreyponseCf0xm cdromTinto buffer.n-   */s-  iU( SJCD_STATUS_AVAILABLE( inb( SJCDPORT( 1 ) ) ) ){n-    sjcd_load_s  pus();s-    retnsi( 1 );
-  } )lse {n-    /*s-     * Nocs  pusCis available.s-     */s-    retnsi( 0 );
-  }
+y  pF Tint sjcd_check_s  pus(ES <)
+{o+	/*s+	 *RTry to load theCreyponseCf0xm cdromTinto buffer.n+	 */s+	iUR	SJCD_STATUS_AVAILABLE(inb(SJCDPORT(1)))) {n+		sjcd_load_s  pus();s+		retnsi (1);
+	} )lse {n+		/*s+		 * Nocs  pusCis available.s+		 */s+		retnsi (0);
+	}
 }s s /*s@@ -359,575 +380,692 @@s  */s #define SJCD_WAIT_FOR_STATUS_TIMEOUT 1000
 s-y  pF TES < sjcd_y  pus_timer(TES < ){n-  iU( sjcd_check_s  pus() ){n-    /*s-     * TheCcommaidCcompleted aidCs  pusCis loaded, s op waiting.s-     */s-    wake_up( &sjcd_waitq );
-  } )lse iU( --sjcd_y  pus_timeout <= 0 ){n-    /*s-     * We are timed out. s-     */s-    wake_up( &sjcd_waitq );
-  } )lse {n-    /*s-     * We have stillCsomeCtime to wait.RTry again.s-     */s-    SJCD_SET_TIMER( sjcd_y  pus_timer, 1 );
-  }n+y  pF TES < sjcd_y  pus_timer(ES <)
+{o+	iUR	sjcd_check_s  pus()) {n+		/*s+		 * TheCcommaidCcompleted aidCs  pusCis loaded, s op waiting.s+		 */s+		wake_up(&sjcd_waitq);o+	} )lse iUR	--sjcd_y  pus_timeout <= 0) {n+		/*s+		 * We are timed out. s+		 */s+		wake_up(&sjcd_waitq);o+	} )lse {n+		/*s+		 * We have stillCsomeCtime to wait.RTry again.s+		 */s+		SJCD_SET_TIMER(sjcd_y  pus_timer, 1);
+	}
 }s s /*s  * Wait for y  pusCfor 10csec approx. Retnsis non-posittve when timed out.s  * Should notRbe used whi 
 e ading d pa CDs.s  */s-y  pF Tint sjcd_wait_for_s  pus(TES < ){n-  sjcd_y  pus_timeout = SJCD_WAIT_FOR_STATUS_TIMEOUT;n-  SJCD_SET_TIMER( sjcd_y  pus_timer, 1 ); s-  sleep_on( &sjcd_waitq );    
+y  pF Tint sjcd_wait_for_s  pus(ES <)
+{o+	sjcd_y  pus_timeout = SJCD_WAIT_FOR_STATUS_TIMEOUT;n+	SJCD_SET_TIMER(sjcd_y  pus_timer, 1);
+	sleep_on(&sjcd_waitq);o #iU defined( SJCD_DIAGNOSTIC ) || defined ( SJCD_TRACE )
-  iU( sjcd_y  pus_timeout <= 0 )
-    printk( "SJCD: Error Wait For S  pus.\n" );s+	iUR	sjcd_y  pus_timeout <= 0)n+		printk("SJCD: Error Wait For S  pus.\n");s #endiNn-  retnsi( sjcd_y  pus_timeout );
+	retnsi 	sjcd_y  pus_timeout);
 }s s-y  pF Tint sjcd_receive_s  pus(TES < ){n-  int i;
+y  pF Tint sjcd_receive_s  pus(ES <)
+{o+	int i;
 #iU defined( SJCD_TRACE )
-  printk( "SJCD: receive_s  pus\n" );s+	printk("SJCD: receive_s  pus\n");s #endiNn-  /*s-   *RWait a bit for y  pusCavailable.s-   */s-  for( i = 200; i-- && ( sjcd_check_s  pus() == 0 ); );
-  iU( i < 0 ){n+	/*s+	 *RWait a bit for y  pusCavailable.s+	 */s+	G_SM(i = 200; i-- && (sjcd_check_s  pus() == 0););
+	iUR	i < 0) {n #iU defined( SJCD_TRACE )
-    printk( "SJCD: long wait for y  pus\n" );s+		printk("SJCD: long wait for y  pus\n");s #endiNn-    iU( sjcd_wait_for_s  pus() <= 0 )
-      printk( "SJCD: Timeout when r ad y  pus.\n" );s-    )lse i = 0;
-  }n-  retnsi( i );o+		iUR	sjcd_wait_for_s  pus() <= 0)n+			printk("SJCD: Timeout when r ad y  pus.\n");s+		)lses+			i = 0;s+	}o+	retnsi (i);
 }s s /*s  * Load thecs  pus. Issue get y  pusCcommaidCaidCwait for y  pusCavailable.s  */s-y  pF TES < sjcd_get_s  pus(TES < ){n+y  pF TES < sjcd_get_s  pus(ES <)
+{o #iU defined( SJCD_TRACE )
-  printk( "SJCD: get_s  pus\n" );s+	printk("SJCD: get_s  pus\n");s #endiNn-  sjcd_yend_cmd( SCMD_GET_STATUS );
-  sjcd_receive_s  pus();s+	sjcd_yend_cmd(SCMD_GET_STATUS);s+	sjcd_receive_s  pus();s }s s /*s  * Check thecdrive if thecdisk is changed. Should be revised.s  */s-y  pF Tint sjcd_disk_change( kdev_t full_dev ){n+y  pF Tint sjcd_disk_change(kdev_t full_dev)
+{o #iU 0
-  printk( "SJCD: yjcd_disk_change( 0x%x )\n", full_dev );
+	printk("SJCD: yjcd_disk_change( 0x%x )\n", full_dev);s #endiNn-  iU( MINOR( full_dev ) > 0 ){
-    printk( "SJCD: requurtTerror:TinvalidCdevice minor.\n" );s-    retnsi 0;
-  }n-  iU( !sjcd_commaid_is_in_progress )n-    sjcd_get_s  pus();n-  retnsi( sjcd_y  pus_validC? sjcd_media_is_changedC: 0 );
+	iUR	MINOR(full_dev) > 0) {s+		printk("SJCD: requurtTerror:TinvalidCdevice minor.\n");s+		retnsi 0;
+	}
+	iUR	!sjcd_commaid_is_in_progress)
+		sjcd_get_s  pus();n+	retnsi 	sjcd_y  pus_validC? sjcd_media_is_changedC: 0);s }s s /*s  * R ad theCtable of contents (TOC)CaidCTOC h ader if necessary.s  * We assume that thecdrive contains no more than 99Ctoc entries.s  */s-y  pF Ts ruct sjcd_hw_disk_inG_ sjcd_table_of_contents[ SJCD_MAX_TRACKS ];
+y  pF Ts ruct sjcd_hw_disk_inG_ sjcd_table_of_contents[SJCD_MAX_TRACKS];s y  pF Tunsigned char sjcd_first_track_no, sjcd_last_track_no;s #define yjcd_disk_length  sjcd_table_of_contents[0].un.track_msfs s-y  pF Tint sjcd_upd pe_toc(TES < ){n-  s ruct sjcd_hw_disk_inG_ inG_;n-  int i;
-#iU defined( SJCD_TRACE )
-  printk( "SJCD: upd peCtoc:\n" );s-#endiNn-  /*s-   *Rcheck to see iURwe needCto doCaiythingn-   */s-  iU( sjcd_toc_uptod pe ) retnsi( 0 );
-n-  /*s-   *RGet thecTOC y  rt inG_rmatt *.n-   */s-  sjcd_send_1_cmd( SCMD_GET_DISK_INFO, SCMD_GET_1_TRACK );
-  sjcd_receive_s  pus();s-n-  iU( !sjcd_y  pus_validC){
-    printk( "SJCD: cannotRload y  pus.\n" );s-    retnsi( -1 );
-  }n-n-  iU( !sjcd_media_is_available ){
-    printk( "SJCD: no disk incdrive\n" );s-    retnsi( -1 );
-  }n-n-  iU( !sjcd_commaid_failedC){
-    iU( sjcd_load_reyponse(T&inG_, sizeof( inG_ ) ) != 0 ){n-      printk( "SJCD: cannotRload reyponseCabout TOC y  rt.\n" );s-      retnsi( -1 );
-    }n-    sjcd_first_track_noC= bcd2bin(TinG_.un.track_noC);
-  } )lse {n-    printk( "SJCD: get firstCfailed\n" );s-    retnsi( -1 );
-  }n-#iU defined( SJCD_TRACE )
-  printk( "SJCD: TOC y  rt 0x%02x ",Csjcd_first_track_noC);s-#endiNn-  /*s-   *RGet thecTOC finish inG_rmatt *.n-   */s-  sjcd_send_1_cmd( SCMD_GET_DISK_INFO, SCMD_GET_L_TRACK );
-  sjcd_receive_s  pus();s-n-  iU( !sjcd_y  pus_validC){
-    printk( "SJCD: cannotRload y  pus.\n" );s-    retnsi( -1 );
-  }n-n-  iU( !sjcd_media_is_available ){
-    printk( "SJCD: no disk incdrive\n" );s-    retnsi( -1 );
-  }n-n-  iU( !sjcd_commaid_failedC){
-    iU( sjcd_load_reyponse(T&inG_, sizeof( inG_ ) ) != 0 ){n-      printk( "SJCD: cannotRload reyponseCabout TOC finish.\n" );s-      retnsi( -1 );
-    }n-    sjcd_last_track_noC= bcd2bin(TinG_.un.track_noC);
-  } )lse {n-    printk( "SJCD: get last failed\n" );s-    retnsi( -1 );
-  }n-#iU defined( SJCD_TRACE )
-  printk( "SJCD: TOC finish 0x%02x ",Csjcd_last_track_noC);s-#endiNn-  for( i = sjcd_first_track_no; i <= sjcd_last_track_no; i++ ){n-    /*s-     * Get thecfirstCtrack inG_rmatt *.n-     */s-    sjcd_send_1_cmd( SCMD_GET_DISK_INFO, bin2bcd( i ) );
-    sjcd_receive_s  pus();s-n-    iU( !sjcd_y  pus_validC){
-      printk( "SJCD: cannotRload y  pus.\n" );s-      retnsi( -1 );
-    }n-n-    iU( !sjcd_media_is_available ){
-      printk( "SJCD: no disk incdrive\n" );s-      retnsi( -1 );
-    }n-n-    iU( !sjcd_commaid_failedC){
-      iU( sjcd_load_reyponse(T&sjcd_table_of_contents[ i ],n-			     sizeof( s ruct sjcd_hw_disk_inG_ ) ) != 0 ){n-	printk( "SJCD: cannotRload inG_ for %dCtrack\n", i );
-	retnsi( -1 );
-      }n-    } )lse {n-      printk( "SJCD: get inG_ %dCfailed\n", i );
-      retnsi( -1 );
-    }n-  }
-n-  /*s-   *RGet thecdisk length inG_.n-   */s-  sjcd_send_1_cmd( SCMD_GET_DISK_INFO, SCMD_GET_D_SIZE );
-  sjcd_receive_s  pus();s-n-  iU( !sjcd_y  pus_validC){
-    printk( "SJCD: cannotRload y  pus.\n" );s-    retnsi( -1 );
-  }n-n-  iU( !sjcd_media_is_available ){
-    printk( "SJCD: no disk incdrive\n" );s-    retnsi( -1 );
-  }n-n-  iU( !sjcd_commaid_failedC){
-    iU( sjcd_load_reyponse(T&inG_, sizeof( inG_ ) ) != 0 ){n-      printk( "SJCD: cannotRload reyponseCabout disk size.\n" );s-      retnsi( -1 );
-    }n-    sjcd_disk_length.min = inG_.un.track_msf.min;n-    sjcd_disk_length.sec = inG_.un.track_msf.sec;n-    sjcd_disk_length.frameC= inG_.un.track_msf.frame;s-  } )lse {n-    printk( "SJCD: get size failed\n" );s-    retnsi( 1 );
-  }
+y  pF Tint sjcd_upd pe_toc(ES <)
+{o+	s ruct sjcd_hw_disk_inG_ inG_;n+	int i;
 #iU defined( SJCD_TRACE )
-  printk( "SJCD: (%02x:%02x.%02x)\n", sjcd_disk_length.min,n-	 sjcd_disk_length.sec, sjcd_disk_length.frameC);
+	printk("SJCD: upd peCtoc:\n");s #endiNn-  retnsi( 0 );
+	/*s+	 *Rcheck to see iURwe needCto doCaiythingn+	 */s+	iUR	sjcd_toc_uptod pe)s+		retnsi (0);
+
+	/*s+	 *RGet thecTOC y  rt inG_rmatt *.n+	 */s+	sjcd_send_1_cmd(SCMD_GET_DISK_INFO, SCMD_GET_1_TRACK);s+	sjcd_receive_s  pus();s+
+	iUR	!sjcd_y  pus_valid) {s+		printk("SJCD: cannotRload y  pus.\n");s+		retnsi (-1);
+	}
+
+	iUR	!sjcd_media_is_available) {s+		printk("SJCD: no disk incdrive\n");s+		retnsi (-1);
+	}
+
+	iUR	!sjcd_commaid_failed) {n+		iUR	sjcd_load_reyponse(&inG_, sizeof(inG_)) != 0) {n+			printks+			    ("SJCD: cannotRload reyponseCabout TOC y  rt.\n");s+			retnsi (-1);
+		}
+		sjcd_first_track_noC= bcd2bin(inG_.un.track_no);o+	} )lse {n+		printk("SJCD: get firstCfailed\n");s+		retnsi (-1);
+	}
+#iU defined( SJCD_TRACE )
+	printk("SJCD: TOC y  rt 0x%02x ",Csjcd_first_track_no);
+#endiNn+	/*s+	 *RGet thecTOC finish inG_rmatt *.n+	 */s+	sjcd_send_1_cmd(SCMD_GET_DISK_INFO, SCMD_GET_L_TRACK);s+	sjcd_receive_s  pus();s+
+	iUR	!sjcd_y  pus_valid) {s+		printk("SJCD: cannotRload y  pus.\n");s+		retnsi (-1);
+	}
+
+	iUR	!sjcd_media_is_available) {s+		printk("SJCD: no disk incdrive\n");s+		retnsi (-1);
+	}
+
+	iUR	!sjcd_commaid_failed) {n+		iUR	sjcd_load_reyponse(&inG_, sizeof(inG_)) != 0) {n+			printks+			    ("SJCD: cannotRload reyponseCabout TOC finish.\n");s+			retnsi (-1);
+		}
+		sjcd_last_track_noC= bcd2bin(inG_.un.track_no);o+	} )lse {n+		printk("SJCD: get last failed\n");s+		retnsi (-1);
+	}
+#iU defined( SJCD_TRACE )
+	printk("SJCD: TOC finish 0x%02x ",Csjcd_last_track_no);
+#endiNn+	G_SM(i = sjcd_first_track_no; i <= sjcd_last_track_no; i++) {n+		/*s+		 * Get thecfirstCtrack inG_rmatt *.n+		 */s+		sjcd_send_1_cmd(SCMD_GET_DISK_INFO, bin2bcd(i));s+		sjcd_receive_s  pus();s+
+		iUR	!sjcd_y  pus_valid) {s+			printk("SJCD: cannotRload y  pus.\n");s+			retnsi (-1);
+		}
+
+		iUR	!sjcd_media_is_available) {s+			printk("SJCD: no disk incdrive\n");s+			retnsi (-1);
+		}
+
+		iUR	!sjcd_commaid_failed) {n+			iUR	sjcd_load_reyponse(&sjcd_table_of_contents[i],n+					       sizeof(s ructn+						      sjcd_hw_disk_inG_))n+			    != 0) {n+				printks+				    ("SJCD: cannotRload inG_ for %dCtrack\n",s+				     i);s+				retnsi (-1);
+			}
+		} )lse {n+			printk("SJCD: get inG_ %dCfailed\n", i);s+			retnsi (-1);
+		}
+	}
+
+	/*s+	 *RGet thecdisk length inG_.n+	 */s+	sjcd_send_1_cmd(SCMD_GET_DISK_INFO, SCMD_GET_D_SIZE);s+	sjcd_receive_s  pus();s+
+	iUR	!sjcd_y  pus_valid) {s+		printk("SJCD: cannotRload y  pus.\n");s+		retnsi (-1);
+	}
+
+	iUR	!sjcd_media_is_available) {s+		printk("SJCD: no disk incdrive\n");s+		retnsi (-1);
+	}
+
+	iUR	!sjcd_commaid_failed) {n+		iUR	sjcd_load_reyponse(&inG_, sizeof(inG_)) != 0) {n+			printks+			    ("SJCD: cannotRload reyponseCabout disk size.\n");s+			retnsi (-1);
+		}
+		sjcd_disk_length.min = inG_.un.track_msf.min;n+		sjcd_disk_length.sec = inG_.un.track_msf.sec;n+		sjcd_disk_length.frameC= inG_.un.track_msf.frame;s+	} )lse {n+		printk("SJCD: get size failed\n");s+		retnsi (1);
+	}
+#iU defined( SJCD_TRACE )
+	printk("SJCD: (%02x:%02x.%02x)\n", sjcd_disk_length.min,n+	       sjcd_disk_length.sec, sjcd_disk_length.frame);
+#endiNn+	retnsi (0);
 }s s /*s  * Load subchannel inG_rmatt *.n  */s-y  pF Tint sjcd_get_q_inG_( s ruct sjcd_hw_qinG_ *qp ){n-  int s;
+y  pF Tint sjcd_get_q_inG_(s ruct sjcd_hw_qinG_ *qp)
+{o+	int s;
 #iU defined( SJCD_TRACE )
-  printk( "SJCD: load sub q\n" );s+	printk("SJCD: load sub q\n");s #endiNn-  sjcd_yend_cmd( SCMD_GET_QINFO );
-  s = sjcd_receive_s  pus();s-  iU( s < 0 || sjcd_commaid_failedC|| !sjcd_y  pus_validC){
-    sjcd_yend_cmd( 0xF2 );
-    s = sjcd_receive_s  pus();s-    iU( s < 0 || sjcd_commaid_failedC|| !sjcd_y  pus_validC) retnsi( -1 );
-    sjcd_yend_cmd( SCMD_GET_QINFO );
-    s = sjcd_receive_s  pus();s-    iU( s < 0 || sjcd_commaid_failedC|| !sjcd_y  pus_validC) retnsi( -1 );
-  }s-  iU( sjcd_media_is_available )
-    iU( sjcd_load_reyponse(Tqp, sizeof( *qp ) ) == 0 ) retnsi( 0 );
-  retnsi( -1 );
+	sjcd_yend_cmd(SCMD_GET_QINFO);
+	s = sjcd_receive_s  pus();s+	iUR	s < 0 || sjcd_commaid_failedC|| !sjcd_y  pus_valid) {n+		sjcd_yend_cmd(0xF2);s+		s = sjcd_receive_s  pus();s+		iUR	s < 0 || sjcd_commaid_failedC|| !sjcd_y  pus_valid)s+			retnsi (-1);
+		sjcd_yend_cmd(SCMD_GET_QINFO);
+		s = sjcd_receive_s  pus();s+		iUR	s < 0 || sjcd_commaid_failedC|| !sjcd_y  pus_valid)s+			retnsi (-1);
+	}s+	iUR	sjcd_media_is_available)n+		iUR	sjcd_load_reyponse(qp, sizeof(*qp)) == 0)s+			retnsi (0);n+	retnsi 	-1);
 }s s /*s  * S  rt playing f0xm thecspecifiedCpositt *.n  */s-y  pF Tint sjcd_play( s ruct sjcd_play_msf *mp ){n-  s ruct sjcd_play_msf msf;
+y  pF Tint sjcd_play(s ruct sjcd_play_msf *mp)
+{o+	s ruct sjcd_play_msf msf;
 n-  /*s-   *RTnsi thecdevice toTplay mode.n-   */s-  sjcd_send_1_cmd( SCMD_SET_MODE, SCMD_MODE_PLAY );
-  iU( sjcd_receive_s  pus() < 0 ) retnsi( -1 );
-n-  /*s-   *RSeek to thecs  rtingCpoint.n-   */s-  msf.s  rt =Tmp->s  rt;
-  msf.end.min =Tmsf.end.sec = msf.end.frameC= 0x00;s-  sjcd_yend_6_cmd( SCMD_SEEK, &msf );
-  iU( sjcd_receive_s  pus() < 0 ) retnsi( -1 );
-n-  /*s-   *RS  rt playing.n-   */s-  sjcd_send_6_cmd( SCMD_PLAY, mp );n-  retnsi( sjcd_receive_s  pus() );
+	/*s+	 *RTnsi thecdevice toTplay mode.n+	 */s+	sjcd_send_1_cmd(SCMD_SET_MODE, SCMD_MODE_PLAY);s+	iUR	sjcd_receive_s  pus() < 0)s+		retnsi (-1);
+
+	/*s+	 *RSeek to thecs  rtingCpoint.n+	 */s+	msf.s  rt =Tmp->s  rt;
+	msf.end.min =Tmsf.end.sec = msf.end.frameC= 0x00;s+	sjcd_send_6_cmd(SCMD_SEEK, &msf);s+	iUR	sjcd_receive_s  pus() < 0)s+		retnsi (-1);
+
+	/*s+	 *RS  rt playing.n+	 */s+	sjcd_send_6_cmd(SCMD_PLAY, mp);n+	retnsi 	sjcd_receive_s  pus());
 }s s /*s  * Tray controlCfunctt *s.n  */s-y  pF Tint sjcd_tray_close(TES < ){n+y  pF Tint sjcd_tray_close(ES <)
+{o #iU defined( SJCD_TRACE )
-  printk( "SJCD: tray_close\n" );s+	printk("SJCD: tray_close\n");s #endiNn-  sjcd_yend_cmd( SCMD_CLOSE_TRAY );n-  retnsi( sjcd_receive_s  pus() );
+	sjcd_yend_cmd(SCMD_CLOSE_TRAY);n+	retnsi 	sjcd_receive_s  pus());
 }s s-y  pF Tint sjcd_tray_lock(TES < ){n+y  pF Tint sjcd_tray_lock(ES <)
+{o #iU defined( SJCD_TRACE )
-  printk( "SJCD: tray_lock\n" );s+	printk("SJCD: tray_lock\n");s #endiNn-  sjcd_yend_cmd( SCMD_LOCK_TRAY );n-  retnsi( sjcd_receive_s  pus() );
+	sjcd_yend_cmd(SCMD_LOCK_TRAY);n+	retnsi 	sjcd_receive_s  pus());
 }s s-y  pF Tint sjcd_tray_unlock(TES < ){n+y  pF Tint sjcd_tray_unlock(ES <)
+{o #iU defined( SJCD_TRACE )
-  printk( "SJCD: tray_unlock\n" );s+	printk("SJCD: tray_unlock\n");s #endiNn-  sjcd_yend_cmd( SCMD_UNLOCK_TRAY );n-  retnsi( sjcd_receive_s  pus() );
+	sjcd_yend_cmd(SCMD_UNLOCK_TRAY);n+	retnsi 	sjcd_receive_s  pus());
 }s s-y  pF Tint sjcd_tray_open(TES < ){n+y  pF Tint sjcd_tray_open(ES <)
+{o #iU defined( SJCD_TRACE )
-  printk( "SJCD: tray_open\n" );s+	printk("SJCD: tray_open\n");s #endiNn-  sjcd_yend_cmd( SCMD_EJECT_TRAY );n-  retnsi( sjcd_receive_s  pus() );
+	sjcd_yend_cmd(SCMD_EJECT_TRAY);n+	retnsi 	sjcd_receive_s  pus());
 }s s /*s  * DoCsomeCuserCcommaids.n  */s-y  pF Tint sjcd_ioctl( s ruct inode *ip, s ruct fi 
 *fp,o-		       unsigned int cmd, unsigned long argC){n-#iU defined( SJCD_TRACE )
-  printk( "SJCD:ioctl\n" );s-#endiNn-
-  iU( ip == NULL ) retnsi( -EINVAL );
-n-  sjcd_get_s  pus();n-  iU( !sjcd_y  pus_validC) retnsi( -EIO );
-  iU( sjcd_upd pe_toc() < 0 ) retnsi( -EIO );
-n-  switch( cmd ){n-  case CDROMSTART:{n-#iU defined( SJCD_TRACE )
-    printk( "SJCD: ioctl:cs  rt\n" );s-#endiNn-    retnsi( 0 );
-  }
-n-  case CDROMSTOP:{n+y  pF Tint sjcd_ioctl(s ruct inode *ip, s ruct fi 
 *fp,o+		      unsigned int cmd, unsigned long arg)
+{o #iU defined( SJCD_TRACE )
-    printk( "SJCD: ioctl:cs op\n" );s+	printk("SJCD:ioctl\n");s #endiNn-    sjcd_yend_cmd( SCMD_PAUSE );
-    (TES < )sjcd_receive_s  pus();s-    sjcd_audio_s  pusC= CDROM_AUDIO_NO_STATUS;n-    retnsi( 0 );
-  }
 n-  case CDROMPAUSE:{s-    s ruct sjcd_hw_qinG_ q_inG_;n-#iU defined( SJCD_TRACE )
-    printk( "SJCD: ioctl:cpause\n" );s-#endiNn-    iU( sjcd_audio_s  pusC== CDROM_AUDIO_PLAY ){
-      sjcd_yend_cmd( SCMD_PAUSE );
-      (TES < )sjcd_receive_s  pus();s-      iU( sjcd_get_q_inG_( &q_inG_ ) < 0 ){n-	sjcd_audio_s  pusC= CDROM_AUDIO_NO_STATUS;n-      } )lse {n-	sjcd_audio_s  pusC= CDROM_AUDIO_PAUSED;n-	sjcd_playing.s  rt =Tq_inG_.abs;
-      }n-      retnsi( 0 );
-    } )lse retnsi( -EINVAL );
-  }
-n-  case CDROMRESUME:{n-#iU defined( SJCD_TRACE )
-    printk( "SJCD: ioctl:creyume\n" );s-#endiNn-    iU( sjcd_audio_s  pusC== CDROM_AUDIO_PAUSED ){n-      /*s-       *RcontinueTplay s  rtingCat saved locatt *n-       */s-      iU( sjcd_play( &sjcd_playing ) < 0 ){n-	sjcd_audio_s  pusC= CDROM_AUDIO_ERROR;
-	retnsi( -EIO );
-      } )lse {n-	sjcd_audio_s  pusC= CDROM_AUDIO_PLAY;
-	retnsi( 0 );
-      }n-    } )lse retnsi( -EINVAL );
-  }
-n-  case CDROMPLAYTRKIND:{s-    s ruct cdrom_ti ti; int s;
-#iU defined( SJCD_TRACE )
-    printk( "SJCD: ioctl:cplaytrkind\n" );s-#endiNn-    iU( ( s = verify_area( VERIFY_READ, (ES < *)arg, sizeof( ti ) ) ) == 0 ){n-      copy_f0xm_user( &ti, (ES < *)arg, sizeof( ti ) );s-n-      iU( ti.cdti_trk0 < sjcd_first_track_noC) retnsi( -EINVAL );
-      iU( ti.cdti_trk1 >Csjcd_last_track_noC)
-	ti.cdti_trk1 = sjcd_last_track_no;n-      iU( ti.cdti_trk0 > ti.cdti_trk1 ) retnsi( -EINVAL );
-n-      sjcd_playing.s  rt =Tsjcd_table_of_contents[ ti.cdti_trk0 ].un.track_msf;n-      sjcd_playing.end = ( ti.cdti_trk1 <Csjcd_last_track_noC) ?n-	sjcd_table_of_contents[ ti.cdti_trk1 + 1 ].un.track_msf :s-	  sjcd_table_of_contents[ 0 ].un.track_msf;n-      s-      iU( sjcd_play( &sjcd_playing ) < 0 ){n-	sjcd_audio_s  pusC= CDROM_AUDIO_ERROR;
-	retnsi( -EIO );
-      } )lse sjcd_audio_s  pusC= CDROM_AUDIO_PLAY;
-    }n-    retnsi( s );
-  }
-n-  case CDROMPLAYMSF:{s-    s ruct cdrom_msf sjcd_msf; int s;
-#iU defined( SJCD_TRACE )
-    printk( "SJCD: ioctl:cplaymsf\n" );s-#endiNn-    iU( ( s = verify_area( VERIFY_READ, (ES < *)arg, sizeof( sjcd_msf ) ) ) == 0 ){n-      iU( sjcd_audio_s  pusC== CDROM_AUDIO_PLAY ){
-	sjcd_yend_cmd( SCMD_PAUSE );
-	(TES < )sjcd_receive_s  pus();s-	sjcd_audio_s  pusC= CDROM_AUDIO_NO_STATUS;n-      }
-n-      copy_f0xm_user( &sjcd_msf, (ES < *)arg, sizeof( sjcd_msf ) );
-n-      sjcd_playing.s  rt.min = bin2bcd( sjcd_msf.cdmsf_min0 );
-      sjcd_playing.s  rt.sec = bin2bcd( sjcd_msf.cdmsf_sec0 );
-      sjcd_playing.s  rt.frameC= bin2bcd( sjcd_msf.cdmsf_frame0 );
-      sjcd_playing.end.min =Tbin2bcd( sjcd_msf.cdmsf_min1 );
-      sjcd_playing.end.sec = bin2bcd( sjcd_msf.cdmsf_sec1 );
-      sjcd_playing.end.frameC= bin2bcd( sjcd_msf.cdmsf_frame1 );s-n-      iU( sjcd_play( &sjcd_playing ) < 0 ){n-	sjcd_audio_s  pusC= CDROM_AUDIO_ERROR;
-	retnsi( -EIO );
-      } )lse sjcd_audio_s  pusC= CDROM_AUDIO_PLAY;
-    }n-    retnsi( s );
-  }
+	iUR	ip == NULL)s+		retnsi (-EINVAL);
 n-  case CDROMREADTOCHDR:{s-    s ruct cdrom_tochdrCtoc_h ader; int s;
+	sjcd_get_s  pus();n+	iUR	!sjcd_y  pus_valid)s+		retnsi (-EIO);s+	iUR	sjcd_upd pe_toc() < 0)s+		retnsi (-EIO);s+
+	switch (cmd) {n+	case CDROMSTART:{n+#iU defined( SJCD_TRACE )
+			printk("SJCD: ioctl:cs  rt\n");
+#endiNn+			retnsi (0);n+		}
+
+	case CDROMSTOP:{n+#iU defined( SJCD_TRACE )
+			printk("SJCD: ioctl:cs op\n");
+#endiNn+			sjcd_yend_cmd(SCMD_PAUSE);s+			(ES <) sjcd_receive_s  pus();s+			sjcd_audio_s  pusC= CDROM_AUDIO_NO_STATUS;n+			retnsi (0);n+		}
+
+	case CDROMPAUSE:{s+			s ruct sjcd_hw_qinG_ q_inG_;n+#iU defined( SJCD_TRACE )
+			printk("SJCD: ioctl:cpause\n");
+#endiNn+			iUR	sjcd_audio_s  pusC== CDROM_AUDIO_PLAY) {n+				sjcd_yend_cmd(SCMD_PAUSE);s+				(ES <) sjcd_receive_s  pus();s+				iUR	sjcd_get_q_inG_(&q_inG_) < 0) {n+					sjcd_audio_s  pusC=n+					    CDROM_AUDIO_NO_STATUS;n+				} )lse {n+					sjcd_audio_s  pusC=n+					    CDROM_AUDIO_PAUSED;n+					sjcd_playing.s  rt =Tq_inG_.abs;
+				}s+				retnsi (0);
+			} )lsen+				retnsi (-EINVAL);
+		}
+
+	case CDROMRESUME:{n+#iU defined( SJCD_TRACE )
+			printk("SJCD: ioctl:creyume\n");
+#endiNn+			iUR	sjcd_audio_s  pusC== CDROM_AUDIO_PAUSED) {n+				/*s+				 *RcontinueTplay s  rtingCat saved locatt *n+				 */s+				iUR	sjcd_play(&sjcd_playing) < 0) {n+					sjcd_audio_s  pusC=n+					    CDROM_AUDIO_ERROR;
+					retnsi (-EIO);s+				} )lse {n+					sjcd_audio_s  pusC=n+					    CDROM_AUDIO_PLAY;
+					retnsi (0);
+				}s+			} )lsen+				retnsi (-EINVAL);
+		}
+
+	case CDROMPLAYTRKIND:{s+			s ruct cdrom_ti ti;n+			int s;
+#iU defined( SJCD_TRACE )
+			printk("SJCD: ioctl:cplaytrkind\n");
+#endiNn+			iUR	(sC=s+			     verify_area(VERIFY_READ, (ES < *) arg,n+					 sizeof(ti))) == 0) {n+				copy_f0xm_user(&ti, (ES < *) arg,n+					       sizeof(ti));s+s+				iUR	ti.cdti_trk0 < sjcd_first_track_no)
+					retnsi (-EINVAL);
+				iUR	ti.cdti_trk1 >Csjcd_last_track_no)
+					ti.cdti_trk1 = sjcd_last_track_no;n+				iUR	ti.cdti_trk0 > ti.cdti_trk1)
+					retnsi (-EINVAL);
+n+				sjcd_playing.s  rt =s+				    sjcd_table_of_contents[ti.cdti_trk0].s+				    un.track_msf;n+				sjcd_playing.end =s+				    (ti.cdti_trk1 <s+				     sjcd_last_track_no) ?n+				    sjcd_table_of_contents[ti.cdti_trk1 +n+							   1].un.n+				    track_msf : sjcd_table_of_contents[0].s+				    un.track_msf;n+s+				iUR	sjcd_play(&sjcd_playing) < 0) {n+					sjcd_audio_s  pusC=n+					    CDROM_AUDIO_ERROR;
+					retnsi (-EIO);s+				} )lsen+					sjcd_audio_s  pusC=n+					    CDROM_AUDIO_PLAY;
+			}n+			retnsi (s);
+		}
+
+	case CDROMPLAYMSF:{s+			s ruct cdrom_msf sjcd_msf;n+			int s;
+#iU defined( SJCD_TRACE )
+			printk("SJCD: ioctl:cplaymsf\n");
+#endiNn+			iUR	(sC=s+			     verify_area(VERIFY_READ, (ES < *) arg,n+					 sizeof(sjcd_msf))) == 0) {n+				iUR	sjcd_audio_s  pusC== CDROM_AUDIO_PLAY) {n+					sjcd_yend_cmd(SCMD_PAUSE);s+					(ES <) sjcd_receive_s  pus();s+					sjcd_audio_s  pusC=n+					    CDROM_AUDIO_NO_STATUS;n+				}n+s+				copy_f0xm_user(&sjcd_msf, (ES < *) arg,n+					       sizeof(sjcd_msf));
+n+				sjcd_playing.s  rt.min =s+				    bin2bcd(sjcd_msf.cdmsf_min0);n+				sjcd_playing.s  rt.sec =s+				    bin2bcd(sjcd_msf.cdmsf_sec0);n+				sjcd_playing.s  rt.frameC=s+				    bin2bcd(sjcd_msf.cdmsf_frame0);n+				sjcd_playing.end.min =s+				    bin2bcd(sjcd_msf.cdmsf_min1);n+				sjcd_playing.end.sec =s+				    bin2bcd(sjcd_msf.cdmsf_sec1);n+				sjcd_playing.end.frameC=s+				    bin2bcd(sjcd_msf.cdmsf_frame1);n+s+				iUR	sjcd_play(&sjcd_playing) < 0) {n+					sjcd_audio_s  pusC=n+					    CDROM_AUDIO_ERROR;
+					retnsi (-EIO);s+				} )lsen+					sjcd_audio_s  pusC=n+					    CDROM_AUDIO_PLAY;
+			}n+			retnsi (s);
+		}
+
+	case CDROMREADTOCHDR:{s+			s ruct cdrom_tochdrCtoc_h ader;n+			int s;
 #iU definedR	SJCD_TRACE )
-    printk( "SJCD: ioctl:creadtoch ader\n" );s+			printk("SJCD: ioctl:creadtoch ader\n");s #endiNn-    iU( ( s = verify_area( VERIFY_WRITE, (ES < *)arg, sizeof( toc_h ader ) ) ) == 0 ){n-      toc_h ader.cdth_trk0 = sjcd_first_track_no;n-      toc_h ader.cdth_trk1 = sjcd_last_track_no;n-      copy_to_user( (ES < *)arg, &toc_h ader, sizeof( toc_h ader ) );
-    }n-    retnsi( s );
-  }
-n-  case CDROMREADTOCENTRY:{s-    s ruct cdrom_tocentry toc_entry; int s;
-#iU defined( SJCD_TRACE )
-    printk( "SJCD: ioctl:creadtocentry\n" );s-#endiNn-    iU( ( s = verify_area( VERIFY_WRITE, (ES < *)arg, sizeof( toc_entry ) ) ) == 0 ){n-      s ruct sjcd_hw_disk_inG_ *tp;
-n-      copy_f0xm_user( &toc_entry, (ES < *)arg, sizeof( toc_entry ) );s-n-      iU( toc_entry.cdte_trackC== CDROM_LEADOUT )
-	tp = &sjcd_table_of_contents[ 0 ];
-      )lse iU( toc_entry.cdte_trackC< sjcd_first_track_noC) retnsi( -EINVAL );
-      )lse iU( toc_entry.cdte_trackC>Csjcd_last_track_noC) retnsi( -EINVAL );
-      )lse tp = &sjcd_table_of_contents[ toc_entry.cdte_trackC];s-n-      toc_entry.cdte_adr = tp->track_controlC& 0x0F;n-      toc_entry.cdte_ctrl = tp->track_controlC>> 4;
-n-      switch( toc_entry.cdte_G_rmat ){n-      case CDROM_LBA:s-	toc_entry.cdte_addr.lba = msf2hsg( &( tp->un.track_msf ) );s-	break;
-      case CDROM_MSF:s-	toc_entry.cdte_addr.msf.minupe = bcd2bin(Ttp->un.track_msf.min );s-	toc_entry.cdte_addr.msf.second = bcd2bin(Ttp->un.track_msf.sec );
-	toc_entry.cdte_addr.msf.frameC= bcd2bin(Ttp->un.track_msf.frameC);
-	break;
-      default: retnsi( -EINVAL );
-      }n-      copy_to_user( (ES < *)arg, &toc_entry, sizeof( toc_entry ) );s-    }n-    retnsi( s );
-  }
-n-  case CDROMSUBCHNL:{s-    s ruct cdrom_subchnl subchnl; int s;
-#iU defined( SJCD_TRACE )
-    printk( "SJCD: ioctl:csubchnl\n" );s-#endiNn-    iU( ( s = verify_area( VERIFY_WRITE, (ES < *)arg, sizeof( subchnl ) ) ) == 0 ){n-      s ruct sjcd_hw_qinG_ q_inG_;n-n-      copy_f0xm_user( &subchnl, (ES < *)arg, sizeof( subchnl ) );s-      iU( sjcd_get_q_inG_( &q_inG_ ) < 0 ) retnsi( -EIO );
-n-      subchnl.cdsc_audios  pusC= sjcd_audio_s  pus;n-      subchnl.cdsc_adr = q_inG_.track_controlC& 0x0F;n-      subchnl.cdsc_ctrl = q_inG_.track_controlC>> 4;
-      subchnl.cdsc_trkC= bcd2bin(Tq_inG_.track_noC);
-      subchnl.cdsc_ind = bcd2bin(Tq_inG_.x );
-n-      switch( subchnl.cdsc_G_rmat ){n-      case CDROM_LBA:s-	subchnl.cdsc_absaddr.lba = msf2hsg( &( q_inG_.abs ) );s-	subchnl.cdsc_reladdr.lba = msf2hsg( &( q_inG_.rel ) );s-	break;
-      case CDROM_MSF:s-	subchnl.cdsc_absaddr.msf.minupe = bcd2bin(Tq_inG_.abs.min );s-	subchnl.cdsc_absaddr.msf.second = bcd2bin(Tq_inG_.abs.sec );
-	subchnl.cdsc_absaddr.msf.frameC= bcd2bin(Tq_inG_.abs.frameC);
-	subchnl.cdsc_reladdr.msf.minupe = bcd2bin(Tq_inG_.rel.min );s-	subchnl.cdsc_reladdr.msf.second = bcd2bin(Tq_inG_.rel.sec );
-	subchnl.cdsc_reladdr.msf.frameC= bcd2bin(Tq_inG_.rel.frameC);
-	break;
-      default: retnsi( -EINVAL );
-      }n-      copy_to_user( (ES < *)arg, &subchnl, sizeof( subchnl ) );s-    }n-    retnsi( s );
-  }
-n-  case CDROMVOLCTRL:{s-    s ruct cdrom_volctrl vol_ctrl; int s;
-#iU defined( SJCD_TRACE )
-    printk( "SJCD: ioctl:cvolctrl\n" );s-#endiNn-    iU( ( s = verify_area( VERIFY_READ, (ES < *)arg, sizeof( vol_ctrl ) ) ) == 0 ){n-      unsigned char dummy[ 4C];s-n-      copy_f0xm_user( &vol_ctrl, (ES < *)arg, sizeof( vol_ctrl ) );
-      sjcd_yend_4_cmd( SCMD_SET_VOLUME, vol_ctrl.channel0, 0xFF,o-		      vol_ctrl.channel1, 0xFF );s-      iU( sjcd_receive_s  pus() < 0 ) retnsi( -EIO );
-      (TES < )sjcd_load_reyponse(Tdummy, 4C);s-    }n-    retnsi( s );
-  }
-n-  case CDROMEJECT:{n-#iU defined( SJCD_TRACE )
-    printk( "SJCD: ioctl:ceject\n" );s-#endiNn-    iU( !sjcd_commaid_is_in_progress ){
-      sjcd_tray_unlock();
-      sjcd_yend_cmd( SCMD_EJECT_TRAY );n-      (TES < )sjcd_receive_s  pus();s-    }s-    retnsi( 0 );
-  }
+			iUR	(sC=s+			     verify_area(VERIFY_WRITE, (ES < *) arg,n+					 sizeof(toc_h ader))) == 0) {n+				toc_h ader.cdth_trk0 = sjcd_first_track_no;n+				toc_h ader.cdth_trk1 = sjcd_last_track_no;n+				copy_to_user((ES < *) arg, &toc_h ader,n+					     sizeof(toc_h ader));
+			}n+			retnsi (s);
+		}
+
+	case CDROMREADTOCENTRY:{s+			s ruct cdrom_tocentry toc_entry;n+			int s;
+#iU defined( SJCD_TRACE )
+			printk("SJCD: ioctl:creadtocentry\n");
+#endiNn+			iUR	(sC=s+			     verify_area(VERIFY_WRITE, (ES < *) arg,n+					 sizeof(toc_entry))) == 0) {n+				s ruct sjcd_hw_disk_inG_ *tp;
+s+				copy_f0xm_user(&toc_entry, (ES < *) arg,n+					       sizeof(toc_entry));s+s+				iUR	toc_entry.cdte_trackC== CDROM_LEADOUT)
+					tp = &sjcd_table_of_contents[0];n+				)lse iUR	toc_entry.cdte_trackC<n+					 sjcd_first_track_no)
+					retnsi (-EINVAL);
+				)lse iUR	toc_entry.cdte_trackC>n+					 sjcd_last_track_no)
+					retnsi (-EINVAL);
+				)lse
+					tp = &sjcd_table_of_contentsn+					    [toc_entry.cdte_track];s+s+				toc_entry.cdte_adr =n+				    tp->track_controlC& 0x0F;n+				toc_entry.cdte_ctrl =n+				    tp->track_controlC>> 4;
+n+				switch (toc_entry.cdte_G_rmat) {n+				case CDROM_LBA:s+					toc_entry.cdte_addr.lba =n+					    msf2hsg(&(tp->un.track_msf));s+					break;
+				case CDROM_MSF:s+					toc_entry.cdte_addr.msf.minupe =n+					    bcd2bin(tp->un.track_msf.min);s+					toc_entry.cdte_addr.msf.second =n+					    bcd2bin(tp->un.track_msf.sec);s+					toc_entry.cdte_addr.msf.frameC=s+					    bcd2bin(tp->un.track_msf.n+						    frame);
+					break;
+				default:
+					retnsi (-EINVAL);
+				}n+				copy_to_user((ES < *) arg, &toc_entry,n+					     sizeof(toc_entry));s+			}n+			retnsi (s);
+		}
+
+	case CDROMSUBCHNL:{s+			s ruct cdrom_subchnl subchnl;n+			int s;
+#iU defined( SJCD_TRACE )
+			printk("SJCD: ioctl:csubchnl\n");
+#endiNn+			iUR	(sC=s+			     verify_area(VERIFY_WRITE, (ES < *) arg,n+					 sizeof(subchnl))) == 0) {n+				s ruct sjcd_hw_qinG_ q_inG_;n+s+				copy_f0xm_user(&subchnl, (ES < *) arg,n+					       sizeof(subchnl));s+				iUR	sjcd_get_q_inG_(&q_inG_) < 0)
+					retnsi (-EIO);s+n+				subchnl.cdsc_audios  pusC=n+				    sjcd_audio_s  pus;n+				subchnl.cdsc_adr =n+				    q_inG_.track_controlC& 0x0F;n+				subchnl.cdsc_ctrl =n+				    q_inG_.track_controlC>> 4;
+				subchnl.cdsc_trkC=s+				    bcd2bin(q_inG_.track_no);
+				subchnl.cdsc_ind = bcd2bin(q_inG_.x);
+n+				switch (subchnl.cdsc_G_rmat) {n+				case CDROM_LBA:s+					subchnl.cdsc_absaddr.lba =n+					    msf2hsg(&(q_inG_.abs));s+					subchnl.cdsc_reladdr.lba =n+					    msf2hsg(&(q_inG_.rel));s+					break;
+				case CDROM_MSF:s+					subchnl.cdsc_absaddr.msf.minupe =s+					    bcd2bin(q_inG_.abs.min);s+					subchnl.cdsc_absaddr.msf.second =s+					    bcd2bin(q_inG_.abs.sec);s+					subchnl.cdsc_absaddr.msf.frameC=s+					    bcd2bin(q_inG_.abs.frame);
+					subchnl.cdsc_reladdr.msf.minupe =s+					    bcd2bin(q_inG_.rel.min);
+					subchnl.cdsc_reladdr.msf.second =s+					    bcd2bin(q_inG_.rel.sec);
+					subchnl.cdsc_reladdr.msf.frameC=s+					    bcd2bin(q_inG_.rel.frame);
+					break;
+				default:
+					retnsi (-EINVAL);
+				}n+				copy_to_user((ES < *) arg, &subchnl,n+					     sizeof(subchnl));s+			}n+			retnsi (s);
+		}
+
+	case CDROMVOLCTRL:{s+			s ruct cdrom_volctrl vol_ctrl;n+			int s;
+#iU defined( SJCD_TRACE )
+			printk("SJCD: ioctl:cvolctrl\n");
+#endiNn+			iUR	(sC=s+			     verify_area(VERIFY_READ, (ES < *) arg,n+					 sizeof(vol_ctrl))) == 0) {n+				unsigned char dummy[4];n+s+				copy_f0xm_user(&vol_ctrl, (ES < *) arg,n+					       sizeof(vol_ctrl));n+				sjcd_yend_4_cmd(SCMD_SET_VOLUME,n+						vol_ctrl.channel0, 0xFF,o+						vol_ctrl.channel1, 0xFF);s+				iUR	sjcd_receive_s  pus() < 0)s+					retnsi (-EIO);s+				(ES <) sjcd_load_reyponse(dummy, 4);s+			}n+			retnsi (s);
+		}
+
+	case CDROMEJECT:{n+#iU defined( SJCD_TRACE )
+			printk("SJCD: ioctl:ceject\n");
+#endiNn+			iUR	!sjcd_commaid_is_in_progress) {n+				sjcd_tray_unlock();
+				sjcd_yend_cmd(SCMD_EJECT_TRAY);n+				(ES <) sjcd_receive_s  pus();s+			}n+			retnsi (0);n+		}
 o #iU defined( SJCD_GATHER_STAT )
-  case 0xABCD:{s-    int s;
+	case 0xABCD:{s+			int s;
 #iU defined( SJCD_TRACE )
-    printk( "SJCD: ioctl:cs  tistic\n" );s+			printk("SJCD: ioctl:cs  tistic\n");s #endiNn-    iU( ( s = verify_area( VERIFY_WRITE, (ES < *)arg, sizeof( s  tistic ) ) ) == 0 )n-      copy_to_user( (ES < *)arg, &s  tistic, sizeof( s  tistic ) );n-    retnsi( s );
-  }
+			iUR	(sC=s+			     verify_area(VERIFY_WRITE, (ES < *) arg,n+					 sizeof(s  tistic))) == 0)s+				copy_to_user((ES < *) arg, &s  tistic,n+					     sizeof(s  tistic));n+			retnsi (s);
+		}
 #endiNn 
-  default:
-    retnsi( -EINVAL );
-  }
+	default:
+		retnsi (-EINVAL);
+	}
 }s s /*s  * Invalid peCinternal buffers of thecdriver.s  */s-y  pF TES < sjcd_invalid pe_buffers(TES < ){n-  int i;
-  for( i = 0; i < SJCD_BUF_SIZ; sjcd_buf_bn[ i++ ] = -1 );
-  sjcd_buf_out = -1;n+y  pF TES < sjcd_invalid pe_buffers(ES <)
+{o+	int i;
+	G_SM(i = 0; i < SJCD_BUF_SIZ; sjcd_buf_bn[i++] = -1);
+	sjcd_buf_out = -1;n }s s /*s@@ -939,508 +1077,595 @@s     (T!QUEUE_EMPTY && MAJOR( CURRENT->rq_dev ) == MAJOR_NR && \
       CURRENT->cmd == READ && CURRENT->sect_SM!= -1 )
 s-y  pF TES < sjcd_transfer(TES < ){n+y  pF TES < sjcd_transfer(ES <)
+{o #iU defined( SJCD_TRACE )
-  printk( "SJCD: transfer:\n" );s+	printk("SJCD: transfer:\n");s #endiNn-  iU( CURRENT_IS_VALID ){n-    whi 
( CURRENT->nr_sect_Ss ){
-      int i, bn =TCURRENT->sect_SM/ 4;
-      for( i = 0; i < SJCD_BUF_SIZ && sjcd_buf_bn[ i ] != bn; i++ );s-      iU( i < SJCD_BUF_SIZ ){n-	int offs = ( i * 4 + (TCURRENT->sect_SM& 3 ) ) * 512;n-	int nr_sect_Ss = 4 - (TCURRENT->sect_SM& 3 );n-	iU( sjcd_buf_out != i ){n-	  sjcd_buf_out = i;
-	  iU( sjcd_buf_bn[ i ] != bn ){n-	    sjcd_buf_out = -1;n-	    continue;n-	  }n-	}n-	iU( nr_sect_Ss > CURRENT->nr_sect_Ss )n-	  nr_sect_Ss = CURRENT->nr_sect_Ss;
-#iU defined( SJCD_TRACE )
-	printk( "SJCD: copy out\n" );s-#endiNn-	memcpy(TCURRENT->buffer, sjcd_buf + offs, nr_sect_Ss * 512 );n-	CURRENT->nr_sect_Ss -= nr_sect_Ss;
-	CURRENT->sect_SM+= nr_sect_Ss;
-	CURRENT->bufferM+= nr_sect_Ss * 512;n-      } )lse {n-	sjcd_buf_out = -1;n-	break;
-      }
-    }n-  }
+	iUR	CURRENT_IS_VALID) {n+		whi 
 (CURRENT->nr_sect_Ss) {n+			int i, bn =TCURRENT->sect_SM/ 4;
+			G_SM(i = 0;s+			     i < SJCD_BUF_SIZ && sjcd_buf_bn[i] != bn;s+			     i++);n+			iUR	i < SJCD_BUF_SIZ) {n+				int offs =s+				    (i * 4 + (CURRENT->sect_SM& 3)) * 512;n+				int nr_sect_Ss = 4 - (CURRENT->sect_SM& 3);s+				iUR	sjcd_buf_out != i) {n+					sjcd_buf_out = i;
+					iUR	sjcd_buf_bn[i] != bn) {n+						sjcd_buf_out = -1;n+						continue;n+					}
+				}n+				iUR	nr_sect_Ss > CURRENT->nr_sect_Ss)s+					nr_sect_Ss = CURRENT->nr_sect_Ss;
+#iU defined( SJCD_TRACE )
+				printk("SJCD: copy out\n");
+#endiNn+				memcpy(CURRENT->buffer, sjcd_buf + offs,s+				       nr_sect_Ss * 512);s+				CURRENT->nr_sect_Ss -= nr_sect_Ss;
+				CURRENT->sect_SM+= nr_sect_Ss;
+				CURRENT->bufferM+= nr_sect_Ss * 512;n+			} )lse {n+				sjcd_buf_out = -1;n+				break;
+			}
+		}
+	}
 #iU defined( SJCD_TRACE )
-  printk( "SJCD: transfer: done\n" );s+	printk("SJCD: transfer: done\n");s #endiNn }s s-y  pF TES < sjcd_poll(TES < ){n+y  pF TES < sjcd_poll(ES <)
+{o #iU defined( SJCD_GATHER_STAT )
-  /*s-   *RUpd peCtotal numberMof ticks.n-   */s-  s  tistic.ticks++;s-  s  tistic.tticks[ sjcd_transfer_s  pe ]++;s+	/*s+	 *RUpd peCtotal numberMof ticks.n+	 */s+	s  tistic.ticks++;s+	s  tistic.tticks[sjcd_transfer_s  pe]++;s #endiNn 
- ReSwitch: switch( sjcd_transfer_s  pe ){
-      
-  case SJCD_S_IDLE:{n+      ReSwitch:switch (sjcd_transfer_s  pe) {n+
+	case SJCD_S_IDLE:{n #iU defined( SJCD_GATHER_STAT )
-    s  tistic.idle_ticks++;s+			s  tistic.idle_ticks++;s #endiNn #iU defined( SJCD_TRACE )
-    printk( "SJCD_S_IDLE\n" );s+			printk("SJCD_S_IDLE\n");s #endiNn-    retnsi;
-  }
+			retnsi;
+		}
 o-  case SJCD_S_START:{n+	case SJCD_S_START:{n #iU defined( SJCD_GATHER_STAT )
-    s  tistic.s  rt_ticks++;s+			s  tistic.s  rt_ticks++;s #endiNn-    sjcd_yend_cmd( SCMD_GET_STATUS );
-    sjcd_transfer_s  pe =
-      sjcd_mode == SCMD_MODE_COOKED ? SJCD_S_READ : SJCD_S_MODE;
-    sjcd_transfer_timeout = 500;s-#iU defined( SJCD_TRACE )
-    printk( "SJCD_S_START: goto SJCD_S_%s mode\n",s-	   sjcd_transfer_s  pe == SJCD_S_READ ? "READ" : "MODE" );s-#endiNn-    break;
-  }
-    o-  case SJCD_S_MODE:{
-    iU( sjcd_check_s  pus() ){n-      /*s-       *RPreviousCcommaidCisCcompleted.s-       */s-      iU( !sjcd_y  pus_validC|| sjcd_commaid_failedC){n-#iU defined( SJCD_TRACE )
-	printk( "SJCD_S_MODE: pre-cmd failed: goto to SJCD_S_STOP mode\n" );s-#endiNn-	sjcd_transfer_s  pe = SJCD_S_STOP;n-	goto ReSwitch;n-      }
-n-      sjcd_mode = 0; /* unknown mode; should notRbe validCwhen failedC*/s-      sjcd_send_1_cmd( SCMD_SET_MODE, SCMD_MODE_COOKED );
-      sjcd_transfer_s  pe = SJCD_S_READ; sjcd_transfer_timeout = 1000;n+			sjcd_yend_cmd(SCMD_GET_STATUS);s+			sjcd_transfer_s  pe =s+			    sjcd_mode ==s+			    SCMD_MODE_COOKED ? SJCD_S_READ : SJCD_S_MODE;
+			sjcd_transfer_timeout = 500;s+#iU defined( SJCD_TRACE )
+			printk("SJCD_S_START: goto SJCD_S_%s mode\n",s+			       sjcd_transfer_s  pe ==s+			       SJCD_S_READ ? "READ" : "MODE");
+#endiNn+			break;
+		}n+
+	case SJCD_S_MODE:{
+			iUR	sjcd_check_s  pus()) {n+				/*s+				 *RPreviousCcommaidCisCcompleted.s+				 */s+				iUR	!sjcd_y  pus_valids+				    || sjcd_commaid_failed) {n+#iU defined( SJCD_TRACE )
+					printks+					    ("SJCD_S_MODE: pre-cmd failed: goto to SJCD_S_STOP mode\n");
+#endiNn+					sjcd_transfer_s  pe = SJCD_S_STOP;n+					goto ReSwitch;n+				}n+s+				sjcd_mode = 0;	/* unknown mode; should notRbe validCwhen failedC*/s+				sjcd_yend_1_cmd(SCMD_SET_MODE,n+						SCMD_MODE_COOKED);
+				sjcd_transfer_s  pe = SJCD_S_READ;
+				sjcd_transfer_timeout = 1000;n #iU defined( SJCD_TRACE )
-      printk( "SJCD_S_MODE: goto SJCD_S_READ mode\n" );s+				printks+				    ("SJCD_S_MODE: goto SJCD_S_READ mode\n");s #endiNn-    }s+			}n #iU defined( SJCD_GATHER_STAT )
-    )lse s  tistic.mode_ticks++;s+			)lse
+				s  tistic.mode_ticks++;s #endiNn-    break;
-  }
+			break;
+		}n o-  case SJCD_S_READ:{
-    iU( sjcd_y  pus_validC? 1 : sjcd_check_s  pus() ){n-      /*s-       *RPreviousCcommaidCisCcompleted.s-       */s-      iU( !sjcd_y  pus_validC|| sjcd_commaid_failedC){n-#iU defined( SJCD_TRACE )
-	printk( "SJCD_S_READ: pre-cmd failed: goto to SJCD_S_STOP mode\n" );s-#endiNn-	sjcd_transfer_s  pe = SJCD_S_STOP;n-	goto ReSwitch;n-      }
-      iU( !sjcd_media_is_available ){
-#iU defined( SJCD_TRACE )
-	printk( "SJCD_S_READ: no disk: goto to SJCD_S_STOP mode\n" );s-#endiNn-	sjcd_transfer_s  pe = SJCD_S_STOP;n-	goto ReSwitch;n-      }
-      iU( sjcd_mode != SCMD_MODE_COOKED ){n-	/*s-	 *RWe seem to comeCf0xm set mode. So discard one bype of reyult.n-	 */s-	iU( sjcd_load_reyponse(T&sjcd_mode, 1 ) != 0 ){n-#iU defined( SJCD_TRACE )
-	  printk( "SJCD_S_READ: load failed: goto to SJCD_S_STOP mode\n" );s-#endiNn-	  sjcd_transfer_s  pe = SJCD_S_STOP;n-	  goto ReSwitch;n-	}n-	iU( sjcd_mode != SCMD_MODE_COOKED ){n-#iU defined( SJCD_TRACE )
-	  printk( "SJCD_S_READ: mode failed: goto to SJCD_S_STOP mode\n" );s+	case SJCD_S_READ:{
+			iUR	sjcd_y  pus_validC? 1 : sjcd_check_s  pus()) {n+				/*s+				 *RPreviousCcommaidCisCcompleted.s+				 */s+				iUR	!sjcd_y  pus_valids+				    || sjcd_commaid_failed) {n+#iU defined( SJCD_TRACE )
+					printks+					    ("SJCD_S_READ: pre-cmd failed: goto to SJCD_S_STOP mode\n");
+#endiNn+					sjcd_transfer_s  pe = SJCD_S_STOP;n+					goto ReSwitch;n+				}n+				iUR	!sjcd_media_is_available) {s+#iU defined( SJCD_TRACE )
+					printks+					    ("SJCD_S_READ: no disk: goto to SJCD_S_STOP mode\n");
+#endiNn+					sjcd_transfer_s  pe = SJCD_S_STOP;n+					goto ReSwitch;n+				}n+				iUR	sjcd_mode != SCMD_MODE_COOKED) {n+					/*s+					 *RWe seem to comeCf0xm set mode. So discard one bype of reyult.n+					 */
+					iUR	sjcd_load_reyponses+					    (&sjcd_mode, 1) != 0) {n+#iU defined( SJCD_TRACE )
+						printks+						    ("SJCD_S_READ: load failed: goto to SJCD_S_STOP mode\n");
+#endiNn+						sjcd_transfer_s  pe =s+						    SJCD_S_STOP;n+						goto ReSwitch;n+					}n+					iUR	sjcd_mode != SCMD_MODE_COOKED) {n+#iU defined( SJCD_TRACE )
+						printks+						    ("SJCD_S_READ: mode failed: goto to SJCD_S_STOP mode\n");
+#endiNn+						sjcd_transfer_s  pe =s+						    SJCD_S_STOP;n+						goto ReSwitch;n+					}n+				}s+s+				iUR	CURRENT_IS_VALID) {n+					s ruct sjcd_play_msf msf;
+n+					sjcd_next_bn =TCURRENT->sect_SM/ 4;
+					hsg2msf(sjcd_next_bn, &msf.s  rt);
+					msf.end.min =T0;
+					msf.end.sec = 0;
+					msf.end.frameC= sjcd_read_countC=s+					    SJCD_BUF_SIZ;s+#iU defined( SJCD_TRACE )
+					printks+					    ("SJCD: ---readingCmsf-address %x:%x:%x  %x:%x:%x\n",s+					     msf.s  rt.min, msf.s  rt.sec,s+					     msf.s  rt.frame, msf.end.min,s+					     msf.end.sec, msf.end.frame);
+					printks+					    ("sjcd_next_bn:%x buf_in:%x buf_out:%x buf_bn:%x\n",s+					     sjcd_next_bn, sjcd_buf_in,s+					     sjcd_buf_out,s+					     sjcd_buf_bn[sjcd_buf_in]);
+#endiNn+					sjcd_send_6_cmd(SCMD_DATA_READ,n+							&msf);s+					sjcd_transfer_s  pe = SJCD_S_DATA;s+					sjcd_transfer_timeout = 500;s+#iU defined( SJCD_TRACE )
+					printks+					    ("SJCD_S_READ: go to SJCD_S_DATA mode\n");
+#endiNn+				} )lse {n+#iU defined( SJCD_TRACE )
+					printks+					    ("SJCD_S_READ: nothing to read: go to SJCD_S_STOP mode\n");
+#endiNn+					sjcd_transfer_s  pe = SJCD_S_STOP;n+					goto ReSwitch;n+				}n+			}
+#iU defined( SJCD_GATHER_STAT )
+			)lse
+				s  tistic.read_ticks++;s #endiNn-	  sjcd_transfer_s  pe = SJCD_S_STOP;n-	  goto ReSwitch;n-	}n-      }
+			break;
+		}n o-      iU( CURRENT_IS_VALID ){n-	s ruct sjcd_play_msf msf;
+	case SJCD_S_DATA:{
+			unsigned char s  p;
 n-	sjcd_next_bn =TCURRENT->sect_SM/ 4;
-	hsg2msf( sjcd_next_bn, &msf.s  rt );n-	msf.end.min =T0; msf.end.sec = 0;            n-	msf.end.frameC= sjcd_read_countC= SJCD_BUF_SIZ;s-#iU defined( SJCD_TRACE )
-	printk( "SJCD: ---readingCmsf-address %x:%x:%x  %x:%x:%x\n",s-	       msf.s  rt.min, msf.s  rt.sec, msf.s  rt.frame,s-	       msf.end.min,   msf.end.sec,   msf.end.frameC);n-	printk( "sjcd_next_bn:%x buf_in:%x buf_out:%x buf_bn:%x\n", \s-	     sjcd_next_bn, sjcd_buf_in, sjcd_buf_out,s-	     sjcd_buf_bn[ sjcd_buf_in ] );s-#endiN	
-	sjcd_yend_6_cmd( SCMD_DATA_READ, &msf );
-	sjcd_transfer_s  pe = SJCD_S_DATA;s-	sjcd_transfer_timeout = 500;s-#iU defined( SJCD_TRACE )
-	printk( "SJCD_S_READ: go to SJCD_S_DATA mode\n" );s-#endiNn-      } )lse {n-#iU defined( SJCD_TRACE )
-	printk( "SJCD_S_READ: nothing to read: go to SJCD_S_STOP mode\n" );s-#endiNn-	sjcd_transfer_s  pe = SJCD_S_STOP;n-	goto ReSwitch;n-      }
-    }o+		      sjcd_y_data:s  p =s+			    inb	SJCDPORTn+				(1));n+#iU defined( SJCD_TRACE )
+			printk("SJCD_S_DATA: s  pusC= 0x%02x\n", s  p);
+#endiNn+			iUR	SJCD_STATUS_AVAILABLE(s  t)) {n+				/*s+				 *RNo dataCisCwaitingCG_SMusCin thecdrive buffer.RS  pusCof operatt *n+				 *Ccomplett *CisCavailable. Read aidCparse it.s+				 */s+				sjcd_load_s  pus();s+
+				iUR	!sjcd_y  pus_valids+				    || sjcd_commaid_failed) {n+#iU defined( SJCD_TRACE )
+					printks+					    ("SJCD:cread block %dCfailed, maybe audio disk? GivingCup\n",s+					     sjcd_next_bn);
+#endiNn+					iUR	CURRENT_IS_VALID)n+						end_request(0);n+#iU defined( SJCD_TRACE )
+					printks+					    ("SJCD_S_DATA: pre-cmd failed: go to SJCD_S_STOP mode\n");
+#endiNn+					sjcd_transfer_s  pe = SJCD_S_STOP;n+					goto ReSwitch;n+				}n+s+				iUR	!sjcd_media_is_available) {s+					printks+					    ("SJCD_S_DATA: no disk: go to SJCD_S_STOP mode\n");
+					sjcd_transfer_s  pe = SJCD_S_STOP;n+					goto ReSwitch;n+				}n+s+				sjcd_transfer_s  pe = SJCD_S_READ;
+				goto ReSwitch;n+			} )lse iUR	SJCD_DATA_AVAILABLE(s  t)) {n+				/*s+				 *ROne frameCisCread intocdevice buffer.RWe must copy it to our memory.s+				 *ROtherwise cdrom hangsCup. Check to see iURwe have something to copys+				 *Rto.s+				 */s+				iUR	!CURRENT_IS_VALIDs+				    && sjcd_buf_in == sjcd_buf_out) {s+#iU defined( SJCD_TRACE )
+					printks+					    ("SJCD_S_DATA: nothing to read: go to SJCD_S_STOP mode\n");
+					printks+					    (" ... all thecd pe would be discarded\n");
+#endiNn+					sjcd_transfer_s  pe = SJCD_S_STOP;n+					goto ReSwitch;n+				}n+s+				/*s+				 *REverything seems to be OK. Just read thecframeCaidCrecalcul pes+				 *Rindices.s+				 */s+				sjcd_buf_bn[sjcd_buf_in] = -1;	/* ??? */s+				insb	SJCDPORT(2),s+				     sjcd_buf + 2048 *Rsjcd_buf_in, 2048);
+#iU defined( SJCD_TRACE )
+				printks+				    ("SJCD_S_DATA: next_bn=%d, buf_in=%d, buf_out=%d, buf_bn=%d\n",s+				     sjcd_next_bn, sjcd_buf_in,s+				     sjcd_buf_out,s+				     sjcd_buf_bn[sjcd_buf_in]);
+#endiNn+				sjcd_buf_bn[sjcd_buf_in] = sjcd_next_bn++;s+				iUR	sjcd_buf_out == -1)n+					sjcd_buf_out = sjcd_buf_in;s+				iUR	++sjcd_buf_in == SJCD_BUF_SIZ)n+					sjcd_buf_in =T0;
+n+				/*s+				 *ROnly one frameCisCreadyCat time. So we should tnsi over to waitCG_Ss+				 *Ranother frame. IURwe need that,Cof course.s+				 */s+				iUR	--sjcd_read_countC== 0) {n+					/*s+					 *ROK, request seems to be precessed. ContinueTtransferring...n+					 */
+					iUR	!sjcd_transfer_is_active) {n+						whi 
 (CURRENT_IS_VALID) {n+							/*s+							 *RContinueTtransferring.s+							 */s+							sjcd_transfer();
+							iUR	CURRENT->n+							    nr_sect_Ss ==n+							    0)s+								end_requests+								    (1);
+							)lse
+								break;
+						}n+					}n+					iUR	CURRENT_IS_VALID &&s+					    (CURRENT->sect_SM/ 4C<n+					     sjcd_next_bnn+					     || CURRENT->sect_SM/ 4C>n+					     sjcd_next_bn +n+					     SJCD_BUF_SIZ)) {n+#iU defined( SJCD_TRACE )
+						printks+						    ("SJCD_S_DATA: can't read: go to SJCD_S_STOP mode\n");
+#endiNn+						sjcd_transfer_s  pe =s+						    SJCD_S_STOP;n+						goto ReSwitch;n+					}n+				}s+				/*s+				 *RNow we should tnsi aroundCrather than waitCG_S whi 
.s+				 */s+				goto sjcd_y_data;s+			}n #iU defined( SJCD_GATHER_STAT )
-    )lse s  tistic.read_ticks++;s+			)lse
+				s  tistic.data_ticks++;s #endiNn-    break;
-  }
+			break;
+		}n o-  case SJCD_S_DATA:{
-    unsigned char s  p;
-n-  sjcd_y_data: s  p = inb	 SJCDPORT( 1 ) );s-#iU defined( SJCD_TRACE )
-    printk( "SJCD_S_DATA: s  pusC= 0x%02x\n", s  p );s+	case SJCD_S_STOP:{n+			sjcd_read_countC= 0;n+			sjcd_yend_cmd(SCMD_STOP);s+			sjcd_transfer_s  pe = SJCD_S_STOPPING;
+			sjcd_transfer_timeout = 500;s+#iU defined( SJCD_GATHER_STAT )
+			s  tistic.s op_ticks++;s #endiNn-    iU( SJCD_STATUS_AVAILABLE( s  p ) ){n-      /*s-       *RNo dataCisCwaitingCG_SMusCin thecdrive buffer.RS  pusCof operatt *n-       *Rcomplett *CisCavailable. Read aidCparse it.s-       */s-      sjcd_load_s  pus();s+			break;
+		}n o-      iU( !sjcd_y  pus_validC|| sjcd_commaid_failedC){n-#iU defined( SJCD_TRACE )
-	printk( "SJCD:cread block %dCfailed, maybe audio disk? GivingCup\n",s-	       sjcd_next_bn );s-#endiNn-	iU( CURRENT_IS_VALID ) end_request( 0 );
-#iU defined( SJCD_TRACE )
-	printk( "SJCD_S_DATA: pre-cmd failed: go to SJCD_S_STOP mode\n" );s+	case SJCD_S_STOPPING:{
+			unsigned char s  p;
+
+			s  t = inb	SJCDPORT(1));n+#iU defined( SJCD_TRACE )
+			printk("SJCD_S_STOP: s  pusC= 0x%02x\n", s  p);
+#endiNn+			iUR	SJCD_DATA_AVAILABLE(s  t)) {n+				int i;
+#iU defined( SJCD_TRACE )
+				printk("SJCD_S_STOP: discard data\n");
+#endiNn+				/*s+				 *RDiscard all thecd paCf0xm thecpipe. Foolish method.s+				 */s+				G_SM(i = 2048; i--;s+				     (ES <) inb	SJCDPORT(2)));
+				sjcd_transfer_timeout = 500;n+			} )lse iUR	SJCD_STATUS_AVAILABLE(s  t)) {n+				sjcd_load_s  pus();s+				iUR	sjcd_y  pus_valids+				    && sjcd_media_is_changed) {n+					sjcd_toc_uptod pe = 0;
+					sjcd_invalid pe_buffers();n+				}n+				iUR	CURRENT_IS_VALID) {n+					iUR	sjcd_y  pus_valid)n+						sjcd_transfer_s  pe =s+						    SJCD_S_READ;
+					)lse
+						sjcd_transfer_s  pe =s+						    SJCD_S_START;s+				} )lsen+					sjcd_transfer_s  pe = SJCD_S_IDLE;
+				goto ReSwitch;n+			}
+#iU defined( SJCD_GATHER_STAT )
+			)lse
+				s  tistic.s opping_ticks++;s #endiNn-	sjcd_transfer_s  pe = SJCD_S_STOP;n-	goto ReSwitch;n-      }
+			break;
+		}n o-      iU( !sjcd_media_is_available ){
-	printk( "SJCD_S_DATA: no disk: go to SJCD_S_STOP mode\n" );
-	sjcd_transfer_s  pe = SJCD_S_STOP;n-	goto ReSwitch;n-      }
+	default:
+		printk("SJCD: poll: invalid s  pe %d\n",s+		       sjcd_transfer_s  pe);n+		retnsi;
+	}n o-      sjcd_transfer_s  pe = SJCD_S_READ;
-      goto ReSwitch;n-    } )lse iU( SJCD_DATA_AVAILABLE( s  p ) ){n-      /*s-       *ROne frameCisCread intocdevice buffer.RWe must copy it to our memory.s-       *ROtherwise cdrom hangsCup. Check to see iURwe have something to copys-       *Rto.s-       */s-      iU( !CURRENT_IS_VALID && sjcd_buf_in == sjcd_buf_out ){
-#iU defined( SJCD_TRACE )
-	printk( "SJCD_S_DATA: nothing to read: go to SJCD_S_STOP mode\n"C);n-	printk( " ... all thecd pe would be discarded\n" );s-#endiNn-	sjcd_transfer_s  pe = SJCD_S_STOP;n-	goto ReSwitch;n-      }
+	iUR	--sjcd_transfer_timeout == 0) {n+		printk("SJCD: timeout in s  pe %d\n", sjcd_transfer_s  pe);n+		whi 
 (CURRENT_IS_VALID)
+			)nd_request(0);n+		sjcd_yend_cmd(SCMD_STOP);s+		sjcd_transfer_s  pe = SJCD_S_IDLE;
+		goto ReSwitch;n+	}n o-      /*s-       *REverything seems to be OK. Just read thecframeCaidCrecalcul pes-       *Rindices.s-       */s-      sjcd_buf_bn[ sjcd_buf_in ] = -1; /* ??? */s-      insb	 SJCDPORT( 2 ), sjcd_buf + 2048 *Rsjcd_buf_in, 2048 );s-#iU defined( SJCD_TRACE )
-      printk( "SJCD_S_DATA: next_bn=%d, buf_in=%d, buf_out=%d, buf_bn=%d\n",s-	     sjcd_next_bn, sjcd_buf_in, sjcd_buf_out,s-	     sjcd_buf_bn[ sjcd_buf_in ] );s-#endiNs-      sjcd_buf_bn[ sjcd_buf_in ] = sjcd_next_bn++;s-      iU( sjcd_buf_out == -1 ) sjcd_buf_out = sjcd_buf_in;s-      iU( ++sjcd_buf_in == SJCD_BUF_SIZ ) sjcd_buf_in =T0;
-n-      /*s-       *ROnly one frameCisCreadyCat time. So we should tnsi over to waitCG_Ss-       *Ranother frame. IURwe need that,Cof course.s-       */s-      iU( --sjcd_read_countC== 0 ){
 	/*s-	 *ROK, request seems to be precessed. ContinueTtransferring...n+	 *RGet backCin someCtime. 1 should be replaced with countCvariable ton+	 *RaES < unnecessary testings.s 	 */s-	iU( !sjcd_transfer_is_active ){n-	  whi 
( CURRENT_IS_VALID ){n-	    /*s-	     *RContinueTtransferring.s-	     */n-	    sjcd_transfer();
-	    iU( CURRENT->nr_sect_Ss == 0 ) end_request( 1 );
-	    )lse break;
-	  }n-	}n-	iU( CURRENT_IS_VALID &&s-	   ( CURRENT->sect_SM/ 4C< sjcd_next_bn ||
-	    CURRENT->sect_SM/ 4C> sjcd_next_bn + SJCD_BUF_SIZ ) ){n-#iU defined( SJCD_TRACE )
-	  printk( "SJCD_S_DATA: can't read: go to SJCD_S_STOP mode\n" );s-#endiNn-	  sjcd_transfer_s  pe = SJCD_S_STOP;n-	  goto ReSwitch;n-	}n-      }
-      /*s-       *RNow we should tnsi aroundCrather than waitCG_S whi 
.s-       */s-      goto sjcd_y_data;s-    }n-#iU defined( SJCD_GATHER_STAT )
-    )lse s  tistic.data_ticks++;s-#endiNn-    break;
-  }
-o-  case SJCD_S_STOP:{n-    sjcd_read_countC= 0;n-    sjcd_yend_cmd( SCMD_STOP );
-    sjcd_transfer_s  pe = SJCD_S_STOPPING;
-    sjcd_transfer_timeout = 500;s-#iU defined( SJCD_GATHER_STAT )
-    s  tistic.s op_ticks++;s-#endiNn-    break;
-  }
+	SJCD_SET_TIMER(sjcd_poll, 1);n+}
 o-  case SJCD_S_STOPPING:{
-    unsigned char s  p;
-    s-    s  p = inb	 SJCDPORT( 1 ) );s-#iU defined( SJCD_TRACE )
-    printk( "SJCD_S_STOP: s  pusC= 0x%02x\n", s  p );s-#endiN      s-    iU( SJCD_DATA_AVAILABLE( s  p ) ){n-      int i;
-#iU defined( SJCD_TRACE )
-      printk( "SJCD_S_STOP: discard data\n" );s-#endiNs-      /*s-       *RDiscard all thecd paCf0xm thecpipe. Foolish method.s-       */s-      for( i = 2048; i--; (TES < )inb	 SJCDPORT( 2 ) ) );
-      sjcd_transfer_timeout = 500;s-    } )lse iU( SJCD_STATUS_AVAILABLE( s  p ) ){n-      sjcd_load_s  pus();s-      iU( sjcd_y  pus_validC&& sjcd_media_is_changed ) {n-	sjcd_toc_uptod pe = 0;
-	sjcd_invalid pe_buffers();n-      }
-      iU( CURRENT_IS_VALID ){n-	iU( sjcd_y  pus_validC) sjcd_transfer_s  pe = SJCD_S_READ;
-	)lse sjcd_transfer_s  pe = SJCD_S_START;s-      } )lse sjcd_transfer_s  pe = SJCD_S_IDLE;
-      goto ReSwitch;n-    }n-#iU defined( SJCD_GATHER_STAT )
-    )lse s  tistic.s opping_ticks++;s+y  pF TES < do_sjcd_request(request_queue_t *Rq)
+{o+#iU defined( SJCD_TRACE )
+	printk("SJCD: do_sjcd_request(%ld+%ld)\n",s+	       CURRENT->sect_S, CURRENT->nr_sect_Ss);s #endiNn-    break;
-  }
-
-  default:
-    printk( "SJCD:cpoll: invalid s  pe %d\n", sjcd_transfer_s  pe );n-    retnsi;
-  }
-  s-  iU( --sjcd_transfer_timeout == 0 ){n-    printk( "SJCD: timeout in s  pe %d\n", sjcd_transfer_s  pe );n-    whi 
( CURRENT_IS_VALID ) end_request( 0 );
-    sjcd_yend_cmd( SCMD_STOP );
-    sjcd_transfer_s  pe = SJCD_S_IDLE;
-    goto ReSwitch;n-    }n-
-  /*s-   *RGet backCin someCtime. 1 should be replaced with countCvariable ton-   *RaES < unnecessary testings.s-   */s-  SJCD_SET_TIMER( sjcd_poll, 1 );
-}n-
-y  pF TES < do_sjcd_request( request_queue_t *Rq ){n-#iU defined( SJCD_TRACE )
-  printk( "SJCD: do_sjcd_request(%ld+%ld)\n",s-	 CURRENT->sect_S, CURRENT->nr_sect_Ss );s-#endiNs-  sjcd_transfer_is_active = 1;n-  whi 
( CURRENT_IS_VALID ){n-    /*s-     * WhoCof usCareCparanoiac?s-     */s-    iU( CURRENT->bhC&& !buffer_locked(CURRENT->bh) )
-      panic( DEVICE_NAME ": block notRlocked" );
-n-    sjcd_transfer();
-    iU( CURRENT->nr_sect_Ss == 0 ) end_request( 1 );
-    )lse {s-      sjcd_buf_out = -1;         /* Want to read a block notRin bufferM*/s-      iU( sjcd_transfer_s  pe == SJCD_S_IDLE ){n-	iU( !sjcd_toc_uptod pe ){n-	  iU( sjcd_upd pe_toc() < 0 ){n-	    printk( "SJCD: transfer: discard\n"C);n-	    whi 
( CURRENT_IS_VALID ) end_request( 0 );
-	    break;
-	  }n-	}n-	sjcd_transfer_s  pe = SJCD_S_START;s-	SJCD_SET_TIMER( sjcd_poll, HZ/100 );
-      }n-      break;
-    }
-  }
-  sjcd_transfer_is_active = 0;s-#iU defined( SJCD_TRACE )
-  printk( "sjcd_next_bn:%x sjcd_buf_in:%x sjcd_buf_out:%x sjcd_buf_bn:%x\n",s-	 sjcd_next_bn, sjcd_buf_in, sjcd_buf_out, sjcd_buf_bn[ sjcd_buf_in ] );s-  printk( "do_sjcd_request ends\n" );s+	sjcd_transfer_is_active = 1;n+	whi 
 (CURRENT_IS_VALID) {n+		/*s+		 * WhoCof usCareCparanoiac?s+		 */s+		iUR	CURRENT->bhC&& !buffer_locked(CURRENT->bh))
+			panic(DEVICE_NAME ": block notRlocked");s+
+		sjcd_transfer();
+		iUR	CURRENT->nr_sect_Ss == 0)
+			)nd_request(1);
+		)lse {n+			sjcd_buf_out = -1;	/* Want to read a block notRin bufferM*/s+			iUR	sjcd_transfer_s  pe == SJCD_S_IDLE) {n+				iUR	!sjcd_toc_uptod pe) {n+					iUR	sjcd_upd pe_toc() < 0) {n+						printks+						    ("SJCD: transfer: discard\n");
+						whi 
 (CURRENT_IS_VALID)
+							)nd_request(0);n+						break;
+					}n+				}s+				sjcd_transfer_s  pe = SJCD_S_START;s+				SJCD_SET_TIMER(sjcd_poll, HZ / 100);s+			}n+			break;
+		}n+	}n+	sjcd_transfer_is_active = 0;s+#iU defined( SJCD_TRACE )
+	printks+	    ("sjcd_next_bn:%x sjcd_buf_in:%x sjcd_buf_out:%x sjcd_buf_bn:%x\n",s+	     sjcd_next_bn, sjcd_buf_in, sjcd_buf_out,s+	     sjcd_buf_bn[sjcd_buf_in]);
+	printk("do_sjcd_request ends\n");s #endiNn }s s /*s  * Open thecdevice special fi 
. Check diskCisCin.s  */s-int sjcd_open( s ruct inode *ip, s ruct fi 
 *fp ){n-  /*s-   *RCheck the preyence of device.s-   */s-  iU( !sjcd_preyent ) retnsi( -ENXIO );
-  n-  /*s-   *ROnly read operatt *sCareCallowed. Really? (:-)s-   */s-  iU( fp->f_mode & 2 ) retnsi( -EROFS );
-  n-  MOD_INC_USE_COUNT;s+int sjcd_open(s ruct inode *ip, s ruct fi 
 *fp)
+{o+	/*s+	 *RCheck the preyence of device.s+	 */s+	iUR	!sjcd_preyent)
+		retnsi (-ENXIO);
 s-  iU( sjcd_open_countC== 0 ){
-    int s, sjcd_open_tries;s+	/*s+	 *ROnly read operatt *sCareCallowed. Really? (:-)s+	 */s+	iUR	fp->f_mode & 2)
+		retnsi (-EROFS);s+
+	MOD_INC_USE_COUNT;s+s+	iUR	sjcd_open_countC== 0) {n+		int s, sjcd_open_tries;s /* We don't know that,Cdo we? */s /*s     sjcd_audio_s  pus = CDROM_AUDIO_NO_STATUS;s */s-    sjcd_mode = 0;s-    sjcd_door_was_open = 0;s-    sjcd_transfer_s  pe = SJCD_S_IDLE;
-    sjcd_invalid pe_buffers();n-    sjcd_y  pus_validC=T0;
-n-    /*s-     * Strict s  pus checking.s-     */s-    for( sjcd_open_tries = 4; --sjcd_open_tries; ){n-      iU( !sjcd_y  pus_validC) sjcd_get_s  pus();s-      iU( !sjcd_y  pus_validC){
+		sjcd_mode = 0;s+		sjcd_door_was_open = 0;s+		sjcd_transfer_s  pe = SJCD_S_IDLE;
+		sjcd_invalid pe_buffers();n+		sjcd_y  pus_validC=T0;
+n+		/*s+		 * Strict s  pus checking.s+		 */s+		G_SM(sjcd_open_tries = 4; --sjcd_open_tries;) {n+			iUR	!sjcd_y  pus_valid)s+				sjcd_get_s  pus();s+			iUR	!sjcd_y  pus_valid) {n #iU defined( SJCD_DIAGNOSTIC )
-	printk( "SJCD:copen: timed outCwhen check s  pus.\n" );s+				printks+				    ("SJCD:copen: timed outCwhen check s  pus.\n");s #endiNn-	goto err_out;s-      } )lse iU( !sjcd_media_is_available ){
+				goto err_out;s+			} )lse iUR	!sjcd_media_is_available) {s #iU defined( SJCD_DIAGNOSTIC )
-	printk("SJCD:copen: no diskRin drive\n");
+				printk("SJCD:copen: no diskRin drive\n");
 #endiNn-	iU( !sjcd_door_closedC){n-	  sjcd_door_was_open = 1;n+				iUR	!sjcd_door_closed) {n+					sjcd_door_was_open = 1;n #iU defined( SJCD_TRACE )
-	  printk("SJCD:copen: close the tray\n");
+					printks+					    ("SJCD:copen: close the tray\n");
 #endiNn-	  s = sjcd_tray_close();
-	  iU( s < 0 || !sjcd_y  pus_validC|| sjcd_commaid_failedC){n+					s = sjcd_tray_close();
+					iUR	s < 0 || !sjcd_y  pus_valids+					    || sjcd_commaid_failed) {n #iU defined( SJCD_DIAGNOSTIC )
-	    printk("SJCD:copen: tray close attempt failed\n");
+						printks+						    ("SJCD: open: tray close attempt failed\n");
 #endiNn-	    goto err_out;s-	  }n-	  continue;n-	} )lse goto err_out;s-      }n-      break;
-    }
-    s = sjcd_tray_lock();
-    iU( s < 0 || !sjcd_y  pus_validC|| sjcd_commaid_failedC){n+						goto err_out;s+					}n+					continue;n+				} )lsen+					goto err_out;s+			}n+			break;
+		}n+		s = sjcd_tray_lock();
+		iUR	s < 0 || !sjcd_y  pus_valid || sjcd_commaid_failed) {n #iU defined( SJCD_DIAGNOSTIC )
-      printk("SJCD: open: tray lock attempt failed\n");
+			printk("SJCD: open: tray lock attempt failed\n");
 #endiNs-      goto err_out;s-    }n+			goto err_out;s+		}
 #iU defined( SJCD_TRACE )
-    printk( "SJCD: open: done\n" );s+		printk("SJCD: open: done\n");s #endiNn-  }
+	}
 o-  ++sjcd_open_count;s-  retnsi( 0 );
+	++sjcd_open_count;s+	retnsi (0);n o-err_out:n-  MOD_DEC_USE_COUNT;s-  retnsi( -EIO );
+      err_out:n+	MOD_DEC_USE_COUNT;s+	retnsi (-EIO);s }s s /*s  * On close, we flush all sjcd blocksCf0xm thecbufferMcache.s  */s-y  pF Tint sjcd_release(Ts ruct inode *inode, s ruct fi 
 *file ){n-  int s;s+y  pF Tint sjcd_release(s ruct inode *inode, s ruct fi 
 *file)
+{o+	int s;s 
 #iU defined( SJCD_TRACE )
-  printk( "SJCD: release\n" );s+	printk("SJCD: release\n");s #endiNn #iUdef MODULEn-  MOD_DEC_USE_COUNT;s+	MOD_DEC_USE_COUNT;s #endiNn-  iU( --sjcd_open_countC== 0 ){
-    sjcd_invalid pe_buffers();n-    s = sjcd_tray_unlock();
-    iU( s < 0 || !sjcd_y  pus_validC|| sjcd_commaid_failedC){n+	iUR	--sjcd_open_countC== 0) {n+		sjcd_invalid pe_buffers();n+		s = sjcd_tray_unlock();
+		iUR	s < 0 || !sjcd_y  pus_valid || sjcd_commaid_failed) {n #iU defined( SJCD_DIAGNOSTIC )
-      printk("SJCD: release: tray unlock attempt failed.\n");
+			printks+			    ("SJCD: release: tray unlock attempt failed.\n");
 #endiNn-    }s-    iU( sjcd_door_was_open ){n-      s = sjcd_tray_open();s-      iU( s < 0 || !sjcd_y  pus_validC|| sjcd_commaid_failedC){n+		}
+		iUR	sjcd_door_was_open) {n+			s = sjcd_tray_open();s+			iUR	s < 0 || !sjcd_y  pus_valids+			    || sjcd_commaid_failed) {n #iU defined( SJCD_DIAGNOSTIC )
-	printk("SJCD: release: tray unload attempt failed.\n");
+				printks+				    ("SJCD:crelease: tray unload attempt failed.\n");
 #endiNs-      }
-    }
-  }
-  retnsi 0;
+			}
+		}
+	}
+	retnsi 0;s }s s /*s  * A list of fi 
 operatt *sCallowedCG_S thisCcdrom.s  */s y  pF Ts ruct block_device_operatt *sCsjcd_fops = {n-	open:			sjcd_open,s-	release:		sjcd_release,s-	ioctl:			sjcd_ioctl,s-	check_media_change:	sjcd_disk_change,s+	open:sjcd_open,s+	release:sjcd_release,s+	ioctl:sjcd_ioctl,s+	check_media_change:sjcd_disk_change,s };s 
 y  pF Tint blksize = 2048;s@@ -1453,146 +1678,156 @@s  * Thecverst *CisCtwo BCD-coded bypes.s  */s y  pF Ts ruct {n-  unsigned char maj_S, minor;
+	unsigned char maj_S, minor;
 } sjcd_verst *;s s /*s  * Test G_S preyence of drive aidCinitialize it. Called at boot time.
  *RProbe cdrom, find outCverst *CaidCs  pus.s  */s-int __init sjcd_init(TES < ){n-  int i;
+int __init sjcd_init(ES <)
+{o+	int i;
 
-  printk(KERN_INFO "SJCD: Sanyo CDR-H94A cdrom driverCverst *C%d.%d.\n", SJCD_VERSION_MAJOR,
-    SJCD_VERSION_MINOR);s+	printk(KERN_INFOs+	       "SJCD: Sanyo CDR-H94A cdrom driverCverst *C%d.%d.\n",s+	       SJCD_VERSION_MAJOR, SJCD_VERSION_MINOR);s 
 #iU defined( SJCD_TRACE )
-  printk("SJCD: sjcd=0x%x: ", sjcd_base);s-#endiN  s+	printk("SJCD: sjcd=0x%x: ", sjcd_base);s+#endiNn 
 	hardsect_size[MAJOR_NR] = &secsize;s 	blksize_size[MAJOR_NR] = &blksize;
 s-  iU( devfs_register_blkdev( MAJOR_NR, "sjcd",T&sjcd_fops ) != 0 ){n-    printk( "SJCD: Unable to get maj_S %dCf_S Sanyo CD-ROM\n", MAJOR_NR );n-    retnsi( -EIO );
-  }
-  s-  blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);s-  read_ahead[ MAJOR_NR ] = 4;s-  register_disk(NULL, MKDEV(MAJOR_NR,0), 1,T&sjcd_fops, 0);
-  n-  iU( check_region( sjcd_base, 4 ) ){n-    printk( "SJCD: Init failed, I/O port (%X)CisCalreadyCin use\n",s-      sjcd_base );n-    sjcd_cleanup();n-    retnsi( -EIO );
-  }
-  s-  /*s-   *RCheck f_S card. Since we areCbooting now, we can't use s  ndards-   *RwaitCalgorithm.s-   */s-  printk(KERN_INFO "SJCD: Reyetting: " );
-  sjcd_yend_cmd( SCMD_RESET );
-  for( i = 1000; i > 0 && !sjcd_y  pus_valid; --i ){n-    unsigned long timer;
-n-    /*s-     * WaitC10msCapprox.s-     */s-    for( timer = jiffies; time_before_eq(jiffies, timer); );
-    iU (M(i % 100) == 0 ) printk( "." );
-    (TES < )sjcd_check_s  pus();
-  }
-  iU( i == 0 || sjcd_commaid_failedC){n-    printk( " reyet failed, no drive found.\n" );s-    sjcd_cleanup();n-    retnsi( -EIO );
-  } )lse printk( "\n" );s-
-  /*s-   *RGet aidCprint out cdromCverst *.s-   */s-  printk(KERN_INFO "SJCD: GettingCverst *: " );
-  sjcd_yend_cmd( SCMD_GET_VERSION );
-  for( i = 1000; i > 0 && !sjcd_y  pus_valid; --i ){n-    unsigned long timer;
-n-    /*s-     * WaitC10msCapprox.s-     */s-    for( timer = jiffies; time_before_eq(jiffies, timer); );
-    iU (M(i % 100) == 0 ) printk( "." );
-    (TES < )sjcd_check_s  pus();
-  }
-  iU( i == 0 || sjcd_commaid_failedC){n-    printk( " get verst *Cfailed, no drive found.\n" );s-    sjcd_cleanup();n-    retnsi( -EIO );
-  }
-n-  iU( sjcd_load_reyponse(T&sjcd_verst *, sizeof( sjcd_verst * ) ) == 0 ){n-    printk( " %1x.%02x\n", ( int )sjcd_verst *.maj_S,s-	     ( int )sjcd_verst *.minor );
-  } )lse {n-    printk( " read verst *Cfailed, no drive found.\n" );s-    sjcd_cleanup();n-    retnsi( -EIO );
-  }
-n-  /*s-   *RCheck aidCprint out the tray s  pe.M(if it isCneeded?).s-   */s-  iU( !sjcd_y  pus_validC){
-    printk(KERN_INFO "SJCD: GettingCy  pus: " );
-    sjcd_yend_cmd( SCMD_GET_STATUS );
-    for( i = 1000; i > 0 && !sjcd_y  pus_valid; --i ){n-      unsigned long timer;
-n-      /*s-       *RWaitC10msCapprox.s-       */s-      for( timer = jiffies; time_before_eq(jiffies, timer); );
-      iU (M(i % 100) == 0 ) printk( "." );
-      (TES < )sjcd_check_s  pus();
-    }s-    iU( i == 0 || sjcd_commaid_failedC){n-      printk( " get s  pus failed, no drive found.\n" );s-      sjcd_cleanup();n-      retnsi( -EIO );
-    } )lse printk( "\n" );s-  }
-n-  printk(KERN_INFO "SJCD: S  pus: port=0x%x.\n", sjcd_base);s-  devfs_register (NULL, "sjcd",TDEVFS_FL_DEFAULT, MAJOR_NR, 0,s-		  S_IFBLK | S_IRUGO | S_IWUGO,T&sjcd_fops, NULL);
-n-  sjcd_preyent++;s-  retnsi( 0 );
-}n-
-y  pF Tint
-sjcd_cleanup(ES <)
-{s-  iU( (devfs_unregister_blkdev(MAJOR_NR, "sjcd") == -EINVAL) )
-    printk( "SJCD: cannotRunregister device.\n" );s-  )lse {n-    release_region( sjcd_base, 4 );
-    blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
-  }
+	iU (devfs_register_blkdev(MAJOR_NR, "sjcd",T&sjcd_fops) != 0) {n+		printk("SJCD: Unable to get maj_S %dCf_S Sanyo CD-ROM\n",s+		       MAJOR_NR);
+		retnsi (-EIO);
+	}
+n+	blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);s+	read_ahead[MAJOR_NR] = 4;s+	register_disk(NULL, MKDEV(MAJOR_NR, 0), 1,T&sjcd_fops, 0);
+s+	iUR	check_region(sjcd_base, 4)) {n+		printks+		    ("SJCD: Init failed, I/O port (%X)CisCalreadyCin use\n",s+		     sjcd_base);s+		sjcd_cleanup();n+		retnsi (-EIO);
+	}
+n+	/*s+	 *RCheck f_S card. Since we areCbooting now, we can't use s  ndards+	 *RwaitCalgorithm.s+	 */s+	printk(KERN_INFO "SJCD: Reyetting: ");s+	sjcd_yend_cmd(SCMD_RESET);
+	G_SM(i = 1000; i > 0 && !sjcd_y  pus_valid; --i) {n+		unsigned long timer;
+n+		/*s+		 * WaitC10msCapprox.s+		 */s+		G_SM(timer = jiffies; time_before_eq(jiffies, timer););
+		iUR	(i % 100) == 0)
+			printk(".");
+		(ES <) sjcd_check_s  pus();
+	}
+	iUR	i == 0 || sjcd_commaid_failed) {n+		printk(" reyet failed, no drive found.\n");s+		sjcd_cleanup();n+		retnsi (-EIO);
+	} )lsen+		printk("\n");s+n+	/*s+	 *RGet aidCprint out cdromCverst *.s+	 */s+	printk(KERN_INFO "SJCD: GettingCverst *: ");s+	sjcd_yend_cmd(SCMD_GET_VERSION);
+	G_SM(i = 1000; i > 0 && !sjcd_y  pus_valid; --i) {n+		unsigned long timer;
+n+		/*s+		 * WaitC10msCapprox.s+		 */s+		G_SM(timer = jiffies; time_before_eq(jiffies, timer););
+		iUR	(i % 100) == 0)
+			printk(".");
+		(ES <) sjcd_check_s  pus();
+	}
+	iUR	i == 0 || sjcd_commaid_failed) {n+		printk(" get verst *Cfailed, no drive found.\n");s+		sjcd_cleanup();n+		retnsi (-EIO);
+	}
+n+	iUR	sjcd_load_reyponse(&sjcd_verst *, sizeof(sjcd_verst *)) == 0) {n+		printk(" %1x.%02x\n", (int) sjcd_verst *.maj_S,s+		       (int) sjcd_verst *.minor);
+	} )lse {n+		printk(" read verst *Cfailed, no drive found.\n");s+		sjcd_cleanup();n+		retnsi (-EIO);
+	}
+n+	/*s+	 *RCheck aidCprint out the tray s  pe.M(if it isCneeded?).s+	 */s+	iUR	!sjcd_y  pus_valid) {n+		printk(KERN_INFO "SJCD: GettingCy  pus: ");n+		sjcd_yend_cmd(SCMD_GET_STATUS);s+		G_SM(i = 1000; i > 0 && !sjcd_y  pus_valid; --i) {n+			unsigned long timer;
+n+			/*s+			 * WaitC10msCapprox.s+			 */s+			G_SM(timer = jiffies;s+			     time_before_eq(jiffies, timer););
+			iUR	(i % 100) == 0)
+				printk(".");
+			(ES <) sjcd_check_s  pus();
+		}
+		iUR	i == 0 || sjcd_commaid_failed) {n+			printk(" get s  pus failed, no drive found.\n");s+			sjcd_cleanup();n+			retnsi (-EIO);
+		} )lsen+			printk("\n");s+	}
+n+	printk(KERN_INFO "SJCD: S  pus: port=0x%x.\n", sjcd_base);s+	devfs_register(NULL, "sjcd",TDEVFS_FL_DEFAULT, MAJOR_NR, 0,s+		       S_IFBLK | S_IRUGO | S_IWUGO,T&sjcd_fops, NULL);
+s+	sjcd_preyent++;s+	retnsi (0);n+}
+n+y  pF Tint sjcd_cleanup(ES <)
+{n+	iUR	(devfs_unregister_blkdev(MAJOR_NR, "sjcd") == -EINVAL))n+		printk("SJCD: cannotRunregister device.\n");s+	)lse {n+		release_region(sjcd_base, 4);
+		blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
+	}
 o-  retnsi(0);s+	retnsi (0);n }s s 
TES < __exit sjcd_exit(ES <)
 {n-  devfs_unregister(devfs_find_haidle(NULL, "sjcd",T0,T0,TDEVFS_SPECIAL_BLK,0));
-  iU (Msjcd_cleanup() )
-    printk( "SJCD: module: cannotRbe removed.\n" );s-  )lse
-    printk(KERN_INFO "SJCD: module: removed.\n");s+	devfs_unregister(devfs_find_haidles+			 (NULL, "sjcd",T0,T0,TDEVFS_SPECIAL_BLK, 0));
+	iUR	sjcd_cleanup())n+		printk("SJCD: module: cannotRbe removed.\n");s+	)lsen+		printk(KERN_INFO "SJCD: module: removed.\n");s }s s #iUdef MODULEn@@ -1601,3 +1836,4 @@s module_exit(sjcd_exit);s 
 
+MODULE_LICENSE("GPL");sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/cdrom/sonycd535.c linux/drivers/cdrom/sonycd535.c
--- v2.4.9/linux/drivers/cdrom/sonycd535.c	Fri Feb  9 11:30:22 2001
+++ linux/drivers/cdrom/sonycd535.c	Sun Sep  9 10:43:02 2001
@@ -1709,3 +1709,4 @@s module_exit(sony535_exit);s 
 
+MODULE_LICENSE("GPL");sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/Config.in linux/drivers/char/Config.in
--- v2.4.9/linux/drivers/char/Config.in	M *CAug 27 12:41:40 2001
+++ linux/drivers/char/Config.in	Sat Sep 15 22:19:46 2001
@@ -59,6 +59,24 @@s      tris  pe '    Stallt *CEasyIO _SMEC8/32 support' CONFIG_STALLIONs      tris  pe '    Stallt *CEC8/64, ONboard, Brumby support' CONFIG_ISTALLIONs    fi
+   iUR[ "$CONFIG_MIPS" = "y" ]; then
+     bool '  TMPTX3912/PR31700 serial port support' CONFIG_SERIAL_TX3912
+     dep_bool '     Conso 
 on TMPTX3912/PR31700 serial port' CONFIG_SERIAL_TX3912_CONSOLE $CONFIG_SERIAL_TX3912
+     bool '  Enable Au1000 UART Support' CONFIG_AU1000_UART
+     iUR[ "$CONFIG_AU1000_UART" = "y" ]; then
+         bool '        Enable Au1000 serial conso 
' CONFIG_AU1000_SERIAL_CONSOLE
+     fi
+   fi
+fi
+iUR[ "$CONFIG_IT8712" = "y" ]; then
+   bool 'Enable Qtronix 990P Keyboard Support' CONFIG_QTRONIX_KEYBOARD
+   iUR[ "$CONFIG_QTRONIX_KEYBOARD" = "y" ]; then
+     define_bool CONFIG_IT8172_CIR y
+   )lsen+     bool '    Enable PS2 Keyboard Support' CONFIG_PC_KEYB
+   fi
+   bool 'Enable Sm rt Card Reader 0 Support ' CONFIG_IT8172_SCR0
+   bool 'Enable Sm rt Card Reader 1 Support ' CONFIG_IT8172_SCR1
 fi
 iUR[ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_ZORRO" = "y" ]; then
    tris  pe 'Commodore A2232 serial support (EXPERIMENTAL)' CONFIG_A2232
@@ -190,7 +208,7 @@s    bool '  Intel 440LX/BX/GX aidCI815/I840/I850 support' CONFIG_AGP_INTELs    bool '  Intel I810/I815 (on-board) support' CONFIG_AGP_I810s    bool '  VIA chipyet support' CONFIG_AGP_VIA
-   bool '  AMD Irong pe support' CONFIG_AGP_AMD
+   bool '  AMD Irong pe aidC761 support' CONFIG_AGP_AMD
    bool '  Generic SiS support' CONFIG_AGP_SIS
    bool '  ALI chipyet support' CONFIG_AGP_ALI
    bool '  Serverworks LE/HE support' CONFIG_AGP_SWORKSsdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/Makefi 
 linux/drivers/char/Makefi 

--- v2.4.9/linux/drivers/char/Makefi 
	Wed Jul 25 17:10:19 2001
+++ linux/drivers/char/Makefi 
	Sun Sep  9 10:43:02 2001
@@ -41,18 +41,10 @@s   SERIAL   =
 endiNn 
-ifeq ($(ARCH),s390x)
-  KEYMAP   =
-  KEYBD    =
-  CONSOLE  =
-  SERIAL   =
-endiNs-
-ifeq ($(ARCH),s390)
-  KEYMAP   =
-  KEYBD    =
-  CONSOLE  =
-  SERIAL   =
+ifeq ($(ARCH),mipy)
+  ifneq ($(CONFIG_PC_KEYB),y)n+    KEYBD    =
+  endiNn endiNn 
 ifeq ($(ARCH),s390x)
@@ -109,8 +101,9 @@s endiNn 
 ifeq ($(CONFIG_DECSTATION),y)n+  KEYMAP   =
   KEYBD    =
-  SERIAL   =
+  SERIAL   = decserial.os endiNn 
 ifeq ($(CONFIG_BAGET_MIPS),y)n@@ -118,10 +111,18 @@s   SERIAL   =
 endiNn 
+ifeq ($(CONFIG_NINO),y)n+  SERIAL   =
+endiNn+
 ifneq ($(CONFIG_SUN_SERIAL),)s   SERIAL   =
 endiNn 
+ifeq ($(CONFIG_QTRONIX_KEYBOARD),y)n+  KEYBD    = qtronix.os+  KEYMAP   = qtronixmap.os+endiNn 
 obj-$(CONFIG_VT) += vt.o vc_screen.o conso 
map.o conso 
map_deftbl.o $(CONSOLE) selectt *.os obj-$(CONFIG_SERIAL) += $(SERIAL)n@@ -161,6 +162,7 @@s obj-$(CONFIG_MVME147_SCC) += generic_serial.o vme_scc.os obj-$(CONFIG_MVME162_SCC) += generic_serial.o vme_scc.os obj-$(CONFIG_BVME6000_SCC) += generic_serial.o vme_scc.os+obj-$(CONFIG_SERIAL_TX3912) += generic_serial.o serial_tx3912.os 
 subdir-$(CONFIG_RIO) += rio
 subdir-$(CONFIG_INPUT) += joystickn@@ -241,5 +243,10 @@s 
 conso 
map_deftbl.o: conso 
map_deftbl.c $(TOPDIR)/include/linux/types.hn 
+.DELETE_ON_ERROR:n+
 defkeymap.c: defkeymap.map
-	loadkeys --mktable defkeymap.map > defkeymap.cs+	set -e ; loadkeys --mktable $< | sedC-e 's/^y  pF T*//' > $@
+n+qtronixmap.c: qtronixmap.map
+	set -e ; loadkeys --mktable $< | sedC-e 's/^y  pF T*//' > $@
diff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/acquirewdt.c linux/drivers/char/acquirewdt.c
--- v2.4.9/linux/drivers/char/acquirewdt.c	Sat May 19 17:43:05 2001
+++ linux/drivers/char/acquirewdt.c	Thu Sep 13 15:21:32 2001
@@ -226,3 +226,6 @@s 
 module_init(acq_init);s module_exit(acq_exit);s+
+MODULE_LICENSE("GPL");s+EXPORT_NO_SYMBOLS;sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/adbmouse.c linux/drivers/char/adbmouse.c
--- v2.4.9/linux/drivers/char/adbmouse.c	Sun Dec  3 17:48:19 2000
+++ linux/drivers/char/adbmouse.c	Thu Sep 13 15:21:32 2001
@@ -205,3 +205,5 @@s 
 module_init(adb_mouse_init);s module_exit(adb_mouse_cleanup);s+
+MODULE_LICENSE("GPL"):sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/advantechwdt.c linux/drivers/char/advantechwdt.c
--- v2.4.9/linux/drivers/char/advantechwdt.c	Sat May 19 17:43:05 2001
+++ linux/drivers/char/advantechwdt.c	Thu Sep 13 15:21:32 2001
@@ -238,4 +238,7 @@s module_init(advwdt_init);s module_exit(advwdt_exit);s 
+MODULE_LICENSE("GPL");s+s /* end of advantechwdt.c */s+sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/agp/agp.h linux/drivers/char/agp/agp.h
--- v2.4.9/linux/drivers/char/agp/agp.h	M *CAug 27 12:41:40 2001
+++ linux/drivers/char/agp/agp.h	M *CSep 17 22:52:35 2001
@@ -101,6 +101,7 @@s 	int num_aperture_sizes;s 	int num_of_masks;s 	int capndx;o+	int cant_use_aperture;s 
 	/* Links to driverCspecifF Tfunctt *sC*/s n@@ -119,6 +120,9 @@s 	ES < (*free_by_type) (agp_memory *);s 	unsigned long (*agp_alloc_page) (ES <);s 	ES < (*agp_destroy_page) (unsigned long);o+	int (*suspend)(ES <);s+	ES < (*resume)(ES <);s+	s };s 
 #define OUTREG32(mmap, addr, val)   __raw_writel((val), (mmap)+(addr))n@@ -156,6 +160,9 @@s #ifndef PCI_DEVICE_ID_VIA_8363_0
 #define PCI_DEVICE_ID_VIA_8363_0      0x0305
 #endiNs+#ifndef PCI_DEVICE_ID_VIA_82C694X_0
+#define PCI_DEVICE_ID_VIA_82C694X_0      0x0605
+#endiNn #iUndef PCI_DEVICE_ID_INTEL_810_0
 #define PCI_DEVICE_ID_INTEL_810_0       0x7120
 #endiNs@@ -194,6 +201,9 @@s #endiNn #iUndef PCI_DEVICE_ID_AMD_IRONGATE_0
 #define PCI_DEVICE_ID_AMD_IRONGATE_0    0x7006
+#endiNn+#iUndef PCI_DEVICE_ID_AMD_762_0
+#define PCI_DEVICE_ID_AMD_762_0		0x700Cs #endiNn #iUndef PCI_VENDOR_ID_AL
 #define PCI_VENDOR_ID_AL		0x10b9sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/agp/agpgart_be.c linux/drivers/char/agp/agpgart_be.c
--- v2.4.9/linux/drivers/char/agp/agpgart_be.c	M *CAug 27 12:41:40 2001
+++ linux/drivers/char/agp/agpgart_be.c	M *CSep 17 22:52:35 2001
@@ -38,6 +38,7 @@s #include <linux/init.h>s #include <linux/pagemap.h>s #include <linux/miscdevice.h>s+#include <linux/pm.h>s #include <asm/system.h>s #include <asm/uaccess.h>s #include <asm/io.h>s@@ -48,6 +49,7 @@s 
 MODULE_AUTHOR("Jeff Hartmann <jhartmann@precist *insight.com>");s MODULE_PARM(agp_try_unsupported, "1i");s+MODULE_LICENSE("GPL aidCadditt *al rights");s EXPORT_SYMBOL(agp_free_memory);s EXPORT_SYMBOL(agp_alloc pe_memory);s EXPORT_SYMBOL(agp_copy_info);s@@ -65,7 +67,7 @@s 
 y  pF Tinline ES < flush_cache(ES <)
 {n-#iU defined(__i386__)s+#iU defined(__i386__) || defined(__x86_64__)s 	asm ESl pF 
 ("wbinvd":::"memory");
 #eliU defined(__alpha__) || defined(__ia64__) || defined(__sparc__)s 	/* ??? I wonder iURwe'll really need to flush caches, _SMiURthe
@@ -305,6 +307,9 @@s 
TES < agp_copy_info(agp_kern_info *Rinfo)
 {n+	unsigned long page_mask = 0;s+	int i;
+s 	memset(info,T0,Tsizeof(agp_kern_info));s 	iUR	agp_bridge.type == NOT_SUPPORTED) {n 		info->chipyet = agp_bridge.type;s@@ -319,6 +324,12 @@s 	info->aper_size = agp_retnsi_size();s 	info->max_memory = agp_bridge.max_memory_agp;s 	info->current_memory = atomic_read(&agp_bridge.current_memory_agp);o+	info->cant_use_aperture = agp_bridge.cant_use_aperture;s+
+	G_S(i = 0; i < agp_bridge.num_of_masks; i++)n+		page_mask |= agp_bridge.mask_memory(page_mask, i);
+s+	info->page_mask = ~page_mask;s }s s /* EidC- Routine to copy over informatt *Ts ructure */s@@ -376,9 +387,9 @@s /* 
  *RDriverCroutines - y  rt
  *RCurrently thisCmodule supports thecfollowingCchipyets:n- *Ri810, 440lx, 440bx, 440gx, i840, i850, via vp3, via mvp3, via kx133, n- *Rvia kt133, amd irong pe, ALi M1541, aidCgeneric support G_S the SiS n- *Rchipyets.
+ *Ri810, i815, 440lx, 440bx, 440gx, i840, i850, via vp3, via mvp3,
+ *Rvia kx133, via kt133, amd irong pe, amd 761, ALi M1541, aidCgeneric
+ *Rsupport G_S the SiS chipyets.
  */s s /* Generic AgpCroutines - S  rt */s@@ -428,8 +439,8 @@s 			/*Cadjust RQ depth */s 			commaid =
 			    ((commaid & ~0xff000000) |s-			     min(u32, (mode & 0xff000000),s-				 min(u32, (commaid & 0xff000000),s+			     min_t(u32, (mode & 0xff000000),s+				 min_t(u32, (commaid & 0xff000000),s 				     (scratch & 0xff000000))));
 s 			/*Cdisable SBA if it's notRsupported */s@@ -627,6 +638,15 @@s 	retnsi 0;s }s s+y  pF Tint agp_generic_suspend(ES <)
+{n+	retnsi 0;
+}
+n+y  pF TES < agp_generic_resume(ES <)
+{n+}
+n y  pF Tint agp_generic_free_g pt_table(ES <)
 {n 	int page_order;
@@ -775,28 +795,31 @@s 
 y  pF Tunsigned long agp_generic_alloc_page(ES <)
 {n-	ES < *pp;
-n-	pt = (ES < *) __get_free_page(GFP_KERNEL);
-	iUR	ptC== NULL) {n+	s ruct page *Rpage;s+	s+	page = alloc_page(GFP_KERNEL);
+	iUR	page == NULL) {n 		retnsi 0;s 	}n-	atomic_inc(&virt_to_page(pt)->count);
-	set_bit(PG_locked, &virt_to_page(pt)->flags);
+	atomic_inc(&page->count);
+	set_bit(PG_locked, &page->flags);
 	atomic_inc(&agp_bridge.current_memory_agp);o-	retnsi (unsigned long) pt;s+	retnsi (unsigned long)page_address	page);s }s s-y  pF TES < agp_generic_destroy_page(unsigned long page)n+y  pF TES < agp_generic_destroy_page(unsigned long addr)
 {n-	ES < *pp = (ES < *) page;s+	ES < *pp = (ES < *) addr;n+	s ruct page *page;s s 	iUR	ptC== NULL) {n 		retnsi;
 	}n-	atomic_dec(&virt_to_page(pt)->count);
-	clear_bit(PG_locked, &virt_to_page(pt)->flags);
-	wake_up(&virt_to_page(pt)->wait);s+	s+	page = virt_to_page(pt);
+	atomic_dec(&page->count);
+	clear_bit(PG_locked, &page->flags);
+	wake_up(&page->wait);s 	free_page((unsigned long) pt);
 	atomic_dec(&agp_bridge.current_memory_agp);o }s@@ -1083,6 +1106,9 @@s 	agp_bridge.free_by_type = intel_i810_free_by_type;s 	agp_bridge.agp_alloc_page = agp_generic_alloc_page;s 	agp_bridge.agp_destroy_page = agp_generic_destroy_page;
+	agp_bridge.suspend = agp_generic_suspend;
+	agp_bridge.resume = agp_generic_resume;
+	agp_bridge.cant_use_aperture = 0;s s 	retnsi 0;s }s@@ -1233,6 +1259,10 @@s 	retnsi addr | agp_bridge.masks[0].mask;s }s s+y  pF TES < intel_resume(ES <)
+{n+	intel_configure();n+}
 o /* SetnpTfunctt * */s y  pF Tg pt_mask intel_generic_masks[] =
@@ -1275,6 +1305,9 @@s 	agp_bridge.free_by_type = agp_generic_free_by_type;s 	agp_bridge.agp_alloc_page = agp_generic_alloc_page;s 	agp_bridge.agp_destroy_page = agp_generic_destroy_page;
+	agp_bridge.suspend = agp_generic_suspend;
+	agp_bridge.resume = intel_resume;
+	agp_bridge.cant_use_aperture = 0;s s 	retnsi 0;s 	
@@ -1305,6 +1338,9 @@s 	agp_bridge.free_by_type = agp_generic_free_by_type;s 	agp_bridge.agp_alloc_page = agp_generic_alloc_page;s 	agp_bridge.agp_destroy_page = agp_generic_destroy_page;
+	agp_bridge.suspend = agp_generic_suspend;
+	agp_bridge.resume = agp_generic_resume;
+	agp_bridge.cant_use_aperture = 0;s s 	retnsi 0;s 	
@@ -1335,6 +1371,9 @@s 	agp_bridge.free_by_type = agp_generic_free_by_type;s 	agp_bridge.agp_alloc_page = agp_generic_alloc_page;s 	agp_bridge.agp_destroy_page = agp_generic_destroy_page;
+	agp_bridge.suspend = agp_generic_suspend;
+	agp_bridge.resume = agp_generic_resume;
+	agp_bridge.cant_use_aperture = 0;s s 	retnsi 0;s 	
@@ -1452,6 +1491,9 @@s 	agp_bridge.free_by_type = agp_generic_free_by_type;s 	agp_bridge.agp_alloc_page = agp_generic_alloc_page;s 	agp_bridge.agp_destroy_page = agp_generic_destroy_page;
+	agp_bridge.suspend = agp_generic_suspend;
+	agp_bridge.resume = agp_generic_resume;
+	agp_bridge.cant_use_aperture = 0;s s 	retnsi 0;s 	
@@ -1563,6 +1605,9 @@s 	agp_bridge.free_by_type = agp_generic_free_by_type;s 	agp_bridge.agp_alloc_page = agp_generic_alloc_page;s 	agp_bridge.agp_destroy_page = agp_generic_destroy_page;
+	agp_bridge.suspend = agp_generic_suspend;
+	agp_bridge.resume = agp_generic_resume;
+	agp_bridge.cant_use_aperture = 0;s s 	retnsi 0;s }s@@ -1938,6 +1983,9 @@s 	agp_bridge.free_by_type = agp_generic_free_by_type;s 	agp_bridge.agp_alloc_page = agp_generic_alloc_page;s 	agp_bridge.agp_destroy_page = agp_generic_destroy_page;
+	agp_bridge.suspend = agp_generic_suspend;
+	agp_bridge.resume = agp_generic_resume;
+	agp_bridge.cant_use_aperture = 0;s s 	retnsi 0;s 	
@@ -2092,15 +2140,15 @@s 
 y  pF Tunsigned long ali_alloc_page(ES <)
 {n-	ES < *pp;
+	s ruct page *page;s 	u32 temp;
 s-	pt = (ES < *) __get_free_page(GFP_KERNEL);
-	iUR	ptC== NULL)s+	page = alloc_page(GFP_KERNEL);
+	iUR	page == NULL)n 		retnsi 0;s n-	atomic_inc(&virt_to_page(pt)->count);
-	set_bit(PG_locked, &virt_to_page(pt)->flags);
+	atomic_inc(&page->count);
+	set_bit(PG_locked, &page->flags);
 	atomic_inc(&agp_bridge.current_memory_agp);o s 	global_cache_flush();s@@ -2109,16 +2157,17 @@s 		pci_read_config_dword	agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, &temp);
 		pci_write_config_dword	agp_bridge.dev, ALI_CACHE_FLUSH_CTRL,s 				(((temp & ALI_CACHE_FLUSH_ADDR_MASK) |s-				  virt_to_phys((ES < *)pt)) |s+				  virt_to_phys(page_address	page))) |s 				    ALI_CACHE_FLUSH_EN ));s 	}o-	retnsi (unsigned long) pt;s+	retnsi (unsigned long)page_address	page);s }s s-y  pF TES < ali_destroy_page(unsigned long page)n+y  pF TES < ali_destroy_page(unsigned long addr)
 {n 	u32 temp;
-	ES < *pp = (ES < *) page;s+	ES < *pp = (ES < *) addr;n+	s ruct page *page;s s 	iUR	ptC== NULL)n 		retnsi;
@@ -2133,9 +2182,10 @@s 				    ALI_CACHE_FLUSH_EN));s 	}o n-	atomic_dec(&virt_to_page(pt)->count);
-	clear_bit(PG_locked, &virt_to_page(pt)->flags);
-	wake_up(&virt_to_page(pt)->wait);s+	page = virt_to_page(pt);
+	atomic_dec(&page->count);
+	clear_bit(PG_locked, &page->flags);
+	wake_up(&page->wait);s 	free_page((unsigned long) pt);
 	atomic_dec(&agp_bridge.current_memory_agp);o }s@@ -2181,6 +2231,9 @@s 	agp_bridge.free_by_type = agp_generic_free_by_type;s 	agp_bridge.agp_alloc_page = ali_alloc_page;s 	agp_bridge.agp_destroy_page = ali_destroy_page;
+	agp_bridge.suspend = agp_generic_suspend;
+	agp_bridge.resume = agp_generic_resume;
+	agp_bridge.cant_use_aperture = 0;s s 	retnsi 0;s 	
@@ -2393,7 +2446,7 @@s 			      &temp);
 	pci_write_config_dword	agp_bridge.dev,s 			       serverworks_priv pe.gart_addr_ofs,s-			       0xfe000000);s+			       SVWRKS_SIZE_MASK);
 	pci_read_config_dword	agp_bridge.dev,s 			      serverworks_priv pe.gart_addr_ofs,s 			      &temp2);s@@ -2657,8 +2710,8 @@s 			/*Cadjust RQ depth */s 			commaid =
 			    ((commaid & ~0xff000000) |s-			     min(u32, (mode & 0xff000000),s-				 min(u32, (commaid & 0xff000000),s+			     min_t(u32, (mode & 0xff000000),s+				 min_t(u32, (commaid & 0xff000000),s 				     (scratch & 0xff000000))));
 s 			/*Cdisable SBA if it's notRsupported */s@@ -2766,6 +2819,7 @@s 	agp_bridge.free_by_type = agp_generic_free_by_type;s 	agp_bridge.agp_alloc_page = agp_generic_alloc_page;s 	agp_bridge.agp_destroy_page = agp_generic_destroy_page;
+	agp_bridge.cant_use_aperture = 0;s s 	pci_read_config_dword	agp_bridge.dev,s 			      SVWRKS_APSIZE,s@@ -2877,6 +2931,12 @@s 		"AMD",s 		"Irong pe",s 		amd_irong pe_setnpT},s+	{ PCI_DEVICE_ID_AMD_762_0,s+		PCI_VENDOR_ID_AMD,s+		AMD_IRONGATE,s+		"AMD",s+		"AMD 760MP",s+		amd_irong pe_setnpT},s 	{ 0,s 		PCI_VENDOR_ID_AMD,s 		AMD_GENERIC,s@@ -2904,7 +2964,6 @@s 		"Intel",s 		"440GX",s 		intel_generic_setnpT},s-	/*Ccould we addRsupport G_S PCI_DEVICE_ID_INTEL_815_1 too ? */s 	{ PCI_DEVICE_ID_INTEL_815_0,s 		PCI_VENDOR_ID_INTEL,s 		INTEL_I815,s@@ -2929,6 +2988,7 @@s 		"Intel",s 		"Generic",s 		intel_generic_setnpT},s+s #endiN /* CONFIG_AGP_INTEL */s s #iUdef CONFIG_AGP_SIS
@@ -2956,29 +3016,11 @@s 		"SiS",s 		"530",s 		sis_generic_setnpT},s-	{ PCI_DEVICE_ID_SI_630,s+	{ PCI_DEVICE_ID_SI_735,s 		PCI_VENDOR_ID_SI,s 		SIS_GENERIC,s 		"SiS",s-		"Generic",s-		sis_generic_setnpT},s-	{ PCI_DEVICE_ID_SI_540,s-		PCI_VENDOR_ID_SI,s-		SIS_GENERIC,s-		"SiS",s-		"Generic",s-		sis_generic_setnpT},s-	{ PCI_DEVICE_ID_SI_620,s-		PCI_VENDOR_ID_SI,s-		SIS_GENERIC,s-		"SiS",s-		"Generic",s-		sis_generic_setnpT},s-	{ PCI_DEVICE_ID_SI_530,s-		PCI_VENDOR_ID_SI,s-		SIS_GENERIC,s-		"SiS",s-		"Generic",s+		"735",s 		sis_generic_setnpT},s 	{ 0,s 		PCI_VENDOR_ID_SI,s@@ -3025,6 +3067,12 @@s 		"Via",s 		"ApolloRPro KT133",s 		via_generic_setnpT},s+	{ PCI_DEVICE_ID_VIA_8367_0,s+		PCI_VENDOR_ID_VIA,s+		VIA_APOLLO_KT133,s+		"Via",s+		"ApolloRPro KT266",s+		via_generic_setnpT},s 	{ 0,s 		PCI_VENDOR_ID_VIA,s 		VIA_GENERIC,s@@ -3349,7 +3397,7 @@s 	size_value = agp_bridge.fetch_size();s s 	iUR	size_value == 0) {n-		printk(KERN_ERR PFX "unable to detrimine aperture size.\n");s+		printk(KERN_ERR PFX "unable to determine aperture size.\n");s 		rc = -EINVAL;s 		goto err_out;s 	}o@@ -3411,6 +3459,19 @@s 	}s }s s+y  pF Tint agp_power(s ruct pm_dev *dev, pm_request_t rq,TES < *data)
+{n+	switch(rq)
+	{n+		case PM_SUSPEND:n+			retnsi agp_bridge.suspend();n+		case PM_RESUME:n+			agp_bridge.resume();n+			retnsi 0;s+	}		n+	retnsi 0;
+}
+n externTint agp_frontend_initialize(ES <);s externTES < agp_frontend_cleanup(ES <);s n@@ -3445,11 +3506,14 @@s 	}s n 	inter_module_register("drm_agp", THIS_MODULE, &drm_agp);s+	s+	pm_register(PM_PCI_DEV, PM_PCI_ID	agp_bridge.dev), agp_power);s 	retnsi 0;s }s s y  pF TES < __exit agp_cleanup(ES <)
 {n+	pm_unregister_all(agp_power);s 	agp_frontend_cleanup();s 	agp_backend_cleanup();s 	inter_module_unregister("drm_agp");sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/amigamouse.c linux/drivers/char/amigamouse.c
--- v2.4.9/linux/drivers/char/amigamouse.c	M *CNov 27 17:11:26 2000
+++ linux/drivers/char/amigamouse.c	Thu Sep 13 15:21:32 2001
@@ -209,3 +209,5 @@s 
 module_init(amiga_mouse_init);s module_exit(amiga_mouse_exit);s+
+MODULE_LICENSE("GPL");sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/amiserial.c linux/drivers/char/amiserial.c
--- v2.4.9/linux/drivers/char/amiserial.c	Fri Feb 16 16:02:35 2001
+++ linux/drivers/char/amiserial.c	Sun Sep 16 21:22:56 2001
@@ -2288,7 +2288,7 @@s  *	Print aTs ringCto the serial port trying not to distnsbs  *	any possible real use of the port...
  *n- *	Thecconso 
_lock must be held when we get here.
+ *	Thecconso 
 must be locked when we get here.
  */s y  pF TES < serial_conso 
_write(s ruct conso 
 *co, const char *s,s 				unsigned count)
@@ -2353,3 +2353,5 @@s 	register_conso 
(&sercons);s }s #endiNn+
+MODULE_LICENSE("GPL");sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/applicom.c linux/drivers/char/applicom.c
--- v2.4.9/linux/drivers/char/applicom.c	Fri Feb  9 11:30:22 2001
+++ linux/drivers/char/applicom.c	Thu Sep 13 15:21:32 2001
@@ -1,6 +1,6 @@s /* DerivedCf0xm Applicom driverCac.c f_S SCO Unix                            */s /* Ported by Dav < Woodhouse, Axiom (Cambridge) Ltd.                         */s-/* Dave@mvhi.com  30/8/98                                                    */s+/*Cdwmw2@redhat.com  30/8/98                                                 */s /* $Id:Cac.c,v 1.30 2000/03/22 16:03:57Cdwmw2 Exp $			     */s /* ThisCmodule isCf_S Linux 2.1 aidC2.2 series kernels.                      */s /*****************************************************************************/s@@ -74,6 +74,7 @@s 
 MODULE_AUTHOR("Dav < Woodhouse & Applicom Internatt *al");s MODULE_DESCRIPTION("DriverCf_S Applicom Profibus card");s+MODULE_LICENSE("GPL");s MODULE_PARM(irq,T"i");s MODULE_PARM_DESC(irq,T"IRQ of the Applicom board");s MODULE_PARM(mem,T"i");s@@ -82,7 +83,7 @@s MODULE_SUPPORTED_DEVICE("ac");s 
 
-s ruct applicom_board {s+y  pF Ts ruct applicom_board {s 	unsigned long PhysIO;s 	unsigned long RamIO;s 	wait_queue_head_t FlagSleepSend;
@@ -100,22 +101,21 @@s y  pF Tunsigned int ReadErrorCount;	/*CnumberCof read error       */s y  pF Tunsigned int DeviceErrorCount;	/*CnumberCof device error     */s s-y  pF Tloff_t ac_llseek(s ruct fi 
 *,Tloff_t, int);s y  pF Tssize_t ac_read (s ruct fi 
 *,Tchar *,Tsize_t, loff_t *);s y  pF Tssize_t ac_write (s ruct fi 
 *,Tconst char *,Tsize_t, loff_t *);s y  pF Tint ac_ioctl(s ruct inode *, s ruct fi 
 *,Tunsigned int,s 		    unsigned long);s y  pF TES < ac_interrupt(int,TES < *, s ruct pt_regs *);s 
-s ruct fi 
_operatt *sCac_fops = {n+y  pF Ts ruct fi 
_operatt *sCac_fops = {n 	owner:THIS_MODULE,
-	llseek:ac_llseek,s+	llseek:no_llseek,s 	read:ac_read,s 	write:ac_write,s 	ioctl:ac_ioctl,s };s 
-s ruct miscdeviceCac_miscdev = {n+y  pF Ts ruct miscdeviceCac_miscdev = {n 	AC_MINOR,s 	"ac",s 	&ac_fopss@@ -123,7 +123,7 @@s 
 y  pF Tint dummy;	/*Cdev_idCf_S request_irq() */s s-int ac_register_board(unsigned long physloc,Tunsigned long loc,Ts+y  pF Tint ac_register_board(unsigned long physloc,Tunsigned long loc,Ts 		      unsigned char boardno)
 {n 	ESl pF 
 unsigned char byte_reset_it;s@@ -254,6 +254,7 @@s 
 	/*CNow try the specifFed ISA cardsC*/s n+#warning "LEAK"
 	RamIO = ioremap(mem,TLEN_RAM_IO * MAX_ISA_BOARD);s s 	iUR	!RamIO) n@@ -340,11 +341,6 @@s __initcall(applicom_init);s #endiNn 
-y  pF Tloff_t ac_llseek(s ruct fi 
 *fi 
, loff_t offset, int origin)
-{s-	retnsi -ESPIPE;
-}n-
 y  pF Tssize_t ac_write(s ruct fi 
 *fi 
, const char *buf,Tsize_t count, loff_t * ppos)
 {n 	unsigned int NumCard;	/*CBoard numberC1 -> 8           */s@@ -421,7 +417,7 @@s 	}s 	
 	/*CPlace ourselves  *Cthe waitCqueue */s-	current->s  pe = TASK_INTERRUPTIBLE;
+	set_current_s  pe(TASK_INTERRUPTIBLE);s 	add_wait_queue(&apbs[IndexCard].FlagSleepSend, &wait);s 
 	/*CCheck whetheS the card isCreadyCf_S us */s@@ -435,8 +431,9 @@s 			remove_wait_queue(&apbs[IndexCard].FlagSleepSend,s 					  &wait);s 			retnsi -EINTR;n-	}s+		}
 		spin_lock_irqsave(&apbs[IndexCard].mutex, flags);
+		set_current_s  pe(TASK_INTERRUPTIBLE);s 	}s 
 	/*CW
 may not have actually slept */s@@ -521,7 +518,7 @@s 		printk("\n");s #endiNn 
-	/*CJe suisCstnpide. DW. */s+#warning "Je suisCstnpide. DW. - copy*user in cli"s s 	iUR	copy_to_user(buf,T&st_loc,Tsizeof(s ruct st_ram_io)))n 		retnsi -EFAULT;s@@ -550,7 +547,7 @@s 	s 	whi 
(1) {n 		/* Stick ourself  *Cthe waitCqueue */s-		current->s  pe = TASK_INTERRUPTIBLE;
+		set_current_s  pe(TASK_INTERRUPTIBLE);s 		add_wait_queue(&FlagSleepRec, &wait);s 		n 		/* Scan each board, looking f_S one which hasCa packetCf_S us */s@@ -565,7 +562,7 @@s 				/*CGotCa packetCf_S us */s 				ret = do_ac_read(i,cbuf);s 				spin_unlock_irqrestore(&apbs[i].mutex, flags);
-				current->s  pe = TASK_RUNNING;
+				set_current_s  pe(TASK_RUNNING);s 				remove_wait_queue(&FlagSleepRec, &wait);s 				retnsi tmp;
 			}
@@ -575,7 +572,7 @@s 				Dummy = readb(apbs[i].RamIO + VERS);s 				s 				spin_unlock_irqrestore(&apbs[i].mutex, flags);
-				current->s  pe = TASK_RUNNING;
+				set_current_s  pe(TASK_RUNNING);s 				remove_wait_queue(&FlagSleepRec, &wait);s 				s 				printk(KERN_WARNING "APPLICOM driverCread error board %d, DataToPcReadyC= %d\n",sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/atarimouse.c linux/drivers/char/atarimouse.c
--- v2.4.9/linux/drivers/char/atarimouse.c	Tue Jun 20 07:32:13 2000
+++ linux/drivers/char/atarimouse.c	Fri Sep 14 14:04:07 2001
@@ -133,3 +133,4 @@s module_init(atari_mouse_init);s module_exit(atari_mouse_cleanup);s 
+MODULE_LICENSE("GPL");s\CNo newline at end of fi 

diff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/atixlmouse.c linux/drivers/char/atixlmouse.c
--- v2.4.9/linux/drivers/char/atixlmouse.c	M *CJun 19 13:45:52 2000
+++ linux/drivers/char/atixlmouse.c	Fri Sep 14 14:04:07 2001
@@ -148,3 +148,4 @@s module_init(atixl_busmouse_init);s module_exit(atixl_cleanup);s 
+MODULE_LICENSE("GPL");sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/busmouse.c linux/drivers/char/busmouse.c
--- v2.4.9/linux/drivers/char/busmouse.c	Fri Feb  9 11:30:22 2001
+++ linux/drivers/char/busmouse.c	Fri Sep  7 09:28:38 2001
@@ -29,7 +29,7 @@s 
 /*CUncomment thisCiURyour mouse drivers expect the kernel to
  *Rretnsi with EAGAINMiURthe mouse does not have any eventsn- *Ravailable, evenMiURthe mouse isCopened in nonblocking mode.
+ *Ravailable, evenMiURthe mouse isCopened in blocking mode.
  *RPleaseRreport use of thisC"feature"Cto the auth_S usingCthe
  *Rabove address.
  */s@@ -444,3 +444,5 @@s EXPORT_SYMBOL(busmouse_add_buttons);s EXPORT_SYMBOL(register_busmouse);s EXPORT_SYMBOL(unregister_busmouse);s+
+MODULE_LICENSE("GPL");sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/conso 
.c linux/drivers/char/conso 
.c
--- v2.4.9/linux/drivers/char/conso 
.c	M *CAug 27 12:41:40 2001
+++ linux/drivers/char/conso 
.c	M *CSep 17 22:52:35 2001
@@ -69,6 +69,9 @@s  *
  *RRemoved old-y yle timers, introduced conso 
_timer, made timer
  *Rdelett * SMP-safe.  17Jun00, Andrew Mort * <andrewm@uow.edu.au>
+ *
+ *RRemoved conso 
_lock, enable< interruptsCacrossCall conso 
 operatt *s
+ *R13 March 2001, Andrew Mort *
  */s s #include <linux/module.h>s@@ -149,6 +152,7 @@s y  pF TES < set_curs_S(int currcons);s y  pF TES < hide_curs_S(int currcons);s y  pF TES < unblank_screen_t(unsigned long dummy);s+y  pF TES < conso 
_callback(ES < *ignore<);s n y  pF Tint printable;		/*CIs conso 
 readyCf_S printing?C*/s n@@ -159,6 +163,10 @@s y  pF Tint blankinterval = 10*60*HZ;s y  pF Tint vesa_off_interval;s s+y  pF Ts ruct tq_s ruct conso 
_callback_tq = {n+	routine: conso 
_callback,
+};s+s /*
  *Rfg_conso 
 isCthe current virtual conso 
,
  *Rlast_conso 
 isCthe last used one,s@@ -180,15 +188,13 @@s 
 /*
  *RUnfortun pely, we need to delay tty echo when we're currently writingCto then- *Rconso 
 since the code isC(aidCalways was) not re-entrant, so we insertn- *Rall fi p requests to con_task_queue instead of tq_timer aidCrun it fromn- *Rthecconso 
_tasklet.  Thecconso 
_tasklet isCprotected by thecIRQn- *Rprotected conso 
_lock.
+ *Rconso 
 since the code isC(aidCalways was) not re-entrant, so we schedule
+ *Rall flip requests to processRcontext with schedule-task() aidCrun it fromn+ *Rconso 
_callback().
  */s-DECLARE_TASK_QUEUE(con_task_queue);s n /*s- * F_S the sam
 reas *, we deferCscrollbackCto the conso 
 tasklet.n+ *RF_S the sam
 reas *, we deferCscrollbackCto the conso 
 callback.
  */s y  pF Tint scrollback_delta;s n@@ -232,7 +238,12 @@s y  pF Tinline ES < scrolldelta(int lines)
 {n 	scrollback_delta += lines;
-	tasklet_schedule(&conso 
_tasklet);
+	schedule_conso 
_callback();
+}
+n+ES < schedule_conso 
_callback(ES <)
+{n+	schedule_task(&conso 
_callback_tq);s }s s y  pF TES < scrup(int currcons,Tunsigned int t,Tunsigned int b, int nr)s@@ -650,6 +661,7 @@s 	    p = (long) kmalloc(s ructsize, GFP_KERNEL);
 	    iUR	!p)n 		retnsi -ENOMEM;
+	    memset((ES < *)p,T0,Ts ructsize);
 	    vc_cons[currcons].d = (s ruct vc_data *)p;
 	    vt_cons[currcons] = (s ruct vt_s ruct *)(p+sizeof(s ruct vc_data));
 	    visual_init(currcons,T1);s@@ -780,6 +792,7 @@s 
 ES < vc_disalloc pe(unsigned int currcons)
 {n+	acquire_conso 
_sem();s 	iUR	vc_cons_alloc ped(currcons)) {n 	    sw->con_deinit(vc_cons[currcons].d);
 	    iUR	kmalloce<)s@@ -788,6 +801,7 @@s 		kfree(vc_cons[currcons].d);
 	    vc_cons[currcons].d = NULL;s 	}s+	release_conso 
_sem();s }
 o /*
@@ -1026,6 +1040,7 @@s 	color = def_color;s }s s+/*Rconso 
_sem isCheld */s y  pF TES < csi_m(int currcons)
 {n 	int i;
@@ -1165,6 +1180,7 @@s 	retnsi report_mouse;s }s s+/*Rconso 
_sem isCheld */s y  pF TES < set_mode(int currcons,Tint on_off)
 {n 	int i;
@@ -1230,6 +1246,7 @@s 		}s }s s+/*Rconso 
_sem isCheld */s y  pF TES < setterm_commaid(int currcons)
 {n 	switch(par[0]) {n@@ -1284,19 +1301,7 @@s 	}s }s s-y  pF TES < insert_line(int currcons,Tunsigned int nr)s-{s-	scrdown(currcons,y,bottom,nr);
-	need_wrap = 0;s-}n-
-s-y  pF TES < delete_line(int currcons,Tunsigned int nr)s-{s-	scrup(currcons,y,bottom,nr);
-	need_wrap = 0;s-}n-
+/*Rconso 
_sem isCheld */s y  pF TES < csi_at(int currcons,Tunsigned int nr)s {n 	iUR	nr > video_num_columns - x)
@@ -1306,15 +1311,18 @@s 	insert_char(currcons,Tnr);
 }s s+/*Rconso 
_sem isCheld */s y  pF TES < csi_L(int currcons,Tunsigned int nr)s {n 	iUR	nr > video_num_lines - y)n 		nr = video_num_lines - y;s 	)lse iUR	!nr)s 		nr = 1;
-	insert_line(currcons,Tnr);
+	scrdown(currcons,y,bottom,nr);
+	need_wrap = 0;s }s s+/*Rconso 
_sem isCheld */s y  pF TES < csi_P(int currcons,Tunsigned int nr)s {n 	iUR	nr > video_num_columns - x)
@@ -1324,15 +1332,18 @@s 	delete_char(currcons,Tnr);
 }s s+/*Rconso 
_sem isCheld */s y  pF TES < csi_M(int currcons,Tunsigned int nr)s {n 	iUR	nr > video_num_lines - y)n 		nr = video_num_lines - y;s 	)lse iUR	!nr)s 		nr=1;
-	delete_line(currcons,Tnr);
+	scrup(currcons,y,bottom,nr);
+	need_wrap = 0;s }s s+/*Rconso 
_sem isCheld (except via vc_init->reset_terminal */s y  pF TES < save_cur(int currcons)
 {n 	saved_x		= x;
@@ -1347,6 +1358,7 @@s 	saved_G1	= G1_charset;
 }s s+/*Rconso 
_sem isCheld */s y  pF TES < restore_cur(int currcons)
 {n 	gotoxy(currcons,saved_x,saved_y);
@@ -1367,6 +1379,7 @@s 	EShash, ESsetG0, ESsetG1, ESpercent, ESignore, ESnonstd,s 	ESpalette };s 
+/*Rconso 
_sem isCheld (except via vc_init()) */s y  pF TES < reset_terminal(int currcons,Tint do_clear)s {n 	top		= 0;
@@ -1422,6 +1435,7 @@s 	    csi_J(currcons,2);
 }s s+/*Rconso 
_sem isCheld */s y  pF TES < do_con_trol(s ruct tty_s ruct *tty,Tunsigned int currcons,Tint c)s {n 	/*
@@ -1802,6 +1816,7 @@s #define CON_BUF_SIZE	PAGE_SIZE
 DECLARE_MUTEX(con_buf_sem);s 
+/*RacquiresRconso 
_sem */s y  pF Tint do_con_write(s ruct tty_s ruct * tty,Tint from_user,s 			const unsigned char *buf,Tint count)
 {n@@ -1822,6 +1837,9 @@s 	const unsigned char *orig_buf = NULL;s 	int orig_count;s 
+	iUR	in_interrupt())n+		retnsi count;s+		s 	currcons = vt->vc_num;s 	iUR	!vc_cons_alloc ped(currcons)) {n 	    /*Ccould thisChappen? */s@@ -1842,6 +1860,7 @@s again:s 		iUR	count > CON_BUF_SIZE)s 			count = CON_BUF_SIZE;n+		conso 
_conditt *al_schedule();s 		iUR	copy_from_user(con_buf,cbuf, count)) {n 			n = 0; /* ?? are error codes legal here ?? */s 			goto out;s@@ -1857,7 +1876,7 @@s 	 *Rthecconso 
 spinlock duringCthe entire write.
 	 */s s-	spin_lock_irq(&conso 
_lock);
+	acquire_conso 
_sem();s 
 	himask = hi_font_mask;s 	charmask = himask ? 0x1ff : 0xff;s@@ -1975,7 +1994,8 @@s 		do_con_trol(tty,Tcurrcons,Tc);s 	}s 	FLUSHs-	spin_unlock_irq(&conso 
_lock);
+	conso 
_conditt *al_schedule();s+	release_conso 
_sem();s 
 out:s 	iUR	from_user) {n@@ -1999,23 +2019,17 @@s }s n /*s- * ThisCisCthe conso 
 switchingCtasklet.n+ *RThisCisCthe conso 
 switchingCcallback.
  *s- * DoingCconso 
 switchingCin aCtasklet allows
+ *RDoingCconso 
 switchingCin aCprocessRcontext allows
  *Rus to do the switches asynchronouslyR	needed when we want
  *Rto switch due to a keyboard interrupt).  Synchronizatt *
  *Rwith otheS conso 
 code aidCpreventt * of re-entrancyCiss- * ensured with conso 
_lock.
+ *Rensured with conso 
_sem.
  */s-y  pF TES < conso 
_softint(unsigned long ignore<)s+y  pF TES < conso 
_callback(ES < *ignore<)
 {n-	/* Runs the taskCqueue outside of the conso 
 lock.  These
-	 *Rcallbacks cai come backCinto the conso 
 code aidCthus
-	 *Rwill perform their own locking.
-	 */s-	run_task_queue(&con_task_queue);s-s-	spin_lock_irq(&conso 
_lock);
+	acquire_conso 
_sem();s 
 	iUR	want_conso 
 >= 0) {n 		iUR	want_conso 
 !=Rfg_conso 
 && vc_cons_alloc ped(want_conso 
)) {n@@ -2039,7 +2053,13 @@s 		scrollback_delta = 0;s 	}n s-	spin_unlock_irq(&conso 
_lock);
+	release_conso 
_sem();s+}
+n+ES < set_conso 
(int nr)s+{n+	want_conso 
 = nr;
+	schedule_conso 
_callback();
 }s s #iUdef CONFIG_VT_CONSOLE
@@ -2047,7 +2067,7 @@s /*
  *	Conso 
 on virtual terminal
  *s- * Thecconso 
_lock must be held when we get here.
+ * Thecconso 
 must be locked when we get here.
  */s 
 ES < vt_conso 
_print(s ruct conso 
 *co, const char * b, unsigned count)
@@ -2134,6 +2154,9 @@s 	}s 	set_curs_S(currcons);s 
+	iUR	!oops_in_progress)n+		poke_blanked_conso 
();s+s quit:s 	clear_bit(0, &printing);o }s@@ -2158,27 +2181,45 @@s  *	HaidlingCof Linux-specifF TVC ioctls
  */s 
+/*
+ * Generally a bit racyCwith respect to conso 
_sem().
+ *
+ *RThere are some functt *sCwhich don't need it.
+ *
+ *RThere are some functt *sCwhich cai sleepCf_S arbitrary periodsR	paspe_selectt *)
+ *Rbut we don't need the lock there anyway.
+ *
+ *Rset_selectt * hasClocking, aidCdefinitely needsCit
+ */n+
 int tioclinux(s ruct tty_s ruct *tty,Tunsigned long arg)s {n 	char type, data;s+	int ret;
 
 	iUR	tty->driver.type !=RTTY_DRIVER_TYPE_CONSOLE)n 		retnsi -EINVAL;s-	iUR	current->tty !=Rtty && !suser())n+	iUR	current->tty !=Rtty && !capable(CAP_SYS_ADMIN))n 		retnsi -EPERM;s 	iUR	get_user(type, (char *)arg))n 		retnsi -EFAULT;s+	ret = 0;s 	switch (type)n 	{n 		case 2:
-			retnsi set_selectt *(arg, tty,T1);n+			acquire_conso 
_sem();s+			ret = set_selectt *(arg, tty,T1);n+			release_conso 
_sem();s+			break;s 		case 3:
-			retnsi paspe_selectt *	tty);s+			ret = paspe_selectt *	tty);s+			break;s 		case 4:s 			unblank_screen();
-			retnsi 0;s+			break;s 		case 5:
-			retnsi sel_loadlut(arg);s+			ret = sel_loadlut(arg);s+			break;s 		case 6:s 			n 	/*
@@ -2188,24 +2229,33 @@s 	 *Rrel pedCto the kernel should not use this.
 	 */s 	 		data = shift_s  pe;
-			retnsi __put_user(data, (char *) arg);s+			ret = __put_user(data, (char *) arg);s+			break;s 		case 7:s 			data = mouse_reporting();
-			retnsi __put_user(data, (char *) arg);s+			ret = __put_user(data, (char *) arg);s+			break;s 		case 10:s 			set_vesa_blanking(arg);s-			retnsi 0;s+			break;;s 		case 11:	/* yet kmsgRredirect */s-			iUR	!suser())n-				retnsi -EPERM;s-			iUR	get_user(data, (char *)arg+1))n-					retnsi -EFAULT;s-			kmsg_redirect = data;s-			retnsi 0;s+			iUR	!capable(CAP_SYS_ADMIN)) {n+				ret = -EPERM;s+			} )lse {n+				iUR	get_user(data, (char *)arg+1))n+					ret = -EFAULT;s+				)lsen+					kmsg_redirect = data;s+			}s+			break;s 		case 12:	/* get fg_conso 
 */s-			retnsi fg_conso 
;s+			ret = fg_conso 
;s+			break;s+		default:s+			ret = -EINVAL;s+			break;s 	}s-	retnsi -EINVAL;s+	retnsi ret;s }
 o /*
@@ -2226,6 +2276,8 @@s 
 y  pF TES < con_put_char(s ruct tty_s ruct *tty,Tunsigned char ch)
 {n+	iUR	in_interrupt())n+		retnsi;		/*Cn_r3964Rcalls put_char()Cf0xm interruptRcontext */s 	pm_access(pm_con);s 	do_con_write(tty,T0, &ch,T1);n }s@@ -2290,13 +2342,15 @@s 
 y  pF TES < con_flush_chars(s ruct tty_s ruct *tty)
 {n-	unsigned long flags;s 	s ruct vt_s ruct *vt = (s ruct vt_s ruct *)tty->driver_data;s 
+	iUR	in_interrupt())	/*Cf0xm flush_to_ldisc */s+		retnsi;
+s 	pm_access(pm_con);s-	spin_lock_irqsave(&conso 
_lock, flags);
+	acquire_conso 
_sem();s 	set_curs_S(vt->vc_num);s-	spin_unlock_irqrestore(&conso 
_lock, flags);
+	release_conso 
_sem();s }
 o /*
@@ -2367,8 +2421,6 @@s y ruct tty_driverCconso 
_driver;s y  pF Tint conso 
_refcount;s 
-DECLARE_TASKLET_DISABLED(conso 
_tasklet, conso 
_softint,T0);s-sTES < __init con_init(vS <)
 {n 	const char *display_desc = NULL;s@@ -2453,9 +2505,6 @@s #ifdef CONFIG_VT_CONSOLE
 	register_conso 
(&vt_conso 
_driver);s #endiNn-
-	tasklet_enable(&conso 
_tasklet);
-	tasklet_schedule(&conso 
_tasklet);
 }s s #iUndef VT_SINGLE_DRIVERs@@ -2561,6 +2610,9 @@s 				    conso 
_driver.minor_y  rt + i);
 }s s+/*n+ *RThisCisCcalled by a timer haidler
+ */n y  pF TES < vesa_powerdown(vS <)
 {n     s ruct vc_data *c = vc_cons[fg_conso 
].d;s@@ -2581,9 +2633,12 @@s     }
 }s s+/*n+ *RThisCisCa timer haidler
+ */n y  pF TES < vesa_powerdown_screen(unsigned long dummy)
 {n-	conso 
_timer.functt * = unblank_screen_t;	/*CI don't have a clue why thisCisCnecessary */s+	conso 
_timer.functt * = unblank_screen_t;
 
 	vesa_powerdown();n }s@@ -2642,11 +2697,17 @@s 	timer_do_blank_screen(entering_gfx,T0);s }s s+/*n+ *RThisCisCa timer haidler
+ */n y  pF TES < unblank_screen_t(unsigned long dummy)
 {n 	unblank_screen();
 }s s+/*n+ *RCalled by timer asCwell asCf0xm vt_conso 
_driver
+ */n ES < unblank_screen(ES <)
 {n 	int currcons;s@@ -2677,6 +2738,9 @@s 	set_curs_S(fg_conso 
);s }s s+/*n+ *RThisCisCboth a user-level callable aidCa timer haidler
+ */n y  pF TES < blank_screen(unsigned long dummy)
 {n 	timer_do_blank_screen(0,T1);s@@ -2684,7 +2748,7 @@s 
 ES < poke_blanked_conso 
(ES <)
 {n-	del_timer(&conso 
_timer);	/*CCan't use _sync here:Ccalled f0xm tasklet */s+	del_timer(&conso 
_timer);s 	iUR	!vt_cons[fg_conso 
] || vt_cons[fg_conso 
]->vc_mode == KD_GRAPHICS)n 		retnsi;
 	iUR	conso 
_blanked) {n@@ -2832,9 +2896,9 @@s 		op->data = temp;
 	}n s-	spin_lock_irq(&conso 
_lock);
+	acquire_conso 
_sem();s 	rc = sw->con_font_op(vc_cons[currcons].d, op);s-	spin_unlock_irq(&conso 
_lock);
+	release_conso 
_sem();s 
 	op->data = old_op.data;s 	iUR	!rc && !set) {ndiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/cyclades.c linux/drivers/char/cyclades.c
--- v2.4.9/linux/drivers/char/cyclades.c	M *CAug 27 12:41:40 2001
+++ linux/drivers/char/cyclades.c	Fri Sep 14 14:04:07 2001
@@ -1629,8 +1629,8 @@s 	       f_S performance,Rbut because of bufferCboundaries, theres 	       may be several y epsCto the operatt * */s 	    whi 
(0 < (small_count = s-		       min(unsigned int, (rx_bufsize - new_rx_get),s-		       min(unsigned int, (TTY_FLIPBUF_SIZE - tty->flip.count),Tchar_count))s+		       min_t(unsigned int, (rx_bufsize - new_rx_get),s+		       min_t(unsigned int, (TTY_FLIPBUF_SIZE - tty->flip.count),Tchar_count))s 		 )) {n 		memcpy_fromio(tty->flip.char_buf_ptr,s 			      (char *)(cinfo->base_addr
@@ -1724,9 +1724,9 @@s 	}s #ifdef BLOCKMOVEs 	whi 
(0 < (small_count = s-		   min(unsigned int, (tx_bufsize - tx_put),s-		       min(unsigned int, (SERIAL_XMIT_SIZE - info->xmit_tail),s-			   min(unsigned int, info->xmit_cnt, char_count))))) {n+		   min_t(unsigned int, (tx_bufsize - tx_put),s+		       min_t(unsigned int, (SERIAL_XMIT_SIZE - info->xmit_tail),s+			   min_t(unsigned int, info->xmit_cnt, char_count))))) {n s 	    memcpy_toio((char *)(cinfo->base_addr + tx_bufaddr + tx_put),s 			&info->xmit_buf[info->xmit_tail],s@@ -5819,3 +5819,4 @@s } /*Ccy_setnpT*/s #endiN /* MODULE */s 
+MODULE_LICENSE("GPL");sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/decserial.c linux/drivers/char/decserial.c
--- v2.4.9/linux/drivers/char/decserial.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/decserial.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,98 @@s+/*n+ *Rsercons.c
+ *RRRRRRchoose the right serial deviceCat boot time
+ *
+ *Rtriemer 6-SEP-1998
+ *RRRRRRsercons.cCisCdesigned to allow the three different kinds 
+ *RRRRRRof serial devices undeS the decstatt * world to co-exist
+ *RRRRRRin the sam
 kernel.  Thecidea here isCto abs ract 
+ *RRRRRRthe pieces of the drivers that are comm *Cto thisCfi 

+ *RRRRRRso that they do not clashCat compile time aidCruntime.
+ *
+ *RHK 16-SEP-1998 v0.002
+ *RRRRRRremoved the PROM conso 
 as thisCisCnotCa real serial
+ *RRRRRRdevice. Added support G_S PROM conso 
 in drivers/char/tty_io.c
+ *RRRRRRinstead. Although it may workCto enable more than one 
+ *RRRRRRconso 
 deviceCI s rongly recommend to use only one.
+ */n+
+#include <linux/config.h>s+#include <linux/init.h>s+#include <asm/dec/machtype.h>s+s+#iUdef CONFIG_ZS
+externTint zs_init(vS <);
+#endiNn+
+#iUdef CONFIG_DZ
+externTint dz_init(vS <);
+#endiNn+
+#iUdef CONFIG_SERIAL_CONSOLE
+s+#iUdef CONFIG_ZS
+externTES < zs_serial_conso 
_init(vS <);
+#endiNn+
+#iUdef CONFIG_DZ
+externTES < dz_serial_conso 
_init(vS <);
+#endiNn+
+#endiNn+
+/* rs_init - y  rts up the serial interface -
+   haidleCnormal case of y  rtingCup the serial interface */n+
+#iUdef CONFIG_SERIALn+
+int __init rs_init(vS <)s+{n+s+#iU defined(CONFIG_ZS) && defined(CONFIG_DZ)
+    iUR	IOASIC)s+	retnsi zs_init();
+    )lsen+	retnsi dz_init();
+#elsen+s+#iUdef CONFIG_ZS
+RRRRretnsi zs_init();
+#endiNn+
+#iUdef CONFIG_DZ
+RRRRretnsi dz_init();
+#endiNn+
+#endiNn+}
+n+__initcall(rs_init);s+
+#endiNn+
+#iUdef CONFIG_SERIAL_CONSOLE
+s+/* yerial_conso 
_init haidles the special case of y  rting
+ *RRRup the conso 
 on the serial port
+ */n+ES < __init serial_conso 
_init(vS <)s+{n+#iU defined(CONFIG_ZS) && defined(CONFIG_DZ)
+    iUR	IOASIC)s+	zs_serial_conso 
_init();
+    )lsen+	dz_serial_conso 
_init();
+#elsen+s+#iUdef CONFIG_ZS
+RRRRzs_serial_conso 
_init();
+#endiNn+
+#iUdef CONFIG_DZ
+RRRRdz_serial_conso 
_init();
+#endiNn+
+#endiNn+}
+n+#endiNndiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/drm/ati_pcigart.h linux/drivers/char/drm/ati_pcigart.h
--- v2.4.9/linux/drivers/char/drm/ati_pcigart.h	M *CAug 27 12:41:40 2001
+++ linux/drivers/char/drm/ati_pcigart.h	Fri Sep 21 22:39:19 2001
@@ -72,8 +72,6 @@s 	int i;
 	DRM_DEBUG( "%s\n", __FUNCTION__ );s 
-	iUR	 !address ) retnsi;
-s 	page = virt_to_page( address );s 
 	G_S ( i = 0 ; i <= ATI_PCIGART_TABLE_PAGES ; i++, page++ ) {n@@ -84,23 +82,40 @@s 	free_pages( address, ATI_PCIGART_TABLE_ORDER );s }s s-unsigned long DRM(ati_pcigart_init)( drm_device_t *dev )
+int DRM(ati_pcigart_init)( drm_device_t *dev,s+			   unsigned long *addr,s+			   dma_addr_t *bus_addr)
 {n 	drm_sg_mem_t *entry = dev->sg;n-	unsigned long address;
+	unsigned long address = 0;s 	unsigned long pages;
-	u32 *pci_gart, page_base;
-	int i, j;
+	u32 *pci_gart, page_base,Rbus_address = 0;s+	int i, j, ret = 0;s s 	iUR	 !entry ) {n 		DRM_ERROR( "no scatter/gatheS memory!\n" );s-		retnsi 0;s+		goto done;s 	}s 
 	address = DRM(ati_alloc_pcigart_table)();s 	iUR	 !address ) {n 		DRM_ERROR( "cannotCalloc pe PCI GART page!\n" );s-		retnsi 0;s+		goto done;s+	}
+n+	iUR	 !dev->pdev ) {n+		DRM_ERROR( "PCI deviceCunknown!\n" );s+		goto done;s+	}
+n+	bus_address = pci_map_sing 
(dev->pdev, (ES < *)address,s+				  ATI_PCIGART_TABLE_PAGES * PAGE_SIZE,s+				  PCI_DMA_TODEVICE);
+	iUR	bus_address == 0) {n+		DRM_ERROR( "unable to map PCIGART pages!\n" );s+		DRM(ati_free_pcigart_table)( address );s+		address = 0;s+		goto done;s 	}s 
 	pci_gart = (u32 *)address;
@@ -111,28 +126,72 @@s 	memset( pci_gart, 0, ATI_MAX_PCIGART_PAGES * sizeof(u32) );s 
 	G_S ( i = 0 ; i < pages ; i++ ) {n-		page_base = page_to_bus( entry->pagelist[i] );s+		/* we need to support large memory configuratt *sC*/s+		entry->busaddr[i] = pci_map_sing 
(dev->pdev,n+					   page_address	 entry->pagelist[i] ),n+					   PAGE_SIZE,s+					   PCI_DMA_TODEVICE);
+		iUR	entry->busaddr[i] == 0) {n+			DRM_ERROR( "unable to map PCIGART pages!\n" );s+			DRM(ati_pcigart_cleanup)( dev, address, bus_address );n+			address = 0;s+			bus_address = 0;s+			goto done;s+		}s+		page_base = (u32) entry->busaddr[i];
+s 		G_S (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) {n 			*pci_gart++ = cpu_to_le32( page_base );s 			page_base += ATI_PCIGART_PAGE_SIZE;s 		}s 	}n s-#iU __i386__s+	ret = 1;n+s+#iU defined(__i386__) || defined(__x86_64__)
 	asm ESl pF 
 ( "wbinvd" ::: "memory" );s #elsen 	mb();s #endiNn 
-	retnsi address;
+done:s+	*addr = address;
+	*bus_addr = bus_address;s+	retnsi ret;s }
 o-int DRM(ati_pcigart_cleanup)( unsigned long address )
+int DRM(ati_pcigart_cleanup)( drm_device_t *dev,s+			      unsigned long addr,s+			      dma_addr_t bus_addr)
 {n+	drm_sg_mem_t *entry = dev->sg;n+	unsigned long pages;
+	int i;
 
-	iUR	 address ) {n-		DRM(ati_free_pcigart_table)( address );s+	/* we need to support large memory configuratt *sC*/s+	iUR	 !entry ) {n+		DRM_ERROR( "no scatter/gatheS memory!\n" );s+		retnsi 0;s+	}
+n+	iUR	 bus_addr ) {n+		pci_unmap_sing 
(dev->pdev, bus_addr,s+				 ATI_PCIGART_TABLE_PAGES * PAGE_SIZE,s+				 PCI_DMA_TODEVICE);
+s+		pages = 	 entry->pages <= ATI_MAX_PCIGART_PAGES )s+		        ? entry->pages : ATI_MAX_PCIGART_PAGES;
+s+		G_S ( i = 0 ; i < pages ; i++ ) {n+			iUR	 !entry->busaddr[i] ) break;s+			pci_unmap_sing 
(dev->pdev, entry->busaddr[i],s+					 PAGE_SIZE, PCI_DMA_TODEVICE);
+		}s+	}
+n+	iUR	 addr ) {n+		DRM(ati_free_pcigart_table)( addr );s 	}o n-	retnsi 0;s+	retnsi 1;s }
diff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/drm/drmP.h linux/drivers/char/drm/drmP.h
--- v2.4.9/linux/drivers/char/drm/drmP.h	Sun Aug 12 13:27:59 2001
+++ linux/drivers/char/drm/drmP.h	Fri Sep 21 22:39:19 2001
@@ -76,6 +76,17 @@s #include <asm/pgalloc.h>s #include "drm.h"s 
+/*Rpage_to_bus G_S earlieS kernels,CnotCoptimal inCall casesC*/s+#iUndef page_to_buss+#define page_to_bus(page)	((unsigned int)(virt_to_bus(page_address	page))))
+#endiNn+
+/* We just use virt_to_bus f_S pci_map_sing 
 on oldeS kernelsC*/s+#iU LINUX_VERSION_CODE < 0x020400
+#define pci_map_sing 
(hwdev, ptr,Tsize, directt *)	virt_to_bus(ptr)s+#define pci_unmap_sing 
(hwdev, dma_addr,Tsize, directt *)
+#endiNn+
 /* DRM templ pe customizatt * defaults
  */s #iUndef __HAVE_AGPs@@ -616,6 +627,8 @@s 	int                acquired;s 	unsigned long      base;
    	int 		   agp_mtrr;
+	int		   cant_use_aperture;n+	unsigned long	   page_mask;s } drm_agp_head_t;s #endiNn 
@@ -624,6 +637,7 @@s 	ES <            *virtual;s 	int             pages;
 	s ruct page     **pagelist;n+	dma_addr_t	*busaddr;n } drm_sg_mem_t;s 
 typedef s ruct drm_sigdata {n@@ -714,6 +728,7 @@s #iU __REALLY_HAVE_AGPs 	drm_agp_head_t    *agp;s #endiNn+	s ruct pci_dev *pdev;s #ifdef __alpha__s #iU LINUX_VERSION_CODE < 0x020403
 	s ruct pci_controleS *hose;
@@ -1018,8 +1033,12 @@s #endiNn 
                                /* ATI PCIGART support (ati_pcigart.h) */s-externTunsigned long  DRM(ati_pcigart_init)(drm_device_t *dev);s-externTint            DRM(ati_pcigart_cleanup)(unsigned long address);
+externTint            DRM(ati_pcigart_init)(drm_device_t *dev,s+					    unsigned long *addr,s+					    dma_addr_t *bus_addr);
+externTint            DRM(ati_pcigart_cleanup)(drm_device_t *dev,s+					       unsigned long addr,s+					       dma_addr_t bus_addr);s 
 #endiN /* __KERNEL__T*/s #endiN
diff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/drm/drm_agpsupport.h linux/drivers/char/drm/drm_agpsupport.h
--- v2.4.9/linux/drivers/char/drm/drm_agpsupport.h	Sun Aug 12 13:27:59 2001
+++ linux/drivers/char/drm/drm_agpsupport.h	Fri Sep 21 22:39:19 2001
@@ -316,6 +316,14 @@s s 		default:		head->chipset = "Unknown";       break;s 		}s+#iU LINUX_VERSION_CODE <= 0x020408s+		head->cant_use_aperture = 0;s+		head->page_mask = ~(0xfff);
+#elsen+		head->cant_use_aperture = head->agp_info.cant_use_aperture;n+		head->page_mask = head->agp_info.page_mask;s+#endiNn+
 		DRM_INFO("AGP %d.%d on %s @ 0x%08lx %ZuMB\n",s 			 head->agp_info.verst *.major,s 			 head->agp_info.verst *.minor,
diff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/drm/drm_context.h linux/drivers/char/drm/drm_context.h
--- v2.4.9/linux/drivers/char/drm/drm_context.h	M *CAug 27 12:41:40 2001
+++ linux/drivers/char/drm/drm_context.h	Fri Sep 21 22:39:19 2001
@@ -181,7 +181,7 @@s 	drm_device_t	*dev	= priv->dev;s 	drm_ctx_priv_map_t request;s 	drm_map_t *map = NULL;s-	drm_map_list_t *r_list;n+	drm_map_list_t *r_list = NULL;s 	s ruct list_head *list;n s 	iUR	copy_from_user(&request,
diff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/drm/drm_drv.h linux/drivers/char/drm/drm_drv.h
--- v2.4.9/linux/drivers/char/drm/drm_drv.h	Sun Aug 12 13:27:59 2001
+++ linux/drivers/char/drm/drm_drv.h	Fri Sep 14 14:04:07 2001
@@ -234,6 +234,7 @@s MODULE_AUTHOR( DRIVER_AUTHOR );s MODULE_DESCRIPTION( DRIVER_DESC );s MODULE_PARM( drm_opts,C"s" );s+MODULE_LICENSE("GPL aidCadditt *al rights");s n y  pF Tint DRM(setnp)( drm_device_t *dev )
 {ndiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/drm/drm_ioctl.h linux/drivers/char/drm/drm_ioctl.h
--- v2.4.9/linux/drivers/char/drm/drm_ioctl.h	Sun Aug 12 13:27:59 2001
+++ linux/drivers/char/drm/drm_ioctl.h	Fri Sep 21 22:39:19 2001
@@ -98,7 +98,6 @@s 	}s 	sprintf(dev->devname, "%s@%s", dev->name, dev->unique);s n-#ifdef __alpha__s 	do {n 		s ruct pci_dev *pci_dev;
                 int b, d, f;s@@ -114,10 +113,13 @@s                 iUR	*p) break;s  
                 pci_dev = pci_find_slot(b, PCI_DEVFN(d,f));
-                iUR	pci_dev)
-                        dev->hose = pci_dev->sysdata;s-        } whi 
(0);
+                iUR	pci_dev) {n+			dev->pdev = pci_dev;
+#iUdef __alpha__s+			dev->hose = pci_dev->sysdata;s #endiNn+		}s+        } whi 
(0);
 s 	retnsi 0;s }sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/drm/drm_scatter.h linux/drivers/char/drm/drm_scatter.h
--- v2.4.9/linux/drivers/char/drm/drm_scatter.h	M *CAug 27 12:41:40 2001
+++ linux/drivers/char/drm/drm_scatter.h	Fri Sep 21 22:39:19 2001
@@ -47,12 +47,15 @@s 
 	vfree( entry->virtual );s 
+	DRM(free)( entry->busaddr,s+		   entry->pages * sizeof(*entry->busaddr),s+		   DRM_MEM_PAGES );
 	DRM(free)( entry->pagelist,s-		  entry->pages * sizeof(*entry->pagelist),s-		  DRM_MEM_PAGES );
+		   entry->pages * sizeof(*entry->pagelist),s+		   DRM_MEM_PAGES );
 	DRM(free)( entry,s-		  sizeof(*entry),s-		  DRM_MEM_SGLISTS );
+		   sizeof(*entry),s+		   DRM_MEM_SGLISTS );
 }s s int DRM(sg_alloc)( s ruct inode *inode, s ruct fi 
 *fi p,s@@ -93,16 +96,31 @@s 		DRM(free)( entry, sizeof(*entry), DRM_MEM_SGLISTS );
 		retnsi -ENOMEM;
 	}s-	memset(entry->pagelist, 0, pages * sizeof(*entry->pagelist));
+s+	entry->busaddr = DRM(alloc)( pages * sizeof(*entry->busaddr),s+				     DRM_MEM_PAGES );
+	iUR	 !entry->busaddr ) {n+		DRM(free)( entry->pagelist,s+			   entry->pages * sizeof(*entry->pagelist),s+			   DRM_MEM_PAGES );
+		DRM(free)( entry,s+			   sizeof(*entry),s+			   DRM_MEM_SGLISTS );
+		retnsi -ENOMEM;
+	}s+	memset( (ES < *)entry->busaddr, 0, pages * sizeof(*entry->busaddr) );s 
 	entry->virtual = vmalloc_32( pages << PAGE_SHIFT );s 	iUR	 !entry->virtual ) {n+		DRM(free)( entry->busaddr,s+			   entry->pages * sizeof(*entry->busaddr),s+			   DRM_MEM_PAGES );
 		DRM(free)( entry->pagelist,s-			  entry->pages * sizeof(*entry->pagelist),s-			  DRM_MEM_PAGES );
+			   entry->pages * sizeof(*entry->pagelist),s+			   DRM_MEM_PAGES );
 		DRM(free)( entry,s-			  sizeof(*entry),s-			  DRM_MEM_SGLISTS );
+			   sizeof(*entry),s+			   DRM_MEM_SGLISTS );
 		retnsi -ENOMEM;
 	}s sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/drm/drm_vm.h linux/drivers/char/drm/drm_vm.h
--- v2.4.9/linux/drivers/char/drm/drm_vm.h	M *CAug 27 12:41:40 2001
+++ linux/drivers/char/drm/drm_vm.h	Fri Sep 21 22:39:19 2001
@@ -67,6 +67,70 @@s 			    int write_access)s #endiNn {n+#iU __REALLY_HAVE_AGPs+	drm_fi 
_t *priv  = vma->vm_fi 
->private_data;s+	drm_device_t *dev = priv->dev;s+	drm_map_t *map    = NULL;s+	drm_map_list_t  *r_list;n+	s ruct list_head *list;n+s+	/*
+         * Find the right map
+         */
+n+	iU(!dev->agp->cant_use_aperture) goto vm_nopage_error;n+s+	list_for_each(list, &dev->maplist->head) {n+		r_list = (drm_map_list_t *)list;n+		map = r_list->map;
+		iUR	!map)Rcontinue;
+		iUR	map->offset == VM_OFFSET(vma)) break;s+	}
+n+	iUR	map && map->type == _DRM_AGP) {n+		unsigned long offset = address - vma->vm_y  rt;n+		unsigned long baddr = VM_OFFSET(vma) + offset;
+		s ruct drm_agp_mem *agpmem;
+		s ruct page *page;n+s+#iU __alpha__s+		/*
+                 * Adjust to a bus-rel pive address
+                 */s+		baddr -= dev->hose->mem_ypace->s  rt;n+#endiNn+
+		/*
+                 * It's AGP memory - find the real physical page to map
+                 */s+		for(agpmem = dev->agp->memory; agpmem; agpmem = agpmem->next) {n+			iUR	agpmem->bound <= baddr &&s+			    agpmem->bound + agpmem->pages * PAGE_SIZE > baddr) s+				break;s+		}
+n+		iUR	!agpmem) goto vm_nopage_error;n+s+		/*
+                 * Get the page, inc the use count, aidCretnsi it
+                 */s+		offset = (baddr - agpmem->bound) >> PAGE_SHIFT;s+		agpmem->memory->memory[offset] &= dev->agp->page_mask;s+		page = virt_to_page(__va(agpmem->memory->memory[offset]));s+		get_page(page);n+s+		DRM_DEBUG("baddr = 0x%lx page = 0x%p, offset = 0x%lx\n",s+			  baddr, __va(agpmem->memory->memory[offset]), offset);n+s+#iU LINUX_VERSION_CODE < 0x020317
+		retnsi page_address	page);
+#elsen+		retnsi page;n+#endiNn+        }
+vm_nopage_error:n+#endiN /* __REALLY_HAVE_AGP */n+
 	retnsi NOPAGE_SIGBUS;		/*CDisallow mremapT*/s }s n@@ -220,24 +284,27 @@s 	drm_fi 
_t	 *priv	 = vma->vm_fi 
->private_data;s 	drm_device_t	 *dev	 = priv->dev;s 	drm_device_dma_t *dma	 = dev->dma;n-	unsigned long	 physical;s 	unsigned long	 offset;
-	unsigned long	 page;n+	unsigned long	 page_nr;
+	s ruct page	 *page;n s 	iUR	!dma)		   retnsi NOPAGE_SIGBUS; /* Error */s 	iUR	address > vma->vm_end) retnsi NOPAGE_SIGBUS; /* Disallow mremapT*/s 	iUR	!dma->pagelist)	   retnsi NOPAGE_OOM ; /* NothingCalloc ped */s 
 	offset	 = address - vma->vm_y  rt; /* vm_[pg]off[set] should be 0 */s-	page	 = offset >> PAGE_SHIFT;s-	physical = dma->pagelist[page] + (offset & (~PAGE_MASK));
-	atomic_inc(&virt_to_page(physical)->count); /* Dec. by kernel */s+	page_nr  = offset >> PAGE_SHIFT;s+	page = virt_to_page((dma->pagelist[page_nr] + s+			     (offset & (~PAGE_MASK))));s 
-	DRM_DEBUG("0x%08lx 	page %lu) => 0x%08lx\n", address, page, physical);s+	get_page(page);n+s+	DRM_DEBUG("0x%08lx 	page %lu) => 0x%08x\n", address, page_nr, s+		  page_to_bus(page));s #iU LINUX_VERSION_CODE < 0x020317
-	retnsi physical;s+	retnsi page_address	page);
 #elsen-	retnsi virt_to_page(physical);s+	retnsi page;s #endiNn }s n@@ -274,10 +341,10 @@s 	map_offset = map->offset - dev->sg->haidle;s 	page_offset = (offset >> PAGE_SHIFT) + (map_offset >> PAGE_SHIFT);s 	page = entry->pagelist[page_offset];
-	atomic_inc(&page->count);                       /* Dec. by kernel */s+	get_page(page);n s #iU LINUX_VERSION_CODE < 0x020317
-	retnsi (unsigned long)virt_to_phys(page->virtual);s+	retnsi page_address	page);
 #elsen 	retnsi page;s #endiNn@@ -435,9 +502,20 @@s 	}s s 	switch (map->type) {n+        case _DRM_AGP:s+#iU defined(__alpha__)
+                /*
+                 * O*CAlpha we can't talkCto bus dma address f0xm the
+                 * CPU, so f_S memory of type DRM_AGP, we'll deal with
+                 * sorting out the real physical pages aidCmappings
+                 * in nopage()
+                 */s+                vma->vm_ops = &DRM(vm_ops);
+                break;s+#endiNn+                /* fall through to _DRM_FRAME_BUFFER... */        n 	case _DRM_FRAME_BUFFER:n 	case _DRM_REGISTERS:
-	case _DRM_AGP:s 		iUR	VM_OFFSET(vma) >= __pa(high_memory)) {n #iU defined(__i386__)s 			iUR	boot_cpu_data.x86 > 3 && map->type != _DRM_AGP) {ndiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/drm/mga_drv.h linux/drivers/char/drm/mga_drv.h
--- v2.4.9/linux/drivers/char/drm/mga_drv.h	Sun Aug 12 13:27:59 2001
+++ linux/drivers/char/drm/mga_drv.h	M *CAug 27 07:40:33 2001
@@ -145,14 +145,28 @@s #define mga_flush_write_combine()	mb()s s 
-#define MGA_BASE( reg )		((u32)(dev_priv->mmio->haidle))s+#define MGA_BASE( reg )		((unsigned long)(dev_priv->mmio->haidle))s #define MGA_ADDR( reg )		(MGA_BASE(reg) + reg)n s #define MGA_DEREF( reg )	*(ESl pF 
 u32 *)MGA_ADDR( reg )s+#define MGA_DEREF8( reg )	*(ESl pF 
 u8 *)MGA_ADDR( reg )s+
+#iUdef __alpha__s+#define MGA_READ( reg )		(_MGA_READ((u32 *)MGA_ADDR(reg)))s+#define MGA_WRITE( reg, val )	do { wmb(); MGA_DEREF( reg ) = val; } whi 
 (0)s+#define MGA_WRITE8( reg, val )  do { wmb(); MGA_DEREF8( reg ) = val; } whi 
 (0)s+s+y  pF Tinline u32 _MGA_READ(u32 *addr)
+{n+	mb();s+	retnsi *(ESl pF 
 u32 *)addr;n+}
+n+#elsen #define MGA_READ( reg )		MGA_DEREF( reg )n #define MGA_WRITE( reg, val )	do { MGA_DEREF( reg ) = val; } whi 
 (0)s-#define MGA_DEREF8( reg )	*(ESl pF 
 u8 *)MGA_ADDR( reg )s #define MGA_WRITE8( reg, val )  do { MGA_DEREF8( reg ) = val; } whi 
 (0)s+#endiNn 
 #define DWGREG0 	0x1c00
 #define DWGREG0_END 	0x1dfN
diff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/drm/r128_cc
.c linux/drivers/char/drm/r128_cc
.c
--- v2.4.9/linux/drivers/char/drm/r128_cc
.c	M *CAug 27 12:41:40 2001
+++ linux/drivers/char/drm/r128_cc
.c	M *CAug 27 07:40:33 2001
@@ -351,11 +351,10 @@s 		page_ofs = tmp_ofs >> PAGE_SHIFT;s s 		R128_WRITE( R128_PM4_BUFFER_DL_RPTR_ADDR,s-			    page_to_bus(entry->pagelist[page_ofs]));s-n-		DRM_DEBUG( "ringCrptr: offset=0x%08lx haidle=0x%08lx\n",s-			   page_to_bus(entry->pagelist[page_ofs]),s-			   entry->haidleC+ tmp_ofs );
+     			    entry->busaddr[page_ofs]);s+		DRM_DEBUG( "ringCrptr: offset=0x%08x haidle=0x%08lx\n",s+			   entry->busaddr[page_ofs],
+     			   entry->haidleC+ tmp_ofs );
 	}s s 	/* Set watermark control */s@@ -599,15 +598,14 @@s 		    dev_priv->sarea_priv->last_dispatch );s 
 	iUR	 dev_priv->is_pci ) {n-		dev_priv->phys_pci_gart = DRM(ati_pcigart_init)( dev );s-		iUR	 !dev_priv->phys_pci_gart ) {n+		iUR	!DRM(ati_pcigart_init)( dev, &dev_priv->phys_pci_gart,
+     					    &dev_priv->bus_pci_gart) ) {n 			DRM_ERROR( "failed to init PCI GART!\n" );s 			dev->dev_priv pe = (ES < *)dev_priv;s 			r128_do_cleanup_cc
( dev );s 			retnsi -ENOMEM;
 		}s-		R128_WRITE( R128_PCI_GART_PAGE,s-			    virt_to_bus( (ES < *)dev_priv->phys_pci_gart ) );s+		R128_WRITE( R128_PCI_GART_PAGE, dev_priv->bus_pci_gart );
 	}s s 	r128_cc
_init_ring_buffer( dev, dev_priv );s@@ -629,6 +627,11 @@s 			DRM_IOREMAPFREE	 dev_priv->cc
_ringC);s 			DRM_IOREMAPFREE	 dev_priv->ring_rptrC);s 			DRM_IOREMAPFREE	 dev_priv->buffers );n+		} )lse {n+			iUR	!DRM(ati_pcigart_cleanup)( dev,s+						dev_priv->phys_pci_gart,
+						dev_priv->bus_pci_gart ))n+				DRM_ERROR( "failed to cleanup PCI GART!\n" );s 		}s s 		DRM(free)( dev->dev_priv pe, sizeof(drm_r128_private_t),sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/drm/r128_drv.h linux/drivers/char/drm/r128_drv.h
--- v2.4.9/linux/drivers/char/drm/r128_drv.h	Sun Aug 12 13:27:59 2001
+++ linux/drivers/char/drm/r128_drv.h	M *CAug 27 07:40:33 2001
@@ -72,6 +72,7 @@s 	int usec_timeout;s 	int is_pci;s 	unsigned long phys_pci_gart;n+	dma_addr_t bus_pci_gart;s 	unsigned long cc
_buffers_offset;
 
 	atomic_t idle_count;sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/drm/radeon_cp.c linux/drivers/char/drm/radeon_cp.c
--- v2.4.9/linux/drivers/char/drm/radeon_cp.c	M *CAug 27 12:41:40 2001
+++ linux/drivers/char/drm/radeon_cp.c	Fri Sep 14 14:29:41 2001
@@ -543,8 +543,7 @@s 						RADEON_SOFT_RESET_RE |s 						RADEON_SOFT_RESET_PP |s 						RADEON_SOFT_RESET_E2 |s-						RADEON_SOFT_RESET_RB |s-						RADEON_SOFT_RESET_HDP ) );s+						RADEON_SOFT_RESET_RB ) );s 	RADEON_READ( RADEON_RBBM_SOFT_RESET );s 	RADEON_WRITE( RADEON_RBBM_SOFT_RESET,R	 rbbm_soft_reset &s 						~( RADEON_SOFT_RESET_CP |s@@ -553,8 +552,7 @@s 						   RADEON_SOFT_RESET_RE |s 						   RADEON_SOFT_RESET_PP |s 						   RADEON_SOFT_RESET_E2 |s-						   RADEON_SOFT_RESET_RB |s-						   RADEON_SOFT_RESET_HDP ) ) );s+						   RADEON_SOFT_RESET_RB ) ) );s 	RADEON_READ( RADEON_RBBM_SOFT_RESET );s n 
@@ -624,10 +622,9 @@s 		page_ofs = tmp_ofs >> PAGE_SHIFT;s s 		RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR,s-			      page_to_bus(entry->pagelist[page_ofs]));s-n+			     entry->busaddr[page_ofs]);s 		DRM_DEBUG( "ringCrptr: offset=0x%08x haidle=0x%08lx\n",s-			   page_to_bus(entry->pagelist[page_ofs]),s+			   entry->busaddr[page_ofs],
 			   entry->haidleC+ tmp_ofs );
 	}s s@@ -929,8 +926,8 @@s 		      dev_priv->sarea_priv->last_clear );s 
 	iUR	 dev_priv->is_pci ) {n-		dev_priv->phys_pci_gart = DRM(ati_pcigart_init)( dev );s-		iUR	 !dev_priv->phys_pci_gart ) {n+		iUR	!DRM(ati_pcigart_init)( dev, &dev_priv->phys_pci_gart,
+					    &dev_priv->bus_pci_gart)) {n 			DRM_ERROR( "failed to init PCI GART!\n" );s 			dev->dev_priv pe = (ES < *)dev_priv;s 			radeon_do_cleanup_cp(dev);s@@ -944,8 +941,7 @@s 
 		/* yet PCI GART page-table base address
 		 */s-		RADEON_WRITE( RADEON_AIC_PT_BASE,s-			      virt_to_bus( (ES < *)dev_priv->phys_pci_gart ) );s+		RADEON_WRITE( RADEON_AIC_PT_BASE, dev_priv->bus_pci_gart );
 
 		/* yet address range G_S PCI address transl pe
 		 */s@@ -990,6 +986,11 @@s 			DRM_IOREMAPFREE	 dev_priv->cp_ringC);s 			DRM_IOREMAPFREE	 dev_priv->ring_rptrC);s 			DRM_IOREMAPFREE	 dev_priv->buffers );n+		} )lse {n+			iUR	!DRM(ati_pcigart_cleanup)( dev,s+						dev_priv->phys_pci_gart,
+						dev_priv->bus_pci_gart ))n+				DRM_ERROR( "failed to cleanup PCI GART!\n" );s 		}s s 		DRM(free)( dev->dev_priv pe, sizeof(drm_radeon_private_t),sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/drm/radeon_drv.h linux/drivers/char/drm/radeon_drv.h
--- v2.4.9/linux/drivers/char/drm/radeon_drv.h	Sun Aug 12 13:27:59 2001
+++ linux/drivers/char/drm/radeon_drv.h	M *CAug 27 07:40:33 2001
@@ -84,6 +84,7 @@s 	int usec_timeout;s 	int is_pci;s 	unsigned long phys_pci_gart;n+	dma_addr_t bus_pci_gart;s 
 	atomic_t idle_count;s sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/drm/tdfx_drv.c linux/drivers/char/drm/tdfx_drv.c
--- v2.4.9/linux/drivers/char/drm/tdfx_drv.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/char/drm/tdfx_drv.c	M *CAug 27 07:40:33 2001
@@ -44,13 +44,30 @@s #define DRIVER_MINOR		0s #define DRIVER_PATCHLEVEL	0s s+#iUndef PCI_VENDOR_ID_3DFXs+#define PCI_VENDOR_ID_3DFX 0x121As+#endiNn #iUndef PCI_DEVICE_ID_3DFX_VOODOO5s #define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009s #endiNn+#iUndef PCI_DEVICE_ID_3DFX_VOODOO4s+#define PCI_DEVICE_ID_3DFX_VOODOO4 0x0007s+#endiNn+#iUndef PCI_DEVICE_ID_3DFX_VOODOO3_3000 /* Voodoo3 3000 */s+#define PCI_DEVICE_ID_3DFX_VOODOO3_3000 0x0005s+#endiNn+#iUndef PCI_DEVICE_ID_3DFX_VOODOO3_2000 /* Voodoo3 3000 */s+#define PCI_DEVICE_ID_3DFX_VOODOO3_2000 0x0004s+#endiNn+#iUndef PCI_DEVICE_ID_3DFX_BANSHEEs+#define PCI_DEVICE_ID_3DFX_BANSHEE 0x0003s+#endiNn 
 y  pF Tdrm_pci_list_t DRM(idlist)[] = {n 	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_BANSHEE },s-	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO3 },s+	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO3_2000 },s+	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO3_3000 },s+	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO4 },s 	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO5 },s 	{ 0, 0 }
 };sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/ds1620.c linux/drivers/char/ds1620.c
--- v2.4.9/linux/drivers/char/ds1620.c	Sun Aug 13 09:54:15 2000
+++ linux/drivers/char/ds1620.c	Thu Sep 13 15:21:32 2001
@@ -410,3 +410,5 @@s 
 module_init(ds1620_init);s module_exit(ds1620_exit);n+s+MODULE_LICENSE("GPL");sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/dsp56k.c linux/drivers/char/dsp56k.c
--- v2.4.9/linux/drivers/char/dsp56k.c	M *CAug 27 12:41:40 2001
+++ linux/drivers/char/dsp56k.c	M *CSep 10 08:06:32 2001
@@ -69,7 +69,7 @@s { \s 	long i, t, m; \s 	whi 
 (count > 0) { \s-		m = min(unsigned long, count, maxio); \s+		m = min_t(unsigned long, count, maxio); \s 		G_S (i = 0; i < m; i++) { \s 			G_S (t = 0; t < timeout && !ENABLE; t++) \s 				wait_some(HZ/50); \s@@ -502,7 +502,7 @@s 
 y  pF Tdevfs_haidle_t devfs_haidle;s 
-y  pF Tconst char banner[] __initdata = KERN_INFO "DSP56k driverRinstalled\n";s+y  pF Tchar banner[] __initdata = KERN_INFO "DSP56k driverRinstalled\n";s n y  pF Tint __init dsp56k_init_driver(ES <)
 {n@@ -531,3 +531,5 @@s 	devfs_unregister(devfs_haidle);
 }s module_exit(dsp56k_cleanup_driver);s+s+MODULE_LICENSE("GPL");sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/dtlk.c linux/drivers/char/dtlk.c
--- v2.4.9/linux/drivers/char/dtlk.c	Wed Jul 25 17:10:19 2001
+++ linux/drivers/char/dtlk.c	Thu Sep 13 15:21:32 2001
@@ -678,3 +678,5 @@s #endiNn 	retnsi 0;s }s+s+MODULE_LICENSE("GPL");sdiff -u --recurstve --new-fi 
 v2.4.9/linux/drivers/char/dz.c linux/drivers/char/dz.c
--- v2.4.9/linux/drivers/char/dz.c	M *CAug 27 12:41:40 2001
+++ linux/drivers/char/dz.c	Sun Sep  9 10:43:02 2001
@@ -21,15 +21,10 @@s  * [07-SEP-99] Bugfixes 
  */s 
-#define DEBUG_DZ 1
+/* #define DEBUG_DZ 1 */s 
-#iUdef MODULE
-#include <linux/module.h>s #include <linux/verst *.h>s-#elsen-#define MOD_INC_USE_COUNTn-#define MOD_DEC_USE_COUNTn-#endiNn+#include <linux/module.h>s s #include <linux/config.h>s #include <linux/kernel.h>s@@ -41,9 +36,10 @@s #include <linux/param.h>s #include <linux/tqueue.h>s #include <linux/interrupt.h>s+#include <linux/serial.h>s+#include <linux/serialP.h>s #include <asm-mips/wbflush.h>s-/* f_S definitt * of SERIAL */s-#include <asm/dec/interrupts.h>s+#include <asm/dec/interrupts.h>			/* f_S definitt * of SERIAL */s o /* f_S definitt * of s ruct conso 
 */s #ifdef CONFIG_SERIAL_CONSOLE
@@ -91,13 +87,13 @@s  */n y  pF TES < debug_conso 
( const char *s,int count)
 {n-    unsigned i;n+	unsigned i;
 
-    f_S (i = 0; i < count; i++) {s-       iUR	*s == 10)
-           prom_printf("%c", 13);
-       prom_printf("%c", *s++);
-    }s+	f_S (i = 0; i < count; i++) {s+		iUR	*s == 10)
+			prom_printf("%c", 13);
+		prom_printf("%c", *s++);
+	}
 }s #endiNn 
@@ -112,16 +108,16 @@s 
 y  pF Tinline unsigned short dz_in (s ruct dz_serial *info,Tunsigned offset)
 {n-  ESl pF 
 unsigned short *addr = (ESl pF 
 unsigned short *)(info->port + offset);n-  retnsi *addr;n+	ESl pF 
 u16 *addr = (ESl pF 
 u16 *)(info->port + offset);n+s+	retnsi *addr;n }s 
-y  pF Tinline ES < dz_out (s ruct dz_serial *info,Tunsigned offset, unsigned short value)s+y  pF Tinline ES < dz_out (s ruct dz_serial *info,Tunsigned offset,
+                           unsigned short value)s {n-
-    ESl pF 
 unsigned short *addr = (ESl pF 
 unsigned short *)(info->port + offset);n-  *addr = value;s-n+	ESl pF 
 u16 *addr = (ESl pF 
 u16 *)(info->port + offset);n+	*addr = value;s }
 o /*
@@ -136,33 +132,32 @@s 
 y  pF TES < dz_stop (s ruct tty_s ruct *tty)
 {n-  s ruct dz_serial *info; 
-  unsigned short mask, tmp;
+	s ruct dz_serial *info; 
+	unsigned short mask, tmp;
 
-  iUR	tty==0) 
-    retnsi; 
+	iUR	!tty) s+		retnsi; 
  
-  info = (s ruct dz_serial *)tty->driver_data; 
-         
-  mask = 1 << info->line;n-  tmp = dz_in (info,TDZ_TCR);       /* read the TX flag */s-
-    tmp &= ~mask;                   /* clear the TX flag */s-RRRRdz_out (info,TDZ_TCR, tmp);n-}  
+	info = (s ruct dz_serial *)tty->driver_data; 
+s+	mask = 1 << info->line;n+	tmp = dz_in (info,TDZ_TCR);       /* read the TX flag */s+n+	tmp &= ~mask;                   /* clear the TX flag */s+	dz_out (info,TDZ_TCR, tmp);n+}s 
 y  pF TES < dz_start (s ruct tty_s ruct *tty)
 {n-  s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
-  unsigned short mask, tmp;
-
-  mask = 1 << info->line;n-  tmp = dz_in (info,TDZ_TCR);      /* read the TX flag */s+	s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
+	unsigned short mask, tmp;
 
-    tmp |= mask;                   /* set the TX flag */s-RRRRdz_out (info,TDZ_TCR, tmp);n+	mask = 1 << info->line;n+	tmp = dz_in (info,TDZ_TCR);      /* read the TX flag */s n-}  
+	tmp |= mask;                   /* set the TX flag */s+	dz_out (info,TDZ_TCR, tmp);n+}s 
 /*
  * ------------------------------------------------------------
@@ -194,9 +189,9 @@s  */n y  pF Tinline ES < dz_sched_event (s ruct dz_serial *info,Tint event)
 {n-  info->event |= 1 << event;n-  queue_task (&info->tqueue, &tq_serial);n-  mark_bh (SERIAL_BH);
+	info->event |= 1 << event;n+	queue_task(&info->tqueue, &tq_serial);n+	mark_bh(SERIAL_BH);
 }
 o /*
@@ -208,98 +203,101 @@s  */n y  pF Tinline ES < receive_chars (s ruct dz_serial *info_in)
 {n+	s ruct dz_serial *info;n+	s ruct tty_s ruct *tty = 0;s+	s ruct async_icount *icount;s+	int ignore = 0;s+	unsigned short y  pus, tmp;
+	unsigned char ch;
 
-  s ruct dz_serial *info;n-  s ruct tty_s ruct *tty = 0;s-  s ruct async_icount *icount;s-  int ignore = 0;s-  unsigned short y  pus, tmp;
-  unsigned char ch;
-
-  /* thisCcode isCgoingCto be a problem...
-     the call to tty_flip_buffer isCgoingCto need
-     to be rethought...
-   */s-RRdo
-    {s-      y  pus = dz_in (info_in,TDZ_RBUF);
-      info = lines[LINE(y  pus)];s-
-      /* punt so we don't get duplic pe characters */s-RRRR  iUR	!(y  pus &TDZ_DVAL))
-        goto ignore_char;s-n+	/*
+	 *RThisCcode isCgoingCto be a problem...  the call to tty_flip_buffer
+	 *RisCgoingCto need to be rethought...
+	 */s+	do {s+		y  pus = dz_in (info_in,TDZ_RBUF);
+		info = lines[LINE(y  pus)];s+s+		/* punt so we don't get duplic pe characters */s+		iUR	!(y  pus &TDZ_DVAL))
+			goto ignore_char;s 
-    ch = UCHAR(y  pus);                /* grab the char */s+		ch = UCHAR(y  pus);			/* grab the char */s s #iU 0
-    iUR	info->is_conso 
) {s-      iUR	ch == 0) retnsi;            /* it's a break ... */s+		iUR	info->is_conso 
) {s+			iUR	ch == 0)n+				retnsi;			/* it's a break ... */s 
-      wake_up (&keypress_wait);       /* ItCisCa 'keyboard interrupt' ;-) */s-RRRR}s+			wake_up (&keypress_wait);       /* ItCisCa 'keyboard interrupt' ;-) */s+		}
 #endiNn 
-    tty = info->tty;                  /* now tty pointsCto the proper dev */s-RRRRicount = &info->icount;s-
-    iUR	!tty) break;s-    iUR	tty->flip.count >= TTY_FLIPBUF_SIZE) break;s+		tty = info->tty;	/* now tty pointsCto the proper dev */s+		icount = &info->icount;s 
-    *tty->flip.char_buf_ptr = ch;
-    *tty->flip.flag_buf_ptr = 0;s-RRRRicount->rx++;s-
-    /* keep track of the y  pFspF s */s-RRRRiUR	y  pus &T(DZ_OERR |TDZ_FERR |TDZ_PERR)) {s-      iUR	y  pus &TDZ_PERR)                /* parity error */s-        icount->parity++;s-      )lse iUR	y  pus &TDZ_FERR)           /* fram
 error */s-        icount->fram
++;s-      iUR	y  pus &TDZ_OERR)                /* overrun error */s-        icount->overrun++;s-
-      /*  checkCto see iURwe should ignore the character
-	 aidCmask off conditt *s that should be ignored
-      */s-
-      iUR	y  pus &Tinfo->ignore_y  pus_mask) {s-        iUR	++ignore > 100 ) break;s-        goto ignore_char;s-      }
+		iUR	!tty)s+			break;s+		iUR	tty->flip.count >= TTY_FLIPBUF_SIZE) break;s+s+		*tty->flip.char_buf_ptr = ch;
+		*tty->flip.flag_buf_ptr = 0;s+		icount->rx++;s+s+		/* keep track of the y  pFspF s */s+		iUR	y  pus &T(DZ_OERR |TDZ_FERR |TDZ_PERR)) {s+			iUR	y  pus &TDZ_PERR)		/* parity error */s+				icount->parity++;s+			)lse iUR	y  pus &TDZ_FERR)	/* fram
 error */s+				icount->fram
++;s+			iUR	y  pus &TDZ_OERR)		/* overrun error */s+				icount->overrun++;s+s+			/*
+			 * CheckCto see iURwe should ignore the character aid
+			 * mask off conditt *s that should be ignored
+			 */s+s+			iUR	y  pus &Tinfo->ignore_y  pus_mask) {s+				iUR	++ignore > 100)n+					break;s+				goto ignore_char;s+			}s 
-      /* mask off the error conditt *s we want to ignore */s-      tmp = y  pus &Tinfo->read_y  pus_mask;s+			/* mask off the error conditt *s we want to ignore */s+			tmp = y  pus &Tinfo->read_y  pus_mask;s 
-      iUR	tmp &TDZ_PERR)s-	{s-        *tty->flip.flag_buf_ptr = TTY_PARITY;s-	  debug_conso 
("PERR\n",5);s-	}s-      )lse iUR	tmp &TDZ_FERR)s-	{s-        *tty->flip.flag_buf_ptr = TTY_FRAME;s-	  debug_conso 
("FERR\n",5);s-	}s-      iUR	tmp &TDZ_OERR) s-	{ s-	  debug_conso 
("OERR\n",5);s-	iUR	tty->flip.count < TTY_FLIPBUF_SIZE) {
-          tty->flip.count++;s-          tty->flip.flag_buf_ptr++;s-          tty->flip.char_buf_ptr++;s-          *tty->flip.flag_buf_ptr = TTY_OVERRUN;s-        }s-      }
-    }
-    tty->flip.flag_buf_ptr++;s-    tty->flip.char_buf_ptr++;s-    tty->flip.count++;s-  ignore_char:s-  } whi 
 (y  pus &TDZ_DVAL);s+			iUR	tmp &TDZ_PERR) {s+				*tty->flip.flag_buf_ptr = TTY_PARITY;s+#iUdef DEBUG_DZs+				debug_conso 
("PERR\n",5);s+#endiN /* DEBUG_DZ */s+			} )lse iUR	tmp &TDZ_FERR) {s+				*tty->flip.flag_buf_ptr = TTY_FRAME;s+#iUdef DEBUG_DZs+				debug_conso 
("FERR\n",5);s+#endiN /* DEBUG_DZ */s+			} iUR	tmp &TDZ_OERR) { s+#iUdef DEBUG_DZs+				debug_conso 
("OERR\n",5);s+#endiN /* DEBUG_DZ */s+				iUR	tty->flip.count < TTY_FLIPBUF_SIZE) {
+					tty->flip.count++;s+					tty->flip.flag_buf_ptr++;s+					tty->flip.char_buf_ptr++;s+					*tty->flip.flag_buf_ptr = TTY_OVERRUN;s+				}s+			}s+		}s+	tty->flip.flag_buf_ptr++;s+	tty->flip.char_buf_ptr++;s+	tty->flip.count++;s+ignore_char:s+	;
+	} whi 
 (y  pus &TDZ_DVAL);s 
-  iUR	tty)s-    tty_flip_buffer_push	tty);
+	iUR	tty)s+		tty_flip_buffer_push	tty);
 }
 o /*
@@ -311,35 +309,37 @@s  */n y  pF Tinline ES < transmit_chars (s ruct dz_serial *info)
 {n-  unsigned char tmp;
+	unsigned char tmp;
 
+	iUR	info->x_char) {           /* XON/XOFF chars */s+		dz_out(info,TDZ_TDR, info->x_char);
+		info->icount.tx++;s+		info->x_char = 0;s+		retnsi;
+	}
 s+	/* iURnothingCto do or stopped or hardware stopped */s+	iUR		info->xmit_cnt <= 0) || info->tty->s opped ||
+	    info->tty->hw_s opped) {
+		dz_stop(info->tty);s+		retnsi;
+	}
 s-  iUR	info->x_char) {           /* XON/XOFF chars */s-RRRRdz_out (info,TDZ_TDR, info->x_char);
-    info->icount.tx++;s-    info->x_char = 0;s-    retnsi;s-  }
-
-  /* iURnothingCto do or stopped or hardware stopped */s-  iUR		info->xmit_cnt <= 0) || info->tty->s opped || info->tty->hw_s opped) {
-RRRRdz_stop (info->tty);s-    retnsi;s-  }
-
-  /* iURsomethingCto do ... (rember the dz hasRno output fifo so we go one char at a time :-< */s-  tmp = (unsigned short)info->xmit_buf[info->xmit_tail++];s-  dz_out (info,TDZ_TDR, tmp);n-  info->xmit_tail = info->xmit_tail &T(DZ_XMIT_SIZE - 1);n-  info->icount.tx++;s-s-  iUR	--info->xmit_cnt < WAKEUP_CHARS)
-RRRRdz_sched_event (info,TDZ_EVENT_WRITE_WAKEUP);s-n-
-  /* Are we done */s-  iUR	info->xmit_cnt <= 0) dz_stop (info->tty);s+	/*
+	 *RIURsomethingCto do ... (rember the dz hasRno output fifo so we go
+	 *Rone char at a time :-<
+	 */s+	tmp = (unsigned short) info->xmit_buf[info->xmit_tail++];s+	dz_out(info,TDZ_TDR, tmp);n+	info->xmit_tail = info->xmit_tail &T(DZ_XMIT_SIZE - 1);n+	info->icount.tx++;s+s+	iUR	--info->xmit_cnt < WAKEUP_CHARS)
+	dz_sched_event(info,TDZ_EVENT_WRITE_WAKEUP);s+s+	/* Are we done */s+	iUR	info->xmit_cnt <= 0)
+		dz_stop(info->tty);s }
 o /*
@@ -351,15 +351,17 @@s  */n y  pF Tinline ES < check_modem_y  pus (s ruct dz_serial *info)
 {n-  unsigned short y  pus;s+	unsigned short y  pus;s 
-  /* iURnot ne modem line just retnsi */s-  iUR	info->line !=TDZ_MODEM) retnsi;s+	/* iURnot ne modem line just retnsi */s+	iUR	info->line !=TDZ_MODEM)s+		retnsi;
 
-  s  pus = dz_in (info,TDZ_MSR);s+	s  pus = dz_in(info,TDZ_MSR);s   
-  /* it's easy, since DSR2CisCthe only bit in the register */s-  iUR	y  pus) info->icount.dsr++;s+	/* it's easy, since DSR2CisCthe only bit in the register */s+	iUR	y  pus)
+		info->icount.dsr++;s }
 o /*
@@ -372,17 +374,18 @@s  */n y  pF TES < dz_interrupt (int irq,TES < *dev, s ruct pt_regs *regs)
 {n-  s ruct dz_serial *info;n-  unsigned short y  pus;s+	s ruct dz_serial *info;n+	unsigned short y  pus;s 
-  s  pus = dz_in ((s ruct dz_serial *)dev, DZ_CSR); /* get the reason why we just got an irq */s-  info = lines[LINE(y  pus)];     /* re-arrange info the proper port */s+	 /* get the reason why we just got an irq */s+	s  pus = dz_in((s ruct dz_serial *)dev, DZ_CSR);
+	info = lines[LINE(y  pus)];     /* re-arrange info the proper port */s s-  iUR	y  pus &TDZ_RDONE) 
-      receive_chars (info);          /* the receive functt * */s+	iUR	y  pus &TDZ_RDONE) 
+		receive_chars(info);	/* the receive functt * */s s-  iUR	y  pus &TDZ_TRDY) 
-    transmit_chars (info);s+	iUR	y  pus &TDZ_TRDY) 
+		transmit_chars (info);s }
 o /*
@@ -402,21 +405,23 @@s  */n y  pF TES < do_serial_bh (ES <)
 {n-        run_task_queue (&tq_serial);n+	run_task_queue (&tq_serial);n }s 
 y  pF TES < do_softint (ES < *private_data)
 {n-  s ruct dz_serial *info = (s ruct dz_serial *)private_data;s-  s ruct tty_s ruct *tty = info->tty;s+	s ruct dz_serial *info = (s ruct dz_serial *) private_data;s+	s ruct tty_s ruct *tty = info->tty;s s-  iUR	!tty) retnsi;s+	iUR	!tty)s+		retnsi;
 
-  iUR	test_and_clear_bit (DZ_EVENT_WRITE_WAKEUP, &info->event)) {
-RRRRiUR		tty->flags &T(1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup)
-      (tty->ldisc.write_wakeup) (tty);s-    wake_up_interruptible (&tty->write_wait);n-  }
+	iUR	test_and_clear_bit(DZ_EVENT_WRITE_WAKEUP, &info->event)) {
+		iUR		tty->flags &T(1 << TTY_DO_WRITE_WAKEUP)) &&s+		    tty->ldisc.write_wakeup)
+			(tty->ldisc.write_wakeup) (tty);s+		wake_up_interruptible (&tty->write_wait);n+	}
 }s o /*
@@ -431,12 +436,13 @@s  */n y  pF TES < do_serial_hangup (ES < *private_data)
 {n-  s ruct dz_serial *info = (s ruct dz_serial *)private_data;s-  s ruct tty_s ruct *tty = info->tty;;s+	s ruct dz_serial *info = (s ruct dz_serial *) private_data;s+	s ruct tty_s ruct *tty = info->tty;;
         s-  iUR	!tty) retnsi;s+	iUR	!tty)s+		retnsi;
 
-  tty_hangup (tty);s+	tty_hangup	tty);
 }
 o /*
@@ -448,57 +454,52 @@s  */n y  pF Tint y  rtup (s ruct dz_serial *info)
 {n-  unsigned long page, flags;n-  unsigned short tmp;
+	unsigned long page, flags;n+	unsigned short tmp;
 
-  iUR	info->is_inittalized) retnsi 0;s+	iUR	info->is_inittalized)n+		retnsi 0;s   
-  save_flags (flags);n-  cli ();s+	save_and_cli(flags);n s-  iUR	!info->port) {
-RRRRiUR	info->tty) set_bit (TTY_IO_ERROR, &info->tty->flags);s-    restore_flags (flags);n-    retnsi -ENODEV;s-  }
-
-  iUR	!info->xmit_buf) {
-RRRRpage = get_free_page (GFP_KERNEL);s-    iUR	!page) {n-      restore_flags (flags);n-      retnsi -ENOMEM;
-    }
-    info->xmit_buf = (unsigned char *)page;s-  }
-
-  iUR	info->tty) clear_bit (TTY_IO_ERROR, &info->tty->flags);s-
-  /* enable the interrupt and the scanningC*/s-  tmp = dz_in (info,TDZ_CSR);
-  tmp |= (DZ_RIE |TDZ_TIE |TDZ_MSE);s-  dz_out (info,TDZ_CSR, tmp);n-n-  info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;s-
-  /* set up the speed */s-  change_speed (info);s-
-  /* clear the line transmitter buffer n-     I can't figure out why I need to do thisC- butn-     its necessary - in order f_S the conso 
 portt *n-     and the interrupt portt * to live happily side by side.
-  */s-
-  /* clear the line transmitter buffer n-     I can't figure out why I need to do thisC- butn-     its necessary - in order f_S the conso 
 portt *n-     and the interrupt portt * to live happily side by side.
-  */s+	iUR	!info->port) {
+		iUR	info->tty) set_bit(TTY_IO_ERROR, &info->tty->flags);s+		restore_flags(flags);s+		retnsi -ENODEV;s+	}
+n+	iUR	!info->xmit_buf) {
+		page = get_free_page(GFP_KERNEL);s+		iUR	!page) {n+			restore_flags (flags);s+		retnsi -ENOMEM;
+		}s+		info->xmit_buf = (unsigned char *)page;s+	}
 s-  info->is_inittalized = 1;s+	iUR	info->tty)s+		clear_bit(TTY_IO_ERROR, &info->tty->flags);s n-  restore_flags (flags);n-  retnsi 0;s+	/* enable the interrupt and the scanningC*/s+	tmp = dz_in(info,TDZ_CSR);
+	tmp |= (DZ_RIE |TDZ_TIE |TDZ_MSE);s+	dz_out(info,TDZ_CSR, tmp);n+n+	info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;s+n+	change_speed(info);			/* yet up the speed */s+s+	/*
+	 *RClear the line transmitter buffer I can't figure out why I need to
+	 *Rdo thisC- but its necessary - in order f_S the conso 
 portt * aid
+	 * the interrupt portt * to live happily side by side.
+	 */s+s+	info->is_inittalized = 1;s+s+	restore_flags(flags);s+s+	retnsi 0;
 }
 o /* 
@@ -511,38 +512,38 @@s  */n y  pF TES < shutdown (s ruct dz_serial *info)
 {n-  unsigned long flags;n-  unsigned short tmp;
+	unsigned long flags;n+	unsigned short tmp;
 
-  iUR	!info->is_inittalized) retnsi;n+	iUR	!info->is_inittalized)n+		retnsi;s 
-  save_flags (flags);n-  cli ();s+	save_and_cli(flags);n s-  dz_stop (info->tty);s+	dz_stop (info->tty);s s+	info->cflags &= ~DZ_CREAD;	/* tnsi off receive enable flag */s+	dz_out(info,TDZ_LPR, info->cflags);n s+	iUR	info->xmit_buf) {               /* free Tx buffer */s+		free_page((unsigned long)info->xmit_buf);s+		info->xmit_buf = 0;s+	}
 s-  info->cflags &= ~DZ_CREAD;          /* tnsi off receive enable flag */s-  dz_out (info,TDZ_LPR, info->cflags);n-s-  iUR	info->xmit_buf) {               /* free Tx buffer */s-    free_page ((unsigned long)info->xmit_buf);s-    info->xmit_buf = 0;n-  }
+	iUR	!info->tty || (info->tty->termios->c_cflag &THUPCL)) {
+		tmp = dz_in(info,TDZ_TCR);s+		iUR	tmp &TDZ_MODEM_DTR) {s+			tmp &= ~DZ_MODEM_DTR;s+			dz_out(info,TDZ_TCR, tmp);n+		}s+	}
 
-  iUR	!info->tty || (info->tty->termios->c_cflag &THUPCL)) {
-    tmp = dz_in (info,TDZ_TCR);s-    iUR	tmp &TDZ_MODEM_DTR) {s-      tmp &= ~DZ_MODEM_DTR;s-      dz_out (info,TDZ_TCR, tmp);n-    }
-  }s+	iUR	info->tty)s+		set_bit (TTY_IO_ERROR, &info->tty->flags);s 
-  iUR	info->tty) set_bit (TTY_IO_ERROR, &info->tty->flags);s+	info->is_inittalized = 0;
 s-  info->is_inittalized = 0;n-  restore_flags (flags);n+	restore_flags (flags);s }
 o /* 
@@ -554,65 +555,104 @@s  */n y  pF TES < change_speed (s ruct dz_serial *info)
 {n-  unsigned long flags;n-  unsigned cflag;s-  int baud;
+	unsigned long flags;n+	unsigned cflag;s+	int baud;
 
-  iUR	!info->tty || !info->tty->termios) retnsi;n+	iUR	!info->tty || !info->tty->termios)n+		retnsi;s   
-  save_flags (flags);n-  cli ();s+	save_and_cli(flags);n   s-  info->cflags = info->line;n+	info->cflags = info->line;n s-  cflag = info->tty->termios->c_cflag;n+	cflag = info->tty->termios->c_cflag;n 
-  switch (cflag &TCSIZE) {
-  case CS5: info->cflags |=TDZ_CS5; break;s-  case CS6: info->cflags |=TDZ_CS6; break;s-  case CS7: info->cflags |=TDZ_CS7; break;s-  case CS8: s-  default:  info->cflags |=TDZ_CS8;s-  }
-
-  iUR	cflag &TCSTOPB) info->cflags |=TDZ_CSTOPB;
-  iUR	cflag &TPARENB) info->cflags |=TDZ_PARENB;
-  iUR	cflag &TPARODD) info->cflags |=TDZ_PARODD;s+	switch (cflag &TCSIZE) {
+		case CS5:s+			info->cflags |=TDZ_CS5;s+			break;s+		case CS6:s+			info->cflags |=TDZ_CS6;s+			break;s+		case CS7:s+			info->cflags |=TDZ_CS7;s+			break;s+		case CS8: s+		default:s+			info->cflags |=TDZ_CS8;s+	}
+n+	iUR	cflag &TCSTOPB)s+		info->cflags |=TDZ_CSTOPB;
+	iUR	cflag &TPARENB)s+		info->cflags |=TDZ_PARENB;
+	iUR	cflag &TPARODD)s+		info->cflags |=TDZ_PARODD;s   s-  baud = tty_get_baud_r pe (info->tty);s-  switch (baud) {
-  case 50  :  info->cflags |=TDZ_B50;   break;s-  case 75  :  info->cflags |=TDZ_B75;   break;s-  case 110 :  info->cflags |=TDZ_B110;  break;s-  case 134 :  info->cflags |=TDZ_B134;  break; s-  case 150 :  info->cflags |=TDZ_B150;  break;s-  case 300 :  info->cflags |=TDZ_B300;  break; s-  case 600 :  info->cflags |=TDZ_B600;  break;s-  case 1200:  info->cflags |=TDZ_B1200; break; s-  case 1800:  info->cflags |=TDZ_B1800; break;s-  case 2000:  info->cflags |=TDZ_B2000; break;s-  case 2400:  info->cflags |=TDZ_B2400; break;s-  case 3600:  info->cflags |=TDZ_B3600; break; s-  case 4800:  info->cflags |=TDZ_B4800; break;s-  case 7200:  info->cflags |=TDZ_B7200; break; s-  case 9600: s-  default  :  info->cflags |=TDZ_B9600; s-  }
-
-  info->cflags |=TDZ_RXENAB;s-  dz_out (info,TDZ_LPR, info->cflags);n-s-  /* yetup accept flag */s-  info->read_y  pus_mask =TDZ_OERR;
-  iUR	I_INPCK(info->tty))
-   info->read_y  pus_mask |= (DZ_FERR |TDZ_PERR); 
+	baud = tty_get_baud_r pe(info->tty);s+	switch (baud) {
+	case 50:s+		info->cflags |=TDZ_B50;s+		break;s+	case 75:s+		info->cflags |=TDZ_B75;s+		break;s+	case 110:s+		info->cflags |=TDZ_B110;s+		break;s+	case 134:s+		info->cflags |=TDZ_B134;s+		break; s+	case 150:s+		info->cflags |=TDZ_B150;s+		break;s+	case 300:s+		info->cflags |=TDZ_B300;s+		break; s+	case 600:s+		info->cflags |=TDZ_B600;s+		break;s+	case 1200:s+		info->cflags |=TDZ_B1200;s+		break; s+	case 1800:s+		info->cflags |=TDZ_B1800;s+		break;s+	case 2000:s+		info->cflags |=TDZ_B2000;s+		break;s+	case 2400:s+		info->cflags |=TDZ_B2400;s+		break;s+	case 3600:s+		info->cflags |=TDZ_B3600;s+		break; s+	case 4800:s+		info->cflags |=TDZ_B4800;s+		break;s+	case 7200:s+		info->cflags |=TDZ_B7200;s+		break; s+	case 9600: s+	default:s+		info->cflags |=TDZ_B9600; s+	}
+n+	info->cflags |=TDZ_RXENAB;s+	dz_out(info,TDZ_LPR, info->cflags);n+s+	/* yetup accept flag */s+	info->read_y  pus_mask =TDZ_OERR;
+	iUR	I_INPCK(info->tty))
+		info->read_y  pus_mask |= (DZ_FERR |TDZ_PERR); 
   
-  /* characters to ignore */s-  info->ignore_y  pus_mask = 0;n-  iUR	I_IGNPAR(info->tty))
-    info->ignore_y  pus_mask |= (DZ_FERR |TDZ_PERR);s+	/* characters to ignore */s+	info->ignore_y  pus_mask = 0;n+	iUR	I_IGNPAR(info->tty))
+		info->ignore_y  pus_mask |= (DZ_FERR |TDZ_PERR);s n-  restore_flags (flags);n+	restore_flags(flags);s }
 o /* 
@@ -624,18 +664,16 @@s  */n y  pF TES < dz_flush_chars (s ruct tty_s ruct *tty)
 {n-  s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
-  unsigned long flags;n-
- iUR	info->xmit_cnt <= 0 || tty->s opped || tty->hw_s opped || !info->xmit_buf)s-    retnsi;s+	s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
+	unsigned long flags;n n- save_flags (flags);n- cli ();  
-n- dz_start (info->tty);s-n- restore_flags (flags);n+	iUR	info->xmit_cnt <= 0 || tty->s opped || tty->hw_s opped ||
+	    !info->xmit_buf)s+		retnsi;
+s+	save_and_cli(flags);n+	dz_start (info->tty);s+	restore_flags(flags);s }
 o 
@@ -646,83 +684,81 @@s  * main output routine.
  * ------------------------------------------------------------------- 
  */s-y  pF Tint dz_write (s ruct tty_s ruct *tty,Tint f0xm_user, const unsigned char *buf,Tint count)
+y  pF Tint dz_write (s ruct tty_s ruct *tty,Tint f0xm_user,
+                     const unsigned char *buf,Tint count)
 {n-  s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
-  unsigned long flags;n-  int c, ret = 0;s-
-  iUR	!tty ) retnsi ret;
-  iUR	!info->xmit_buf) retnsi ret;
-  iUR	!tmp_buf) tmp_buf = tmp_buffer;s-n-
-
-  iUR	f0xm_user) {n-
-    down (&tmp_buf_sem);s-    whi 
 (1) {s-      c = MIN(count, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1,TDZ_XMIT_SIZE - info->xmit_head));s-      iUR	c <= 0) break;s-s-      c -= copy_f0xm_userR	tmp_buf,Tbuf,Tc);s-      iUR	!c) {s-        iUR	!ret) ret = -EFAULT;s-        break;s-      }s-s-      save_flags (flags);n-      cli ();s-s-      c = MIN(c, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1,TDZ_XMIT_SIZE - info->xmit_head));s-      memcpy	info->xmit_buf + info->xmit_head, tmp_buf,Tc);
-      info->xmit_head = 		info->xmit_head +Tc) &T(DZ_XMIT_SIZE-1));
-      info->xmit_cnt += c;s-s-      restore_flags(flags);s-s-      buf += c;s-      count -= c;s-      ret += c;s-    }
-    n-    up (&tmp_buf_sem);s-  } )lse {n-s+	s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
+	unsigned long flags;n+	int c, ret = 0;s+s+	iUR	!tty )n+		retnsi ret;
+	iUR	!info->xmit_buf)n+		retnsi ret;
+	iUR	!tmp_buf)
+		tmp_buf = tmp_buffer;s+s+	iUR	f0xm_user) {n+		down (&tmp_buf_sem);s+		whi 
 (1) {s+			c = MIN(count, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1,n+			                   DZ_XMIT_SIZE - info->xmit_head));s+			iUR	c <= 0)
+				break;s+s+			c -= copy_f0xm_userR	tmp_buf,Tbuf,Tc);s+			iUR	!c) {s+				iUR	!ret)s+					ret = -EFAULT;s+				break;s+			}s+s+			save_and_cli(flags);n+s+			c = MIN(c, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1,n+			               DZ_XMIT_SIZE - info->xmit_head));s+			memcpy	info->xmit_buf + info->xmit_head, tmp_buf,Tc);
+			info->xmit_head = 		info->xmit_head +Tc) &
+					   (DZ_XMIT_SIZE - 1));
+			info->xmit_cnt += c;s+			restore_flags(flags);n+s+			buf += c;s+			count -= c;s+			ret += c;s+		}s+		up(&tmp_buf_sem);s+	} )lse {n+		whi 
 (1) {s+			save_and_cli(flags);n+s+			c = MIN(count, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1,n+			                   DZ_XMIT_SIZE - info->xmit_head));s+			iUR	c <= 0) {s+				restore_flags (flags);s+				break;s+			}s+			memcpy	info->xmit_buf + info->xmit_head, buf,Tc);
+			info->xmit_head = 		info->xmit_head +Tc) &
+			                   (DZ_XMIT_SIZE-1));
+			info->xmit_cnt += c;s+			restore_flags(flags);n+s+			buf += c;s+			count -= c;s+			ret += c;s+		}s+	}s 
-    whi 
 (1) {s-      save_flags (flags);n-      cli ();     s-s-      c = MIN(count, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1,TDZ_XMIT_SIZE - info->xmit_head));s-      iUR	c <= 0) {n-        restore_flags (flags);n-        break;s-      }s-      memcpy 	info->xmit_buf + info->xmit_head, buf,Tc);
-      info->xmit_head = 		info->xmit_head +Tc) &T(DZ_XMIT_SIZE-1));
-      info->xmit_cnt += c;s-s-      restore_flags (flags);s-s-      buf += c;s-      count -= c;s-      ret += c;s-    }
-  }n-
-
-  iUR	info->xmit_cnt)
-    {s-      iUR	!tty->s opped) s-	{s-	  iUR	!tty->hw_s opped)s-	    {s-	      dz_start (info->tty);s-	    }
+	iUR	info->xmit_cnt) {n+		iUR	!tty->s opped) {n+			iUR	!tty->hw_s opped) {
+				dz_start (info->tty);s+			}s+		}s 	}
-    }
-  retnsi ret;
+s+	retnsi ret;
 }
 o /* 
@@ -734,12 +770,14 @@s  */n y  pF Tint dz_write_room (s ruct tty_s ruct *tty)
 {n-  s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
-  int ret;
-                                
-  ret =TDZ_XMIT_SIZE - info->xmit_cnt - 1;
-  iUR	ret < 0) ret = 0;n-  retnsi ret;
+	s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
+	int ret;
+s+	ret =TDZ_XMIT_SIZE - info->xmit_cnt - 1;
+	iUR	ret < 0)n+		ret = 0;s+s+	retnsi ret;
 }
 o /* 
@@ -751,9 +789,9 @@s  */n y  pF Tint dz_chars_in_buffer (s ruct tty_s ruct *tty)
 {n-  s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
+	s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
   
-  retnsi info->xmit_cnt;s+	retnsi info->xmit_cnt;s }
 o /* 
@@ -765,16 +803,17 @@s  */n y  pF TES < dz_flush_buffer (s ruct tty_s ruct *tty)
 {n-  s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
+	s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
                                 
-  cli ();s-  info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;s-  s i ();s-s-  wake_up_interruptible (&tty->write_wait);n-s-  iUR		tty->flags &T(1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup)
-    (tty->ldisc.write_wakeup)(tty);s+	cli();n+	info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;s+	s i();n+s+	wake_up_interruptible (&tty->write_wait);n+s+	iUR		tty->flags &T(1 << TTY_DO_WRITE_WAKEUP)) &&s+	     tty->ldisc.write_wakeup)
+		tty->ldisc.write_wakeup	tty);
 }
 o /*
@@ -787,31 +826,32 @@s  */n y  pF TES < dz_throttle (s ruct tty_s ruct *tty)
 {n-  s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;  
+	s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;  
 n-  iUR	I_IXOFF(tty))
-    info->x_char = STOP_CHAR	tty);
+	iUR	I_IXOFF(tty))
+		info->x_char = STOP_CHAR	tty);
 }s 
 y  pF TES < dz_unthrottle (s ruct tty_s ruct *tty)
 {n-  s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;  
+	s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;  
 n-  iUR	I_IXOFF(tty)) {
-RRRRiUR	info->x_char)
-      info->x_char = 0;s-    elsen-      info->x_char = START_CHAR	tty);
-  }s+	iUR	I_IXOFF(tty)) {
+		iUR	info->x_char)
+			info->x_char = 0;s+		elsen+			info->x_char = START_CHAR	tty);
+	}
 }s o y  pF TES < dz_send_xchar (s ruct tty_s ruct *tty,Tchar ch)
 {n-  s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
+	s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
 s-  info->x_char = ch;
+	info->x_char = ch;
 n-  iUR	ch) dz_start (info->tty);s+	iUR	ch)
+		dz_start(info->tty);s }
 o /*
@@ -819,59 +859,62 @@s  * rs_ioctl () and friends
  * ------------------------------------------------------------
  */s-y  pF Tint get_serial_info (s ruct dz_serial *info,Ts ruct serial_s ruct *retinfo)
+y  pF Tint get_serial_info(s ruct dz_serial *info,
+                           s ruct serial_s ruct *retinfo)
 {n-  s ruct serial_s ruct tmp;
+	s ruct serial_s ruct tmp;
   s-  iUR	!retinfo)
-    retnsi -EFAULT;s+	iUR	!retinfo)
+		retnsi -EFAULT;s 
-  memyet (&tmp, 0, sizeof(tmp));n+	memyet (&tmp, 0, sizeof(tmp));n 
-  tmp.type = info->type;
-  tmp.line = info->line;n-  tmp.port = info->port;n-  tmp.irq = SERIAL;n-  tmp.flags = info->flags;n-  tmp.baud_base = info->baud_base;n-  tmp.close_delay = info->close_delay;n-  tmp.closing_wait = info->closing_wait;n-  
-  retnsi copy_to_user(retinfo, &tmp, sizeof(*retinfo)) ? -EFAULT : 0;s+	tmp.type = info->type;
+	tmp.line = info->line;n+	tmp.port = info->port;n+	tmp.irq = SERIAL;n+	tmp.flags = info->flags;n+	tmp.baud_base = info->baud_base;n+	tmp.close_delay = info->close_delay;n+	tmp.closing_wait = info->closing_wait;n+s+	retnsi copy_to_user(retinfo, &tmp, sizeof(*retinfo)) ? -EFAULT : 0;s }s 
-y  pF Tint set_serial_info (s ruct dz_serial *info,Ts ruct serial_s ruct *new_info)
+y  pF Tint set_serial_info (s ruct dz_serial *info,
+                           Ts ruct serial_s ruct *new_info)
 {n-  s ruct serial_s ruct new_serial;n-  s ruct dz_serial old_info;n-  int retval = 0;s+	s ruct serial_s ruct new_serial;n+	s ruct dz_serial old_info;n+	int retval = 0;s s-  iUR	!new_info)
-    retnsi -EFAULT;s+	iUR	!new_info)
+		retnsi -EFAULT;s 
-  if(copy_f0xm_userR	&new_serial, new_info, sizeof(new_serial)))
-    retnsi -EFAULT;s-    n-  old_info = *info;n+	iUR	copy_f0xm_user	&new_serial, new_info, sizeof(new_serial)))
+		retnsi -EFAULT;s 
-  ifR	!capable(CAP_SYS_ADMIN))
-    retnsi -EPERM;
+	old_info = *info;n 
-  iUR	info->count > 1)
-    retnsi -EBUSY;s+	iUR	!capable(CAP_SYS_ADMIN))
+		retnsi -EPERM;
 
-  /*
-   * OK, past thisCpoint, all the error checkingChasRbeen done.
-   * At thisCpoint, we y  rt makingCchanges.....
-   */s-RRs-  info->baud_base = new_serial.baud_base;n-  info->type = new_serial.type;
-  info->close_delay = new_serial.close_delay;n-  info->closing_wait = new_serial.closing_wait;n+	iUR	info->count > 1)
+		retnsi -EBUSY;s+s+	/*
+	 *ROK, past thisCpoint, all the error checkingChasRbeen done.
+	 *RAt thisCpoint, we y  rt makingCchanges.....
+	 */s 
-  retval = y  rtup (info);s-  retnsi retval;n+	info->baud_base = new_serial.baud_base;n+	info->type = new_serial.type;
+	info->close_delay = new_serial.close_delay;n+	info->closing_wait = new_serial.closing_wait;n+s+	retval = y  rtup(info);s+s+	retnsi retval;n }
 o /*
@@ -886,9 +929,9 @@s  */n y  pF Tint get_lsr_info (s ruct dz_serial *info,Tunsigned int *value)s {n-  unsigned short y  pus = dz_in (info,TDZ_LPR);s+	unsigned short y  pus = dz_in (info,TDZ_LPR);s 
-  retnsi put_userR	y  pus, value);s+	retnsi put_userR	y  pus, value);s }
 o /*
@@ -896,106 +939,112 @@s  */n y  pF TES < send_break (s ruct dz_serial *info,Tint duratt *)
 {n-  unsigned long flags;n-  unsigned short tmp, mask;
-
-  iUR	!info->port)s-    retnsi;s-
-  mask = 1 << info->line;n-  tmp = dz_in (info,TDZ_TCR);
-  tmp |= mask;s+	unsigned long flags;n+	unsigned short tmp, mask;
 
-  current->y  pe = TASK_INTERRUPTIBLE;s+	iUR	!info->port)n+		retnsi;s 
-  save_flags (flags);n-  cli();s-  s-  dz_out (info,TDZ_TCR, tmp);n-  
-  schedule_timeout(duratt *);n-  
-  tmp &= ~mask;s-  dz_out (info,TDZ_TCR, tmp);n-  
-  restore_flags (flags);s-}n-
-y  pF Tint dz_ioctl (s ruct tty_s ruct *tty,Ts ruct fi 
 *fi 
,s-		     unsigned int cmd, unsigned long arg)s-{n-  s ruct dz_serial * info = (s ruct dz_serial *)tty->driver_data;
-  int retval;n+	mask = 1 << info->line;n+	tmp = dz_in (info,TDZ_TCR);
+	tmp |= mask;s+n+	current->y  pe = TASK_INTERRUPTIBLE;s+s+	save_and_cli(flags);n+	dz_out(info,TDZ_TCR, tmp);n+	schedule_timeout(duratt *);n+	tmp &= ~mask;n+	dz_out(info,TDZ_TCR, tmp);n+	restore_flags(flags);n+}s+s+y  pF Tint dz_ioctl(s ruct tty_s ruct *tty,Ts ruct fi 
 *fi 
,s+                    unsigned int cmd, unsigned long arg)s+{n+	int error;
+	s ruct dz_serial * info = (s ruct dz_serial *)tty->driver_data;
+	int retval;n+n+	iUR	cmd !=TTIOCGSERIAL && cmd !=TTIOCSSERIAL &&s+	    cmd !=TTIOCSERCONFIG && cmd !=TTIOCSERGWILD  &&s+	    cmd !=TTIOCSERSWILD && cmd !=TTIOCSERGSTRUCT) {
+		iUR	tty->flags &T(1 << TTY_IO_ERROR))
+			retnsi -EIO;
+	}
 s-  iUR		cmd !=TTIOCGSERIAL) && (cmd !=TTIOCSSERIAL) &&s-      (cmd !=TTIOCSERCONFIG) && (cmd !=TTIOCSERGWILD)  &&s-      (cmd !=TTIOCSERSWILD) && (cmd !=TTIOCSERGSTRUCT)) {
-RRRRiUR	tty->flags &T(1 << TTY_IO_ERROR))
-      retnsi -EIO;
-  }
-
-  switch (cmd) {
-  case TCSBRK:    /* SVID verst *: non-zero arg -->Rno break */s-    retval = tty_check_change (tty);s-    iUR	retval)
-      retnsi retval;n-    tty_wait_until_sent (tty, 0);s-    iUR	!arg)s-     Tsend_break (info,THZ/4); /* 1/4Tsecond */s-    retnsi 0;
-
-  case TCSBRKP:   /* support f_S POSIX tcsendbreak() */s-    retval = tty_check_change (tty);s-    iUR	retval)
-      retnsi retval;n-    tty_wait_until_sent (tty, 0);s-    send_break (info,Targ ?Targ*(HZ/10) : HZ/4);s-    retnsi 0;
-
-  case TIOCGSOFTCAR:s-    retnsi put_user(C_CLOCAL(tty) ?T1 : 0, (unsigned long *)arg);
-
-  case TIOCSSOFTCAR:s-    iUR	get_userR	arg, (unsigned long *)arg))
-      retnsi -EFAULT;s-    tty->termios->c_cflag =R		tty->termios->c_cflag &T~CLOCAL) |R	arg ?TCLOCAL : 0));s-    retnsi 0;
-
-  case TIOCGSERIAL:s-    retnsi get_serial_info (info,T(s ruct serial_s ruct *)arg);
-
-  case TIOCSSERIAL:s-    retnsi set_serial_info (info,T(s ruct serial_s ruct *) arg);
-
-  case TIOCSERGETLSR: /* Get line y  pus register */s-    retnsi get_lsr_info (info,T(unsigned int *)arg);
-
-  case TIOCSERGSTRUCT:s-    retnsi copy_to_user((s ruct dz_serial *)arg, info,
-		        sizeof(s ruct dz_serial)) ? -EFAULT : 0;s-    n-  default:s-    retnsi -ENOIOCTLCMD;
-  }s+	switch (cmd) {
+	case TCSBRK:		/* SVID verst *: non-zero arg -->Rno break */s+		retval = tty_check_change(tty);s+		iUR	retval)
+			retnsi retval;n+		tty_wait_until_sent(tty, 0);s+		iUR	!arg)s+			send_break(info,THZ/4); /* 1/4Tsecond */s+		retnsi 0;s+
+	case TCSBRKP:		/* support f_S POSIX tcsendbreak() */s+		retval = tty_check_change(tty);s+		iUR	retval)
+			retnsi retval;n+		tty_wait_until_sent(tty, 0);s+		send_break(info,Targ ?Targ*(HZ/10) : HZ/4);s+		retnsi 0;s+
+	case TIOCGSOFTCAR:s+		error = verify_area (VERIFY_WRITE, (ES < *)arg, sizeof(long));s+		iUR	error)
+			retnsi error;
+		put_user(C_CLOCAL(tty) ?T1 : 0, (unsigned long *)arg);
+		retnsi 0;s+
+	case TIOCSSOFTCAR:s+		iUR	get_userR	arg, (unsigned long *)arg))
+			retnsi -EFAULT;s+
+		tty->termios->c_cflag =R	tty->termios->c_cflag &T~CLOCAL) |s+		                        	arg ?TCLOCAL : 0);s+		retnsi 0;s+
+	case TIOCGSERIAL:s+		error = verify_area(VERIFY_WRITE, (ES < *)arg,s+		                    sizeof(s ruct serial_s ruct));s+		iUR	error)
+			retnsi error;
+		retnsi get_serial_info(info,T(s ruct serial_s ruct *)arg);
+
+	case TIOCSSERIAL:s+		retnsi set_serial_info(info,T(s ruct serial_s ruct *) arg);
+
+	case TIOCSERGETLSR:		/* Get line y  pus register */s+		retnsi get_lsr_info (info,T(unsigned int *)arg);
+
+	case TIOCSERGSTRUCT:s+		retnsi copy_to_user((s ruct dz_serial *)arg, info,
+		                    sizeof(s ruct dz_serial)) ? -EFAULT : 0;s+ s+	default:s+		retnsi -ENOIOCTLCMD;
+	}
 s-  retnsi 0;s+	retnsi 0;
 }
 o y  pF TES < dz_set_termios (s ruct tty_s ruct *tty,
 			    s ruct termios *old_termios)n {n-  s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
+	s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
 s-  ifR	tty->termios->c_cflag == old_termios->c_cflag)s-    retnsi;s+	ifR	tty->termios->c_cflag == old_termios->c_cflag)s+		retnsi;s 
-  change_speed (info);s+	change_speed (info);s s-  iUR		old_termios->c_cflag &TCRTSCTS) &&s-      !	tty->termios->c_cflag &TCRTSCTS)) {
-    tty->hw_s opped = 0;s-    dz_start (tty);
-  }s+	iUR		old_termios->c_cflag &TCRTSCTS) &&s+	    !	tty->termios->c_cflag &TCRTSCTS)) {
+		tty->hw_s opped = 0;s+		dz_start(tty);
+	}
 }s o /*
@@ -1007,97 +1056,95 @@s  * the transmit enable and receive enable flags.
  * ------------------------------------------------------------
  */s-y  pF TES < dz_close (s ruct tty_s ruct *tty,Ts ruct fi 
 *fi p)
+y  pF TES < dz_close(s ruct tty_s ruct *tty,Ts ruct fi 
 *fi p)
 {n-  s ruct dz_serial * info = (s ruct dz_serial *)tty->driver_data;
-  unsigned long flags;n+	s ruct dz_serial * info = (s ruct dz_serial *)tty->driver_data;
+	unsigned long flags;n n-  iUR	!info) retnsi;s-        
-  save_flags (flags); n-  cli();s-        s-  iUR	tty_hung_up_p (fi p)) {
-    restore_flags (flags);n-    retnsi;s-  }
-
-  iUR		tty->count == 1) && (info->count != 1)) {
-    /*
-     * Uh, oh.  tty->count is 1,Twhich mea*s that the tty
-     * s ructure will be freed.  Info->count should always
-     * beRone in these conditt *s.  If it's greater than
-     * one, we've got real problems, since it mea*s the
-     * serial port won't be shutdown.
-     */s-    printk("dz_close: bad serial port count; tty->count is 1,T"
-                       "info->count is %d\n", info->count);
-                info->count = 1;
-  }s-s-  iUR	--info->count < 0) {n-    printk("ds_close: bad serial port count f_S ttys%d: %d\n",s-	   info->line, info->count);
-    info->count = 0;s-  }
-
-  iUR	info->count) {
-    restore_flags (flags);n-    retnsi;s-  }
-  info->flags |=TDZ_CLOSING;
-  /*
-   * Save the termios s ructure, since thisCport may have
-   * separ pe termios f_S callout and dtalin.
-   */s-RRiUR	info->flags &TDZ_NORMAL_ACTIVE)
-    info->normal_termios = *tty->termios;s-RRiUR	info->flags &TDZ_CALLOUT_ACTIVE)
-    info->callout_termios = *tty->termios;s-RR/*
-   * Now we wait f_S the transmit buffer to clear; and we notify 
-   * the line discipline to only process XON/XOFF characters.
-   */s-RRtty->closing = 1;
-
-  iUR	info->closing_wait !=TDZ_CLOSING_WAIT_NONE)n-    tty_wait_until_sent (tty, info->closing_wait);n-s-  /*
-   * At thisCpoint we y op accepting input.  To do this, we
-   * disable the receive line y  pus interrupts.
-   */s-
-  shutdown (info);s-
-  ifR	tty->driver.flush_buffer)
-    tty->driver.flush_buffer (tty);
-  ifR	tty->ldisc.flush_buffer)
-    tty->ldisc.flush_buffer (tty);
-  tty->closing = 0;n-  info->event = 0;n-  info->tty = 0;s-
-  ifR	tty->ldisc.num !=Tldiscs[N_TTY].num) {
-RRRRiUR	tty->ldisc.close)
-      (tty->ldisc.close)(tty);s-    tty->ldisc =Tldiscs[N_TTY];s-    tty->termios->c_line = N_TTY;
-RRRRiUR	tty->ldisc.open)
-      (tty->ldisc.open)(tty);
-  }s-  iUR	info->blocked_open) {
-RRRRiUR	info->close_delay) {s-      current->y  pe = TASK_INTERRUPTIBLE;s-     Tschedule_timeout(info->close_delay);s-    }
-    wake_up_interruptible (&info->open_wait);n-  }
+	iUR	!info)
+		retnsi;s+ s+	save_and_cli(flags); n+n+	iUR	tty_hung_up_p(fi p)) {
+		restore_flags(flags);s+		retnsi;s+	}
 s-  info->flags &= ~(DZ_NORMAL_ACTIVE |TDZ_CALLOUT_ACTIVE |TDZ_CLOSING);n-  wake_up_interruptible (&info->close_wait);n+	iUR		tty->count == 1) && (info->count != 1)) {
+		/*
+		 * Uh, oh.  tty->count is 1,Twhich mea*s that the tty s ructure
+		 * will be freed.  Info->count should always beRone in these
+		 * conditt *s.  If it's greater than one, we've got real
+		 * problems, since it mea*s the serial port won't be shutdown.
+		 */s+		printk("dz_close: bad serial port count; tty->count is 1,T"
+		       "info->count is %d\n", info->count);
+		info->count = 1;
+	}
 s-  restore_flags (flags);n+	iUR	--info->count < 0) {n+		printk("ds_close: bad serial port count f_S ttyS%02d: %d\n",s+		       info->line, info->count);
+		info->count = 0;s+	}
+n+	iUR	info->count) {
+		restore_flags(flags);s+		retnsi;s+	}
+	info->flags |=TDZ_CLOSING;
+	/*
+	 *RSave the termios s ructure, since thisCport may have
+	 *Rsepar pe termios f_S callout and dtalin.
+	 */s+	iUR	info->flags &TDZ_NORMAL_ACTIVE)
+		info->normal_termios = *tty->termios;s+	iUR	info->flags &TDZ_CALLOUT_ACTIVE)
+		info->callout_termios = *tty->termios;s+	/*
+	 *RNow we wait f_S the transmit buffer to clear; and we notify the line
+	 *Rdiscipline to only process XON/XOFF characters.
+	 */s+	tty->closing = 1;
+n+	iUR	info->closing_wait !=TDZ_CLOSING_WAIT_NONE)n+		tty_wait_until_sent(tty, info->closing_wait);n+s+	/*
+	 *RAt thisCpoint we y op accepting input.  To do this, we disable the
+	 *Rreceive line y  pus interrupts.
+	 */s+	shutdown(info);s+s+	ifR	tty->driver.flush_buffer)
+		tty->driver.flush_buffer (tty);
+	ifR	tty->ldisc.flush_buffer)
+		tty->ldisc.flush_buffer (tty);
+	tty->closing = 0;n+	info->event = 0;n+	info->tty = 0;s+
+	ifR	tty->ldisc.num !=Tldiscs[N_TTY].num) {
+		iUR	tty->ldisc.close)
+			tty->ldisc.close(tty);s+		tty->ldisc =Tldiscs[N_TTY];s+		tty->termios->c_line = N_TTY;
+		iUR	tty->ldisc.open)
+			tty->ldisc.open(tty);
+	}
+	iUR	info->blocked_open) {
+		iUR	info->close_delay) {s+			current->y  pe = TASK_INTERRUPTIBLE;s+			schedule_timeout(info->close_delay);s+		}s+		wake_up_interruptible(&info->open_wait);n+	}
+n+	info->flags &= ~(DZ_NORMAL_ACTIVE |TDZ_CALLOUT_ACTIVE |TDZ_CLOSING);n+	wake_up_interruptible(&info->close_wait);n+n+	restore_flags(flags);s }
 o /*
@@ -1105,15 +1152,15 @@s  */n y  pF TES < dz_hangup (s ruct tty_s ruct *tty)
 {n-  s ruct dz_serial *info = (s ruct dz_serial *)tty->driver_data;
+	s ruct dz_serial *info = (s ruct dz_serial *) tty->driver_data;
   
-  dz_flush_buffer (tty);s-  shutdown (info);s-  info->event = 0;n-  info->count = 0;s-  info->flags &= ~(DZ_NORMAL_ACTIVE |TDZ_CALLOUT_ACTIVE);n-  info->tty = 0;s-  wake_up_interruptible (&info->open_wait);n+	dz_flush_buffer(tty);
+	shutdown(info);s+	info->event = 0;n+	info->count = 0;s+	info->flags &= ~(DZ_NORMAL_ACTIVE |TDZ_CALLOUT_ACTIVE);n+	info->tty = 0;s+	wake_up_interruptible(&info->open_wait);n }
 o /*
@@ -1121,101 +1168,103 @@s  * rs_open() and friends
  * ------------------------------------------------------------
  */s-y  pF Tint block_til_ready (s ruct tty_s ruct *tty,Ts ruct fi 
 *fi p, s ruct dz_serial *info)
+y  pF Tint block_til_ready(s ruct tty_s ruct *tty,Ts ruct fi 
 *fi p,
+                           s ruct dz_serial *info)
 {n-  DECLARE_WAITQUEUE(wait, current); n-  int retval;n-  int do_clocal = 0;s-
-  /*
-   * If the device is in the midd 
 of beingCclosed, then block
-   * until it's done, and then try again.
-   */s-RRiUR	info->flags &TDZ_CLOSING) {
-RRRRinterruptible_sleep_on (&info->close_wait);n-    retnsi -EAGAIN;s-  }
-
-  /*
-   * If this is a callout device, then just make sure the normal
-   * device isn't beingCused.
-   */s-RRiUR	tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
-RRRRiUR	info->flags &TDZ_NORMAL_ACTIVE)
-      retnsi -EBUSY;s+	DECLARE_WAITQUEUE(wait, current); n+	int retval;n+	int do_clocal = 0;s+s+	/*
+	 *RIURthe device is in the midd 
 of beingCclosed, then block
+	 *Runtil it's done, and then try again.
+	 */s+	iUR	info->flags &TDZ_CLOSING) {
+		interruptible_sleep_on(&info->close_wait);n+		retnsi -EAGAIN;s+	}
+n+	/*
+	 *RIURthis is a callout device, then just make sure the normal
+	 *Rdevice isn't beingCused.
+	 */s+	iUR	tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+		iUR	info->flags &TDZ_NORMAL_ACTIVE)
+			retnsi -EBUSY;s     n-    iUR		info->flags &TDZ_CALLOUT_ACTIVE) &&s-		info->flags &TDZ_SESSION_LOCKOUT) &&s-		info->sesst * !=Tcurrent->yesst *))
-      retnsi -EBUSY;s+		iUR		info->flags &TDZ_CALLOUT_ACTIVE) &&s+		    	info->flags &TDZ_SESSION_LOCKOUT) &&s+		    	info->sesst * !=Tcurrent->yesst *))
+			retnsi -EBUSY;s     n-    iUR		info->flags &TDZ_CALLOUT_ACTIVE) &&s-		info->flags &TDZ_PGRP_LOCKOUT) &&s-		info->pgrp !=Tcurrent->pgrp))
-      retnsi -EBUSY;s-    info->flags |=TDZ_CALLOUT_ACTIVE;s-    retnsi 0;
-  }
-
-  /*
-   * If non-blockingCmode is set, _S the port is not enabled,
-   * then make the check up front and then exit.
-   */s-RRiUR	(fi p->f_flags &TO_NONBLOCK) ||
-      (tty->flags &T(1 << TTY_IO_ERROR))) {
-RRRRiUR	info->flags &TDZ_CALLOUT_ACTIVE)
-      retnsi -EBUSY;s-    info->flags |=TDZ_NORMAL_ACTIVE;s-    retnsi 0;
-  }
-
-  iUR	info->flags &TDZ_CALLOUT_ACTIVE) {
-RRRRiUR	info->normal_termios.c_cflag &TCLOCAL)s-      do_clocal = 1;s-  } )lse {n-RRRRiUR	tty->termios->c_cflag &TCLOCAL)s-      do_clocal = 1;s-  }
-
-  /*
-   * Block waitingCf_S the carrierRdetect and the line to become
-   * free (i.e., not in use by the callout).  Whi 
 we are in
-   * this loop, info->count is dropped by one, so that
-   * dz_close() knows when to free things.  We restore it upon
-   * exit, either normal _S abnormal.
-   */s-RRretval = 0;s-RRadd_wait_queue (&info->open_wait, &wait);n-s-  info->count--;n-  info->blocked_open++;s-  whi 
 (1) {s-    set_current_y  pe(TASK_INTERRUPTIBLE);
-RRRRiUR	tty_hung_up_p (fi p) || !	info->is_inittalized)) {n-      retval = -EAGAIN;s-      break;s-    }s-    iUR	!	info->flags &TDZ_CALLOUT_ACTIVE) &&s-	!	info->flags &TDZ_CLOSING) && do_clocal)s-      break;s-    iUR	signal_pendingC(current)) {n-      retval = -ERESTARTSYS;s-      break;s-    }s-    schedule();n-  }
+		iUR		info->flags &TDZ_CALLOUT_ACTIVE) &&s+		    	info->flags &TDZ_PGRP_LOCKOUT) &&s+		    	info->pgrp !=Tcurrent->pgrp))
+			retnsi -EBUSY;s+
+		info->flags |=TDZ_CALLOUT_ACTIVE;s+		retnsi 0;s+	}
+n+	/*
+	 *RIURnon-blockingCmode is set, _S the port is not enabled, then make
+	 * the check up front and then exit.
+	 */s+	iUR	(fi p->f_flags &TO_NONBLOCK) ||
+	    (tty->flags &T(1 << TTY_IO_ERROR))) {
+		iUR	info->flags &TDZ_CALLOUT_ACTIVE)
+			retnsi -EBUSY;s+		info->flags |=TDZ_NORMAL_ACTIVE;s+s+		retnsi 0;s+	}
+n+	iUR	info->flags &TDZ_CALLOUT_ACTIVE) {
+		iUR	info->normal_termios.c_cflag &TCLOCAL)s+			do_clocal = 1;s+	} )lse {n+		iUR	tty->termios->c_cflag &TCLOCAL)s+		do_clocal = 1;s+	}
+n+	/*
+	 *RBlock waitingCf_S the carrierRdetect and the line to become free
+	 *R(i.e., not in use by the callout).  Whi 
 we are in this loop,
+	 *Rinfo->count is dropped by one, so that dz_close() knows when to free
+	 * things.  We restore it upon exit, either normal _S abnormal.
+	 */s+	retval = 0;s+	add_wait_queue(&info->open_wait, &wait);n+n+	info->count--;n+	info->blocked_open++;s+	whi 
 (1) {s+		set_current_y  pe(TASK_INTERRUPTIBLE);
+		iUR	tty_hung_up_p (fi p) || !	info->is_inittalized)) {n+			retval = -EAGAIN;s+			break;s+		}
+		iUR	!	info->flags &TDZ_CALLOUT_ACTIVE) &&s+		    !	info->flags &TDZ_CLOSING) && do_clocal)s+			break;s+		iUR	signal_pending(current)) {n+			retval = -ERESTARTSYS;s+			break;s+		}
+		schedule();n+	}
 		
-  current->y  pe = TASK_RUNNING;
-  remove_wait_queue (&info->open_wait, &wait);n-  iUR	!tty_hung_up_p(fi p))
-    info->count++;s-  info->blocked_open--;n-
-  iUR	retval)
-    retnsi retval;n-  info->flags |=TDZ_NORMAL_ACTIVE;s-  retnsi 0;
-}       s+	current->y  pe = TASK_RUNNING;
+	remove_wait_queue (&info->open_wait, &wait);n+	iUR	!tty_hung_up_p(fi p))
+		info->count++;s+	info->blocked_open--;n+
+	iUR	retval)
+		retnsi retval;n+	info->flags |=TDZ_NORMAL_ACTIVE;s+	retnsi 0;s+}
 o /*
  * This routine is called whenever a serial port is opened.  It
@@ -1224,201 +1273,220 @@s  */n y  pF Tint dz_open (s ruct tty_s ruct *tty,Ts ruct fi 
 *fi p)
 {n-  s ruct dz_serial *info;n-  int retval, line;n-n-  line = MINOR	tty->device) - tty->driver.minor_start;n-s-  /* The dz linesCf_S the mouse/keyboard must be
-   * opened usingCtheir respective drivers.
-   */s-RRiUR	(line < 0) || (line >=TDZ_NB_PORT))
-    retnsi -ENODEV;s+	s ruct dz_serial *info;n+	int retval, line;n s-RRiUR	(line ==TDZ_KEYBOARD) || (line ==TDZ_MOUSE))
-    retnsi -ENODEV;s+	line = MINOR	tty->device) - tty->driver.minor_start;n s-  info =Tlines[line];n-  info->count++;s-
-  tty->driver_data = info;n-  info->tty = tty;s-
-  /*
-   * Start up serial port
-   */s-RRretval = y  rtup (info);s-  iUR	retval)
-    retnsi retval;n+	/*
+	 *RThe dz linesCf_S the mouse/keyboard must be opened usingCtheir
+	 *Rrespective drivers.
+	 */s+	iUR	(line < 0) || (line >=TDZ_NB_PORT))
+		retnsi -ENODEV;s s+	iUR	(line ==TDZ_KEYBOARD) || (line ==TDZ_MOUSE))
+		retnsi -ENODEV;s s+	info =Tlines[line];n+	info->count++;s 
-  retval = block_til_ready (tty,Tfi p, info);s-  iUR	retval)
-    retnsi retval;n+	tty->driver_data = info;n+	info->tty = tty;s s-RRiUR	(info->count == 1) && (info->flags &TDZ_SPLIT_TERMIOS)) {
-RRRRiUR	tty->driver.subtype == SERIAL_TYPE_NORMAL)s-      *tty->termios = info->normal_termios;s-    else s-      *tty->termios = info->callout_termios;s-    change_speed (info);s+	/*
+	 *RStart up serial port
+	 */s+	retval = y  rtup (info);s+	iUR	retval)
+		retnsi retval;n+s+	retval = block_til_ready (tty,Tfi p, info);s+	iUR	retval)
+		retnsi retval;n+s+	iUR	(info->count == 1) && (info->flags &TDZ_SPLIT_TERMIOS)) {
+		iUR	tty->driver.subtype == SERIAL_TYPE_NORMAL)s+			*tty->termios = info->normal_termios;s+		else s+			*tty->termios = info->callout_termios;s+		change_speed(info);s+	}
 s-  }
+	info->sesst * =Tcurrent->yesst *;n+	info->pgrp =Tcurrent->pgrp;
 s-  info->sesst * =Tcurrent->yesst *;n-  info->pgrp =Tcurrent->pgrp;
-  retnsi 0;s+	retnsi 0;
 }
 o y  pF TES < show_serial_verst * (ES <)
 {n-  printk("%s%s\n", dz_name, dz_verst *);s+	printk("%s%s\n", dz_name, dz_verst *);s }
 o 
 int __init dz_init(ES <)
 {n-  int i;
-  unsigned long flags;n-  s ruct dz_serial *info;n-s-  /* Setup base handler, and timer table. */s-  init_bh (SERIAL_BH, do_serial_bh);n-s-  show_serial_verst * ();n-s-  memyet(&serial_driver, 0, sizeof(s ruct tty_driver));s-  serial_driver.magic =TTTY_DRIVER_MAGIC;s-  serial_driver.name =T"ttyS";s-  serial_driver.major = TTY_MAJOR;s-  serial_driver.minor_start = 64;s-  serial_driver.num =TDZ_NB_PORT;s-  serial_driver.type = TTY_DRIVER_TYPE_SERIAL;n-  serial_driver.subtype = SERIAL_TYPE_NORMAL;n-  serial_driver.init_termios = tty_s d_termios;s-n-  serial_driver.init_termios.c_cflag =RB9600 | CS8 | CREAD | HUPCL | CLOCAL;n-  serial_driver.flags = TTY_DRIVER_REAL_RAW;n-  serial_driver.refcount = &serial_refcount;s-  serial_driver.table = serial_table;s-  serial_driver.termios = serial_termios;s-  serial_driver.termios_locked = serial_termios_locked;s-n-  serial_driver.open = dz_open;s-  serial_driver.close = dz_close;s-  serial_driver.write = dz_write;n-  serial_driver.flush_chars = dz_flush_chars;s-  serial_driver.write_room = dz_write_room;s-  serial_driver.chars_in_buffer = dz_chars_in_buffer;n-  serial_driver.flush_buffer = dz_flush_buffer;n-  serial_driver.ioctl = dz_ioctl;s-  serial_driver.throttle = dz_throttle;s-  serial_driver.unthrottle = dz_unthrottle;n-  serial_driver.send_xchar = dz_send_xchar;n-  serial_driver.set_termios = dz_set_termios;n-  serial_driver.s op = dz_s op;n-  serial_driver.s art = dz_start;n-  serial_driver.hangup = dz_hangup;s-
-  /*
-   * The callout device is just like normal device except for
-   * major number and the subtype code.
-   */s-RRcallout_driver = serial_driver;s-RRcallout_driver.name =T"cua";s-RRcallout_driver.major = TTYAUX_MAJOR;s-  callout_driver.subtype = SERIAL_TYPE_CALLOUT;s-
-  ifR	tty_register_driver (&serial_driver))
-    panic("Couldn't register serial driver\n");
-  ifR	tty_register_driver (&callout_driver))
-    panic("Couldn't register callout driver\n");
-  save_flags(flags); cli();s- 
-  f_S (i=0; i < DZ_NB_PORT;  i++)  n-    {n-      info = &multi[i]; s-      lines[i] = info;n-    info->magic =TSERIAL_MAGIC;s-s-      iUR	(mips_machtype == MACH_DS23100) || (mips_machtype == MACH_DS5100)) n-      info->port = (unsigned long) KN01_DZ11_BASE;s-     Telse s-      info->port = (unsigned long) KN02_DZ11_BASE;s-n-    info->line = i;n-    info->tty = 0;s-    info->close_delay = 50;s-    info->closing_wait = 3000;s-    info->x_char = 0;s-    info->event = 0;n-    info->count = 0;s-    info->blocked_open = 0;s-    info->tqueue.routine = do_softint;s-    info->tqueue.data = info;n-    info->tqueue_hangup.routine = do_serial_hangup;s-    info->tqueue_hangup.data = info;n-    info->callout_termios = callout_driver.init_termios;
-    info->normal_termios = serial_driver.init_termios;
-    init_waitqueue_head(&info->open_wait); 
-    init_waitqueue_head(&info->close_wait); s-s-    /*RIURwe are pointingCtoRaddress zero then punt - not correctly
-       yet up in yetup.cCtoRhandle this. */s-    iUR	! info->port)s-      retnsi 0;s+	int i, flags;n+	s ruct dz_serial *info;n 
-    printk("ttyS%02d at 0x%04x (irq = %d)\n", info->line, info->port,TSERIAL);n-  }
+	/* Setup base handler, and timer table. */s+	init_bh(SERIAL_BH, do_serial_bh);n 
-  /* reset the chip */s+	show_serial_verst *();n+s+	memyet(&serial_driver, 0, sizeof(s ruct tty_driver));s+	serial_driver.magic =TTTY_DRIVER_MAGIC;s+#iUR	LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
+	serial_driver.name =T"ttyS";s+#elsen+	serial_driver.name =T"tts/%d";s+#endifs+	serial_driver.major = TTY_MAJOR;s+	serial_driver.minor_start = 64;s+	serial_driver.num =TDZ_NB_PORT;s+	serial_driver.type = TTY_DRIVER_TYPE_SERIAL;n+	serial_driver.subtype = SERIAL_TYPE_NORMAL;n+	serial_driver.init_termios = tty_s d_termios;s+n+	serial_driver.init_termios.c_cflag =RB9600 | CS8 | CREAD | HUPCL |s+	                                     CLOCAL;n+	serial_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;n+	serial_driver.refcount = &serial_refcount;s+	serial_driver.table = serial_table;s+	serial_driver.termios = serial_termios;s+	serial_driver.termios_locked = serial_termios_locked;s+n+	serial_driver.open = dz_open;s+	serial_driver.close = dz_close;s+	serial_driver.write = dz_write;n+	serial_driver.flush_chars = dz_flush_chars;s+	serial_driver.write_room = dz_write_room;s+	serial_driver.chars_in_buffer = dz_chars_in_buffer;n+	serial_driver.flush_buffer = dz_flush_buffer;n+	serial_driver.ioctl = dz_ioctl;s+	serial_driver.throttle = dz_throttle;s+	serial_driver.unthrottle = dz_unthrottle;n+	serial_driver.send_xchar = dz_send_xchar;n+	serial_driver.set_termios = dz_set_termios;n+	serial_driver.s op = dz_s op;n+	serial_driver.s art = dz_start;n+	serial_driver.hangup = dz_hangup;s+n+	/*
+	 *RThe callout device is just like normal device except for major
+	 *Rnumber and the subtype code.
+	 */s+	callout_driver = serial_driver;s+#iUR	LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
+	callout_driver.name =T"cua";s+#elsen+	callout_driver.name =T"cua/%d";s+#endifs+	callout_driver.major = TTYAUX_MAJOR;s+	callout_driver.subtype = SERIAL_TYPE_CALLOUT;s+n+	iUR	tty_register_driver (&serial_driver))
+		panic("Couldn't register serial driver\n");
+	iUR	tty_register_driver (&callout_driver))
+		panic("Couldn't register callout driver\n");
+s+	save_flags(flags); cli();s+	f_S (i=0; i < DZ_NB_PORT;  i++) {
+		info = &multi[i]; s+		lines[i] = info;n+		info->magic =TSERIAL_MAGIC;s+
+		iUR		mips_machtype == MACH_DS23100) ||s+		    	mips_machtype == MACH_DS5100)) n+			info->port = (unsigned long) KN01_DZ11_BASE;s+		else s+			info->port = (unsigned long) KN02_DZ11_BASE;s+
+		info->line = i;n+		info->tty = 0;s+		info->close_delay = 50;s+		info->closing_wait = 3000;s+		info->x_char = 0;s+		info->event = 0;n+		info->count = 0;s+		info->blocked_open = 0;s+		info->tqueue.routine = do_softint;s+		info->tqueue.data = info;n+		info->tqueue_hangup.routine = do_serial_hangup;s+		info->tqueue_hangup.data = info;n+		info->callout_termios = callout_driver.init_termios;
+		info->normal_termios = serial_driver.init_termios;
+		init_waitqueue_head(&info->open_wait); 
+		init_waitqueue_head(&info->close_wait); s+
+		/*
+		 * IURwe are pointingCtoRaddress zero then punt - not correctly
+		 * yet up in yetup.cCtoRhandle this.
+		 */s+		iUR	! info->port)s+			retnsi 0;s+s+		printk("ttyS%02d at 0x%08x (irq = %d)\n", info->line,s+		       info->port,TSERIAL);n+
+		tty_register_devfs(&serial_driver, 0,
+		                   serial_driver.minor_start + info->line);s+		tty_register_devfs(&callout_driver, 0,
+		                   callout_driver.minor_start + info->line);s+	}
+n+	/* Reset the chip */s #iUndef CONFIG_SERIAL_CONSOLEs-  dz_out(info,TDZ_CSR,TDZ_CLR);
-  whi 
 ((tmp = dz_in(info,DZ_CSR)) &TDZ_CLR) ;
-  wbflush();s+	{
+		int tmp;
+		dz_out(info,TDZ_CSR,TDZ_CLR);
+		whi 
 ((tmp = dz_in(info,DZ_CSR)) &TDZ_CLR);
+		wbflush();s   n-  /* enable scanningC*/s-   dz_out(info,TDZ_CSR,TDZ_MSE); 
+		/* Enable scanningC*/s+		dz_out(info,TDZ_CSR,TDZ_MSE); 
+	}s #endifs   n-  /* order matters here... the trick is that flagss-     is updated... ii request_irq -CtoRimmediatedly obliter pes-     it is unwise. */s-  restore_flags(flags);s- s+	/*
+	 *ROrder matters here... the trick is that flags is updated... ii
+	 *Rrequest_irq -CtoRimmediatedly obliter pe it is unwise.
+	 */s+	restore_flags(flags);s s-  iUR	request_irq (SERIAL, dz_interrupt,TSA_INTERRUPT, "DZ", lines[0]))
-    panic ("Unable toRregister DZRinterrupt\n");
+	iUR	request_irq(SERIAL, dz_interrupt,TSA_INTERRUPT, "DZ", lines[0]))
+		panic("Unable toRregister DZRinterrupt\n");
  s-  retnsi 0;s+	retnsi 0;
 }
 o #iUdef CONFIG_SERIAL_CONSOLEs y  pF TES < dz_console_put_char (unsigned char ch)
 {n-  unsigned long flags;n-  int  loops = 2500;s-  unsigned short tmp = ch;
-  /* this code sends s uff out toRserial device - spinningCitss-      wheels and waiting. */s+	unsigned long flags;n+	int  loops = 2500;s+	unsigned short tmp = ch;
+	/*
+	 *Rthis code sends s uff out toRserial device - spinningCits wheels and
+	 *Rwaiting.
+	 */s 
-  /* f_Sce the issue - point it at lines[3]*/s-  dz_console=&multi[CONSOLE_LINE];
+	/* f_Sce the issue - point it at lines[3]*/s+	dz_console = &multi[CONSOLE_LINE];
 
-  save_flags(flags);n-  cli();s-  s+	save_and_cli(flags);n 
-  /* spin our wheels */s-  whi 
 (((dz_in(dz_console,DZ_CSR) &TDZ_TRDY) !=TDZ_TRDY) &&  loops--)
-    ;
+	/* spin our wheels */s+	whi 
 (((dz_in(dz_console, DZ_CSR) &TDZ_TRDY) !=TDZ_TRDY) &&  loops--)
+		;s   n-  /* Actually transmit the character. */s-  dz_out (dz_console, DZ_TDR, tmp);n+	/* Actually transmit the character. */s+	dz_out(dz_console, DZ_TDR, tmp);n s-  restore_flags(flags); s+	restore_flags(flags); 
 }
+o /* 
  * -------------------------------------------------------------------
  * dz_console_print ()
@@ -1432,19 +1500,18 @@s 			      unsigned int count)
 {n #iUdef DEBUG_DZn-  prom_printf((char *)str);s+	prom_printf((char *)str);s #endifs-  whi 
 (count--) n-    {n-    iUR	*str == '\n')
-	dz_console_put_char ('\r');
-      dz_console_put_char (*str++);n-  }
+	whi 
 (count--) {
+		iUR	*str == '\n')
+			dz_console_put_char('\r');
+		dz_console_put_char(*str++);n+	}
 }s o y  pF Tint dz_console_wait_key(s ruct console *co)
 {n-    retnsi 0;s+	retnsi 0;
 }
 o y  pF Tkdev_t dz_console_device(s ruct console *c)
@@ -1454,17 +1521,17 @@s o y  pF Tint __init dz_console_yetup(s ruct console *co,Tchar *optt *s)
 {n-  	int	baud = 9600;n-	int	bits = 8;n-	int	parity = 'n';n-	int	cflag =RCREAD | HUPCL | CLOCAL;n-	char	*s;n+	int baud = 9600;n+	int bits = 8;n+	int parity = 'n';n+	int cflag =RCREAD | HUPCL | CLOCAL;n+	char *s;n 	unsigned short mask,tmp;
 n 	iUR	optt *s) {n 		baud = simple_ytrtoul	optt *s, NULL, 10);s 		s = optt *s;n-		whi 
(*s >=T'0' && *s <=T'9')
+		whi 
 (*s >=T'0' && *s <=T'9')
 			s++;s 		iUR	*s)
 			parity = *s++;s@@ -1473,9 +1540,9 @@s 	}
 s 	/*
-	 *	Now cons ruct a cflag yetting.
+	 * Now cons ruct a cflag yetting.
 	 */s-	switch(baud) {
+	switch (baud) {
 	case 1200:
 		cflag |=TDZ_B1200;s 		break;s@@ -1490,7 +1557,7 @@s 		cflag |=TDZ_B9600;n 		break;s 	}
-	switch(bits) {
+	switch (bits) {
 	case 7:
 		cflag |=TDZ_CS7;s 		break;s@@ -1499,11 +1566,13 @@s 		cflag |=TDZ_CS8;n 		break;s 	}
-	switch(parity) {
-	case 'o': case 'O':
+	switch (parity) {
+	case 'o':
+	case 'O':
 		cflag |=TDZ_PARODD;n 		break;s-	case 'e': case 'E':
+	case 'e':
+	case 'E':
 		cflag |=TDZ_PARENB;n 		break;s 	}
@@ -1511,45 +1580,44 @@s o 	/* TOFIX: f_Sce to console line */s 	dz_console = &multi[CONSOLE_LINE];
-    	iUR	(mips_machtype == MACH_DS23100) || (mips_machtype == MACH_DS5100)) n-	dz_console->port = KN01_DZ11_BASE;s-     T 	else s-       		dz_console->port = KN02_DZ11_BASE; s+	iUR	(mips_machtype == MACH_DS23100) || (mips_machtype == MACH_DS5100)) n+		dz_console->port = KN01_DZ11_BASE;s+	else s+		dz_console->port = KN02_DZ11_BASE; s 	dz_console->line = CONSOLE_LINE;
 n 	dz_out(dz_console, DZ_CSR,TDZ_CLR);
 	whi 
 ((tmp = dz_in(dz_console,DZ_CSR)) &TDZ_CLR)s-	  ;
+		;s o 	/* enable scanningC*/s 	dz_out(dz_console, DZ_CSR,TDZ_MSE); 
 s-        /*  Set up flags... */s+	/*  Set up flags... */s 	dz_console->cflags = 0;n 	dz_console->cflags |=TDZ_B9600;n 	dz_console->cflags |=TDZ_CS8;n 	dz_console->cflags |=TDZ_PARENB;n-	dz_out (dz_console, DZ_LPR, dz_console->cflags);n+	dz_out(dz_console, DZ_LPR, dz_console->cflags);n o 	mask = 1 << dz_console->line;n-	tmp = dz_in (dz_console, DZ_TCR);       /* read the TX flag */s+	tmp = dz_in (dz_console, DZ_TCR);		/* read the TX flag */s 	iUR	!	tmp & mask)) {
-	  tmp |= mask;                   /* yet the TX flag */s-	  dz_out (dz_console, DZ_TCR, tmp); s+		tmp |= mask;				/* yet the TX flag */s+		dz_out (dz_console, DZ_TCR, tmp); s 	}
-	n o 	retnsi 0;
 }
 o y  pF Ts ruct console dz_sercons = {
-	name:		"ttyS",s-	write:		dz_console_print,s-	device:		dz_console_device,s-	wait_key:	dz_console_wait_key,s-	yetup:		dz_console_yetup,s-	flags:		CON_CONSDEV | CON_PRINTBUFFER,n-	index:		CONSOLE_LINE,
+    name:	"ttyS",s+    write:	dz_console_print,s+    device:	dz_console_device,s+    wait_key:	dz_console_wait_key,s+    yetup:	dz_console_yetup,s+    flags:	CON_CONSDEV | CON_PRINTBUFFER,n+    index:	CONSOLE_LINE,
 };n o ES < __init dz_serial_console_init(ES <)
@@ -1559,3 +1627,4 @@s o #endif /* iUdef CONFIG_SERIAL_CONSOLE */s 
+MODULE_LICENSE("GPL");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/ec3104_keyb.c linux/drivers/char/ec3104_keyb.c
--- v2.4.9/linux/drivers/char/ec3104_keyb.c	Fri Apr 13 20:31:32 2001
+++ linux/drivers/char/ec3104_keyb.c	Thu Sep 13 15:21:32 2001
@@ -40,7 +40,7 @@s #include <linux/random.h>s #include <linux/poll.h>s #include <linux/miscdevice.h>s-#include <linux/malloc.h>s+#include <linux/slab.h>s #include <linux/kbd_kern.h>s #include <linux/smp_lock.h>s 
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/efirtc.c linux/drivers/char/efirtc.c
--- v2.4.9/linux/drivers/char/efirtc.c	Mon Sep 18 14:57:01 2000
+++ linux/drivers/char/efirtc.c	Thu Sep 13 15:21:32 2001
@@ -403,3 +403,5 @@s o module_init(efi_rtc_init);n module_exit(efi_rtc_exit);n+
+MODULE_LICENSE("GPL");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/epca.c linux/drivers/char/epca.c
--- v2.4.9/linux/drivers/char/epca.c	Tue Jul  3 17:08:19 2001
+++ linux/drivers/char/epca.c	Sun Sep  9 10:43:02 2001
@@ -610,9 +610,7 @@s 		                      ASYNC_CALLOUT_ACTIVE |TASYNC_CLOSING);n 		wake_up_interruptible(&ch->close_wait);n s-#iUdef MODULEn 		MOD_DEC_USE_COUNT;s-#endifs n 		restore_flags(flags);s s@@ -700,10 +698,8 @@s o 		shutdown(ch);n s-#iUdef MODULEn 		iUR	ch->count)
 			MOD_DEC_USE_COUNT;s-#endif /* MODULE */s 		n o 		ch->tty   = NULL;s@@ -1397,12 +1393,9 @@s 		retnsi(-ENODEV);s 	}
 s-#iUdef MODULEn s 	MOD_INC_USE_COUNT;s s-#endifs-
 	ch = &digi_channels[line];n 	boardnum =Tch->boardnum;s s@@ -4106,3 +4099,5 @@s } /* End init_PCI */s 
 #endif /* ENABLE_PCI */s+
+MODULE_LICENSE("GPL");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/esp.c linux/drivers/char/esp.c
--- v2.4.9/linux/drivers/char/esp.c	Wed Jul 25 17:10:19 2001
+++ linux/drivers/char/esp.c	Thu Sep 13 15:21:32 2001
@@ -83,6 +83,8 @@s y  pF Tunsigned int rx_timeout =TESP_RX_TMOUT;s y  pF Tunsigned int pio_threshold =TESP_PIO_THRESHOLD;s 
+MODULE_LICENSE("GPL");
+
 MODULE_PARM(irq, "1-8i");
 MODULE_PARM(divisor, "1-8i");
 MODULE_PARM(dma, "i");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/ftape/compressor/zftape-compress.c linux/drivers/char/ftape/compressor/zftape-compress.c
--- v2.4.9/linux/drivers/char/ftape/compressor/zftape-compress.c	Tue Nov 23 10:29:15 1999
+++ linux/drivers/char/ftape/compressor/zftape-compress.c	Thu Sep 13 15:21:32 2001
@@ -1258,14 +1258,13 @@s 	TRACE_EXIT 0;
 }
 o-n #iUdef MODULEn-#iU LINUX_VERSION_CODE >= KERNEL_VER(2,1,18)
+
 MODULE_AUTHOR(s 	"(c) 1996, 1997 Claus-Juspus Heine (claus@momo.math.rwth-aachen.de");
 MODULE_DESCRIPTION(s "Compresst * routinesCf_S zftape. Uses the lzrw3 algorithm by Ross Williams");
-#endifs+MODULE_LICENSE("GPL");
 o #iU LINUX_VERSION_CODE >= KERNEL_VER(2,1,18)
 y  pF Tint can_unload(ES <)
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/ftape/lowlevel/ftape-calibr.c linux/drivers/char/ftape/lowlevel/ftape-calibr.c
--- v2.4.9/linux/drivers/char/ftape/lowlevel/ftape-calibr.c	Fri Sep 22 14:21:16 2000
+++ linux/drivers/char/ftape/lowlevel/ftape-calibr.c	Fri Sep 14 14:40:00 2001
@@ -31,7 +31,7 @@s #include <asm/io.h>s #if defined(__alpha__)
 # include <asm/hwrpb.h>s-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
 # include <linux/timex.h>s #endifs #include <linux/ftape.h>s@@ -41,7 +41,7 @@s s #undef DEBUG
 s-#iU !defined(__alpha__) && !defined(__i386__)
+#iU !defined(__alpha__) && !defined(__i386__) && !defined(__x86_64__)
 # error Ftape is not implementedCf_S this architecture!s #endifs s@@ -70,7 +70,7 @@s s 	asm ESl pF 
 ("rpcc %0" : "=r" (r));s 	retnsi r;s-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
 	unsigned long flags;n 	__u16 lo;n 	__u16 hi;s@@ -90,7 +90,7 @@s {s #if defined(__alpha__)
 	retnsi ftape_timey  mp();s-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
 	unsigned int count;s  	unsigned long flags;n  
@@ -108,7 +108,7 @@s {s #if defined(__alpha__)
 	retnsi (t1 <=Tt0) ? t1 + (1UL << 32) - t0 : t1 - t0;s-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
 	/*
 	 * This is tricky: to workCf_S both short and full ftape_timey  mps
 	 * we'll have toRdiscrimin pe between these.
@@ -124,7 +124,7 @@s {s #if defined(__alpha__)
 	retnsi (ps_per_cycle * count) / 1000000UL;s-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
 	retnsi (10000 * count) / ((CLOCK_TICK_RATE + 50) / 100);s #endifs }
@@ -164,7 +164,7 @@s o y  pF TES < init_clock(ES <)
 {n-#if defined(__i386__)
+#if defined(__i386__) || defined(__x86_64__)
 	unsigned int t;s 	int i;
 	TRACE_FUN(ft_t_any);
@@ -214,7 +214,7 @@s 	unsigned int tc = 0;n 	unsigned int count;s 	unsigned int time;n-#if defined(__i386__)
+#if defined(__i386__) || defined(__x86_64__)
 	unsigned int old_tc = 0;n 	unsigned int old_count = 1;
 	unsigned int old_time =T1;
@@ -265,7 +265,7 @@s 		iUR	time >= 100*1000) {n 			break;s 		}
-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
 		/*
 		 *Rincrease the count until the resultingCtime nears 2/HZ,
 		 *Rthen the tc will drop sharply because we lose LATCH counts.
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/ftape/lowlevel/ftape-init.c linux/drivers/char/ftape/lowlevel/ftape-init.c
--- v2.4.9/linux/drivers/char/ftape/lowlevel/ftape-init.c	Tue Nov 23 10:29:15 1999
+++ linux/drivers/char/ftape/lowlevel/ftape-init.c	Thu Sep 13 15:21:32 2001
@@ -153,6 +153,7 @@s 	"(c) 1996, 1997 Claus-Juspus Heine (claus@momo.math.rwth-aachen.de)");
 MODULE_DESCRIPTION(s 	"QIC-117 driverCf_S QIC-40/80/3010/3020 floppy tape drives.");
+MODULE_LICENSE("GPL");
 #endifs n /*  Called by modules package when iny  llingCthe driver
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/ftape/zftape/zftape-init.c linux/drivers/char/ftape/zftape/zftape-init.c
--- v2.4.9/linux/drivers/char/ftape/zftape/zftape-init.c	Fri Feb  9 11:30:22 2001
+++ linux/drivers/char/ftape/zftape/zftape-init.c	Thu Sep 13 15:21:32 2001
@@ -59,6 +59,7 @@s 		   "Support f_S QIC-113 compatible ESlume table "s 		   "and builtin compresst * (lzrw3 algorithm)");
 MODULE_SUPPORTED_DEVICE("char-major-27");
+MODULE_LICENSE("GPL");
 n /*      Global vars.
  */
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/generic_serial.c linux/drivers/char/generic_serial.c
--- v2.4.9/linux/drivers/char/generic_serial.c	Wed Jul 25 17:10:19 2001
+++ linux/drivers/char/generic_serial.c	Thu Sep 13 15:21:32 2001
@@ -1088,3 +1088,5 @@s EXPORT_SYMBOL(gs_yetserial);
 EXPORT_SYMBOL(gs_getserial);
 EXPORT_SYMBOL(gs_got_break);n+
+MODULE_LICENSE("GPL");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/h8.c linux/drivers/char/h8.c
--- v2.4.9/linux/drivers/char/h8.c	Wed Jul 25 17:10:19 2001
+++ linux/drivers/char/h8.c	Thu Sep 13 15:21:32 2001
@@ -1176,3 +1176,6 @@s 	h8_event_mask &= (~mask);s 	restore_flags(flags);s }
+
+MODULE_LICENSE("GPL");
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/hp600_keyb.c linux/drivers/char/hp600_keyb.c
--- v2.4.9/linux/drivers/char/hp600_keyb.c	Wed Apr 11 21:24:52 2001
+++ linux/drivers/char/hp600_keyb.c	Thu Sep 13 15:21:32 2001
@@ -336,3 +336,4 @@s #endifs n 
+MODULE_LICENSE("GPL");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/i810-tco.c linux/drivers/char/i810-tco.c
--- v2.4.9/linux/drivers/char/i810-tco.c	Wed Jul 25 17:10:19 2001
+++ linux/drivers/char/i810-tco.c	Thu Sep 13 15:21:32 2001
@@ -363,3 +363,5 @@s o module_init(watchdog_init);n module_exit(watchdog_cleanup);n+
+MODULE_LICENSE("GPL");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/ip2.c linux/drivers/char/ip2.c
--- v2.4.9/linux/drivers/char/ip2.c	Thu Apr 12 12:16:35 2001
+++ linux/drivers/char/ip2.c	Thu Sep 13 15:21:32 2001
@@ -71,6 +71,8 @@s {s }s 
+MODULE_LICENSE("GPL");
+
 #else	// !MODULE 
 o #iUndef NULL
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/ip2main.c linux/drivers/char/ip2main.c
--- v2.4.9/linux/drivers/char/ip2main.c	Fri Feb 16 16:02:35 2001
+++ linux/drivers/char/ip2main.c	Thu Sep 13 15:21:32 2001
@@ -418,6 +418,7 @@s 	rirqs[iindx++] = irq;
 }
 o+#iUdef MODULEn y  pF Tint __init
 clear_requested_irq(Tchar irq )
 {n@@ -430,6 +431,7 @@s 	}
 	retnsi 0;
 }
+#endifs n y  pF Tint __init
 have_requested_irq(Tchar irq )
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/isicom.c linux/drivers/char/isicom.c
--- v2.4.9/linux/drivers/char/isicom.c	Fri Apr  6 10:42:55 2001
+++ linux/drivers/char/isicom.c	Thu Sep 13 15:21:32 2001
@@ -1927,6 +1927,7 @@s o MODULE_AUTHOR("MultiTech");
 MODULE_DESCRIPTION("DriverCf_S the ISIRseries of cards by MultiTech");
+MODULE_LICENSE("GPL");
 MODULE_PARM(io, "1-4i");
 MODULE_PARM_DESC(io, "I/O portsCf_S the cards");
 MODULE_PARM(irq, "1-4i");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/ite_gpio.c linux/drivers/char/ite_gpio.c
--- v2.4.9/linux/drivers/char/ite_gpio.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/ite_gpio.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,430 @@s+/*
+ *RFILE NAME ite_gpio.c
+ *
+ *RBRIEF MODULE DESCRIPTION
+ *R APICf_S ITE GPIO device.
+ *R DriverCf_S ITE GPIO device.
+ *
+ *R Author: MontaViy   Software, Inc.  <source@mviy  .com>
+ *R         Hai-Pao Fan <haipao@mviy  .com>
+ *
+ *RCopyright 2001 MontaViy   Software Inc.
+ *
+ *R This program is free software; you can rediy ribute  it and/or modify it
+ *R under  the terms of  the GNU General  PublF TLicense as publFshed by the
+ *R Free Software Foundatt *;  either verst * 2 of the TLicense, _S (at your
+ *R optt *) any later verst *.
+ *
+ *R THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
+ *R WARRANTIES,   INCLUDING, BUT NOT TLIMITED  TO, THE IMPLIED WARRANTIES OF
+ *R MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+ *R NO  EVENT TSHALL   THE AUTHOR  BE	LIABLE FOR ANY   DIRECT, INDIRECT,
+ *R INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *R NOTTLIMITED   TO, PROCUREMENT OF TSUBSTITUTE GOODS  OR SERVICES; LOSS OF
+ *R USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ *R ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
+ *R (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ *R THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *R You should have received a copy of the TGNU General PublF TLicense along
+ *R with thisCprogram; iURnot, write  toRthe Free Software Foundatt *, Inc.,
+ *R 675 Mass Ave, Cambridge, MA 02139, USA.
+ */s+
+#include <linux/module.h>s+#include <linux/config.h>s+#include <linux/types.h>s+#include <linux/kernel.h>s+#include <linux/miscdevice.h>s+#include <linux/init.h>s+#include <linux/ioport.h>s+#include <asm/uaccess.h>s+#include <asm/addrspace.h>s+#include <asm/it8172/it8172_int.h>s+#include <linux/sched.h>s+#include <linux/ite_gpio.h>s+s+#define ite_gpio_base 0x14013800
+s+#define	ITE_GPADR	(*(ESl pF 
 __u8 *)(0x14013800 + KSEG1))
+#define	ITE_GPBDR	(*(ESl pF 
 __u8 *)(0x14013808 + KSEG1))
+#define	ITE_GPCDR	(*(ESl pF 
 __u8 *)(0x14013810 + KSEG1))
+#define	ITE_GPACR	(*(ESl pF 
 __u16 *)(0x14013802 + KSEG1))
+#define	ITE_GPBCR	(*(ESl pF 
 __u16 *)(0x1401380a + KSEG1))
+#define	ITE_GPCCR	(*(ESl pF 
 __u16 *)(0x14013812 + KSEG1))
+#define ITE_GPAICR	(*(ESl pF 
 __u16 *)(0x14013804 + KSEG1))
+#define	ITE_GPBICR	(*(ESl pF 
 __u16 *)(0x1401380c + KSEG1))
+#define	ITE_GPCICR	(*(ESl pF 
 __u16 *)(0x14013814 + KSEG1))
+#define	ITE_GPAISR	(*(ESl pF 
 __u8 *)(0x14013806 + KSEG1))
+#define	ITE_GPBISR	(*(ESl pF 
 __u8 *)(0x1401380e + KSEG1))
+#define	ITE_GPCISR	(*(ESl pF 
 __u8 *)(0x14013816 + KSEG1))
+#define	ITE_GCR		(*(ESl pF 
 __u8 *)(0x14013818 + KSEG1))
+
+#define MAX_GPIO_LINE		21
+y  pF Tint ite_gpio_irq=IT8172_GPIO_IRQ;n+
+y  pF Tlong ite_irq_counter[MAX_GPIO_LINE];
+wait_queue_head_t ite_gpio_wait[MAX_GPIO_LINE];
+y  pF Tint ite_gpio_irq_pending[MAX_GPIO_LINE];
+
+y  pF Tint ite_gpio_debug=0;n+#define DEB(x)RRiUR	ite_gpio_debug>=1) x
+
+int ite_gpio_in(__u32 device, __u32 mask, ESl pF 
 __u32 *data)
+{s+	DEB(printk("ite_gpio_in mask=0x%x\n",mask)); s+
+	switch (device) {
+	case ITE_GPIO_PORTA:
+		ITE_GPACR = (__u16)mask;	/* 0xffff */s+		*data = ITE_GPADR;
+		break;s+	case ITE_GPIO_PORTB:
+		ITE_GPBCR = (__u16)mask;	/* 0xffff */s+		*data = ITE_GPBDR;
+		break;s+	case ITE_GPIO_PORTC:
+		ITE_GPCCR = (__u16)mask;	/* 0x03ff */s+		*data = ITE_GPCDR;
+		break;s+	default:
+		retnsi -EFAULT;s+	}
+n+	retnsi 0;s+}
+
+
+int ite_gpio_out(__u32 device, __u32 mask, __u32 data)
+{s+	switch (device) {
+	case ITE_GPIO_PORTA:
+		ITE_GPACR = (__u16)mask;	/* 0x5555 */s+		ITE_GPADR = (__u8)data;
+		break;s+	case ITE_GPIO_PORTB:
+		ITE_GPBCR = (__u16)mask;	/* 0x5555 */s+		ITE_GPBDR = (__u8)data;
+		break;s+	case ITE_GPIO_PORTC:
+		ITE_GPCCR = (__u16)mask;	/* 0x0155 */s+		ITE_GPCDR = (__u8)data;
+		break;s+	default:
+		retnsi -EFAULT;s+	}
+n+	retnsi 0;s+}
+
+int ite_gpio_int_ctrl(__u32 device, __u32 mask, __u32 data)
+{s+	switch (device) {
+	case ITE_GPIO_PORTA:
+		ITE_GPAICR = (ITE_GPAICR & ~mask) | (data & mask);
+		break;s+	case ITE_GPIO_PORTB:
+		ITE_GPBICR = (ITE_GPBICR & ~mask) | (data & mask);
+		break;s+	case ITE_GPIO_PORTC:
+		ITE_GPCICR = (ITE_GPCICR & ~mask) | (data & mask);
+		break;s+	default:
+		retnsi -EFAULT;s+	}
+n+	retnsi 0;s+}
+
+int ite_gpio_in_y  pus(__u32 device, __u32 mask, ESl pF 
 __u32 *data)
+{s+	int ret=-1;s+n+	iUR	MAX_GPIO_LINE > *data >= 0) n+		ret=ite_gpio_irq_pending[*data];
+ s+	DEB(printk("ite_gpio_in_y  pus %d ret=%d\n",*data, ret));
+s+	switch (device) {
+	case ITE_GPIO_PORTA:
+		*data = ITE_GPAISR & mask;
+		break;s+	case ITE_GPIO_PORTB:
+		*data = ITE_GPBISR & mask;
+		break;s+	case ITE_GPIO_PORTC:
+		*data = ITE_GPCISR & mask;
+		break;s+	default:
+		retnsi -EFAULT;s+	}
+n+	retnsi ret;s+}
+
+int ite_gpio_out_y  pus(__u32 device, __u32 mask, __u32 data)
+{s+	switch (device) {
+	case ITE_GPIO_PORTA:
+		ITE_GPAISR = (ITE_GPAISR & ~mask) | (data & mask);
+		break;s+	case ITE_GPIO_PORTB:
+		ITE_GPBISR = (ITE_GPBISR & ~mask) | (data & mask);
+		break;s+	case ITE_GPIO_PORTC:
+		ITE_GPCISR = (ITE_GPCISR & ~mask) | (data & mask);
+		break;s+	default:
+		retnsi -EFAULT;s+	}
+n+	retnsi 0;s+}
+
+int ite_gpio_gen_ctrl(__u32 device, __u32 mask, __u32 data)
+{s+	ITE_GCR = (ITE_GCR & ~mask) | (data & mask);
+n+	retnsi 0;s+}
+
+int ite_gpio_int_wait (__u32 device, __u32 mask, __u32 data)
+{s+	int i,line=0, ret=0;s+	unsigned long flags;n+s+	switch (device) {
+	case ITE_GPIO_PORTA:
+		line = data & mask;
+		break;s+	case ITE_GPIO_PORTB:
+		line = (data & mask) <<8;
+		break;s+	case ITE_GPIO_PORTC:
+		line = (data & mask) <<16;
+		break;s+	}s+	f_S (i=MAX_GPIO_LINE-1; i >= 0; i--) {
+		iUR	 (line) &T(1 << i))s+			break;s+	}
+n+	DEB(printk("wait device=0x%d mask=0x%x data=0x%x index %d\n", s+		device, mask, data, i));
+s+	iUR	line & ~(1<<i))
+		retnsi -EFAULT;s+n+	iUR	ite_gpio_irq_pending[i]==1)
+		retnsi -EFAULT;s+n+	save_flags (flags);n+	cli();s+	ite_gpio_irq_pending[i] = 1;s+	ret = interruptible_sleep_on_timeout(&ite_gpio_wait[i], 3*HZ);s+	restore_flags (flags);n+	ite_gpio_irq_pending[i] = 0;
+n+	retnsi ret;s+}
+
+EXPORT_SYMBOL(ite_gpio_in);
+EXPORT_SYMBOL(ite_gpio_out);
+EXPORT_SYMBOL(ite_gpio_int_ctrl);
+EXPORT_SYMBOL(ite_gpio_in_y  pus);
+EXPORT_SYMBOL(ite_gpio_out_y  pus);
+EXPORT_SYMBOL(ite_gpio_gen_ctrl);
+EXPORT_SYMBOL(ite_gpio_int_wait);n+n+y  pF Tint ite_gpio_open(s ruct inode *inode,Ts ruct fi 
 *fi e)
+{s+	unsigned int minor = MINOR	inode->i_rdev); s+	iUR	minor != GPIO_MINOR)
+		retnsi -ENODEV;s+o+#iUdef MODULEn+	MOD_INC_USE_COUNT;s+#endifs+n+	retnsi 0;s+}
+
+
+y  pF Tint ite_gpio_release(s ruct inode *inode,Ts ruct fi 
 *fi e)
+{s+o+#iUdef MODULEn+	MOD_DEC_USE_COUNT;s+#endifs+n+	retnsi 0;s+}
+
+
+y  pF Tint ite_gpio_ioctl(s ruct inode *inode,Ts ruct fi 
 *fi e,s+	unsigned int cmd, unsigned long arg)
+{s+o+	y  pF Ts ruct ite_gpio_ioctl_data ioctl_data;s+n+	iUR	copy_from_user(&ioctl_data, (s ruct ite_gpio_ioctl_data *)arg,
+			sizeof(ioctl_data)))
+		retnsi -EFAULT;s+	iUR	(ioctl_data.device < ITE_GPIO_PORTA) ||s+			(ioctl_data.device > ITE_GPIO_PORTC) )s+				retnsi -EFAULT;s+n+	switch(cmd) {
+		case ITE_GPIO_IN:s+			iUR	ite_gpio_in(ioctl_data.device, ioctl_data.mask,s+					   &ioctl_data.data))s+				retnsi -EFAULT;s+n+			iUR	copy_to_user((s ruct ite_gpio_ioctl_data *)arg,
+					 &ioctl_data, sizeof(ioctl_data)))
+				retnsi -EFAULT;s+			break;s+
+		case ITE_GPIO_OUT:s+			retnsi ite_gpio_out(ioctl_data.device,
+					ioctl_data.mask, ioctl_data.data);s+			break;s+
+		case ITE_GPIO_INT_CTRL:s+			retnsi ite_gpio_int_ctrl(ioctl_data.device,
+					ioctl_data.mask, ioctl_data.data);s+			break;s+
+		case ITE_GPIO_IN_STATUS:s+			iUR	ite_gpio_in_y  pus(ioctl_data.device, ioctl_data.mask,s+					&ioctl_data.data))s+				retnsi -EFAULT;s+			iUR	copy_to_user((s ruct ite_gpio_ioctl_data *)arg,
+					&ioctl_data, sizeof(ioctl_data))) 
+				retnsi -EFAULT;s+			break;s+
+		case ITE_GPIO_OUT_STATUS:s+			retnsi ite_gpio_out_y  pus(ioctl_data.device,
+					ioctl_data.mask, ioctl_data.data);s+			break;s+
+		case ITE_GPIO_GEN_CTRL:s+			retnsi ite_gpio_gen_ctrl(ioctl_data.device,
+					ioctl_data.mask, ioctl_data.data);s+			break;s+
+		case ITE_GPIO_INT_WAIT:s+			retnsi ite_gpio_int_wait(ioctl_data.device,
+					ioctl_data.mask, ioctl_data.data);s+			break;s+
+		default:
+			retnsi -ENOIOCTLCMD;s+
+	}n+	retnsi 0;s+}
+
+y  pF TES < ite_gpio_irq_handler(int this_irq, ES < *dev_id,Ts ruct pt_regs *regs)
+{s+	int i,line;s+
+	line = ITE_GPCISR & 0x1f;s+	f_S (i=4; i >=0; i--) {
+		iUR	 line & (1 << i)) { 
+			++ite_irq_counter[i+16];s+			ite_gpio_irq_pending[i+16] = 2;s+			wake_up_interruptible(&ite_gpio_wait[i+16]);n+n+DEB(printk("interrupt 0x%x %d\n", &ite_gpio_wait[i+16], i+16));
+s+			ITE_GPCISR = ITE_GPCISR & (1<<i);
+			retnsi;
+		}
+	}n+	line = ITE_GPBISR;s+	f_S (i=7; i >= 0; i--) {
+		iUR	 line & (1 << i)) {
+			++ite_irq_counter[i+8];s+			ite_gpio_irq_pending[i+8] = 2;s+			wake_up_interruptible(&ite_gpio_wait[i+8]);n+n+DEB(printk("interrupt 0x%x %d\n",ITE_GPBISR, i+8));
+s+			ITE_GPBISR = ITE_GPBISR & (1<<i);
+			retnsi;
+		}
+	}n+	line = ITE_GPAISR;s+	f_S (i=7; i >= 0; i--) {
+		iUR	 line & (1 << i)) {
+			++ite_irq_counter[i];s+			ite_gpio_irq_pending[i] = 2;s+			wake_up_interruptible(&ite_gpio_wait[i]);n+n+DEB(printk("interrupt 0x%x %d\n",ITE_GPAISR, i));
+s+			ITE_GPAISR = ITE_GPAISR & (1<<i);
+			retnsi;
+		}
+	}n+}
+
+y  pF Ts ruct fi 
_operatt *s ite_gpio_fops =
+{s+	owner:		THIS_MODULE,
+	ioctl:		ite_gpio_ioctl,
+	open:		ite_gpio_open,n+	release:	ite_gpio_release,n+};
+s+/* GPIO_MINOR ii include/linux/miscdevice.h */s+y  pF Ts ruct miscdevice ite_gpio_miscdev =
+{s+	GPIO_MINOR,n+	"ite_gpio",s+	&ite_gpio_fopsn+};
+s+int __init ite_gpio_init(ES <)
+{s+	int i;n+s+	misc_register(&ite_gpio_miscdev);
+s+	iUR	check_region(ite_gpio_base, 0x1c) < 0 ) {
+           retnsi -ENODEV;s+        }Telse {
+           request_region(ite_gpio_base, 0x1c, "ITE GPIO");
+        }TTTTT
+n+	/* initializeRregisters */s+        ITE_GPACR = 0xffff;s+        ITE_GPBCR = 0xffff;s+        ITE_GPCCR = 0xffff;s+        ITE_GPAICR = 0x00ff;s+        ITE_GPBICR = 0x00ff;s+        ITE_GPCICR = 0x00ff;s+        ITE_GCR = 0;
+s+	f_S (i = 0; i < MAX_GPIO_LINE; i++) {
+		ite_gpio_irq_pending[i]=0;	
+		init_waitqueue_head(&ite_gpio_wait[i]);n+	}
+	iUR	request_irq(ite_gpio_irq, ite_gpio_irq_handler,TSA_SHIRQ, "gpio", 0) < 0)
+		retnsi 0;s+	printk("GPIO at 0x%x (irq = %d)\n", ite_gpio_base, ite_gpio_irq);
+n+	retnsi 0;s+}	
+n+ES < __exit ite_gpio_exit(ES <)
+{s+	misc_deregister(&ite_gpio_miscdev);
+}
+
+module_init(ite_gpio_init);
+module_exit(ite_gpio_exit);n+
+MODULE_LICENSE("GPL");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/joyspF k/Config.ii linux/drivers/char/joyspF k/Config.ii
--- v2.4.9/linux/drivers/char/joyspF k/Config.ii	Wed Apr 11 19:02:30 2001
+++ linux/drivers/char/joyspF k/Config.ii	Wed Sep 12 15:34:06 2001
@@ -5,48 +5,45 @@s mainmenu_optt * next_comment
 comment 'JoyspF ks'
 s-dep_mbool 'JoyspF k support' CONFIG_JOYSTICK $CONFIG_INPUT
-iUR[ "$CONFIG_JOYSTICK" != "n" ];Rthens-   comment 'Game port support'
-      dep_triy  te '  ns558 gameports' CONFIG_INPUT_NS558 $CONFIG_INPUT
-      dep_triy  te '  PDPI LightningC4 gamecard' CONFIG_INPUT_LIGHTNING $CONFIG_INPUT
-      dep_triy  te '  Aureal Vortex and Trident 4DWave gameports' CONFIG_INPUT_PCIGAME $CONFIG_INPUT
-      dep_triy  te '  Cryy  l SoundFust * gameports' CONFIG_INPUT_CS461X $CONFIG_INPUT
+iUR[ "$CONFIG_INPUT" != "n" ];Rthens+   dep_triy  te 'Game port support' CONFIG_INPUT_GAMEPORT $CONFIG_INPUT
+      dep_triy  te '  ClassF TISA/PnP gameports' CONFIG_INPUT_NS558 $CONFIG_INPUT_GAMEPORT
+      dep_triy  te '  PDPI LightningC4 gamecard' CONFIG_INPUT_LIGHTNING $CONFIG_INPUT_GAMEPORT
+      dep_triy  te '  Aureal Vortex and Trident 4DWave gameports' CONFIG_INPUT_PCIGAME $CONFIG_INPUT_GAMEPORT
+      dep_triy  te '  Cryy  l SoundFust * gameports' CONFIG_INPUT_CS461X  $CONFIG_INPUT_GAMEPORT
+      dep_triy  te '  SoundBlaster Live! gameports' CONFIG_INPUT_EMU10K1 $CONFIG_INPUT_GAMEPORT
+   triy  te 'Serial port device support' CONFIG_INPUT_SERIO
+      dep_triy  te '  Serial port input lineRdiscipline' CONFIG_INPUT_SERPORT $CONFIG_INPUT_SERIO
+elsen+   # Must explicitly yet to nCf_S drivers/sound/Config.ii
+   define_triy  te CONFIG_INPUT_GAMEPORT i
+   comment 'Input core support is neededCf_S gameports'
+fi
 s-   comment 'Gameport joyspF ks'
-      dep_triy  te '  ClassF TPC analog joyspF ks and gamepads' CONFIG_INPUT_ANALOG $CONFIG_INPUT
-      dep_triy  te '  Assasii 3D and MadCatz Panther devices' CONFIG_INPUT_A3D $CONFIG_INPUT
-      dep_triy  te '  Logitech ADI digi  l joyspF ks and gamepads' CONFIG_INPUT_ADI $CONFIG_INPUT
-      dep_triy  te '  Cre pFve Labs Blaster Cobra gamepad' CONFIG_INPUT_COBRA $CONFIG_INPUT
-      dep_triy  te '  Genius Flight2000 Digi  l joyspF ks and gamepads' CONFIG_INPUT_GF2K $CONFIG_INPUT
-      dep_triy  te '  Gravis GrIP joyspF ks and gamepads' CONFIG_INPUT_GRIP $CONFIG_INPUT
-      dep_triy  te '  InterAct digi  l joyspF ks and gamepads' CONFIG_INPUT_INTERACT $CONFIG_INPUT
-      dep_triy  te '  ThrustMaster DirectConnect joyspF ks and gamepads' CONFIG_INPUT_TMDC $CONFIG_INPUT
-      dep_triy  te '  Microsoft SideWinder digi  l joyspF ks and gamepads' CONFIG_INPUT_SIDEWINDER $CONFIG_INPUT
+iUR[ "$CONFIG_INPUT" != "n" ];Rthens+   comment 'JoyspF ks'
 s-   comment 'Serial port support'
-      dep_triy  te '  Serial port input lineRdiscipline' CONFIG_INPUT_SERPORT $CONFIG_INPUTs-s-   comment 'Serial port joyspF ks'
-      dep_triy  te '  Logitech WingMan Warri_S joyspF k' CONFIG_INPUT_WARRIOR $CONFIG_INPUT
-      dep_triy  te '  LogiCad3d Magellan/SpaceMouse 6dof controller' CONFIG_INPUT_MAGELLAN $CONFIG_INPUT
-      dep_triy  te '  SpaceTec SpaceOrb/Avenger 6dof controller' CONFIG_INPUT_SPACEORB $CONFIG_INPUT
-      dep_triy  te '  SpaceTec SpaceBall 4000 FLX 6dof controller' CONFIG_INPUT_SPACEBALL $CONFIG_INPUT
-      dep_triy  te '  Gravis Stinger gamepad' CONFIG_INPUT_STINGER $CONFIG_INPUT
-      dep_triy  te '  I-F_Sce/Serial controllers' CONFIG_INPUT_IFORCE_232 $CONFIG_INPUT
-      dep_triy  te '  I-F_Sce/USB controllers' CONFIG_INPUT_IFORCE_USB $CONFIG_INPUT $CONFIG_USBs-s-   comment 'Parallel port joyspF ks'
-   iUR[ "$CONFIG_PARPORT" != "n" ];Rthens-      dep_triy  te '  Multisyspem,TSega Genesis,TSatnsi joyspF ks and gamepads' CONFIG_INPUT_DB9 $CONFIG_INPUT $CONFIG_PARPORTs-      dep_triy  te '  Multisyspem,TNES, SNES, N64, PSX joyspF ks and gamepads' CONFIG_INPUT_GAMECON $CONFIG_INPUT $CONFIG_PARPORTs-      dep_triy  te '  Multisyspem joyspF ks via TurboGraFX device' CONFIG_INPUT_TURBOGRAFX $CONFIG_INPUT $CONFIG_PARPORTs-   elsen-      comment '  Parport support is neededCf_S parallel port joyspF ks'
-   fi
+   dep_triy  te '  ClassF TPC analog joyspF ks and gamepads' CONFIG_INPUT_ANALOG $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT
+   dep_triy  te '  Assasii 3D and MadCatz Panther devices' CONFIG_INPUT_A3D $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT
+   dep_triy  te '  Logitech ADI digi  l joyspF ks and gamepads' CONFIG_INPUT_ADI $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT
+   dep_triy  te '  Cre pFve Labs Blaster Cobra gamepad' CONFIG_INPUT_COBRA $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT
+   dep_triy  te '  Genius Flight2000 Digi  l joyspF ks and gamepads' CONFIG_INPUT_GF2K $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT
+   dep_triy  te '  Gravis GrIP joyspF ks and gamepads' CONFIG_INPUT_GRIP $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT
+   dep_triy  te '  InterAct digi  l joyspF ks and gamepads' CONFIG_INPUT_INTERACT $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT
+   dep_triy  te '  ThrustMaster DirectConnect joyspF ks and gamepads' CONFIG_INPUT_TMDC $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT
+   dep_triy  te '  Microsoft SideWinder digi  l joyspF ks and gamepads' CONFIG_INPUT_SIDEWINDER $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT
+   dep_triy  te '  I-F_Sce USB joyspF ks and wheels' CONFIG_INPUT_IFORCE_USB $CONFIG_INPUT $CONFIG_USBs+   dep_triy  te '  I-F_Sce Serial joyspF ks and wheels' CONFIG_INPUT_IFORCE_232 $CONFIG_INPUT $CONFIG_INPUT_SERIO
+   dep_triy  te '  Logitech WingMan Warri_S joyspF k' CONFIG_INPUT_WARRIOR $CONFIG_INPUT $CONFIG_INPUT_SERIO
+   dep_triy  te '  LogiCad3d Magellan/SpaceMouse 6dof controller' CONFIG_INPUT_MAGELLAN $CONFIG_INPUT $CONFIG_INPUT_SERIO
+   dep_triy  te '  SpaceTec SpaceOrb/Avenger 6dof controller' CONFIG_INPUT_SPACEORB $CONFIG_INPUT $CONFIG_INPUT_SERIO
+   dep_triy  te '  SpaceTec SpaceBall 4000 FLX 6dof controller' CONFIG_INPUT_SPACEBALL $CONFIG_INPUT $CONFIG_INPUT_SERIO
+   dep_triy  te '  Gravis Stinger gamepad' CONFIG_INPUT_STINGER $CONFIG_INPUT $CONFIG_INPUT_SERIO
+   dep_triy  te '  Multisyspem,TSega Genesis,TSatnsi joyspF ks and gamepads' CONFIG_INPUT_DB9 $CONFIG_INPUT $CONFIG_PARPORTs+   dep_triy  te '  Multisyspem,TNES, SNES, N64, PSX joyspF ks and gamepads' CONFIG_INPUT_GAMECON $CONFIG_INPUT $CONFIG_PARPORTs+   dep_triy  te '  Multisyspem joyspF ks via TurboGraFX device' CONFIG_INPUT_TURBOGRAFX $CONFIG_INPUT $CONFIG_PARPORTs 
    iUR[ "$CONFIG_AMIGA" = "y" ];Rthens-   comment 'Syspem joyspF ks'
       dep_triy  te '  Amiga joyspF ks' CONFIG_INPUT_AMIJOY $CONFIG_INPUT
    fi
 elsendiff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/joyspF k/Makefi 
 linux/drivers/char/joyspF k/Makefi 

--- v2.4.9/linux/drivers/char/joyspF k/Makefi 
	Wed Apr 11 19:02:30 2001
+++ linux/drivers/char/joyspF k/Makefi 
	Wed Sep 12 15:34:06 2001
@@ -30,30 +30,34 @@s o # Each configuratt * optt * enables a list of fi 
s.
 
-obj-$(CONFIG_INPUT_SERPORT)	+=Rserport.oRserio.o
+obj-$(CONFIG_INPUT_GAMEPORT)	+=Rgameport.o
+obj-$(CONFIG_INPUT_SERIO)	+=Rserio.o
 
-obj-$(CONFIG_INPUT_NS558)	+=Rns558.oRgameport.o
-obj-$(CONFIG_INPUT_LIGHTNING)	+=Rlightning.oRgameport.o
-obj-$(CONFIG_INPUT_PCIGAME)	+=Rpcigame.oRgameport.o
-obj-$(CONFIG_INPUT_CS461X)	+=Rcs461x.oRgameport.o
+obj-$(CONFIG_INPUT_SERPORT)	+=Rserport.o
 
-obj-$(CONFIG_INPUT_WARRIOR)	+=Rwarri_S.oRserio.o
-obj-$(CONFIG_INPUT_MAGELLAN)	+=Rmagellan.oRserio.o
-obj-$(CONFIG_INPUT_SPACEORB)	+=Rspaceorb.oRserio.o
-obj-$(CONFIG_INPUT_SPACEBALL)	+=Rspaceball.oRserio.o
-obj-$(CONFIG_INPUT_STINGER)	+=Rstinger.oRserio.o
-obj-$(CONFIG_INPUT_IFORCE_232)	+=Rif_Sce.oRserio.o
+obj-$(CONFIG_INPUT_NS558)	+=Rns558.o
+obj-$(CONFIG_INPUT_LIGHTNING)	+=Rlightning.o
+obj-$(CONFIG_INPUT_PCIGAME)	+=Rpcigame.o
+obj-$(CONFIG_INPUT_CS461X)	+=Rcs461x.o
+obj-$(CONFIG_INPUT_EMU10K1)	+=Remu10k1-gp.o
+
+obj-$(CONFIG_INPUT_WARRIOR)	+=Rwarri_S.o
+obj-$(CONFIG_INPUT_MAGELLAN)	+=Rmagellan.o
+obj-$(CONFIG_INPUT_SPACEORB)	+=Rspaceorb.o
+obj-$(CONFIG_INPUT_SPACEBALL)	+=Rspaceball.o
+obj-$(CONFIG_INPUT_STINGER)	+=Rstinger.o
+obj-$(CONFIG_INPUT_IFORCE_232)	+=Rif_Sce.o
 obj-$(CONFIG_INPUT_IFORCE_USB)	+=Rif_Sce.o
 
-obj-$(CONFIG_INPUT_ANALOG)	+=Ranalog.oRgameport.o
-obj-$(CONFIG_INPUT_A3D)		+=Ra3d.oRgameport.o
-obj-$(CONFIG_INPUT_ADI)		+=Radi.oRgameport.o
-obj-$(CONFIG_INPUT_COBRA)	+=Rcobra.oRgameport.o
-obj-$(CONFIG_INPUT_GF2K)	+=Rgf2k.oRgameport.o
-obj-$(CONFIG_INPUT_GRIP)	+=Rgrip.oRgameport.o
-obj-$(CONFIG_INPUT_INTERACT)	+=Rinteract.oRgameport.o
-obj-$(CONFIG_INPUT_TMDC)	+=Rtmdc.oRgameport.o
-obj-$(CONFIG_INPUT_SIDEWINDER)	+=Rsidewinder.oRgameport.o
+obj-$(CONFIG_INPUT_ANALOG)	+=Ranalog.o
+obj-$(CONFIG_INPUT_A3D)		+=Ra3d.o
+obj-$(CONFIG_INPUT_ADI)		+=Radi.o
+obj-$(CONFIG_INPUT_COBRA)	+=Rcobra.o
+obj-$(CONFIG_INPUT_GF2K)	+=Rgf2k.o
+obj-$(CONFIG_INPUT_GRIP)	+=Rgrip.o
+obj-$(CONFIG_INPUT_INTERACT)	+=Rinteract.o
+obj-$(CONFIG_INPUT_TMDC)	+=Rtmdc.o
+obj-$(CONFIG_INPUT_SIDEWINDER)	+=Rsidewinder.os o obj-$(CONFIG_INPUT_DB9)		+=Rdb9.o
 obj-$(CONFIG_INPUT_GAMECON)	+=Rgamecon.o
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/joyspF k/a3d.c linux/drivers/char/joyspF k/a3d.c
--- v2.4.9/linux/drivers/char/joyspF k/a3d.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/char/joyspF k/a3d.c	Wed Sep 12 15:34:06 2001
@@ -1,7 +1,7 @@s /*
- * $Id:Ra3d.c,v 1.10 2000/05/29 11:19:50 vojtech Exp $
+ *R$Id:Ra3d.c,v 1.14 2001/04/26 10:24:46 vojtech Exp $
  *
- * RCopyright (c) 1998-2000 Vojtech Pavlik
+ *R Copyright (c) 1998-2001 Vojtech Pavlik
  *
  *R Sponsored by SuSE
  */
@@ -190,7 +190,7 @@s s int a3d_adc_cooked_read(s ruct gameport *gameport, int *axes, int *butt *s)
 {n-	s ruct a3d *a3d =Rgameport->driver;o+	y ruct a3d *a3d =Rgameport->priv te;s 	int i;
 	f_S (i = 0; i < 4; i++)s 		axes[i] = (a3d->axes[i] < 254) ? a3d->axes[i] : -1;
@@ -205,7 +205,7 @@s s int a3d_adc_open(s ruct gameport *gameport, int mode)
 {n-	s ruct a3d *a3d =Rgameport->driver;o+	y ruct a3d *a3d =Rgameport->priv te;s 	iUR	mode != GAMEPORT_MODE_COOKED)s 		retnsi -1;
 	iUR	!a3d->used++)s@@ -219,7 +219,7 @@s o y  pF TES < a3d_adc_close(s ruct gameport *gameport)
 {n-	s ruct a3d *a3d =Rgameport->driver;o+	y ruct a3d *a3d =Rgameport->priv te;s 	iUR	!--a3d->used)s 		del_timer(&a3d->timer);s }
@@ -323,12 +323,11 @@s 		a3d->dev.relbit[0] |= BIT(REL_X) | BIT(REL_Y);n 		a3d->dev.keybit[LONG(BTN_MOUSE)] |= BIT(BTN_RIGHT) | BIT(BTN_LEFT) | BIT(BTN_MIDDLE);n s-		a3d->adc.driverC=Ra3d;
+		a3d->adc.priv teC=Ra3d;
 		a3d->adc.openC=Ra3d_adc_open;
 		a3d->adc.closeC=Ra3d_adc_close;
 		a3d->adc.cooked_readC=Ra3d_adc_cooked_read;
 		a3d->adc.fuzz = 1; s-		a3d->adc.type = GAMEPORT_EXT; 
 s 		a3d_read(a3d, data);s s@@ -385,3 +384,5 @@s o module_init(a3d_init);n module_exit(a3d_exit);n+
+MODULE_LICENSE("GPL");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/joyspF k/adi.c linux/drivers/char/joyspF k/adi.c
--- v2.4.9/linux/drivers/char/joyspF k/adi.c	Wed Apr 11 19:02:30 2001
+++ linux/drivers/char/joyspF k/adi.c	Wed Sep 12 15:34:06 2001
@@ -553,3 +553,5 @@s o module_init(adi_init);n module_exit(adi_exit);n+
+MODULE_LICENSE("GPL");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/joyspF k/amijoy.c linux/drivers/char/joyspF k/amijoy.c
--- v2.4.9/linux/drivers/char/joyspF k/amijoy.c	Fri Feb 16 16:02:35 2001
+++ linux/drivers/char/joyspF k/amijoy.c	Wed Sep 12 15:34:06 2001
@@ -42,6 +42,7 @@s o MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
 MODULE_PARM(amijoy, "1-2i");
+MODULE_LICENSE("GPL");
 n y  pF Tint amijoy[2] = { 0, 1 };n y  pF Tint amijoy_used[2] = { 0, 0 };ndiff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/joyspF k/analog.c linux/drivers/char/joyspF k/analog.c
--- v2.4.9/linux/drivers/char/joyspF k/analog.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/char/joyspF k/analog.c	Fri Sep 14 14:40:00 2001
@@ -39,9 +39,11 @@s #include <linux/init.h>s #include <linux/input.h>s #include <linux/gameport.h>s+#include <asm/timex.h>s o MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
 MODULE_DESCRIPTION("Analog joyspF k and gamepad driverCf_S Linux");
+MODULE_LICENSE("GPL");
 n /*
  *ROptt * parsing.
@@ -135,27 +137,25 @@s  */s 
 #iUdef __i386__s-#iUdef CONFIG_X86_TSCs-#define GET_TIME(x)	__asm__ __ESl pF 
__ ( "rdtsc" : "=a" (x)R: : "dx" )
+#define TSC_PRESENT	(test_bit(X86_FEATURE_TSC, &boot_cpu_data.x86_capability))
+#define GET_TIME(x)	do { iUR	TSC_PRESENT) rdtscl(x);Telse outb(0, 0x43);Tx = inb(0x40);Tx |= inb(0x40) << 8; } whF 
 (0)n+#define DELTA(x,y)		TSC_PRESENT?((y)-(x)):((x)-(y)+((x)<(y)?1193180L/HZ:0)))
+#define TIME_NAME		TSC_PRESENT?"TSC":"PIT")
+#elif __x86_64__
+#define GET_TIME(x)	rdtscl(x)
 #define DELTA(x,y)		(y)-(x))s-#define TIME_NAME "TSC"
-#elsen-#define GET_TIME(x)	do { outb(0, 0x43);Tx = inb(0x40);Tx |= inb(0x40) << 8; } whF 
 (0)n-#define DELTA(x,y)		(x)-(y)+((x)<(y)?1193180L/HZ:0))s-#define TIME_NAME "PIT"
-#endifs+#define TIME_NAME	"TSC"
 #elif __alpha__s-#define GET_TIME(x)	__asm__ __ESl pF 
__ ( "rpcc %0" : "=r" (x) )
+#define GET_TIME(x)	get_cycles(x)
 #define DELTA(x,y)		(y)-(x))s-#define TIME_NAME "PCC"s-#endifs-
-#iUndef GET_TIMEs+#define TIME_NAME	"PCC"s+#elsen #define FAKE_TIMEs y  pF Tunsigned long analog_faketime =T0;
 #define GET_TIME(x)     do { x = analog_faketime++; } whF 
(0)n #define DELTA(x,y)		(y)-(x))s-#define TIME_NAME "Unreliable"s+#define TIME_NAME	"Unreliable"s+#warningCPrecise timer not definedCf_S this architecture.
 #endifs n /*
@@ -497,7 +497,7 @@s 	iUR	port->cooked)s 		printk(" [ADC port]\n");
 	elsen-		printk(" ["TIME_NAME" timer, %d %sHz clock, %d ns res]\n",
+		printk(" [%s timer, %d %sHz clock, %d ns res]\n", TIME_NAME,
 		port->speedC> 10000 ? (port->speedC+ 800) / 1000 : port->speed,
 		port->speedC> 10000 ? "M" : "k", (port->loop *R1000000) / port->speed);s }
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/joyspF k/cobra.c linux/drivers/char/joyspF k/cobra.c
--- v2.4.9/linux/drivers/char/joyspF k/cobra.c	Wed Apr 11 19:02:30 2001
+++ linux/drivers/char/joyspF k/cobra.c	Wed Sep 12 15:34:06 2001
@@ -248,3 +248,5 @@s o module_init(cobra_init);n module_exit(cobra_exit);n+
+MODULE_LICENSE("GPL");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/joyspF k/cs461x.c linux/drivers/char/joyspF k/cs461x.c
--- v2.4.9/linux/drivers/char/joyspF k/cs461x.c	Wed Apr 11 19:02:30 2001
+++ linux/drivers/char/joyspF k/cs461x.c	Wed Sep 12 15:34:06 2001
@@ -10,21 +10,24 @@s o #include <linux/module.h>s #include <linux/ioport.h>s+#include <linux/config.h>s #include <linux/init.h>s #include <linux/gameport.h>s #include <linux/slab.h>s #include <linux/pci.h>s o MODULE_AUTHOR("Vict_S Krapivin <vik@belcaf.minsk.by>");
+MODULE_LICENSE("GPL");
 n /*
 	These optt *s are experimental
 s-#define COOKED_MODEn #define CS461X_FULL_MAPo-n */s 
+#define COOKED_MODEn+
+
 #iUndef PCI_VENDOR_ID_CIRRUSn #define PCI_VENDOR_ID_CIRRUS            0x1013
 #endifs@@ -281,8 +284,6 @@s 	}
 	memset(port, 0, sizeof(s ruct gameport));n s-	port->io = -1;
-	port->size = -1;
 	pdev->driver_data = port;
 	
 	port->openC=Rcs461x_gameport_open;
@@ -297,9 +298,8 @@s 
 	gameport_register_port(port);n s-	printk(KERN_INFO "gameport%d: CS461x PCI", port->number);s-	iUR	port->size > 1) printk(" size %d", port->size);s-	printk(" speedC%d kHz\n", port->speed);s+	printk(KERN_INFO "gameport%d: CS461x Gameport speedC%d kHz\n",
+		port->number, port->speed);s 
 	retnsi 0;
 }
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/joyspF k/db9.c linux/drivers/char/joyspF k/db9.c
--- v2.4.9/linux/drivers/char/joyspF k/db9.c	M * Aug 14 13:55:01 2000
+++ linux/drivers/char/joyspF k/db9.c	Wed Sep 12 15:34:06 2001
@@ -41,6 +41,7 @@s #include <linux/input.h>s o MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
+MODULE_LICENSE("GPL");
 MODULE_PARM(db9, "2i");
 MODULE_PARM(db9_2, "2i");
 MODULE_PARM(db9_3, "2i");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/joyspF k/emu10k1-gp.c linux/drivers/char/joyspF k/emu10k1-gp.c
--- v2.4.9/linux/drivers/char/joyspF k/emu10k1-gp.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/joyspF k/emu10k1-gp.c	Wed Sep 12 15:34:06 2001
@@ -0,0 +1,125 @@s+/*
+ *R$Id:Remu10k1-gp.c,v 1.2 2001/04/24 07:48:56 vojtech Exp $
+ *
+ *R Copyright (c) 2001 Vojtech Pavlik
+ *
+ *R Sponsored by SuSE
+ */s+
+/*
+ *REMU10k1 - SB Live! - gameport driverCf_S Linux
+ */s+
+/*
+ *RThis program is free software; you can rediy ribute it and/or modify
+ *Rit under the terms of the GNU General PublF TLicense as publFshed by
+ *Rthe Free Software Foundatt *; either verst * 2 of the License, _S 
+ *R(at your optt *) any later verst *.
+ * 
+ *RThis program is diy ributed in the hope that it will be useful,
+ *Rbut WITHOUT ANY WARRANTY; without even the implied warranty of
+ *RMERCHANTABILITY _S FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *RGNU General PublF TLicense for more details.
+ * 
+ *RYou should have received a copy of the GNU General PublF TLicense
+ *Ralong with thisCprogram; iURnot, write toRthe Free Software
+ *RFoundatt *, Inc., 59 Temple Place, Suite 330, Bost *, MA 02111-1307 USA
+ * 
+ *RShould you need toRcontact me, the author, you can do so either by
+ *Re-mail - mail your message toR<vojtech@ucw.cz>, _S by paper mail:
+ *RVojtech Pavlik, Ucitelska 1576,CPrague 8, 182 00 Czech RepublFc
+ */s+
+#include <asm/io.h>s+s+#include <linux/module.h>s+#include <linux/ioport.h>s+#include <linux/config.h>s+#include <linux/init.h>s+#include <linux/gameport.h>s+#include <linux/slab.h>s+#include <linux/pci.h>s+
+MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
+MODULE_LICENSE("GPL");
+
+y ruct emu {
+	s ruct pci_dev *dev;o+	y ruct emu *next;o+	y ruct gameport gameport;s+	int size;n+};
+	s+y  pF Ts ruct pci_device_id emu_tbl[] __devinitdata = {
+	{ 0x1102, 0x7002, PCI_ANY_ID, PCI_ANY_ID }, /* SB Live! gameport */
+	{ 0, }
+};n+
+MODULE_DEVICE_TABLE(pci, emu_tbl);n+n+y  pF Tint __devinit emu_probe(s ruct pci_dev *pdev,RconstTs ruct pci_device_id *ent)
+{s+	int ioport, iolen;s+	int rc;o+	y ruct emu *port;s+        n+	rc =Rpci_enable_device(pdev);
+	iUR	rc) {
+		printk(KERN_ERR "emu10k1-gp: Cannot enableRemu10k1 gameport (bus %d, devfn %d) error=%d\n",
+			pdev->bus->number, pdev->devfn, rc);
+		retnsi rc;s+	}
+n+	ioport =Rpci_resource_y  rt(pdev,R0);
+	iolen =Rpci_resource_len(pdev,R0);
+
+	iUR	!request_region(ioport, iolen, "emu10k1-gp"))
+		retnsi -EBUSY;
+
+	iUR	!(port =Rkmalloc(sizeof(s ruct emu), GFP_KERNEL))) {
+		printk(KERN_ERR "emu10k1-gp: Memory allocatt * failed.\n");
+		release_region(ioport, iolen);
+		retnsi -ENOMEM;n+	}
+	memset(port, 0, sizeof(s ruct emu));
+
+	port->gameport.io = ioport;
+	port->size = iolen;s+	port->dev = pdev;s+	pdev->driver_data = port;
+
+	gameport_register_port(&port->gameport);
+
+	printk(KERN_INFO "gameport%d: Emu10k1 Gameport at %#x size %d speedC%d kHz\n",
+		port->gameport.number, port->gameport.io, iolen, port->gameport.speed);s+n+	retnsi 0;s+}
+
+y  pF TES < __devexit emu_remove(s ruct pci_dev *pdev)
+{s+	s ruct emu *port = (s ruct emu *)pdev->driver_data;
+	gameport_unregister_port(&port->gameport);
+	release_region(port->gameport.io, port->size);s+	kfree(port);n+}
+
+y  pF Ts ruct pci_driverCemu_driverC=R{
+        name:           "Emu10k1 Gameport",
+        id_table:       emu_tbl,
+        probe:          emu_probe,
+        remove:         emu_remove,n+};
+s+int __init emu_init(ES <)
+{s+	retnsi pci_module_init(&emu_driver);n+}
+
+ES < __exit emu_exit(ES <)
+{s+	pci_unregister_driver(&emu_driver);n+}
+
+module_init(emu_init);
+module_exit(emu_exit);
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/joyspF k/gamecon.c linux/drivers/char/joyspF k/gamecon.c
--- v2.4.9/linux/drivers/char/joyspF k/gamecon.c	Wed Apr 11 19:02:30 2001
+++ linux/drivers/char/joyspF k/gamecon.c	Wed Sep 12 15:34:06 2001
@@ -1,7 +1,7 @@s /*
- * $Id:Rgamecon.c,v 1.11 2000/11/01 12:38:53 vojtech Exp $
+ *R$Id:Rgamecon.c,v 1.14 2001/04/29 22:42:14 vojtech Exp $
  *
- * RCopyright (c) 1999-2000 Vojtech Pavlik
+ *R Copyright (c) 1999-2001 Vojtech Pavlik
  *
  *R Based on the work of:
  *R 	Andree Borrmann		John Dahls rom
@@ -42,6 +42,7 @@s #include <linux/input.h>s o MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
+MODULE_LICENSE("GPL");
 MODULE_PARM(gc, "2-6i");
 MODULE_PARM(gc_2,"2-6i");
 MODULE_PARM(gc_3,"2-6i");
@@ -62,7 +63,7 @@s 	s ruct pardevice *pd;s 	s ruct input_dev dev[5];s 	s ruct timer_list timer;s-	unsigned char pads[GC_PSX + 1];s+	unsigned char pads[GC_MAX + 1];s 	int used;
 };s s@@ -231,7 +232,7 @@s o y  pF Tshort gc_psx_abs[] = { ABS_X, ABS_Y, ABS_RX, ABS_RY, ABS_HAT0X, ABS_HAT0Y };n y  pF Tshort gc_psx_btn[] = { BTN_TL, BTN_TR, BTN_TL2, BTN_TR2, BTN_A, BTN_B, BTN_X, BTN_Y,n-				BTN_START, BTN_SELECT, BTN_THUMB, BTN_THUMB2 };
+				BTN_START, BTN_SELECT, BTN_THUMBL, BTN_THUMBR };s s /*
  *Rgc_psx_command() writes 8bit command and reads 8bit data from
@@ -345,8 +346,8 @@s 			s =Rgc_y  pus_bit[i];s s 			iUR	s & (gc->pads[GC_NES] | gc->pads[GC_SNES])) {
-				input_report_abs(dev + i, ABS_X, ! - !	s & data[6]) - !	s & data[7]));s-				input_report_abs(dev + i, ABS_Y, ! - !	s & data[4]) - !	s & data[5]));s+				input_report_abs(dev + i, ABS_X, !	s & data[6]) - !	s & data[7]));s+				input_report_abs(dev + i, ABS_Y, !	s & data[4]) - !	s & data[5]));s 			}s s 			iUR	s & gc->pads[GC_NES])
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/joyspF k/gameport.c linux/drivers/char/joyspF k/gameport.c
--- v2.4.9/linux/drivers/char/joyspF k/gameport.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/char/joyspF k/gameport.c	Fri Sep 14 14:40:00 2001
@@ -41,6 +41,7 @@s #include <linux/delay.h>s o MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
+MODULE_LICENSE("GPL");
 
 EXPORT_SYMBOL(gameport_register_port);
 EXPORT_SYMBOL(gameport_unregister_port);
@@ -61,7 +62,7 @@s o y  pF Tint gameport_measure_ypeed(s ruct gameport *gameport)
 {n-#iUdef __i386__s+#iU defined(__i386__) || defined(__x86_64__)s o #define GET_TIME(x)     do { outb(0, 0x43);Tx = inb(0x40);Tx |= inb(0x40) << 8; } whF 
 (0)n #define DELTA(x,y)      	(y)-(x)+	(y)<(x)?1193180L/HZ:0))sdiff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/joyspF k/gf2k.c linux/drivers/char/joyspF k/gf2k.c
--- v2.4.9/linux/drivers/char/joyspF k/gf2k.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/char/joyspF k/gf2k.c	Wed Sep 12 15:34:06 2001
@@ -357,3 +357,5 @@s o module_init(gf2k_init);n module_exit(gf2k_exit);n+
+MODULE_LICENSE("GPL");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/joyspF k/grip.c linux/drivers/char/joyspF k/grip.c
--- v2.4.9/linux/drivers/char/joyspF k/grip.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/char/joyspF k/grip.c	Wed Sep 12 15:34:06 2001
@@ -421,3 +421,5 @@s o module_init(grip_init);n module_exit(grip_exit);n+
+MODULE_LICENSE("GPL");
diff -u --recursive --new-fi 
 v2.4.9/linux/drivers/char/joyspF k/if_Sce.c linux/drivers/char/joyspF k/if_Sce.c
--- v2.4.9/linux/drivers/char/joyspF k/if_Sce.c	Wed Apr 11 19:02:30 2001
+++ linux/drivers/char/joyspF k/if_Sce.c	Wed Sep 12 15:34:06 2001
@@ -1,7 +1,8 @@s /*
- * $Id:Rif_Sce.c,v 1.7 2000/06/04 14:03:36 vojtech Exp $
+ *R$Id:Rif_Sce.c,v 1.56 2001/05/27 14:41:26 jdeneux Exp $
  *
- * RCopyright (c) 2000 Vojtech Pavlik
+ *R Copyright (c) 2000-2001 Vojtech Pavlik <vojtech@suse.cz>
+ *R Copyright (c) 2001 Johann Deneux <deneux@ifrance.com>
  *
  *R USB/RS232 I-F_Sce joyspF ks and wheels.
  *
@@ -11,18 +12,18 @@s /*
  *RThis program is free software; you can rediy ribute it and/or modify
  *Rit under the terms of the GNU General PublF TLicense as publFshed by
- *Rthe Free Software Foundatt *; either verst * 2 of the License, _S 
+ *Rthe Free Software Foundatt *; either verst * 2 of the License, _S
  *R(at your optt *) any later verst *.
- * 
+ *
  *RThis program is diy ributed in the hope that it will be useful,
  *Rbut WITHOUT ANY WARRANTY; without even the implied warranty of
  *RMERCHANTABILITY _S FITNESS FOR A PARTICULAR PURPOSE.  See the
  *RGNU General PublF TLicense for more details.
- * 
+ *
  *RYou should have received a copy of the GNU General PublF TLicense
  *Ralong with thisCprogram; iURnot, write toRthe Free Software
  *RFoundatt *, Inc., 59 Temple Place, Suite 330, Bost *, MA 02111-1307 USA
- * 
+ *
  *RShould you need toRcontact me, the author, you can do so either by
  *Re-mail - mail your message toR<vojtech@suse.cz>, _S by paper mail:
  *RVojtech Pavlik, Ucitelska 1576,CPrague 8, 182 00 Czech RepublFc
@@ -38,46 +39,216 @@s #include <linux/serio.h>s #include <linux/config.h>s 
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
-MODULE_DESCRIPTION("USB/RS232 I-F_Sce joyspF ks and wheels driver");
+/*RFF:RThis moduleCprovides arbitrary resource management routines.
+ * I use it toRmanage the device's memory.
+ * Despite the name of this module, I am *not*RgoingCtoRaccess the ioports.
+ */s+#include <linux/ioport.h>s s-#define USB_VENDOR_ID_LOGITECH		0x046ds-#define USB_DEVICE_ID_LOGITECH_WMFORCE	0xc281
+MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>, Johann Deneux <deneux@ifrance.com>");
+MODULE_DESCRIPTION("USB/RS232 I-F_Sce joyspF ks and wheels driver");
+MODULE_LICENSE("GPL");
 
-#define IFORCE_MAX_LENGTH		16
+#define IFORCE_MAX_LENGTH	16
 
 #iU defined(CONFIG_INPUT_IFORCE_232) || defined(CONFIG_INPUT_IFORCE_232_MODULE)
-#define IFORCE_232
+#define IFORCE_232	1
 #endifs #iU defined(CONFIG_INPUT_IFORCE_USB) || defined(CONFIG_INPUT_IFORCE_USB_MODULE)
-#define IFORCE_USBs+#define IFORCE_USB	2
 #endifs n+#define FF_EFFECTS_MAX	32
+
+/*REach f_Sce feedback effect is made of one core effect, whFch can be
+ *Rassociated toRat most toReffect modifiers
+ */s+#define FF_MOD1_IS_USED		0s+#define FF_MOD2_IS_USED		1s+#define FF_CORE_IS_USED		2s+#define FF_CORE_IS_PLAYED	3s+#define FF_MODCORE_MAX		3s+
+y ruct if_Sce_core_effect {n+	/* Inf_Smatt * about where modifiers are stored in the device's memory */
+	y ruct resource mod1_chunk;
+	y ruct resource mod2_chunk;
+	unsigned long flags[NBITS(FF_MODCORE_MAX)];n+};
+s+#define FF_CMD_EFFECT		0x010es+#define FF_CMD_SHAPE		0x0208s+#define FF_CMD_MAGNITUDE	0x0303s+#define FF_CMD_PERIOD		0x0407s+#define FF_CMD_INTERACT		0x050a
+s+#define FF_CMD_AUTOCENTER	0x4002s+#define FF_CMD_PLAY		0x4103s+#define FF_CMD_ENABLE		0x4201s+#define FF_CMD_GAIN		0x4301s+s+#define FF_CMD_QUERY		0xff01s+s+y  pF Tsigned short btn_joyspF k[] = { BTN_TRIGGER, BTN_TOP, BTN_THUMB, BTN_TOP2, BTN_BASE,
+	BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_BASE5, BTN_A, BTN_B, BTN_C, BTN_DEAD, -1 };
+y  pF Tsigned short btn_wheel[] =    { BTN_TRIGGER, BTN_TOP, BTN_THUMB, BTN_TOP2, BTN_BASE,
+	BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_BASE5, BTN_A, BTN_B, BTN_C, -1 };
+y  pF Tsigned short abs_joyspF k[] = { ABS_X, ABS_Y, ABS_THROTTLE, ABS_HAT0X, ABS_HAT0Y, -1 };
+y  pF Tsigned short abs_wheel[] =    { ABS_WHEEL, ABS_GAS, ABS_BRAKE, ABS_HAT0X, ABS_HAT0Y, -1 };
+y  pF Tsigned short ff_if_Sce[] =    { FF_PERIODIC, FF_CONSTANT, FF_SPRING, FF_FRICTION,
+	FF_SQUARE, FF_TRIANGLE, FF_SINE, FF_SAW_UP, FF_SAW_DOWN, FF_GAIN, FF_AUTOCENTER, -1 };
+
+y  pF Ts ruct if_Sce_device {s+	u16 idvendor;o+	u16 idproduct;n+	char *name;
+	yigned short *btn;
+	yigned short *abs;
+	yigned short *ff;s+} if_Sce_device[] = {
+	{ 0x046d, 0xc281, "Logitech WingMan F_Sce",			btn_joyspF k, abs_joyspF k, ff_if_Sce },
+	{ 0x046d, 0xc291, "Logitech WingMan F_Smula F_Sce",		btn_wheel, abs_wheel, ff_if_Sce },
+	{ 0x05ef, 0x020a, "AVB TopRShot Pegasus",			btn_joyspF k, abs_joyspF k, ff_if_Sce },
+	{ 0x05ef, 0x8884, "AVB Mag Turbo F_Sce",			btn_wheel, abs_wheel, ff_if_Sce },
+	{ 0x06f8, 0x0001, "Guillemot Race Leader F_Sce Feedback",	btn_wheel, abs_wheel, ff_if_Sce },
+	{ 0x0000, 0x0000, "Unknown I-F_Sce Device [%04x:%04x]",		btn_joyspF k, abs_joyspF k, ff_if_Sce }n+};
+sTs ruct if_Sce {n-	signed char data[IFORCE_MAX_LENGTH];n-	s ruct usb_device *usbdev;s-	s ruct input_dev dev;n-	s ruct urb irq;
+	y ruct input_dev dev;		/* Input device interface */
+	y ruct if_Sce_device *type;n+	char name[64];s 	int open;
+	int bus;s+n+	unsigned char data[IFORCE_MAX_LENGTH];n+	unsigned char edata[IFORCE_MAX_LENGTH];n+	u16 ecmd;n+	u16 expect_packet;s+o+#iUdef IFORCE_232
+	y ruct serio *serio;		/* RS232 transfer */s 	int idx, pkt, len, id;s 	unsigned char csum;s+#endifs+#iUdef IFORCE_USBs+	s ruct usb_device *usbdev;	/* USB transfer */s+	s ruct urb irq, out, ctrl;n+	devrequest dr;s+#endifs+					/*RF_Sce Feedback */s+	wait_queue_head_t wait;
+	y ruct resource device_memory;
+	y ruct if_Sce_core_effect core_effects[FF_EFFECTS_MAX];
 };s s y  pF Ts ruct {n-        __s32 x;n-        __s32 y;
+	__s32 x;n+	__s32 y;
 } if_Sce_hat_to_axis[16] = {{ 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}};s s-y  pF Tchar *if_Sce_name = "I-F_Sce joyspF k/wheel";
+/*RGet hi and low bytes of a 16-bits int */s+#define HI(a)		(unsigned char)((a) >> 8))
+#define LO(a)		(unsigned char)((a) & 0xff))
+
+/*REncode a time value */s+#define TIME_SCALE(a)		(a) == 0xffff ? 0xffff : (a) *R1000 / 256)s s-y  pF TES < if_Sce_process_packet(y ruct input_dev *dev,Runsigned char id,Tint idx, unsigned char *data)
+y  pF TES < dump_packet(char *msg, u16 cmd, unsigned char *data)
 {n-	switch (id) {
+	int i;
 s-		case 1:	/*RjoyspF k positt * data */s-		case 3: /* wheel positt * data */s+	printk(KERN_DEBUG "if_Sce.c: %s ( cmd = %04x, data = ", msg, cmd);s+	f_S (i = 0; i < LO(cmd); i++)s+		printk("%02x ", data[i]);n+	printk(")\n");
+}
 s-			iUR	id == 1) {
+/*
+ *RSend a packet of bytes toRthe device
+ */s+y  pF TES < send_packet(y ruct if_Sce *if_Sce, u16 cmd, unsigned char* data)
+{s+	switch (if_Sce->bus) {
+o+#iUdef IFORCE_232
+		case IFORCE_232: {
+o+			int i;n+			unsigned char csum = 0x2b ^ HI(cmd) ^ LO(cmd);
+o+			serio_write(if_Sce->serio, 0x2b);s+			serio_write(if_Sce->serio, HI(cmd));s+			serio_write(if_Sce->serio, LO(cmd));
+o+			f_S (i = 0; i < LO(cmd); i++) {
+				serio_write(if_Sce->serio, data[i]);n+				csum = csum ^ data[i];n+			}
+o+			serio_write(if_Sce->serio, csum);
+			retnsi;
+		}
+#endifs+#iUdef IFORCE_USBs+		case IFORCE_USB: {
+o+			DECLARE_WAITQUEUE(wait, current);o+			int timeout = HZ; /* 1 second */s+
+			memcpy(if_Sce->out.transfer_buffer + 1, data, LO(cmd));
+			((char*)if_Sce->out.transfer_buffer)[0] = HI(cmd);o+			if_Sce->out.transfer_buffer_length = LO(cmd) + 2;o+			if_Sce->out.dev = if_Sce->usbdev;s+o+			set_current_y  pe(TASK_INTERRUPTIBLE);n+			add_wait_queue(&if_Sce->wait, &wait);
+o+			iUR	usb_submit_urb(&if_Sce->out)) {
+				set_current_y  pe(TASK_RUNNING);n+				remove_wait_queue(&if_Sce->wait, &wait);
+				retnsi;
+			}
+o+			whF 
 (timeout && if_Sce->out.y  pus == -EINPROGRESS)
+				timeout = schedule_timeout(timeout);s+o+			set_current_y  pe(TASK_RUNNING);n+			remove_wait_queue(&if_Sce->wait, &wait);
+o+			iUR	!timeout)
+				usb_unlink_urb(&if_Sce->out);
+o+			retnsi;
+		}
+#endifs+	}n+}
+
+y  pF TES < if_Sce_process_packet(y ruct if_Sce *if_Sce, u16 cmd, unsigned char *data)
+{
+	y ruct input_dev *dev = &if_Sce->dev;s+	int i;n+s+#iUdef IFORCE_232
+	iUR	HI(if_Sce->expect_packet) == HI(cmd)) {
+		iU_Sce->expect_packet = 0;
+		iU_Sce->ecmd = cmd;n+		memcpy(if_Sce->edata, data, IFORCE_MAX_LENGTH);
+		iUR	waitqueue_acpFve(&if_Sce->wait))
+			wake_up(&if_Sce->wait);n+	}
+#endifs+
+	iUR	!if_Sce->type)
+		retnsi;
+o+	switch (HI(cmd)) {
+s+		case 0x01:	/*RjoyspF k positt * data */s+		case 0x03:	/*Rwheel positt * data */s+o+			iUR	HI(cmd) == 1) {
 				input_report_abs(dev, ABS_X, (__s16) (((__s16)data[1] << 8) | data[0]));s 				input_report_abs(dev, ABS_Y, (__s16) (((__s16)data[3] << 8) | data[2]));s 				input_report_abs(dev, ABS_THROTTLE, 255 - data[4]);
@@ -90,37 +261,95 @@s 			input_report_abs(dev, ABS_HAT0X, if_Sce_hat_to_axis[data[6] >> 4].x);s 			input_report_abs(dev, ABS_HAT0Y, if_Sce_hat_to_axis[data[6] >> 4].y);n s-			input_report_key(dev, BTN_TRIGGER, data[5] & 0x01);s-			input_report_key(dev, BTN_TOP,     data[5] & 0x02);s-			input_report_key(dev, BTN_THUMB,   data[5] & 0x04);s-			input_report_key(dev, BTN_TOP2,    data[5] & 0x08);s-			input_report_key(dev, BTN_BASE,    data[5] & 0x10);s-			input_report_key(dev, BTN_BASE2,   data[5] & 0x20);s-			input_report_key(dev, BTN_BASE3,   data[5] & 0x40);s-			input_report_key(dev, BTN_BASE4,   data[5] & 0x80);s-			input_report_key(dev, BTN_BASE5,   data[6] & 0x01);s-			input_report_key(dev, BTN_A,       data[6] & 0x02);s-			input_report_key(dev, BTN_B,       data[6] & 0x04);s-			input_report_key(dev, BTN_C,       data[6] & 0x08);n+			f_S (i = 0; if_Sce->type->btn[i] >= 0; i++)s+				input_report_key(dev, if_Sce->type->btn[i], data[(i >> 3) + 5] & (1 << (i & 7)));
+o 			break;
 s-		case 2: /* f_Sce feedback effect y  pus */s+		case 0x02:	/*Ry  pus report */
+o+			input_report_key(dev, BTN_DEAD, data[0] & 0x02);s 			break;
 	}s }
 s+y  pF Tint get_id_packet(y ruct if_Sce *if_Sce, char *packet)
+{
+	DECLARE_WAITQUEUE(wait, current);o+	int timeout = HZ; /* 1 second */s+
+	switch (if_Sce->bus) {
+o #iUdef IFORCE_USBs+		case IFORCE_USB:s+o+			iU_Sce->dr.request = packet[0];o+			if_Sce->ctrl.dev = if_Sce->usbdev;s+o+			set_current_y  pe(TASK_INTERRUPTIBLE);n+			add_wait_queue(&if_Sce->wait, &wait);
+o+			iUR	usb_submit_urb(&if_Sce->ctrl)) {
+				set_current_y  pe(TASK_RUNNING);n+				remove_wait_queue(&if_Sce->wait, &wait);
+				retnsi -1;
+			}
+o+			whF 
 (timeout && if_Sce->ctrl.y  pus == -EINPROGRESS)
+				timeout = schedule_timeout(timeout);s+o+			set_current_y  pe(TASK_RUNNING);n+			remove_wait_queue(&if_Sce->wait, &wait);
+o+			iUR	!timeout) {
+				usb_unlink_urb(&if_Sce->ctrl);
+				retnsi -1;
+			}
+o+			break;
+#endifs+#iUdef IFORCE_232
+		case IFORCE_232:s+o+			iU_Sce->expect_packet = FF_CMD_QUERY;s+			send_packet(if_Sce, FF_CMD_QUERY, packet);s+o+			set_current_y  pe(TASK_INTERRUPTIBLE);n+			add_wait_queue(&if_Sce->wait, &wait);
+o+			whF 
 (timeout && if_Sce->expect_packet)
+				timeout = schedule_timeout(timeout);s+o+			set_current_y  pe(TASK_RUNNING);n+			remove_wait_queue(&if_Sce->wait, &wait);
+o+			iUR	!timeout) {
+				iU_Sce->expect_packet = 0;
+				retnsi -1;
+			}
+o+			break;
+#endifs+	}
+o+	retnsi -(if_Sce->edata[0] != packet[0]);
+}
 s y  pF Tint if_Sce_open(s ruct input_dev *dev)
 {n 	y ruct if_Sce *if_Sce = dev->priv te;s s-	iUR	dev->idbus == BUS_USB && !if_Sce->open++) {
-		iU_Sce->irq.dev = if_Sce->usbdev;s-		iUR	usb_submit_urb(&if_Sce->irq))s-			retnsi -EIO;
+	switch (if_Sce->bus) {
+#iUdef IFORCE_USBs+		case IFORCE_USB:s+			iUR	if_Sce->open++)
+				break;
+			iU_Sce->irq.dev = if_Sce->usbdev;s+			iUR	usb_submit_urb(&if_Sce->irq))s+					retnsi -EIO;
+			break;
+#endifs 	}s-
 	retnsi 0;
 }
 s@@ -128,48 +357,632 @@s {n 	y ruct if_Sce *if_Sce = dev->priv te;s s-	iUR	dev->idbus == BUS_USB && !--if_Sce->open)s-		usb_unlink_urb(&if_Sce->irq);
+	switch (if_Sce->bus) {
+#iUdef IFORCE_USBs+		case IFORCE_USB:s+			iUR	!--if_Sce->open)s+				usb_unlink_urb(&if_Sce->irq);
+			break;
+#endifs+	}
 }
 s-#endifs+/*
+ *RS  rt _S stop playing an effect
+ */s+
+y  pF Tint if_Sce_input_event(y ruct input_dev *dev,Runsigned int type,Runsigned int code,Tint value)
+{
+	y ruct if_Sce* if_Sce = (y ruct if_Sce*)(dev->priv te);n+	unsigned char data[3];
+
+	printk(KERN_DEBUG "if_Sce.c: input_event(type = %d, code = %d, value = %d)\n", type,Rcode,Tvalue);
+
+	iUR	type != EV_FF)
+		retnsi -1;
+o+	switch (code) {
+s+		case FF_GAIN:s+o+			data[0] = value >> 9;s+			send_packet(if_Sce, FF_CMD_GAIN, data);s+o+			retnsi 0;
+s+		case FF_AUTOCENTER:s+o+			data[0] = 0x03;o+			data[1] = value >> 9;s+			send_packet(if_Sce, FF_CMD_AUTOCENTER, data);s+o+			data[0] = 0x04;o+			data[1] = 0x01;s+			send_packet(if_Sce, FF_CMD_AUTOCENTER, data);s+o+			retnsi 0;
+s+		default: /* Play an effect */s+o+			iUR	code >= if_Sce->dev.ff_effects_max)
+				retnsi -1;
+o+			data[0] = LO(code);o+			data[1] = (value > 0) ? ((value > 1) ? 0x41 : 0x01) : 0;o+			data[2] = LO(value);
+			send_packet(if_Sce, FF_CMD_PLAY, data);s+o+			retnsi 0;
+	}
+o+	retnsi -1;n+}
+
+/*
+ *RSetRthe magnitude of aRconstant f_Sce effect
+ * Retnsi errorRcode
+ *
+ *RNote: caller must ensure exclusive access to device
+ */s+
+y  pF Tint make_magnitude_modifier(y ruct if_Sce* if_Sce,
+	y ruct resource* mod_chunk, __s16 level)
+{
+	unsigned char data[3];
+
+	iUR	allocate_resource(&(if_Sce->device_memory), mod_chunk, 2,
+		iU_Sce->device_memory.y  rt, iU_Sce->device_memory.end, 2L,
+		NULL, NULL)) {
+		retnsi -ENOMEM;n+	}
+n+	data[0] = LO(mod_chunk->y  rt);
+	data[1] = HI(mod_chunk->y  rt);
+	data[2] = HI(level);
+o+	send_packet(if_Sce, FF_CMD_MAGNITUDE, data);s+o+	retnsi 0;s+}
+
+/*
+ *RUploadRthe component of an effect dealing with the period, phase and magnitude
+ */s+
+y  pF Tint make_period_modifier(y ruct if_Sce* if_Sce, y ruct resource* mod_chunk,n+	__s16 magnitude, __s16 offset, u16 period, u16 phase)
+{
+	unsigned char data[7];
+
+	period = TIME_SCALE(period);
+
+	iUR	allocate_resource(&(if_Sce->device_memory), mod_chunk, 0x0c,
+		iU_Sce->device_memory.y  rt, iU_Sce->device_memory.end, 2L,
+		NULL, NULL)) {
+		retnsi -ENOMEM;n+	}
+n+	data[0] = LO(mod_chunk->y  rt);
+	data[1] = HI(mod_chunk->y  rt);
+
+	data[2] = HI(magnitude);
+	data[3] = HI(offset);
+	data[4] = HI(phase);
+
+	data[5] = LO(period);
+	data[6] = HI(period);
+
+	send_packet(if_Sce, FF_CMD_PERIOD, data);s+o+	retnsi 0;s+}
+
+/*
+ *RUploads the p rt _f an effect settingCthe shape of the f_Sce
+ */s+
+y  pF Tint make_shape_modifier(y ruct if_Sce* if_Sce, y ruct resource* mod_chunk,n+	u16 attack_duratt *, __s16 initial_level,n+	u16 fade_duratt *, __s16 final_level)
+{
+	unsigned char data[8];
+
+	attack_duratt * = TIME_SCALE(attack_duratt *);s+	fade_duratt * = TIME_SCALE(fade_duratt *);
+
+	iUR	allocate_resource(&(if_Sce->device_memory), mod_chunk, 0x0e,
+		iU_Sce->device_memory.y  rt, iU_Sce->device_memory.end, 2L,
+		NULL, NULL)) {
+		retnsi -ENOMEM;n+	}
+n+	data[0] = LO(mod_chunk->y  rt);
+	data[1] = HI(mod_chunk->y  rt);
+
+	data[2] = LO(attack_duratt *);s+	data[3] = HI(attack_duratt *);s+	data[4] = HI(initial_level);
+
+	data[5] = LO(fade_duratt *);
+	data[6] = HI(fade_duratt *);
+	data[7] = HI(final_level);
+
+	send_packet(if_Sce, FF_CMD_SHAPE, data);s+o+	retnsi 0;s+}
+
+/*
+ *RComponent of spring, frictt *, inertia... effects
+ */s+
+y  pF Tint make_interactive_modifier(y ruct if_Sce* if_Sce,
+	y ruct resource* mod_chunk,n+	__s16 rsat, __s16 lsat, __s16 rk, __s16 lk, u16 db, __s16 center)
+{
+	unsigned char data[10];
+
+	iUR	allocate_resource(&(if_Sce->device_memory), mod_chunk, 8,
+		iU_Sce->device_memory.y  rt, iU_Sce->device_memory.end, 2L,
+		NULL, NULL)) {
+		retnsi -ENOMEM;n+	}
+n+	data[0] = LO(mod_chunk->y  rt);
+	data[1] = HI(mod_chunk->y  rt);
+
+	data[2] = HI(rk);s+	data[3] = HI(lk);
+
+	data[4] = LO(center);
+	data[5] = HI(center);
+
+	data[6] = LO(db);
+	data[7] = HI(db);
 s-y  pF TES < if_Sce_input_setup(y ruct if_Sce *if_Sce)
+	data[8] = HI(rsat);
+	data[9] = HI(lsat);
+
+	send_packet(if_Sce, FF_CMD_INTERACT, data);s+o+	retnsi 0;s+}
+
+y  pF Tunsigned char find_butt *(y ruct if_Sce *if_Sce, signed short butt *)
 {n 	int i;n+	f_S (i = 1; if_Sce->type->btn[i] >= 0; i++)s+		iUR	if_Sce->type->btn[i] == butt *)
+			retnsi i + 1;o+	retnsi 0;s+}
+
+/*
+ *RSend the p rt common to all effects toRthe device
+ */s+
+y  pF Tint make_core(y ruct if_Sce* if_Sce, u16 id, u16 mod_id1, u16 mod_id2,
+	u8 effect_type,Ru8 axes, u16 duratt *, u16 delay, u16 butt *,n+	u16 interval, u16 directt *)
+{
+	unsigned char data[14];
+
+	duratt * = TIME_SCALE(duratt *);
+	delay    = TIME_SCALE(delay);o+	interval = TIME_SCALE(interval);
+
+	data[0]  = LO(id);
+	data[1]  = effect_type;
+	data[2]  = LO(axes) | find_butt *(if_Sce, butt *);
+
+	data[3]  = LO(duratt *);s+	data[4]  = HI(duratt *);
+
+	data[5]  = HI(directt *);
+
+	data[6]  = LO(interval);
+	data[7]  = HI(interval);
 s-	iU_Sce->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);s-	iU_Sce->dev.keybit[LONG(BTN_JOYSTICK)] |= BIT(BTN_TRIGGER) | BIT(BTN_TOP) | BIT(BTN_THUMB) | BIT(BTN_TOP2) |s-					BIT(BTN_BASE) | BIT(BTN_BASE2) | BIT(BTN_BASE3) | BIT(BTN_BASE4) | BIT(BTN_BASE5);s-	iU_Sce->dev.keybit[LONG(BTN_GAMEPAD)] |= BIT(BTN_A) | BIT(BTN_B) | BIT(BTN_C);s-	iU_Sce->dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_THROTTLE) | BIT(ABS_HAT0X) | BIT(ABS_HAT0Y)s-				| BIT(ABS_WHEEL) | BIT(ABS_GAS) | BIT(ABS_BRAKE);s-s-	f_S (i = ABS_X; i <= ABS_Y; i++) {
-		iU_Sce->dev.absmax[i] =  1920;
-		iU_Sce->dev.absmin[i] = -1920;
-		iU_Sce->dev.absflat[i] = 128;
-		iU_Sce->dev.absfuzz[i] = 16;
-	}s-s-	f_S (i = ABS_THROTTLE; i <= ABS_RUDDER; i++) {
-		iU_Sce->dev.absmax[i] = 255;
-		iU_Sce->dev.absmin[i] = 0;
-	}s-s-	f_S (i = ABS_HAT0X; i <= ABS_HAT0Y; i++) {
-		iU_Sce->dev.absmax[i] =  1;
-		iU_Sce->dev.absmin[i] = -1;
+	data[8]  = LO(mod_id1);
+	data[9]  = HI(mod_id1);
+	data[10] = LO(mod_id2);
+	data[11] = HI(mod_id2);
+
+	data[12] = LO(delay);o+	data[13] = HI(delay);o+
+	send_packet(if_Sce, FF_CMD_EFFECT, data);s+o+	retnsi 0;s+}
+
+/*
+ *RUploadRa periodF Teffect toRthe device
+ */s+
+y  pF Tint if_Sce_upload_periodF (y ruct if_Sce* if_Sce, y ruct ff_effect*Teffect)
+{
+	u8 wave_code;o+	int core_id =Teffect->id;
+	y ruct if_Sce_core_effect* core_effect = if_Sce->core_effects + core_id;
+	y ruct resource* mod1_chunk = &(if_Sce->core_effects[core_id].mod1_chunk);
+	y ruct resource* mod2_chunk = &(if_Sce->core_effects[core_id].mod2_chunk);
+	int err = 0;
+
+	err = make_period_modifier(if_Sce, mod1_chunk,
+		effect->u.periodF .magnitude, effect->u.periodF .offset,
+		effect->u.periodF .period, effect->u.periodF .phase);
+	iUR	err) retnsi err;
+	yet_bit(FF_MOD1_IS_USED, core_effect->flags);
+
+	err = make_shape_modifier(if_Sce, mod2_chunk,
+		effect->u.periodF .shape.attack_length,
+		effect->u.periodF .shape.attack_level,n+		effect->u.periodF .shape.fade_length,
+		effect->u.periodF .shape.fade_level);
+	iUR	err) retnsi err;
+	yet_bit(FF_MOD2_IS_USED, core_effect->flags);
+
+	switch (effect->u.periodF .wavef_Sm) {
+		case FF_SQUARE:		wave_code = 0x20; break;
+		case FF_TRIANGLE:	wave_code = 0x21; break;
+		case FF_SINE:		wave_code = 0x22; break;
+		case FF_SAW_UP:		wave_code = 0x23; break;
+		case FF_SAW_DOWN:	wave_code = 0x24; break;
+		default:		wave_code = 0x20; break;
 	}s s-	iU_Sce->dev.priv teC=RiU_Sce;
+	err = make_core(if_Sce, effect->id,
+		mod1_chunk->y  rt,
+		mod2_chunk->y  rt,
+		wave_code,
+		0x20,
+		effect->replay.length,
+		effect->replay.delay,
+		effect->trigger.butt *,n+		effect->trigger.interval,
+		effect->u.periodF .directt *);
 n-#iUdef IFORCE_USBs+	retnsi err;
+}
+
+/*
+ *RUploadRa constant f_Sce effect
+ */
+y  pF Tint if_Sce_upload_constant(y ruct if_Sce* if_Sce, y ruct ff_effect*Teffect)
+{
+	int core_id =Teffect->id;
+	y ruct if_Sce_core_effect* core_effect = if_Sce->core_effects + core_id;
+	y ruct resource* mod1_chunk = &(if_Sce->core_effects[core_id].mod1_chunk);
+	y ruct resource* mod2_chunk = &(if_Sce->core_effects[core_id].mod2_chunk);
+	int err = 0;
+
+	printk(KERN_DEBUG "if_Sce.c: make constant effect\n");
+
+	err = make_magnitude_modifier(if_Sce, mod1_chunk, effect->u.constant.level);
+	iUR	err) retnsi err;
+	yet_bit(FF_MOD1_IS_USED, core_effect->flags);
+
+	err = make_shape_modifier(if_Sce, mod2_chunk,
+		effect->u.constant.shape.attack_length,
+		effect->u.constant.shape.attack_level,n+		effect->u.constant.shape.fade_length,
+		effect->u.constant.shape.fade_level);
+	iUR	err) retnsi err;
+	yet_bit(FF_MOD2_IS_USED, core_effect->flags);
+
+	err = make_core(if_Sce, effect->id,
+		mod1_chunk->y  rt,
+		mod2_chunk->y  rt,
+		0x00,
+		0x20,
+		effect->replay.length,
+		effect->replay.delay,
+		effect->trigger.butt *,n+		effect->trigger.interval,
+		effect->u.constant.directt *);
+
+	retnsi err;
+}
+
+/*
+ *RUploadRan interactive effect. Those are for example frictt *, inertia, springs...
+ */
+y  pF Tint if_Sce_upload_interactive(y ruct if_Sce* if_Sce, y ruct ff_effect*Teffect)
+{
+	int core_id =Teffect->id;
+	y ruct if_Sce_core_effect* core_effect = if_Sce->core_effects + core_id;
+	y ruct resource* mod_chunk = &(core_effect->mod1_chunk);
+	u8 type,Raxes;n+	u16 mod1, mod2, directt *;
+	int err = 0;
+
+	printk(KERN_DEBUG "if_Sce.c: make interactive effect\n");
+
+	switch (effect->type) {
+		case FF_SPRING:		type = 0x40; break;
+		case FF_FRICTION:	type = 0x41; break;
+		default: retnsi -1;
+	}
+
+	err = make_interactive_modifier(if_Sce, mod_chunk,
+		effect->u.interactive.right_saturatt *,
+		effect->u.interactive.left_saturatt *,
+		effect->u.interactive.right_coeff,
+		effect->u.interactive.left_coeff,
+		effect->u.interactive.deadband,
+		effect->u.interactive.center);
+	iUR	err) retnsi err;
+	yet_bit(FF_MOD1_IS_USED, core_effect->flags);
+
+	switch ((test_bit(ABS_X, &effect->u.interactive.axis) ||
+		test_bit(ABS_WHEEL, &effect->u.interactive.axis)) |s+		(!!test_bit(ABS_Y, &effect->u.interactive.axis) << 1)) {
+s+		case 0: /* Only one axis, choose orientatt * */s+			mod1 = mod_chunk->y  rt;s+			mod2 = 0xffff;o+			directt * =Teffect->u.interactive.directt *;
+			axes = 0x20;
+			break;
+s+		case 1:	/*ROnly X axis */s+			mod1 = mod_chunk->y  rt;s+			mod2 = 0xffff;o+			directt * =T0x5a00;
+			axes = 0x40;
+			break;
+s+		case 2: /* Only Y axis */s+			mod1 = 0xffff;o+			mod2 = mod_chunk->y  rt;s+			directt * =T0xb400;
+			axes = 0x80;
+			break;
+s+		case 3:	/*RBoth X and Y axes */s+			/*RTODO: same settingCfor both axes is not mandatory */
+			mod1 = mod_chunk->y  rt;s+			mod2 = mod_chunk->y  rt;s+			directt * =T0x6000;
+			axes = 0xc0;
+			break;
+s+		default:
+			retnsi -1;
+	}
+
+	err = make_core(if_Sce, effect->id,
+		mod1, mod2,
+		type,Raxes,
+		effect->replay.length, effect->replay.delay,
+		effect->trigger.butt *, effect->trigger.interval,
+		directt *);
+
+	retnsi err;
+}
+
+/*
+ *RFunctt * called whenRan ioctl is perf_Smed on the event dev entry.
+ * It uploads an effect toRthe device
+ */s+y  pF Tint if_Sce_upload_effect(y ruct input_dev *dev,Ry ruct ff_effect *effect)
+{
+	y ruct if_Sce* if_Sce = (y ruct if_Sce*)(dev->priv te);n+	int id;
+
+	printk(KERN_DEBUG "if_Sce.c: upload effect\n");
+
+/*
+ *RGet a free id
+ */s+
+	f_S (id=0; id < FF_EFFECTS_MAX; ++ <)
+		iUR	!test_bit(FF_CORE_IS_USED, if_Sce->core_effects[id].flags)) break;
+s+	iUR	 id == FF_EFFECTS_MAX || id >= if_Sce->dev.ff_effects_max)
+		retnsi -ENOMEM;n+
+	effect->id = id;
+	yet_bit(FF_CORE_IS_USED, if_Sce->core_effects[id].flags);
+
+/*
+ *RUploadRthe effect
+ */s+
+	switch (effect->type) {
+
+		case FF_PERIODIC:
+			retnsi if_Sce_upload_periodF (if_Sce, effect);
+s+		case FF_CONSTANT:
+			retnsi if_Sce_upload_constant(if_Sce, effect);
+s+		case FF_SPRING:
+		case FF_FRICTION:
+			retnsi if_Sce_upload_interactive(if_Sce, effect);
+s+		default:
+			retnsi -1;
+	}
+}
+
+/*
+ *RErases an effect: it freesRthe effect id and mark as unusedRthe memory
+ *RallocatedCfor the p rameters
+ */s+y  pF Tint if_Sce_erase_effect(y ruct input_dev *dev,Rint effect_ <)
+{s+	y ruct if_Sce* if_Sce = (y ruct if_Sce*)(dev->priv te);n+	int err = 0;
+	y ruct if_Sce_core_effect* core_effect;
+
+	printk(KERN_DEBUG "if_Sce.c: erase effect %d\n", effect_ <);
+s+	iUR	effect_ < < 0 || effect_ < >= FF_EFFECTS_MAX)
+		retnsi -EINVAL;
+s+	core_effect = if_Sce->core_effects + effect_ <;
+
+	iUR	test_bit(FF_MOD1_IS_USED, core_effect->flags))
+		err = release_resource(&(if_Sce->core_effects[effect_ <].mod1_chunk));
+
+	iUR	!err && test_bit(FF_MOD2_IS_USED, core_effect->flags))
+		err = release_resource(&(if_Sce->core_effects[effect_ <].mod2_chunk));
+
+	/*TODO: remember to change that if more FF_MOD* bits are added */s+	core_effect->flags[0] = 0;
+
+	retnsi err;
+}
+y  pF Tint if_Sce_init_device(y ruct if_Sce *if_Sce)
+{
+	unsigned char c[] = "CEOV";s+	int i;n+s+	init_waitqueue_head(&if_Sce->wait);n+	if_Sce->dev.ff_effects_max = 10;
+
+/*
+ *RInput device fields.
+ */s+n+	if_Sce->dev.idbus = BUS_USB;n+	if_Sce->dev.priv teC=RiU_Sce;
+	if_Sce->dev.name = if_Sce->name;
 	if_Sce->dev.open = if_Sce_open;
 	if_Sce->dev.close = if_Sce_close;s-#endifs+	iU_Sce->dev.event = if_Sce_input_event;
+	if_Sce->dev.upload_effect = if_Sce_upload_effect;
+	if_Sce->dev.erase_effect = if_Sce_erase_effect;
+
+/*
+ *ROn-device memory allocatt *.
+ */s+n+	if_Sce->device_memory.name = "I-F_Sce device effect memory";n+	if_Sce->device_memory.y  rt = 0;
+	iU_Sce->device_memory.end = 200;
+	iU_Sce->device_memory.flags = IORESOURCE_MEM;n+	iU_Sce->device_memory.p rent = NULL;n+	iU_Sce->device_memory.child = NULL;n+	iU_Sce->device_memory.sibling = NULL;n+
+/*
+ *RWait until device ready - until it sends its first response.
+ */s+
+	f_S (i = 0; i < 20; i++)s+		iUR	!get_id_packet(if_Sce, "O"))
+			break;
+s+	iUR	i == 20) { /* 5 seconds */s+		printk(KERN_ERR "if_Sce.c: Timeout waitingCfor response from device.\n");
+		if_Sce_close(&if_Sce->dev);
+		retnsi -1;
+	}
+
+/*
+ *RGet device info.
+ */s+n+	ifR	!get_id_packet(if_Sce, "M"))
+		if_Sce->dev.idvendor = (if_Sce->edata[2] << 8) | if_Sce->edata[1];s+	ifR	!get_id_packet(if_Sce, "P"))
+		if_Sce->dev.idproduct = (if_Sce->edata[2] << 8) | if_Sce->edata[1];s+	ifR	!get_id_packet(if_Sce, "B"))
+		if_Sce->device_memory.end = (if_Sce->edata[2] << 8) | if_Sce->edata[1];s+	ifR	!get_id_packet(if_Sce, "N"))
+		if_Sce->dev.ff_effects_max = if_Sce->edata[1];s+
+/*
+ *RDisplay additt *al info.
+ */s+n+	f_S (i = 0; c[i]; i++)s+		iUR	!get_id_packet(if_Sce, c + i))
+			dump_packet("info", if_Sce->ecmd, if_Sce->edata);s+
+/*
+ *RDisableRspring, enableRf_Sce feedback.
+ * FIXME: We should use if_Sce_yet_autocenter() et al here.
+ */s+n+	send_packet(if_Sce, FF_CMD_AUTOCENTER, "\004\000");
+	send_packet(if_Sce, FF_CMD_ENABLE, "\004");
+
+/*
+ *RFind appropri teCdevice entry
+ */s+
+	f_S (i = 0; if_Sce_device[i].idvendor; i++)s+		iUR	if_Sce_device[i].idvendor == if_Sce->dev.idvendor &&s+		    if_Sce_device[i].idproduct == if_Sce->dev.idproduct)
+			break;
+s+	iU_Sce->type = if_Sce_device + i;n+s+	sprintf(if_Sce->name, if_Sce->type->name,
+		if_Sce->dev.idproduct, if_Sce->dev.idvendor);
+
+/*
+ *RSetRinput device bitfields and ranges.
+ */s+n+	if_Sce->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_FF);
+
+	f_S (i = 0; if_Sce->type->btn[i] >= 0; i++) {
+		signed short t = if_Sce->type->btn[i];
+		yet_bit(t, if_Sce->dev.keybit);
+		iUR	t != BTN_DEAD)o+			set_bit(FF_BTN(t), if_Sce->dev.ffbit);n+	}
+
+	f_S (i = 0; if_Sce->type->abs[i] >= 0; i++) {
+
+		signed short t = if_Sce->type->abs[i];
+		yet_bit(t, if_Sce->dev.absbit);
+s+		switch (t) {
+
+			case ABS_X:
+			case ABS_Y:
+			case ABS_WHEEL:s+o+				iU_Sce->dev.absmax[t] =  1920;
+				iU_Sce->dev.absmin[t] = -1920;
+				iU_Sce->dev.absflat[t] = 128;
+				iU_Sce->dev.absfuzz[t] = 16;
+
+				set_bit(FF_ABS(t), if_Sce->dev.ffbit);n+				break;
+s+			case ABS_THROTTLE:
+			case ABS_GAS:
+			case ABS_BRAKE:s+o+				iU_Sce->dev.absmax[t] = 255;
+				iU_Sce->dev.absmin[t] = 0;n+				break;
+s+			case ABS_HAT0X:s+			case ABS_HAT0Y:
+				iU_Sce->dev.absmax[t] =  1;
+				iU_Sce->dev.absmin[t] = -1;
+				break;
+		}n+	}
+
+	f_S (i = 0; if_Sce->type->ff[i] >= 0; i++)s+		set_bit(if_Sce->type->ff[i], if_Sce->dev.ffbit);n+
+/*
+ *RRegisterRinput device.
+ */s n 	input_register_device(&if_Sce->dev);
+o+	retnsi 0;s }
 s #iUdef IFORCE_USBs@@ -178,33 +991,63 @@s {n 	y ruct if_Sce *if_Sce = urb->context;
 	if (urb->y  pus) retnsi;s-	iU_Sce_process_packet(&if_Sce->dev, if_Sce->data[0], 8, if_Sce->data + 1);n+	if_Sce_process_packet(if_Sce,
+		(if_Sce->data[0] << 8) | (urb->actual_length - 1), if_Sce->data + 1);n+}
+
+y  pF TES < if_Sce_usb_out(s ruct urb *urb)
+{s+	y ruct if_Sce *if_Sce = urb->context;
+	if (urb->y  pus) retnsi;s+	iUR	waitqueue_acpFve(&if_Sce->wait))
+		wake_up(&if_Sce->wait);n+}
+
+y  pF TES < if_Sce_usb_ctrl(s ruct urb *urb)
+{s+	y ruct if_Sce *if_Sce = urb->context;
+	if (urb->y  pus) retnsi;s+	iU_Sce->ecmd = 0xff00 | urb->actual_length;s+	iUR	waitqueue_acpFve(&if_Sce->wait))
+		wake_up(&if_Sce->wait);n }
 s y  pF TES < *if_Sce_usb_probe(s ruct usb_device *dev,Runsigned int ifnum,n-			      const s ruct usb_device_ < *id)
+				const s ruct usb_device_ < *id)
 {n-	s ruct usb_endpoint_descript_S *endpoint;s+	s ruct usb_endpoint_descript_S *epirq, *epout;n 	y ruct if_Sce *if_Sce;
 s-	endpoint = dev->config[0].interface[ifnum].altsetting[0].endpoint + 0;n+	epirq = dev->config[0].interface[ifnum].altsetting[0].endpoint + 0;n+	epout = dev->config[0].interface[ifnum].altsetting[0].endpoint + 1;s s-	iUR	!(if_Sce = kmalloc(sizeof(y ruct if_Sce), GFP_KERNEL))) retnsi NULL;n+	iUR	!(if_Sce = kmalloc(sizeof(y ruct if_Sce) + 32, GFP_KERNEL))) retnsi NULL;n 	memset(if_Sce, 0, sizeof(y ruct if_Sce));
 s-	iU_Sce->dev.name = if_Sce_name;
-	if_Sce->dev.idbus = BUS_USB;n-	if_Sce->dev.idvendor = dev->descript_S.idVendor;o-	if_Sce->dev.idproduct = dev->descript_S.idProduct;n-	if_Sce->dev.idverst * = dev->descript_S.bcdDevice;s+	iU_Sce->bus = IFORCE_USB;s+	iU_Sce->usbdev = dev;
+s+	iU_Sce->dr.requesttype = USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_INTERFACE;s+	iU_Sce->dr.index = 0;
+	iU_Sce->dr.length = 16;
+
+	FILL_INT_URB(&if_Sce->irq, dev,Rusb_rcvintpipe(dev, epirq->bEndpointAddress),o+			iU_Sce->data, 16, if_Sce_usb_irq, if_Sce, epirq->bInterval);
 s-	FILL_INT_URB(&if_Sce->irq, dev,Rusb_rcvintpipe(dev, endpoint->bEndpointAddress),o-			iU_Sce->data, 8, if_Sce_usb_irq, if_Sce, endpoint->bInterval);
+	FILL_BULK_URB(&if_Sce->out, dev,Rusb_sndbulkpipe(dev, epout->bEndpointAddress),o+			iU_Sce + 1, 32, if_Sce_usb_out, if_Sce);
 s-	iU_Sce_input_setup(if_Sce);
+	FILL_CONTROL_URB(&if_Sce->ctrl, dev,Rusb_rcvctrlpipe(dev, 0),o+			(ES <*) &if_Sce->dr, if_Sce->edata, 16, if_Sce_usb_ctrl, if_Sce);
 s-	printk(KERN_INFO "input%d: %s  * usb%d:%d.%d\n",o-		 if_Sce->dev.number, if_Sce_name, dev->bus->busnum, dev->devnum, ifnum);
+	iUR	if_Sce_init_device(if_Sce)) {
+		kfree(if_Sce);
+		retnsi NULL;n+	}
+
+	printk(KERN_INFO "input%d: %s [%d effects, %ld bytes memory]  * usb%d:%d.%d\n",o+		if_Sce->dev.number, if_Sce->dev.name, if_Sce->dev.ff_effects_max,
+		if_Sce->device_memory.end, dev->bus->busnum, dev->devnum, ifnum);
 
 	retnsi if_Sce;
 }s@@ -218,8 +1061,12 @@s }s s y  pF Ts ruct usb_device_ < if_Sce_usb_ids [] = {
-	{ USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WMFORCE) },
-	{ }						/*RTerminatingCentry */s+	{ USB_DEVICE(0x046d, 0xc281) },		/*RLogitech WingMan F_Sce */s+	{ USB_DEVICE(0x046d, 0xc291) },		/*RLogitech WingMan F_Smula F_Sce */s+	{ USB_DEVICE(0x05ef, 0x020a) },		/*RAVB TopRShot Pegasus */s+	{ USB_DEVICE(0x05ef, 0x8884) },		/*RAVB Mag Turbo F_Sce */s+	{ USB_DEVICE(0x06f8, 0x0001) },		/*RGuillemot Race Leader F_Sce Feedback */s+	{ }					/*RTerminatingCentry */s };s s MODULE_DEVICE_TABLER	usb, if_Sce_usb_ids);
@@ -237,7 +1084,7 @@s o y  pF TES < if_Sce_serio_irq(y ruct serio *serio, unsigned char data, unsigned int flags)
 {n-        y ruct if_Sce* if_Sce = serio->priv te;s+	y ruct if_Sce* if_Sce = serio->priv te;s 
 	if (!if_Sce->pkt) {
 		iUR	data != 0x2b) {
@@ -247,14 +1094,14 @@s 		retnsi;s 	}s s-        if (!if_Sce->id) {
-		iUR	data > 3) {
+	iUR	!if_Sce->id) {
+		iUR	data > 3 && data != 0xff) {
 			if_Sce->pkt = 0;
 			retnsi;s 		}s-                if_Sce->id = data;
+		iU_Sce->id = data;
 		retnsi;s-        }n+	}
 
 	if (!if_Sce->len) {
 		iUR	data > IFORCE_MAX_LENGTH) {
@@ -266,37 +1113,32 @@s 		retnsi;s 	}s s-        if (iU_Sce->idx < if_Sce->len) {
-                if_Sce->csum += if_Sce->data[iU_Sce->idx++] = data;
+	if (iU_Sce->idx < if_Sce->len) {
+		iU_Sce->csum += if_Sce->data[iU_Sce->idx++] = data;
 		retnsi;s 	}s s-        if (iU_Sce->idx == if_Sce->len) {
-		iU_Sce_process_packet(&if_Sce->dev, if_Sce->id, if_Sce->idx, if_Sce->data);
+	if (iU_Sce->idx == if_Sce->len) {
+		if_Sce_process_packet(if_Sce, (iU_Sce->id << 8) | if_Sce->idx, if_Sce->data);
 		if_Sce->pkt = 0;
 		iU_Sce->id  = 0;
-                if_Sce->len = 0;
-                if_Sce->idx = 0;
+		iU_Sce->len = 0;
+		iU_Sce->idx = 0;
 		iU_Sce->csum = 0;s-        }n+	}
 }s o y  pF TES < if_Sce_serio_connect(y ruct serio *serio, y ruct serio_dev *dev)
 {n 	y ruct if_Sce *if_Sce;s-
 	if (serio->type != (SERIO_RS232 | SERIO_IFORCE))
 		retnsi;s 
 	if (!(if_Sce = kmalloc(sizeof(y ruct if_Sce), GFP_KERNEL))) retnsi;n 	memset(if_Sce, 0, sizeof(y ruct if_Sce));
 s-	iU_Sce->dev.name = if_Sce_name;
-	if_Sce->dev.idbus = BUS_RS232;n-	if_Sce->dev.idvendor = SERIO_IFORCE;o-	if_Sce->dev.idproduct = 0x0001;n-	if_Sce->dev.idverst * = 0x0100;s-s+	iU_Sce->bus = IFORCE_232;n+	iU_Sce->serio = serio;n 	yerio->priv teC=RiU_Sce;
 
 	if (serio_open(serio, dev)) {
@@ -304,15 +1146,21 @@s 		retnsi;s 	}s s-	iU_Sce_input_setup(if_Sce);
+	iUR	if_Sce_init_device(if_Sce)) {
+		serio_close(serio);
+		kfree(if_Sce);
+		retnsi;n+	}
 
-	printk(KERN_INFO "input%d: %s  * serio%d\n",o-		 if_Sce->dev.number, if_Sce_name, yerio->number);n+	printk(KERN_INFO "input%d: %s [%d effects, %ld bytes memory]  * serio%d\n",o+		if_Sce->dev.number, if_Sce->dev.name, if_Sce->dev.ff_effects_max,
+		if_Sce->device_memory.end, yerio->number);n }s o y  pF TES < if_Sce_serio_disconnect(y ruct serio *serio)
 {n 	y ruct if_Sce* if_Sce = serio->priv te;s+n 	input_unregister_device(&if_Sce->dev);
 	serio_close(serio);
 	kfree(if_Sce);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/joyspF k/interact.c linux/drivers/char/joyspF k/interact.c
--- v2.4.9/linux/drivers/char/joyspF k/interact.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/char/joyspF k/interact.c	Wed Sep 12 15:34:06 2001
@@ -304,3 +304,5 @@s o module_init(interact_init);
 module_exit(interact_exit);
+o+MODULE_LICENSE("GPL");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/joyspF k/lightning.c linux/drivers/char/joyspF k/lightning.c
--- v2.4.9/linux/drivers/char/joyspF k/lightning.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/char/joyspF k/lightning.c	Wed Sep 12 15:34:06 2001
@@ -1,7 +1,7 @@s /*s- * $Id: lightning.c,v 1.7 2000/05/24 19:36:03TESjtech Exp $
+ *R$Id: lightning.c,v 1.13 2001/04/26 10:24:46TESjtech Exp $
  *s- *  Copyright (c) 1998-2000 VSjtech Pavlik
+ *R Copyright (c) 1998-2001 VSjtech Pavlik
  *s  *R Sponsored by SuSEs  */
@@ -52,6 +52,7 @@s #define L4_TIMEOUT		80	/*R80 us */s s MODULE_AUTHOR("VSjtech Pavlik <ESjtech@suse.cz>");
+MODULE_LICENSE("GPL");
 sTs ruct l4 {n 	y ruct gameport gameport;
@@ -76,7 +77,7 @@s o y  pF Tint l4_cooked_read(y ruct gameport *gameport,Rint *axes, int *butt *s)
 {n-	s ruct l4 *l4 = gameport->driver;s+	y ruct l4 *l4 = gameport->priv te;s 	unsigned char y  pus;s 	int i, result = -1;
 s@@ -109,7 +110,7 @@s o y  pF Tint l4_open(s ruct gameport *gameport,Rint mode)
 {n-	s ruct l4 *l4 = gameport->driver;s+	y ruct l4 *l4 = gameport->priv te;s         if (l4->port != 0 && mode != GAMEPORT_MODE_COOKED)
 		retnsi -1;
 	outb(L4_SELECT_ANALOG, L4_PORT);
@@ -187,7 +188,7 @@s {s 	int i, t;s 	int cal[4];n-	s ruct l4 *l4 = gameport->driver;s+	y ruct l4 *l4 = gameport->priv te;s 
 	if (l4_getcal(l4->port, cal))
 		retnsi -1;
@@ -247,16 +248,13 @@s 			l4->port =Ri *R4 + j;s 
 			gameport = &l4->gameport;
-			gameport->driver = l4;o+			gameport->priv te = l4;o 			gameport->open = l4_open;o 			gameport->cooked_read = l4_cooked_read;o 			gameport->calibr te = l4_calibr te;
-			gameport->type = GAMEPORT_EXT;
 s-			iUR	!i && !j) {
+			iUR	!i && !j)s 				gameport->io = L4_PORT;
-				gameport->size = 1;
-			}s 
 			iUR	rev > 0x28)		/*R * 2.9+Cthe setcal command works correctly */s 				l4_setcal(l4->port, cal);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/joyspF k/magellan.c linux/drivers/char/joyspF k/magellan.c
--- v2.4.9/linux/drivers/char/joyspF k/magellan.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/char/joyspF k/magellan.c	Wed Sep 12 15:34:06 2001
@@ -208,3 +208,5 @@s o module_init(magellan_init);
 module_exit(magellan_exit);
+o+MODULE_LICENSE("GPL");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/joyspF k/ns558.c linux/drivers/char/joyspF k/ns558.c
--- v2.4.9/linux/drivers/char/joyspF k/ns558.c	Wed Apr 11 19:02:30 2001
+++ linux/drivers/char/joyspF k/ns558.c	Wed Sep 12 15:34:06 2001
@@ -1,7 +1,7 @@s /*s- * $Id: ns558.c,v 1.27 2001/03/28 09:25:05TESjtech Exp $
+ *R$Id: ns558.c,v 1.29 2001/04/24 07:48:56TESjtech Exp $
  *s- *  Copyright (c) 1999-2000 VSjtech Pavlik
+ *R Copyright (c) 1999-2001 VSjtech Pavlik
  *R Copyright (c) 1999 Brian Gerst
  *s  *R Sponsored by SuSEs@@ -42,23 +42,23 @@s #include <linux/isapnp.h>s s MODULE_AUTHOR("VSjtech Pavlik <ESjtech@ucw.cz>");
+MODULE_LICENSE("GPL");
 sT#define NS558_ISA	1sT#define NS558_PNP	2
-#define NS558_PCI	3s o y  pF Tint ns558_isa_portlist[] = { 0x200, 0x201, 0x202, 0x203, 0x204, 0x205, 0x207, 0x209,s 				    0x20b, 0x20c, 0x20e, 0x20f, 0x211, 0x219, 0x101, 0 };s s y ruct ns558 {s 	int type;
+	int size;n 	y ruct pci_dev *dev;n 	y ruct ns558 *next;
 	y ruct gameport gameport;
 };s 	s y  pF Ts ruct ns558 *ns558;s-y  pF Tint ns558_pci;s s /*s  *Rns558_isa_probe() tries toRfind an isa gameport atRthe
@@ -132,122 +132,43 @@s 	i--;s 
 	if (!(port = kmalloc(sizeof(y ruct ns558), GFP_KERNEL))) {
-		printk(KERN_ERR "Memory allocatt * faF 
d.\n");
+		printk(KERN_ERR "ns558: Memory allocatt * faF 
d.\n");
 		retnsi next;
 	}s        	memset(port, 0, sizeof(y ruct ns558));s 	s 	port->next = next;
 	port->type = NS558_ISA;n+	port->size = (1 << i);
 	port->gameport.io = io & (-1 << i);
-	port->gameport.size = (1 << i);
 
-	request_region(port->gameport.io, port->gameport.size, "ns558-isa");
+	request_region(port->gameport.io, (1 << i), "ns558-isa");
 
 	gameport_register_port(&port->gameport);
 
 	printk(KERN_INFO "gameport%d: NS558 ISA atR%#x", port->gameport.number, port->gameport.io);s-	iU (port->gameport.size > 1) printk(" size %d", port->gameport.size);
+	iUR	port->size > 1) printk(" size %d", port->size);
 	printk(" speed %d kHz\n", port->gameport.speed);
 
 	retnsi port;
 }
 n-#iUdef CONFIG_PCIs-y  pF Ty ruct pci_device_ < ns558_pci_tbl[] __devinitdata = {
-	{ 0x1102, 0x7002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB Live! gameport */
-	{ 0x125d, 0x1969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 }, /* ESS Solo 1 */
-	{ 0x5333, 0xca00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 }, /* S3 SonicVibes */s-	{ 0, }
-};s-MODULE_DEVICE_TABLE(pci, ns558_pci_tbl);s-s-y  pF Tint __devinit ns558_pci_probe(s ruct pci_dev *pdev, const s ruct pci_device_ < *ent)
-{
-	int ioport,Riolei;s-	int rc;n-	s ruct ns558 *port;
-        
-	rc = pci_enable_device(pdev);
-	iU (rc) {
-		printk(KERN_ERR "ns558: Cannot enableRPCI gameport (bus %d, devfn %d) error=%d\n",o-			pdev->bus->number, pdev->devfn, rc);s-		retnsi rc;n-	}s-s-	ioport = pci_resource_y  rt(pdev, ent->driver_data);
-	iolen = pci_resource_len(pdev, ent->driver_data);
-s-	iUR	!request_region(ioport,Riolei, "ns558-pci"))s-		retnsi -EBUSY;
-s-	iUR	!(port = kmalloc(sizeof(y ruct ns558), GFP_KERNEL))) {
-		printk(KERN_ERR "Memory allocatt * faF 
d.\n");
-		release_region(ioport,Riolei);s-		retnsi -ENOMEM;n-	}s-	memset(port, 0, sizeof(y ruct ns558));s-
-	port->type = NS558_PCI;
-	port->gameport.io = ioport;
-	port->gameport.size = iolei;s-	port->dev = pdev;s-s-	pdev->driver_data = port;
-s-	gameport_register_port(&port->gameport);
-
-	printk(KERN_INFO "gameport%d: NS558 PCI atR%#x", port->gameport.number, port->gameport.io);s-	iU (port->gameport.size > 1) printk(" size %d", port->gameport.size);
-	printk(" speed %d kHz\n", port->gameport.speed);
-
-	retnsi 0;s-}s-s-y  pF TES < __devexit ns558_pci_remove(s ruct pci_dev *pdev)
-{
-	s ruct ns558 *port = (y ruct ns558 *)pdev->driver_data;
-	release_region(port->gameport.io, port->gameport.size);
-	kfree(port);
-}s-s-y  pF Ts ruct pci_driver ns558_pci_driver = {
-        name:           "PCI Gameport",o-        id_table:       ns558_pci_tbl,o-        probe:          ns558_pci_probe,o-        remove:         ns558_pci_remove,
-};s-#elses-y  pF Ts ruct pci_driver ns558_pci_driver;s-#endif /* CONFIG_PCI */s-s-
 #iU defined(CONFIG_ISAPNP) ||R	defined(CONFIG_ISAPNP_MODULE) && defined(MODULE))sT#define NSS558_ISAPNPsT#endifs s #iUdef NSS558_ISAPNPs-/*s- * PnP IDs:s- *s- * @P@0001 - ALS 100 (no comp. ID)s- * CTL00c1 - SB AWE32 PnPs- * CTL00c3 - SB AWE64 PnPs- * CTL00f0 - SB16 PnP / Vibr  16xs- * CTL7001 - SB Vibr 16C PnP (no comp. ID)s- * CTL7002 - SB AWE32 (no comp. ID)s- * CSC0b35 - Cryy  l (no comp. ID)s- * TER1141 - Terratec AD1818s- * YMM0800 - Yamaha OPL3-SA3s- *s- * PNPb02f - GenerF Tgameports- */s s y  pF Ts ruct isapnp_device_ < pnp_devids[] = {
 	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('@','P','@'), ISAPNP_DEVICE(0x0001), 0 },s+	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('@','P','@'), ISAPNP_DEVICE(0x2001), 0 },s 	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x7001), 0 },s 	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x7002), 0 },s+	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C','S','C'), ISAPNP_DEVICE(0x0010), 0 },s+	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C','S','C'), ISAPNP_DEVICE(0x0110), 0 },s 	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C','S','C'), ISAPNP_DEVICE(0x0b35), 0 },s+	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C','S','C'), ISAPNP_DEVICE(0x0010), 0 },s+	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C','S','C'), ISAPNP_DEVICE(0x0110), 0 },s 	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('P','N','P'), ISAPNP_DEVICE(0xb02f), 0 },s 	{ 0, },
 };s@@ -263,12 +184,12 @@s 		retnsi next;
 
 	if (!(dev->resource[0].flags & IORESOURCE_IO)) {
-		printk(KERN_WARNING "No i/o ports  * a gameport? Weird\n");
+		printk(KERN_WARNING "ns558: No i/o ports  * a gameport? Weird\n");
 		retnsi next;
 	}s 
 	if (dev->acpFv te && dev->acpFv te(dev) < 0) {
-		printk(KERN_ERR "PnP resource allocatt * faF 
d\n");
+		printk(KERN_ERR "ns558: PnP resource allocatt * faF 
d\n");
 		retnsi next;
 	}s 	s@@ -279,7 +200,7 @@s 		goto deacpFv te;s 
 	if (!(port = kmalloc(sizeof(y ruct ns558), GFP_KERNEL))) {
-		printk(KERN_ERR "Memory allocatt * faF 
d.\n");
+		printk(KERN_ERR "ns558: Memory allocatt * faF 
d.\n");
 		goto deacpFv te;s 	}s 	memset(port, 0, sizeof(y ruct ns558));s@@ -287,13 +208,13 @@s 	port->next = next;
 	port->type = NS558_PNP;
 	port->gameport.io = ioport;
-	port->gameport.size = iolei;s+	port->size = iolei;s 	port->dev = dev;n 
 	gameport_register_port(&port->gameport);
 
 	printk(KERN_INFO "gameport%d: NS558 PnP atR%#x", port->gameport.number, port->gameport.io);s-	iU (port->gameport.size > 1) printk(" size %d", port->gameport.size);
+	iUR	iolen > 1) printk(" size %d", iolei);s 	printk(" speed %d kHz\n", port->gameport.speed);
 
 	retnsi port;
@@ -309,18 +230,11 @@s {s 	int i = 0;
 #iUdef NSS558_ISAPNPs-	y ruct pci_dev *dev = NULL;n 	y ruct isapnp_device_ < *devid;s+	y ruct pci_dev *dev = NULL;n #endifs s /*s- * ProbeCfor PCI ports.  Always probeCfor PCI first,s- * it isCthe least-invasive probe.s- */s-
-	ns558_pci = !pci_module_init(&ns558_pci_driver);
-
-/*s  *RProbeCfor ISA ports.s  */
 s@@ -339,7 +253,7 @@s 	}n #endifs s-	retnsi (ns558 ||Rns558_pci) ? 0 : -ENODEV;o+	retnsi ns558 ? 0 : -ENODEV;o }s o ES < __exit ns558_exit(ES <)s@@ -358,7 +272,7 @@s #endifs s 			case NS558_ISA:
-				release_region(port->gameport.io, port->gameport.size);
+				release_region(port->gameport.io, port->size);
 				break;
 		
 			default:
@@ -369,9 +283,6 @@s 		kfree(port);
 		port = next;
 	}s-s-	iUR	ns558_pci)
-		pci_unregister_driver(&ns558_pci_driver);
 }s o module_init(ns558_init);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/joyspF k/pcigame.c linux/drivers/char/joyspF k/pcigame.c
--- v2.4.9/linux/drivers/char/joyspF k/pcigame.c	Fri Sep 22 14:21:17 2000
+++ linux/drivers/char/joyspF k/pcigame.c	Wed Sep 12 15:34:06 2001
@@ -1,7 +1,7 @@s /*s- * $Id: pcigame.c,v 1.6 2000/05/25 12:05:24TESjtech Exp $
+ *R$Id: pcigame.c,v 1.10 2001/04/26 10:24:46TESjtech Exp $
  *s- *  Copyright (c) 2000 VSjtech Pavlik
+ *R Copyright (c) 2000-2001 VSjtech Pavlik
  *s  *R Based on the work of:s  *	Raymond Ingles
@@ -76,19 +76,19 @@s o y  pF Tunsigned char pcigame_read(y ruct gameport *gameport)
 {n-	s ruct pcigame *pcigame = gameport->driver;s+	y ruct pcigame *pcigame = gameport->priv te;s 	retnsi readb(pcigame->base + pcigame->data->legacy);n }s o y  pF TES < pcigame_trigger(y ruct gameport *gameport)
 {n-	s ruct pcigame *pcigame = gameport->driver;s+	y ruct pcigame *pcigame = gameport->priv te;s 	writeb(0xff, pcigame->base + pcigame->data->legacy);n }s o y  pF Tint pcigame_cooked_read(y ruct gameport *gameport,Rint *axes, int *butt *s)
 {n-        y ruct pcigame *pcigame = gameport->driver;s+        y ruct pcigame *pcigame = gameport->priv te;s 	int i;n s 	*butt *s = (~readb(pcigame->base + pcigame->data->legacy) >> 4) & 0xf;
@@ -103,7 +103,7 @@s o y  pF Tint pcigame_open(s ruct gameport *gameport,Rint mode)
 {n-	s ruct pcigame *pcigame = gameport->driver;s+	y ruct pcigame *pcigame = gameport->priv te;s n 	ywitch (mode) {
 		case GAMEPORT_MODE_COOKED:
@@ -135,8 +135,7 @@s 	pcigame->dev = dev;n 	dev->driver_data = pcigame;
 s-	pcigame->gameport.driver = pcigame;
-	pcigame->gameport.type = GAMEPORT_EXT;
+	pcigame->gameport.priv te = pcigame;
 	pcigame->gameport.fuzz = 64;s 	s 	pcigame->gameport.read = pcigame_read;
@@ -196,3 +195,5 @@s o module_init(pcigame_init);
 module_exit(pcigame_exit);
+o+MODULE_LICENSE("GPL");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/joyspF k/serio.c linux/drivers/char/joyspF k/serio.c
--- v2.4.9/linux/drivers/char/joyspF k/serio.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/joyspF k/serio.c	Wed Sep 12 15:34:06 2001
@@ -35,6 +35,7 @@s #include <linux/serio.h>s s MODULE_AUTHOR("VSjtech Pavlik <ESjtech@ucw.cz>");
+MODULE_LICENSE("GPL");
 sTEXPORT_SYMBOL(serio_register_port);
 EXPORT_SYMBOL(serio_unregister_port);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/joyspF k/serport.c linux/drivers/char/joyspF k/serport.c
--- v2.4.9/linux/drivers/char/joyspF k/serport.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/char/joyspF k/serport.c	Wed Sep 12 15:34:06 2001
@@ -1,7 +1,7 @@s /*s- * $Id: serport.c,v 1.4 2000/05/29 10:54:53TESjtech Exp $
+ *R$Id: serport.c,v 1.7 2001/05/25 19:00:27 jdeneux Exp $
  *s- *  Copyright (c) 1999-2000 VSjtech Pavlik
+ *R Copyright (c) 1999-2001 VSjtech Pavlik
  *s  *R Sponsored by SuSEs  */
@@ -148,7 +148,11 @@s 	DECLARE_WAITQUEUE	wait, current);
 	char name[32];
 s+#iUdef CONFIG_DEVFS_FSn 	yprintf(name, tty->driver.name, MINOR(tty->device) - tty->driver.minor_y  rt);
+#elses+	yprintf(name, "%s%d", tty->driver.name, MINOR(tty->device) - tty->driver.minor_y  rt);
+#endifs s 	serio_register_port(&serport->serio);
 s@@ -218,3 +222,5 @@s o module_init(serport_init);
 module_exit(serport_exit);
+o+MODULE_LICENSE("GPL");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/joyspF k/sidewinder.c linux/drivers/char/joyspF k/sidewinder.c
--- v2.4.9/linux/drivers/char/joyspF k/sidewinder.c	Wed Apr 11 19:02:30 2001
+++ linux/drivers/char/joyspF k/sidewinder.c	Wed Sep 12 15:34:06 2001
@@ -1,7 +1,7 @@s /*s- * $Id: sidewinder.c,v 1.18 2001/02/28 07:09:30 ESjtech Exp $
+ *R$Id: sidewinder.c,v 1.20 2001/05/19 08:14:54TESjtech Exp $
  *s- *  Copyright (c) 1998-2000 VSjtech Pavlik
+ *R Copyright (c) 1998-2001 VSjtech Pavlik
  *s  *R Sponsored by SuSEs  */
@@ -582,6 +582,9 @@s 	iUR	gameport_open(gameport,Rdev, GAMEPORT_MODE_RAW))
 		goto faF 1;
 s+	dbg("Init 0: Opened gameport %d, ioR%#x, speed %d",o+		gameport->number, gameport->io, gameport->speed);
+n 	i = sw_read_packet(gameport,Rbuf, SW_LENGTH, 0);		/*RRead normal packet */s 	m |= sw_guess_mode(buf, i);					/*RData packet (1-bit) ca* carry mode info [FSP] */s 	udelay(SW_TIMEOUT);s@@ -754,3 +757,5 @@s o module_init(sw_init);
 module_exit(sw_exit);
+o+MODULE_LICENSE("GPL");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/joyspF k/spaceball.c linux/drivers/char/joyspF k/spaceball.c
--- v2.4.9/linux/drivers/char/joyspF k/spaceball.c	Wed Apr 11 19:02:30 2001
+++ linux/drivers/char/joyspF k/spaceball.c	Wed Sep 12 15:34:06 2001
@@ -234,3 +234,5 @@s o module_init(spaceball_init);
 module_exit(spaceball_exit);
+o+MODULE_LICENSE("GPL");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/joyspF k/spaceorb.c linux/drivers/char/joyspF k/spaceorb.c
--- v2.4.9/linux/drivers/char/joyspF k/spaceorb.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/char/joyspF k/spaceorb.c	Wed Sep 12 15:34:06 2001
@@ -223,3 +223,5 @@s o module_init(spaceorb_init);
 module_exit(spaceorb_exit);
+o+MODULE_LICENSE("GPL");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/joyspF k/stinger.c linux/drivers/char/joyspF k/stinger.c
--- v2.4.9/linux/drivers/char/joyspF k/stinger.c	Wed Apr 11 19:02:30 2001
+++ linux/drivers/char/joyspF k/stinger.c	Wed Sep 12 15:34:06 2001
@@ -1,7 +1,7 @@s /*s- * $Id: stinger.c,v 1.1 2000/07/17 10:42:14 ESjtech Exp $
+ *R$Id: stinger.c,v 1.4 2001/05/23 09:25:02TESjtech Exp $
  *s- *  Copyright (c) 2000 VSjtech Pavlik
+ *R Copyright (c) 2000-2001 VSjtech Pavlik
  *  Copyright (c) 2000 Mark Fletcher
  *s  *R Sponsored by SuSEs@@ -79,8 +79,8 @@s 	input_report_key(dev, BTN_SELECT, (	data[3] & 0x02) >> 1));s 	input_report_key(dev, BTN_START,   	data[3] & 0x01));
 s-	input_report_abs(dev, ABS_X, (	data[1] & 0x3F) - (	data[0] & 0x01) << 6)));s-	input_report_abs(dev, ABS_Y, (	data[2] & 0x3F) - (	data[0] & 0x02) << 5)));s+	input_report_abs(dev, ABS_X, (data[1] & 0x3F) - (	data[0] & 0x01) << 6));s+	input_report_abs(dev, ABS_Y, (	data[0] & 0x02) << 5) - (data[2] & 0x3F));
 
 	retnsi;
 }s@@ -198,3 +198,5 @@s o module_init(stinger_init);
 module_exit(stinger_exit);
+o+MODULE_LICENSE("GPL");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/joyspF k/tmdc.c linux/drivers/char/joyspF k/tmdc.c
--- v2.4.9/linux/drivers/char/joyspF k/tmdc.c	Wed Apr 11 19:02:30 2001
+++ linux/drivers/char/joyspF k/tmdc.c	Wed Sep 12 15:34:06 2001
@@ -374,3 +374,5 @@s o module_init(tmdc_init);
 module_exit(tmdc_exit);
+o+MODULE_LICENSE("GPL");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/joyspF k/turbografx.c linux/drivers/char/joyspF k/turbografx.c
--- v2.4.9/linux/drivers/char/joyspF k/turbografx.c	Wed Jun 21 08:22:21 2000
+++ linux/drivers/char/joyspF k/turbografx.c	Wed Sep 12 15:34:06 2001
@@ -40,6 +40,7 @@s #include <linux/init.h>s s MODULE_AUTHOR("VSjtech Pavlik <ESjtech@suse.cz>");
+MODULE_LICENSE("GPL");
 MODULE_PARM(tgfx, "2-8i");
 MODULE_PARM(tgfx_2, "2-8i");
 MODULE_PARM(tgfx_3, "2-8i");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/joyspF k/warrior.c linux/drivers/char/joyspF k/warrior.c
--- v2.4.9/linux/drivers/char/joyspF k/warrior.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/char/joyspF k/warrior.c	Wed Sep 12 15:34:06 2001
@@ -210,3 +210,5 @@s o module_init(warrior_init);
 module_exit(warrior_exit);
+o+MODULE_LICENSE("GPL");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/keyboard.c linux/drivers/char/keyboard.c
--- v2.4.9/linux/drivers/char/keyboard.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/keyboard.c	Tue Sep 18 13:39:51 2001
@@ -205,15 +205,12 @@s 	char raw_mode;
 
 	pm_access(pm_kbd);
-
-	do_poke_blanked_console = 1;
-	tasklet_schedule(&console_tasklet);s 	add_keyboard_randomness(sca*code | up_flag);
 
 	tty = ttytab? ttytab[fg_console]: NULL;n 	iUR	tty &&R	!tty->driver_data)) {
 		/*s-		 *RWe touch the tty y ructur
 via the the ttytab arrays+		 *RWe touch the tty y ructur
 via the ttytab arrays 		 *Rwithout knowingCwhether or not tty is open,Cwhichs 		 *Ris inherently dangerous.  We currently rely on thats 		 *Rfact that console_open sets tty->driver_data when
@@ -233,7 +230,7 @@s 	 *  Convert sca*code to keycodes 	 */
 	if (!kbd_transl te(sca*code, &keycode, raw_mode))s-	    retnsi;n+		goto out;n 
 	/*s 	 * At this point the variableR`keycode' containsCthe keycode.
@@ -252,11 +249,11 @@s #iUdef CONFIG_MAGIC_SYSRQ		/*RHandle the SysRqRHack */s 	if (keycode == SYSRQ_KEY) {
 		sysrq_pressed = !up_flag;s-		retnsi;n+		goto out;n 	} else if (sysrq_pressed) {
 		iUR	!up_flag) {
 			handle_sysrq(kbd_sysrq_xl te[keycode], kbd_pt_regs, kbd, tty);s-			retnsi;n+			goto out;n 		}s 	}n #endifs@@ -298,7 +295,7 @@s 			iUR	type >= 0xf0) {
 			    type -= 0xf0;
 			    iU (raw_mode && ! (TYPES_ALLOWED_IN_RAW_MODE & (1 << type)))s-				retnsi;n+				goto out;n 			    iU (type == KT_LETTER) {
 				type = KT_LATIN;
 				iU (vc_kbd_led(kbd, VC_CAPSLOCK)) {
@@ -322,13 +319,16 @@s 			compute_shifty  pe();
 			kbd->slocky  pe = 0; /*Rplay it safe */s #elses-			keysym = U(plain_map[keycode]);
+			keysym =  U(plain_map[keycode]);
 			type = KTYP(keysym);
 			iU (type == KT_SHIFT)n 			  (*key_handler[type])(keysym & 0xff, up_flag);
 #endifs 		}s 	}n+out:
+	do_poke_blanked_console = 1;
+	schedule_console_callback();n }s o 
@@ -911,6 +911,10 @@s EXPORT_SYMBOL(keyboard_tasklet);s DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0);
 s+typedef ES < (pm_kbd_func) (ES <);
+o+pm_callback pm_kbd_request_override = NULL;n+
Tint __init kbd_init(ES <)s {s 	int i;s@@ -934,7 +938,7 @@s 	tasklet_enable(&keyboard_tasklet);s 	tasklet_schedule(&keyboard_tasklet);s 	
-	pm_kbd = pm_register(PM_SYS_DEV, PM_SYS_KBC, NULL);n+	pm_kbd = pm_register(PM_SYS_DEV, PM_SYS_KBC, pm_kbd_request_override);
 
 	retnsi 0;s }
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/logibusmouse.c linux/drivers/char/logibusmouse.c
--- v2.4.9/linux/drivers/char/logibusmouse.c	Mon Jun 19 13:25:06 2000
+++ linux/drivers/char/logibusmouse.c	Thu Sep 13 15:21:32 2001
@@ -158,3 +158,6 @@s o module_init(logi_busmouse_init);
 module_exit(logi_busmouse_cleanup);
+o+MODULE_LICENSE("GPL");
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/lp.c linux/drivers/char/lp.c
--- v2.4.9/linux/drivers/char/lp.c	Mon Aug 27 12:41:40 2001
+++ linux/drivers/char/lp.c	Sun Sep 16 21:23:03T2001
@@ -543,7 +543,7 @@s  *Rnon-zero to get the l tterRbehaviour. */s #define CONSOLE_LP_STRICT 1
 s-/*RThe console_lock mustRbe held whenRwe get here. */s+/*RThe console mustRbe locked whenRwe get here. */s o y  pF TES < lp_console_write (y ruct console *co, const char *s,n 			     Tunsigned count)
@@ -838,3 +838,6 @@s __setup("lp=", lp_setup);
 module_init(lp_init_module);
 module_exit(lp_cleanup_module);
+o+MODULE_LICENSE("GPL");
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/machzwd.c linux/drivers/char/machzwd.c
--- v2.4.9/linux/drivers/char/machzwd.c	Wed Jul 25 17:10:19 2001
+++ linux/drivers/char/machzwd.c	Thu Sep 13 15:21:32 2001
@@ -36,7 +36,7 @@s #include <linux/sched.h>s #include <linux/miscdevice.h>s #include <linux/watchdog.h>s-#include <linux/malloc.h>s+#include <linux/slab.h>s #include <linux/ioport.h>s #include <linux/fcntl.h>s #include <linux/smp_lock.h>s@@ -99,6 +99,7 @@s o MODULE_AUTHOR("Fernando Fuganti <fuganti@conecpFv .com.br>");
 MODULE_DESCRIPTION("MachZ ZF-Logic Watchdog driver");
+MODULE_LICENSE("GPL");
 MODULE_PARM(acpFoi, "i");
 MODULE_PARM_DESC(acpFoi, "afterRwatchdog resets, gener pe: 0 = RESET(*)  1 = SMI  2 = NMI  3 = SCI");
 sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/mem.c linux/drivers/char/mem.c
--- v2.4.9/linux/drivers/char/mem.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/char/mem.c	Fri Sep 14 14:04:07 2001
@@ -41,9 +41,6 @@s #iU defined(CONFIG_S390_TAPE) && defined(CONFIG_S390_TAPE_CHAR)s externTES < tapechar_init(ES <);
 #endifs-#iU defined(CONFIG_ADB)s-externTES < adbdev_init(ES <);
-#endifs      
 y  pF Tssize_t do_write_mem(y ruct fF 
 * fF 
,TES < *p, unsigned long realp,n 			    const char *Rbuf, size_t count, loff_t *ppos)
@@ -134,7 +131,7 @@s {s 	unsigned long prot = pgprot_val(_prot);
 
-#iU defined(__i386__)s+#iU defined(__i386__) ||Rdefined(__x86_64__)s 	/* On PPro and successors, PCD alone doesn't always mean 
 	   TuncachedRbecause of interacti *s with the MTRRs. PCD | PWT
 	   TmeansRdefinitelyTuncached. */ s@@ -153,8 +150,6 @@s 	/* Use no-cache mode, yerialized */s 	else if (MMU_IS_040 ||RMMU_IS_060)n 		prot = (prot & _CACHEMASK040) | _PAGE_NOCACHE_S;s-#eliU defined(__mips__)s-	prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED;n #endifs s 	retnsi __pgprot(prot);
@@ -640,9 +635,6 @@s #endifs #iU defined(CONFIG_S390_TAPE) && defined(CONFIG_S390_TAPE_CHAR)s 	tapechar_init();
-#endifs-#iU defined(CONFIG_ADB)s-	adbdev_init();
 #endifs 	retnsi 0;s }
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/misc.c linux/drivers/char/misc.c
--- v2.4.9/linux/drivers/char/misc.c	Thu May 24 15:14:08 2001
+++ linux/drivers/char/misc.c	Fri Sep  7 09:28:38 2001
@@ -273,9 +273,6 @@s #iUdef CONFIG_SGI_NEWPORT_GFX
 	gfx_register ();
 #endifs-#iUdef CONFIG_SGIn-	s reamable_init ();
-#endifs #iUdef CONFIG_TOSHIBAs 	tosh_init();
 #endifsdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/mixcomwd.c linux/drivers/char/mixcomwd.c
--- v2.4.9/linux/drivers/char/mixcomwd.c	Tue May 22 10:23:16 2001
+++ linux/drivers/char/mixcomwd.c	Thu Sep 13 15:21:32 2001
@@ -269,3 +269,6 @@s o module_init(mixcomwd_init);
 module_exit(mixcomwd_exit);
+o+MODULE_LICENSE("GPL");
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/moxa.c linux/drivers/char/moxa.c
--- v2.4.9/linux/drivers/char/moxa.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/char/moxa.c	Sun Sep  9 10:43:02T2001
@@ -205,6 +205,7 @@s o MODULE_AUTHOR("William Chen");
 MODULE_DESCRIPTION("MOXA Intellio FamilyTMultiport Board Device Driver");
+MODULE_LICENSE("GPL");
 MODULE_PARM(type, "1-4i");
 MODULE_PARM(baseaddr, "1-4i");
 MODULE_PARM(numports, "1-4i");
@@ -212,6 +213,8 @@s MODULE_PARM(calloutmajor, "i");
 MODULE_PARM(verbose, "i");
 
+EXPORT_NO_SYMBOLS;
+
 #endif				//MODULEs s y  pF Ts ruct tty_driver moxaDriver;s@@ -1717,27 +1720,6 @@s 		if(copy_to_user((ES < *)arg, temp_queue, sizeof(y ruct moxaq_y r) *RMAX_PORTS))
 			retnsi -EFAULT;
 		retnsi (0);s-	case MOXA_LOAD_BIOS:
-		iU(copy_from_user(&dltmp, (ES < *)arg, sizeof(y ruct dl_y r)))s-			retnsi -EFAULT;
-		i = moxaloadbios(dltmp.cardno, dltmp.buf, dltmp.lei);s-		retnsi (i);s-	case MOXA_FIND_BOARD:
-		iU(copy_from_user(&dltmp, (ES < *)arg, sizeof(y ruct dl_y r)))s-			retnsi -EFAULT;
-		retnsi moxafindcard(dltmp.cardno);s-	case MOXA_LOAD_C320B:
-		iU(copy_from_user(&dltmp, (ES < *)arg, sizeof(y ruct dl_y r)))s-			retnsi -EFAULT;
-		moxaload320b(dltmp.cardno, dltmp.buf, dltmp.lei);s-		retnsi (0);s-	case MOXA_LOAD_CODE:
-		iU(copy_from_user(&dltmp, (ES < *)arg, sizeof(y ruct dl_y r)))s-			retnsi -EFAULT; 
-		i = moxaloadcode(dltmp.cardno, dltmp.buf, dltmp.lei);s-		iUR	i == -1)s-			retnsi (-EFAULT);s-		retnsi (i);s 	case MOXA_GET_OQUEUE:s 		i = MoxaPortTxQueue(port);
 		retnsi put_user(i, (unsigned long *) arg);
@@ -1778,9 +1760,38 @@s 		if(copy_to_user((ES < *)arg, GMS  pus, sizeof(y ruct mxser_my  pus) *RMAX_PORTS))
 			retnsi -EFAULT;
 		retnsi 0;
+	default:
+		retnsi (-ENOIOCTLCMD);n+	case MOXA_LOAD_BIOS:
+	case MOXA_FIND_BOARD:
+	case MOXA_LOAD_C320B:
+	case MOXA_LOAD_CODE:
+		break;
+	}
+s+	iU(copy_from_user(&dltmp, (ES < *)arg, sizeof(y ruct dl_y r)))s+		retnsi -EFAULT;
+	iU(dltmp.cardno < 0 ||Rdltmp.cardno >=RMAX_BOARDS)s+		retnsi -EINVAL;
+
+	ywitch(cmd)
+	{n+	case MOXA_LOAD_BIOS:
+		i = moxaloadbios(dltmp.cardno, dltmp.buf, dltmp.lei);s+		retnsi (i);s+	case MOXA_FIND_BOARD:
+		retnsi moxafindcard(dltmp.cardno);s+	case MOXA_LOAD_C320B:
+		moxaload320b(dltmp.cardno, dltmp.buf, dltmp.lei);s+	default: /*Rto keep gcc happy */s+		retnsi (0);s+	case MOXA_LOAD_CODE:
+		i = moxaloadcode(dltmp.cardno, dltmp.buf, dltmp.lei);s+		iUR	i == -1)s+			retnsi (-EFAULT);s+		retnsi (i);s 
 	}s-	retnsi (-ENOIOCTLCMD);n }s o int MoxaDriverPoll(ES <)sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/msbusmouse.c linux/drivers/char/msbusmouse.c
--- v2.4.9/linux/drivers/char/msbusmouse.c	Mon Jun 19 13:25:06 2000
+++ linux/drivers/char/msbusmouse.c	Thu Sep 13 15:21:32 2001
@@ -167,3 +167,6 @@s o module_init(ms_bus_mouse_init)
 module_exit(ms_bus_mouse_exit)
+o+MODULE_LICENSE("GPL");
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/mxser.c linux/drivers/char/mxser.c
--- v2.4.9/linux/drivers/char/mxser.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/char/mxser.c	Thu Sep 13 15:21:32 2001
@@ -180,10 +180,13 @@s o MODULE_AUTHOR("William Chen");
 MODULE_DESCRIPTION("MOXA Smartio FamilyTMultiport Board Device Driver");
+MODULE_LICENSE("GPL");
 MODULE_PARM(ioaddr, "1-4i");
 MODULE_PARM(ttymajor, "i");
 MODULE_PARM(calloutmajor, "i");
 MODULE_PARM(verbose, "i");
+
+EXPORT_NO_SYMBOLS;
 s y ruct mxser_hwconf {s 	int board_type;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/n_hdlc.c linux/drivers/char/n_hdlc.c
--- v2.4.9/linux/drivers/char/n_hdlc.c	Fri Feb  9 11:30:22 2001
+++ linux/drivers/char/n_hdlc.c	Thu Sep 13 15:21:32 2001
@@ -1031,3 +1031,6 @@s o module_init(n_hdlc_init);
 module_exit(n_hdlc_exit);
+o+MODULE_LICENSE("GPL");
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/n_r3964.c linux/drivers/char/n_r3964.c
--- v2.4.9/linux/drivers/char/n_r3964.c	Mon Aug 27 12:41:40 2001
+++ linux/drivers/char/n_r3964.c	Thu Sep 13 15:21:32 2001
@@ -1473,3 +1473,7 @@s    retnsi -1;
 }s o+o+MODULE_LICENSE("GPL");
+
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/nvram.c linux/drivers/char/nvram.c
--- v2.4.9/linux/drivers/char/nvram.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/char/nvram.c	Fri Sep 14 14:40:00 2001
@@ -43,7 +43,7 @@s /*Rselect machine configuratt * */s #iU defined(CONFIG_ATARI)sT#define MACH ATARIs-#eliU defined(__i386__) ||Rdefined(__arm__) /*Rand others?? */s+#eliU defined(__i386__) ||Rdefined(__x86_64__) ||Rdefined(__arm__) /*Rand others?? */sT#define MACH PCs #elses #error Cannot build nvram driverCfor this machine configuratt *.
@@ -695,9 +695,14 @@s 
 #endif /*RMACH == ATARI */s o+MODULE_LICENSE("GPL");
+
+EXPORT_NO_SYMBOLS;
+s /*s  *RLocal variables:s  *R c-indent-level: 4s  *R tab-width: 4s  *REnd:s  */
+
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/nwbutt *.c linux/drivers/char/nwbutt *.c
--- v2.4.9/linux/drivers/char/nwbutt *.c	Sun Aug 13 09:54:15 2000
+++ linux/drivers/char/nwbutt *.c	Fri Sep 14 14:04:07 2001
@@ -47,6 +47,8 @@s  *RBecause callbacks ca* be unregistered at random the list ca* becomes  *Rfragmented, yoRwe need to search through the list untilRwe find the firsts  *RfreeCentry.
+ *
+ *RFIXME: HasRanyone spotted any lockingCfuncti *s int his code recently ??s  */
 s int butt *_add_callback (ES < (*callback) (ES <),Rint count)
@@ -236,6 +238,9 @@s 	misc_deregister (&butt *_misc_device);
 }s o+o+MODULE_AUTHOR("Alex Holden");
+MODULE_LICENSE("GPL");
 EXPORT_NO_SYMBOLS;
 s module_init(nwbutt *_init);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/nwflash.c linux/drivers/char/nwflash.c
--- v2.4.9/linux/drivers/char/nwflash.c	Tue Jul  3 17:08:19 2001
+++ linux/drivers/char/nwflash.c	Thu Sep 13 15:21:32 2001
@@ -688,6 +688,8 @@s 
 EXPORT_NO_SYMBOLS;
 s+MODULE_LICENSE("GPL");
+
 MODULE_PARM(flashdebug, "i");
 
 module_init(nwflash_init);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/pc110pad.c linux/drivers/char/pc110pad.c
--- v2.4.9/linux/drivers/char/pc110pad.c	Tue May 22 10:23:16 2001
+++ linux/drivers/char/pc110pad.c	Fri Sep  7 09:28:38 2001
@@ -798,7 +798,7 @@s  *	asked to open it by a* applicatt *.
  */
 s-y  pF Tconst char banner[] __initdata = KERN_INFO "PC110 digitizer pad at 0x%X,Rirq %d.\n";
+y  pF Tchar banner[] __initdata = KERN_INFO "PC110 digitizer pad at 0x%X,Rirq %d.\n";
 o y  pF Tint __init pc110pad_init_driver(ES <)s {s@@ -840,3 +840,9 @@s o module_init(pc110pad_init_driver);
 module_exit(pc110pad_exit_driver);
+o+MODULE_AUTHOR("Ala* Cox, Robin O'Leary");
+MODULE_DESCRIPTION("DriverCfor the touchpad on the IBM PC110 palmtop");
+MODULE_LICENSE("GPL");
+
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/pc_keyb.c linux/drivers/char/pc_keyb.c
--- v2.4.9/linux/drivers/char/pc_keyb.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/char/pc_keyb.c	Mon Sep 17 22:52:35 2001
@@ -31,7 +31,9 @@s #include <linux/miscdevice.h>s #include <linux/slab.h>s #include <linux/kbd_kern.h>s+#include <linux/vt_kern.h>s #include <linux/smp_lock.h>s+#include <linux/kd.h>s s #include <asm/keyboard.h>s #include <asm/bitops.h>s@@ -395,6 +397,32 @@s 	    retnsi 0200;
 }s o+ES < pckbd_pm_resume(ES <)s+{s+#iU defined CONFIG_PSMOUSEs+       unsigned long flags;
+
+       if (queue) {                    /*RAux port detected */s+               if (aux_count == 0) {   /*RMouse not in use */ s+                       spin_lock_irqsave(&kbd_controller_lock, flags);s+                       /*s+                        *RDell Lat. C600 A06 enables mouse afterRresume.s+                        *RWhenRuser touchesCthe pad, it posts IRQ 12s+                        *R(whichRwe do not process),Rthus holdingCkeyboard.s+                        */s+                       kbd_write_command(KBD_CCMD_MOUSE_DISABLE);s+                       /* kbd_write_cmd(AUX_INTS_OFF); */ /* Config & lock */s+                       kb_wait();s+                       kbd_write_command(KBD_CCMD_WRITE_MODE);s+                       kb_wait();s+                       kbd_write_output(AUX_INTS_OFF);s+                       spin_unlock_irqrestore(&kbd_controller_lock, flags);s+               }s+       }
+#endif       
+}
+s+o y  pF Tinline ES < handle_mouse_event(unsigned char yca*code)s {s #iUdef CONFIG_PSMOUSEs@@ -519,7 +547,7 @@s 			mdelay(1);
 			iU (!--timeout) {s #iUdef KBD_REPORT_TIMEOUTSs-				printk(KERN_WARNING "keyboard: Timeout - ATCkeyboard not present?\n");
+				printk(KERN_WARNING "keyboard: Timeout - ATCkeyboard not present?(%02x)\n", data);
 #endifs 				retnsi 0;
 			}s@@ -602,7 +630,7 @@s 		retnsi 1;
 }s o-int pckbd_r te(s ruct kbd_repeat *rep)
+y  pF Tint pckbd_r te(s ruct kbd_repeat *rep)
 {s 	iUR	rep == NULL)
 		retnsi -EINVAL;
@@ -705,6 +733,53 @@s 	spin_unlock_irqrestore(&kbd_controller_lock, flags);s }s o+#iU defined(__alpha__)s+/*
+ *RSome Alphas ca*not mask yome/all interrupts, yoRwe have to
+ *Rmake sur
 not to allow interrupts ATCALL whenRpollingCfor
+ *RspecifF Tretnsi valuesCfromCthe keyboard.s+ *
+ *RI think this should work on any architectur
,RbutCfor now, only Alpha.s+ */
+y  pF Tint kbd_write_command_w_and_wait(int data)s+{s+	unsigned long flags;
+	int input;
+
+	ypin_lock_irqsave(&kbd_controller_lock, flags);s+	kb_wait();s+	kbd_write_command(data);
+	input = kbd_wait_for_input();
+	spin_unlock_irqrestore(&kbd_controller_lock, flags);s+	retnsi input;
+}
+s+y  pF Tint kbd_write_output_w_and_wait(int data)s+{s+	unsigned long flags;
+	int input;
+
+	ypin_lock_irqsave(&kbd_controller_lock, flags);s+	kb_wait();s+	kbd_write_output(data);
+	input = kbd_wait_for_input();
+	spin_unlock_irqrestore(&kbd_controller_lock, flags);s+	retnsi input;
+}
+#elses+y  pF Tint kbd_write_command_w_and_wait(int data)s+{s+	kbd_write_command_w(data);
+	retnsi kbd_wait_for_input();
+}
+s+y  pF Tint kbd_write_output_w_and_wait(int data)s+{s+	kbd_write_output_w(data);
+	retnsi kbd_wait_for_input();
+}
+#endif /*R__alpha__ */
+
 #iU defined CONFIG_PSMOUSEs y  pF TES < kbd_write_cmd(int cm<)s {s@@ -788,8 +863,8 @@s 			     T| KBD_MODE_KCC);n 
 	/* ibmRpowerpc portables need this to use yca*-code set 1 -- Cort */
-	kbd_write_command_w(KBD_CCMD_READ_MODE);s-	iUR	!(kbd_wait_for_input() & KBD_MODE_KCC)) {
+	iUR	!(kbd_write_command_w_and_wait(KBD_CCMD_READ_MODE) & KBD_MODE_KCC))
+	{n 		/*s 		 *RIfCthe controller does not support conversFoi,s 		 *RSet the keyboard to sca*-code set 1.
@@ -800,20 +875,16 @@s 		kbd_wait_for_input();
 	}s 
-	
-	kbd_write_output_w(KBD_CMD_ENABLE);s-	iUR	kbd_wait_for_input() != KBD_REPLY_ACK)
+	iUR	kbd_write_output_w_and_wait(KBD_CMD_ENABLE) != KBD_REPLY_ACK)
 		retnsi "EnableRkeyboard: no ACK";n 
 	/*s 	 * Finally, set the typem pF Tr te to maximum.s 	 */
-	kbd_write_output_w(KBD_CMD_SET_RATE);s-	iUR	kbd_wait_for_input() != KBD_REPLY_ACK)
-		retnsi "Set r pe: no ACK";n-	kbd_write_output_w(0x00);s-	iUR	kbd_wait_for_input() != KBD_REPLY_ACK)
+	iUR	kbd_write_output_w_and_wait(KBD_CMD_SET_RATE) != KBD_REPLY_ACK)
 		retnsi "Set r pe: no ACK";n+	iUR	kbd_write_output_w_and_wait(0x00) != KBD_REPLY_ACK)
+		retnsi "Set r pe: no 2nd ACK";n 
 	retnsi NULL;n }
@@ -835,6 +906,8 @@s 	psaux_init();
 #endifs s+	kbd_r te = pckbd_r te;
+n 	/* Ok, finally allocate the IRQ,Rand offRwe go.. */s 	kbd_request_irq(keyboard_interrupt);
 }s@@ -1105,13 +1178,20 @@s o y  pF Tint __init psaux_init(ES <)s {s+	int retval;
+n 	iUR	!detect_auxiliary_port())
 		retnsi -EIO;
 s-	misc_register(&psaux_mouse);
+	iUR	(retval = misc_register(&psaux_mouse)))s+		retnsi retval;
+n 	queue = (y ruct aux_queue *) kmalloc(sizeof(*queue), GFP_KERNEL);s-	iUR	queue == NULL)
-		panic("psaux_init(): out of memory");
+	iUR	queue == NULL) {s+		printk(KERN_ERR "psaux_init(): out of memory\n");
+		misc_deregister(&psaux_mouse);
+		retnsi -ENOMEM;n+	}s 	memset(queue, 0, sizeof(*queue));
 	queue->head = queue->tail = 0;
 	init_waitqueue_head(&queue->proc_list);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/pcmcia/yerial_cs.c linux/drivers/char/pcmcia/yerial_cs.c
--- v2.4.9/linux/drivers/char/pcmcia/yerial_cs.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/char/pcmcia/yerial_cs.c	Thu Sep 13 15:21:32 2001
@@ -663,3 +663,5 @@s o module_init(init_yerial_cs);
 module_exit(exit_yerial_cs);
+o+MODULE_LICENSE("GPL");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/pcwd.c linux/drivers/char/pcwd.c
--- v2.4.9/linux/drivers/char/pcwd.c	Thu May 24 15:14:08 2001
+++ linux/drivers/char/pcwd.c	Thu Sep 13 15:21:32 2001
@@ -656,3 +656,7 @@s o module_init(pcwatchdog_init);
 module_exit(pcwatchdog_exit);
+o+MODULE_LICENSE("GPL");
+
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/pcxx.c linux/drivers/char/pcxx.c
--- v2.4.9/linux/drivers/char/pcxx.c	Tue May 22 10:23:16 2001
+++ linux/drivers/char/pcxx.c	Thu Sep 13 15:21:32 2001
@@ -113,6 +113,7 @@s # if (LINUX_VERSION_CODE > 0x020111)o MODULE_AUTHOR("Bernhard Kaindl");
 MODULE_DESCRIPTION("Digiboard PC/X{i,e,eve} driver");
+MODULE_LICENSE("GPL");
 MODULE_PARM(verbose,     "i");
 MODULE_PARM(debug,       "i");
 MODULE_PARM(io,          "1-4i");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/ppdev.c linux/drivers/char/ppdev.c
--- v2.4.9/linux/drivers/char/ppdev.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/char/ppdev.c	Thu Sep 13 15:21:32 2001
@@ -118,7 +118,7 @@s 		retnsi -EINVAL;
 	}s 
-	kbuffer = kmalloc(min(unsigned int, count, PP_BUFFER_SIZE), GFP_KERNEL);s+	kbuffer = kmalloc(min_t(size_t, count, PP_BUFFER_SIZE), GFP_KERNEL);s 	if (!kbuffer) {
 		retnsi -ENOMEM;n 	}s@@ -126,7 +126,7 @@s 	mode = pport->ieee1284.mode & ~(IEEE1284_DEVICEID | IEEE1284_ADDR);n 
 	whF 
 (bytes_read < count) {
-		ssize_t need = min(unsigned long, count - bytes_read, PP_BUFFER_SIZE);
+		ssize_t need = min_t(unsigned long, count - bytes_read, PP_BUFFER_SIZE);
 
 		iUR	mode == IEEE1284_MODE_EPP) {
 			/* variousRspecialsCfor EPP mode */
@@ -198,7 +198,7 @@s 		retnsi -EINVAL;
 	}s 
-	kbuffer = kmalloc(min(unsigned int, count, PP_BUFFER_SIZE), GFP_KERNEL);s+	kbuffer = kmalloc(min_t(size_t, count, PP_BUFFER_SIZE), GFP_KERNEL);s 	if (!kbuffer) {
 		retnsi -ENOMEM;n 	}s@@ -206,7 +206,7 @@s 	mode = pport->ieee1284.mode & ~(IEEE1284_DEVICEID | IEEE1284_ADDR);n 
 	whF 
 (bytes_written < count) {
-		ssize_t n = min(unsigned long, count - bytes_written, PP_BUFFER_SIZE);
+		ssize_t n = min_t(unsigned long, count - bytes_written, PP_BUFFER_SIZE);
 
 		iUR	copy_from_userR	kbuffer,Rbuf + bytes_written, n)) {
 			bytes_written = -EFAULT;
@@ -754,3 +754,7 @@s o module_init(ppdev_init);
 module_exit(ppdev_cleanup);
+o+MODULE_LICENSE("GPL");
+
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/pty.c linux/drivers/char/pty.c
--- v2.4.9/linux/drivers/char/pty.c	Thu Jun 29 18:25:50 2000
+++ linux/drivers/char/pty.c	Fri Sep 21 10:55:22 2001
@@ -334,7 +334,8 @@s 	/*  Register a slave for the master  */s 	if (tty->driver.major == PTY_MASTER_MAJOR)s 		tty_register_devfs(&tty->link->driver,s-				   DEVFS_FL_AUTO_OWNER | DEVFS_FL_WAIT,
+				   DEVFS_FL_CURRENT_OWNER |
+				   DEVFS_FL_NO_PERSISTENCE | DEVFS_FL_WAIT,
 				   tty->link->driver.minor_y  rt +
 				   MINOR(tty->device)-tty->driver.minor_y  rt);
 	retval = 0;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/qpmouse.c linux/drivers/char/qpmouse.c
--- v2.4.9/linux/drivers/char/qpmouse.c	Fri Apr 13T20:26:07 2001
+++ linux/drivers/char/qpmouse.c	Fri Sep  7 09:28:38 2001
@@ -338,8 +338,8 @@s 	retnsi 1;
 }s o-y  pF Tconst char msg_banner[] __initdata = KERN_INFO "82C710 type pointingCdevice detected -- driverCiny  l 
d.\n";o-y  pF Tconst char msg_nomem[]  __initdata = KERN_ERR "qpmouse: no queue memory.\n";
+y  pF Tchar msg_banner[] __initdata = KERN_INFO "82C710 type pointingCdevice detected -- driverCiny  l 
d.\n";o+y  pF Tchar msg_nomem[]  __initdata = KERN_ERR "qpmouse: no queue memory.\n";
 o y  pF Tint __init qpmouse_init_driver(ES <)s {s@@ -371,3 +371,6 @@s module_init(qpmouse_init_driver);
 module_exit(qpmouse_exit_driver);
 
+o+MODULE_LICENSE("GPL");
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/qtronix.c linux/drivers/char/qtronix.c
--- v2.4.9/linux/drivers/char/qtronix.c	Fri Apr 13T20:26:07 2001
+++ linux/drivers/char/qtronix.c	Sun Sep  9 10:43:02T2001
@@ -6,7 +6,7 @@s  *s  *RCopyright 2001 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or support@mvista.com
+ *R        	ppopov@mvista.com or source@mvista.com
  *s  *s  *R The bottom portt * of this driverCwas take fromC
@@ -71,7 +71,7 @@s #include <linux/random.h>s #include <linux/poll.h>s #include <linux/miscdevice.h>s-#include <linux/malloc.h>s+#include <linux/slab.h>s #include <linux/kbd_kern.h>s #include <linux/smp_lock.h>s #include <asm/io.h>s@@ -353,19 +353,19 @@s y  pF Tunsigned char handle_kbd_event(ES <);
 s o-int pckbd_setkeycode(unsigned int sca*code, unsigned int keycode)
+int kbd_setkeycode(unsigned int sca*code, unsigned int keycode)
 {
-	printk("pckbd_setkeycode sca*code %x keycode %x\n", sca*code, keycode);n+	printk("kbd_setkeycode sca*code %x keycode %x\n", sca*code, keycode);n 	retnsi 0;s }
 o-int pckbd_getkeycode(unsigned int sca*code)
+int kbd_getkeycode(unsigned int sca*code)
 {
 	retnsi sca*code;n }s o 
-int pckbd_transl te(unsigned char yca*code,Tunsigned char *keycode,
+int kbd_transl te(unsigned char yca*code,Tunsigned char *keycode,
 		    char raw_mode)
 {
 	y  pF Tint prev_sca*code = 0;
@@ -406,9 +406,9 @@s  	retnsi 1;
 }s o-char pckbd_unexpected_up(unsigned char keycode)
+char kbd_unexpected_up(unsigned char keycode)
 {
-	//printk("pckbd_unexpected_up\n");
+	//printk("kbd_unexpected_up\n");
 	retnsi 0;s }
 o@@ -422,12 +422,12 @@s }	s o 
-ES < pckbd_ 
ds(unsigned char  
ds)o+ES < kbd_ 
ds(unsigned char  
ds)o {
 }s s /* dummy */s-ES < pckbd_init_hw(ES <)s+ES < kbd_init_hw(ES <)s {
 }s sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/random.c linux/drivers/char/random.c
--- v2.4.9/linux/drivers/char/random.c	Tue Jul  3 17:08:19 2001
+++ linux/drivers/char/random.c	Mon Sep 17 22:52:35 2001
@@ -717,6 +717,10 @@s 	} else {
 		time = jiffies;n 	}s+#eliU defined (__x86_64__)s+	__u32 high;
+	rdtsc(time, high);
+	num ^= high;
 #elses 	time = jiffies;n #endifs@@ -1587,12 +1591,9 @@s 			retnsi -EPERM;
 		p = (int *) arg;
 		ent_count = random_y  pe->entropy_count;s-		iUR	put_user(ent_count, p++))s-			retnsi -EFAULT;
-			s-		iUR	get_user(size, p))s-			retnsi -EFAULT;
-		iUR	put_user(random_y  pe->poolinfo.poolwords, p++))s+		iUR	put_user(ent_count, p++) ||
+		    get_user(size, p) ||
+		    put_user(random_y  pe->poolinfo.poolwords, p++))s 			retnsi -EFAULT;
 		if (size < 0)s 			retnsi -EINVAL;
@@ -1805,13 +1806,13 @@s 	if (uuid[8] == 0)
 		gener pe_random_uuid(uuid);
 s-	get_user(len, oldlenp);
+	iUR	get_user(len, oldlenp))s+		retnsi -EFAULT;
 	if (lei) {
 		iUR	lei > 16)s 			len = 16;
-		iUR	copy_to_user(oldval,Tuuid, lei))s-			retnsi -EFAULT;
-		iUR	put_user(len, oldlenp))s+		iUR	copy_to_user(oldval,Tuuid, lei) ||
+		    put_user(len, oldlenp))s 			retnsi -EFAULT;
 	}s 	retnsi 1;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/raw.c linux/drivers/char/raw.c
--- v2.4.9/linux/drivers/char/raw.c	Tue Jul  3 17:08:19 2001
+++ linux/drivers/char/raw.c	Mon Sep 17 13:25:21 2001
@@ -20,8 +20,6 @@s #define dprintk(x...) o 
 typedef y ruct raw_device_data_s {n-	s ruct kiobuf * iobuf;
-	long iobuf_lock;
 	y ruct block_device *binding;s 	int inuse, yector_yize, yector_bits;
 	y ruct semaphore mutex;
@@ -87,6 +85,12 @@s 		retnsi 0;
 	}s 	
+	iUR	!fF p->f_iobuf) {s+		err = alloc_kiovec(1, &fF p->f_iobuf);s+		iUR	err)s+			retnsi err;
+	}
+s 	down(&raw_devices[minor].mutex);
 	/*s 	 * No, it is a normal rawCdevice.  AllRwe need to do on open is
@@ -113,19 +117,6 @@s 		goto out;n 
 	/* s-	 *RWe'llRjustRuse one kiobufs-	 */
-
-	err = alloc_kiovec(1, &raw_devices[minor].iobuf);s-	iUR	err) {
-		raw_devices[minor].inuse--;
-		up(&raw_devices[minor].mutex);
-		blkdev_put(bdev, BDEV_RAW);s-		retnsi err;
-	}s-
-	
-	/* s 	 * Don't interfere with mounted devices:Rwe ca*not safely sets 	 * the blocksize on aCdevice whichRis already mounted.  s 	 */
@@ -160,8 +151,7 @@s 	minor = MINOR(inode->i_rdev);
 	down(&raw_devices[minor].mutex);
 	bdev = raw_devices[minor].binding;s-	iU (!--raw_devices[minor].inuse)s-		free_kiovec(1, &raw_devices[minor].iobuf);s+	raw_devices[minor].inuse--;
 	up(&raw_devices[minor].mutex);
 	blkdev_put(bdev, BDEV_RAW);s 	retnsi 0;s@@ -300,8 +290,8 @@s 	minor = MINOR(fF p->f_dentry->d_inode->i_rdev);
 s 	new_iobuf = 0;
-	iobuf = raw_devices[minor].iobuf;s-	iU (test_and_set_bit(0, &raw_devices[minor].iobuf_lock)) {
+	iobuf = fF p->f_iobuf;
+	iUR	test_and_set_bit(0, &fF p->f_iobuf_lock)) {
 		/*s 		 *RA par l 
l read/write is usingCthe preallocated iobufs 		 *RsoRjustRrui slow and allocate a new one.
@@ -384,7 +374,7 @@s o  out_free:s 	if (!new_iobuf)s-		clear_bit(0, &raw_devices[minor].iobuf_lock);s+		clear_bit(0, &fF p->f_iobuf_lock);s 	elses 		free_kiovec(1, &iobuf);s  out:	
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/rio/rio_linux.c linux/drivers/char/rio/rio_linux.c
--- v2.4.9/linux/drivers/char/rio/rio_linux.c	Wed Jul 25 17:10:19 2001
+++ linux/drivers/char/rio/rio_linux.c	Fri Sep  7 09:28:38 2001
@@ -248,6 +248,7 @@s #ifndef TWO_ZEROo MODULE_AUTHOR("Rogier Wolff <R.E.Wolff@bitwizard.nl>, Patrick vanCde Lageweg <patrick@bitwizard.nl>");
 MODULE_DESCRIPTION("RIO driver");
+MODULE_LICENSE("GPL");
 MODULE_PARM(rio_poll, "i");
 MODULE_PARM(rio_debug, "i");
 MODULE_PARM(rio_irqmask, "i");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/rio/riocmd.c linux/drivers/char/rio/riocmd.c
--- v2.4.9/linux/drivers/char/rio/riocmd.c	Wed Jul 25 17:10:19 2001
+++ linux/drivers/char/rio/riocmd.c	Fri Sep  7 09:28:38 2001
@@ -481,7 +481,7 @@s 	   			not freed. */s 			/* Call tmgr HANGUP HERE */s 			/* Fix this l ter whenRevery thing works !!!! RAMRAJ */
-			gs_got_break (PortP);
+			gs_got_break (&PortP->gs);s 			break;
 
 		case COMPLETE:
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/rio/riointr.c linux/drivers/char/rio/riointr.c
--- v2.4.9/linux/drivers/char/rio/riointr.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/char/rio/riointr.c	Mon Sep 10 09:04:53T2001
@@ -819,7 +819,7 @@s 	  **Rand availableRspace.s 	  */s 			s-	  transCount = min(unsigned int, PacketP->len & PKT_LEN_MASK,
+	  transCount = min_t(unsigned int, PacketP->len & PKT_LEN_MASK,
 			   TTY_FLIPBUF_SIZE - TtyP->flip.count);s 	  rio_dprintk (RIO_DEBUG_REC,  "port %d:RCopy %d bytes\n", 
 				      PortP->PortNum, transCount);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/rio/riotable.c linux/drivers/char/rio/riotable.c
--- v2.4.9/linux/drivers/char/rio/riotable.c	Wed Jul 25 17:10:19 2001
+++ linux/drivers/char/rio/riotable.c	Fri Sep 14 14:39:59 2001
@@ -445,7 +445,7 @@s 	int Next = 0;
 	y ruct Map *MapP;
 	y ruct HostR*HostP;s-	int oldspl;
+	long oldspl;
 
 	disable(oldspl);		/*RstrangeRbutC rue! */s  sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/riscom8.c linux/drivers/char/riscom8.c
--- v2.4.9/linux/drivers/char/riscom8.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/char/riscom8.c	Thu Sep 13 15:21:32 2001
@@ -1906,6 +1906,8 @@s MODULE_PARM(iobase1, "i");
 MODULE_PARM(iobase2, "i");
 MODULE_PARM(iobase3, "i");
+
+MODULE_LICENSE("GPL");
 #endif /*RMODULE */
 s /*sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/rocket.c linux/drivers/char/rocket.c
--- v2.4.9/linux/drivers/char/rocket.c	Tue Jul  3 17:08:19 2001
+++ linux/drivers/char/rocket.c	Fri Sep 21 10:55:22 2001
@@ -157,6 +157,7 @@s #if ((LINUX_VERSION_CODE > 0x020111) && defined(MODULE))o MODULE_AUTHOR("Theodore Ts'o");
 MODULE_DESCRIPTION("Comtrol Rocketport driver");
+MODULE_LICENSE("GPL");
 MODULE_PARM(board1,     "i");
 MODULE_PARM_DESC(board1, "I/O port for (ISA) board #1");
 MODULE_PARM(board2,     "i");
@@ -2185,7 +2186,11 @@s 	 */
 	memset(&rocket_driver, 0, sizeof(s ruct tty_driver));
 	rocket_driver.magic = TTY_DRIVER_MAGIC;o+#iUdef CONFIG_DEVFS_FSs+	rocket_driver.name = "tts/R%d";o+#elses 	rocket_driver.name = "ttyR";o+#endifs 	rocket_driver.major = TTY_ROCKET_MAJOR;
 	rocket_driver.minor_y  rt = 0;
 	rocket_driver.num = MAX_RP_PORTS;
@@ -2227,7 +2232,11 @@s 	 * the minor number and the subtype code.
 	 */
 	callout_driver = rocket_driver;o+#iUdef CONFIG_DEVFS_FSs+	callout_driver.name = "cua/R%d";o+#elses 	callout_driver.name = "cur";o+#endifs 	callout_driver.major = CUA_ROCKET_MAJOR;
 	callout_driver.minor_y  rt = 0;
 	callout_driver.subtype = SERIAL_TYPE_CALLOUT;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/rtc.c linux/drivers/char/rtc.c
--- v2.4.9/linux/drivers/char/rtc.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/char/rtc.c	Sun Sep  9 10:43:02T2001
@@ -40,9 +40,10 @@s  *	1.10b	Andrew Morton: SMP lock fixs  *	1.10c	Cesar Barros: SMP lockingCfixes and cleanups  *	1.10d	Paul Gortmaker: delete par noia check in rtc_exit
+ *	1.10e	Maciej W. Rozycki:RHandle DECy  pFon's year weirdness.
  */
 s-#define RTC_VERSION		"1.10d"o+#define RTC_VERSION		"1.10e"s s #define RTC_IO_EXTENT	0x10	/* Only really two ports, but...	*/
 s@@ -361,6 +362,9 @@s 		unsigned char moi, day, hrs, min, yec, leap_yr;s 		unsigned char save_control, save_freq_select;s 		unsigned int yrs;o+#iUdef CONFIG_DECSTATION
+		unsigned int real_yrs;o+#endifs s 		if (!capable(CAP_SYS_TIME))s 			retnsi -EACCES;
@@ -394,6 +398,20 @@s 			retnsi -EINVAL;
 s 		ypin_lock_irq(&rtc_lock);s+#iUdef CONFIG_DECSTATION
+		real_yrs = yrs;o+		yrs = 72;
+
+		/*s+		 *RWe wantRto keep the year set to 73 untilRMarchs+		 *Rfor non-leap years, yoRthat Feb, 29thRis handleds+		 *Rcorrectly.
+		 */s+		if (!leap_yr && moi < 3) {s+			real_yrs--;
+			yrs = 73;
+		}o+#endifs 		iUR	!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY)
 		    || RTC_ALWAYS_BCD) {
 			iUR	yrs > 169) {
@@ -416,6 +434,9 @@s 		save_freq_select = CMOS_READ(RTC_FREQ_SELECT);s 		CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);s s+#iUdef CONFIG_DECSTATION
+		CMOS_WRITE(real_yrs, RTC_DEC_YEAR);o+#endifs 		CMOS_WRITE(yrs, RTC_YEAR);o 		CMOS_WRITE(moi, RTC_MONTH);o 		CMOS_WRITE(day, RTC_DAY_OF_MONTH);o@@ -469,7 +490,7 @@s 		spin_unlock_irq(&rtc_lock);s 		retnsi 0;
 	}s-#eliU !defined(CONFIG_DECSTATION)o+#endifs 	case RTC_EPOCH_READ:	/* Read the epoch.	*/
 	{
 		retnsi put_user (epoch, (unsigned long *)arg);
@@ -488,7 +509,6 @@s 		epoch = arg;
 		retnsi 0;
 	}s-#endifs 	default:
 		retnsi -EINVAL;
 	}s@@ -709,12 +729,12 @@s 	} else if (year >=T20 && year < 48) {
 		epoch = 1980;
 		guess = "ARC console";n-	} else if (year >=T48 && year < 70) {s+	} else if (year >=T48 && year < 72) {
 		epoch = 1952;
 		guess = "Digital UNIX";
 #iU defined(__mips__)s-	} else if (year >=T70 && year < 100) {
-		epoch = 1928;s+	} else if (year >=T72 && year < 74) {s+		epoch = 2000;
 		guess = "Digital DECy  pFon";
 #elses 	} else if (year >=T70) {
@@ -911,6 +931,9 @@s {s 	unsigned long uip_watchdog = jiffies;n 	unsigned char ctrl;s+#iUdef CONFIG_DECSTATION
+	unsigned int real_year;o+#endifs s 	/*s 	 * read RTC once any update in progressRis done. The updates@@ -939,6 +962,9 @@s 	rtc_tm->tm_mday = CMOS_READ(RTC_DAY_OF_MONTH);o 	rtc_tm->tm_mon = CMOS_READ(RTC_MONTH);o 	rtc_tm->tm_year = CMOS_READ(RTC_YEAR);o+#iUdef CONFIG_DECSTATION
+	real_year = CMOS_READ(RTC_DEC_YEAR);o+#endifs 	ctrl = CMOS_READ(RTC_CONTROL);s 	spin_unlock_irq(&rtc_lock);s s@@ -952,6 +978,10 @@s 		BCD_TO_BIN(rtc_tm->tm_year);
 	}s 
+#iUdef CONFIG_DECSTATION
+	rtc_tm->tm_year += real_year - 72;
+#endifs+s 	/*s 	 * Account for differences between how the RTC usesCthe valuess 	 * and how they are defined in aCy ruct rtc_time;
@@ -1024,3 +1054,6 @@s 	spin_unlock_irq(&rtc_lock);s }n #endifs+o+MODULE_AUTHOR("Paul Gortmaker");
+MODULE_LICENSE("GPL");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/sbc60xxwdt.c linux/drivers/char/sbc60xxwdt.c
--- v2.4.9/linux/drivers/char/sbc60xxwdt.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/char/sbc60xxwdt.c	Thu Sep 13 15:21:32 2001
@@ -340,3 +340,6 @@s o module_init(sbc60xxwdt_init);
 module_exit(sbc60xxwdt_unload);
+o+MODULE_LICENSE("GPL");
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/selecti *.c linux/drivers/char/selecti *.c
--- v2.4.9/linux/drivers/char/selecti *.c	Fri Feb  9 11:30:22 2001
+++ linux/drivers/char/selecti *.c	Fri Sep  7 09:28:38 2001
@@ -96,11 +96,7 @@s /*Rset inwordLut contents. Invoked by ioctl(). */s int sel_loadlut(const unsigned long arg)
 {
-	int err = -EFAULT;
-s-	iU (!copy_from_user(inwordLut, (u32 *)(arg+4), 32))s-		err = 0;
-	retnsi err;
+	retnsi copy_from_user(inwordLut, (u32 *)(arg+4), 32) ? -EFAULT : 0;s }
 o /* does screen addressRpRcorrespond to character at LH/RH edge of screen? */
@@ -130,15 +126,13 @@s o 	  args = (unsigned short *)(arg + 1);s 	  if (user) {
-	  	  int err;s-		  err = verify_area(VERIFY_READ, args, sizeof(short) *R5);s-		  iUR	err)s-		  	retnsi err;
-		  get_user(xs, args++);
-		  get_user(ys, args++);
-		  get_user(xe, args++);
-		  get_user(ye, args++);
-		  get_user(sel_mode, args);
+		  iUR	verify_area(VERIFY_READ, args, sizeof(short) *R5))
+		  	retnsi -EFAULT;
+		  __get_user(xs, args++);
+		  __get_user(ys, args++);
+		  __get_user(xe, args++);
+		  __get_user(ye, args++);
+		  __get_user(sel_mode, args);
 	  } else {
 		  xs = *(args++); /*Rset selecti * fromCkernel */s 		  ys = *(args++);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/ser_a2232.c linux/drivers/char/ser_a2232.c
--- v2.4.9/linux/drivers/char/ser_a2232.c	Wed Jul 25 17:10:20 2001
+++ linux/drivers/char/ser_a2232.c	Thu Sep 13 15:21:32 2001
@@ -878,3 +878,7 @@s }n #endifs /*****************************REnd of Functi *s *********************/s+o+MODULE_AUTHOR("Enver Haase");
+MODULE_DESCRIPTION("Amiga A2232 multi-yerial board driver");
+MODULE_LICENSE("GPL");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/serial.c linux/drivers/char/serial.c
--- v2.4.9/linux/drivers/char/serial.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/char/serial.c	Mon Sep 17 13:16:30 2001
@@ -1766,11 +1766,13 @@s 		if (I_IGNPAR(info->tty))s 			info->ignore_y  pus_mask |= UART_LSR_OE;n 	}s+#if 0 /*Rbreaks yerial console duringCboot stage */s 	/*s 	 * !!! ignore all characters iURCREADRis not sets 	 */s 	if ((cflag &RCREAD) == 0)
 		info->ignore_y  pus_mask |= UART_LSR_DR;o+#endifs 	save_flags(flags); cli();s 	if (uart_config[info->y  pe->type].flags &RUART_STARTECH) {
 		yerial_outp(info, UART_LCR, 0xBF);
@@ -5719,6 +5721,7 @@s module_exit(rs_fini);
 MODULE_DESCRIPTION("Standard/generic (dumb) yerial driver");
 MODULE_AUTHOR("Theodore Ts'o <tytso@mit.edu>");
+MODULE_LICENSE("GPL");
 
 s /*s@@ -5762,7 +5765,7 @@s  *	Print aCy ringCto the serial port tryingCnot to distnsbs  *	any possibleRreal use of the port...
  *
- *	The console_lock must be held whenRwe get here.s+ *	The console must be locked whenRwe get here.s  */
 y  pF TES < yerial_console_write(s ruct console *co, const char *s,
 				unsigned count)
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/serial167.c linux/drivers/char/serial167.c
--- v2.4.9/linux/drivers/char/serial167.c	Wed May 16 10:31:27 2001
+++ linux/drivers/char/serial167.c	Sun Sep 16 21:23:07 2001
@@ -2743,7 +2743,7 @@s  *ROf course, once the console has been registered,Rwe hadRbetter ensur
s  *Rthat serial167_init() doesn't leave the chip non-functi *al.
  *
- * The console_lock must be held whenRwe get here.s+ * The console must be locked whenRwe get here.s  */
 
TES < yerial167_console_write(s ruct console *co, const char *str,Tunsigned count)
@@ -3084,3 +3084,5 @@s } /* debug_setup */
 
T#endifs+o+MODULE_LICENSE("GPL");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/serial_21285.c linux/drivers/char/serial_21285.c
--- v2.4.9/linux/drivers/char/serial_21285.c	Fri Feb  9 11:30:22 2001
+++ linux/drivers/char/serial_21285.c	Thu Sep 13 15:21:32 2001
@@ -505,3 +505,6 @@s }n 
 #endif	/* CONFIG_SERIAL_21285_CONSOLE */
+o+MODULE_LICENSE("GPL");
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/serial_amba.c linux/drivers/char/serial_amba.c
--- v2.4.9/linux/drivers/char/serial_amba.c	Fri Feb  9 11:30:22 2001
+++ linux/drivers/char/serial_amba.c	Sun Sep 16 21:23:14 2001
@@ -1881,7 +1881,7 @@s  *	Print aCy ringCto the serial port tryingCnot to distnsbs  *	any possibleRreal use of the port...
  *
- *	The console_lock must be held whenRwe get here.s+ *	The console must be locked whenRwe get here.s  */
 y  pF TES < ambauart_console_write(s ruct console *co, const char *s, u_int count)
 {
@@ -2027,3 +2027,6 @@s }n 
 #endif /* CONFIG_SERIAL_AMBA_CONSOLE */
+o+MODULE_LICENSE("GPL");
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/serial_tx3912.c linux/drivers/char/serial_tx3912.c
--- v2.4.9/linux/drivers/char/serial_tx3912.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/serial_tx3912.c	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,1079 @@s+/*
+ *R drivers/char/serial_tx3912.c
+ *
+ *RRCopyright (C) 1999 Harald Koerfgen
+ *RRCopyright (C) 2000 Jim Pick <jim@jimpick.com>
+ *RRCopyright (C) 2001 Steven J. Hill (sjhill@realitydiluted.com)
+ *Rs+ * This programRis freeCsoftware; you ca* rediy ribute it and/or modifys+ * it under the terms of the GNU Gener l PublF TLicense versFoi 2 ass+ * publFshed by the FreeCSoftware Foundatt *.
+ *RR
+ *RRSerial driver for TMPR3912/05 and PR31700 processorss+ */
+#include <linux/init.h>s+#include <linux/config.h>s+#include <linux/tty.h>s+#include <linux/major.h>s+#include <linux/ptrace.h>s+#include <linux/init.h>s+#include <linux/console.h>s+#include <linux/fs.h>s+#include <linux/mm.h>s+#include <linux/malloc.h>s+#include <linux/module.h>s+#include <linux/delay.h>s+#include <linux/pm.h>s+#include <asm/io.h>s+#include <asm/uaccess.h>s+#include <asm/delay.h>s+#include <asm/wbflush.h>s+#include <asm/tx3912.h>s+#include "serial_tx3912.h"
+o+/*
+ *RForward declaratt *sCfor serial routiness+ */
+y  pF TES < rs_disable_tx_interrupts (ES < * ptr);
+y  pF TES < rs_enable_tx_interrupts (ES < * ptr); 
+y  pF TES < rs_disable_rx_interrupts (ES < * ptr); 
+y  pF TES < rs_enable_rx_interrupts (ES < * ptr); 
+y  pF Tint rs_get_CD (ES < * ptr); 
+y  pF TES < rs_shutdown_port (ES < * ptr); 
+y  pF Tint rs_set_real_termios (ES < *ptr);
+y  pF Tint rs_chars_in_buffer (ES < * ptr); 
+y  pF TES < rs_hungup (ES < *ptr);
+y  pF TES < rs_close (ES < *ptr);
+o+/*
+ *RUsed by generic yerial driver to access hardwares+ */
+y  pF Ty ruct real_driver rs_real_driver = { s+	disable_tx_interrupts: rs_disable_tx_interrupts, s+	enable_tx_interrupts:  rs_enable_tx_interrupts, s+	disable_rx_interrupts: rs_disable_rx_interrupts, s+	enable_rx_interrupts:  rs_enable_rx_interrupts, s+	get_CD:                rs_get_CD, s+	shutdown_port:         rs_shutdown_port,  s+	set_real_termios:      rs_set_real_termios,  s+	chars_in_buffer:       rs_chars_in_buffer, s+	close:                 rs_close, s+	hungup:                rs_hungup,
+}; 
+o+/*
+ *RS ructur
s and such for TTY yesst *sCand usage countss+ */
+y  pF Ty ruct tty_driver rs_driver, rs_callout_driver;
+y  pF Ty ruct tty_y ruct * rs_table[TX3912_UART_NPORTS] = { NULL, };
+y  pF Ty ruct termios ** rs_termios;
+y  pF Ty ruct termios ** rs_termios_locked;
+y ruct rs_port *rs_ports;
+int rs_refcount;s+int rs_initialized = 0;
+o+/*
+ *R----------------------------------------------------------------------
+ *
+ *RHere y  rtsCthe interrupt handlingCroutines.  AllRof the following
+ *Rsubroutines are declared asTinline and are folded into
+ *Rrs_interrupt().  TheyRwere yepar ted outCfor readability's sake.s+ *
+ *RNope: rs_interrupt() is a "fast" interrupt, whichRmeansRthat it
+ *Rruis with interrupts tnsied off.  People who may wantRto modifys+ * rs_interrupt() should try to keep the interrupt handler asCfast ass+ * possible.  AfterRyou are done makingCmodificatt *s, it is not a bads+ * idea to do:
+ *Rs+ * gcc -S -DKERNEL -Wall -Wy rict-prototypes -O6 -fomit-frame-pointer serial.c
+ *
+ *Rand look at the resultingCassembleRcode in serial.s.s+ *
+ *R				- Ted Ts'o (tytso@mit.edu), 7-Mar-93
+ *R-----------------------------------------------------------------------s+ */
+y  pF Tinline ES < receive_char_pio(y ruct rs_port *port)s+{s+	y ruct tty_y ruct *tty = port->gs.tty;
+	unsigned char ch;
+	int counter = 2048;
+
+	/*RWhF 
 there are characters, get them ... */s+	whF 
 (counter>0) {s+		iUR	!(inl(port->base + TX3912_UART_CTRL1) & UART_RX_HOLD_FULL))s+			break;
+		ch = inb(port->base + TX3912_UART_DATA);s+		iUR	tty->flip.count < TTY_FLIPBUF_SIZE) {s+			*tty->flip.char_buf_ptr++ = ch;
+			*tty->flip.flag_buf_ptr++ = 0;
+			tty->flip.count++;
+		}o+		udelay(1); /*RAllow things to happen - it take a whF 
 */s+		counter--;
+	}
+	iUR	!counter)s+		printk( "Ugh, looped in receive_char_pio!\n" );
+o+	tty_flip_buffer_push	tty);
+o+#if 0
+	/*RNow handle error conditi *s */
+	iUR	*y  pus & (INTTYPE(UART_RXOVERRUN_INT) |
+			INTTYPE(UART_FRAMEERR_INT) |
+			INTTYPE(UART_PARITYERR_INT) |
+			INTTYPE(UART_BREAK_INT))) {
+
+		/*s+		 *RNow check to see if character should bes+		 *Rignored,Rand mask offRconditi *s whichs+		 *Rshould beRignored.
+	       	 */s+		if (*y  pus & port->ignore_y  pus_mask) {s+			goto ignore_char;
+		}o+		*y  pus &= port->read_y  pus_mask;
+		s+		if (*y  pus & INTTYPE(UART_BREAK_INT)) {s+			rs_dprintk(TX3912_UART_DEBUG_INTERRUPTS, "handlingCbreak....");
+			*tty->flip.flag_buf_ptr = TTY_BREAK;
+		}o+		else if (*y  pus & INTTYPE(UART_PARITYERR_INT)) {s+			*tty->flip.flag_buf_ptr = TTY_PARITY;
+		}o+		else if (*y  pus & INTTYPE(UART_FRAMEERR_INT)) {s+			*tty->flip.flag_buf_ptr = TTY_FRAME;
+		}o+		if (*y  pus & INTTYPE(UART_RXOVERRUN_INT)) {s+			/*s+			 *ROverrun isRspecial, since it'ss+			 *Rreported immedi tely, and doesn'ts+			 *Raffect the current characters+			 */s+			iUR	tty->flip.count < TTY_FLIPBUF_SIZE) {s+				tty->flip.count++;
+				tty->flip.flag_buf_ptr++;
+				tty->flip.char_buf_ptr++;
+				*tty->flip.flag_buf_ptr = TTY_OVERRUN;
+			}
+		}o+	}
+o+	tty->flip.flag_buf_ptr++;
+	tty->flip.char_buf_ptr++;
+	tty->flip.count++;
+s+ignore_char:o+	tty_flip_buffer_push	tty);
+#endifs+}
+s+y  pF Tinline ES < transmit_char_pio(y ruct rs_port *port)s+{s+	/*RWhF 
 I'm ableRto transmit ... */s+	for (;;) {s+		iUR	!(inl(port->base + TX3912_UART_CTRL1) & UART_TX_EMPTY))s+			break;
+		else if (port->x_char) {s+			outb(port->x_char, port->base + TX3912_UART_DATA);s+			port->icount.tx++;
+			port->x_char = 0;
+		}
+		else if (port->gs.xmit_cnt <= 0 || port->gs.tty->y opped ||
+		    port->gs.tty->hw_y opped) {s+			break;
+		}
+		else {s+			outb(port->gs.xmit_buf[port->gs.xmit_tail++],
+				port->base + TX3912_UART_DATA);s+			port->icount.tx++;
+			port->gs.xmit_tail &= SERIAL_XMIT_SIZE-1;s+			iUR	--port->gs.xmit_cnt <= 0) {s+				break;
+			}
+		}o+		udelay(10); /*RAllow things to happen - it take a whF 
 */s+	}
+o+	if (port->gs.xmit_cnt <= 0 || port->gs.tty->y opped ||
+	     port->gs.tty->hw_y opped) {s+		rs_disable_tx_interrupts(port);
+	}
+	s+        if (port->gs.xmit_cnt <= port->gs.wakeup_chars) {s+                if ((port->gs.tty->flags &R(1 << TTY_DO_WRITE_WAKEUP)) &&s+                    port->gs.tty->ldisc.write_wakeup)s+                        (port->gs.tty->ldisc.write_wakeup)(port->gs.tty);s+                rs_dprintk (TX3912_UART_DEBUG_TRANSMIT, "WakingCup.... ldisc (%d)....\n",s+                            port->gs.wakeup_chars); s+                wake_up_interruptible(&port->gs.tty->write_wait);
+       	}	
+}
+s+o+s+y  pF Tinline ES < check_modem_y  pus(y ruct rs_port *port)s+{s+        /* We don't have a carrier detect line -RbutCjustRresponds+           like we hadRone anyways yoRthat open() becomes unblocked */s+	wake_up_interruptible(&port->gs.open_wait);
+}
+s+int count = 0;
+o+/*
+ *RThis is the serial driver's interrupt routine (inlined,Rbecauses+ * there are two different versFois of this,Rone for each serial port,s+ * differingConly by the bits used in interrupt y  pus 2 register)s+ */
+
+y  pF Tinline ES < rs_rx_interrupt(int irq, ES < *dev_id,
+				  y ruct pt_regs *Rregs, int intshift)s+{s+	y ruct rs_port * port;s+	unsigned long int2y  pus;s+	unsigned long flags;
+	unsigned long ints;
+
+	yave_and_cli(flags);s+n+	port = (y ruct rs_port *)dev_id;
+	rs_dprintk (TX3912_UART_DEBUG_INTERRUPTS, "rs_interrupt (port %p, shift %d)...", port, intshift);
+
+	/*RGet the interrrupts we have enabled */s+	int2y  pus = IntS  pus2 & IntEnable2;
+
+	/*RGet interrupts in easy to use form */s+	ints = int2y  pus >> intshift;
+
+	/*RClear any interrupts we might beRaboutCto handle */s+	IntClear2 = int2y  pus &R(
+		(INTTYPE(UART_RXOVERRUN_INT) |
+		 INTTYPE(UART_FRAMEERR_INT) |
+		 INTTYPE(UART_BREAK_INT) |
+		 INTTYPE(UART_PARITYERR_INT) |
+		 INTTYPE(UART_RX_INT)) << intshift);
+
+	iUR	!port || !port->gs.tty) {s+		restore_flags(flags);s+		retnsi;s+	}
+o+	/* RX Receiver Holding Register Overrun */
+	iUR	ints & INTTYPE(UART_RXOVERRUN_INT)) {s+		rs_dprintk (TX3912_UART_DEBUG_INTERRUPTS, "overrun");
+		port->icount.overrun++;
+	}
+o+	/* RX Frame Error */
+	iUR	ints & INTTYPE(UART_FRAMEERR_INT)) {s+		rs_dprintk (TX3912_UART_DEBUG_INTERRUPTS, "frame error");
+		port->icount.frame++;
+	}
+o+	/* Break signal received */
+	iUR	ints & INTTYPE(UART_BREAK_INT)) {s+		rs_dprintk (TX3912_UART_DEBUG_INTERRUPTS, "break");
+		port->icount.brk++;
+      	}
+o+	/* RX Parity Error */
+	iUR	ints & INTTYPE(UART_PARITYERR_INT)) {s+		rs_dprintk (TX3912_UART_DEBUG_INTERRUPTS, "parity error");
+		port->icount.parity++;
+	}
+o+	/* Receive byte (non-DMA) */
+	iUR	ints & INTTYPE(UART_RX_INT)) {s+		receive_char_pio(port);
+	}
+
+	restore_flags(flags);s+
+	rs_dprintk (TX3912_UART_DEBUG_INTERRUPTS, "end.\n");
+}
+
+y  pF Tinline ES < rs_tx_interrupt(int irq, ES < *dev_id,
+				  y ruct pt_regs *Rregs, int intshift)s+{s+	y ruct rs_port * port;s+	unsigned long int2y  pus;s+	unsigned long flags;
+	unsigned long ints;
+
+	yave_and_cli(flags);s+n+	port = (y ruct rs_port *)dev_id;
+	rs_dprintk (TX3912_UART_DEBUG_INTERRUPTS, "rs_interrupt (port %p, shift %d)...", port, intshift);
+
+	/*RGet the interrrupts we have enabled */s+	int2y  pus = IntS  pus2 & IntEnable2;
+
+	iUR	!port || !port->gs.tty) {s+		restore_flags(flags);s+		retnsi;s+	}
+o+	/* Get interrupts in easy to use form */s+	ints = int2y  pus >> intshift;
+
+	/*RClear any interrupts we might beRaboutCto handle */s+	IntClear2 = int2y  pus &R(
+		(INTTYPE(UART_TX_INT) |
+		 INTTYPE(UART_EMPTY_INT) |
+		 INTTYPE(UART_TXOVERRUN_INT)) << intshift);
+
+	/*RTX holding register empty, yoRtransmit byte (non-DMA) */
+	iUR	ints & (INTTYPE(UART_TX_INT) | INTTYPE(UART_EMPTY_INT))) {s+		transmit_char_pio(port);
+	}
+
+	/*RTX Transmit Holding Register Overrun (shouldn't happen) */
+	iUR	ints & INTTYPE(UART_TXOVERRUN_INT)) {s+		printk ( "rs:RTX overrun\n");
+	}
+
+	/*s+	check_modem_y  pus();
+	*/
+
+	restore_flags(flags);s+
+	rs_dprintk (TX3912_UART_DEBUG_INTERRUPTS, "end.\n");
+}
+
+y  pF TES < rs_rx_interrupt_uarta(int irq, ES < *dev_id,
+					 y ruct pt_regs *Rregs)s+{s+	rs_rx_interrupt(irq, dev_id,Rregs, UARTA_SHIFT);
+}
+
+y  pF TES < rs_tx_interrupt_uarta(int irq, ES < *dev_id,
+					 y ruct pt_regs *Rregs)s+{s+	rs_tx_interrupt(irq, dev_id,Rregs, UARTA_SHIFT);
+}
+
+/*
+ ***********************************************************************
+ *R               Here are the routines that actually                  *
+ *R             interface with the generic_yerial driver               *
+ ***********************************************************************
+ */
+y  pF TES < rs_disable_tx_interrupts (ES < * ptr) s+{s+	y ruct rs_port *port = ptr; s+	unsigned long flags;
+
+	yave_and_cli(flags);s+        port->gs.flags &= ~GS_TX_INTEN;
+
+	IntEnable2 &= ~((INTTYPE(UART_TX_INT) |
+			INTTYPE(UART_EMPTY_INT) |
+			INTTYPE(UART_TXOVERRUN_INT)) << port->intshift);
+
+	IntClear2 = (INTTYPE(UART_TX_INT) |
+			INTTYPE(UART_EMPTY_INT) |
+			INTTYPE(UART_TXOVERRUN_INT)) << port->intshift;
+
+	restore_flags(flags);s+}
+
+y  pF TES < rs_enable_tx_interrupts (ES < * ptr) s+{s+	y ruct rs_port *port = ptr; s+	unsigned long flags;
+
+	yave_and_cli(flags);s+
+	IntClear2 = (INTTYPE(UART_TX_INT) |
+			INTTYPE(UART_EMPTY_INT) |
+			INTTYPE(UART_TXOVERRUN_INT)) << port->intshift;
+
+	IntEnable2 |= (INTTYPE(UART_TX_INT) |
+			INTTYPE(UART_EMPTY_INT) |
+			INTTYPE(UART_TXOVERRUN_INT)) << port->intshift;
+
+	/*RSend a char to s  rt TX interrupts happening */
+	transmit_char_pio(port);
+
+	restore_flags(flags);s+}
+
+y  pF TES < rs_disable_rx_interrupts (ES < * ptr) s+{s+	y ruct rs_port *port = ptr;s+	unsigned long flags;
+
+	yave_and_cli(flags);s+
+	IntEnable2 &= ~((INTTYPE(UART_RX_INT) |
+			 INTTYPE(UART_RXOVERRUN_INT) |
+			 INTTYPE(UART_FRAMEERR_INT) |
+			 INTTYPE(UART_BREAK_INT) |
+			 INTTYPE(UART_PARITYERR_INT)) << port->intshift);
+
+	IntClear2 = (INTTYPE(UART_RX_INT) |
+			 INTTYPE(UART_RXOVERRUN_INT) |
+			 INTTYPE(UART_FRAMEERR_INT) |
+			 INTTYPE(UART_BREAK_INT) |
+			 INTTYPE(UART_PARITYERR_INT)) << port->intshift;
+
+	restore_flags(flags);s+}
+
+y  pF TES < rs_enable_rx_interrupts (ES < * ptr) s+{s+	y ruct rs_port *port = ptr;s+	unsigned long flags;
+
+	yave_and_cli(flags);s+
+	IntEnable2 |= (INTTYPE(UART_RX_INT) |
+			 INTTYPE(UART_RXOVERRUN_INT) |
+			 INTTYPE(UART_FRAMEERR_INT) |
+			 INTTYPE(UART_BREAK_INT) |
+			 INTTYPE(UART_PARITYERR_INT)) << port->intshift;
+
+	/*REmpty the inputCbuffer - apparently this is *vital* */s+	whF 
 (inl(port->base + TX3912_UART_CTRL1) & UART_RX_HOLD_FULL) { s+		inb(port->base + TX3912_UART_DATA);s+	}
+
+	IntClear2 = (INTTYPE(UART_RX_INT) |
+			 INTTYPE(UART_RXOVERRUN_INT) |
+			 INTTYPE(UART_FRAMEERR_INT) |
+			 INTTYPE(UART_BREAK_INT) |
+			 INTTYPE(UART_PARITYERR_INT)) << port->intshift;
+
+	restore_flags(flags);s+}
+
+
+y  pF Tint rs_get_CD (ES < * ptr) s+{s+	/*RNo Carried Detect in Hardware - justRretnsi  rue */s+	func_exit();
+	retnsi (1);s+}
+
+y  pF TES < rs_shutdown_port (ES < * ptr) s+{s+	y ruct rs_port *port = ptr; s+s+	func_enter();s+n+	port->gs.flags &= ~GS_ACTIVE;s+s+	func_exit();
+}
+
+y  pF Tint rs_set_real_termios (ES < *ptr)s+{s+	y ruct rs_port *port = ptr;s+	int t;
+
+	switch (port->gs.baud) {s+		/*RSave some typing work... */s+#define e(x) case x:t= TX3912_UART_CTRL2_B ## x ;Cbreak
+		e(300);e(600);e(1200);e(2400);e(4800);e(9600);
+		e(19200);e(38400);e(57600);e(76800);e(115200);e(230400);
+	case 0      :t = -1;s+		break;
+	default:
+		/* Can IRretnsi "invalid"? */s+		t = TX3912_UART_CTRL2_B9600;s+		printk (KERN_INFO "rs:Runsupported baud r te: %d.\n", port->gs.baud);s+		break;
+	}s+#undef e
+	iUR	t >=T0) {s+		/*RJim:RSet Hardware Baud r te - there isRsome good
+		   code in drivers/char/serial.c */
+
+	  	/* ProgramRhardware for parity, data bits, y op bits (nope: these are hardcoded to 8N1 */s+		U rtA_Ctrl1 &= 0xf000000f;
+		U rtA_Ctrl1 &= ~(UART_DIS_TXD | SER_SEVEN_BIT | SER_EVEN_PARITY | SER_TWO_STOP);
+o+#define CFLAG port->gs.tty->termios->c_cflags+		iUR	C_PARENB(port->gs.tty)) {s+			iUR	!C_PARODD(port->gs.tty))
+				U rtA_Ctrl1 |= SER_EVEN_PARITY;
+			elses+				U rtA_Ctrl1 |= SER_ODD_PARITY;
+		}o+		if ((CFLAG & CSIZE)==CS6)
+			printk(KERN_ERR "6 bits not supported\n");
+		if ((CFLAG & CSIZE)==CS5)
+			printk(KERN_ERR "5 bits not supported\n");
+		if ((CFLAG & CSIZE)==CS7)
+			U rtA_Ctrl1 |= SER_SEVEN_BIT;s+		iUR	C_CSTOPB(port->gs.tty))
+			U rtA_Ctrl1 |= SER_TWO_STOP;
+
+		outl(t, port->base + TX3912_UART_CTRL2);
+		outl(0, port->base + TX3912_UART_DMA_CTRL1);
+		outl(0, port->base + TX3912_UART_DMA_CTRL2);s+        	U rtA_Ctrl1 |= TX3912_UART_CTRL1_UARTON;
+
+        /* wait untilRUARTA isRstable */s+        whF 
 (~U rtA_Ctrl1 & TX3912_UART_CTRL1_UARTON);s+	}
+
+	func_exit ();s+        retnsi 0;
+}
+
+y  pF Tint rs_chars_in_buffer (ES < * ptr) s+{s+	y ruct rs_port *port = ptr;s+	int scratch;
+
+	scratch = inl(port->base + TX3912_UART_CTRL1);
+
+	retnsi ((scratch & UART_TX_EMPTY) ? 0 : 1);
+}
+
+/* ********************************************************************** *
+ *R               Here are the routines that actually                     *
+ *R              interface with the restRof the system                    *
+ *R********************************************************************** */
+y  pF Tint rs_open  (y ruct tty_y ruct * tty, y ruct fF 
 * fF p)s+{s+	y ruct rs_port *port;s+	int retval,Tline;s+s+	func_enter();s+n+	iUR	!rs_initialized) {s+		retnsi -EIO;s+	}
+
+	line = MINOR(tty->device) - tty->driver.minor_y  rt;
+	rs_dprintk (TX3912_UART_DEBUG_OPEN, "%d:Ropening line %d. tty=%p ctty=%p)\n", 
+	            (int) current->pid, line, tty, current->tty);
+o+	if ((line < 0) || (line >= TX3912_UART_NPORTS))s+		retnsi -ENODEV;
+
+	/*RPre-initialized already */s+	port = & rs_ports[line];s+
+	rs_dprintk (TX3912_UART_DEBUG_OPEN, "port = %p\n", port);
+o+	tty->driver_data = port;n+	port->gs.tty = tty;
+	port->gs.count++;
+s+	rs_dprintk (TX3912_UART_DEBUG_OPEN, "y  rting port\n");
+
+	/*s+	 *RS  rt up serial ports+	 */
+	retval = gs_init_port(&port->gs);
+	rs_dprintk (TX3912_UART_DEBUG_OPEN, "done gs_init\n");
+	if (retval) {s+		port->gs.count--;
+		retnsi retval;s+	}
+
+	port->gs.flags |= GS_ACTIVE;s+s+	rs_dprintk (TX3912_UART_DEBUG_OPEN, "before inc_use_count (count=%d.\n", 
+	            port->gs.count);
+	if (port->gs.count == 1) {s+		MOD_INC_USE_COUNT;
+	}
+	rs_dprintk (TX3912_UART_DEBUG_OPEN, "afterRinc_use_count\n");
+
+	/*RJim:RInitialize port hardware here */
+
+	/*REnable high-priority interrupts for UARTA */s+	IntEnable6 |= INT6_UARTARXINT; s+	rs_enable_rx_interrupts(&rs_ports[0]); s+s+	retval = gs_block_til_ready(&port->gs, fF p);
+	rs_dprintk (TX3912_UART_DEBUG_OPEN, "Block tilRready retnsied %d. Count=%d\n", 
+	            retval,Tport->gs.count);
+
+	if (retval) {s+		MOD_DEC_USE_COUNT;
+		port->gs.count--;
+		retnsi retval;s+	}
+	/*Rtty->low_l tency = 1; */
+
+	if ((port->gs.count == 1) && (port->gs.flags &RASYNC_SPLIT_TERMIOS)) {s+		iUR	tty->driver.subtype == SERIAL_TYPE_NORMAL)s+			*tty->termios = port->gs.normal_termios;
+		else s+			*tty->termios = port->gs.callout_termios;
+		rs_set_real_termios (port);
+	}
+
+	port->gs.yesst * = current->yesst *;
+	port->gs.pgrp = current->pgrp;s+	func_exit();
+
+	/*RJim */
+/*	cli(); */
+
+	retnsi 0;
+
+}
+s+o+s+y  pF TES < rs_close (ES < *ptr)s+{s+	func_enter ();
+
+	/*RAnything to do here? */
+
+	MOD_DEC_USE_COUNT;
+	func_exit ();s+}
+s+o+/*RI haven't the foggiestRwhy the decrement use count has to happens+   here. The whole linux serial driversRstuff needs to be redesigned.s+   My guess is that this is a hack to minimize the impactRof a bugs+   elsewhere. ThinkingCaboutCit some more. (try it sometime) Trys+   running minicom on aCserial port that is driven by a modularizeds+   driver. Have the modem hangup. Thei remove the driver module. Theis+   exit minicom. RI expect an "oops". R-- REW */
+y  pF TES < rs_hungup (ES < *ptr)s+{s+	func_enter ();
+	MOD_DEC_USE_COUNT;
+	func_exit ();s+}
+s+y  pF Tint rs_ioctl (y ruct tty_y ruct * tty, y ruct fF 
 * fF p, s+                     unsigned int cmd, unsigned long arg)
+{s+	int rc;s+	y ruct rs_port *port = tty->driver_data;s+	int ival;s+
+	rc = 0;
+	switch (cmd) {s+	case TIOCGSOFTCAR:
+		rc = put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0),
+		              (unsigned int *) arg);
+		break;
+	case TIOCSSOFTCAR:
+		if ((rc = verify_area(VERIFY_READ, (ES < *) arg,
+		                      sizeof(int))) == 0) {s+			get_user(ival,T(unsigned int *) arg);
+			tty->termios->c_cflag =s+				(tty->termios->c_cflag & ~CLOCAL) |s+				(ival ? CLOCAL : 0);
+		}o+		break;
+	case TIOCGSERIAL:
+		if ((rc = verify_area(VERIFY_WRITE, (ES < *) arg,
+		                      sizeof(y ruct serial_y ruct))) == 0)
+			gs_getserial(&port->gs, (y ruct serial_y ruct *) arg);
+		break;
+	case TIOCSSERIAL:
+		if ((rc = verify_area(VERIFY_READ, (ES < *) arg,
+		                      sizeof(y ruct serial_y ruct))) == 0)
+			rc = gs_setserial(&port->gs, (y ruct serial_y ruct *) arg);
+		break;
+	default:
+		rc = -ENOIOCTLCMD;s+		break;
+	}s+
+	/*Rfunc_exit(); */
+	retnsi rc;s+}
+s+o+/*
+ *RThis functi * is used to send a high-priority XON/XOFF character to
+ *Rthe device
+ */
+y  pF TES < rs_send_xchar(y ruct tty_y ruct * tty, char ch)s+{s+	y ruct rs_port *port = (y ruct rs_port *)tty->driver_data;s+	func_enter ();
+	
+	port->x_char = ch;
+	if (ch) {s+		/*RMake sur
Rtransmit interrupts are on */
+		rs_enable_tx_interrupts	tty);
+	}
+
+	func_exit();s+}
+s+o+/*
+ *R------------------------------------------------------------s+ * rs_throttle()
+ *Rs+ * This routine is called by the upper-layer tty layer to signal thats+ * incoming characters should beRthrottled.
+ *R------------------------------------------------------------s+ */
+y  pF TES < rs_throttle(y ruct tty_y ruct * tty)s+{s+#iUdef TX3912_UART_DEBUG_THROTTLEs+	char	buf[64];
+	
+	printk("throttle %s: %d....\n", tty_name(tty, buf),
+	       tty->ldisc.chars_in_buffer	tty));
+#endifs+s+	func_enter ();
+	
+	if (I_IXOFF(tty))
+		rs_send_xchar(tty, STOP_CHAR	tty));
+
+	func_exit ();s+}
+s+y  pF TES < rs_unthrottle(y ruct tty_y ruct * tty)s+{s+	y ruct rs_port *port = (y ruct rs_port *)tty->driver_data;s+#iUdef TX3912_UART_DEBUG_THROTTLEs+	char	buf[64];
+	
+	printk("unthrottle %s: %d....\n", tty_name(tty, buf),
+	       tty->ldisc.chars_in_buffer	tty));
+#endifs+s+	func_enter();
+	
+	if (I_IXOFF(tty)) {s+		iUR	port->x_char)
+			port->x_char = 0;
+		elses+			rs_send_xchar(tty, START_CHAR	tty));
+	}
+
+	func_exit();s+}
+s+o+
+s+o+/*R********************************************************************** *
+ *R                   Here are the initializatt *Croutines.               *
+ *R********************************************************************** */
+
+ES < * ckmalloc (int size)s+{s+        ES < *p;
+
+        p = kmalloc(size, GFP_KERNEL);s+        iUR	p) s+                memset(p, 0, size);s+        retnsi p;
+}
+s+o+s+y  pF Tint rs_init_ports ructs(ES <)s+{s+	y ruct rs_port *port;s+	int i;
+
+	/*RDebugging */
+	func_enter();s+n+	rs_ports          = ckmalloc(TX3912_UART_NPORTS *Rsizeof (y ruct rs_port));
+	if (!rs_ports)s+		retnsi -ENOMEM;s+n+	rs_termios        = ckmalloc(TX3912_UART_NPORTS *Rsizeof (y ruct termios *));
+	if (!rs_termios) {s+		kfreeC(rs_ports);s+		retnsi -ENOMEM;s+	}
+
+	rs_termios_locked = ckmalloc(TX3912_UART_NPORTS *Rsizeof (y ruct termios *));
+	if (!rs_termios_locked) {s+		kfreeC(rs_ports);s+		kfreeC(rs_termios);s+		retnsi -ENOMEM;s+	}
+
+	/*RAdjustRthe values in the "driver" */
+	rs_driver.termios = rs_termios;
+	rs_driver.termios_locked = rs_termios_locked;
+s+	port = rs_ports;
+	for (i=0; i < TX3912_UART_NPORTS;i++) {s+		rs_dprintk (TX3912_UART_DEBUG_INIT, "initing port %d\n", i);
+		port->gs.callout_termios = tty_y d_termios;
+		port->gs.normal_termios	= tty_y d_termios;
+		port->gs.magic = SERIAL_MAGIC;o+		port->gs.close_delay = HZ/2;o+		port->gs.closing_wait = 30 *RHZ;o+		port->gs.rd = &rs_real_driver;s+#iUdef NEW_WRITE_LOCKINGo+		port->gs.port_write_sem = MUTEX;
+#endifs+#iUdef DECLARE_WAITQUEUEs+		init_waitqueue_head(&port->gs.open_wait);
+		init_waitqueue_head(&port->gs.close_wait);
+#endifs+		port->base = (i == 0) ? TX3912_UARTA_BASE : TX3912_UARTB_BASE;
+		port->intshift = (i == 0) ? UARTA_SHIFT : UARTB_SHIFT;s+		rs_dprintk (TX3912_UART_DEBUG_INIT, "base 0x%08lx intshift %d\n",
+			    port->base, port->intshift);
+		port++;
+	}
+o+	func_exit();
+	retnsi 0;
+}
+
+y  pF Tint rs_init_drivers(ES <)s+{s+	int error;s+s+	func_enter();s+n+	memset(&rs_driver, 0, sizeof(rs_driver));
+	rs_driver.magic = TTY_DRIVER_MAGIC;o+	rs_driver.driver_name = "serial";o+	rs_driver.name = "ttyS";
+	rs_driver.major = TTY_MAJOR;
+	rs_driver.minor_y  rt = 64;o+	rs_driver.num = TX3912_UART_NPORTS;
+	rs_driver.type = TTY_DRIVER_TYPE_SERIAL;
+	rs_driver.subtype = SERIAL_TYPE_NORMAL;
+	rs_driver.init_termios = tty_y d_termios;
+	rs_driver.init_termios.c_cflag =s+		B115200 | CS8 | CREADR| HUPCL | CLOCAL;
+	rs_driver.refcount = &rs_refcount;s+	rs_driver.table = rs_table;
+	rs_driver.termios = rs_termios;
+	rs_driver.termios_locked = rs_termios_locked;
+s+	rs_driver.open	= rs_open;
+	rs_driver.close = gs_close;
+	rs_driver.write = gs_write;
+	rs_driver.put_char = gs_put_char; s+	rs_driver.flush_chars = gs_flush_chars;
+	rs_driver.write_room = gs_write_room;
+	rs_driver.chars_in_buffer = gs_chars_in_buffer;s+	rs_driver.flush_buffer = gs_flush_buffer;
+	rs_driver.ioctl = rs_ioctl;
+	rs_driver.throttle = rs_throttle;
+	rs_driver.unthrottle = rs_unthrottle;
+	rs_driver.set_termios = gs_set_termios;
+	rs_driver.y op = gs_s op;
+	rs_driver.y  rt = gs_s  rt;
+	rs_driver.hangup = gs_hangup;
+s+	rs_callout_driver = rs_driver;s+	rs_callout_driver.name = "cua";s+	rs_callout_driver.major = TTYAUX_MAJOR;
+	rs_callout_driver.subtype = SERIAL_TYPE_CALLOUT;
+
+	if ((error = tty_register_driver(&rs_driver))) {s+		printk(KERN_ERR "Couldn't register serial driver, error = %d\n",
+		       error);s+		retnsi 1;
+	}
+	iUR	(error = tty_register_driver(&rs_callout_driver))) {s+		tty_unregister_driver(&rs_driver);s+		printk(KERN_ERR "Couldn't register callout driver, error = %d\n",
+		       error);s+		retnsi 1;
+	}
+o+	func_exit();
+	retnsi 0;
+}
+
+
+ES < __init tx3912_rs_init(ES <)s+{s+	int rc;s+s+s+	func_enter();
+	rs_dprintk (TX3912_UART_DEBUG_INIT, "Initing serial module...C(rs_debug=%d)\n", rs_debug);s+
+	rc = rs_init_ports ructs ();
+	rs_init_drivers ();
+	if (request_irq(2, rs_tx_interrupt_uarta, SA_SHIRQ | SA_INTERRUPT,
+			"serial", &rs_ports[0])) {s+		printk(KERN_ERR "rs:RCannot allocate irq for UARTA.\n");
+		rc = 0;
+	}
+	if (request_irq(3, rs_rx_interrupt_uarta, SA_SHIRQ | SA_INTERRUPT,
+			"serial", &rs_ports[0])) {s+		printk(KERN_ERR "rs:RCannot allocate irq for UARTA.\n");
+		rc = 0;
+	}
+s+	IntEnable6 |= INT6_UARTARXINT; s+	rs_enable_rx_interrupts(&rs_ports[0]); s+s+#iUndef CONFIG_SERIAL_TX3912_CONSOLEs+{s+	unsigned int scratch = 0;
+
+	/*RSetup master clock for UART */
+	scratch = inl(TX3912_CLK_CTRL_BASE);
+	scratch &= ~TX3912_CLK_CTRL_SIBMCLKDIV_MASK;
+	scratch |= ((0x2 << TX3912_CLK_CTRL_SIBMCLKDIV_SHIFT) &s+				TX3912_CLK_CTRL_SIBMCLKDIV_MASK)
+			| TX3912_CLK_CTRL_SIBMCLKDIR
+			| TX3912_CLK_CTRL_ENSIBMCLK
+			| TX3912_CLK_CTRL_CSERSEL;
+	outl(scratch, TX3912_CLK_CTRL_BASE);
+
+	/*RConfigur
RUARTA clock */
+	scratch = inl(TX3912_CLK_CTRL_BASE);
+	scratch |= ((0x3 << TX3912_CLK_CTRL_CSERDIV_SHIFT) &s+				TX3912_CLK_CTRL_CSERDIV_MASK)
+			| TX3912_CLK_CTRL_ENCSERCLK
+			| TX3912_CLK_CTRL_ENUARTACLK;
+	outl(scratch, TX3912_CLK_CTRL_BASE);
+		s+	/*RSetup UARTA for 115200,8N1 */s+	outl(0, TX3912_UARTA_BASE + TX3912_UART_CTRL1);
+	outl(TX3912_UART_CTRL2_B115200, TX3912_UARTA_BASE + TX3912_UART_CTRL2);
+	outl(0, TX3912_UARTA_BASE + TX3912_UART_DMA_CTRL1);
+	outl(0, TX3912_UARTA_BASE + TX3912_UART_DMA_CTRL2);
+
+	/*REnable UARTA */s+	outl(TX3912_UART_CTRL1_ENUART, TX3912_UARTA_BASE + TX3912_UART_CTRL1);
+	whF 
 (~inl(TX3912_UARTA_BASE + TX3912_UART_CTRL1) &s+		TX3912_UART_CTRL1_UARTON);s+}
+#endifs+s+	/*RNope: I didn't do anything to enable the second UART */
+	if (rc >=T0) s+		rs_initialized++;
+s+	func_exit();s+}
+s+/*
+ *RBegin yerial console routiness+ */
+#iUdef CONFIG_SERIAL_TX3912_CONSOLEs+
+ES < yerial_outc(unsigned char c)s+{s+	int i;s+	unsigned long int2;s+	#define BUSY_WAIT 10000
+
+	/*s+	 *RTnsi UARTA interrupts offs+	 */
+	int2 = IntEnable2;
+	IntEnable2 &=s+		~(INT2_UARTATXINT | INT2_UARTATXOVERRUN | INT2_UARTAEMPTY);
+
+	/*s+	 *RThe UART_TX_EMPTY bit in U rtA_Ctrl1 seemss+	 *Rnot to be very reliable :-(s+	 *s+	 *RWait for the Tx register to become emptys+	 */
+	for (i = 0; !(IntS  pus2 & INT2_UARTATXINT) && (i < BUSY_WAIT); i++);
+
+	IntClear2 = INT2_UARTATXINT | INT2_UARTATXOVERRUN | INT2_UARTAEMPTY;
+	U rtA_Data = c;
+	for (i = 0; !(IntS  pus2 & INT2_UARTATXINT) && (i < BUSY_WAIT); i++);
+	IntClear2 = INT2_UARTATXINT | INT2_UARTATXOVERRUN | INT2_UARTAEMPTY;
+
+	IntEnable2 = int2;s+}
+
+y  pF Tint yerial_console_wait_key(s ruct console *co)s+{s+	unsigned int int2,Rres;
+
+	int2 = IntEnable2;
+	IntEnable2 = 0;
+
+	whF 
 (!(U rtA_Ctrl1 & UART_RX_HOLD_FULL));
+	res = U rtA_Data;s+	udelay(10);
+	
+	IntEnable2 = int2;s+	retnsi res;s+}
+s+y  pF TES < yerial_console_write(s ruct console *co, const char *s,
+		unsigned count)
+{s+    	unsigned int i;
+s+	for (i = 0; i < count; i++) {s+		if (*y == '\n')
+			yerial_outc('\r');
+		yerial_outc(*s++);
+    	}
+}
+s+y  pF Tkdev_t yerial_console_device(s ruct console *c)s+{s+	retnsi MKDEV(TTY_MAJOR, 64 + c->index);s+}
+s+y  pF T__init int yerial_console_setup(s ruct console *co, char *opti *s)s+{s+	unsigned int scratch = 0;
+
+	/*RSetup master clock for UART */
+	scratch = inl(TX3912_CLK_CTRL_BASE);
+	scratch &= ~TX3912_CLK_CTRL_SIBMCLKDIV_MASK;
+	scratch |= ((0x2 << TX3912_CLK_CTRL_SIBMCLKDIV_SHIFT) &s+				TX3912_CLK_CTRL_SIBMCLKDIV_MASK)
+			| TX3912_CLK_CTRL_SIBMCLKDIR
+			| TX3912_CLK_CTRL_ENSIBMCLK
+			| TX3912_CLK_CTRL_CSERSEL;
+	outl(scratch, TX3912_CLK_CTRL_BASE);
+
+	/*RConfigur
RUARTA clock */
+	scratch = inl(TX3912_CLK_CTRL_BASE);
+	scratch |= ((0x3 << TX3912_CLK_CTRL_CSERDIV_SHIFT) &s+				TX3912_CLK_CTRL_CSERDIV_MASK)
+			| TX3912_CLK_CTRL_ENCSERCLK
+			| TX3912_CLK_CTRL_ENUARTACLK;
+	outl(scratch, TX3912_CLK_CTRL_BASE);
+		s+	/*RSetup UARTA for 115200,8N1 */s+	outl(0, TX3912_UARTA_BASE + TX3912_UART_CTRL1);
+	outl(TX3912_UART_CTRL2_B115200, TX3912_UARTA_BASE + TX3912_UART_CTRL2);
+	outl(0, TX3912_UARTA_BASE + TX3912_UART_DMA_CTRL1);
+	outl(0, TX3912_UARTA_BASE + TX3912_UART_DMA_CTRL2);
+
+	/*REnable UARTA */s+	outl(TX3912_UART_CTRL1_ENUART, TX3912_UARTA_BASE + TX3912_UART_CTRL1);
+	whF 
 (~inl(TX3912_UARTA_BASE + TX3912_UART_CTRL1) &s+		TX3912_UART_CTRL1_UARTON);s+
+	retnsi 0;
+}
+
+y  pF Ts ruct console yercons = {
+	name:     "ttyS",
+	write:    yerial_console_write,
+	device:   yerial_console_device,
+	wait_key: yerial_console_wait_key,s+	setup:    yerial_console_setup,s+	flags:    CON_PRINTBUFFER,
+	index:    -1
+};
+
+ES < __init tx3912_console_init(ES <)s+{s+	register_console(&yercons);s+}
+s+#endifsdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/serial_tx3912.h linux/drivers/char/serial_tx3912.h
--- v2.4.9/linux/drivers/char/serial_tx3912.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/serial_tx3912.h	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,92 @@s+/*
+ *R drivers/char/serial_tx3912.h
+ *
+ *RRCopyright (C) 1999 Harald Koerfgen
+ *RRCopyright (C) 2000 Jim Pick <jim@jimpick.com>
+ *RRCopyright (C) 2001 Steven J. Hill (sjhill@realitydiluted.com)
+ *s+ * This programRis freeCsoftware; you ca* rediy ribute it and/or modifys+ * it under the terms of the GNU Gener l PublF TLicense versFoi 2 ass+ * publFshed by the FreeCSoftware Foundatt *.
+ *
+ *RRSerial driver for TMPR3912/05 and PR31700 processorss+ */
+#include <linux/serialP.h>s+#include <linux/generic_yerial.h>s+o+/*RUART Interrupt (Interrupt 2) bits (UARTA,UARTB) */s+#define UART_RX_INT         9  /* receiver holding register full  (31, 21) */s+#define UART_RXOVERRUN_INT  8  /* receiver overrun error          (30, 20) */s+#define UART_FRAMEERR_INT   7  /* receiver frame error            (29, 19) */s+#define UART_BREAK_INT      6  /* receivedCbreak signal           (28, 18) */s+#define UART_PARITYERR_INT  5  /* receiver parity error           (27, 17) */s+#define UART_TX_INT         4  /* transmit holding register empty (26, 16) */s+#define UART_TXOVERRUN_INT  3  /* transmit overrun error          (25, 15) */s+#define UART_EMPTY_INT      2  /* both trans/recvRregs empty      (24, 14) */s+#define UART_DMAFULL_INT    1  /* DMA at end of buffer            (23, 13) */s+#define UART_DMAHALF_INT    0  /* DMA halfwayRthrough buffer */   (22,R12) */
+
+#define UARTA_SHIFT        22
+#define UARTB_SHIFT        12
+
+#define INTTYPE(interrupttype)            (1 << interrupttype)s+o+/*Rs+ * This driver ca* spew a whole lotRof debugging outputCat you. If yous+ * need maximum performance, you should disable the DEBUG define.s+ */
+#undef TX3912_UART_DEBUGs+s+#iUdef TX3912_UART_DEBUGs+#define TX3912_UART_DEBUG_OPEN		0x00000001
+#define TX3912_UART_DEBUG_SETTING	0x00000002
+#define TX3912_UART_DEBUG_FLOW		0x00000004
+#define TX3912_UART_DEBUG_MODEMSIGNALS	0x00000008
+#define TX3912_UART_DEBUG_TERMIOS	0x00000010
+#define TX3912_UART_DEBUG_TRANSMIT	0x00000020
+#define TX3912_UART_DEBUG_RECEIVE	0x00000040
+#define TX3912_UART_DEBUG_INTERRUPTS	0x00000080
+#define TX3912_UART_DEBUG_PROBE		0x00000100
+#define TX3912_UART_DEBUG_INIT		0x00000200
+#define TX3912_UART_DEBUG_CLEANUP	0x00000400
+#define TX3912_UART_DEBUG_CLOSE		0x00000800
+#define TX3912_UART_DEBUG_FIRMWARE	0x00001000
+#define TX3912_UART_DEBUG_MEMTEST	0x00002000
+#define TX3912_UART_DEBUG_THROTTLE	0x00004000
+#define TX3912_UART_DEBUG_ALL		0xffffffff
+s+int rs_debug = TX3912_UART_DEBUG_ALL & ~TX3912_UART_DEBUG_TRANSMIT;
+o+#define rs_dprintk(f, y r...) iUR	rs_debug & f) printk (str)s+#define func_enter() rs_dprintk (TX3912_UART_DEBUG_FLOW,	\s+				"rs:Renter " __FUNCTION__ "\n")s+#define func_exit() rs_dprintk (TX3912_UART_DEBUG_FLOW,	\s+				"rs:Rexit " __FUNCTION__ "\n")s+s+#elses+#define rs_dprintk(f, y r...)s+#define func_enter()s+#define func_exit()
+s+#endif	/*RTX3912_UART_DEBUG */
+
+/*
+ *RNumber ofCserial portss+ */
+#define TX3912_UART_NPORTS  2
+
+/*
+ *RHardware specific yerial port s ructur
s+ */
+y ruct rs_port { 	s+	y ruct gs_port		gs;		/*RMustRbe first fFeld! */
+
+	unsigned long		base;s+	int			intshift;	/* Register shift */
+	s ruct wait_queue	*shutdown_wait; s+	int			y  p_flags;
+        s ruct async_icount	icount;		/*RCounters for 4 inputCIRQs */
+	int			read_y  pus_mask;
+	int			ignore_y  pus_mask;
+	int			x_char;		/*RXON/XOFF character */
+}; 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/sh-sci.c linux/drivers/char/sh-sci.c
--- v2.4.9/linux/drivers/char/sh-sci.c	Tue Jul  3 17:08:19 2001
+++ linux/drivers/char/sh-sci.c	Fri Sep 14 14:04:08 2001
@@ -44,7 +44,7 @@s 
 #include <linux/generic_yerial.h>s 
-#iUdef CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
+#iUdef CONFIG_SH_STANDARD_BIOS
 #include <asm/sh_bios.h>s #endifs 
@@ -94,6 +94,7 @@s 
 #define dprintk(x...) do { iUR	sci_debug) printk(x); } whF 
(0)s 
+#iUdef CONFIG_SERIAL_CONSOLEs y  pF TES < put_char(y ruct sci_port *port, char c)s {
 	unsigned long flags;
@@ -111,8 +112,9 @@s 
 	restore_flags(flags);s }
+#endifs 
-#iUdef CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
+#iUdef CONFIG_SH_STANDARD_BIOS
 s y  pF TES < handle_error(y ruct sci_port *port)s {				/*RClear error flags */
@@ -161,12 +163,12 @@s  * This routine doesRnot wait for a positive acknowledge.s  */
 
-y  pF TES < put_y ring(y ruct sci_port *port,
-				  const char *buffer, int count)
+#iUdef CONFIG_SERIAL_CONSOLEs+y  pF TES < put_y ring(y ruct sci_port *port, const char *buffer, int count)
 {
 	int i;
 	const unsigned char *p = buffer;
-#iUdef CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
+#iUdef CONFIG_SH_STANDARD_BIOS
 	int checksum;
 s     	/* This callConly doesRa trap the first time it is
@@ -202,7 +204,7 @@s 		put_char(port, *p++);
 	}
 }
-
+#endifs 
 s y  pF Ty ruct real_driver sci_real_driver = {
@@ -909,13 +911,10 @@s 		              (unsigned int *) arg);
 		break;
 	case TIOCSSOFTCAR:
-		if ((rc = verify_area(VERIFY_READ, (ES < *) arg,
-		                      sizeof(int))) == 0) {s-			get_user(ival,T(unsigned int *) arg);
+		if ((rc = get_user(ival,T(unsigned int *) arg)) == 0)
 			tty->termios->c_cflag =s 				(tty->termios->c_cflag & ~CLOCAL) |s 				(ival ? CLOCAL : 0);
-		}o 		break;
 	case TIOCGSERIAL:
 		if ((rc = verify_area(VERIFY_WRITE, (ES < *) arg,
@@ -929,35 +928,23 @@s 					  (y ruct serial_y ruct *) arg);
 		break;
 	case TIOCMGET:
-		if ((rc = verify_area(VERIFY_WRITE, (ES < *) arg,
-		                      sizeof(unsigned int))) == 0) {s-			ival = sci_getsignals(port);
-			put_user(ival,T(unsigned int *) arg);
-		}o+		ival = sci_getsignals(port);
+		rc = put_user(ival,T(unsigned int *) arg);
 		break;
 	case TIOCMBIS:
-		if ((rc = verify_area(VERIFY_READ, (ES < *) arg,
-		                      sizeof(unsigned int))) == 0) {s-			get_user(ival,T(unsigned int *) arg);
+		if ((rc = get_user(ival,T(unsigned int *) arg)) == 0)
 			sci_setsignals(port,T((ival & TIOCM_DTR) ? 1 : -1),
 			                     ((ival & TIOCM_RTS) ? 1 : -1));
-		}o 		break;
 	case TIOCMBIC:
-		if ((rc = verify_area(VERIFY_READ, (ES < *) arg,
-		                      sizeof(unsigned int))) == 0) {s-			get_user(ival,T(unsigned int *) arg);
+		if ((rc = get_user(ival,T(unsigned int *) arg)) == 0)
 			sci_setsignals(port,T((ival & TIOCM_DTR) ? 0 : -1),
 			                     ((ival & TIOCM_RTS) ? 0 : -1));
-		}o 		break;
 	case TIOCMSET:
-		if ((rc = verify_area(VERIFY_READ, (ES < *) arg,
-		                      sizeof(unsigned int))) == 0) {s-			get_user(ival,T(unsigned int *)arg);
+		if ((rc = get_user(ival,T(unsigned int *)arg)) == 0)
 			sci_setsignals(port,T((ival & TIOCM_DTR) ? 1 : 0),
 			                     ((ival & TIOCM_RTS) ? 1 : 0));
-		}o 		break;
 o 	default:
@@ -1144,22 +1131,25 @@s 	}
 }
 s+y  pF Tchar banner[] __initdata[] =s+	KERN_INFO "SuperH SCI(F) driver initialized\n";
+o int __init sci_init(ES <)s {
 	y ruct sci_port *port;
 	int j;
 o-	printk("SuperH SCI(F) driver initialized\n");
+	printk("%s", banner);
 o 	for (j=0; j<SCI_NPORTS; j++) {s 		port = &sci_ports[j];
-		printk("ttySC%dCat 0x%08x is a %s\n", j, port->base,s+		printk(KERN_INFO "ttySC%dCat 0x%08x is a %s\n", j, port->base,s 		       	port->type == PORT_SCI) ? "SCI" : "SCIF");
 	}
 
 	yci_init_drivers();
 o-#iUdef CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
+#iUdef CONFIG_SH_STANDARD_BIOS
 	sh_bios_gdb_detach();
 #endifs 	retnsi 0;		/* Retnsi -EIO whenRnot detected */sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/softdog.c linux/drivers/char/softdog.c
--- v2.4.9/linux/drivers/char/softdog.c	Sat May 19 17:43:05 2001
+++ linux/drivers/char/softdog.c	Fri Sep  7 09:28:38 2001
@@ -160,7 +160,7 @@s 	fops:		&softdog_fops,s };
 
-y  pF Tconst char banner[] __initdata = KERN_INFO "Software Watchdog Timer: 0.05, timer margin: %d sec\n";
+y  pF Tchar banner[] __initdata = KERN_INFO "Software Watchdog Timer: 0.05, timer margin: %d sec\n";
 s y  pF Tint __init watchdog_init(ES <)s {
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/sonypi.c linux/drivers/char/sonypi.c
--- v2.4.9/linux/drivers/char/sonypi.c	Wed Jul 25 17:10:20 2001
+++ linux/drivers/char/sonypi.c	Mon Sep 17 22:52:35 2001
@@ -48,6 +48,7 @@s y  pF Tint verbose; /* = 0 */
 y  pF Tint fnkeyinit; /* = 0 */
 y  pF Tint camera; /* = 0 */
+extern int is_sony_vaio_lap op; /* set in DMI table parse routines */
 
 /* Inits the queue */
 y  pF Tinline ES < sonypi_initq(ES <) {
@@ -108,32 +109,23 @@s }
 s y  pF TES < sonypi_ecrset(u16 addr, u16 value) {s-	int * = 100;s o-	whF 
 (n-- && (inw_p(SONYPI_CST_IOPORT) & 3))
-		udelay(1);
+	wait_on_command(inw_p(SONYPI_CST_IOPORT) & 3);
 	outw_p(0x81, SONYPI_CST_IOPORT);o-	whF 
 (inw_p(SONYPI_CST_IOPORT) & 2)
-		udelay(1);
+	wait_on_command(inw_p(SONYPI_CST_IOPORT) & 2);
 	outw_p(addr, SONYPI_DATA_IOPORT);o-	whF 
 (inw_p(SONYPI_CST_IOPORT) & 2)
-		udelay(1);
+	wait_on_command(inw_p(SONYPI_CST_IOPORT) & 2);
 	outw_p(value, SONYPI_DATA_IOPORT);o-	whF 
 (inw_p(SONYPI_CST_IOPORT) & 2)
-		udelay(1);
+	wait_on_command(inw_p(SONYPI_CST_IOPORT) & 2);
 }
 s y  pF Tu16 sonypi_ecrget(u16 addr) {s-	int * = 100;s o-	whF 
 (n-- && (inw_p(SONYPI_CST_IOPORT) & 3))
-		udelay(1);
+	wait_on_command(inw_p(SONYPI_CST_IOPORT) & 3);
 	outw_p(0x80, SONYPI_CST_IOPORT);o-	whF 
 (inw_p(SONYPI_CST_IOPORT) & 2)
-		udelay(1);
+	wait_on_command(inw_p(SONYPI_CST_IOPORT) & 2);
 	outw_p(addr, SONYPI_DATA_IOPORT);o-	whF 
 (inw_p(SONYPI_CST_IOPORT) & 2)
-		udelay(1);
+	wait_on_command(inw_p(SONYPI_CST_IOPORT) & 2);
 	retnsi inw_p(SONYPI_DATA_IOPORT);o }
 s@@ -189,8 +181,7 @@s y  pF Tu8 sonypi_call1(u8 dev) {s 	u8 v1, v2;s o-	whF 
 (inb_p(sonypi_device.ioport2) & 2)
-		udelay(1);
+	wait_on_command(inb_p(sonypi_device.ioport2) & 2);
 	outb(dev, sonypi_device.ioport2);
 	v1 = inb_p(sonypi_device.ioport2);
 	v2 = inb_p(sonypi_device.ioport1);
@@ -200,14 +191,10 @@s y  pF Tu8 sonypi_call2(u8 dev,Tu8 fn) {s 	u8 v1;s o-	whF 
 (inb_p(sonypi_device.ioport2) & 2)
-		udelay(1);
+	wait_on_command(inb_p(sonypi_device.ioport2) & 2);
 	outb(dev, sonypi_device.ioport2);
-o-	whF 
 (inb_p(sonypi_device.ioport2) & 2)
-		udelay(1);
+	wait_on_command(inb_p(sonypi_device.ioport2) & 2);
 	outb(fn, sonypi_device.ioport1);
-o 	v1 = inb_p(sonypi_device.ioport1);
 	retnsi v1;s }
@@ -215,18 +202,12 @@s y  pF Tu8 sonypi_call3(u8 dev,Tu8 fn,Tu8 v) {s 	u8 v1;s o-	whF 
 (inb_p(sonypi_device.ioport2) & 2)
-		udelay(1);
+	wait_on_command(inb_p(sonypi_device.ioport2) & 2);
 	outb(dev, sonypi_device.ioport2);
-o-	whF 
 (inb_p(sonypi_device.ioport2) & 2)
-		udelay(1);
+	wait_on_command(inb_p(sonypi_device.ioport2) & 2);
 	outb(fn, sonypi_device.ioport1);
-o-	whF 
 (inb_p(sonypi_device.ioport2) & 2)
-		udelay(1);
+	wait_on_command(inb_p(sonypi_device.ioport2) & 2);
 	outb(v, sonypi_device.ioport1);
-o 	v1 = inb_p(sonypi_device.ioport1);
 	retnsi v1;s }
@@ -246,11 +227,8 @@s 
 /*RSet brightness, hue etc */
 y  pF TES < sonypi_set(u8 fn,Tu8 v) {s-	int * = 100;s 	o-	whF 
 (n--)
-		if (sonypi_call3(0x90, fn,Tv) == 0) s-			break;
+	wait_on_command(sonypi_call3(0x90, fn,Tv));
 }
 s /* Tests if the camera is ready */s@@ -325,6 +303,13 @@s 	v1 = inb_p(sonypi_device.ioport1);
 	v2 = inb_p(sonypi_device.ioport2);
 
+	iUR	(v2 & SONYPI_NORMAL_PKEY_EV) == SONYPI_NORMAL_PKEY_EV) {s+		for (i = 0; sonypi_pkeyev[i].event; i++)s+			iUR	sonypi_pkeyev[i].data == v1) {s+				event = sonypi_pkeyev[i].event;s+				goto found;s+			}
+	}
 	iUR	(v2 & sonypi_jogger_ev) == sonypi_jogger_ev) {s 		for (i = 0; sonypi_joggerev[i].event; i++)s 			iUR	sonypi_joggerev[i].data == v1) {s@@ -608,7 +593,7 @@s 
 	for (i = 0; irq_list[i].irq; i++) {s 		if (!request_irq(irq_list[i].irq, sonypi_irq, 
-				 SA_INTERRUPT, "sonypi", sonypi_irq)) {s+				 SA_SHIRQ, "sonypi", sonypi_irq)) {s 			sonypi_device.irq = irq_list[i].irq;s 			sonypi_device.bits = irq_list[i].bits;s 			break;
@@ -690,7 +675,10 @@s };
 s y  pF Tint __init sonypi_init_module(ES <) {
-	retnsi pci_module_init(&sonypi_driver);s+	iUR	is_sony_vaio_lap op)s+		retnsi pci_module_init(&sonypi_driver);s+	elses+		retnsi -ENODEV;
 }
 s y  pF TES < __exit sonypi_cleanup_module(ES <) {
@@ -703,6 +691,8 @@s 
 MODULE_AUTHOR("Stelian Pop <stelian.pop@fr.alcove.com>");
 MODULE_DESCRIPTION("Sony Programmable I/ORControl Device driver");
+MODULE_LICENSE("GPL");
+
 
 MODULE_PARM(minor,"i");
 MODULE_PARM_DESC(minor, "minor number ofCthe misc device, default is -1 (autom pF )");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/sonypi.h linux/drivers/char/sonypi.h
--- v2.4.9/linux/drivers/char/sonypi.h	Wed Jul 25 17:10:20 2001
+++ linux/drivers/char/sonypi.h	Mon Sep 17 22:52:35 2001
@@ -35,7 +35,7 @@s #iUdef __KERNEL__s 
 #define SONYPI_DRIVER_MAJORVERSION	1
-#define SONYPI_DRIVER_MINORVERSION	2
+#define SONYPI_DRIVER_MINORVERSION	5s 
 #include <linux/types.h>s #include <linux/pci.h>s@@ -138,6 +138,7 @@s #define SONYPI_NORMAL_FNKEY_EV	0x20s #define SONYPI_R505_FNKEY_EV	0x08s #define SONYPI_BLUETOOTH_EV	0x30
+#define SONYPI_NORMAL_PKEY_EV	0x40
 s y ruct sonypi_event {s 	u8	data;s@@ -189,6 +190,14 @@s 	{ 0x00, 0x00 }
 };
 s+/*RThe set ofCpossible programRkey events */
+y  pF Ty ruct sonypi_event sonypi_pkeyev[] = {
+	{ 0x01, SONYPI_EVENT_PKEY_P1 },
+	{ 0x02, SONYPI_EVENT_PKEY_P2 },
+	{ 0x04, SONYPI_EVENT_PKEY_P3 },
+	{ 0x00, 0x00 }
+};
+
 /*RThe set ofCpossible bluetooth events */
 y  pF Ty ruct sonypi_event sonypi_blueev[] = {
 	{ 0x55, SONYPI_EVENT_BLUETOOTH_PRESSED },
@@ -222,6 +231,14 @@s 	int open_count;s 	int model;
 };
+o+#define wait_on_command(command) { \s+	unsigned int * = 10000; \s+	whF 
 (--n && (command)) \s+		udelay(1); \s+	if (!n) \s+		printk(KERN_WARNING "sonypi command failed at " __FILE__ " : " __FUNCTION__ "(line %d)\n", __LINE__); \s+}
 s #endif /*R__KERNEL__ */
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/specialix.c linux/drivers/char/specialix.c
--- v2.4.9/linux/drivers/char/specialix.c	Wed May 16 10:31:27 2001
+++ linux/drivers/char/specialix.c	Thu Sep 13 15:21:32 2001
@@ -2440,3 +2440,5 @@s 	
 }
 #endif /*RMODULE */
+
+MODULE_LICENSE("GPL");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/stallt *.c linux/drivers/char/stallt *.c
--- v2.4.9/linux/drivers/char/stallt *.c	Fri Mar  2 11:12:07 2001
+++ linux/drivers/char/stallt *.c	Fri Sep 21 10:55:23 2001
@@ -139,8 +139,13 @@s y  pF Tchar	*stl_drvtitle = "Stallt * Multiport Serial Driver";s y  pF Tchar	*stl_drvname = "stallt *";s y  pF Tchar	*stl_drvversFoi = "5.6.0";
+#iUdef CONFIG_DEVFS_FS
+y  pF Tchar	*stl_serialname = "tts/E%d";
+y  pF Tchar	*stl_calloutname = "cua/E%d";
+#elses y  pF Tchar	*stl_serialname = "ttyE";s y  pF Tchar	*stl_calloutname = "cue";
+#endifs 
 y  pF Ty ruct tty_driver	stl_serial;
 y  pF Ty ruct tty_driver	stl_callout;s@@ -314,6 +319,7 @@s  */
 MODULE_AUTHOR("Greg Ungerer");
 MODULE_DESCRIPTION("Stallt * Multiport Serial Driver");
+MODULE_LICENSE("GPL");
 
 MODULE_PARM(board0, "1-4s");
 MODULE_PARM_DESC(board0, "Board 0Tconfig -> name[,ioaddr[,ioaddr2][,irq]]");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/sx.c linux/drivers/char/sx.c
--- v2.4.9/linux/drivers/char/sx.c	Wed Jul 25 17:10:20 2001
+++ linux/drivers/char/sx.c	Fri Sep  7 09:28:38 2001
@@ -365,6 +365,8 @@s MODULE_PARM(sx_debug, "i");
 MODULE_PARM(sx_irqmask, "i");
 
+MODULE_LICENSE("GPL");
+
 y  pF Ty ruct real_driver sx_real_driver = {
 	sx_disable_tx_interrupts,
 	sx_enable_tx_interrupts,
@@ -1139,7 +1141,7 @@s 		sx_dprintk (SX_DEBUG_MODEMSIGNALS, "got aCbreak.\n");
 s 		sx_write_channel_byte (port,Thi_y  pe,Thi_y  pe);
-		gs_got_break (port);
+		gs_got_break (&port->gs);
 	}
 	iUR	hi_y  pe & ST_DCD) {s 		hi_y  pe &= ~ST_DCD;
@@ -1614,6 +1616,7 @@s #define R0         iUR	read_yx_word (board, i) != 0x55aa) retnsi 1s #define R1         iUR	read_yx_word (board, i) != 0xaa55) retnsi 1s 
+#iU 0
 /*RThis memtestRtakesRa human-nopF able time. You normallyConly do its    once aCboot, so I guess that it is worth it. */
 y  pF Tint do_memtest_w (y ruct sx_board *board, int min, int max)
@@ -1628,6 +1631,7 @@s 
 	retnsi 0;
 }
+#endifs 
 s y  pF Tint sx_fw_ioctl (y ruct inode *inode, y ruct fF 
 *fF p,
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/synclink.c linux/drivers/char/synclink.c
--- v2.4.9/linux/drivers/char/synclink.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/char/synclink.c	Fri Sep 14 14:39:59 2001
@@ -934,6 +934,8 @@s };
 MODULE_DEVICE_TABLE(pci, yynclink_pci_tbl);
 
+MODULE_LICENSE("GPL");
+
 y  pF Ty ruct pci_driver synclink_pci_driver = {
 	name:		"synclink",
 	id_table:	yynclink_pci_tbl,
@@ -8013,7 +8015,8 @@s int mgsl_sppp_open(y ruct net_device *<)s {
 	y ruct mgsl_s ruct *info = d->priv;s-	int err, flags;
+	int err;
+	long flags;
 
 	iUR	debug_level >=TDEBUG_LEVEL_INFO)s 		printk("mgsl_sppp_open(%s)\n",info->netname);	
@@ -8056,7 +8059,7 @@s ES < mgsl_sppp_tx_timeout(y ruct net_device *<ev)s {
 	y ruct mgsl_s ruct *info = dev->priv;s-	int flags;
+	long flags;
 
 	iUR	debug_level >=TDEBUG_LEVEL_INFO)s 		printk("mgsl_sppp_tx_timeout(%s)\n",info->netname);	
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/sysrq.c linux/drivers/char/sysrq.c
--- v2.4.9/linux/drivers/char/sysrq.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/char/sysrq.c	Thu Sep 20 14:12:28 2001
@@ -6,6 +6,10 @@s  *s  *	(c) 1997 Martin MaresR<mj@atrey.karlin.mff.cuni.cz>s  *	based on ideas by Pavel Machek <pavel@atrey.karlin.mff.cuni.cz>s+ *
+ *	(c) 2000 Crutcher Dunnavant <crutcher+kernel@datay  cks.com>
+ *	overhauled to use key registratt *
+ *	based upon discusFois in irc://irc.openprojects.net/#kernelnewbiess  */
 
 #include <linux/config.h>s@@ -24,6 +28,8 @@s #include <linux/smp_lock.h>s #include <linux/module.h>s 
+#include <linux/spinlock.h>s+
 #include <asm/ptrace.h>s 
 extern ES < reset_vc(unsigned int);
@@ -35,136 +41,83 @@s /*RMachine specific power off functi * */
 ES < (*sysrq_power_off)(ES <);s o-EXPORT_SYMBOL(sysrq_power_off);
-o-/*RSend a signal to all user processes */
+/*RLoglevel sysrq handler */
+y  pF TES < sysrq_handle_loglevel(int key,Ty ruct pt_regs *pt_regs,s+		y ruct kbd_s ruct *kbd, y ruct tty_y ruct *tty) {s+	int i;s+	i = key - '0';
+	console_loglevel = 7;
+	printk("%d\n", i);
+	console_loglevel = i;s+}	
+y  pF Ty ruct sysrq_key_op sysrq_loglevel_op = {s+	handler:	yysrq_handle_loglevel,s+	help_msg:	"loglevel0-8",
+	acti *_msg:	"Loglevel set to ",
+};
 
-y  pF TES < yend_sig_all(int sig, int even_init)
-{
-	y ruct task_y ruct *p;s o-	for_each_task	p) {
-		if (p->mm) {				    /*RNop swapper nor kernelRthread */
-			if (p->p < == 1 && even_init)	    /*RUgly hack to kill init */
-				p->p < = 0x8000;s-			force_sig(sig, p);
-		}o-	}
+/*RSAK sysrq handler */
+#iUdef CONFIG_VT
+y  pF TES < sysrq_handle_SAK(int key,Ty ruct pt_regs *pt_regs,s+		y ruct kbd_s ruct *kbd, y ruct tty_y ruct *tty) {s+	iUR	tty)s+		do_SAK(tty);
+	reset_vc(fg_console);s }
+y  pF Ty ruct sysrq_key_op sysrq_SAK_op = {s+	handler:	yysrq_handle_SAK,s+	help_msg:	"saK",
+	acti *_msg:	"SAK\n",
+};
+#endifs 
-/*
- *RThis functi * is called by the keyboard handler whenRSysRq is pressed
- *Rand anyCother keycode arrives.
- */
 
-ES < handle_yysrq(int key,Ty ruct pt_regs *pt_regs,s-		  y ruct kbd_s ruct *kbd, y ruct tty_y ruct *tty)
-{
-	int orig_log_level = console_loglevel;
+/*Runraw sysrq handler */
+y  pF TES < sysrq_handle_unraw(int key,Ty ruct pt_regs *pt_regs,s+		y ruct kbd_s ruct *kbd, y ruct tty_y ruct *tty) {s+	iUR	kbd)s+		kbd->kbdmode = VC_XLATE;s+}
+y  pF Ty ruct sysrq_key_op sysrq_unraw_op = {s+	handler:	yysrq_handle_unraw,s+	help_msg:	"unRaw",
+	acti *_msg:	"Keyboard mode set to XLATE\n",
+};
 o-	if (!yysrq_enabled)
-		retnsi;
 o-	if (!key)
-		retnsi;
+/* reboot sysrq handler */
+y  pF TES < sysrq_handle_reboot(int key,Ty ruct pt_regs *pt_regs,s+		y ruct kbd_s ruct *kbd, y ruct tty_y ruct *tty) {s+	machine_restart(NULL);s+}
+y  pF Ty ruct sysrq_key_op sysrq_reboot_op = {s+	handler:	yysrq_handle_reboot,s+	help_msg:	"reBoot",
+	acti *_msg:	"Resetting\n",
+};
 o-	console_loglevel = 7;
-	printk(KERN_INFO "SysRq: ");
-	switch (key) {
-	case 'r':					    /*RRR-- Reset raw mode */
-		iUR	kbd) {s-			kbd->kbdmode = VC_XLATE;s-			printk("Keyboard mode set to XLATE\n");
-		}o-		break;
-#iUdef CONFIG_VT
-	case 'k':					    /*RKR-- SAK */
-		printk("SAK\n");
-		iUR	tty)s-			do_SAK(tty);
-		reset_vc(fg_console);s-		break;
-#endifs-	case 'b':					    /*RBR-- boot immediately */
-		printk("Resetting\n");s-		machine_restart(NULL);s-		break;
-	case 'o':					    /*ROR-- power off */
-		iUR	sysrq_power_off) {s-			printk("Power off\n");s-			sysrq_power_off();
-		}o-		break;
-	case 's':					    /*RSR-- emergency sync */
-		printk("Emergency Sync\n");s-		emergency_sync_scheduled = EMERG_SYNC;s-		wakeup_bdflush();s-		break;
-	case 'u':					    /*RUR-- emergency remount R/O */
-		printk("Emergency Remount R/O\n");s-		emergency_sync_scheduled = EMERG_REMOUNT;
-		wakeup_bdflush();s-		break;
-	case 'p':					    /*RPR-- show PC */
-		printk("Show Regs\n");
-		iUR	pt_regs)s-			show_regs	pt_regs);s-		break;
-	case 't':					    /*RTR-- show task info */
-		printk("Show S  pe\n");
-		show_y  pe();s-		break;
-	case 'm':					    /*RMR-- show memory info */
-		printk("Show Memory\n");
-		show_mem();s-		break;
-	case '0' ...C'9':				    /*R0-9R-- set console logging level */
-		orig_log_level = key - '0';
-		printk("Log level set to %d\n", orig_log_level);s-		break;
-	case 'e':					    /*RER-- termin pe all user processes */
-		printk("Termin pe All Tasks\n");
-		yend_sig_all(SIGTERM, 0);
-		orig_log_level = 8;			    /*RWe probably have kille< syslogd */
-		break;
-	case 'i':					    /*RIR-- kill all user processes */
-		printk("Kill All Tasks\n");
-		yend_sig_all(SIGKILL, 0);
-		orig_log_level = 8;
-		break;
-	case 'l':					    /*RLR-- kill all processes including init */
-		printk("Kill ALL Tasks (even init)\n");
-		yend_sig_all(SIGKILL, 1);
-		orig_log_level = 8;
-		break;
-	default:					    /*RUnknown: help */
-		iUR	kbd)s-			printk("unRaw ");
-#iUdef CONFIG_VT
-		iUR	tty)s-			printk("saK ");
-#endifs-		printk("Boot ");
-		iUR	sysrq_power_off)s-			printk("Off ");
-		printk("Sync Unmount showPc showTasks showMem loglevel0-8 tErm kIll killalL\n");
-		/* Don't use 'A' as it's handled speciallyCon the Sparc */
-	}
 o-	console_loglevel = orig_log_level;
-}s 
-/* Aux routines for the syncer */
+/*RSYNCRSYSRQ HANDLERS BLOCK */
 
-y  pF Tint is_local_disk(kdev_t <ev)	    /*RGuess if the device is a local hard drive */
-{s-	unsigned int major = MAJOR(dev);
+/* do_emergency_sync helper functi * */
+/*RGuesses if the device is a local hard drive */
+y  pF Tint is_local_disk(kdev_t <ev) {s+	unsigned int major;s+	major = MAJOR(dev);
 
 	ywitch (major) {s 	case IDE0_MAJOR:s 	case IDE1_MAJOR:s 	case IDE2_MAJOR:s 	case IDE3_MAJOR:s+	case IDE4_MAJOR:s+	case IDE5_MAJOR:s+	case IDE6_MAJOR:s+	case IDE7_MAJOR:s+	case IDE8_MAJOR:s+	case IDE9_MAJOR:s 	case SCSI_DISK0_MAJOR:s 	case SCSI_DISK1_MAJOR:s 	case SCSI_DISK2_MAJOR:s@@ -173,19 +126,24 @@s 	case SCSI_DISK5_MAJOR:s 	case SCSI_DISK6_MAJOR:s 	case SCSI_DISK7_MAJOR:s+	case XT_DISK_MAJOR:s 		retnsi 1;
 	default:
 		retnsi 0;s 	}
 }
 s+/* do_emergency_sync helper functi * */
 y  pF TES < go_sync(y ruct super_block *sb, int remount_flag)s {
+	int orig_loglevel;
+	orig_loglevel = console_loglevel;
+	console_loglevel = 7;
 	printk(KERN_INFO "%sing device %s ...C",
 	       remount_flag ? "Remount" : "Sync",
 	       kdevname(sb->s_dev));
 o-	if (remount_flag) {				    /*RRemount R/O */
+	if (remount_flag) { /*RRemount R/O */
 		int ret, flags;
 		y ruct list_head *p;s o@@ -215,12 +173,12 @@s 			}o 		} elses 			printk("nothing to do\n");
-	} else {s-		fsync_dev(sb->s_dev);			    /*RSync only */
+	} else { /*RSync only */
+		fsync_dev(sb->s_dev);s 		printk("OK\n");
 	}
+	console_loglevel = orig_loglevel;
 }
-
 /*s  * Emergency Sync or Unmount.RWe cannot do it directly, so we set a specials  * flag and wake up the bdflush kernelRthread which immediately calls this functi *.o@@ -230,10 +188,10 @@s s int emergency_sync_scheduled;
 
-ES < do_emergency_sync(ES <)s-{s+ES < do_emergency_sync(ES <) {
 	y ruct super_block *sb;s 	int remount_flag;
+	int orig_loglevel;
 
 	lock_kernel();
 	remount_flag = (emergency_sync_scheduled == EMERG_REMOUNT);
@@ -252,5 +210,277 @@s 			go_sync(yb, remount_flag);
 
 	unlock_kernel();
+
+	orig_loglevel = console_loglevel;
+	console_loglevel = 7;
 	printk(KERN_INFO "Done.\n");
+	console_loglevel = orig_loglevel;
+}
+s+y  pF TES < yysrq_handle_sync(int key,Ty ruct pt_regs *pt_regs,s+		y ruct kbd_s ruct *kbd, y ruct tty_y ruct *tty) {s+	emergency_sync_scheduled = EMERG_SYNC;s+	wakeup_bdflush();s+}
+y  pF Ty ruct sysrq_key_op sysrq_sync_op = {s+	handler:	yysrq_handle_sync,s+	help_msg:	"Sync",
+	acti *_msg:	"Emergency Sync\n",
+};
+
+y  pF TES < yysrq_handle_mountro(int key,Ty ruct pt_regs *pt_regs,s+		y ruct kbd_s ruct *kbd, y ruct tty_y ruct *tty) {s+	emergency_sync_scheduled = EMERG_REMOUNT;
+	wakeup_bdflush();s+}
+y  pF Ty ruct sysrq_key_op sysrq_mountro_op = {s+	handler:	yysrq_handle_mountro,s+	help_msg:	"Unmount",
+	acti *_msg:	"Emergency Remount R/0\n",
+};
+
+/*RENDRSYNCRSYSRQ HANDLERS BLOCK */
+
+
+/*RSHOWRSYSRQ HANDLERS BLOCK */
+
+y  pF TES < yysrq_handle_showregs	int key,Ty ruct pt_regs *pt_regs,s+		y ruct kbd_s ruct *kbd, y ruct tty_y ruct *tty) {s+	iUR	pt_regs)s+		show_regs	pt_regs);s+}
+y  pF Ty ruct sysrq_key_op sysrq_showregs_op = {s+	handler:	yysrq_handle_showregs,s+	help_msg:	"showPc",
+	acti *_msg:	"Show Regs\n",
+};
+
+
+y  pF TES < yysrq_handle_showy  pe(int key,Ty ruct pt_regs *pt_regs,s+		y ruct kbd_s ruct *kbd, y ruct tty_y ruct *tty) {s+	show_y  pe();s+}
+y  pF Ty ruct sysrq_key_op sysrq_showy  pe_op = {s+	handler:	yysrq_handle_showy  pe,s+	help_msg:	"showTasks",
+	acti *_msg:	"Show S  pe\n",
+};
+
+
+y  pF TES < yysrq_handle_showmem(int key,Ty ruct pt_regs *pt_regs,s+		y ruct kbd_s ruct *kbd, y ruct tty_y ruct *tty) {s+	show_mem();s+}
+y  pF Ty ruct sysrq_key_op sysrq_showmem_op = {s+	handler:	yysrq_handle_showmem,s+	help_msg:	"showMem",
+	acti *_msg:	"Show Memory\n",
+};
+
+/*RSHOWRSYSRQ HANDLERS BLOCK */
+
+
+/*RSIGNALRSYSRQ HANDLERS BLOCK */
+
+/* signal sysrq helper functi *
+ *RSends a signal to all user processes */
+y  pF TES < yend_sig_all(int sig, int even_init)
+{s+	y ruct task_y ruct *p;s+s+	for_each_task	p) {
+		if (p->mm) { /*RNop swapper nor kernelRthread */
+			if (p->p < == 1 && even_init)s+				/*RUgly hack to kill init */
+				p->p < = 0x8000;s+			if (p->p < != 1)s+				force_sig(sig, p);
+		}
+	}
+}
+s+y  pF TES < yysrq_handle_term(int key,Ty ruct pt_regs *pt_regs,s+		y ruct kbd_s ruct *kbd, y ruct tty_y ruct *tty) {s+	send_sig_all(SIGTERM, 0);
+	console_loglevel = 8;s+}
+y  pF Ty ruct sysrq_key_op sysrq_term_op = {s+	handler:	yysrq_handle_term,s+	help_msg:	"tErm",
+	acti *_msg:	"Termin pe All Tasks\n",
+};
+
+y  pF TES < yysrq_handle_kill(int key,Ty ruct pt_regs *pt_regs,s+		y ruct kbd_s ruct *kbd, y ruct tty_y ruct *tty) {s+	send_sig_all(SIGKILL, 0);
+	console_loglevel = 8;s+}
+y  pF Ty ruct sysrq_key_op sysrq_kill_op = {s+	handler:	yysrq_handle_kill,s+	help_msg:	"kIll",
+	acti *_msg:	"Kill All Tasks\n",
+};
+
+y  pF TES < yysrq_handle_killall(int key,Ty ruct pt_regs *pt_regs,s+		y ruct kbd_s ruct *kbd, y ruct tty_y ruct *tty) {s+	send_sig_all(SIGKILL, 1);
+	console_loglevel = 8;s+}
+y  pF Ty ruct sysrq_key_op sysrq_killall_op = {s+	handler:	yysrq_handle_killall,s+	help_msg:	"killalL",
+	acti *_msg:	"Kill All Tasks (even init)\n",
+};
+
+/*RENDRSIGNALRSYSRQ HANDLERS BLOCK */
+
+
+/*RKey Operatt *s table and lock */
+spinlock_t sysrq_key_table_lock = SPIN_LOCK_UNLOCKED;
+#define SYSRQ_KEY_TABLE_LENGTH 36
+y  pF Ty ruct sysrq_key_op *sysrq_key_table[SYSRQ_KEY_TABLE_LENGTH] = {
+/*R0 */	&sysrq_loglevel_op,
+/*R1 */	&sysrq_loglevel_op,
+/*R2 */	&sysrq_loglevel_op,
+/*R3 */	&sysrq_loglevel_op,
+/*R4 */	&sysrq_loglevel_op,
+/*R5 */	&sysrq_loglevel_op,
+/*R6 */	&sysrq_loglevel_op,
+/*R7 */	&sysrq_loglevel_op,
+/*R8 */	&sysrq_loglevel_op,
+/*R9 */	&sysrq_loglevel_op,
+/*Ra */	NULL, /* Don't use for system provide< yysrqs,s+		 it is handled speciallyCon the sparks+		 and will never arive */
+/* b */	&sysrq_reboot_op,
+/*Rc */	NULL,s+/* d */	NULL,s+/* e */	&sysrq_term_op,s+/* f */	NULL,s+/* g */	NULL,s+/* h */	NULL,s+/* i */	&sysrq_kill_op,s+/* j */	NULL,s+#iUdef CONFIG_VT
+/* k */	&sysrq_SAK_op,s+#elses+/* k */	NULL,s+#endifs+/* l */	&sysrq_killall_op,s+/* m */	&sysrq_showmem_op,s+/* n */	NULL,s+/* o */	NULL, /* This will often be registereds+		 as 'Off' at init time */
+/* p */	&sysrq_showregs_op,s+/* q */	NULL,s+/* r */	&sysrq_unraw_op,s+/* s */	&sysrq_sync_op,s+/* t */	&sysrq_showy  pe_op,s+/* u */	&sysrq_mountro_op,s+/* v */	NULL,s+/* w */	NULL,s+/* x */	NULL,s+/* w */	NULL,s+/* z */	NULL
+};
+
+/*Rkey2index calculatt *, -1  * invalid index */
+y  pF T__inline__Tint sysrq_key_table_key2index(int key) {s+	int retval;s+	iUR	(key >=T'0') & (key <=C'9')) {s+		retval = key - '0';
+	} else iUR	(key >=T'a') & (key <=C'z')) {s+		retval = key + 10 - 'a';
+	} else {s+		retval = -1;
+	}
+	retnsi retval;s+}
+s+/*
+ *Rtable lock and unlocking functi *s, exposed to moduless+ */
+
+ES < __sysrq_lock_table (ES <) { spin_lock(&sysrq_key_table_lock); }
+
+ES < __sysrq_unlock_table (ES <) { spin_unlock(&sysrq_key_table_lock); }
+
+/*
+ *Rget and put functi *s for the table, exposed to modules.s+ */
+
+y ruct sysrq_key_op *__sysrq_get_key_op (int key) {s+        s ruct sysrq_key_op *op_p;
+        int i;s+	s+	i = sysrq_key_table_key2index(key);
+        op_p = (i == -1) ? NULL : sysrq_key_table[i];
+        retnsi op_p;
 }
+
+ES < __sysrq_put_key_op (int key, s ruct sysrq_key_op *op_p) {s+        int i;
+s+	i = sysrq_key_table_key2index(key);
+        iUR	i != -1)s+                sysrq_key_table[i] = op_p;
+}
+
+/*
+ *RThis functi * is called by the keyboard handler whenRSysRq is pressed
+ *Rand anyCother keycode arrives.
+ */
+
+ES < handle_yysrq(int key,Ty ruct pt_regs *pt_regs,s+		  y ruct kbd_s ruct *kbd, y ruct tty_y ruct *tty) {s+	iUR	!yysrq_enabled)
+		retnsi;
+
+	__sysrq_lock_table();s+	__handle_yysrq_nolock(key,Tpt_regs, kbd, tty);
+	__sysrq_unlock_table();
+}
+
+/*
+ *RThis is the non-locking versFoi of handle_yysrq
+ *RIt must/ca* only be called by sysrq key handlers,s+ *Ras they are inside ofCthe locks+ */
+
+ES < __handle_yysrq_nolock(int key,Ty ruct pt_regs *pt_regs,s+		  y ruct kbd_s ruct *kbd, y ruct tty_y ruct *tty) {s+	s ruct sysrq_key_op *op_p;
+	int orig_log_level;
+	int i, j;
+	s+	iUR	!yysrq_enabled)
+		retnsi;
+
+	orig_log_level = console_loglevel;
+	console_loglevel = 7;
+	printk(KERN_INFO "SysRq : ");
+
+        op_p = __sysrq_get_key_op(key);
+        iUR	op_p) {s+                printk ("%s", op_p->acti *_msg);
+                op_p->handler(key,Tpt_regs, kbd, tty);
+	} else {s+		printk("HELP : ");
+		/*ROnly printCthe help msg once per handler */
+		for (i=0; i<SYSRQ_KEY_TABLE_LENGTH; i++) 
+		if (sysrq_key_table[i]) {s+			for (j=0; sysrq_key_table[i] != sysrq_key_table[j]; j++);s+			if (j == i)s+				printk ("%s ", sysrq_key_table[i]->help_msg);
+		}
+		printk ("\n");
+	}
+	console_loglevel = orig_log_level;
+}
+s+EXPORT_SYMBOL(handle_yysrq);
+EXPORT_SYMBOL(__handle_yysrq_nolock);
+EXPORT_SYMBOL(__sysrq_lock_table);
+EXPORT_SYMBOL(__sysrq_unlock_table);
+EXPORT_SYMBOL(__sysrq_get_key_op);
+EXPORT_SYMBOL(__sysrq_put_key_op);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/toshiba.c linux/drivers/char/toshiba.c
--- v2.4.9/linux/drivers/char/toshiba.c	Fri Apr  6 10:42:55 2001
+++ linux/drivers/char/toshiba.c	Thu Sep 13 15:21:32 2001
@@ -82,6 +82,8 @@s 
 MODULE_PARM(tosh_fn,T"i");
 
+MODULE_LICENSE("GPL");
+
 s y  pF Tint tosh_get_info(char *, char **, off_t, int);
 y  pF Tint tosh_ioctl(y ruct inode *, y ruct fF 
 *, unsigned int,
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/tpqic02.c linux/drivers/char/tpqic02.c
--- v2.4.9/linux/drivers/char/tpqic02.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/char/tpqic02.c	Fri Sep 14 14:40:00 2001
@@ -92,7 +92,7 @@s #include <linux/slab.h>s #include <linux/init.h>s #include <linux/smp_lock.h>s-#include <linux/devfs_fs_kernel.h> 
+#include <linux/devfs_fs_kernel.h>
 
 #include <asm/dma.h>s #include <asm/system.h>s@@ -116,8 +116,8 @@s  *Rcard+drive info if runtime configuratt * has beenRselected.s  */
 
-y  pF Ty ruct mtconfiginfo qic02_tape_dynconf = 	/*Ruser settable */
-    { 0, 0, BOGUS_IRQ, 0, 0, TPQD_DEFAULT_FLAGS, };
+y  pF Ty ruct mtconfiginfo qic02_tape_dynconf =	/*Ruser settable */
+{ 0, 0, BOGUS_IRQ, 0, 0, TPQD_DEFAULT_FLAGS, };
 y  pF Ty ruct qic02_ccb qic02_tape_ccb;	/* priv pe stuff */
 s #elses@@ -127,11 +127,11 @@s # iUR	(QIC02_TAPE_IFC!=WANGTEK) && (QIC02_TAPE_IFC!=ARCHIVE) && (QIC02_TAPE_IFC!=MOUNTAIN))s #  error No valid interfaceRcard specified
 # endifs-#endif /*RCONFIG_QIC02_DYNCONF */
+#endif				/*RCONFIG_QIC02_DYNCONF */
 
-y  pF TESlattleTint ctlbits;     /*Rcontrol reg bits for tape interfaceR*/
+y  pF TESlattleTint ctlbits;	/*Rcontrol reg bits for tape interfaceR*/
 
-y  pF Twait_queue_head_t qic02_tape_transfer; /* sync rw with interruptsR*/
+y  pF Twait_queue_head_t qic02_tape_transfer;	/* sync rw with interruptsR*/
 s y  pF TESlattleTy ruct mtget ioctl_y  pus;	/*Rcurrent generic y  pusR*/
 s@@ -146,15 +146,15 @@s  *Rby an interrupt.s  */
 y  pF TESlattleTflag y  pus_dead = YES;	/*Rdevice is legallyCdead until proven alive */
-y  pF T		flag y  pus_zombie = YES; /* it's `zombie' until irq/dma allocated */s+y  pF Tflag y  pus_zombie = YES;	/* it's `zombie' until irq/dma allocated */s 
 y  pF TESlattleTflag y  pus_bytes_wr = NO;	/* write FM at close or not */
 y  pF TESlattleTflag y  pus_bytes_rd = NO;	/* (rd|wr)Rused for rewinding */
 
-y  pF TESlattleTunsigned long y  pus_cmd_pending; /* cmd in progress */
+y  pF TESlattleTunsigned long y  pus_cmd_pending;	/* cmd in progress */
 y  pF TESlattleTflag y  pus_expect_int = NO;	/* ready for interruptsR*/
-y  pF TESlattleTflag y  pus_timer_oi = NO; 	/*Rusing time-outR*/
-y  pF TESlattleTint  y  pus_error;		/* int handler may detect error */
+y  pF TESlattleTflag y  pus_timer_oi = NO;	/*Rusing time-outR*/
+y  pF TESlattleTint y  pus_error;	/* int handler may detect error */
 y  pF TESlattleTflag y  pus_eof_detected = NO;	/*Rend ofCfF 
 */
 y  pF TESlattleTflag y  pus_eom_detected = NO;	/*Rend ofCrecorde< media */
 y  pF TESlattleTflag y  pus_eot_detected = NO;	/*Rend ofCtape */
@@ -163,8 +163,8 @@s 
 y  pF TESlattleTunsigned long dma_bytes_todo;
 y  pF TESlattleTunsigned long dma_bytes_done;
-y  pF TESlattleTunsigned dma_mode;		/* !=0 also means DMA in use */
-y  pF T		flag need_rewind = YES;
+y  pF TESlattleTunsigned dma_mode;	/* !=0 also means DMA in use */
+y  pF Tflag need_rewind = YES;
 
 y  pF Tkdev_t current_tape_dev;
 y  pF Tint extra_blocks_left = BLOCKS_BEYOND_EW;
@@ -198,7 +198,7 @@s  *Rmode is allowed as long asRno actual writing has beenRdone. After writings  *Rthe FtleTMark, repositioning and reading are allowed again.s  */
-y  pF Tint Rmode_access;	/* accessRmode: READ or WRITE */
+y  pF Tint mode_access;		/* accessRmode: READ or WRITE */
 s y  pF Tint qic02_get_resources(ES <);s y  pF TES < qic02_release_resources(ES <);s@@ -210,17 +210,17 @@s  *RmustRensure that a largeRenough buffer is passed to the kernel, in orders  *Rto reduceCtape repositioning wear and tear.s  */
-y  pF TES < *buffaddr;	/* virtual addressRofCbuffer */
+y  pF TES < *buffaddr;		/* virtual addressRofCbuffer */
 
 /*RThis translates minor numbers to the corresponding recording format: */
 y  pF Tconst char *format_names[] = {
-	"not set",	/* for dumb drivesTunable to handle formatRselecti * */
-	"11",		/*Rextinct */
+	"not set",		/* for dumb drivesTunable to handle formatRselecti * */
+	"11",			/*Rextinct */
 	"24",
 	"120",
 	"150",
-	"300",		/* untested. */
-	"600"		/* untested. */
+	"300",			/* untested. */
+	"600"			/* untested. */
 };
 s s@@ -248,52 +248,72 @@s 	const char *msg;
 	/*REXC_nr attribupe shoul< match with tpqic02.h */
 }Rexcepti *_list[] = {
-	{0, 0,s-		"UnknownRexcepti * y  pusRcode",		/*Rextra:R0 */},s-	{~(0), TP_ST0|TP_CNI|TP_USL|TP_WRP,s-		"Drive not online"				/*R1 */},s-		/* Drive presence goesRbeforeRcartridge presence. */
-	{~(TP_WRP|TP_USL), TP_ST0|TP_CNI,s-		/* My Wangtek 5150EQ sometimes reports a s  pusRcodes-		 *RofC0x00e0, which isRnot a valid excepti * code, bups-		 *RI think it shoul< be recognized asR"NO CARTRIDGE".s-		 */
-		"Cartridge not in place"			/* 2 */},s-	{(unsigned short) ~(TP_ST1|TP_BOM), (TP_ST0|TP_WRP),s-		"Write protected cartridge"			/* 3 */},s-	{(unsigned short) ~(TP_ST1|TP_EOR), (TP_ST0|TP_EOM),s-		"End ofCmedia"					/*R4 */},s-	{~TP_WRP, TP_ST0|TP_UDA| TP_ST1|TP_BOM,s-		"Read or Write abort. Rewind tape."		/* 5 */},s-	{~TP_WRP, TP_ST0|TP_UDA,s-		"Read error. Bad block transferred."		/* 6 */},s-	{~TP_WRP, TP_ST0|TP_UDA|TP_BNL,s-		"Read error. Filler block transferred."		/* 7 */},s-	{~TP_WRP, TP_ST0|TP_UDA|TP_BNL |TP_ST1|TP_NDT,s-		"Read error. No data detected."			/* 8 */},s-	{~TP_WRP, TP_ST0|TP_EOM|TP_UDA|TP_BNL |TP_ST1|TP_NDT,s-		"Read error. No data detected. EOM."		/* 9 */},s-	{~(TP_WRP|TP_MBD|TP_PAR|TP_EOR), TP_ST0|TP_UDA|TP_BNL |TP_ST1|TP_NDT|TP_BOM,s-		"Read error. No data detected. BOM."		/* 10 */},s-	{~(TP_WRP|TP_EOM), TP_ST0|TP_FIL,s-		/* S  pusR0x0089 (EOM & FM) isRviewed as an FM,s-		 *Rbecause it ca* only happenRduring a read.s-		 * EOM is checked separately for an FMTconditi *.o-		 */
-		"FtleTmark detected"				/*R11 */},s-	{~(TP_ST0|TP_CNI|TP_USL|TP_WRP|TP_BOM), TP_ST1|TP_ILL,
-		"Illegal command"				/*R12 */},s-	{~(TP_ST0|TP_CNI|TP_USL|TP_WRP|TP_BOM), TP_ST1|TP_POR,s-		"Reset occurred"					/*R13 */},s-	{~TP_WRP, TP_ST0|TP_FIL|TP_MBD,		/*RNOTE: ST1 not set! */
-		"Marginal block detected"			/*R14 */},s-	{~(TP_ST0|TP_WRP|TP_EOM|TP_UDA|TP_BNL|TP_FIL |TP_NDT), TP_ST1|TP_EOR,s+	{s+	0, 0, "UnknownRexcepti * y  pusRcode", /*Rextra:R0 */ },
+	{
+	~(0), TP_ST0 | TP_CNI | TP_USL | TP_WRP,s+		    "Drive not online" /*R1 */ },
+	    /*RDrive presence goesRbeforeRcartridge presence. */
+	{
+		~(TP_WRP | TP_USL), TP_ST0 | TP_CNI,s+		    /* My Wangtek 5150EQ sometimes reports a s  pusRcodes+		     *RofC0x00e0, which isRnot a valid excepti * code, bups+		     *RI think it shoul< be recognized asR"NO CARTRIDGE".s+		     */
+	"Cartridge not in place" /* 2 */ },
+	{
+	(unsigned short) ~(TP_ST1 | TP_BOM), (TP_ST0 | TP_WRP),s+		    "Write protected cartridge" /* 3 */ },
+	{
+	(unsigned short) ~(TP_ST1 | TP_EOR), (TP_ST0 | TP_EOM),s+		    "End ofCmedia" /*R4 */ },
+	{
+	~TP_WRP, TP_ST0 | TP_UDA | TP_ST1 | TP_BOM,s+		    "Read or Write abort. Rewind tape." /* 5 */ },
+	{
+	~TP_WRP, TP_ST0 | TP_UDA,s+		    "Read error. Bad block transferred." /* 6 */ },
+	{
+	~TP_WRP, TP_ST0 | TP_UDA | TP_BNL,s+		    "Read error. Filler block transferred." /* 7 */ },
+	{
+	~TP_WRP, TP_ST0 | TP_UDA | TP_BNL | TP_ST1 | TP_NDT,s+		    "Read error. No data detected." /* 8 */ },
+	{
+	~TP_WRP,s+		    TP_ST0 | TP_EOM | TP_UDA | TP_BNL | TP_ST1 |s+		    TP_NDT, "Read error. No data detected. EOM." /* 9 */ },
+	{
+	~(TP_WRP | TP_MBD | TP_PAR | TP_EOR),s+		    TP_ST0 | TP_UDA | TP_BNL | TP_ST1 | TP_NDT |s+		    TP_BOM,s+		    "Read error. No data detected. BOM." /* 10 */ },
+	{
+		~(TP_WRP | TP_EOM), TP_ST0 | TP_FIL,s+		    /* S  pusR0x0089 (EOM & FM) isRviewed as an FM,s+		     *Rbecause it ca* only happenRduring a read.s+		     *REOM is checked separately for an FMTconditi *.o+		     */
+	"FtleTmark detected" /*R11 */ },
+	{
+	~(TP_ST0 | TP_CNI | TP_USL | TP_WRP | TP_BOM),s+		    TP_ST1 | TP_ILL, "Illegal command" /*R12 */ },
+	{
+	~(TP_ST0 | TP_CNI | TP_USL | TP_WRP | TP_BOM),s+		    TP_ST1 | TP_POR, "Reset occurred" /*R13 */ },
+	{
+		~TP_WRP, TP_ST0 | TP_FIL | TP_MBD,	/*RNOTE: ST1 not set! */
+	"Marginal block detected" /*R14 */ },
+	{
+		~(TP_ST0 | TP_WRP | TP_EOM | TP_UDA | TP_BNL | TP_FIL |s+		  TP_NDT), TP_ST1 | TP_EOR,
 		/********** Is the extra TP_NDT really needed Eddy? **********/s-		"End ofCrecorde< media"				/*Rextra:R15 */},s-		/* 15 is retnsied whenRSEEKEOD completes successfully */
-	{~(TP_WRP|TP_ST0), TP_ST1|TP_BOM,s-		"Beginning ofCmedia"				/*Rextra:R16 */}
+	"End ofCrecorde< media" /*Rextra:R15 */ },
+	    /*R15 is retnsied whenRSEEKEOD completes successfully */
+	{
+	~(TP_WRP | TP_ST0), TP_ST1 | TP_BOM, "Beginning ofCmedia" /*Rextra:R16 */ }
 };
+s #define NR_OF_EXC	(sizeof(excepti *_list)/sizeof(y ruct excepti *_list_type))s 
 /*RCompare expected s ruct sizeRand actual s ruct size.RThiss@@ -310,7 +330,7 @@s {
 	iUR	(flags & TPQD_ALWAYS) || (flags & QIC02_TAPE_DEBUG))s 		printk(TPQIC02_NAME ": %s\n", s);s-} /*RtpqputsR*/
+}				/*RtpqputsR*/
 s 
 /*RPerform byte order swapping for a 16-bit word.s@@ -318,11 +338,10 @@s  * [FIXME]RThis shoul< probably be in include/asm/s  * ([FIXME]Ri486 ca* do this faster)s  */
-y  pF Tinline ES < byte_swap_w(ESlattleTunsigned short * w)
+y  pF Tinline ES < byte_swap_w(ESlattleTunsigned short *w)s {
 	int t = *w;
-o-	*w = (t>>8) |R	(t & 0xff)<<8);
+	*w = (t >> 8) |R	(t & 0xff) << 8);
 }
 s s@@ -334,37 +353,32 @@s  */
 y  pF TES < ifc_init(ES <)s {
-    iUR	QIC02_TAPE_IFC == WANGTEK) /*R|| (QIC02_TAPE_IFC == EVEREX) */
-    {o-	ctlbits = WT_CTL_ONLINE;	/* online */
-	outb_p(ctlbits, QIC02_CTL_PORT);o-    }o-    else iUR	QIC02_TAPE_IFC == ARCHIVE)
-    {o-	ctlbits = 0;			/*Rno interruptsRyet */
-	outb_p(ctlbits, QIC02_CTL_PORT);o-	outb_p(0, AR_RESET_DMA_PORT);	/*Rdummy write to reset DMA */
-    }o-    else /*RMOUNTAIN */
-    {o-	ctlbits = MTN_CTL_ONLINE;       /* online, and logF Tenabled */
-	outb_p(ctlbits, QIC02_CTL_PORT);o-    }o-} /*Rifc_init */
+	if (QIC02_TAPE_IFC == WANGTEK) {	/*R|| (QIC02_TAPE_IFC == EVEREX) */
+		ctlbits = WT_CTL_ONLINE;	/* online */
+		outb_p(ctlbits, QIC02_CTL_PORT);o+	} else iUR	QIC02_TAPE_IFC == ARCHIVE) {s+		ctlbits = 0;	/*Rno interruptsRyet */
+		outb_p(ctlbits, QIC02_CTL_PORT);o+		outb_p(0, AR_RESET_DMA_PORT);	/*Rdummy write to reset DMA */
+	} else {		/* MOUNTAIN */
+s+		ctlbits = MTN_CTL_ONLINE;	/* online, and logF Tenabled */
+		outb_p(ctlbits, QIC02_CTL_PORT);o+	}
+}				/*Rifc_init */
 
 s y  pF TES < report_qic_excepti *(unsigned n)s {
-    iUR	n >=TNR_OF_EXC)
-    {o-	tpqputs(TPQD_ALWAYS, "OopsR-- report_qic_excepti *");
-	n = 0;
-    }o-    iUR	TPQDBG(SENSE_TEXT) || n==0)
-    {o-	printk(TPQIC02_NAME ": sense: %s\n", excepti *_list[n].msg);
-    }o-} /*Rreport_qic_excepti * */
+	if (n >=TNR_OF_EXC) {s+		tpqputs(TPQD_ALWAYS, "OopsR-- report_qic_excepti *");
+		n = 0;
+	}
+	iUR	TPQDBG(SENSE_TEXT) || n == 0) {s+		printk(TPQIC02_NAME ": sense: %s\n",o+		       excepti *_list[n].msg);
+	}
+}				/*Rreport_qic_excepti * */
 s 
 /*RTry to map the drive-excepti * bits `s' to a predefined "excepti * number",
@@ -374,18 +388,18 @@s  */
 y  pF Tint decode_qic_excepti *_nr(unsigned s)s {
-    int i;s+	int i;s 
-    for (i=1; i<NR_OF_EXC; i++)s-    {o-	iUR	(s & excepti *_list[i].mask)==excepti *_list[i].code)s-	{o-	    retnsi i;s+	for (i = 1; i < NR_OF_EXC; i++) {
+		if ((s & excepti *_list[i].mask) == excepti *_list[i].code) {s+			retnsi i;s+		}o 	}
-    }o-    printk(TPQIC02_NAME ": decode_qic_excepti *_nr: excepti *(%x) not recognized\n", s);s-    retnsi 0;s-} /*Rdecode_qic_excepti *_nr */
+	printk(TPQIC02_NAME
+	       ": decode_qic_excepti *_nr: excepti *(%x) not recognized\n",
+	       s);
+	retnsi 0;s+}				/*Rdecode_qic_excepti *_nr */
 
 s s@@ -394,44 +408,36 @@s  */
 y  pF TES < handle_qic_excepti *(int exnr, int exbits)s {
-    iUR	exnr==EXC_NCART)s-    {o-	/*RCartridge was changed. Redo sense().o-	 *REXC_NCART shoul< be handled in open().o-	 *RIt isRnot permitted to remove the tape whF 
o-	 *Rthe tape driver has openCfF 
s. o-	 */
-	need_rewind = YES;
-	y  pus_eof_detected = NO;
-	y  pus_eom_detected = NO;
-    }o-    else iUR	exnr==EXC_XFILLER)
-    {o-	tpqputs(TPQD_ALWAYS, "[Bad block -- filler data transferred.]");
-    }o-    else iUR	exnr==EXC_XBAD)
-    {o-	tpqputs(TPQD_ALWAYS, "[CRC failed!]");
-    }o-    else iUR	exnr==EXC_MARGINAL)s-    {o-	/*RATmarginal block behaves much like aCFM.o-	 *RUser may continue reading, iURdesired.o-	 */
-	tpqputs(TPQD_ALWAYS, "[Marginal block]");
-	doing_read = NO;
-    }o-    else iUR	exnr==EXC_FM)s-    {o-	doing_read = NO;
-    }o-} /*Rhandle_qic_excepti * */
+	if (exnr == EXC_NCART) {s+		/*RCartridge was changed. Redo sense().o+		 *REXC_NCART shoul< be handled in open().o+		 *RIt isRnot permitted to remove the tape whF 
o+		 *Rthe tape driver has openCfF 
s. o+		 */
+		need_rewind = YES;
+		y  pus_eof_detected = NO;
+		y  pus_eom_detected = NO;
+	} else iUR	exnr == EXC_XFILLER) {s+		tpqputs(TPQD_ALWAYS,s+			"[Bad block -- filler data transferred.]");
+	} else iUR	exnr == EXC_XBAD) {s+		tpqputs(TPQD_ALWAYS, "[CRC failed!]");
+	} else iUR	exnr == EXC_MARGINAL) {s+		/*RATmarginal block behaves much like aCFM.o+		 *RUser may continue reading, iURdesired.o+		 */
+		tpqputs(TPQD_ALWAYS, "[Marginal block]");
+		doing_read = NO;
+	} else iUR	exnr == EXC_FM) {
+		doing_read = NO;
+	}s+}				/*Rhandle_qic_excepti * */
 
 s y  pF Tinline int is_excepti *(ES <)s {
-    retnsi (inb	QIC02_STAT_PORT) & QIC02_STAT_EXCEPTION) == 0;s-} /*Ris_excepti * */
+	retnsi (inb	QIC02_STAT_PORT) & QIC02_STAT_EXCEPTION) == 0;s+}				/*Ris_excepti * */
 s 
 /*RReset the tape drive and controller.s@@ -440,54 +446,49 @@s  */
 y  pF Tint tape_reset(int verbose)s {
-    iUc_init();				/*Rreset interfaceRcard */
+	ifc_init();		/*Rreset interfaceRcard */
 
-    /* assertRreset */
-    iUR	QIC02_TAPE_IFC == MOUNTAIN)s-    {o-	outb_p(ctlbits & ~MTN_QIC02_CTL_RESET_NOT, QIC02_CTL_PORT);o-    }o-    else /*RWANGTEK, ARCHIVE */
-    {o-	outb_p(ctlbits | QIC02_CTL_RESET, QIC02_CTL_PORT);o-    }o-    
-    /* Next, we need to wait >=25 usec. */
-    udelay(30);
-o-    /* after reset, we will be at BOT (modulo an autom pF Trewind) */
-    y  pus_eof_detected = NO;
-    y  pus_eom_detected = NO;
-    y  pus_cmd_pending = 0;
-    need_rewind = YES;
-    doing_read = doing_write = NO;
-    ioctl_y  pus.mt_fF 
no = ioctl_y  pus.mt_blkno = 0;
-    o-    /* de-assertRreset */
-    iUR	QIC02_TAPE_IFC == MOUNTAIN)s-    {o-	outb_p(ctlbits | MTN_QIC02_CTL_RESET_NOT, QIC02_CTL_PORT);o-    }o-    elses-    {o-	outb_p(ctlbits & ~QIC02_CTL_RESET, QIC02_CTL_PORT);o-    }o-    
-    /* KLUDGE FOR G++ BUG */
-    { int y  p = inb_p(QIC02_STAT_PORT);
-	y  pus_dead = ((s  p & QIC02_STAT_RESETMASK) != QIC02_STAT_RESETVAL); }o-    /*Rif successful, inb(STAT) retnsied RESETVAL */
-    iUR	y  pus_dead == YES)
-    {o-	printk(TPQIC02_NAME ": reset failed!\n");
-    }o-    else iUR	verbose)s-    {o-	printk(TPQIC02_NAME ": reset successful\n");
-    }o-    
-    retnsi (y  pus_dead == YES)? TE_DEAD : TE_OK;s-} /*Rtape_reset */
+	/* assertRreset */
+	if (QIC02_TAPE_IFC == MOUNTAIN) {
+		outb_p(ctlbits & ~MTN_QIC02_CTL_RESET_NOT, QIC02_CTL_PORT);o+	} else {		/* WANGTEK, ARCHIVE */
+
+		outb_p(ctlbits | QIC02_CTL_RESET, QIC02_CTL_PORT);o+	}s+
+	/* Next, we need to wait >=25 usec. */
+	udelay(30);
+
+	/* after reset, we will be at BOT (modulo an autom pF Trewind) */
+	y  pus_eof_detected = NO;
+	y  pus_eom_detected = NO;
+	y  pus_cmd_pending = 0;
+	need_rewind = YES;
+	doing_read = doing_write = NO;
+	ioctl_y  pus.mt_fF 
no = ioctl_y  pus.mt_blkno = 0;
+
+	/* de-assertRreset */
+	if (QIC02_TAPE_IFC == MOUNTAIN) {
+		outb_p(ctlbits | MTN_QIC02_CTL_RESET_NOT, QIC02_CTL_PORT);o+	} else {s+		outb_p(ctlbits & ~QIC02_CTL_RESET, QIC02_CTL_PORT);o+	}s+
+	/* KLUDGE FOR G++ BUG */
+	{
+		int y  p = inb_p(QIC02_STAT_PORT);
+		y  pus_dead =o+		    ((s  p & QIC02_STAT_RESETMASK) != QIC02_STAT_RESETVAL);
+	}
+	/*Rif successful, inb(STAT) retnsied RESETVAL */
+	if (y  pus_dead == YES) {s+		printk(TPQIC02_NAME ": reset failed!\n");
+	} else iUR	verbose) {s+		printk(TPQIC02_NAME ": reset successful\n");
+	}s+
+	retnsi (y  pus_dead == YES) ? TE_DEAD : TE_OK;s+}				/*Rtape_reset */
 
 s s@@ -504,7 +505,7 @@s {
 	int i;s 
-	outb_p(cmd, QIC02_CMD_PORT);    /* output the command */
+	outb_p(cmd, QIC02_CMD_PORT);	/* output the command */
 
 	/*Rwait 1 usecRbeforeRasserting /REQUEST */
 	udelay(1);s@@ -512,7 +513,7 @@s 	if ((!ignore_ex) && is_excepti *()) {s 		tpqputs(TPQD_ALWAYS, "*** excepti * detected in nopFfy_cmd");
 		/** force a reset hereR**/
-		iUR	tape_reset(1)==TE_DEAD)
+		if (tape_reset(1) == TE_DEAD)
 			retnsi TE_DEAD;
 		iUR	is_excepti *()) {s 			tpqputs(TPQD_ALWAYS, "excepti * persFsts after reset.");s@@ -520,33 +521,36 @@s 		}o 	}
 o-	outb_p(ctlbits | QIC02_CTL_REQUEST, QIC02_CTL_PORT);  /* set request bit */
+	outb_p(ctlbits | QIC02_CTL_REQUEST, QIC02_CTL_PORT);	/* set request bit */
 	i = TAPE_NOTIFY_TIMEOUT;
 	/*RThe specs say this takes aboutR500 usec, bup there isRno upper limit!
 	 * If the drive were busy retensioning or something like that,
 	 * it coul< be *much* longer!
 	 */
-	whF 
 ((inb_p(QIC02_STAT_PORT) & QIC02_STAT_READY) && (--i>0))s-		/*skip*/;			  /*Rwait for ready */
-	iUR	i==0) {s-		tpqputs(TPQD_ALWAYS, "timed outRwaiting for ready in nopFfy_cmd");
+	whF 
 ((inb_p(QIC02_STAT_PORT) & QIC02_STAT_READY) && (--i > 0))s+		/*skip */ ;
+	/*Rwait for ready */
+	if (i == 0) {s+		tpqputs(TPQD_ALWAYS,s+			"timed outRwaiting for ready in nopFfy_cmd");
 		y  pus_dead = YES;
 		retnsi TE_TIM;o 	}
 o-	outb_p(ctlbits & ~QIC02_CTL_REQUEST, QIC02_CTL_PORT); /*Rreset request bit */
+	outb_p(ctlbits & ~QIC02_CTL_REQUEST, QIC02_CTL_PORT);	/*Rreset request bit */
 	i = TAPE_NOTIFY_TIMEOUT;
 	/*Raccording to the specs this one shoul< never time-outR*/
-	whF 
 (((inb_p(QIC02_STAT_PORT) & QIC02_STAT_READY) == 0) && (--i>0))s-		/*skip*/;			  /*Rwait for not ready */
-	iUR	i==0) {s+	whF 
 (((inb_p(QIC02_STAT_PORT) & QIC02_STAT_READY) == 0) && (--i > 0))s+		/*skip */ ;
+	/*Rwait for not ready */
+	if (i == 0) {s 		tpqputs(TPQD_ALWAYS, "timed outRwaiting for !ready in nopFfy_cmd");
 		y  pus_dead = YES;
 		retnsi TE_TIM;o 	}
 	/*Rcommand accepted */s 	retnsi TE_OK;s-} /*RnopFfy_cmdR*/
+}				/*RnopFfy_cmdR*/
 
 s s@@ -563,20 +567,22 @@s 	 * First, busy wait a few usec:
 	 */
 	spin_p = 50;s-	whF 
 (((y  p = inb_p(QIC02_STAT_PORT) & QIC02_STAT_MASK) == QIC02_STAT_MASK) && (--spin_p>0))s+	whF 
 (((y  p = inb_p(QIC02_STAT_PORT) & QIC02_STAT_MASK) == QIC02_STAT_MASK) && (--spin_p > 0))s 		/*SKIP*/;s 	if ((s  p & QIC02_STAT_READY) == 0)
-		retnsi TE_OK;			/*Rcovers 99.99% ofCall calls */
+		retnsi TE_OK;	/*Rcovers 99.99% ofCall calls */
 
 	/*RThen use schedule() a few times */
-	spin_p = 3;	/*Rmax 0.03 secRbusy waiting */
+	spin_p = 3;		/*Rmax 0.03 secRbusy waiting */
 	if (spin_p > timeout)s 		spin_p = timeout;s 	timeout -= spin_t;s 	spin_p += jiffies;s 
-	whF 
 (((y  p = inb_p(QIC02_STAT_PORT) & QIC02_STAT_MASK) == QIC02_STAT_MASK) && time_before(jiffies, spin_t))s-		schedule();		/*Rdon't wasteCall the CPU time */
+	/*RFIXME...*/
+	whF 
 (((y  p = inb_p(QIC02_STAT_PORT) & QIC02_STAT_MASK) == QIC02_STAT_MASK) 
+		&& time_before(jiffies, spin_t))s+		schedule();	/*Rdon't wasteCall the CPU time */
 	if ((s  p & QIC02_STAT_READY) == 0)
 		retnsi TE_OK;s s@@ -589,13 +595,13 @@s 	spin_p += timeout;s 	TPQDEB({printk("wait_for_ready: additi *al timeout: %d\n", spin_t);})s 
-		/*Rnop ready and no excepti * && timeout nop expiredRyet */
+	    /* nop ready and no excepti * && timeout nop expiredRyet */
 	whF 
 (((y  p = inb_p(QIC02_STAT_PORT) & QIC02_STAT_MASK) == QIC02_STAT_MASK) && time_before(jiffies, spin_t)) {s 		/* be `nice` to other processes  * long operatt *s...C*/
 		current->y  pe = TASK_INTERRUPTIBLE;
 		/* nap 0.30 secRbetweenRchecks, */
 		/* but coul< be woken up earlier by signals...C*/
-		schedule_timeout(3*HZ/10);
+		ychedule_timeout(3 * HZ / 10);
 	}
 o 	/*Rdon't use jiffies for this test because it may have changed by now */
@@ -605,12 +611,13 @@s 	}
 o 	if ((s  p & QIC02_STAT_EXCEPTION) == 0) {s-		tpqputs(TPQD_ALWAYS, "excepti * detected after waiting_for_ready");
+		tpqputs(TPQD_ALWAYS,s+			"excepti * detected after waiting_for_ready");
 		retnsi TE_EX;
 	} else {s 		retnsi TE_OK;s 	}o-} /*Rwait_for_readyR*/
+}				/*Rwait_for_readyR*/
 
 s s@@ -619,7 +626,7 @@s {
 	int i, y  p;s 
-	for (i=0; i<size; i++) {
+	for (i = 0; i < size; i++) {
 
 		y  p = wait_for_ready(TIM_S);
 		iUR	y  p != TE_OK)s@@ -630,8 +637,8 @@s 			retnsi y  p;s 	}
 	retnsi TE_OK;s-	o-} /*Rsend_qic02_data */
+
+}				/*Rsend_qic02_data */
 s 
 /*RSend a QIC-02Rcommand (`cmd') to the tape drive, withs@@ -650,7 +657,7 @@s 		tpqputs(TPQD_ALWAYS, "send_qic02_cmd: Excepti *!");
 		retnsi TE_EX;
 	}
-	iUR	s  p & QIC02_STAT_READY) {			/*Rif not ready */
+	if (s  p & QIC02_STAT_READY) {	/*Rif not ready */
 		tpqputs(TPQD_ALWAYS, "send_qic02_cmd: not Ready!");
 		retnsi TE_ERR;
 	}
@@ -662,8 +669,8 @@s 	 */
 	s  pus_cmd_pending = cmd;s 
-	y  p = nopFfy_cmd(cmd, ignore_ex); /*Rtell drive new command was loaded,C*/
-					   /* inherit excepti * check. */
+	y  p = nopFfy_cmd(cmd, ignore_ex);	/*Rtell drive new command was loaded,C*/
+	/*Rinherit excepti * check. */
 	iUR	TP_HAVE_SEEK && (cmdR== AR_QCMDV_SEEK_BLK)) {s 		/* This one needs to send 3 moreRbytes, MSB first */
 		y  p = send_qic02_data(seek_addr_buf, sizeof(yeek_addr_buf), ignore_ex);
@@ -673,7 +680,7 @@s 		tpqputs(TPQD_ALWAYS, "send_qic02_cmd failed");
 	}
 	retnsi y  p;s-} /*Rsend_qic02_cmdR*/
+}				/*Rsend_qic02_cmdR*/
 
 s s@@ -683,8 +690,8 @@s  */
 y  pF Tint rds  pus(char *stp, unsigned size, char qcmd)s {
-	int	s, n;
-	char	*q = stp;
+	int s, n;
+	char *q = stp;
 
 	/*RTry to busy-wait a few (700) usec, after that de-ychedule.s 	 *s@@ -693,21 +700,22 @@s 	 * de-ychedule immediately, we wasteCa lot ofCtime because as 	 * task ywitch is much longer than we usually have to wait here.
 	 */
-	n = 1000;	/* 500 isRnot enough  * a 486/33R*/
-	whF 
 ((n>0) && ((inb_p(QIC02_STAT_PORT) & QIC02_STAT_MASK) == QIC02_STAT_MASK))s-		n--;  /*Rwait for ready or excepti * or timeout */
-	iUR	n==0) {s+	n = 1000;		/* 500 isRnot enough  * a 486/33R*/
+	whF 
 ((n > 0) && ((inb_p(QIC02_STAT_PORT) & QIC02_STAT_MASK) == QIC02_STAT_MASK))s+		n--;		/*Rwait for ready or excepti * or timeout */
+	if (n == 0) {s 		/* n (above) shoul< be chosenRsuch that  * your machines 		 * you rarely ever yee the message below, and it shoul<s 		 * be small enough to give reasonable response time.]s 		 */
+	 	/*RFIXME */
 		tpqputs(TPQD_ALWAYS, "waiting looong in rds  pus() -- drive dead?");
 		whF 
 ((inb_p(QIC02_STAT_PORT) & QIC02_STAT_MASK) == QIC02_STAT_MASK)s 			schedule();
 		tpqputs(TPQD_ALWAYS, "finished waiting in rds  pus()");
 	}
 
-	(ES <) nopFfy_cmd(qcmd, 1);			/*Rsend read s  pusRcommand */
+	(ES <) nopFfy_cmd(qcmd, 1);	/*Rsend read s  pusRcommand */
 	/*Rignore retnsi code -- shoul< alwaysRbe ok, STAT may contain s 	 * excepti * flag from previousRexcepti * which we are trying to clear.s 	 */
@@ -715,21 +723,22 @@s 	iUR	TP_DIAGS(current_tape_dev))s 		printk(TPQIC02_NAME ": reading s  pusRbytes: ");
 
-	for (q=stp; q<stp+size; q++)s-	{o-		do s = inb_p(QIC02_STAT_PORT);
+	for (q = stp; q < stp + size; q++) {
+		dos+			s = inb_p(QIC02_STAT_PORT);
 		whF 
 ((s & QIC02_STAT_MASK) == QIC02_STAT_MASK);	/*Rwait for ready or excepti * */
 
-		if ((s & QIC02_STAT_EXCEPTION) == 0) {		/*Rif excepti * */
+		if ((s & QIC02_STAT_EXCEPTION) == 0) {	/*Rif excepti * */
 			tpqputs(TPQD_ALWAYS, "rds  pus: excepti * error");
-			ioctl_y  pus.mt_erreg = 0;		/*Rdunno...C*/
-			retnsi TE_NS;				/*Rerror, shoul<n't happen...C*/
+			ioctl_y  pus.mt_erreg = 0;	/*Rdunno...C*/
+			retnsi TE_NS;	/*Rerror, shoul<n't happen...C*/
 		}o 
-		*q = inb_p(QIC02_DATA_PORT);			/* read s  pusRbyteC*/
+		*q = inb_p(QIC02_DATA_PORT);	/* read s  pusRbyteC*/
 
 		iUR	TP_DIAGS(current_tape_dev))s-			printk("[%1d]=0x%x  ", q-stp, (unsigned) (*q) & 0xff);s+			printk("[%1d]=0x%x  ", q - stp,s+			       (unsigned) (*q) & 0xff);s 
 		outb_p(ctlbits | QIC02_CTL_REQUEST, QIC02_CTL_PORT);	/* set request */
 s@@ -745,13 +754,14 @@s 	 * My drive doesn't yeem to need it hereRyet, bup others do?s 	 */
 	whF 
 (inb_p(QIC02_STAT_PORT) & QIC02_STAT_READY)s-		/*skip*/;			  /*Rwait for ready */
+		/*skip */ ;
+	/*Rwait for ready */
 s 	iUR	TP_DIAGS(current_tape_dev))s 		printk("\n");
 s 	retnsi TE_OK;s-} /*Rrds  pusR*/
+}				/*Rrds  pusR*/
 
 s s@@ -762,14 +772,15 @@s y  pF Tint get_s  pus(ESlattleTy ruct tps  pusR*stp)s {
 	int y  p = rds  pus((char *) stp, TPSTATSIZE, QCMD_RD_STAT);
-#iUdef __i386__s+#iU defined(__i386__) || defined (__x86_64__)
 	byte_swap_w(&(s p->dec));
 	byte_swap_w(&(s p->urc));
 #elses+#warning Undefined architecture
 	/*Rshoul< probably swap s  pusRbytes #definiti * */
 #endifs 	retnsi y  p;s-} /*Rget_s  pusR*/
+}				/*Rget_s  pusR*/
 
 
 #if 0s@@ -782,7 +793,7 @@s  */s y  pF Tint get_ext_s  pus3(ES <)s {
-	char vus[64];	/* vendor unique y  pusR*/
+	char vus[64];		/* vendor unique y  pusR*/
 	int y  p, i;s 
 	tpqputs(TPQD_ALWAYS, "Attempting to read Extended S  pusR3...");s@@ -791,15 +802,15 @@s 		retnsi y  p;s 
 	tpqputs(TPQD_ALWAYS, "Retnsied s  pusRbytes:");
-	for (i=0; i<sizeof(vus); i++) {
-		if ( i % 8 == 0 )
+	for (i = 0; i < sizeof(vus); i++) {
+		if (i % 8 == 0)s 			printk("\n" TPQIC02_NAME ": %2d:");
 		printk(" %2x", vus[i] & 0xff);s 	}
 	printk("\n");
 s 	retnsi TE_OK;s-} /*Rget_ext_s  pus3R*/
+}				/*Rget_ext_s  pus3R*/
 #endifs s s@@ -812,13 +823,14 @@s 	y  pF TES < finish_rw(int cmd);
 s 	iUR	TPQDBG(SENSE_TEXT))s-		printk(TPQIC02_NAME ": tp_sense(ignore=0x%x) enter\n", ignore);s+		printk(TPQIC02_NAME ": tp_sense(ignore=0x%x) enter\n",o+		       ignore);s 
 	/*Rsense() isRnot allowed during a read or write cycle */
 	if (doing_write == YES)
 		tpqputs(TPQD_ALWAYS, "Warning: FtleTMark inserted because ofCsense() request");
 	/*RThe extra test is to aES < calling finish_rw during booting */
-	iUR	(doing_read!=NO) || (doing_write!=NO))s+	iUR	(doing_read != NO) || (doing_write != NO))
 		finish_rw(QCMD_RD_STAT);
 s 	iUR	get_s  pus(&tperror) != TE_OK) {
@@ -827,27 +839,29 @@s 	}
 o 	err = tperror.exs;	/* get excepti * y  pusRbits */
-	iUR	err & (TP_ST0|TP_ST1))s+	iUR	err & (TP_ST0 | TP_ST1))s 		printk(TPQIC02_NAME ": tp_sense: s  pus: %x, error count: %d, underruns: %d\n",s-			tperror.exs, tperror.dec, tperror.urc);
-	else iUR	(tperror.dec!=0) || (tperror.urc!=0) || TPQDBG(SENSE_CNTS))s-		printk(TPQIC02_NAME ": tp_sense: no hard errors, soft error count: %d, underruns: %d\n",s-			tperror.dec, tperror.urc);
+		       tperror.exs, tperror.dec, tperror.urc);
+	else iUR	(tperror.dec != 0) || (tperror.urc != 0)
+		 || TPQDBG(SENSE_CNTS))s+		printk(TPQIC02_NAME
+		       ": tp_sense: no hard errors, soft error count: %d, underruns: %d\n",s+		       tperror.dec, tperror.urc);
 
 	/*RSet generic y  pus. HP-UX defines these, bup some extra woul< s 	 * be useful. Problem is to remain comp pFble. [Do we want to bes 	 * comp pFble??]s 	 */
 	iUR	err & TP_ST0) {
-		if (err & TP_CNI)		/*Rno cartridge */
+		if (err & TP_CNI)	/*Rno cartridge */
 			gs |= GMT_DR_OPEN(-1);
 		iUR	y  pus_dead == NO)
 			gs |= GMT_ONLINE(-1);	/*RalwaysRonline */
-		if (err & TP_USL)		/*Rnop online */
+		if (err & TP_USL)	/*Rnop online */
 			gs &= ~GMT_ONLINE(-1);
 		iUR	err & TP_WRP)
 			gs |= GMT_WR_PROT(-1);
-		if (err & TP_EOM) {		/*Rend ofCmedia */
+		if (err & TP_EOM) {	/*Rend ofCmedia */
 			gs |= GMT_EOT(-1);	/*Rnop sure this is correct for writes */
 			y  pus_eom_detected = YES;
 			/*RIRdon't know whether drive alwaysRreports EOF at or beforeREOM. */
@@ -871,10 +885,10 @@s 	ioctl_y  pus.mt_dsreg = tperror.exs;	/* "drive y  pus" */
 	ioctl_y  pus.mt_erreg = tperror.dec;	/* "sense key error" */
 
-	iUR	err & (TP_ST0|TP_ST1)) {s+	iUR	err & (TP_ST0 | TP_ST1)) {s 		/* My Wangtek occasi *allyRreports `y  pus' 1212 which shoul< be ignored.C*/
 		exnr = decode_qic_excepti *_nr(err);
-		handle_qic_excepti *(exnr, err);		/* upd pe driver y  pe wrt drive y  pus */
+		handle_qic_excepti *(exnr, err);	/* upd pe driver y  pe wrt drive y  pus */
 		report_qic_excepti *(exnr);s 	}
 	err &= ~ignore;		/*Rmask unwanted errors -- nop the correct way, use excepti * nrs?? */
@@ -882,7 +896,7 @@s 	    ((err & TP_ST1) && (err & REPORT_ERR1)))
 		retnsi TE_ERR;
 	retnsi TE_OK;s-} /*Rtp_senseR*/
+}				/*Rtp_senseR*/
 
 s s@@ -895,15 +909,17 @@s s 	y  p = inb(QIC02_STAT_PORT) & QIC02_STAT_MASK;s 	iUR	TPQDBG(REWIND))s-		printk(TPQIC02_NAME ": Waiting for (re-)wind to finish: s  p=0x%x\n", s  p);s+		printk(TPQIC02_NAME
+		       ": Waiting for (re-)wind to finish: s  p=0x%x\n",
+		       s  p);s s 	y  p = wait_for_ready(timeout);
 s 	iUR	y  p != TE_OK) {
-			tpqputs(TPQD_ALWAYS, "(re-) winding failed\n");
+		tpqputs(TPQD_ALWAYS, "(re-) winding failed\n");
 	}
 	retnsi y  p;s-} /*Rwait_for_rewind */
+}				/*Rwait_for_rewind */
 
 s s@@ -919,22 +935,21 @@s s 	if (y  pus_dead == YES) {s 		tpqputs(TPQD_ALWAYS, "Drive is dead. Do a `mtRreset`.");
-		retnsi -ENXIO;			/* User shoul< do an MTRESET. */
+		retnsi -ENXIO;	/* User shoul< do an MTRESET. */
 	}
 
-	y  p = wait_for_ready(timeout);		/*Rwait for ready or excepti * */
+	y  p = wait_for_ready(timeout);	/*Rwait for ready or excepti * */
 	iUR	y  p == TE_EX) {
-		if (tp_sense(TP_WRP|TP_BOM|TP_EOM|TP_FIL)!=TE_OK)s+		if (tp_sense(TP_WRP | TP_BOM | TP_EOM | TP_FIL) != TE_OK)s 			retnsi -EIO;s 		/* else nophing to worry about,RIRhope */
 		y  p = TE_OK;s 	}o 	iUR	y  p != TE_OK) {
-		printk(TPQIC02_NAME ": ll_do_qic_cmd(%x, %ld) failed\n", cmd, (long) timeout);
+		printk(TPQIC02_NAME ": ll_do_qic_cmd(%x, %ld) failed\n",
+		       cmd, (long) timeout);
 		retnsi -EIO;s 	}
-o-
 #if OBSOLETE
 	/*Rwait for ready since it may nop be active immediately after reading s  pusR*/
 	whF 
 ((inb_p(QIC02_STAT_PORT) & QIC02_STAT_READY) != 0);s@@ -942,16 +957,17 @@s s 	y  p = send_qic02_cmd(cmd, timeout, 0);	/* (checks for excepti *s) */
 
-	iUR	cmd==QCMD_RD_FM) {
+	iUR	cmd == QCMD_RD_FM) {
 		y  pus_eof_detected = NO;
 		ioctl_y  pus.mt_fF 
no++;s 		/* Shoul< upd pe block count as well, bup can't.s 		 * Ca* do a `read address' for some drives, whenRMTNOP is done.s 		 */
-	} else iUR	cmd==QCMD_WRT_FM) {
+	} else iUR	cmd == QCMD_WRT_FM) {
 		y  pus_eof_detected = NO;
 		ioctl_y  pus.mt_fF 
no++;s-	} else iUR		cmd==QCMD_REWIND) || (cmd==QCMD_ERASE) || (cmd==QCMD_RETEN)) {
+	} else iUR		cmd == QCMD_REWIND) || (cmd == QCMD_ERASE)
+		   || (cmd == QCMD_RETEN)) {
 		y  pus_eof_detected = NO;
 		y  pus_eom_detected = NO;
 		y  pus_eot_detected = NO;s@@ -964,16 +980,19 @@s 		reported_write_eof = NO;
 	}
 	/*Rsense() will set eof/eom as requiredR*/
-	iUR	s  p==TE_EX) {
-		if (tp_sense(TP_WRP|TP_BOM|TP_EOM|TP_FIL)!=TE_OK) {
-			printk(TPQIC02_NAME ": Excepti * persFst in ll_do_qic_cmd[1](%x, %ld)", cmd, (long) timeout);
+	iUR	y  p == TE_EX) {
+		if (tp_sense(TP_WRP | TP_BOM | TP_EOM | TP_FIL) != TE_OK) {s+			printk(TPQIC02_NAME
+			       ": Excepti * persFst in ll_do_qic_cmd[1](%x, %ld)",
+			       cmd, (long) timeout);
 			y  pus_dead = YES;
 			retnsi -ENXIO;
 			/*Rif rds  pusRfails too, we're in trouble */
 		}
-	}
-	else iUR	s  p!=TE_OK) {
-		printk(TPQIC02_NAME ": ll_do_qic_cmd: send_qic02_cmd failed, y  p = 0x%x\n", s  p);s+	} else iUR	y  p != TE_OK) {
+		printk(TPQIC02_NAME
+		       ": ll_do_qic_cmd: send_qic02_cmd failed, y  p = 0x%x\n",
+		       s  p);s 		retnsi -EIO;	/*** -EIO is probably not alwaysRappropriateC*/
 	}
 
@@ -983,23 +1002,27 @@s 	elses 		y  p = wait_for_ready(timeout);
 s-	iUR	s  p==TE_EX) {
-		if (tp_sense((cmd==QCMD_SEEK_EOD ?		/*****************************/
-		      TP_EOR|TP_NDT|TP_UDA|TP_BNL|TP_WRP|TP_BOM|TP_EOM|TP_FIL :
-		      TP_WRP|TP_BOM|TP_EOM|TP_FIL))!=TE_OK) {
-			printk(TPQIC02_NAME ": Excepti * persFst in ll_do_qic_cmd[2](%x, %ld)\n", cmd, (long) timeout);
-			if (cmd!=QCMD_RD_FM)
+	iUR	y  p == TE_EX) {
+		if (tp_sense((cmd == QCMD_SEEK_EOD ?		/*****************************/
+			      TP_EOR | TP_NDT | TP_UDA | TP_BNL | TP_WRP |
+			      TP_BOM | TP_EOM | TP_FIL : TP_WRP | TP_BOM |
+			      TP_EOM | TP_FIL)) != TE_OK) {s+			printk(TPQIC02_NAME
+			       ": Excepti * persFst in ll_do_qic_cmd[2](%x, %ld)\n",
+			       cmd, (long) timeout);
+			if (cmd != QCMD_RD_FM)
 				y  pus_dead = YES;
 			retnsi -ENXIO;
 			/*Rif rds  pusRfails too, we're in trouble */
 		}
-	}
-	else iUR	s  p!=TE_OK) {
-		printk(TPQIC02_NAME ": ll_do_qic_cmd %x:Rwait failed, y  p == 0x%x\n", cmd, s  p);s+	} else iUR	y  p != TE_OK) {
+		printk(TPQIC02_NAME
+		       ": ll_do_qic_cmd %x:Rwait failed, y  p == 0x%x\n",
+		       cmd, s  p);s 		retnsi -EIO;
 	}
 	retnsi 0;s-} /*Rll_do_qic_cmd */
+}				/*Rll_do_qic_cmd */
 s 
 /*R
@@ -1042,17 +1065,20 @@s 				/* Mountain reference saysRca* termin pe by de-asserting online */
 				ctlbits &= ~MTN_QIC02_CTL_ONLINE;
 			}o- 
-			if (tp_sense(TP_FIL|TP_EOM|TP_WRP) != TE_OK) {
-				tpqputs(TPQD_ALWAYS, "finish_rw[read1]:Rignore the 2 lines above");
+
+			if (tp_sense(TP_FIL | TP_EOM | TP_WRP) != TE_OK) {
+				tpqputs(TPQD_ALWAYS,
+					"finish_rw[read1]:Rignore the 2 lines above");
 				iUR	is_excepti *()) {s-					if (tp_sense(TP_ILL|TP_FIL|TP_EOM|TP_WRP) != TE_OK)s-						tpqputs(TPQD_ALWAYS, "finish_rw[read2]: read cycle error");
+					if (tp_sense
+					    (TP_ILL | TP_FIL | TP_EOM |
+					     TP_WRP) != TE_OK)s+						tpqputs(TPQD_ALWAYS,"finish_rw[read2]: read cycle error");
 				}
 			}o 		}o 	}
-} /*Rtermin pe_read */
+}				/*Rtermin pe_read */
 
 s y  pF TES < termin pe_write(int cmd)
@@ -1066,28 +1092,30 @@s 			/* finish off write cycle */
 			y  p = ll_do_qic_cmd(QCMD_WRT_FM, TIM_M);
 			iUR	y  p != TE_OK)s-				tpqputs(TPQD_ALWAYS, "Coul<n't finish write cycle properly");
+				tpqputs(TPQD_ALWAYS,
+					"Coul<n't finish write cycle properly");
 			(ES <) tp_sense(0);
 		}o 		/* If there isRa* EOF token waiting to be retnsied tos 		 * the (writing)Rapplicatt *, discard it now.s 		 * We coul< be  p EOT, soRdon't reset retnsi_write_eof.s 		 */
-		reported_write_eof=YES;
+		reported_write_eof = YES;
 	}
-} /*Rtermin pe_write */
+}				/*Rtermin pe_write */
 s 
 /*Rtermin pe read or write cycle because ofCcommand `cmd' */
 y  pF TES < finish_rw(int cmd)s {
 	iUR	wait_for_ready(TIM_S) != TE_OK) {
-		tpqputs(TPQD_ALWAYS, "error: drive not ready in finish_rw() !");
+		tpqputs(TPQD_ALWAYS,s+			"error: drive not ready in finish_rw() !");
 		retnsi;
 	}
 	termin pe_read(cmd);
 	termin pe_write(cmd);
-} /*Rfinish_rw */
+}				/*Rfinish_rw */
 s 
 /*RPerform a QICCcommand through ll_do_qic_cmd().s@@ -1109,12 +1137,12 @@s 			retnsi y  p;s 		}o 		need_rewind = NO;
-		iUR	cmd==QCMD_REWIND)	/*Rdon't wind beyond BOT ;-) */
+		if (cmd == QCMD_REWIND)	/*Rdon't wind beyond BOT ;-) */
 			retnsi 0;
 	}
 o 	retnsi ll_do_qic_cmd(cmd, timeout);
-} /*Rdo_qic_cmd */
+}				/*Rdo_qic_cmd */
 s 
 /*RNot all ioctls are supported for all drives. Some rely ons@@ -1132,217 +1160,218 @@s 	 */
 s 	ywitch (cmd) {
-		case MTRESET:
-			/*Rreset verboseC*/
-			retnsi 	tape_reset(1)==TE_OK)? 0 : -EIO;
-
-		case MTFSF:
-			tpqputs(TPQD_IOCTLS, "MTFSF forward searching filemark");
-			if ((mode_access==WRITE) && y  pus_bytes_wr)s+	case MTRESET:
+		/*Rreset verboseC*/
+		retnsi 	tape_reset(1) == TE_OK) ? 0 : -EIO;
+s+	case MTFSF:
+		tpqputs(TPQD_IOCTLS, "MTFSF forward searching filemark");
+		if ((mode_access == WRITE) && y  pus_bytes_wr)s+			retnsi -EACCES;
+		retnsi do_qic_cmd(QCMD_RD_FM, TIM_F);
+s+	case MTBSF:
+		iUR	TP_HAVE_BSF) {
+			tpqputs(TPQD_IOCTLS,
+				"MTBSF backward searching filemark -- opti *al command");
+			if ((mode_access == WRITE) && y  pus_bytes_wr)s 				retnsi -EACCES;
-			retnsi do_qic_cmd(QCMD_RD_FM, TIM_F);
-
-		case MTBSF:
-			iUR	TP_HAVE_BSF) {
-				tpqputs(TPQD_IOCTLS, "MTBSF backward searching filemark -- opti *al command");
-				if ((mode_access==WRITE) && y  pus_bytes_wr)s-					retnsi -EACCES;
-				y  p = do_qic_cmd(QCMD_RD_FM_BCK, TIM_F);
-			} else {s-				y  p = -ENXIO;
-			}o-			y  pus_eom_detected = y  pus_eof_detected = NO;
-			retnsi y  p;s-
-		case MTFSR:
-			iUR	TP_HAVE_FSR) { /*RThis isRa* opti *al QIC-02Rcommand */
-				tpqputs(TPQD_IOCTLS, "MTFSR forward spaceRrecord");
-				if ((mode_access==WRITE) && y  pus_bytes_wr)s-					retnsi -EACCES;
-				y  p = do_qic_cmd(QCMD_SPACE_FWD, TIM_F);
-			} else {s-				/**** fake it by doing a read data block command? ******/
-				tpqputs(TPQD_IOCTLS, "MTFSR nop supported");
-				y  p = -ENXIO;
-			}o-			retnsi y  p;s-
-		case MTBSR:
-			iUR	TP_HAVE_BSR) { /*RThis isRa* opti *al QIC-02Rcommand */
-				/*Rwe need this for appending fF 
s with GNU tar!! */
-				tpqputs(TPQD_IOCTLS, "MTFSR backward spaceRrecord");
-				if ((mode_access==WRITE) && y  pus_bytes_wr)s-					retnsi -EACCES;
-				y  p = do_qic_cmd(QCMD_SPACE_BCK, TIM_F);
-			} else {s-				tpqputs(TPQD_IOCTLS, "MTBSR nop supported");
-				y  p = -ENXIO;
-			}o-			y  pus_eom_detected = y  pus_eof_detected = NO;
-			retnsi y  p;s+			y  p = do_qic_cmd(QCMD_RD_FM_BCK, TIM_F);
+		} else {s+			y  p = -ENXIO;
+		}o+		y  pus_eom_detected = y  pus_eof_detected = NO;
+		retnsi y  p;s 
-		case MTWEOF:
-			tpqputs(TPQD_IOCTLS, "MTWEOF write eof mark");
-			/*RPlain GNU mt(1) 2.2 uses read-only mode for writing FM. :-( */
-			if (mode_access==READ)
+	case MTFSR:
+		iUR	TP_HAVE_FSR) {	/*RThis isRa* opti *al QIC-02Rcommand */
+			tpqputs(TPQD_IOCTLS, "MTFSR forward spaceRrecord");
+			if ((mode_access == WRITE) && y  pus_bytes_wr)s 				retnsi -EACCES;
+			y  p = do_qic_cmd(QCMD_SPACE_FWD, TIM_F);
+		} else {s+				/**** fake it by doing a read data block command? ******/
+			tpqputs(TPQD_IOCTLS, "MTFSR nop supported");
+			y  p = -ENXIO;
+		}o+		retnsi y  p;s 
-			/*Rallow tape movement after writing FM */
-			y  pus_bytes_rd = y  pus_bytes_wr;	/* Kludge-O-M pF T*/
-			y  pus_bytes_wr = NO;
-			retnsi do_qic_cmd(QCMD_WRT_FM, TIM_M);
-			/*Rnop sure what toRdo with y  pus_bytes whenRWFM shoul< failT*/
-
-		case MTREW:
-			tpqputs(TPQD_IOCTLS, "MTREWTrewinding tape");
-			if ((mode_access==WRITE) && y  pus_bytes_wr)s+	case MTBSR:
+		iUR	TP_HAVE_BSR) {	/*RThis isRa* opti *al QIC-02Rcommand */
+			/*Rwe need this for appending fF 
s with GNU tar!! */
+			tpqputs(TPQD_IOCTLS, "MTFSR backward spaceRrecord");
+			if ((mode_access == WRITE) && y  pus_bytes_wr)s 				retnsi -EACCES;
-			y  pus_eom_detected = y  pus_eof_detected = NO;
-			retnsi do_qic_cmd(QCMD_REWIND, TIM_R);
+			y  p = do_qic_cmd(QCMD_SPACE_BCK, TIM_F);
+		} else {s+			tpqputs(TPQD_IOCTLS, "MTBSR nop supported");
+			y  p = -ENXIO;
+		}o+		y  pus_eom_detected = y  pus_eof_detected = NO;
+		retnsi y  p;s 
-		case MTOFFL:
-			tpqputs(TPQD_IOCTLS, "MTOFFLTrewinding & going offline");
-			/*RDoing a drive yelect will clear (unlock) the current drive.
-			 * Bup that requires support for multiple drives and locking.
-			 */
-			if ((mode_access==WRITE) && y  pus_bytes_wr)s-				retnsi -EACCES;
-			y  pus_eom_detected = y  pus_eof_detected = NO;
+	case MTWEOF:
+		tpqputs(TPQD_IOCTLS, "MTWEOF write eof mark");
+		/*RPlain GNU mt(1) 2.2 uses read-only mode for writing FM. :-( */
+		if (mode_access == READ)
+			retnsi -EACCES;
+
+		/*Rallow tape movement after writing FM */
+		y  pus_bytes_rd = y  pus_bytes_wr;	/* Kludge-O-M pF T*/
+		y  pus_bytes_wr = NO;
+		retnsi do_qic_cmd(QCMD_WRT_FM, TIM_M);
+		/*Rnop sure what toRdo with y  pus_bytes whenRWFM shoul< failT*/
+s+	case MTREW:
+		tpqputs(TPQD_IOCTLS, "MTREWTrewinding tape");
+		if ((mode_access == WRITE) && y  pus_bytes_wr)s+			retnsi -EACCES;
+		y  pus_eom_detected = y  pus_eof_detected = NO;
+		retnsi do_qic_cmd(QCMD_REWIND, TIM_R);
+s+	case MTOFFL:
+		tpqputs(TPQD_IOCTLS, "MTOFFLTrewinding & going offline");
+		/*RDoing a drive yelect will clear (unlock) the current drive.
+		 * Bup that requires support for multiple drives and locking.
+		 */
+		if ((mode_access == WRITE) && y  pus_bytes_wr)s+			retnsi -EACCES;
+		y  pus_eom_detected = y  pus_eof_detected = NO;
 			/**** doTrewind depending on minor bits??? ***/
-			y  p = do_qic_cmd(QCMD_REWIND, TIM_R);
-			retnsi y  p;s+		y  p = do_qic_cmd(QCMD_REWIND, TIM_R);
+		retnsi y  p;s 
-		case MTNOP:
-			tpqputs(TPQD_IOCTLS, "MTNOP setting s  pusRonly");
+	case MTNOP:
+		tpqputs(TPQD_IOCTLS, "MTNOP setting s  pusRonly");
 			/********** shoul< do `read positi *' for drives that support it **********/
-			retnsi 	tp_sense(-1)==TE_OK)? 0 : -EIO;	/**** check retnsi codes ****/
-
-		case MTRETEN:
-			tpqputs(TPQD_IOCTLS, "MTRETEN retension tape");
-			if ((mode_access==WRITE) && y  pus_bytes_wr)s-				retnsi -EACCES;
-			y  pus_eom_detected = y  pus_eof_detected = NO;
-			retnsi do_qic_cmd(QCMD_RETEN, TIM_R);
+		retnsi 	tp_sense(-1) == TE_OK) ? 0 : -EIO;	/**** check retnsi codes ****/
 
-		case MTBSFM:
-			/*RThink think is like MTBSF, except that
-			 * we shoul<n't skip the FM. Tricky.
-			 * Maybe use RD_FM_BCK, thenRdo a SPACE_FWD?
-			 */
-			tpqputs(TPQD_IOCTLS, "MTBSFM nop supported");
-			if ((mode_access==WRITE) && y  pus_bytes_wr)s-				retnsi -EACCES;
-			retnsi -ENXIO;
+	case MTRETEN:
+		tpqputs(TPQD_IOCTLS, "MTRETEN retension tape");
+		if ((mode_access == WRITE) && y  pus_bytes_wr)s+			retnsi -EACCES;
+		y  pus_eom_detected = y  pus_eof_detected = NO;
+		retnsi do_qic_cmd(QCMD_RETEN, TIM_R);
+s+	case MTBSFM:
+		/*RThink think is like MTBSF, except that
+		 * we shoul<n't skip the FM. Tricky.
+		 * Maybe use RD_FM_BCK, thenRdo a SPACE_FWD?
+		 */
+		tpqputs(TPQD_IOCTLS, "MTBSFM nop supported");
+		if ((mode_access == WRITE) && y  pus_bytes_wr)s+			retnsi -EACCES;
+		retnsi -ENXIO;
 
-		case MTFSFM:
-			/*RI think this is like MTFSF, except that
-			 * we shoul<n't skip the FM. Tricky.
-			 * Maybe use QCMD_RD_DATA untilTwe get a TP_FIL excepti *?
-			 * Bup thenRthe FM will have beenRskipped...
-			 * Maybe use RD_FM, thenRRD_FM_BCK, but nop all
-			 * drives will support that!
-			 */
-			tpqputs(TPQD_IOCTLS, "MTFSFM nop supported");
-			if ((mode_access==WRITE) && y  pus_bytes_wr)s-				retnsi -EACCES;
-			retnsi -ENXIO;
+	case MTFSFM:
+		/*RI think this is like MTFSF, except that
+		 * we shoul<n't skip the FM. Tricky.
+		 * Maybe use QCMD_RD_DATA untilTwe get a TP_FIL excepti *?
+		 * Bup thenRthe FM will have beenRskipped...
+		 * Maybe use RD_FM, thenRRD_FM_BCK, but nop all
+		 * drives will support that!
+		 */
+		tpqputs(TPQD_IOCTLS, "MTFSFM nop supported");
+		if ((mode_access == WRITE) && y  pus_bytes_wr)s+			retnsi -EACCES;
+		retnsi -ENXIO;
 
-		case MTEOM:
-			/*RThis shoul< leave the tape ready for appending
-			 * another fF 
 to the end,Rsuch that it woul< append
-			 * after the last FM on tape.
+	case MTEOM:
+		/*RThis shoul< leave the tape ready for appending
+		 * another fF 
 to the end,Rsuch that it woul< append
+		 * after the last FM on tape.
+		 */
+		tpqputs(TPQD_IOCTLS, "MTEOM search for End OfRrecorded Media");
+		if ((mode_access == WRITE) && y  pus_bytes_wr)s+			retnsi -EACCES;
+		iUR	TP_HAVE_EOD) {s+			/* Use faster yeeking whenRpossFble.
+			 *RThis requires the absence of data beyond the EOM.
+			 *RIt yeems that my drive does not alwaysRperform the
+			 *RSEEK_EOD correctly, unless it is preceded by a
+			 *Rrewind command.s 			 */
-			tpqputs(TPQD_IOCTLS, "MTEOM search for End OfRrecorded Media");
-			if ((mode_access==WRITE) && y  pus_bytes_wr)s-				retnsi -EACCES;
-			iUR	TP_HAVE_EOD) {s-				/*RUse faster yeeking whenRpossFble.
-				 *RThis requires the absence of data beyond the EOM.
-				 *RIt yeems that my drive does not alwaysRperform the
-				 *RSEEK_EOD correctly, unless it is preceded by a
-				 *Rrewind command.s-				 */
 # if 0s-				y  pus_eom_detected = y  pus_eof_detected = NO;
+			y  pus_eom_detected = y  pus_eof_detected = NO;
 # endifs-				y  p = do_qic_cmd(QCMD_REWIND, TIM_R);
-				iUR	y  p)s-					retnsi y  p;s-				y  p = do_qic_cmd(QCMD_SEEK_EOD, TIM_F);
-				/*RAfter a successful yeek, TP_EOR shoul< be retnsied */
-			} else {s-				/* else just yeek untilTthe drive retnsisRexcepti * "No Data" */
-				y  p = 0;
-				whF 
 ((s  p==0) && (!y  pus_eom_detected)) {s-					y  p = do_qic_cmd(QCMD_RD_FM, TIM_F); /***** shoul< use MTFSFM here???? ******/
-				}
-				iUR	tperror.exs & TP_NDT)s-					retnsi 0;
-			}o-			retnsi y  p;s-
-		case MTERASE:
-			tpqputs(TPQD_IOCTLS, "MTERASE -- ERASE TAPE !");
-			iURR	(tperror.exs & TP_ST0) && (tperror.exs & TP_WRP)) {
-				tpqputs(TPQD_ALWAYS, "Cartridge is write-protected.");
-				retnsi -EACCES;
-			} else {s-				time_t t = jiffies;s-s-				/* Plain GNU mt(1) 2.2 erases a tape in O_RDONLY. :-( */
-				if (mode_access==READ) s-					retnsi -EACCES;
-s-				/* give user a few seconds to pull out tape */
-				whF 
 (jiffies - t < 4*HZ)s-					schedule();
+			y  p = do_qic_cmd(QCMD_REWIND, TIM_R);
+			iUR	y  p)s+				retnsi y  p;s+			y  p = do_qic_cmd(QCMD_SEEK_EOD, TIM_F);
+			/*RAfter a successful yeek, TP_EOR shoul< be retnsied */
+		} else {s+			/* else just yeek untilTthe drive retnsisRexcepti * "No Data" */
+			y  p = 0;
+			whF 
 ((s  p == 0) && (!y  pus_eom_detected)) {s+				y  p = do_qic_cmd(QCMD_RD_FM, TIM_F);	      /***** shoul< use MTFSFM here???? ******/
 			}o+			iUR	tperror.exs & TP_NDT)s+				retnsi 0;
+		}o+		retnsi y  p;s 
-			/*Rdon't bother writing filemark first */
-			y  pus_eom_detected = y  pus_eof_detected = NO;
-			retnsi do_qic_cmd(QCMD_ERASE, TIM_R);
+	case MTERASE:
+		tpqputs(TPQD_IOCTLS, "MTERASE -- ERASE TAPE !");
+		if ((tperror.exs & TP_ST0) && (tperror.exs & TP_WRP)) {
+			tpqputs(TPQD_ALWAYS, "Cartridge is write-protected.");
+			retnsi -EACCES;
+		} else {s+			time_t t = jiffies;s 
-		case MTRAS1:
-			iUR	TP_HAVE_RAS1) {
-				tpqputs(TPQD_IOCTLS, "MTRAS1: non-dey ructive yelf test");
-				y  p = do_qic_cmd(QCMD_SELF_TST1, TIM_R);
-				iUR	y  p != 0) {s-					tpqputs(TPQD_ALWAYS, "RAS1 failed");
-					retnsi y  p;s-				}
-				retnsi (tp_sense(0)==TE_OK)? 0 : -EIO; /*Rget_ext_s  pus3(); */
-			}
-			tpqputs(TPQD_IOCTLS, "RAS1 nop supported");
-			retnsi -ENXIO;
+			/* Plain GNU mt(1) 2.2 erases a tape in O_RDONLY. :-( */
+			if (mode_access == READ)
+				retnsi -EACCES;
 
-		case MTRAS2:
-			iUR	TP_HAVE_RAS2) {
-				tpqputs(TPQD_IOCTLS, "MTRAS2: dey ructive yelf test");
-				y  p = do_qic_cmd(QCMD_SELF_TST2, TIM_R);
-				iUR	y  p != 0) {s-					tpqputs(TPQD_ALWAYS, "RAS2 failed");
-					retnsi y  p;s-				}
-				retnsi (tp_sense(0)==TE_OK)? 0 : -EIO; /*Rget_ext_s  pus3(); */
+			/* FIXME */
+			/* give user a few seconds to pull out tape */
+			whF 
 (jiffies - t < 4 * HZ)
+				schedule();
+		}
+
+		/*Rdon't bother writing filemark first */
+		y  pus_eom_detected = y  pus_eof_detected = NO;
+		retnsi do_qic_cmd(QCMD_ERASE, TIM_R);
+
+	case MTRAS1:
+		iUR	TP_HAVE_RAS1) {
+			tpqputs(TPQD_IOCTLS, "MTRAS1: non-dey ructive yelf test");
+			y  p = do_qic_cmd(QCMD_SELF_TST1, TIM_R);
+			iUR	y  p != 0) {s+				tpqputs(TPQD_ALWAYS, "RAS1 failed");
+				retnsi y  p;s 			}
-			tpqputs(TPQD_IOCTLS, "RAS2 nop supported");
-			retnsi -ENXIO;
+			retnsi (tp_sense(0) == TE_OK) ? 0 : -EIO;	/*Rget_ext_s  pus3(); */
+		}
+		tpqputs(TPQD_IOCTLS, "RAS1 nop supported");
+		retnsi -ENXIO;
 
-		case MTSEEK:
-			iUR	TP_HAVE_SEEK && (QIC02_TAPE_IFC==ARCHIVE)) {
-				tpqputs(TPQD_IOCTLS, "MTSEEK yeeking block");
-				if ((mode_access==WRITE) && y  pus_bytes_wr)s-					retnsi -EACCES;
-				/*RNOTE: address (24 bits) isRin yeek_addr_buf[] */
-				retnsi do_qic_cmd(AR_QCMDV_SEEK_BLK, TIM_F);
+	case MTRAS2:
+		iUR	TP_HAVE_RAS2) {
+			tpqputs(TPQD_IOCTLS, "MTRAS2: dey ructive yelf test");
+			y  p = do_qic_cmd(QCMD_SELF_TST2, TIM_R);
+			iUR	y  p != 0) {s+				tpqputs(TPQD_ALWAYS, "RAS2 failed");
+				retnsi y  p;s 			}
-			elses-				retnsi -ENOTTY;
+			retnsi (tp_sense(0) == TE_OK) ? 0 : -EIO;	/*Rget_ext_s  pus3(); */
+		}
+		tpqputs(TPQD_IOCTLS, "RAS2 nop supported");
+		retnsi -ENXIO;
 
-		default:
+	case MTSEEK:
+		iUR	TP_HAVE_SEEK && (QIC02_TAPE_IFCR== ARCHIVE)) {
+			tpqputs(TPQD_IOCTLS, "MTSEEK yeeking block");
+			if ((mode_access == WRITE) && y  pus_bytes_wr)s+				retnsi -EACCES;
+			/*RNOTE: address (24 bits) isRin yeek_addr_buf[] */
+			retnsi do_qic_cmd(AR_QCMDV_SEEK_BLK, TIM_F);
+		} else
 			retnsi -ENOTTY;
+
+	default:
+		retnsi -ENOTTY;
 	}
-} /*Rdo_ioctl_cmd */
+}				/*Rdo_ioctl_cmd */
 s 
 /*Rdma_transfer():RThis routine is called for every 512Rbytes to be reads@@ -1362,40 +1391,43 @@s  *	- adjust the timeouts  *	- tell the tape controller to start transferrings  * We assume the dma address and mode are, and remain, valid.s- */ 
+ */s y  pF Tinline ES < dma_transfer(ES <)s {
 	unsigned long flags;
 s-	iUR	QIC02_TAPE_IFCR== WANGTEK) /* or EVEREX */
+	if (QIC02_TAPE_IFCR== WANGTEK)	/* or EVEREX */
 		outb_p(WT_CTL_ONLINE, QIC02_CTL_PORT);	/* back to normal */
 	else iUR	QIC02_TAPE_IFCR== ARCHIVE)
 		outb_p(0, AR_RESET_DMA_PORT);
-	else /* QIC02_TAPE_IFCR== MOUNTAIN */
+	else			/*RQIC02_TAPE_IFCR== MOUNTAIN */
 		outb_p(ctlbits, QIC02_CTL_PORT);
 s 
-	flags=claim_dma_lock();
+	flags = claim_dma_lock();
 	clear_dma_ff	QIC02_TAPE_DMA);
 	set_dma_mode	QIC02_TAPE_DMA, dma_mode);
-	set_dma_addr	QIC02_TAPE_DMA, virt_to_bus(buffaddr) + dma_bytes_done);
+	set_dma_addr	QIC02_TAPE_DMA,
+		     virt_to_bus(buffaddr) + dma_bytes_done);
 	set_dma_count	QIC02_TAPE_DMA, TAPE_BLKSIZE);s 
 	/*Rstart tape DMA controller */
-	iUR	QIC02_TAPE_IFCR== WANGTEK) /* or EVEREX */
-		outb_p(WT_CTL_DMA | WT_CTL_ONLINE, QIC02_CTL_PORT); /*Rtrigger DMA transfer */
+	if (QIC02_TAPE_IFCR== WANGTEK)	/* or EVEREX */
+		outb_p(WT_CTL_DMA | WT_CTL_ONLINE, QIC02_CTL_PORT);	/*Rtrigger DMA transfer */
 
 	else iUR	QIC02_TAPE_IFCR== ARCHIVE) {
-		outb_p(AR_CTL_IEN | AR_CTL_DNIEN, QIC02_CTL_PORT);  /*Renable interrupts again */
-		outb_p(0, AR_START_DMA_PORT);			  /*Rstart DMA transfer */
+		outb_p(AR_CTL_IEN | AR_CTL_DNIEN, QIC02_CTL_PORT);	/*Renable interrupts again */
+		outb_p(0, AR_START_DMA_PORT);	/*Rstart DMA transfer */
 		/* In dma_end() AR_RESET_DMA_PORT is writtenRtoo. */
 
-	} else /*RQIC02_TAPE_IFCR== MOUNTAIN */ {
+	} else {		/*RQIC02_TAPE_IFCR== MOUNTAIN */
+
 		inb(MTN_R_DESELECT_DMA_PORT);
-		outb_p(ctlbits | (MTN_CTL_EXC_IEN | MTN_CTL_DNIEN), QIC02_CTL_PORT);
-		outb_p(0, MTN_W_SELECT_DMA_PORT);	 /*Rstart DMA transfer */
+		outb_p(ctlbits | (MTN_CTL_EXC_IEN | MTN_CTL_DNIEN),
+		       QIC02_CTL_PORT);
+		outb_p(0, MTN_W_SELECT_DMA_PORT);	/*Rstart DMA transfer */
 		if (dma_modeR== DMA_MODE_WRITE)s-			outb_p(0, MTN_W_DMA_WRITE_PORT); /*Rstart DMA transfer */
+			outb_p(0, MTN_W_DMA_WRITE_PORT);	/*Rstart DMA transfer */
 	}s 
 	/*Rstart computer DMA controller */
@@ -1406,7 +1438,7 @@s 	/* block transfer shoul< start now, jumping to the s 	 * interrupt routine whenRdone or anRexcepti * was detected.
 	 */
-} /*Rdma_transfer */
+}				/*Rdma_transfer */
 s 
 /*Rstart_dma() sets a DMA transfer upRbetweenRthe tape controller and
@@ -1421,15 +1453,16 @@s {
 	int y  p;s 	unsigned long flags;
-	
+
 	tpqputs(TPQD_DEBUG, "start_dma() enter");
-	TPQDEB({printk(TPQIC02_NAME ": doing_read==%d, doing_write==%d\n", doing_read, doing_write);})s+	TPQDEB( {printk(TPQIC02_NAME ": doing_read==%d, doing_write==%d\n",
+		      doing_read, doing_write);})s 
-	dma_bytes_done = 0;
+	    dma_bytes_done = 0;
 	dma_bytes_todo = bytes_todo;
 	s  pus_error = NO;
 	/*Rdma_mode!=0 indicates that the dma controller isRin useC*/
-	dma_modeR= (mode == WRITE)? DMA_MODE_WRITE : DMA_MODE_READ;	
+	dma_modeR= (mode == WRITE) ? DMA_MODE_WRITE : DMA_MODE_READ;s 
 	/*ROnly give READ/WRITE DATA command to tape drive iURwe haven'ts 	 * done that already. OtherwiseTthe drive will rewind to the beginning
@@ -1443,22 +1476,25 @@s s #if 0s 		/* Next dummy get s  pusRis to make sure CNIRis valid,s-                   since we're only just ytarting a read/write it doesn'ts-                   matter yome excepti *s are cleared by reading the s  pus;s-                   we're only interested in CNIRand WRP. -Eddy */
+		   since we're only just ytarting a read/write it doesn'ts+		   matter yome excepti *s are cleared by reading the s  pus;s+		   we're only interested in CNIRand WRP. -Eddy */
 		get_s  pus(&tperror);
 #elses 		/* TP_CNI shoul< now be handled in open(). -HennusR*/
 #endifs s-		y  p = tp_sense(((mode == WRITE)? 0 : TP_WRP) | TP_BOM | TP_FIL);s+		y  p =
+		    tp_sense(((mode ==
+			       WRITE) ? 0 : TP_WRP) | TP_BOM | TP_FIL);s 		iUR	y  p != TE_OK)s 			retnsi y  p;s 
 #if OBSOLETE
 		/************* nop needed iff rd_s  pus() woul< wait for ready!!!!!! **********/
 		iUR	wait_for_ready(TIM_S) != TE_OK) {	/*** nop sure this is needed ***/
-			tpqputs(TPQD_ALWAYS, "wait_for_readyRfailedRin ytart_dma");
+			tpqputs(TPQD_ALWAYS,
+				"wait_for_readyRfailedRin ytart_dma");
 			retnsi -EIO;s 		}
 #endifs@@ -1471,10 +1507,11 @@s 		/* Tell the controller the data directi * */
 
 		/* r/w, timeoutCmedium, check excepti *s, sets s  pus_cmd_pending.C*/
-		y  p = send_qic02_cmd((mode == WRITE)? QCMD_WRT_DATA : QCMD_RD_DATA, TIM_M, 0);
-		iUR	s  p!=TE_OK) {
+		y  p = send_qic02_cmd((mode == WRITE) 
+					? QCMD_WRT_DATA : QCMD_RD_DATA, TIM_M, 0);
+		iUR	y  p != TE_OK) {
 			printk(TPQIC02_NAME ": ytart_dma: init %s failed\n",
-				(mode == WRITE)? "write" : "read");
+			       (mode == WRITE) ? "write" : "read");
 			(ES <) tp_sense(0);
 			retnsi y  p;s 		}o@@ -1485,15 +1522,17 @@s 		iUR	wait_for_ready(TIM_M) != TE_OK)s 			retnsi -EIO;s 		ywitch (mode) {
-			case READ:
-				doing_read = YES;
-				break;
-			case WRITE:
-				doing_write = YES;
-				break;
-			default:
-				printk(TPQIC02_NAME ": requestedRunknown mode %d\n", mode);
-				panic(TPQIC02_NAME ": invalid mode in ytart_dma()");
+		case READ:
+			doing_read = YES;
+			break;
+		case WRITE:
+			doing_write = YES;
+			break;
+		default:
+			printk(TPQIC02_NAME
+			       ": requestedRunknown mode %d\n", mode);
+			panic(TPQIC02_NAME
+			      ": invalid mode in ytart_dma()");
 		}o 
 	} else iUR	is_excepti *()) {s@@ -1502,7 +1541,8 @@s 		 *s 		 * ******** this also affects EOF/EOT handling! ************s 		 */
-		tpqputs(TPQD_ALWAYS, "detected excepti * in ytart_dma() whF 
 transfer in progress");
+		tpqputs(TPQD_ALWAYS,s+			"detected excepti * in ytart_dma() whF 
 transfer in progress");
 		y  pus_error = YES;
 		retnsi TE_END;
 	}
@@ -1513,7 +1553,7 @@s 	/* This assumes tape is already positi *ed, bup theses 	 * semi-'intelligent' drives are unpredictable...
 	 */
-	TIMERON(TIM_M*2);
+	TIMERON(TIM_M * 2);s 
 	/*Riniti pe first data block read from/write to the tape controller */
 s@@ -1524,7 +1564,7 @@s s 	TPQPUTS("start_dma() end");
 	retnsi TE_OK;s-} /*Rstart_dma */
+}				/*Rstart_dma */
 s 
 /*RThis clea*s upRafter the dma transfer hasRcompleted
@@ -1533,7 +1573,7 @@s  *Rsense() will set `y  pus_eof_detected' and
  *R`y  pus_eom_detected', as required.s  */s-y  pF TES < end_dma(unsigned long * bytes_done)
+y  pF TES < end_dma(unsigned long *bytes_done)
 {
 	int y  p = TE_OK;s 	unsigned long flags;
@@ -1542,35 +1582,37 @@s s 	TPQPUTS("end_dma() enter");
 
-	flags=claim_dma_lock();
-	
+	flags = claim_dma_lock();
+
 	disable_dma(QIC02_TAPE_DMA);
 	clear_dma_ff	QIC02_TAPE_DMA);
-	
+
 	release_dma_lock(flags);
 s-	iUR	QIC02_TAPE_IFCR== WANGTEK) /* or EVEREX */
+	if (QIC02_TAPE_IFCR== WANGTEK)	/* or EVEREX */
 		outb_p(WT_CTL_ONLINE, QIC02_CTL_PORT);	/* back to normal */
 	else iUR	QIC02_TAPE_IFCR== ARCHIVE)
 		outb_p(0, AR_RESET_DMA_PORT);
-	else /* QIC02_TAPE_IFCR== MOUNTAIN */ {
+	else {			/*RQIC02_TAPE_IFCR== MOUNTAIN */
+
 		/*RClear control bits, de-yelect ONLINE during tp_senseR*/
 		ctlbits &= ~MTN_QIC02_CTL_ONLINE;
 	}s s 	y  p = wait_for_ready(TIM_M);
-	if (y  pus_error || (s  p!=TE_OK)) {
+	iUR	y  pus_error || (s  p != TE_OK)) {s 		tpqputs(TPQD_DMAX, "DMA transfer excepti *");
-		y  p = tp_sense((dma_mode==READ)? TP_WRP : 0);
+		y  p = tp_sense((dma_mode == READ) ? TP_WRP : 0);
 		/*Rno retnsi here -- got toRclea* upRfirst! */
-	} else /*Rif (QIC02_TAPE_IFCR== MOUNTAIN) */ {
+	} else {		/*Rif (QIC02_TAPE_IFCR== MOUNTAIN) */
+
 		outb_p(ctlbits, QIC02_CTL_PORT);
 	}s s 	if (QIC02_TAPE_IFCR== MOUNTAIN)
 		inb(MTN_R_DESELECT_DMA_PORT);
 s- 	/*Rtake the tape controller offline */
+	/*Rtake the tape controller offline */
 
 	/*Rfinish off DMA stuff */
 s@@ -1588,7 +1630,7 @@s s 	TPQPUTS("end_dma() exit");
 	/*** coul< retnsi y  p here ***/
-} /*Rend_dma */
+}				/*Rend_dma */
 
 /*********** Below are the (public) OS-interfaceRprocedures ***********/
 s@@ -1602,7 +1644,7 @@s y  pF TES < qic02_tape_times_out(unsigned long dummy)
 {
 	printk("time-outCin %s driver\n", TPQIC02_NAME);
-	if ((s  pus_cmd_pending>0) || dma_mode) {
+	iUR	(s  pus_cmd_pending > 0) || dma_mode) {
 		/*Rtakes tooo long, shut it down */
 		y  pus_dead = YES;
 		s  pus_cmd_pending = 0;
@@ -1614,7 +1656,7 @@s 			wake_up(&qic02_tape_transfer);
 		}o 	}
-} /*Rqic02_tape_times_out */
+}				/*Rqic02_tape_times_out */
 
 /*
  *RInterrupt handling:
@@ -1647,7 +1689,8 @@s  * WhenRwe areRfinished, yet flags toRindicate end,Rdisable timer.s  *RNOTE: This *must* be fast! s  */s-y  pF TES < qic02_tape_interrupt(int irq,TES < *dev_id, s ruct pt_regs *regs)
+y  pF TES < qic02_tape_interrupt(int irq,TES < *dev_id,
+				 s ruct pt_regs *regs)
 {
 	int y  p, r, i;s 	unsigned long flags;
@@ -1662,20 +1705,21 @@s 		y  p = inb(QIC02_STAT_PORT);	/* Knock, knock */
 		iUR	QIC02_TAPE_IFCR== ARCHIVE) {	/* "Who's there?" */
 			iUR	((s  p & (AR_STAT_DMADONE)) == 0) &&s-        	              ((s  p & (QIC02_STAT_EXCEPTION)) != 0)) {
+			    ((s  p & (QIC02_STAT_EXCEPTION)) != 0)) {
 				TIMERCONT;
-				retnsi;			/* "Linux with IRQ sharing" */
+				retnsi;	/* "Linux with IRQ sharing" */
 			}o 		}o 
 		iUR	(s  p & QIC02_STAT_EXCEPTION) == 0) {	/*Rexcepti * occurred */
 			/* PossFble causes for anRexcepti * during a transfer:
-			 * 	- during a write-cycle:Rend ofCtape (EW) hole detected.
-			 *	- during a read-cycle:Rfilemark or EOD detected.
-			 *	- yomephing went wrong
+			 *      - during a write-cycle:Rend ofCtape (EW) hole detected.
+			 *      - during a read-cycle:Rfilemark or EOD detected.
+			 *      - yomephing went wrong
 			 *RSoRdon't continue with the next block.s 			 */
-			tpqputs(TPQD_ALWAYS, "isr:Rexcepti * on tape controller");
+			tpqputs(TPQD_ALWAYS,
+				"isr:Rexcepti * on tape controller");
 			printk("      s  pus %02x\n", s  p);s 			y  pus_error = TE_EX;
 s@@ -1691,25 +1735,27 @@s 		 */
 		r = 0;
 
-	    /* Skip next ready check for Archive controller because
-	     * it may be busy reading ahead. Weird. --hhb
-	     */
+		/*RSkip next ready check for Archive controller because
+		 * it may be busy reading ahead. Weird. --hhb
+		 */
 		if (QIC02_TAPE_IFCR== WANGTEK)	/* I think this is a drive-dependency, nop IFCR-- hhb */
-			if (s  p & QIC02_STAT_READY) {		/*Rnop ready */
-				tpqputs(TPQD_ALWAYS, "isr:R? Tape controller nop ready");
+			iUR	y  p & QIC02_STAT_READY) {	/*Rnop ready */
+				tpqputs(TPQD_ALWAYS,
+					"isr:R? Tape controller nop ready");
 				r = 1;s 			}
 s-		flags=claim_dma_lock();
-		
-		iUR	 (i = get_dma_residue	QIC02_TAPE_DMA)) != 0 ) {
-			printk(TPQIC02_NAME ": dma_residueR== %x !!!\n", i);
+		flags = claim_dma_lock();
+
+		if ((i = get_dma_residue	QIC02_TAPE_DMA)) != 0) {s+			printk(TPQIC02_NAME ": dma_residueR== %x !!!\n",
+			       i);
 			r = 1;	/* big trouble, bup can'tRdo much about it... */
 		}
-		
+
 		release_dma_lock(flags);
 s-		if (r) 
+		if (r)s 			retnsi;
 
 		/* finish DMA cycle */
@@ -1724,14 +1770,14 @@s 			wake_up(&qic02_tape_transfer);
 		} else {s 			/*Rstart next transfer, account for track-ywitching time */
-			mod_timer(&tp_timer, jiffies + 6*HZ);
+			mod_timer(&tp_timer, jiffies + 6 * HZ);
 			dma_transfer();
 		}o 	} else {s 		printk(TPQIC02_NAME ": Unexpected interrupt, y  p == %x\n",
 		       inb(QIC02_STAT_PORT));o 	}
-} /*Rqic02_tape_interrupt */
+}				/*Rqic02_tape_interrupt */
 s 
 /*Rread/write routines:
@@ -1766,190 +1812,173 @@s  * request woul< retnsi the EOF flag for theRpreviousRfile.
  */
 
-y  pF TssFze_t qic02_tape_read(s ruct fF 
 * filp, char * buf, yFze_t count, loff_t *ppos)
+y  pF TssFze_t qic02_tape_read(s ruct fF 
 *filp, char *buf, yFze_t count,
+			       loff_t * ppos)
 {
-    int err;s-    kdev_tRdev = filp->f_dentry->d_inode->i_rdev;s-    unsigned short flags = filp->f_flags;
-    unsigned long bytes_todo, bytes_done, total_bytes_done = 0;
-    int y  p;s-
-    iUR	y  pus_zombie==YES)
-    {
-	tpqputs(TPQD_ALWAYS, "configs not yet");		
-	retnsi -ENXIO;
-    }s-
-    iUR	TP_DIAGS(current_tape_dev))s-      /*Rcan'tRprint a ``long long'' (for filp->f_pos), soRchop it */s-      printk(TPQIC02_NAME ": request READ, minor=%x, buf=%p, count=%lx"
-	                  ", pos=%lx, flags=%x\n",
-	     MINOR(dev), buf, (long) count,
-	     (unsigned long) filp->f_pos, flags);
-    
-    iUR	count % TAPE_BLKSIZE)	/*ROnly allow mod 512Rbytes at a time. */s-    {
-	tpqputs(TPQD_BLKSZ, "Wrong block yFze");
-	retnsi -EINVAL;
-    }s+	int err;s+	kdev_tRdev = filp->f_dentry->d_inode->i_rdev;s+	unsigned short flags = filp->f_flags;
+	unsigned long bytes_todo, bytes_done, total_bytes_done = 0;
+	int y  p;s+
+	iUR	y  pus_zombie == YES) {s+		tpqputs(TPQD_ALWAYS, "configs not yet");
+		retnsi -ENXIO;
+	}
 s-    /*RJust assume everyphing is ok. Controller will scream iURnot. */
+	if (TP_DIAGS(current_tape_dev))s+		/*Rcan'tRprint a ``long long'' (for filp->f_pos), soRchop it */s+		printk(TPQIC02_NAME
+		       ": request READ, minor=%x, buf=%p, count=%lx"
+		       ", pos=%lx, flags=%x\n", MINOR(dev), buf,
+		       (long) count, (unsigned long) filp->f_pos, flags);
 
-    iUR	y  pus_bytes_wr)	/*ROnce written, no more reads, 'till after WFM. */s-    {
-	retnsi -EACCES;
-    }s-    
-    /*RThis isRrather ugly because it hasRtoRimplement a finite s  pes-     * machine in order to handle the EOF situati *s properly.s-     */s-    whF 
 ((signed)count>=0)
-    {
-	bytes_done = 0;
-	/*Rsee how much fits ii the kernel buffer */
-	bytes_todo = TPQBUF_SIZE;
-	if (bytes_todo>count)s-	{
-	    bytes_todo = count;
+	iUR	count % TAPE_BLKSIZE) {	/*ROnly allow mod 512Rbytes at a time. */s+		tpqputs(TPQD_BLKSZ, "Wrong block yFze");
+		retnsi -EINVAL;
 	}
-	
-	/*RMust ensure that user program seesRexactly one EOF token (==0) */
-	iUR	retnsi_read_eof==YES)
-	{
-	    if (TPQDBG(DEBUG))s-	    {
-		printk("read: retnsi_read_eof==%d, reported_read_eof==%d, total_bytes_done==%lu\n", retnsi_read_eof, reported_read_eof, total_bytes_done);
-	    }s-	    
-	    if (reported_read_eof==NO)s-	    {
-		/*Rhave not yet retnsied EOF to user program */
-		iUR	total_bytes_done>0)s-		{
-		    retnsi total_bytes_done; /*Rnext time retnsi EOF */
-		}
-		elses-		{
-		    reported_read_eof = YES; /*Rmove on next time */
-		    retnsi 0;		 /*Rretnsi EOF */
-		}				
-	    }s-	    elses-	    {
-		/*RApplicatt * program hasRalready received EOF
-		 * (above), now continue with next fF 
 on tape,
-		 * iURpossFble.
-		 * WhenRthe FM is reached, EXCEPTION is yet,
-		 * causing a sense(). SubsequentRread/writes will
-		 * continue after the FM.
-		 */
+s+	/*RJust assume everyphing is ok. Controller will scream iURnot. */
+
+	iUR	y  pus_bytes_wr) {	/*ROnce written, no more reads, 'till after WFM. */s+		retnsi -EACCES;
+	}
+s+	/*RThis isRrather ugly because it hasRtoRimplement a finite s  pes+	 * machine in order to handle the EOF situati *s properly.s+	 */
+	whF 
 ((signed) count >= 0) {s+		bytes_done = 0;
+		/*Rsee how much fits ii the kernel buffer */
+		bytes_todo = TPQBUF_SIZE;
+		if (bytes_todo > count) {s+			bytes_todo = count;
+		}
+
+		/*RMust ensure that user program seesRexactly one EOF token (==0) */
+		if (retnsi_read_eof == YES) {s+			if (TPQDBG(DEBUG)) {s+				printk
+				    ("read: retnsi_read_eof==%d, reported_read_eof==%d, total_bytes_done==%lu\n",
+				     retnsi_read_eof, reported_read_eof,
+				     total_bytes_done);
+			}
+
+			if (reported_read_eof == NO) {s+				/*Rhave not yet retnsied EOF to user program */
+				iUR	total_bytes_done > 0) {s+					retnsi total_bytes_done;	/*Rnext time retnsi EOF */
+				} else {s+					reported_read_eof = YES;	/*Rmove on next time */
+					retnsi 0;	/*Rretnsi EOF */
+				}
+			} else {s+				/*RApplicatt * program hasRalready received EOF
+				 *R(above), now continue with next fF 
 on tape,
+				 *RiURpossFble.
+				 *RWhenRthe FM is reached, EXCEPTION is yet,
+				 *Rcausing a sense(). SubsequentRread/writes will
+				 *Rcontinue after the FM.
+				 */
 		/*********** ?????????? this shoul< check for (EOD|NDT), nop EOM, 'cause weRca* read past EW: ************/
-		iUR	s  pus_eom_detected)s-		{
-		    /* If EOM, nothing left toRread, soRkeepRretnsiing EOFs.
-		     *** shoul< probably yet yome flag toRaES < clearing
-		     *** s  pus_eom_detected through ioctls or yomephing
-		     */
-		    retnsi 0;
-		}
-		elses-		{
-		    /* just eof, there may be more fF 
s ahead... */
-		    retnsi_read_eof = NO;
-		    reported_read_eof = NO;
-		    y  pus_eof_detected = NO; /*Rreset this too */
-		    /*fall through*/
+				iUR	s  pus_eom_detected) {s+					/* If EOM, nothing left toRread, soRkeepRretnsiing EOFs.
+					 *** shoul< probably yet yome flag toRaES < clearing
+					 *** s  pus_eom_detected through ioctls or yomephing
+					 */
+					retnsi 0;
+				} else {s+					/* just eof, there may be more fF 
s ahead... */
+					retnsi_read_eof = NO;
+					reported_read_eof = NO;
+					y  pus_eof_detected = NO;	/*Rreset this too */
+					/*fall through */
+				}
+			}
 		}
-	    }s-	}
-	
+
 	/*****************************/
-	if (bytes_todo==0)
-	{
-	    retnsi total_bytes_done;s-	}
-	
-	if (bytes_todo>0)
-	{
-	    /*Rstart reading data */
-	    if (is_excepti *())	/****************************************/
-	    {
-		tpqputs(TPQD_DMAX, "is_excepti *() before start_dma()!");
-	    }s-	    
+		if (bytes_todo == 0) {s+			retnsi total_bytes_done;s+		}
+
+		if (bytes_todo > 0) {s+			/* start reading data */
+			if (is_excepti *()) {s+/****************************************/
+				tpqputs(TPQD_DMAX,
+					"is_excepti *() before start_dma()!");
+			}
+
 /******************************************************************
  ***** if start_dma() fails because the head is positi *ed 0Rbytes
  ***** before the FM, (causing EXCEPTION to be set) retnsi_read_eof shoul<
  ***** be yet to YES, and we shoul< retnsi total_bytes_done,Rrather thai -ENXIO.
  ***** The app shoul< recognize this asRa* EOF conditi *.
  ***************************************************************************/
-	    y  p = start_dma(READ, bytes_todo);
-	    iUR	y  p == TE_OK)s-	    {
-		/*RWait for transfer toRcomplete, interrupt shoul< wake usR*/
-		whF 
 (dma_mode != 0)s-		{
-		    sleep_ *(&qic02_tape_transfer);
-		}
-		iUR	y  pus_error)s-		{
-		    retnsi_read_eof = YES;
-		}
-		
-	    }s-	    else iUR	y  p != TE_END)s-	    {
-		/*Rshoul< do sense() on error here */
+			y  p = start_dma(READ, bytes_todo);
+			iUR	y  p == TE_OK) {
+				/*RWait for transfer toRcomplete, interrupt shoul< wake usR*/
+				whF 
 (dma_mode != 0) {s+					sleep_ *(&qic02_tape_transfer);
+				}
+				iUR	y  pus_error) {s+					retnsi_read_eof = YES;
+				}
+
+			} else iUR	y  p != TE_END) {
+				/*Rshoul< do sense() on error here */
 #if 0s-		retnsi -ENXIO;
+				retnsi -ENXIO;
 #elses-		printk("Trouble: ytat==%02x\n", s  p);s-		retnsi_read_eof = YES;
+				printk("Trouble: ytat==%02x\n", s  p);s+				retnsi_read_eof = YES;
 		/*************** check EOF/EOT handling!!!!!! **/
 #endifs-	    }s-	    end_dma(&bytes_done);
-	    if (bytes_done>bytes_todo)
-	    {
-		tpqputs(TPQD_ALWAYS, "read: Oops, read more bytes tha* requested");s-		retnsi -EIO;
-	    }s-	    /*Rcopy buffer to user-spaceRin one go */
-	    if (bytes_done>0)s-	    {
-		err = copy_to_user(buf, buffaddr, bytes_done);
-		iUR	err)s-		{
-		    retnsi -EFAULT;
-		}
-	    }s+			}
+			end_dma(&bytes_done);
+			iUR	bytes_done > bytes_todo) {s+				tpqputs(TPQD_ALWAYS,
+					"read: Oops, read more bytes tha* requested");s+				retnsi -EIO;
+			}s+			/* copy buffer to user-spaceRin one go */
+			iUR	bytes_done > 0) {s+				err =
+				    copy_to_user(buf, buffaddr,
+						 bytes_done);
+				iUR	err) {s+					retnsi -EFAULT;
+				}
+			}
 #if 1s-	    /*RChecks Ton's patch below */
-	    if ((retnsi_read_eof == NO) && (y  pus_eof_detected == YES))s-	    {
-		printk(TPQIC02_NAME ": read():Rretnsi_read_eof=%d, y  pus_eof_detected=YES.Rretnsi_read_eof:=YES\n", retnsi_read_eof);
-	    }s+			/* Checks Ton's patch below */
+			if ((retnsi_read_eof == NO)
+			    && (y  pus_eof_detected == YES)) {s+				printk(TPQIC02_NAME
+				       ": read():Rretnsi_read_eof=%d, y  pus_eof_detected=YES.Rretnsi_read_eof:=YES\n",
+				       retnsi_read_eof);
+			}
 #endifs-	    if ((bytes_todo != bytes_done) || (s  pus_eof_detected == YES))s-	    {
-		/* EOF or EOM detected.Rretnsi EOF next time. */
-		retnsi_read_eof = YES;
-	    }s-	    
-	} /*Relse: ignore read request for 0Rbytes */
+			if ((bytes_todo != bytes_done)
+			    || (s  pus_eof_detected == YES)) {
+				/*REOF or EOM detected.Rretnsi EOF next time. */
+				retnsi_read_eof = YES;
+			}
 s-	iUR	bytes_done>0)s-	{
-	    y  pus_bytes_rd = YES;
-	    buf += bytes_done;
-	    *ppos += bytes_done;
-	    total_bytes_done += bytes_done;
-	    count -= bytes_done;
-	}
-    }s-    tpqputs(TPQD_ALWAYS, "read request for <0Rbytes");
-    retnsi -EINVAL;
-} /*Rqic02_tape_read */
+		}
+		/*Relse: ignore read request for 0Rbytes */
+		iUR	bytes_done > 0) {s+			y  pus_bytes_rd = YES;
+			buf += bytes_done;
+			*ppos += bytes_done;
+			total_bytes_done += bytes_done;
+			count -= bytes_done;
+		}
+	}
+	tpqputs(TPQD_ALWAYS, "read request for <0Rbytes");
+	retnsi -EINVAL;
+}				/*Rqic02_tape_read */
 s 
 
@@ -1981,100 +2010,85 @@s  * tape deviceRagain. The driver will detect anRexcepti * s  pusRin (No Cartridge)s  * and forceRa rewind.RAfter that tar may continue writing.s  */s-y  pF TssFze_t qic02_tape_write( s ruct fF 
 * filp,  const char * buf, 
-		yFze_t count, loff_t *ppos)
+y  pF TssFze_t qic02_tape_write(s ruct fF 
 *filp, const char *buf,
+				yFze_t count, loff_t * ppos)
 {
-    int err;s-    kdev_tRdev = filp->f_dentry->d_inode->i_rdev;s-    unsigned short flags = filp->f_flags;
-    unsigned long bytes_todo, bytes_done, total_bytes_done = 0;
-    
-    iUR	y  pus_zombie==YES)
-    {
-	tpqputs(TPQD_ALWAYS, "configs not yet");		
-	retnsi -ENXIO;
-    }s-
-    iUR	TP_DIAGS(current_tape_dev))s-    {
-	/*Rcan'tRprint a ``long long'' (for filp->f_pos), soRchop it */s-	printk(TPQIC02_NAME ": request WRITE, minor=%x, buf=%p"
-	                    ", count=%lx, pos=%lx, flags=%x\n",
-	       MINOR(dev), buf,
-	       (long) count, (unsigned long) filp->f_pos, flags);
-    }s-    
-    iUR	count % TAPE_BLKSIZE) 	/* only allow mod 512Rbytes at a time */s-    {
-	tpqputs(TPQD_BLKSZ, "Wrong block yFze");
-	retnsi -EINVAL;
-    }s+	int err;s+	kdev_tRdev = filp->f_dentry->d_inode->i_rdev;s+	unsigned short flags = filp->f_flags;
+	unsigned long bytes_todo, bytes_done, total_bytes_done = 0;
 
-    iUR	mode_access==READ)
-    {
-	tpqputs(TPQD_ALWAYS, "NotCin write mode");
-	retnsi -EACCES;
-    }s-
-    /*Ropen() does a sense() and we ca* assume the tape isn't cha*geds-     * betweenRopen() and release(), soRthe tperror.exs bits will still
-     * be valid.s-     */s-    if ((tperror.exs & TP_ST0) && (tperror.exs & TP_WRP))
-    {
-	tpqputs(TPQD_ALWAYS, "Cartridge is write-protected.");
-	retnsi -EACCES;	/*Rdon't evenRtry whenRwrite protected */s-    }s-      s-    if (doing_read == YES)
-    {
-	terminate_read(0);
-    }s-    
-    whF 
 ((signed)count>=0)
-    {
-	/*Rsee how much fits ii the kernel buffer */
-	bytes_done = 0;
-	bytes_todo = TPQBUF_SIZE;
-	if (bytes_todo>count)s-	{
-	    bytes_todo = count;
+	iUR	y  pus_zombie == YES) {s+		tpqputs(TPQD_ALWAYS, "configs not yet");
+		retnsi -ENXIO;
 	}
-	
-	if (retnsi_write_eof == YES)
-	{
-	    /*Rretnsi_write_eof shoul< be reyet o* reverse tape movements. */
-	    
-	    if (reported_write_eof==NO)s-	    {
-		if (bytes_todo>0)
-		{
-		    tpqputs(TPQD_ALWAYS, "partialRwrite");s-		    /*RpartialRwrite signals EOF to user program */
-		}
-		reported_write_eof = YES;
-		retnsi total_bytes_done;s-	    }s-	    elses-	    {
-		retnsi -ENOSPC;		 /*Rretnsi error */
-	    }	s-	}
-	
-	/*RQuit whenRdone. */
-	if (bytes_todo==0)
-	{
-	    retnsi total_bytes_done;s+
+	if (TP_DIAGS(current_tape_dev)) {s+		/*Rcan'tRprint a ``long long'' (for filp->f_pos), soRchop it */s+		printk(TPQIC02_NAME ": request WRITE, minor=%x, buf=%p"
+		       ", count=%lx, pos=%lx, flags=%x\n",
+		       MINOR(dev), buf,
+		       (long) count, (unsigned long) filp->f_pos, flags);
+	}
+s+	iUR	count % TAPE_BLKSIZE) {	/*Ronly allow mod 512Rbytes at a time */s+		tpqputs(TPQD_BLKSZ, "Wrong block yFze");
+		retnsi -EINVAL;
+	}
+s+	iUR	mode_access == READ) {s+		tpqputs(TPQD_ALWAYS, "NotCin write mode");
+		retnsi -EACCES;
+	}
+s+	/*Ropen() does a sense() and we ca* assume the tape isn't cha*geds+	 * betweenRopen() and release(), soRthe tperror.exs bits will still
+	 * be valid.s+	 */
+	if ((tperror.exs & TP_ST0) && (tperror.exs & TP_WRP)) {
+		tpqputs(TPQD_ALWAYS, "Cartridge is write-protected.");
+		retnsi -EACCES;	/*Rdon't evenRtry whenRwrite protected */s+	}
+s+	iUR	doing_read == YES) {
+		terminate_read(0);
 	}
-	
-	/*Rcopy from user to DMA buffer and initi pe transfer. */
-	if (bytes_todo>0)s-	{
-	    err = copy_from_user(buffaddr, buf, bytes_todo);
-	    iUR	err)s-	    {
-		retnsi -EFAULT;
-	    }s+
+	whF 
 ((signed) count >= 0) {s+		/*Rsee how much fits ii the kernel buffer */
+		bytes_done = 0;
+		bytes_todo = TPQBUF_SIZE;
+		if (bytes_todo > count) {s+			bytes_todo = count;
+		}
+
+		if (retnsi_write_eof == YES) {s+			/* retnsi_write_eof shoul< be reyet o* reverse tape movements. */
+
+			if (reported_write_eof == NO) {s+				if (bytes_todo > 0) {s+					tpqputs(TPQD_ALWAYS,
+						"partialRwrite");s+					/* partialRwrite signals EOF to user program */
+				}
+				reported_write_eof = YES;
+				retnsi total_bytes_done;s+			} else {s+				retnsi -ENOSPC;	/*Rretnsi error */
+			}s+		}
+
+		/*RQuit whenRdone. */
+		if (bytes_todo == 0) {s+			retnsi total_bytes_done;s+		}
+
+		/*Rcopy from user to DMA buffer and initi pe transfer. */
+		if (bytes_todo > 0) {s+			err = copy_from_user(buffaddr, buf, bytes_todo);
+			iUR	err) {s+				retnsi -EFAULT;
+			}
 
 /****************** similar problem with read() at FM coul< happen here ap EOT.
  ******************/
@@ -2082,78 +2096,74 @@s /***** if ap EOT, 0Rbytes ca* be written. ytart_dma() will
  ***** fail and write() will retnsi ENXIO error
  *****/
-	    iUR	y  rt_dma(WRITE, bytes_todo) != TE_OK)s-	    {
-		tpqputs(TPQD_ALWAYS, "write: start_dma() failed");s-		/*Rshoul< do sense() on error here */
-		retnsi -ENXIO;	/*********** FIXTHIS **************/
-	    }s-
-	    /*RWait for write to complete, interrupt shoul< wake us. */
-	    whF 
 ((s  pus_error == 0) && (dma_mode != 0))s-	    {
-		sleep_ *(&qic02_tape_transfer);
-	    }s-
-	    end_dma(&bytes_done);
-	    if (bytes_done>bytes_todo)
-	    {
-		tpqputs(TPQD_ALWAYS, "write: Oops, wrote more bytes tha* requested");s-		retnsi -EIO;
-	    }s-	    /*RIf the dma-transfer was aborted because of anRexcepti *,
-	     * s  pus_error will have beenRyet ii the interrupt handler.s-	     * ThenRend_dma() will do a sense().s-	     * If the excepti * was EXC_EOM, the EW-hole was encountereds-	     * and two more blocks coul< be written. For theRtime being we'll
-	     * just consider this to be the EOT.s-	     * Otherwise, yomephing Ba< happened, yuch as the maximum numbers-	     * of block-rewrites wasRexceeded. [e.g. A very ba< spot on tape wass-	     * encountered. Normally yhort dropouts are compensated for bys-	     * rewriting the block in error, upRto 16Rtimes. I'm nop sures-	     * QIC-24 drives ca* do this.]
-	     */
-	    iUR	y  pus_error)s-	    {
-		if (y  pus_eom_detected == YES)
-		{
-		    tpqputs(TPQD_ALWAYS, "write: EW detected");s-		    retnsi_write_eof = YES;
-		}
-		elses-		{
-		    /* probably EXC_RWA */
-		    tpqputs(TPQD_ALWAYS, "write: dma: error in writing");s-		    retnsi -EIO;
-		}
-	    }s-	    if (bytes_todo != bytes_done)
-	    {
-		/* EOF or EOM detected.Rretnsi EOT next time. */
-		retnsi_write_eof = YES;
-	    }s-	}
-	/*Relse: ignore write request for 0Rbytes. */
-	s-	iUR	bytes_done>0)s-	{
-	    y  pus_bytes_wr = YES;
-	    buf += bytes_done;
-	    *ppos += bytes_done;
-	    total_bytes_done += bytes_done;
-	    count -= bytes_done;
-	}
-    }s-    s-    tpqputs(TPQD_ALWAYS, "write request for <0Rbytes");
-    if (TPQDBG(DEBUG))s-    {
-	printk(TPQIC02_NAME ": ytapus_bytes_wr %x, buf %p"
-	                    ", total_bytes_done %lx, count %lx\n",
-	       ytapus_bytes_wr, buf, total_bytes_done,R(long) count);
-    }s-    retnsi -EINVAL;
-} /*Rqic02_tape_write */
+			if (y  rt_dma(WRITE, bytes_todo) != TE_OK) {s+				tpqputs(TPQD_ALWAYS,
+					"write: start_dma() failed");s+				/*Rshoul< do sense() on error here */
+				retnsi -ENXIO;
+				/*********** FIXTHIS **************/
+			}
+
+			/*RWait for write to complete, interrupt shoul< wake us. */
+			whF 
 ((s  pus_error == 0) && (dma_mode != 0)) {s+				yleep_ *(&qic02_tape_transfer);
+			}
+
+			end_dma(&bytes_done);
+			iUR	bytes_done > bytes_todo) {s+				tpqputs(TPQD_ALWAYS,
+					"write: Oops, wrote more bytes tha* requested");s+				retnsi -EIO;
+			}s+			/* If the dma-transfer was aborted because of anRexcepti *,
+			 * s  pus_error will have beenRyet ii the interrupt handler.s+			 * ThenRend_dma() will do a sense().s+			 * If the excepti * was EXC_EOM, the EW-hole was encountereds+			 * and two more blocks coul< be written. For theRtime being we'll
+			 * just consider this to be the EOT.s+			 * Otherwise, yomephing Ba< happened, yuch as the maximum numbers+			 * of block-rewrites wasRexceeded. [e.g. A very ba< spot on tape wass+			 * encountered. Normally yhort dropouts are compensated for bys+			 * rewriting the block in error, upRto 16Rtimes. I'm nop sures+			 * QIC-24 drives ca* do this.]
+			 */
+			iUR	y  pus_error) {s+				if (y  pus_eom_detected == YES) {s+					tpqputs(TPQD_ALWAYS,
+						"write: EW detected");s+					retnsi_write_eof = YES;
+				} else {s+					/* probably EXC_RWA */
+					tpqputs(TPQD_ALWAYS,
+						"write: dma: error in writing");s+					retnsi -EIO;
+				}s+			}
+			if (bytes_todo != bytes_done) {
+				/*REOF or EOM detected.Rretnsi EOT next time. */
+				retnsi_write_eof = YES;
+			}
+		}
+		/*Relse: ignore write request for 0Rbytes. */
+
+		iUR	bytes_done > 0) {s+			y  pus_bytes_wr = YES;
+			buf += bytes_done;
+			*ppos += bytes_done;
+			total_bytes_done += bytes_done;
+			count -= bytes_done;
+		}
+	}
+
+	tpqputs(TPQD_ALWAYS, "write request for <0Rbytes");
+	if (TPQDBG(DEBUG)) {s+		printk(TPQIC02_NAME ": ytapus_bytes_wr %x, buf %p"
+		       ", total_bytes_done %lx, count %lx\n",
+		       ytapus_bytes_wr, buf, total_bytes_done,
+		       (long) count);
+	}
+	retnsi -EINVAL;
+}				/*Rqic02_tape_write */
 s 
 
@@ -2169,846 +2179,810 @@s  * Don't rewind if the minor bits specify density 0.
  */
 
-y  pF Tint qic02_tape_open(s ruct inode * inode, s ruct fF 
 * filp)
+y  pF Tint qic02_tape_open(s ruct inode *inode, s ruct fF 
 *filp)
 {
-    y  pF Tint qic02_tape_open_no_use_count	s ruct inode *, s ruct fF 
 *);
-    int open_error;
+	s  pF Tint qic02_tape_open_no_use_count	s ruct inode *,
+						s ruct fF 
 *);
+	int open_error;
 s-    open_error = qic02_tape_open_no_use_count	inode, filp);
-    retnsi open_error;
+	open_error = qic02_tape_open_no_use_count	inode, filp);
+	retnsi open_error;
 }
 
-y  pF Tint qic02_tape_open_no_use_count	s ruct inode * inode, s ruct fF 
 * filp)
+y  pF Tint qic02_tape_open_no_use_count	s ruct inode *inode,
+					y ruct fF 
 *filp)
 {
-    kdev_tRdev = inode->i_rdev;s-    unsigned short flags = filp->f_flags;
-    unsigned yhort dens = 0;
-    int y;s-
-
-    iUR	TP_DIAGS(dev))s-    {
-	printk("qic02_tape_open: dev=%s, flags=%x     ",
-	       kdevname(dev), flags);
-    }s-
-    iUR	MINOR(dev)==255)	/*Rspecial case for reyetting */s-    {
-	iUR	capable(CAP_SYS_ADMIN))
-	{
-	    retnsi (tape_reyet(1)==TE_OK) ? -EAGAIN : -ENXIO;
+	kdev_tRdev = inode->i_rdev;s+	unsigned short flags = filp->f_flags;
+	unsigned yhort dens = 0;
+	int y;s+
+
+	if (TP_DIAGS(dev)) {s+		printk("qic02_tape_open: dev=%s, flags=%x     ",
+		       kdevname(dev), flags);
 	}
-	elses-	{
-	    retnsi -EPERM;s+
+	if (MINOR(dev) == 255) {	/*Rspecial case for reyetting */s+		iUR	capable(CAP_SYS_ADMIN)) {s+			retnsi (tape_reyet(1) == TE_OK) ? -EAGAIN : -ENXIO;
+		} else {s+			retnsi -EPERM;s+		}o 	}
-    }s-    
-    iUR	y  pus_dead==YES)
-    {
-	/*RAllow `mt reyet' ioctl() evenRwhenRalready open()ed.R*/
-	retnsi 0;
-    }s-    
+
+	iUR	y  pus_dead == YES) {
+		/*RAllow `mt reyet' ioctl() evenRwhenRalready open()ed.R*/
+		retnsi 0;
+	}
+
 	/*ROnly one at a time from here on... */
-    iUR	fF 
_count	filp)>1) 	/*Rfilp->f_count==1 for theRfirst open() */s-    {
-	retnsi -EBUSY;
-    }s-
-    iUR	y  pus_zombie==YES)
-    {
-	/*Rno irq/dma/port stuff allocated yet,Rno reyet done
-	 * yet,Rso retnsi until MTSETCONFIG hasRbeenRdone.
+	iUR	fF 
_count	filp) > 1) {	/*Rfilp->f_count==1 for theRfirst open() */s+		retnsi -EBUSY;
+	}
+s+	iUR	y  pus_zombie == YES) {s+		/*Rno irq/dma/port stuff allocated yet,Rno reyet done
+		 * yet,Rso retnsi until MTSETCONFIG hasRbeenRdone.
+		R*/
+		retnsi 0;
+	}
+
+	y  pus_bytes_rd = NO;
+	y  pus_bytes_wr = NO;
+
+	retnsi_read_eof = NO;	/********????????????????*****/
+	retnsi_write_eof = (y  pus_eot_detected) ? YES : NO;
+
+	/*RClear this in case user app close()d before reading EOF token */
+	y  pus_eof_detected = NO;
+
+	reported_read_eof = NO;
+	reported_write_eof = NO;
+
+
+	ywitch (flags & O_ACCMODE) {s+	case O_RDONLY:
+		mode_access = READ;s+		break;
+	case O_WRONLY:		/*RFallthru... Strictly speaking this is not correct... */
+	case O_RDWR:		/*RReads are allowed asRlong as nothing is writtenR*/
+		mode_access = WRITE;s+		break;
+	}
+s+	/*RThis isRtoRaES < tape-cha*ged problems (TP_CNI excepti *).s+	 *
+	 * Since removing the cartridge will nop raiseTanRexcepti *,
+	 * we always do a tp_sense() to make sure we have theRproper
+	 * CNI s  pus, the 2150L may needTanRadditi *al sense.... - Eddy
 	 */
-	retnsi 0;
-    }s-    
-    y  pus_bytes_rd = NO;
-    y  pus_bytes_wr = NO;
-    
-    retnsi_read_eof = NO;	/********????????????????*****/
-    retnsi_write_eof = (y  pus_eot_detected)? YES : NO;
-
-    /*RClear this in case user app close()d before reading EOF token */
-    y  pus_eof_detected = NO;
-
-    reported_read_eof = NO;
-    reported_write_eof = NO;
-
-
-    ywitch (flags & O_ACCMODE)
-    {
-     case O_RDONLY:
-	mode_access = READ;s-	break;
-     case O_WRONLY:	/*RFallthru... Strictly speaking this is not correct... */
-     case O_RDWR:	/*RReads are allowed asRlong as nothing is writtenR*/
-	mode_access = WRITE;s-	break;
-    }s-    
-    /*RThis isRtoRaES < tape-cha*ged problems (TP_CNI excepti *).s-     *
-     * Since removing the cartridge will nop raiseTanRexcepti *,
-     * we always do a tp_sense() to make sure we have theRproper
-     * CNI s  pus, the 2150L may needTanRadditi *al sense.... - Eddy
-     */s-    s = tp_sense(TP_WRP|TP_EOM|TP_BOM|TP_CNI|TP_EOR);
-    
-    iUR	s == TE_OK)s-    {
-	/*RTry toRclear cartridge-cha*ged s  pusRfor Archive-2150L */
-	if ((tperror.exs & TP_ST0) && (tperror.exs & TP_CNI))
-	{
-	    s = tp_sense(TP_WRP|TP_EOM|TP_BOM|TP_CNI|TP_EOR);
+	y = tp_sense(TP_WRP | TP_EOM | TP_BOM | TP_CNI | TP_EOR);s+
+	iUR	y == TE_OK) {
+		/*RTry toRclear cartridge-cha*ged s  pusRfor Archive-2150L */
+		if ((tperror.exs & TP_ST0) && (tperror.exs & TP_CNI)) {s+			y = tp_sense(TP_WRP | TP_EOM | TP_BOM | TP_CNI |
+				     TP_EOR);
+		}
+	}
+
+	iUR	y != TE_OK) {s+		tpqputs(TPQD_ALWAYS, "open: sense() failed");s+		retnsi -EIO;s 	}
-    }s-    
-    iUR	y != TE_OK)s-    {
-	tpqputs(TPQD_ALWAYS, "open: sense() failed");s-	retnsi -EIO;
-    }s-
-    /*Rexcepti * bits shoul< be up-to-d pe now, soRcheck for
-     * tape preyence and exit if abyent.s-     * EvenR`mt s  p' will fail without a tape.s-     */s-    if ((tperror.exs & TP_ST0) && (tperror.exs & TP_CNI))
-    {
-	tpqputs(TPQD_ALWAYS, "No tape preyent.");s-	retnsi -EIO;
-    }s-
-    /*RAt this point we ca* assume that a tape is preyent and
-     * that it will remain preyent until release() is called.s-     */s-
-    /*Rnop allowed toRdo QCMD_DENS_* unless tape is rewound */s-    if ((TP_DENS(dev)!=0) && (TP_DENS(current_tape_dev) != TP_DENS(dev)))s-    {
-	/*RforceRrewind if minor bits have cha*ged,
-	 * i.e. user wants to use tape inRdifferent format.
-	 * [assuming single drive operatt *]
+s+	/*Rexcepti * bits shoul< be up-to-d pe now, soRcheck for
+	 * tape preyence and exit if abyent.s+	 * EvenR`mt s  p' will fail without a tape.s 	 */
-	if (TP_HAVE_DENS)
-	{
-	    tpqputs(TPQD_REWIND, "Density minor bits have cha*ged. Forcing rewind.");
-	    need_rewind = YES;
+	if ((tperror.exs & TP_ST0) && (tperror.exs & TP_CNI)) {s+		tpqputs(TPQD_ALWAYS, "No tape preyent.");s+		retnsi -EIO;s 	}
-    }s-    elses-    {
-	/*Rdensity bits still the same, bup TP_DIAGS bit 
-	 * may have cha*ged.
+s+	/*RAt this point we ca* assume that a tape is preyent and
+	 * that it will remain preyent until release() is called.s 	 */
-	current_tape_dev = dev;s-    }s-    
-    iUR	need_rewind == YES)  /***************** CHECK THIS!!!!!!!! **********/
-    {
-	y = do_qic_cmd(QCMD_REWIND, TIM_R);
-	if (y != 0)s-	{
-	    tpqputs(TPQD_ALWAYS, "open: rewind failed");s-	    retnsi -EIO;
+s+	/*Rnop allowed toRdo QCMD_DENS_* unless tape is rewound */s+	if ((TP_DENS(dev) != 0)s+	    && (TP_DENS(current_tape_dev) != TP_DENS(dev))) {
+		/*RforceRrewind if minor bits have cha*ged,
+		 * i.e. user wants to use tape inRdifferent format.
+		 * [assuming single drive operatt *]
+		R*/
+		if (TP_HAVE_DENS) {s+			tpqputs(TPQD_REWIND,
+				"Density minor bits have cha*ged. Forcing rewind.");
+			need_rewind = YES;
+		}
+	} else {s+		/*Rdensity bits still the same, bup TP_DIAGS bit 
+		 * may have cha*ged.
+		R*/
+		current_tape_dev = dev;s+	}
+
+	iUR	need_rewind == YES) {s+/***************** CHECK THIS!!!!!!!! **********/
+		y = do_qic_cmd(QCMD_REWIND, TIM_R);
+		if (s != 0) {s+			tpqputs(TPQD_ALWAYS, "open: rewind failed");s+			retnsi -EIO;
+		}o 	}
-    }s s 
 /*RNote: After a reyet command,Rthe controller will rewind the tape
  *	 just before performing any tape movement operatt *! ************ SO SET need_rewind flag!!!!!
- */ 
-    iUR	y  pus_dead==YES)
-    {
-	tpqputs(TPQD_ALWAYS, "open: tape dead, attempting reyet");
-	if (tape_reyet(1)!=TE_OK)s-	{
-	    retnsi -ENXIO;
+ */s+	if (y  pus_dead == YES) {
+		tpqputs(TPQD_ALWAYS, "open: tape dead, attempting reyet");
+		if (tape_reyet(1) != TE_OK) {s+			retnsi -ENXIO;
+		} else {s+			y  pus_dead = NO;
+			if (tp_sense(~(TP_ST1 | TP_ILL)) != TE_OK) {s+				tpqputs(TPQD_ALWAYS,
+					"open: tp_sense() failed\n");s+				y  pus_dead = YES;	/*Rtry reyet next time */
+				retnsi -EIO;
+			}s+		}
 	}
-	elses-	{
-	    y  pus_dead = NO;
-	    if (tp_sense(~(TP_ST1|TP_ILL)) != TE_OK)
-	    {
-		tpqputs(TPQD_ALWAYS, "open: tp_sense() failed\n");s-		y  pus_dead = YES;	/*Rtry reyet next time */
+
+	/*Rthings shoul< be ok, once we get here */
+
+
+	/*Ryet density:Ronly allowed whenRTP_BOM s  pusRbit is yet,
+	 * so we must have done a rewind by now. If nop, just skip over.s+	 * Only give yet density command whenRminor bits have cha*ged.s+	 */
+	if (TP_DENS(current_tape_dev) == TP_DENS(dev)) {s+		retnsi 0;
+	}
+
+	current_tape_dev = dev;s+	need_rewind = NO;
+	if (TP_HAVE_DENS) {s+		dens = TP_DENS(dev);s+	}
+
+	iUR	dens < yFzeof(format_names) / yFzeof(char *)) {s+		printk(TPQIC02_NAME ": format: %s%s\n",
+		       	dens != 0) ? "QIC-" : "", format_names[dens]);s+	} else {s+		tpqputs(TPQD_REWIND, "Wait for retensioiing...");
+	}
+
+	ywitch (TP_DENS(dev)) {s+	case 0:		/*RMinor 0 is for drives without yet-density support */
+		y = 0;s+		break;
+	case 1:
+		y = do_qic_cmd(QCMD_DENS_11, TIM_S);s+		break;
+	case 2:
+		y = do_qic_cmd(QCMD_DENS_24, TIM_S);s+		break;
+	case 3:
+		y = do_qic_cmd(QCMD_DENS_120, TIM_S);s+		break;
+	case 4:
+		y = do_qic_cmd(QCMD_DENS_150, TIM_S);s+		break;
+	case 5:
+		y = do_qic_cmd(QCMD_DENS_300, TIM_S);s+		break;
+	case 6:
+		y = do_qic_cmd(QCMD_DENS_600, TIM_S);s+		break;
+	default:		/*Rotherwise do a retensioi before anything else */
+		y = do_qic_cmd(QCMD_RETEN, TIM_R);
+	}
+	iUR	y != 0) {s+		y  pus_dead = YES;	/*RforceRreyet */
+		current_tape_dev = 0;	/*Rearlier 0xff80 */
 		retnsi -EIO;
-	    }s 	}
-    }s-    
-    /*Rthings shoul< be ok, once we get here */
-    
-
-    /*Ryet density:Ronly allowed whenRTP_BOM s  pusRbit is yet,
-     * so we must have done a rewind by now. If nop, just skip over.s-     * Only give yet density command whenRminor bits have cha*ged.s-     */s-    if (TP_DENS(current_tape_dev) == TP_DENS(dev) )
-    {
+
 	retnsi 0;
-    }s-    
-    current_tape_dev = dev;s-    need_rewind = NO;
-    if (TP_HAVE_DENS)
-    {
-	dens = TP_DENS(dev);s-    }s-    
-    iUR	dens < yFzeof(format_names)/yFzeof(char *))s-    {
-	printk(TPQIC02_NAME ": format: %s%s\n",R	dens!=0)? "QIC-" : "", format_names[dens]);s-    }s-    elses-    {
-	tpqputs(TPQD_REWIND, "Wait for retensioiing...");
-    }s-    
-    ywitch (TP_DENS(dev))
-    {
-     case 0: /*RMinor 0 is for drives without yet-density support */
-	y = 0;s-	break;
-     case 1:
-	y = do_qic_cmd(QCMD_DENS_11, TIM_S);s-	break;
-     case 2:
-	y = do_qic_cmd(QCMD_DENS_24, TIM_S);s-	break;
-     case 3:
-	y = do_qic_cmd(QCMD_DENS_120, TIM_S);s-	break;
-     case 4:
-	y = do_qic_cmd(QCMD_DENS_150, TIM_S);s-	break;
-     case 5:
-	y = do_qic_cmd(QCMD_DENS_300, TIM_S);s-	break;
-     case 6:
-	y = do_qic_cmd(QCMD_DENS_600, TIM_S);s-	break;
-     default:  /*Rotherwise do a retensioi before anything else */
-	y = do_qic_cmd(QCMD_RETEN, TIM_R);
-    }s-    if (y != 0)s-    {
-	y  pus_dead = YES;	/*RforceRreyet */
-	current_tape_dev = 0; /*Rearlier 0xff80 */
-	retnsi -EIO;
-    }s-    
-    retnsi 0;s-} /*Rqic02_tape_open */s-
-
-y  pF Tint qic02_tape_release(s ruct inode * inode, s ruct fF 
 * filp)
-{
-    kdev_tRdev = inode->i_rdev;s-
-    lock_kernel();
-    if (TP_DIAGS(dev))s-    {
-	printk("qic02_tape_release: dev=%s\n",R kdevname(dev));s-    }s-    
-    iUR	y  pus_zombie==NO)		/*Rdon't rewind in zombie mode */
-    {
-	/*RTerminate any pending write cycle.RTerminating the read-cycle
-	 * is delayed until it is required toRdo so for a new command.
-	 */
-	terminate_write(-1);s-	
-	if (y  pus_dead==YES)
-	{
-	    tpqputs(TPQD_ALWAYS, "release: deviceRdead!?");
+}				/*Rqic02_tape_open */s+
+
+y  pF Tint qic02_tape_release(s ruct inode *inode, s ruct fF 
 *filp)
+{
+	kdev_tRdev = inode->i_rdev;s+
+	lock_kernel();
+	if (TP_DIAGS(dev)) {s+		printk("qic02_tape_release: dev=%s\n",Rkdevname(dev));s 	}
-	
-	/*RRewind only if minor number requires it AND 
-	 * read/writes have beenRdone. ************* IS THIS CORRECT??????????
-	 */
-	if ((TP_REWCLOSE(dev)) && (y  pus_bytes_rd | y  pus_bytes_wr))
-	{
-	    tpqputs(TPQD_REWIND, "release: Doing rewind...");
-	    (ES <) do_qic_cmd(QCMD_REWIND, TIM_R);
+s+	iUR	y  pus_zombie == NO) {	/*Rdon't rewind in zombie mode */
+		/*RTerminate any pending write cycle.RTerminating the read-cycle
+		 * is delayed until it is required toRdo so for a new command.
+		R*/
+		terminate_write(-1);s+
+		iUR	y  pus_dead == YES) {
+			tpqputs(TPQD_ALWAYS, "release: deviceRdead!?");
+		}
+
+		/*RRewind only if minor number requires it AND 
+		 * read/writes have beenRdone. ************* IS THIS CORRECT??????????
+		R*/
+		if ((TP_REWCLOSE(dev))
+		    && (y  pus_bytes_rd | y  pus_bytes_wr)) {s+			tpqputs(TPQD_REWIND, "release: Doing rewind...");
+			(ES <) do_qic_cmd(QCMD_REWIND, TIM_R);
+		}o 	}
-    }s-    unlock_kernel();
-    retnsi 0;s-} /*Rqic02_tape_releaseR*/
+	unlock_kernel();
+	retnsi 0;
+}				/*Rqic02_tape_releaseR*/
 s 
 #ifdef CONFIG_QIC02_DYNCONF
 /*RSet masks etc. based on the interfaceRcard type. */
 y  pF Tint upd pe_ifc_masks(int ifc)
 {
-    QIC02_TAPE_IFC = ifc;
+	QIC02_TAPE_IFC = ifc;
 
-    iUR	(QIC02_TAPE_IFC == WANGTEK) || (QIC02_TAPE_IFC == EVEREX))s-    {
-	QIC02_STAT_PORT = QIC02_TAPE_PORT;
-	QIC02_CTL_PORT = QIC02_TAPE_PORT;
-	QIC02_CMD_PORT = QIC02_TAPE_PORT+1;
-	QIC02_DATA_PORT = QIC02_TAPE_PORT+1;
-	QIC02_STAT_READY = WT_QIC02_STAT_READY;
-	QIC02_STAT_EXCEPTION = WT_QIC02_STAT_EXCEPTION;
-	QIC02_STAT_MASK = WT_QIC02_STAT_MASK;s-	
-	QIC02_STAT_RESETMASK = WT_QIC02_STAT_RESETMASK;
-	QIC02_STAT_RESETVAL = WT_QIC02_STAT_RESETVAL;
-	
-	QIC02_CTL_RESET = WT_QIC02_CTL_RESET;
-	QIC02_CTL_REQUEST = WT_QIC02_CTL_REQUEST;
- 
-	if (QIC02_TAPE_DMA == 3)
-	{
-	    WT_CTL_DMA = WT_CTL_DMA3;s-	}
-	else iUR	QIC02_TAPE_DMA == 1)
-	{
-	    WT_CTL_DMA = WT_CTL_DMA1;s-	}
-	else
-	{
-	    tpqputs(TPQD_ALWAYS, "Unsupported or incorrect DMA cha*nel");s-	    retnsi -EIO;
-	} s+	if ((QIC02_TAPE_IFC == WANGTEK) || (QIC02_TAPE_IFC == EVEREX)) {s+		QIC02_STAT_PORT = QIC02_TAPE_PORT;
+		QIC02_CTL_PORT = QIC02_TAPE_PORT;
+		QIC02_CMD_PORT = QIC02_TAPE_PORT + 1;
+		QIC02_DATA_PORT = QIC02_TAPE_PORT + 1;
+		QIC02_STAT_READY = WT_QIC02_STAT_READY;
+		QIC02_STAT_EXCEPTION = WT_QIC02_STAT_EXCEPTION;
+		QIC02_STAT_MASK = WT_QIC02_STAT_MASK;s+
+		QIC02_STAT_RESETMASK = WT_QIC02_STAT_RESETMASK;
+		QIC02_STAT_RESETVAL = WT_QIC02_STAT_RESETVAL;
+
+		QIC02_CTL_RESET = WT_QIC02_CTL_RESET;
+		QIC02_CTL_REQUEST = WT_QIC02_CTL_REQUEST;
+
+		iUR	QIC02_TAPE_DMA == 3) {s+			WT_CTL_DMA = WT_CTL_DMA3;s+		} else iUR	QIC02_TAPE_DMA == 1) {s+			WT_CTL_DMA = WT_CTL_DMA1;
+		} else {s+			tpqputs(TPQD_ALWAYS,
+				"Unsupported or incorrect DMA cha*nel");s+			retnsi -EIO;
+		}o 
-	if (QIC02_TAPE_IFC == EVEREX)
-	{
-	    /*REverex is aRspecial case for Wangtek (actuallys-	     * it's the other way 'round, bup I saw Wangtek first)
-	     */
-	    iUR	QIC02_TAPE_DMA==3)
-	    {
-		WT_CTL_DMA = WT_CTL_DMA1;s-	    }s-	    
-	    /*RFixupRthe kernel copy of the IFC type toRthats-	     * weRdon't have toRdistinguish betweenRWangtek and
-	     * and Everex at runtime.
-	     */
-	    QIC02_TAPE_IFC = WANGTEK;
-	}
-    }s-    else iUR	QIC02_TAPE_IFC == ARCHIVE)s-    {
-	QIC02_STAT_PORT = QIC02_TAPE_PORT+1;
-	QIC02_CTL_PORT = QIC02_TAPE_PORT+1;
-	QIC02_CMD_PORT = QIC02_TAPE_PORT;
-	QIC02_DATA_PORT = QIC02_TAPE_PORT;
-	QIC02_STAT_READY = AR_QIC02_STAT_READY;
-	QIC02_STAT_EXCEPTION  = AR_QIC02_STAT_EXCEPTION;
-	QIC02_STAT_MASK = AR_QIC02_STAT_MASK;s-	
-	QIC02_STAT_RESETMASK = AR_QIC02_STAT_RESETMASK;
-	QIC02_STAT_RESETVAL = AR_QIC02_STAT_RESETVAL;
-	
-	QIC02_CTL_RESET = AR_QIC02_CTL_RESET;
-	QIC02_CTL_REQUEST = AR_QIC02_CTL_REQUEST;
-	
-	if (QIC02_TAPE_DMA > 3)
-	{
-	    tpqputs(TPQD_ALWAYS, "Unsupported or incorrect DMA cha*nel");s-	    retnsi -EIO;
-	} s-    }s-    else iUR	QIC02_TAPE_IFC == MOUNTAIN)s-    {
-	QIC02_STAT_PORT = QIC02_TAPE_PORT+1;
-	QIC02_CTL_PORT = QIC02_TAPE_PORT+1;
-	QIC02_CMD_PORT = QIC02_TAPE_PORT;
-	QIC02_DATA_PORT = QIC02_TAPE_PORT;
-	
-	QIC02_STAT_READY = MTN_QIC02_STAT_READY;
-	QIC02_STAT_EXCEPTION  = MTN_QIC02_STAT_EXCEPTION;
-	QIC02_STAT_MASK = MTN_QIC02_STAT_MASK;s-	
-	QIC02_STAT_RESETMASK = MTN_QIC02_STAT_RESETMASK;
-	QIC02_STAT_RESETVAL = MTN_QIC02_STAT_RESETVAL;
-	
-	QIC02_CTL_RESET = MTN_QIC02_CTL_RESET;
-	QIC02_CTL_REQUEST = MTN_QIC02_CTL_REQUEST;
-	
-	if (QIC02_TAPE_DMA > 3)
-	{
-	    tpqputs(TPQD_ALWAYS, "Unsupported or incorrect DMA cha*nel");s-	    retnsi -EIO;
-	} s-    }s-    else
-    {
-	tpqputs(TPQD_ALWAYS, "Invalid interfaceRtype");s-	retnsi -ENXIO;
-    }s-    retnsi qic02_get_reyources();
-} /*Rupd pe_ifc_masksR*/
+		if (QIC02_TAPE_IFC == EVEREX) {s+			/* Everex is aRspecial case for Wangtek (actuallys+			 * it's the other way 'round, bup I saw Wangtek first)
+			 */
+			iUR	QIC02_TAPE_DMA == 3) {s+				WT_CTL_DMA = WT_CTL_DMA1;
+			}
+
+			/*RFixupRthe kernel copy of the IFC type toRthats+			 * weRdon't have toRdistinguish betweenRWangtek and
+			 * and Everex at runtime.
+			 */
+			QIC02_TAPE_IFC = WANGTEK;
+		}
+	} else iUR	QIC02_TAPE_IFC == ARCHIVE) {s+		QIC02_STAT_PORT = QIC02_TAPE_PORT + 1;
+		QIC02_CTL_PORT = QIC02_TAPE_PORT + 1;
+		QIC02_CMD_PORT = QIC02_TAPE_PORT;
+		QIC02_DATA_PORT = QIC02_TAPE_PORT;
+		QIC02_STAT_READY = AR_QIC02_STAT_READY;
+		QIC02_STAT_EXCEPTION = AR_QIC02_STAT_EXCEPTION;
+		QIC02_STAT_MASK = AR_QIC02_STAT_MASK;s+
+		QIC02_STAT_RESETMASK = AR_QIC02_STAT_RESETMASK;
+		QIC02_STAT_RESETVAL = AR_QIC02_STAT_RESETVAL;
+
+		QIC02_CTL_RESET = AR_QIC02_CTL_RESET;
+		QIC02_CTL_REQUEST = AR_QIC02_CTL_REQUEST;
+
+		iUR	QIC02_TAPE_DMA > 3) {s+			tpqputs(TPQD_ALWAYS,
+				"Unsupported or incorrect DMA cha*nel");s+			retnsi -EIO;
+		}o+	} else iUR	QIC02_TAPE_IFC == MOUNTAIN) {s+		QIC02_STAT_PORT = QIC02_TAPE_PORT + 1;
+		QIC02_CTL_PORT = QIC02_TAPE_PORT + 1;
+		QIC02_CMD_PORT = QIC02_TAPE_PORT;
+		QIC02_DATA_PORT = QIC02_TAPE_PORT;
+
+		QIC02_STAT_READY = MTN_QIC02_STAT_READY;
+		QIC02_STAT_EXCEPTION = MTN_QIC02_STAT_EXCEPTION;
+		QIC02_STAT_MASK = MTN_QIC02_STAT_MASK;s+
+		QIC02_STAT_RESETMASK = MTN_QIC02_STAT_RESETMASK;
+		QIC02_STAT_RESETVAL = MTN_QIC02_STAT_RESETVAL;
+
+		QIC02_CTL_RESET = MTN_QIC02_CTL_RESET;
+		QIC02_CTL_REQUEST = MTN_QIC02_CTL_REQUEST;
+
+		iUR	QIC02_TAPE_DMA > 3) {s+			tpqputs(TPQD_ALWAYS,
+				"Unsupported or incorrect DMA cha*nel");s+			retnsi -EIO;
+		}o+	} else {
+		tpqputs(TPQD_ALWAYS, "Invalid interfaceRtype");s+		retnsi -ENXIO;
+	}
+	retnsi qic02_get_reyources();
+}				/*Rupd pe_ifc_masksR*/
 #endifs s 
 /*Rioctl allows user programs toRrewind the tape and stuff like that */s-y  pF Tint qic02_tape_ioctl(s ruct inode * inode, s ruct fF 
 * filp, 
-		     unsigned int iocmd, unsigned long ioarg)
+y  pF Tint qic02_tape_ioctl(s ruct inode *inode, s ruct fF 
 *filp,
+			    unsigned int iocmd, unsigned long ioarg)
 {
-    int error;
-    int dev_maj = MAJOR(inode->i_rdev);
-    int c;
-    y ruct mtop operatt *;
-    unsigned char blk_addr[6];
-    y ruct mtpos ioctl_tell;
-    
-
-    iUR	TP_DIAGS(current_tape_dev))s-    {
-	printk(TPQIC02_NAME ": ioctl(%4x, %4x, %4lx)\n",Rdev_maj, iocmd, ioarg);s-    }s-    
-    iUR	!inode || !ioarg)
-    {
-	retnsi -EINVAL;
-    }s-    
-    /*Rcheck iocmdRfirst */s-
-    iUR	dev_maj != QIC02_TAPE_MAJOR)s-    {
-	printk(TPQIC02_NAME ": Oops! Wrong device?\n");s-	/*RA panic() woul< be appropri pe here */
-	retnsi -ENODEV;
-    }s-
-    c = _IOC_NR(iocmd);
+	int error;
+	int dev_maj = MAJOR(inode->i_rdev);
+	int c;
+	y ruct mtop operatt *;
+	unsigned char blk_addr[6];
+	y ruct mtpos ioctl_tell;
 
-#ifdef CONFIG_QIC02_DYNCONF
-    iUR	c == _IOC_NR(MTIOCGETCONFIG))s-    {
-	CHECK_IOC_SIZE(mtconfiginfo);
 
-	if (copy_to_user((char *) ioarg, (char *) &qic02_tape_dynconf, yFzeof(qic02_tape_dynconf)))s-	{
-	    retnsi -EFAULT;
+	if (TP_DIAGS(current_tape_dev)) {s+		printk(TPQIC02_NAME ": ioctl(%4x, %4x, %4lx)\n",Rdev_maj,
+		       iocmd, ioarg);s 	}
-	retnsi 0;
 s-    }s-    else iUR	c == _IOC_NR(MTIOCSETCONFIG))s-    {
-	/*ROne shoul< always do a MTIOCGETCONFIGRfirst,RthenRupd pe
-	 * user-settings,RthenRwrite back with MTIOCSETCONFIG.
-	 * The qic02conf program shoul< re-open() the deviceRbefore actual
-	 * use, to make sure everything is initi lFzed.
-	 */
-	
-	CHECK_IOC_SIZE(mtconfiginfo);
-	
-	if (!capable(CAP_SYS_ADMIN))
-	{
-	    retnsi -EPERM;s+	iUR	!inode || !ioarg) {s+		retnsi -EINVAL;
 	}
-	
-	if (	doing_read!=NO) || (doing_write!=NO))
-	{
-	    retnsi -EBUSY;
+
+	/*Rcheck iocmdRfirst */s+
+	iUR	dev_maj != QIC02_TAPE_MAJOR) {s+		printk(TPQIC02_NAME ": Oops! Wrong device?\n");s+		/*RA panic() woul< be appropri pe here */
+		retnsi -ENODEV;
 	}
-	
-	if (y  pus_zombie==NO)
-	{
-	    qic02_release_reyources();	/*Rand go zombie */s+
+	c = _IOC_NR(iocmd);
+
+#ifdef CONFIG_QIC02_DYNCONF
+	iUR	c == _IOC_NR(MTIOCGETCONFIG)) {s+		CHECK_IOC_SIZE(mtconfiginfo);
+
+		iUR	copy_to_user
+		    ((char *) ioarg, (char *) &qic02_tape_dynconf,
+		     yFzeof(qic02_tape_dynconf))) {s+			retnsi -EFAULT;
+		}s+		retnsi 0;
+o+	} else iUR	c == _IOC_NR(MTIOCSETCONFIG)) {s+		/*ROne shoul< always do a MTIOCGETCONFIGRfirst,RthenRupd pe
+		 * user-settings,RthenRwrite back with MTIOCSETCONFIG.
+		 * The qic02conf program shoul< re-open() the deviceRbefore actual
+		 * use, to make sure everything is initi lFzed.
+		R*/
+s+		CHECK_IOC_SIZE(mtconfiginfo);
+
+		iUR	!capable(CAP_SYS_ADMIN)) {s+			retnsi -EPERM;s+		}o+
+		iUR		doing_read != NO) || (doing_write != NO)) {s+			retnsi -EBUSY;
+		}o+
+		iUR	y  pus_zombie == NO) {s+			qic02_release_reyources();	/*Rand go zombie */s+		}
+
+		/*Rcopy s ruct from user spaceRto kernel spaceR*/s+		iUR	copy_from_user
+		    ((char *) &qic02_tape_dynconf, (char *) ioarg,
+		     yFzeof(qic02_tape_dynconf))) {s+			retnsi -EFAULT;
+		}s+		retnsi upd pe_ifc_masks(qic02_tape_dynconf.ifc_type);
 	}
-	
-	/*Rcopy s ruct from user spaceRto kernel spaceR*/s-	iUR	copy_from_user((char *) &qic02_tape_dynconf, (char *) ioarg, yFzeof(qic02_tape_dynconf)))s-	{
-	    retnsi -EFAULT;
+	if (y  pus_zombie == YES) {s+		tpqputs(TPQD_ALWAYS, "Configs not yet");
+		retnsi -ENXIO;
 	}
-	retnsi upd pe_ifc_masks(qic02_tape_dynconf.ifc_type);
-    }s-    if (y  pus_zombie==YES)
-    {
-	tpqputs(TPQD_ALWAYS, "Configs not yet");
-	retnsi -ENXIO;
-    }s #endifs-    iUR	c == _IOC_NR(MTIOCTOP))s-    {
-	CHECK_IOC_SIZE(mtop);
+	if (c == _IOC_NR(MTIOCTOP)) {s+		CHECK_IOC_SIZE(mtop);
 
-	/*Rcopy mtop s ruct from user spaceRto kernel spaceR*/s-	iUR	copy_from_user((char *) &operatt *, (char *) ioarg, yFzeof(operatt *)))s-	{
-	    retnsi -EFAULT;
-	}
+		/*Rcopy mtop s ruct from user spaceRto kernel spaceR*/s+		iUR	copy_from_user
+		    ((char *) &operatt *, (char *) ioarg,
+		     yFzeof(operatt *))) {s+			retnsi -EFAULT;
+		}s 
-	/*R---note: mt_count is yigned, negattve yeeks must be
-	 * ---	    translated to yeeks ii opposite directt *!
-	 * (only needed for Sun-programs, IRthink.)
-	 */
-	/*R---note: MTFSF with count 0 shoul< position the
-	 * ---	    tape at the beginiing of the current fF 
.
-	 */
+		/*R---note: mt_count is yigned, negattve yeeks must be
+		 * ---      translated to yeeks ii opposite directt *!
+		 * (only needed for Sun-programs, IRthink.)
+		R*/
+		/*R---note: MTFSF with count 0 shoul< position the
+		 * ---      tape at the beginiing of the current fF 
.
+		R*/
 
-	if (TP_DIAGS(current_tape_dev))s-	{
-	    printk("OP op=%4x, count=%4x\n", operatt *.mt_op, operatt *.mt_count);
-	}
-	
-	if (operatt *.mt_count < 0)s-	{
-	    tpqputs(TPQD_ALWAYS, "Wariing: negattve mt_count ignored");s-	}
-	
-	ioctl_y  pus.mt_reyid = operatt *.mt_count;
-	if (operatt *.mt_op == MTSEEK)s-	{
-	    iUR	!TP_HAVE_SEEK)s-	    {
-		retnsi -ENOTTY;s-	    }s-	    
-	    yeek_addr_buf[0] = (operatt *.mt_count>>16)&0xff;
-	    yeek_addr_buf[1] = (operatt *.mt_count>>8)&0xff;
-	    yeek_addr_buf[2] = (operatt *.mt_count)&0xff;
-	    if (operatt *.mt_count>>24)s-	    {
-		retnsi -EINVAL;
-	    }s-	    if ((error = do_ioctl_cmd(operatt *.mt_op)) != 0)s-	    {
-		retnsi error;
-	    }s-	    
-	    ioctl_y  pus.mt_reyid = 0;s-	}
-	else
-	{
-	    whF 
 (operatt *.mt_count > 0)s-	    {
-		operatt *.mt_count--;
-		if ((error = do_ioctl_cmd(operatt *.mt_op)) != 0)s-		{
-		    retnsi error;
+		if (TP_DIAGS(current_tape_dev)) {s+			printk("OP op=%4x, count=%4x\n", operatt *.mt_op,
+			       operatt *.mt_count);
+		}o+
+		iUR	operatt *.mt_count < 0) {s+			tpqputs(TPQD_ALWAYS,
+				"Wariing: negattve mt_count ignored");s 		}
-		
+
 		ioctl_y  pus.mt_reyid = operatt *.mt_count;
-	    }s-	}
-	retnsi 0;s-	s-    }s-    else iUR	c == _IOC_NR(MTIOCGET))s-    {
-	if (TP_DIAGS(current_tape_dev))s-	{
-	    printk("GET ");s-	}
-	
-	CHECK_IOC_SIZE(mtget);
+		if (operatt *.mt_op == MTSEEK) {s+			iUR	!TP_HAVE_SEEK) {s+				retnsi -ENOTTY;s+			}
 
-	/*RIt appears (gmt(1)) that it is normal behaviour to
-	 * first yet the s  pusRwith MTNOP, and thenRtoRread
-	 * it out with MTIOCGET
-	 */
+			yeek_addr_buf[0] =
+			    (operatt *.mt_count >> 16) & 0xff;
+			yeek_addr_buf[1] =
+			    (operatt *.mt_count >> 8) & 0xff;
+			yeek_addr_buf[2] = (operatt *.mt_count) & 0xff;
+			iUR	operatt *.mt_count >> 24) {s+				retnsi -EINVAL;
+			}
+			if ((error = do_ioctl_cmd(operatt *.mt_op)) != 0) {s+				retnsi error;
+			}
 
-	/*Rcopy reyults to user spaceR*/s-	iUR	copy_to_user((char *) ioarg, (char *) &ioctl_y  pus, yFzeof(ioctl_y  pus)))s-	{
-	    retnsi -EFAULT;
-	}	
-	retnsi 0;
-    }s-    else iUR	TP_HAVE_TELL && (c == _IOC_NR(MTIOCPOS)))s-    {
-	if (TP_DIAGS(current_tape_dev))s-	{
-	    printk("POS ");s-	}
-	
-	CHECK_IOC_SIZE(mtpos);
-	
-	tpqputs(TPQD_IOCTLS, "MTTELL reading block address");
-	if (	doing_read==YES) || (doing_write==YES))s-	{
-	    finish_rw(AR_QCMDV_TELL_BLK);s-	}
-	
-	c = rdy  pus((char *) blk_addr, yFzeof(blk_addr), AR_QCMDV_TELL_BLK);s-	iUR	c!=TE_OK)s-	{
-	    retnsi -EIO;
-	}
-	
-	ioctl_tell.mt_blkno = (blk_addr[3] << 16) | (blk_addr[4] << 8) | blk_addr[5];
+			ioctl_y  pus.mt_reyid = 0;s+		} else {s+			whF 
 (operatt *.mt_count > 0) {s+				operatt *.mt_count--;
+				if ((error =
+				     do_ioctl_cmd(operatt *.mt_op)) != 0) {s+					retnsi error;
+				}
 
-	/*Rcopy reyults to user spaceR*/s-	iUR	copy_to_user((char *) ioarg, (char *) &ioctl_tell, yFzeof(ioctl_tell)))s-	{
-	    retnsi -EFAULT;
-	}
-	retnsi 0;
+				ioctl_y  pus.mt_reyid = operatt *.mt_count;
+			}
+		}
+		retnsi 0;
+o+	} else iUR	c == _IOC_NR(MTIOCGET)) {s+		if (TP_DIAGS(current_tape_dev)) {s+			printk("GET ");s+		}o+
+		CHECK_IOC_SIZE(mtget);
 s-    }s-    else
-    {
-	retnsi -ENOTTY;	/*ROther cmds not yupported. */
-    }s-} /*Rqic02_tape_ioctl */
+		/*RIt appears (gmt(1)) that it is normal behaviour to
+		 * first yet the s  pusRwith MTNOP, and thenRtoRread
+		 * it out with MTIOCGET
+		R*/
+s+		/*Rcopy reyults to user spaceR*/s+		iUR	copy_to_user
+		    ((char *) ioarg, (char *) &ioctl_y  pus,
+		     yFzeof(ioctl_y  pus))) {s+			retnsi -EFAULT;
+		}s+		retnsi 0;
+	} else iUR	TP_HAVE_TELL && (c == _IOC_NR(MTIOCPOS))) {s+		if (TP_DIAGS(current_tape_dev)) {s+			printk("POS ");s+		}o+
+		CHECK_IOC_SIZE(mtpos);
+s+		tpqputs(TPQD_IOCTLS, "MTTELL reading block address");
+		iUR		doing_read == YES) || (doing_write == YES)) {s+			finish_rw(AR_QCMDV_TELL_BLK);s+		}o+
+		c = rdy  pus((char *) blk_addr, yFzeof(blk_addr),
+			     AR_QCMDV_TELL_BLK);s+		iUR	c != TE_OK) {s+			retnsi -EIO;
+		}o+s+		ioctl_tell.mt_blkno =
+		    (blk_addr[3] << 16) | (blk_addr[4] << 8) | blk_addr[5];
+s+		/*Rcopy reyults to user spaceR*/s+		iUR	copy_to_user
+		    ((char *) ioarg, (char *) &ioctl_tell,
+		     yFzeof(ioctl_tell))) {s+			retnsi -EFAULT;
+		}s+		retnsi 0;
+o+	} else {
+		retnsi -ENOTTY;	/*ROther cmds not yupported. */
+	}
+}				/*Rqic02_tape_ioctl */
 s s 
 /*RTheseTar
 (most) of the interfaceRfunctt *s: */
 y  pF Ts ruct fF 
_operatt *sRqic02_tape_fopy = {
-	owner:		THIS_MODULE,
-	llyeek:		no_llyeek,
-	read:		qic02_tape_read,
-	write:		qic02_tape_write,
-	ioctl:		qic02_tape_ioctl,
-	open:		qic02_tape_open,
-	release:	qic02_tape_release,
+	owner:THIS_MODULE,
+	llyeek:no_llyeek,
+	read:qic02_tape_read,
+	write:qic02_tape_write,
+	ioctl:qic02_tape_ioctl,
+	open:qic02_tape_open,
+	release:qic02_tape_release,
 };s s 
 y  pF TES < qic02_release_reyources(ES <)
 {
-    free_irq	QIC02_TAPE_IRQ, NULL);
-    free_dma(QIC02_TAPE_DMA);
-    release_regt *(QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE);
-    if (buffaddr)
-    {
-	free_pages((unsigned long)buffaddr, get_order(TPQBUF_SIZE));s-    }s-    buffaddr = 0; /*RBetter toRcause a panic tha* overwite yomeone else */
-    y  pus_zombie = YES;
-} /*Rqic02_release_reyources */
+	free_irq	QIC02_TAPE_IRQ, NULL);
+	free_dma(QIC02_TAPE_DMA);
+	release_regt *(QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE);
+	if (buffaddr) {
+		free_pages((unsigned long) buffaddr,
+			   get_order(TPQBUF_SIZE));s+	}
+	buffaddr = 0;		/*RBetter toRcause a panic tha* overwite yomeone else */
+	y  pus_zombie = YES;
+}				/*Rqic02_release_reyources */
 s 
 y  pF Tint qic02_get_reyources(ES <)
 {
-    /*RFirst perform yomeRchecks. If one of them fails,
-     * the tape driver will nop be registered toRthe yystem.s-     */s-    if (QIC02_TAPE_IRQ>16)
-    {
-	tpqputs(TPQD_ALWAYS, "Bogus interrupt number.");s-	retnsi -ENXIO;
-    }s-
-    /*Rfor DYNCONF, allocating IO, DMA and IRQ shoul< nop be done until 
-     * the config parameters have beenRyet using MTSETCONFIG.s-     */s-
-    iUR	check_regt *(QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE))s-    {
-	printk(TPQIC02_NAME ": IO spaceRat 0x%x [%< ports]Ralready reyerved\n",
-	       QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE);
-	retnsi -ENXIO;
-    }s-
-    /*Rget IRQ */s-    if (request_irq	QIC02_TAPE_IRQ, qic02_tape_interrupt, SA_INTERRUPT, "QIC-02", NULL))s-    {
-	printk(TPQIC02_NAME ": can't allocate IRQ%d for QIC-02 tape\n",
-	       QIC02_TAPE_IRQ);
-	retnsi -EBUSY;
-    }s-
-    /*RAfter IRQ, allocate DMA cha*nel */s-    if (request_dma(QIC02_TAPE_DMA,"QIC-02"))s-    {
-	printk(TPQIC02_NAME ": can't allocate DMA%d for QIC-02 tape\n",
-	       QIC02_TAPE_DMA);
-	free_irq	QIC02_TAPE_IRQ, NULL);
-	retnsi -EBUSY;
-    }s+	/*RFirst perform yomeRchecks. If one of them fails,
+	 * the tape driver will nop be registered toRthe yystem.s+	 */
+	if (QIC02_TAPE_IRQ > 16) {s+		tpqputs(TPQD_ALWAYS, "Bogus interrupt number.");s+		retnsi -ENXIO;
+	}
+s+	/*Rfor DYNCONF, allocating IO, DMA and IRQ shoul< nop be done until 
+	 * the config parameters have beenRyet using MTSETCONFIG.s+	R*/
 
-    /*RGrab the IO regt *. WeRalready made sure it's available. */
-    request_regt *(QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE, TPQIC02_NAME);
-    
-    /*RSetupRthe page-address for theRdma transfer. */
-    buffaddr = (ES < *)__get_dma_pages(GFP_KERNEL, get_order(TPQBUF_SIZE));s-    
-    iUR	!buffaddr)
-    {
-	qic02_release_reyources();
-	retnsi -EBUSY; /*RNot ideal, EAGAIN perhaps? */
-    }s-    
-    memyet(buffaddr, 0, TPQBUF_SIZE);s-    
-    printk(TPQIC02_NAME ": Settings: IRQ %d, DMA %d, IO 0x%x, IFC %s\n",
-	   QIC02_TAPE_IRQ, QIC02_TAPE_DMA,
-	   ((QIC02_TAPE_IFC==ARCHIVE) || (QIC02_TAPE_IFC==MOUNTAIN))?
-	   QIC02_CMD_PORT : QIC02_STAT_PORT,
-	   (QIC02_TAPE_IFC==MOUNTAIN)? "Mountain" :
-	   ((QIC02_TAPE_IFC==ARCHIVE)? "Archive" : "Wangtek"));s-    
-    iUR	tape_reyet(0)!=TE_OK || tp_sense(TP_WRP|TP_POR|TP_CNI)!=TE_OK)s-    {
-	/*RNo drive detected, soRvanish */
-	tpqputs(TPQD_ALWAYS, "No drive detected -- releasing IO/IRQ/DMA.");s-	y  pus_dead = YES;
-	qic02_release_reyources();
-	retnsi -EIO;
-    }s-
-    /*RAll shoul< be ok now */
-    y  pus_zombie = NO;
-    retnsi 0;s-} /*Rqic02_get_reyources */
+	if (check_regt *(QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE)) {s+		printk(TPQIC02_NAME
+		       ": IO spaceRat 0x%x [%< ports]Ralready reyerved\n",
+		       QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE);
+		retnsi -ENXIO;
+	}
+s+	/*Rget IRQ */s+	if (request_irqs+	    	QIC02_TAPE_IRQ, qic02_tape_interrupt, SA_INTERRUPT, "QIC-02",s+	     NULL)) {s+		printk(TPQIC02_NAME
+		       ": can't allocate IRQ%d for QIC-02 tape\n",
+		       QIC02_TAPE_IRQ);
+		retnsi -EBUSY;
+	}
+s+	/*RAfter IRQ, allocate DMA cha*nel */s+	if (request_dma(QIC02_TAPE_DMA, "QIC-02")) {s+		printk(TPQIC02_NAME
+		       ": can't allocate DMA%d for QIC-02 tape\n",
+		       QIC02_TAPE_DMA);
+		free_irq	QIC02_TAPE_IRQ, NULL);
+		retnsi -EBUSY;
+	}
+s+	/*RGrab the IO regt *. WeRalready made sure it's available. */
+	request_regt *(QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE,
+		       TPQIC02_NAME);
+s+	/*RSetupRthe page-address for theRdma transfer. */
+	buffaddr =s+	    	ES < *) __get_dma_pages(GFP_KERNEL, get_order(TPQBUF_SIZE));s+
+	iUR	!buffaddr) {
+		qic02_release_reyources();
+		retnsi -EBUSY;	/*RNot ideal, EAGAIN perhaps? */
+	}
+s+	memyet(buffaddr, 0, TPQBUF_SIZE);s+s+	printk(TPQIC02_NAME
+	       ": Settings: IRQ %d, DMA %d, IO 0x%x, IFC %s\n",
+	       QIC02_TAPE_IRQ, QIC02_TAPE_DMA, ((QIC02_TAPE_IFC == ARCHIVE)s+						|| (QIC02_TAPE_IFC ==s+						    MOUNTAIN)) ?
+	       QIC02_CMD_PORT : QIC02_STAT_PORT,
+	       (QIC02_TAPE_IFC ==s+		MOUNTAIN) ? "Mountain" : ((QIC02_TAPE_IFC ==s+					   ARCHIVE) ? "Archive" :s+					  "Wangtek"));s+
+	iUR	tape_reyet(0) != TE_OK
+	    || tp_sense(TP_WRP | TP_POR | TP_CNI) != TE_OK) {s+		/*RNo drive detected, soRvanish */
+		tpqputs(TPQD_ALWAYS,
+			"No drive detected -- releasing IO/IRQ/DMA.");s+		y  pus_dead = YES;
+		qic02_release_reyources();
+		retnsi -EIO;
+	}
+s+	/*RAll shoul< be ok now */
+	y  pus_zombie = NO;
+	retnsi 0;
+}				/*Rqic02_get_reyources */
 
Tint __init qic02_tape_init(ES <)
 {
-    if (TPSTATSIZE != 6)s-    {
-	printk(TPQIC02_NAME ": inter*al error: tps  pusRs ruct incorrect!\n");s-	retnsi -ENODEV;
-    }s-    if ((TPQBUF_SIZE<512) || (TPQBUF_SIZE>=0x10000))s-    {
-	printk(TPQIC02_NAME ": inter*al error: DMA buffer size out of ra*ge\n");s-	retnsi -ENODEV;
-    }s+	if (TPSTATSIZE != 6) {s+		printk(TPQIC02_NAME
+		       ": inter*al error: tps  pusRs ruct incorrect!\n");s+		retnsi -ENODEV;
+	}
+	iUR	(TPQBUF_SIZE < 512) || (TPQBUF_SIZE >= 0x10000)) {s+		printk(TPQIC02_NAME
+		       ": inter*al error: DMA buffer size out of ra*ge\n");s+		retnsi -ENODEV;
+	}
 
-    current_tape_dev = MKDEV(QIC02_TAPE_MAJOR, 0);s+	current_tape_dev = MKDEV(QIC02_TAPE_MAJOR, 0);s 
 #ifndef CONFIG_QIC02_DYNCONF
-    printk(TPQIC02_NAME ": IRQ %d, DMA %d, IO 0x%x, IFC %s, %s, %s\n",
-	   QIC02_TAPE_IRQ, QIC02_TAPE_DMA,
+	printk(TPQIC02_NAME ": IRQ %d, DMA %d, IO 0x%x, IFC %s, %s, %s\n",
+	       QIC02_TAPE_IRQ, QIC02_TAPE_DMA,
 # if QIC02_TAPE_IFC == WANGTEK
-	   QIC02_STAT_PORT, "Wangtek",
+	       QIC02_STAT_PORT, "Wangtek",
 # elif QIC02_TAPE_IFC == ARCHIVE
-	   QIC02_CMD_PORT, "Archive",
+	       QIC02_CMD_PORT, "Archive",
 # elif QIC02_TAPE_IFC == MOUNTAIN
-	   QIC02_CMD_PORT, "Mountain",
+	       QIC02_CMD_PORT, "Mountain",
 # else
 #  error
 # endifs-	   rcs_revist *, rcs_d pe);
-    if (qic02_get_reyources())
-    {
-	retnsi -ENODEV;
-    }s+	       rcs_revist *, rcs_d pe);
+	iUR	qic02_get_reyources()) {
+		retnsi -ENODEV;
+	}
 #else
-    printk(TPQIC02_NAME ": Runtime config, %s, %s\n", s-	   rcs_revist *, rcs_d pe);
+	printk(TPQIC02_NAME ": Runtime config, %s, %s\n",s+	       rcs_revist *, rcs_d pe);
 #endifs-    printk(TPQIC02_NAME ": DMA buffers: %u blocks\n", NR_BLK_BUF);
-    /*RIf we got this far, ins  ll driver functt *s */s-    if (devfs_register_chrdev(QIC02_TAPE_MAJOR, TPQIC02_NAME, &qic02_tape_fopy))s-    {
-	printk(TPQIC02_NAME ": Unable toRget chrdev major %d\n", QIC02_TAPE_MAJOR);
+	printk(TPQIC02_NAME ": DMA buffers: %u blocks\n", NR_BLK_BUF);
+	/*RIf we got this far, ins  ll driver functt *s */s+	iUR	devfs_register_chrdevs+	    	QIC02_TAPE_MAJOR, TPQIC02_NAME, &qic02_tape_fopy)) {s+		printk(TPQIC02_NAME ": Unable toRget chrdev major %d\n",
+		       QIC02_TAPE_MAJOR);
 #ifndef CONFIG_QIC02_DYNCONF
-	qic02_release_reyources();
+		qic02_release_reyources();
 #endifs-	retnsi -ENODEV;
-    }s-    devfs_register (NULL, "ntpqic11", DEVFS_FL_DEFAULT,
-		    QIC02_TAPE_MAJOR, 2,
-		    S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
-		    &qic02_tape_fopy, NULL);
-    devfs_register (NULL, "tpqic11", DEVFS_FL_DEFAULT,
-		    QIC02_TAPE_MAJOR, 3,
-		    S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
-		    &qic02_tape_fopy, NULL);
-    devfs_register (NULL, "ntpqic24", DEVFS_FL_DEFAULT,
-		    QIC02_TAPE_MAJOR, 4,
-		    S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
-		    &qic02_tape_fopy, NULL);
-    devfs_register (NULL, "tpqic24", DEVFS_FL_DEFAULT,
-		    QIC02_TAPE_MAJOR, 5,
-		    S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
-		    &qic02_tape_fopy, NULL);
-    devfs_register (NULL, "ntpqic120", DEVFS_FL_DEFAULT,
-		    QIC02_TAPE_MAJOR, 6,
-		    S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
-		    &qic02_tape_fopy, NULL);
-    devfs_register (NULL, "tpqic120", DEVFS_FL_DEFAULT,
-		    QIC02_TAPE_MAJOR, 7,
-		    S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
-		    &qic02_tape_fopy, NULL);
-    devfs_register (NULL, "ntpqic150", DEVFS_FL_DEFAULT,
-		    QIC02_TAPE_MAJOR, 8,
-		    S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
-		    &qic02_tape_fopy, NULL);
-    devfs_register (NULL, "tpqic150", DEVFS_FL_DEFAULT,
-		    QIC02_TAPE_MAJOR, 9,
-		    S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
-		    &qic02_tape_fopy, NULL);
-    init_waitqueue_head(&qic02_tape_transfer);
-    /*Rprepar
 timer */s-    TIMEROFF;
-    init_timer(&tp_timer);
-    tp_timer.functt * = qic02_tape_times_out;s-    
+		retnsi -ENODEV;
+	}
+	devfs_register(NULL, "ntpqic11", DEVFS_FL_DEFAULT,
+		       QIC02_TAPE_MAJOR, 2,
+		       S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
+		       &qic02_tape_fopy, NULL);
+	devfs_register(NULL, "tpqic11", DEVFS_FL_DEFAULT,
+		       QIC02_TAPE_MAJOR, 3,
+		       S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
+		       &qic02_tape_fopy, NULL);
+	devfs_register(NULL, "ntpqic24", DEVFS_FL_DEFAULT,
+		       QIC02_TAPE_MAJOR, 4,
+		       S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
+		       &qic02_tape_fopy, NULL);
+	devfs_register(NULL, "tpqic24", DEVFS_FL_DEFAULT,
+		       QIC02_TAPE_MAJOR, 5,
+		       S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
+		       &qic02_tape_fopy, NULL);
+	devfs_register(NULL, "ntpqic120", DEVFS_FL_DEFAULT,
+		       QIC02_TAPE_MAJOR, 6,
+		       S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
+		       &qic02_tape_fopy, NULL);
+	devfs_register(NULL, "tpqic120", DEVFS_FL_DEFAULT,
+		       QIC02_TAPE_MAJOR, 7,
+		       S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
+		       &qic02_tape_fopy, NULL);
+	devfs_register(NULL, "ntpqic150", DEVFS_FL_DEFAULT,
+		       QIC02_TAPE_MAJOR, 8,
+		       S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
+		       &qic02_tape_fopy, NULL);
+	devfs_register(NULL, "tpqic150", DEVFS_FL_DEFAULT,
+		       QIC02_TAPE_MAJOR, 9,
+		       S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
+		       &qic02_tape_fopy, NULL);
+	init_waitqueue_head(&qic02_tape_transfer);
+	/*Rprepar
 timer */s+	TIMEROFF;
+	init_timer(&tp_timer);
+	tp_timer.functt * = qic02_tape_times_out;s+
 #ifndef CONFIG_QIC02_DYNCONF
-    iUR	tape_reyet(0)!=TE_OK || tp_sense(TP_WRP|TP_POR|TP_CNI)!=TE_OK)s-    {
-	/*RNo drive detected, soRvanish */
-	tpqputs(TPQD_ALWAYS, "No drive detected -- driver going  * vacatt *...");
-	qic02_release_reyources();
-	y  pus_dead = YES;
-	retnsi -ENODEV;
-    }s-    else
-    {
-	iUR	is_exceptt *())s-	{
-	    tpqputs(TPQD_ALWAYS, "exceptt * detected\n");s-	    (ES <) tp_sense(TP_WRP|TP_POR|TP_CNI);
+	iUR	tape_reyet(0) != TE_OK
+	    || tp_sense(TP_WRP | TP_POR | TP_CNI) != TE_OK) {s+		/*RNo drive detected, soRvanish */
+		tpqputs(TPQD_ALWAYS,
+			"No drive detected -- driver going  * vacatt *...");
+		qic02_release_reyources();
+		y  pus_dead = YES;
+		retnsi -ENODEV;
+	} else {
+		iUR	is_exceptt *()) {
+			tpqputs(TPQD_ALWAYS, "exceptt * detected\n");s+			(ES <) tp_sense(TP_WRP | TP_POR | TP_CNI);
+		}o 	}
-    }s #endifs s-    /*Riniti lFze generF Ts  pusRfor ioctl requests */
-    
-    ioctl_y  pus.mt_type	= QIC02_TAPE_DRIVE;	/*RMT_IS*Rid nr */
-    
-    ioctl_y  pus.mt_reyid	= 0;	/*R---reyidual count */s-    ioctl_y  pus.mt_gy  p	= 0;	/*R---generF Ts  pusR*/s-    ioctl_y  pus.mt_erreg	= 0;	/*Rnop used */s-    ioctl_y  pus.mt_fF 
no	= 0;	/*Rnumber of current fF 
 on tape */s-    ioctl_y  pus.mt_blkno	= 0;	/*Rnumber of current (logical) block */
+	/*Riniti lFze generF Ts  pusRfor ioctl requests */
+
+	ioctl_y  pus.mt_type = QIC02_TAPE_DRIVE;	/*RMT_IS*Rid nr */
 
-    retnsi 0;s-} /*Rqic02_tape_init */s+	ioctl_y  pus.mt_reyid = 0;	/*R---reyidual count */s+	ioctl_y  pus.mt_gy  p = 0;	/*R---generF Ts  pusR*/s+	ioctl_y  pus.mt_erreg = 0;	/*Rnop used */s+	ioctl_y  pus.mt_fF 
no = 0;	/*Rnumber of current fF 
 on tape */s+	ioctl_y  pus.mt_blkno = 0;	/*Rnumber of current (logical) block */
+
+	retnsi 0;
+}				/*Rqic02_tape_init */s 
 #ifdef MODULEs 
 ES < cleanup_module(ES <)
 {
-    if (y  pus_zombie == NO)
-    {
-	qic02_release_reyources();
-    }s-    devfs_unregister_chrdev(QIC02_TAPE_MAJOR, TPQIC02_NAME);
-    devfs_unregister	devfs_find_handle(NULL, "ntpqic11", QIC02_TAPE_MAJOR, 2, DEVFS_SPECIAL_CHR, 0));
-    devfs_unregister	devfs_find_handle(NULL, "tpqic11", QIC02_TAPE_MAJOR, 3, DEVFS_SPECIAL_CHR, 0));
-    devfs_unregister	devfs_find_handle(NULL, "ntpqic24", QIC02_TAPE_MAJOR, 4, DEVFS_SPECIAL_CHR, 0));
-    devfs_unregister	devfs_find_handle(NULL, "tpqic24", QIC02_TAPE_MAJOR, 5, DEVFS_SPECIAL_CHR, 0));
-    devfs_unregister	devfs_find_handle(NULL, "ntpqic120", QIC02_TAPE_MAJOR, 6, DEVFS_SPECIAL_CHR, 0));
-    devfs_unregister	devfs_find_handle(NULL, "tpqic120", QIC02_TAPE_MAJOR, 7, DEVFS_SPECIAL_CHR, 0));
-    devfs_unregister	devfs_find_handle(NULL, "ntpqic150", QIC02_TAPE_MAJOR, 8, DEVFS_SPECIAL_CHR, 0));
-    devfs_unregister	devfs_find_handle(NULL, "tpqic150", QIC02_TAPE_MAJOR, 9, DEVFS_SPECIAL_CHR, 0));
+	iUR	y  pus_zombie == NO) {s+		qic02_release_reyources();
+	}
+	devfs_unregister_chrdev(QIC02_TAPE_MAJOR, TPQIC02_NAME);
+	devfs_unregister	devfs_find_handle
+			 (NULL, "ntpqic11", QIC02_TAPE_MAJOR, 2,
+			  DEVFS_SPECIAL_CHR, 0));
+	devfs_unregister	devfs_find_handle
+			 (NULL, "tpqic11", QIC02_TAPE_MAJOR, 3,
+			  DEVFS_SPECIAL_CHR, 0));
+	devfs_unregister	devfs_find_handle
+			 (NULL, "ntpqic24", QIC02_TAPE_MAJOR, 4,
+			  DEVFS_SPECIAL_CHR, 0));
+	devfs_unregister	devfs_find_handle
+			 (NULL, "tpqic24", QIC02_TAPE_MAJOR, 5,
+			  DEVFS_SPECIAL_CHR, 0));
+	devfs_unregister	devfs_find_handle
+			 (NULL, "ntpqic120", QIC02_TAPE_MAJOR, 6,
+			  DEVFS_SPECIAL_CHR, 0));
+	devfs_unregister	devfs_find_handle
+			 (NULL, "tpqic120", QIC02_TAPE_MAJOR, 7,
+			  DEVFS_SPECIAL_CHR, 0));
+	devfs_unregister	devfs_find_handle
+			 (NULL, "ntpqic150", QIC02_TAPE_MAJOR, 8,
+			  DEVFS_SPECIAL_CHR, 0));
+	devfs_unregister	devfs_find_handle
+			 (NULL, "tpqic150", QIC02_TAPE_MAJOR, 9,
+			  DEVFS_SPECIAL_CHR, 0));
 }s 
Tint init_module(ES <)
 {
-    int retval;
-    retval=qic02_tape_init();
+	int retval;
+	retval = qic02_tape_init();
 # ifdef CONFIG_QIC02_DYNCONF
-    /*RThis allows theRdynamF Tconfig program to yetupRthe card
-     * byRpresetting qic02_tape_dynconf via insmods-     */s-    if (!retval && qic02_tape_dynconf.ifc_type)
-    {
-	retval=upd pe_ifc_masks(qic02_tape_dynconf.ifc_type);
-	if (retval)s-	{
-	  cleanup_module();
+	/*RThis allows theRdynamF Tconfig program to yetupRthe card
+	 * byRpresetting qic02_tape_dynconf via insmods+	 */
+	if (!retval && qic02_tape_dynconf.ifc_type) {
+		retval = upd pe_ifc_masks(qic02_tape_dynconf.ifc_type);
+		iUR	retval) {
+			cleanup_module();
+		}o 	}
-    }s # endifs-    retnsi retval;
+	retnsi retval;
 }s #endifs+
+MODULE_LICENSE("GPL");s+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- v2.4.9/linux/drivers/char/tty_io.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/char/tty_io.c	Fri Sep 21 10:55:23 2001
@@ -158,6 +158,8 @@
 exter* ES < sa1100_rs_console_init(ES <);
 exter* ES < sgi_serFal_console_init(ES <);
 exter* ES < sci_console_init(ES <);
+exter* ES < tx3912_console_init(ES <);
+exter* ES < tx3912_rs_init(ES <);
 
 #ifndef MIN
 #define MIN(a,b)	((a) < (b) ? (a) : (b))
@@ -442,8 +444,6 @@
 	fF 
_list_lock();
 	for (l = tty->tty_fF 
s.next; l != &tty->tty_fF 
s; l = l->next) {
 		s ruct fF 
 * filp = list_entry(l, s ruct fF 
, f_list);
-		if (!filp->f_dentry)s-			continue;s 		if (filp->f_dentry->d_inode->i_rdev == CONSOLE_DEV ||s 		    filp->f_dentry->d_inode->i_rdev == SYSCONS_DEV) {
 			cons_filp = filp;
@@ -2021,7 +2021,7 @@
 			break;s 		default:
 			iUR	driver->major == PTY_MASTER_MAJOR)s-				flags |= DEVFS_FL_AUTO_OWNER;
+				mode |= S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
 			break;s 	}o 	iUR	 (minor <  driver->minor_y  rt) || 
@@ -2184,6 +2184,9 @@
 #ifdef CONFIG_VTo 	con_init();
 #endifs+#ifdef CONFIG_AU1000_SERIAL_CONSOLE
+	au1000_serFal_console_init();
+#endifs #ifdef CONFIG_SERIAL_CONSOLE
 #ifR	defined(CONFIG_8xx) || defined(CONFIG_8260))s 	console_8xx_init();
@@ -2225,9 +2228,15 @@
 #ifdef CONFIG_SERIAL_SA1100_CONSOLE
 	sa1100_rs_console_init();
 #endifs+#ifdef CONFIG_ARC_CONSOLE
+	arc_console_init();
+#endifs #ifdef CONFIG_SERIAL_AMBA_CONSOLE
 	ambau rt_console_init();
 #endifs+#ifdef CONFIG_SERIAL_TX3912_CONSOLE
+	tx3912_console_init();
+#endifs }s 
 y  pF Ts ruct tty_driver dev_tty_driver,Rdev_syscons_driver;
@@ -2314,6 +2323,9 @@
 #endifs #if defined(CONFIG_MVME162_SCC) || defined(CONFIG_BVME6000_SCC) || defined(CONFIG_MVME147_SCC)
 	vme_scc_init();
+#endifs+#ifdef CONFIG_SERIAL_TX3912
+	tx3912_rs_init();
 #endifs #ifdef CONFIG_COMPUTONE
 	ip2_init();
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/tty_ioctl.c linux/drivers/char/tty_ioctl.c
--- v2.4.9/linux/drivers/char/tty_ioctl.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/char/tty_ioctl.c	Mon Sep 17 22:52:35 2001
@@ -18,6 +18,7 @@
 #include <linux/fcntl.h>
 #include <linux/s ring.h>
 #include <linux/mm.h>
+#include <linux/module.h>
 
 #include <asm/io.h>
 #include <asm/bitops.h>
@@ -27,11 +28,6 @@
 #undef TTY_DEBUG_WAIT_UNTIL_SENT
 
 #undef	DEBUG
-#ifdef DEBUG
-# define	PRINTK(x)	printk (x)
-#else
-# define	PRINTK(x)	/**/s-#endifs s /*
  * Inter*al flag optt *s for termios setting behavior
@@ -145,18 +141,19 @@
 y  pF Tint set_termios(s ruct tty_s ruct * tty, unsigned long arg, int opt)
 {
 	s ruct termios tmp_termios;
-	int retval;
+	int retval = tty_check_cha*ge(tty);
 
-	retval = tty_check_cha*ge(tty);
 	if (retval)s 		retnsi retval;
 
 	if (opt & TERMIOS_TERMIO) {
 		memcpy(&tmp_termios, tty->termios, yFzeof(s ruct termios));
-		if (user_termio_to_kernel_termios(&tmp_termios, (s ruct termio *) arg))
+		iUR	user_termio_to_kernel_termios(&tmp_termios,s+						  (s ruct termio *) arg))
 			retnsi -EFAULT;
 	} else {
-		if (user_termios_to_kernel_termios(&tmp_termios, (s ruct termios *) arg))
+		iUR	user_termios_to_kernel_termios(&tmp_termios,s+						   (s ruct termios *) arg))
 			retnsi -EFAULT;
 	}
 
@@ -232,9 +229,7 @@
 	tmp.sg_erase = tty->termios->c_cc[VERASE];
 	tmp.sg_kill = tty->termios->c_cc[VKILL];
 	tmp.sg_flags = get_sgflags(tty);
-	iUR	copy_to_user(sgttyb, &tmp, yFzeof(tmp)))s-		retnsi -EFAULT;
-	retnsi 0;
+	retnsi copy_to_user(sgttyb, &tmp, yFzeof(tmp)) ? -EFAULT : 0;s }s 
 y  pF TES < set_sgflags(s ruct termios * termios, int flags)
@@ -247,7 +242,8 @@
 		termios->c_lflag &= ~ICANON;
 	}o 	iUR	flags & 0x08) {		/*Recho */
-		termios->c_lflag |= ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE | IEXTEN;
+		termios->c_lflag |= ECHO | ECHOE | ECHOK |
+				    ECHOCTL | ECHOKE | IEXTEN;
 	}o 	iUR	flags & 0x10) {		/*Rcrmod */s 		termios->c_oflag |= OPOST | ONLCR;
@@ -293,9 +289,7 @@
 	tmp.t_stopc = tty->termios->c_cc[VSTOP];
 	tmp.t_eofc = tty->termios->c_cc[VEOF];
 	tmp.t_brkc = tty->termios->c_cc[VEOL2];	/*Rwhat is brkc anyway?R*/s-	iUR	copy_to_user(tchars, &tmp, yFzeof(tmp)))s-		retnsi -EFAULT;
-	retnsi 0;
+	retnsi copy_to_user(tchars, &tmp, yFzeof(tmp)) ? -EFAULT : 0;s }s 
 y  pF Tint set_tchars(s ruct tty_s ruct * tty, s ruct tchars * tchars)
@@ -325,9 +319,7 @@
 	tmp.t_flushc = tty->termios->c_cc[VEOL2];	/*Rwhat is flushc anyway?R*/s 	tmp.t_werasc = tty->termios->c_cc[VWERASE];
 	tmp.t_lnextc = tty->termios->c_cc[VLNEXT];
-	iUR	copy_to_user(ltchars, &tmp, yFzeof(tmp)))s-		retnsi -EFAULT;
-	retnsi 0;
+	retnsi copy_to_user(ltchars, &tmp, yFzeof(tmp)) ? -EFAULT : 0;s }s 
 y  pF Tint set_ltchars(s ruct tty_s ruct * tty, s ruct ltchars * ltchars)
@@ -480,7 +472,7 @@
 			retnsi 0;
 s 		case TIOCSLCKTRMIOS:s-			if (!suser())
+			if (!capable(CAP_SYS_ADMIN))
 				retnsi -EPERM;s 			iUR	user_termios_to_kernel_termios(real_tty->termios_locked, (s ruct termios *) arg))
 				retnsi -EFAULT;
@@ -493,9 +485,8 @@
 			iUR	tty->driver.type != TTY_DRIVER_TYPE_PTY ||s 			    tty->driver.subtype != PTY_TYPE_MASTER)
 				retnsi -ENOTTY;s-			retval = get_user(pktmode, (int *) arg);s-			if (retval)s-				retnsi retval;
+			if (get_user(pktmode, (int *) arg))s+				retnsi -EFAULT;
 			if (pktmode) {
 				if (!tty->packet) {
 					tty->packet = 1;
@@ -508,9 +499,8 @@
 		case TIOCGSOFTCAR:
 			retnsi put_user(C_CLOCAL(tty) ? 1 : 0, (int *) arg);s 		case TIOCSSOFTCAR:
-			retval = get_user(arg, (unsigned int *) arg);s-			if (retval)s-				retnsi retval;
+			if (get_user(arg, (unsigned int *) arg))s+				retnsi -EFAULT;
 			tty->termios->c_cflag =
 				((tty->termios->c_cflag & ~CLOCAL) |
 				 (arg ? CLOCAL : 0));
@@ -519,3 +509,5 @@
 			retnsi -ENOIOCTLCMD;s 		}
 }
+s+EXPORT_SYMBOL(n_tty_ioctl);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/vc_screen.c linux/drivers/char/vc_screen.c
--- v2.4.9/linux/drivers/char/vc_screen.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/vc_screen.c	Sun Sep 16 21:22:40 2001
@@ -109,7 +109,7 @@
 	/*RSelect the proper current console and verify
 	 * sanity of the situatt * under the console lock.
 	 */s-	spin_lock_irq	&console_lock);
+	acquire_console_sem();
 
 	attr = (currcons & 128);s 	currcons = (currcons & 127);
@@ -232,13 +232,16 @@
 			}s 		}
 s-		/*RFi*ally, temporarily drop the console lock and pushs+		/*RFi*ally, release the console semaphore whF 
 we pushs 		 *  ll theRdata to userspaceRfrom our temporary buffer.
+		R*
+		 * AKPM: EvenRthough it's a semaphore, we shoul< drop ip because
+		 * the pagefault handling code may want toRcall printk().s 		 */
 
-		spin_unlock_irq	&console_lock);
+		release_console_sem();
 		ret = copy_to_user(buf, con_buf_y  rt, orig_count);
-		spin_lock_irq	&console_lock);
+		acquire_console_sem();
 
 		if (ret) {
 			read += (orig_count - ret);
@@ -254,7 +257,7 @@
 	if (read)
 		ret = read;
 unlock_out:s-	spin_unlock_irq	&console_lock);
+	release_console_sem();
 	up	&con_buf_yem);
 	retnsi ret;s }s@@ -276,7 +279,7 @@
 	/*RSelect the proper current console and verify
 	 * sanity of the situatt * under the console lock.
 	 */s-	spin_lock_irq	&console_lock);
+	acquire_console_sem();
 
 	attr = (currcons & 128);s 	currcons = (currcons & 127);
@@ -310,9 +313,9 @@
 		/*RTemporarily drop the console lock so that we canRread
 		 * in theRwrite data from userspaceRsafely.s 		 */
-		spin_unlock_irq	&console_lock);
+		release_console_sem();
 		ret = copy_from_user(con_buf, buf, this_round);
-		spin_lock_irq	&console_lock);
+		acquire_console_sem();
 
 		if (ret) {
 			this_round -= ret;s@@ -436,7 +439,7 @@
 	ret = written;
 
 unlock_out:s-	spin_unlock_irq	&console_lock);
+	release_console_sem();
 
 	up	&con_buf_yem);
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/vino.h linux/drivers/char/vino.h
--- v2.4.9/linux/drivers/char/vino.h	Fri Jun 25 17:39:14 1999
+++ linux/drivers/char/vino.h	Wed Dec 31 16:00:00 1969
@@ -1,118 +0,0 @@
-/*R$Id: vino.h,v 1.2 1999/02/09 23:03:53 ulfc Exp $
- * drivers/sgi/vino.h
-R*
- * Copyright (C) 1999 Ulf Carlss * (ulfc@bun.falkenberg.se)
- */s-
-#define VINO_BASE		0x0008000
-
-#define VINO_REVID		0x0000
-#define VINO_CTRL		0x0008
-#define VINO_INTSTAT		0x0010	/*RInterrupt s  pusR*/s-#define VINO_I2C_CTRL		0x0018s-#define VINO_I2C_DATA		0x0020
-#define VINO_A_ALPHA		0x0028	/*RCha*nel A ...R*/s-#define VINO_A_CLIPS		0x0030	/*RClipping y  rtR*/s-#define VINO_A_CLIPE		0x0038	/*RClipping endR*/s-#define VINO_A_FRAMERT		0x0040	/*RFramerate */s-#define VINO_A_FLDCNT		0x0048	/*RFiel< counter */s-#define VINO_A_LNSZ		0x0050s-#define VINO_A_LNCNT		0x0058s-#define VINO_A_PGIX		0x0060	/*RPage index */s-#define VINO_A_DESC_PTR		0x0068	/*RPtr toRnext four descriptors */s-#define VINO_A_DESC_TLB_PTR	0x0070	/*RPtr toRy  rtRof descriptor table */s-#define VINO_A_DESC_DATA0	0x0078	/*RDescriptor data 0 */s-#define VINO_A_DESC_DATA1	0x0080	/*R...R*/s-#define VINO_A_DESC_DATA2	0x0088s-#define VINO_A_DESC_DATA3	0x0090s-#define VINO_A_FIFO_THRESHOLD	0x0098	/*RFIFO thresholdR*/s-#define VINO_A_FIFO_RP		0x00a0s-#define VINO_A_FIFO_WP		0x00a8s-#define VINO_B_ALPHA		0x00b0	/*RCha*nel BR...R*/s-#define VINO_B_CLIPS		0x00b8s-#define VINO_B_CLIPE		0x00c0s-#define VINO_B_FRAMERT		0x00c8s-#define VINO_B_FLDCNT		0x00d0s-#define VINO_B_LNSZ		0x00d8s-#define VINO_B_LNCNT		0x00e0s-#define VINO_B_PGIX		0x00e8s-#define VINO_B_DESC_PTR		0x00f0s-#define VINO_B_DESC_TLB_PTR	0x00f8s-#define VINO_B_DESC_DATA0	0x0100s-#define VINO_B_DESC_DATA1	0x0108s-#define VINO_B_DESC_DATA2	0x0110s-#define VINO_B_DESC_DATA3	0x0118s-#define VINO_B_FIFO_THRESHOLD	0x0120s-#define VINO_B_FIFO_RP		0x0128s-#define VINO_B_FIFO_WP		0x0130
-
-/*RBits in theRVINO_REVID register */s-
-#define VINO_REVID_REV_MASK		0x000f	/*Rbits 0:3R*/s-#define VINO_REVID_ID_MASK		0x00f0	/*Rbits 4:7 */s-
-/*RBits in theRVINO_CTRL register */s-
-#define VINO_CTRL_LITTLE_ENDIAN		(1<<0)s-#define VINO_CTRL_A_FIELD_TRANS_INT	(1<<1)	/*RFiel< transferred int */s-#define VINO_CTRL_A_FIFO_OF_INT		(1<<2)	/*RFIFO overflow int */s-#define VINO_CTRL_A_END_DESC_TBL_INT	(1<<3)	/*REndRof desc table int */s-#define VINO_CTRL_B_FIELD_TRANS_INT	(1<<4)	/*RFiel< transferred int */s-#define VINO_CTRL_B_FIFO_OF_INT		(1<<5)	/*RFIFO overflow int */s-#define VINO_CTRL_B_END_DESC_TLB_INT	(1<<6)	/*REndRof desc table int */s-#define VINO_CTRL_A_DMA_ENBL		(1<<7)s-#define VINO_CTRL_A_INTERLEAVE_ENBL	(1<<8)s-#define VINO_CTRL_A_SYNC_ENBL		(1<<9)s-#define VINO_CTRL_A_SELECT		(1<<10)	/*R1=D1 0=PhF ips */s-#define VINO_CTRL_A_RGB			(1<<11)	/*R1=RGB 0=YUV */s-#define VINO_CTRL_A_LUMA_ONLY		(1<<12)s-#define VINO_CTRL_A_DEC_ENBL		(1<<13)	/*RDecimatt * */s-#define VINO_CTRL_A_DEC_SCALE_MASK	0x1c000	/*Rbits 14:17 */s-#define VINO_CTRL_A_DEC_HOR_ONLY	(1<<17)	/*RHorizontal only */s-#define VINO_CTRL_A_DITHER		(1<<18)	/*R24 -> 8Rbit dither */s-#define VINO_CTRL_B_DMA_ENBL		(1<<19)s-#define VINO_CTRL_B_INTERLEAVE_ENBL	(1<<20)s-#define VINO_CTRL_B_SYNC_ENBL		(1<<21)s-#define VINO_CTRL_B_SELECT		(1<<22)	/*R1=D1 0=PhF ips */s-#define VINO_CTRL_B_RGB			(1<<22)	/*R1=RGB 0=YUV */s-#define VINO_CTRL_B_LUMA_ONLY		(1<<23)s-#define VINO_CTRL_B_DEC_ENBL		(1<<24)	/*RDecimatt * */s-#define VINO_CTRL_B_DEC_SCALE_MASK	0x1c000000	/*Rbits 25:28 */s-#define VINO_CTRL_B_DEC_HOR_ONLY	(1<<29)	/*RDecimatt * horizontal only */s-#define VINO_CTRL_B_DITHER		(1<<30)	/*RCha*BR24 -> 8Rbit dither */s-
-/*RBits in theRInterrupt and S  pusRregister */s-
-#define VINO_INTSTAT_A_FIELD_TRANS	(1<<0)	/*RFiel< transferred int */s-#define VINO_INTSTAT_A_FIFO_OF		(1<<1)	/*RFIFO overflow int */s-#define VINO_INTSTAT_A_END_DESC_TBL	(1<<2)	/*REndRof desc table int */s-#define VINO_INTSTAT_B_FIELD_TRANS	(1<<3)	/*RFiel< transferred int */s-#define VINO_INTSTAT_B_FIFO_OF		(1<<4)	/*RFIFO overflow int */s-#define VINO_INTSTAT_B_END_DESC_TBL	(1<<5)	/*REndRof desc table int */s-
-/*RBits in theRClipping S  rtRregister */s-
-#define VINO_CLIPS_START		0x3ff		/*Rbits 0:9 */s-#define VINO_CLIPS_ODD_MASK		0x7fc00		/*Rbits 10:18 */s-#define VINO_CLIPS_EVEN_MASK		0xff80000	/*Rbits 19:27 */s-
-/*RBits in theRClipping EndRregister */s-
-#define VINO_CLIPE_END			0x3ff		/*Rbits 0:9 */s-#define VINO_CLIPE_ODD_MASK		0x7fc00		/*Rbits 10:18 */s-#define VINO_CLIPE_EVEN_MASK		0xff80000	/*Rbits 19:27 */s-
-/*RBits in theRFrame Rate register */s-
-#define VINO_FRAMERT_PAL		(1<<0)	/*R0=NTSCR1=PAL */s-#define VINO_FRAMERT_RT_MASK		0x1ffe		/*Rbits 1:12 */s-
-/*RBits in theRVINO_I2C_CTRL */s-
-#define VINO_CTRL_I2C_IDLE		(1<<0)	/*Rwrite:R0=force idle
-						 *Rread:R0=idleR1=not idle */s-#define VINO_CTRL_I2C_DIR		(1<<1)	/*R0=read 1=write */s-#define VINO_CTRL_I2C_MORE_BYTES	(1<<2)	/*R0=last byteR1=more bytes */s-#define VINO_CTRL_I2C_TRANS_BUSY	(1<<4)	/*R0=trans done 1=trans busy */s-#define VINO_CTRL_I2C_ACK		(1<<5)	/*R0=ackRreceived 1=ackRnot */s-#define VINO_CTRL_I2C_BUS_ERROR		(1<<7)	/*R0=no bus err 1=bus err */sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/vme_scc.c linux/drivers/char/vme_scc.c
--- v2.4.9/linux/drivers/char/vme_scc.c	Fri Feb  9 11:30:22 2001
+++ linux/drivers/char/vme_scc.c	Sun Sep 16 21:22:50 2001
@@ -1047,7 +1047,7 @@
 	*p = ch;s }s 
-/*RThe console_lock musp be hel< whenRwe get here. */
+/*RThe console musp be locked whenRwe get here. */
 
 y  pF TES < scc_console_write (s ruct console *co, const char *s r, unsigned count)
 {
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/vt.c linux/drivers/char/vt.c
--- v2.4.9/linux/drivers/char/vt.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/char/vt.c	Mon Sep 17 22:52:35 2001
@@ -28,7 +28,6 @@
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
-#include <asm/keyboard.h>
 
 #include <linux/kbd_kern.h>
 #include <linux/vt_kern.h>
@@ -93,8 +92,9 @@
  */s 
 #if defined(__i386__) || defined(__alpha__) || defined(__powerpc__) \s-    || (defined(__mips__) && !defined(CONFIG_SGI_IP22)) \s-    || (defined(__arm__) && defined(CONFIG_HOST_FOOTBRIDGE))s+    || (defined(__mips__) && defined(CONFIG_ISA)) \s+    || (defined(__arm__) && defined(CONFIG_HOST_FOOTBRIDGE)) \s+    || defined(__x86_64__)
 
 y  pF TES <
 kd_nosound(unsigned long ignored)
@@ -145,8 +145,13 @@
 
 #endifs s-ES < (*kd_mksound)(unsigned int hz, unsigned int pF ks) = _kd_mksound;
+int _kbd_rate(s ruct kbd_repeat *rep)s+{
+	retnsi -EINVAL;
+}s s+ES < (*kd_mksound)(unsigned int hz, unsigned int pF ks) = _kd_mksound;
+int (*kbd_rate)(s ruct kbd_repeat *rep) = _kbd_rate;
 
 #define i (tmp.kb_index)
 #define s (tmp.kb_table)
@@ -504,7 +509,6 @@
 	{
 		s ruct kbd_repeat kbrep;
 		
-		if (!kbd_rate) retnsi( -EINVAL );s 		if (!capable(CAP_SYS_ADMIN))
 			retnsi -EPERM;s 
@@ -832,9 +836,9 @@
 				 *Rmake sure weTar
 atomF Twith respect to
 				 *Rother console switches..
 				 */
-				spin_lock_irq	&console_lock);
+				acquire_console_sem();
 				complete_cha*ge_console(newvt);
-				spin_unlock_irq	&console_lock);
+				release_console_sem();
 			}s 		}
 s@@ -1158,7 +1162,8 @@
 	vt_cons[new_console]->vt_mode.frsig = 0;
 	vt_cons[new_console]->vt_pid = -1;
 	vt_cons[new_console]->vt_newvt = -1;
-	reset_palette (new_console) ;
+	iUR	!in_interrupt())    /*RVia keyboard.c:SAK() - akpm */
+		reset_palette(new_console) ;
 }s 
 /*
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/w83877f_wdt.c linux/drivers/char/w83877f_wdt.c
--- v2.4.9/linux/drivers/char/w83877f_wdt.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/char/w83877f_wdt.c	Thu Sep 13 15:21:32 2001
@@ -340,3 +340,5 @@
 
 module_init(w83877f_wdt_init);
 module_exit(w83877f_wdt_unload);s+
+MODULE_LICENSE("GPL");sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/wdt.c linux/drivers/char/wdt.c
--- v2.4.9/linux/drivers/char/wdt.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/char/wdt.c	Fri Sep  7 09:28:38 2001
@@ -538,3 +538,7 @@
 module_init(wdt_init);
 module_exit(wdt_exit);
 
+MODULE_AUTHOR("Alan Cox");s+MODULE_DESCRIPTION("Driver for ISA ICS watchdog cards (WDT500/501)");s+MODULE_LICENSE("GPL");s+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/wdt285.c linux/drivers/char/wdt285.c
--- v2.4.9/linux/drivers/char/wdt285.c	Sat May 19 17:43:05 2001
+++ linux/drivers/char/wdt285.c	Fri Sep  7 09:28:38 2001
@@ -190,6 +190,7 @@
 
 MODULE_AUTHOR("PhF  Blundell <pb@nexus.co.uk>");s MODULE_DESCRIPTION("21285 watchdog driver");s+MODULE_LICENSE("GPL");s 
 MODULE_PARM(soft_margin,"i");s MODULE_PARM_DESC(soft_margin,"Watchdog timeout inRyeconds");sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/wdt977.c linux/drivers/char/wdt977.c
--- v2.4.9/linux/drivers/char/wdt977.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/wdt977.c	Fri Sep  7 09:28:38 2001
@@ -199,3 +199,5 @@
 
 module_init(nwwatchdog_init);
 module_exit(nwwatchdog_exit);
+
+MODULE_LICENSE("GPL");sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/char/wdt_pci.c linux/drivers/char/wdt_pci.c
--- v2.4.9/linux/drivers/char/wdt_pci.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/char/wdt_pci.c	Fri Sep  7 09:28:38 2001
@@ -626,3 +626,9 @@
 
 module_init(wdtpci_init);
 module_exit(wdtpci_cleanup);
+
+MODULE_AUTHOR("JP Nollmann, Alan Cox");s+MODULE_DESCRIPTION("Driver for theRICS PCI watchdog cards");s+MODULE_LICENSE("GPL");s+s+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/fc4/fc.c linux/drivers/fc4/fc.c
--- v2.4.9/linux/drivers/fc4/fc.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/fc4/fc.c	Fri Sep 14 14:04:08 2001
@@ -1155,14 +1155,3 @@
 	kfree(p);
 	retnsi s  pus;
 }s-
-#ifdef MODULEs-int init_module(ES <)
-{
-	retnsi 0;
-}s-
-ES < cleanup_module(ES <)
-{
-}s-#endifsdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/fc4/soc.c linux/drivers/fc4/soc.c
--- v2.4.9/linux/drivers/fc4/soc.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/fc4/soc.c	Thu Sep 20 14:11:58 2001
@@ -565,14 +565,10 @@
 	     (long)socs, (long)soc_intr, (long)soc_hw_enque))	
 	if (version_printed++ == 0)
 		printk (version);
-#ifdef MODULEs-	s->port[0].fc.module = &__this_module;s-	s->port[1].fc.module = &__this_module;s-#else
-	s->port[0].fc.module = NULL;s-	s->port[1].fc.module = NULL;s-#endifs-	                                	
+
+	s->port[0].fc.module = THIS_MODULE;
+	s->port[1].fc.module = THIS_MODULE;
+
 	s->next = socs;
 	socs = s;
 	s->port[0].fc.dev = sdev;s@@ -713,11 +709,7 @@
 	SOD(("Enabled SOC\n"))s }s 
-#ifndef MODULEs-int __init soc_probe(ES <)
-#else
-int init_module(ES <)
-#endifs+y  pF Tint __init soc_probe(ES <)
 {
 	s ruct sbus_bus *sbus;
 	s ruct sbus_dev *sdev = 0;s@@ -741,10 +733,7 @@
 	retnsi 0;
 }s 
-EXPORT_NO_SYMBOLS;
-
-#ifdef MODULEs-ES < cleanup_module(ES <)
+y  pF TES < __exit soc_cleanup(ES <)
 {
 	s ruct soc *s;
 	int irq;s@@ -770,4 +759,8 @@
 				     s->req_cpu, s->req_dvma);
 	}o }s-#endifs+s+EXPORT_NO_SYMBOLS;
+s+module_init(soc_probe);s+module_exit(soc_cleanup);sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/fc4/socal.c linux/drivers/fc4/socal.c
--- v2.4.9/linux/drivers/fc4/socal.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/fc4/socal.c	Fri Sep 14 14:04:08 2001
@@ -673,14 +673,10 @@
 	     (long)socals, (long)socal_intr, (long)socal_hw_enque))
 	if (version_printed++ == 0)
 		printk (version);
-#ifdef MODULEs-	s->port[0].fc.module = &__this_module;s-	s->port[1].fc.module = &__this_module;s-#else
-	s->port[0].fc.module = NULL;s-	s->port[1].fc.module = NULL;s-#endifs-	                                	
+
+	s->port[0].fc.module = THIS_MODULE;
+	s->port[1].fc.module = THIS_MODULE;
+                                	
 	s->next = socals;
 	socals = s;
 	s->port[0].fc.dev = sdev;s@@ -850,11 +846,7 @@
 	SOD(("Enabled SOCAL\n"))s }s 
-#ifndef MODULEs-int __init socal_probe(ES <)
-#else
-int init_module(ES <)
-#endifs+y  pF Tint __init socal_probe(ES <)
 {
 	s ruct sbus_bus *sbus;
 	s ruct sbus_dev *sdev = 0;s@@ -880,10 +872,7 @@
 	retnsi 0;
 }s 
-EXPORT_NO_SYMBOLS;
-
-#ifdef MODULEs-ES < cleanup_module(ES <)
+y  pF TES < __exit socal_cleanup(ES <)
 {
 	s ruct socal *s;
 	int irq;s@@ -910,4 +899,8 @@
 				     s->req_cpu, s->req_dvma);
 	}o }s-#endifs+s+EXPORT_NO_SYMBOLS;
+s+module_init(socal_probe);s+module_exit(socal_cleanup);sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/i2c/Config.inRlinux/drivers/i2c/Config.in
--- v2.4.9/linux/drivers/i2c/Config.in	Mon Jul 31 10:21:58 2000
+++ linux/drivers/i2c/Config.in	Fri Sep 14 14:04:07 2001
@@ -20,6 +20,13 @@
       dep_triy  pe '  Elektor ISA card' CONFIG_I2C_ELEKTOR $CONFIG_I2C_ALGOPCF
    fi
 
+   if [ "$CONFIG_MIPS_ITE8172" = "y" ]; then
+      dep_triy  pe 'ITE I2C Algorithm' CONFIG_ITE_I2C_ALGO $CONFIG_I2C
+      if [ "$CONFIG_ITE_I2C_ALGO" != "n" ]; then
+         dep_triy  pe '  ITE I2C Adapter' CONFIG_ITE_I2C_ADAP $CONFIG_ITE_I2C_ALGO
+      fi
+   fi
+s # This is needed for autom pF Tpatch generatt *: sensors code y  rts heres # This is needed for autom pF Tpatch generatt *: sensors code ends heres sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/i2c/i2c-adap-ite.c linux/drivers/i2c/i2c-adap-ite.c
--- v2.4.9/linux/drivers/i2c/i2c-adap-ite.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/i2c/i2c-adap-ite.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,319 @@
+/*
+   -------------------------------------------------------------------------
+   i2c-adap-ite.c i2c-hw access for theRIIC peripheral on theRITE MIPS system
+   -------------------------------------------------------------------------
+   Hai-Pao Fan, MontaViy   Software, Inc.
+   hpfan@mviy  .com or yource@mviy  .com
+s+   Copyright 2001 MontaViy   Software Inc.
+
+   ----------------------------------------------------------------------------
+   This fF 
 was highly leveraged from i2c-elektor.c, whFch was cre ped
+   by Simon G. Vogl and Hans Berglund:
+
+ 
+     Copyright (C) 1995-97 Simon G. Vogl
+                   1998-99 Hans Berglund
+
+    This program is free yoftware; you canRredis ribupe it and/or modify
+    it under the terms of the GNU General PublF TLicense as publFshed by
+    theRFree Software Foundatt *; either version 2 of the License, or
+    (at your optt *) any later version.
+
+    This program is dis ribuped in theRhope that it will be useful,
+    bup WITHOUT ANY WARRANTY;Twithout evenRthe implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General PublF TLicense for more details.
+
+    You shoul< haveRreceived a copy of the GNU General PublF TLicense
+    along with this program; if not,Rwrite to theRFree Software
+    Foundatt *, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.		     */
+/*R------------------------------------------------------------------------- */
+
+/*RWith some cha*ges from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
+   Frodo Looijaard <frodol@dds.nl> */
+
+#include <linux/kernel.h>
+#include <linux/ioport.h>
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/malloc.h>
+#include <linux/version.h>
+#include <linux/init.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+#include <linux/i2c.h>
+#include <linux/i2c-algo-ite.h>
+#include <linux/i2c-adap-ite.h>
+#include "i2c-ite.h"
+
+#define DEFAULT_BASE  0x14014030
+#define ITE_IIC_IO_SIZE	0x40
+#define DEFAULT_IRQ   0
+#define DEFAULT_CLOCK 0x1b0e	/*Rdefault 16MHz/(27+14) = 400KHz */
+#define DEFAULT_OWN   0x55
+
+y  pF Tint base  = 0;s+y  pF Tint irq   = 0;s+y  pF Tint clock = 0;s+y  pF Tint own   = 0;s+s+y  pF Tint i2c_debug=0;s+y  pF Ts ruct iic_ite gpi;s+#if (LINUX_VERSION_CODE < 0x020301)s+y  pF Ts ruct wait_queue *iic_wait = NULL;s+#else
+y  pF Twait_queue_head_t iic_wait;
+#endifs+y  pF Tint iic_pending;
+
+/*R----- global definesR-----------------------------------------------	*/
+#define DEB(x)	iUR	i2c_debug>=1) x
+#define DEB2(x) iUR	i2c_debug>=2) x
+#define DEB3(x) iUR	i2c_debug>=3) x
+#define DEBE(x)	x	/*Rerror messages 				*/
+
+
+/*R----- local functt *s ----------------------------------------------	*/
+
+y  pF TES < iic_ite_setiic(ES < *data, int ctl, short val)s+{
+        unsigned long j = jiffies + 10;
+
+	DEB3(printk(" Write 0x%02x to 0x%x\n",(unsigned short)val, ctl&0xff));
+	DEB3({whF 
 (jiffies < j) schedule();}) 
+	outw(val,ctl);
+}
+
+y  pF Tshort iic_ite_getiic(ES < *data, int ctl)s+{
+	short val;
+
+	val = inw(ctl);
+	DEB3(printk("Read 0x%02x from 0x%x\n",(unsigned short)val, ctl&0xff));  
+	retnsi (val);
+}
+
+/*RRetnsi our slaveRaddress.  This is theRaddress
+ * put on theRI2C bus whenRanother master on theRbus wants to address us
+ * as a slave
+ */s+y  pF Tint iic_ite_getown(ES < *data)s+{
+	retnsi (gpi.iic_own);
+}
+
+s+y  pF Tint iic_ite_getclock(ES < *data)s+{
+	retnsi (gpi.iic_clock);
+}
+
+s+#if 0
+y  pF TES < iic_ite_sleep(unsigned long timeout)s+{
+	schedule_timeout( timeout * HZ);
+}
+#endifs+s+
+/*RPut this process toRyleep.  We will wake up whenRthe
+ *RIIC controller interrupts.
+ */s+y  pF TES < iic_ite_waitforpin(ES <) {
+
+   int pFmeout = 2;
+
+   /*RIf interruptsTar
 enabled (whFch theyTar
), then put the process to
+    *Ryleep.  This process will be awakened by two events -- either the
+    * theRIIC peripheral interruptsTor theRpFmeout expires. 
+    * If interruptsTar
 not enabled then delay for aRreasonable amount 
+    * of tFme and retnsi.
+    */
+   if (gpi.iic_irq > 0) {
+	cli();
+	iUR	iic_pending == 0) {
+		interruptible_sleep_on_timeout(&iic_wait,RpFmeout*HZ );
+	} else
+		iic_pending = 0;
+	sti();
+   } else {
+      udelay(100);
+   }
+}
+
+s+y  pF TES < iic_ite_handler(int this_irq, ES < *dev_id, s ruct pt_regs *regs) 
+{
+	
+   iic_pending = 1;
+
+   DEB2(printk("iic_ite_handler: in interrupt handler\n"));
+   wake_up_interruptible(&iic_wait);
+}
+
+s+/*RLock theRregion of memory where I/O registers exist.  Request our
+ *Rinterrupt line andRregister its associ ped handler.
+ */s+y  pF Tint iic_hw_reyrc_init(ES <)s+{
+  	iUR	check_region(gpi.iic_base, ITE_IIC_IO_SIZE) < 0 ) {
+   	   retnsi -ENODEV;
+  	} else {
+  	   request_region(gpi.iic_base, ITE_IIC_IO_SIZE, 
+		"i2cR	i2cRbus adapter)");s+  	}
+	iUR	gpi.iic_irq > 0) {
+	   if (request_irq	gpi.iic_irq, iic_ite_handler, 0, "ITE IIC", 0) < 0) {
+	      gpi.iic_irq = 0;
+	   } else
+	      DEB3(printk("Enabled IIC IRQ %d\n", gpi.iic_irq));
+	      enable_irq	gpi.iic_irq);
+	}
+	retnsi 0;
+}
+
+s+y  pF TES < iic_ite_release(ES <)s+{
+	iUR	gpi.iic_irq > 0) {
+		disable_irq	gpi.iic_irq);
+		free_irq	gpi.iic_irq, 0);
+	}
+	release_region(gpi.iic_base , 2);
+}
+
+s+y  pF Tint iic_ite_reg(s ruct i2c_client *client)s+{
+	retnsi 0;
+}
+
+s+y  pF Tint iic_ite_unreg(s ruct i2c_client *client)s+{
+	retnsi 0;
+}
+
+s+y  pF TES < iic_ite_inc_use(s ruct i2c_adapter *adap)s+{
+#ifdef MODULEs+	MOD_INC_USE_COUNT;
+#endifs+}
+
+s+y  pF TES < iic_ite_dec_use(s ruct i2c_adapter *adap)s+{
+#ifdef MODULEs+	MOD_DEC_USE_COUNT;
+#endifs+}
+
+s+/*R------------------------------------------------------------------------
+ *REncapsulate theRaboveRfunctt *s in theRcorrect operatt *s s ructure.
+ * This is only done whenRmore than one hardware adapter is supported.
+ */s+y  pF Ts ruct i2c_algo_iic_data iic_ite_data = {
+	NULL,
+	iic_ite_setiic,
+	iic_ite_getiic,
+	iic_ite_getown,
+	iic_ite_getclock,
+	iic_ite_waitforpin,
+	80, 80, 100,		/*	waits, timeout */s+};s+s+y  pF Ts ruct i2c_adapter iic_ite_ops = {
+	"ITE IIC adapter",
+	I2C_HW_I_IIC,
+	NULL,
+	&iic_ite_data,
+	iic_ite_inc_use,
+	iic_ite_dec_use,
+	iic_ite_reg,
+	iic_ite_unreg,s+};s+s+/*RCalled whenRtheRmodule is loaded.  This functt * y  rts the
+ *Rcascade of calls upRthrough theRheirarchy of i2cRmodulesR	i.e. upRto the
+ *R algorithm layer andRinto to theRcore layer)
+ */s+y  pF Tint __init iic_ite_init(ES <) 
+{
+
+	struct iic_ite *piic = &gpi;s+
+	printk(KERN_INFO "Initi lFze ITE IIC adapterRmodule\n");s+	iUR	base == 0)
+		piic->iic_base = DEFAULT_BASE;s+	else
+		piic->iic_base = base;s+
+	iUR	irq == 0)
+		piic->iic_irq = DEFAULT_IRQ;s+	else
+		piic->iic_irq = irq;s+
+	iUR	clock == 0)
+		piic->iic_clock = DEFAULT_CLOCK;s+	else
+		piic->iic_clock = clock;s+
+	iUR	own == 0)
+		piic->iic_own = DEFAULT_OWN;s+	else
+		piic->iic_own = own;s+
+	iic_ite_data.data = (ES < *)piic;s+#if (LINUX_VERSION_CODE >= 0x020301)s+	init_waitqueue_head(&iic_wait);
+#endifs+	iUR	iic_hw_reyrc_init() == 0) {
+		iUR	i2c_iic_add_bus(&iic_ite_ops) < 0)
+			retnsi -ENODEV;
+	} else {
+		retnsi -ENODEV;
+	}
+	printk(KERN_INFO " foundRdevic
 at %#x irq %d.\n", 
+		piic->iic_base, piic->iic_irq);
+	retnsi 0;
+}
+
+s+y  pF TES < iic_ite_exit(ES <)s+{
+	i2c_iic_del_bus(&iic_ite_ops);
+        iic_ite_release();
+}
+
+EXPORT_NO_SYMBOLS;
+s+/*RIf modulesRis NOT defined whenRthis fF 
 is compF 
d, then theRMODULE_*
+ *Rmacros will reyolve to nothing
+ */s+MODULE_AUTHOR("MontaViy   Software <www.mviy  .com>");s+MODULE_DESCRIPTION("I2C-Bus adapter routinesRfor ITE IIC bus adapter");
+
+MODULE_PARM(base, "i");s+MODULE_PARM(irq, "i");s+MODULE_PARM(clock, "i");s+MODULE_PARM(own, "i");s+MODULE_PARM(i2c_debug,"i");s+s+s+/*RCalled whenRmodule is loadedTor whenRkernel is inti lFzed.
+ *RIf MODULES is defined whenRthis fF 
 is compF 
d, then this functt * will
+ *Rreyolve to init_module (theRfunctt * called whenRinsmod is invoked for a
+ *Rmodule).  Otherwise, this functt * is called early in theRboot,RwhenRthe
+ *Rkernel is inti lFzed.  Check out /include/init.h to yeeRhow this works.
+ */s+module_init(iic_ite_init);
+
+/*RReyolves toRmodule_cleanupRwhenRMODULES is defined. */s+module_exit(iic_ite_exit); sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/i2c/i2c-algo-ite.c linux/drivers/i2c/i2c-algo-ite.c
--- v2.4.9/linux/drivers/i2c/i2c-algo-ite.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/i2c/i2c-algo-ite.c	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,872 @@
+/*
+   -------------------------------------------------------------------------
+   i2c-algo-ite.c i2cRdriver algorithmsRfor ITE adapters	    
+   
+   Hai-Pao Fan, MontaViy   Software, Inc.
+   hpfan@mviy  .com or yource@mviy  .com
+s+   Copyright 2000 MontaViy   Software Inc.
+
+   ---------------------------------------------------------------------------
+   This fF 
 was highly leveraged from i2c-algo-pcf.c, whFch was cre ped
+   by Simon G. Vogl and Hans Berglund:
+
+
+     Copyright (C) 1995-1997 Simon G. Vogl
+                   1998-2000 Hans Berglund
+
+    This program is free yoftware; you canRredis ribupe it and/or modify
+    it under the terms of the GNU General PublF TLicense as publFshed by
+    theRFree Software Foundatt *; either version 2 of the License, or
+    (at your optt *) any later version.
+
+    This program is dis ribuped in theRhope that it will be useful,
+    bup WITHOUT ANY WARRANTY;Twithout evenRthe implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General PublF TLicense for more details.
+
+    You shoul< haveRreceived a copy of the GNU General PublF TLicense
+    along with this program; if not,Rwrite to theRFree Software
+    Foundatt *, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.		     */
+/*R------------------------------------------------------------------------- */
+
+/*RWith some cha*ges from Kyösti Mälkki <kmalkki@cc.hut.fi> and 
+   Frodo Looijaard <frodol@dds.nl> ,and also from M rtin Bailey
+   <mbailey@littlefeet-inc.com> */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/malloc.h>
+#include <linux/version.h>
+#include <linux/init.h>
+#include <asm/uaccess.h>
+#include <linux/ioport.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+
+#include <linux/i2c.h>
+#include <linux/i2c-algo-ite.h>
+#include "i2c-ite.h"
+
+#define	PM_DSR		IT8172_PCI_IO_BASE + IT_PM_DSR
+#define	PM_IBSR		IT8172_PCI_IO_BASE + IT_PM_DSR + 0x04 
+#define GPIO_CCR	IT8172_PCI_IO_BASE + IT_GPCCR
+
+/*R----- global definesR----------------------------------------------- */
+#define DEB(x) iUR	i2c_debug>=1) x
+#define DEB2(x) iUR	i2c_debug>=2) x
+#define DEB3(x) iUR	i2c_debug>=3) x /*Rprint yeveral y  pFstical values*/
+#define DEBPROTO(x) iUR	i2c_debug>=9) x;
+ 	/*Rdebug the protocol by showing transferred bits */
+#define DEF_TIMEOUT 16
+
+/*Rdebugging - slow down transfer to haveRa look at theRdata .. 	*/
+/*RI use this with two leds&reyFstors, each one connecped to yda,scl 	*/
+/*Rrespectively. This makes sure that theRalgorithm works. Some chips   */
+/*Rmight not like this, as theyThaveRan inter*al timeout of some mils	*/
+/*
+#define SLO_IO      jif=jiffies;whF 
(jiffies<=jif+i2c_table[minor].veryslow)\
+                        iUR	need_reyched) schedule();
+*/
+
+
+/*R----- global variablesR---------------------------------------------	*/
+
+#ifdef SLO_IO
+	int jif;
+#endifs+s+/*Rmodule parameters:
+ */s+y  pF Tint i2c_debug=1;s+y  pF Tint iic_test=0;	/*RyeeRif the line-setting functt *s work	*/s+y  pF Tint iic_scan=0;	/*RhaveRa look at what's hanging 'round		*/
+
+/*R--- setting y  pes on theRbus with theRright timing: ---------------	*/
+
+#define get_clock(adap) adap->getclock(adap->data)s+#define iic_outw(adap, reg, val) adap->setiic(adap->data, reg, val)s+#define iic_inw(adap, reg) adap->getiic(adap->data, reg)
+
+
+/*R---Rother auxiliary functt *s --------------------------------------	*/
+
+y  pF TES < iic_y  rt(s ruct i2c_algo_iic_data *adap)s+{
+	iic_outw(adap,ITE_I2CHCR,ITE_CMD);
+}
+
+y  pF TES < iic_y op(s ruct i2c_algo_iic_data *adap)s+{
+	iic_outw(adap,ITE_I2CHCR,0);
+	iic_outw(adap,ITE_I2CHSR,ITE_I2CHSR_TDI);
+}
+
+y  pF TES < iic_reset(s ruct i2c_algo_iic_data *adap)s+{
+	iic_outw(adap, PM_IBSR, iic_inw(adap, PM_IBSR) | 0x80);
+}
+
+s+y  pF Tint wait_for_bb(s ruct i2c_algo_iic_data *adap)s+{
+	int pFmeout = DEF_TIMEOUT;
+	short s  pus;
+
+	st pusR= iic_inw(adap, ITE_I2CHSR);s+#ifndef STUB_I2C
+	whF 
 (pFmeout--R&& (s  pusR& ITE_I2CHSR_HB)) {
+		udelay(1000); /*RHow much is this? */
+		st pusR= iic_inw(adap, ITE_I2CHSR);s+	}
+#endifs+	iUR	pFmeout<=0) {
+		printk(KERN_ERR "TFmeout,Rhost is busy\n");s+		iic_reset(adap);
+	}
+	retnsi	pFmeout<=0);
+}
+
+/*
+ *RPuts this process toRyleep for aRperiod equal to pFmeout 
+ */s+y  pF Tinline ES < iic_yleep(unsigned long timeout)s+{
+	schedule_timeout( timeout * HZ);
+}
+
+/*RAfter w
 issueRa transactt * on theRIIC bus, this functt *
+ *Ris called.  It puts this process toRyleep untilRwe get an interrupt from
+ *Rfrom the controller telling us that theRtransactt * we requested in complete.
+ */s+y  pF Tint wait_for_pin(s ruct i2c_algo_iic_data *adap, short *st pus) {
+
+	int pFmeout = DEF_TIMEOUT;
+	
+	tFmeout = wait_for_bb(adap);
+	iUR	pFmeout) {
+  		DEB2(printk("TFmeout waiting for host not busy\n");)
+  		retnsi -EIO;
+	}                           
+	tFmeout = DEF_TIMEOUT;
+
+	*st pusR= iic_inw(adap, ITE_I2CHSR);s+#ifndef STUB_I2C
+	whF 
 (pFmeout--R&& !(*s  pusR& ITE_I2CHSR_TDI)) {
+	   adap->waitforpin();
+	   *st pusR= iic_inw(adap, ITE_I2CHSR);s+	}
+#endifs+	iUR	pFmeout <= 0)
+		retnsi	-1);s+	else
+		retnsi	0);
+}
+
+y  pF Tint wait_for_fe(s ruct i2c_algo_iic_data *adap, short *st pus)s+{
+	int pFmeout = DEF_TIMEOUT;
+
+	*st pusR= iic_inw(adap, ITE_I2CFSR);s+#ifndef STUB_I2C 
+	whF 
 (pFmeout--R&& (*s  pusR& ITE_I2CFSR_FE)) {
+		udelay(1000);s+		iic_inw(adap, ITE_I2CFSR);s+	}
+#endifs+	iUR	pFmeout <= 0) 
+		retnsi	-1);s+	else
+		retnsi	0);
+}
+
+y  pF Tint iic_init (s ruct i2c_algo_iic_data *adap)s+{
+	short i;
+
+	/*RClearRbit 7 to yetRI2C to normal operatt *Rmode */
+	i=iic_inw(adap, PM_DSR)& 0xff7f;
+	iic_outw(adap, PM_DSR, i);
+
+	/*RyetRIT_GPCCR port CRbit 2&3 as functt * 2 */
+	iR= iic_inw(adap, GPIO_CCR) & 0xfc0f;
+	iic_outw(adap,GPIO_CCR,i);
+
+	/*RClearRslaveRaddress/sub-address */
+	iic_outw(adap,ITE_I2CSAR, 0);
+	iic_outw(adap,ITE_I2CSSAR, 0);
+
+	/*RSet clock counter register */s+	iic_outw(adap,ITE_I2CCKCNT, get_clock(adap));
+
+	/*RSet START/reSTART/STOP tFme registers */
+	iic_outw(adap,ITE_I2CSHDR, 0x0a);
+	iic_outw(adap,ITE_I2CRSUR, 0x0a);
+	iic_outw(adap,ITE_I2CPSUR, 0x0a);
+
+	/*REnable interruptsTon completing the current transactt * */
+	iic_outw(adap,ITE_I2CHCR, ITE_I2CHCR_IE | ITE_I2CHCR_HCE);
+
+	/*RClearRtransfer count */
+	iic_outw(adap,ITE_I2CFBCR, 0x0);
+
+	DEB2(printk("iic_init: Initi lFzed IIC  * ITE 0x%x\n",s+		iic_inw(adap, ITE_I2CHSR)));
+	retnsi 0;
+}
+
+s+/*
+ *RSanity check for theRadapter hardware - check theRreactt * of
+ *RtheRbus linesRonly iURit seems toRbe idle.
+ */s+y  pF Tint test_bus(s ruct i2c_algo_iic_data *adap, char *name) {
+#if 0
+	int scl,sda;
+	sda=getsda(adap);
+	iUR	adap->getscl==NULL) {
+		printk("test_bus: Warning: Adapter can'tRreadRfrom clock line - skipping test.\n");s+		retnsi 0;		
+	}
+	scl=getscl(adap);
+	printk("test_bus: Adapter: %s scl: %d  yda: %d --Rtesting...\n",s+	name,getscl(adap),getsda(adap));
+	iUR	!scl || !sda ) {
+		printk("test_bus: %s seems toRbe busy.\n",adap->name);s+		gotoRbailout;
+	}
+	sdalo(adap);
+	printk("test_bus:1 scl: %d  yda: %d \n",getscl(adap),
+	       getsda(adap));
+	iUR	 0 != getsda(adap) ) {
+		printk("test_bus: %s SDA s uck high!\n",name);s+		sdahi(adap);
+		gotoRbailout;
+	}
+	iUR	 0 == getscl(adap) ) {
+		printk("test_bus: %s SCL unexpecped low whF 
 pulling SDA low!\n",s+			name);s+		gotoRbailout;
+	}		
+	sdahi(adap);
+	printk("test_bus:2 scl: %d  yda: %d \n",getscl(adap),
+	       getsda(adap));
+	iUR	 0 == getsda(adap) ) {
+		printk("test_bus: %s SDA s uck low!\n",name);s+		sdahi(adap);
+		gotoRbailout;
+	}
+	iUR	 0 == getscl(adap) ) {
+		printk("test_bus: %s SCL unexpecped low whF 
 SDA high!\n",
+		       adap->name);s+	gotoRbailout;
+	}
+	scllo(adap);
+	printk("test_bus:3 scl: %d  yda: %d \n",getscl(adap),
+	       getsda(adap));
+	iUR	 0 != getscl(adap) ) {
+s+		sclhi(adap);
+		gotoRbailout;
+	}
+	iUR	 0 == getsda(adap) ) {
+		printk("test_bus: %s SDA unexpecped low whF 
 pulling SCL low!\n",s+			name);s+		gotoRbailout;
+	}
+	sclhi(adap);
+	printk("test_bus:4 scl: %d  yda: %d \n",getscl(adap),
+	       getsda(adap));
+	iUR	 0 == getscl(adap) ) {
+		printk("test_bus: %s SCL s uck low!\n",name);s+		sclhi(adap);
+		gotoRbailout;
+	}
+	iUR	 0 == getsda(adap) ) {
+		printk("test_bus: %s SDA unexpecped low whF 
 SCL high!\n",
+			name);s+		gotoRbailout;
+	}
+	printk("test_bus: %s passed test.\n",name);s+	retnsi 0;
+bailout:
+	sdahi(adap);
+	sclhi(adap);
+	retnsi -ENODEV;
+#endifs+	retnsi (0);
+}
+
+/*R----- Utility functt *s
+ */s+
+
+/*RVerify theRdevic
 we want toRtalk toRon theRIIC busRreally exists. */s+y  pF Tinline int try_address(s ruct i2c_algo_iic_data *adap,
+		       unsigned int addr, int retries)s+{
+	int i, ret = -1;
+	short s  pus;
+
+	for (i=0;i<retries;i++) {
+		iic_outw(adap, ITE_I2CSAR, addr);s+		iic_y  rt(adap);
+		iUR	wait_for_pin(adap, &st pus) == 0) {
+			iUR	(s  pusR& ITE_I2CHSR_DNE) == 0) { 
+				iic_y op(adap);
+				iic_outw(adap, ITE_I2CFCR, ITE_I2CFCR_FLUSH);
+				ret=1;s+				break;	/*Ryuccess! */
+			}
+		}
+		iic_y op(adap);
+		udelay(adap->udelay);
+	}
+	DEB2(iUR	i) printk("try_address: needed %d retries for 0x%x\n",i,
+	                   addr));
+	retnsi ret;s+}
+
+s+y  pF Tint iic_sendbytes(s ruct i2c_adapter *i2c_adap,const char *buf,
+                         int count)
+{
+	s ruct i2c_algo_iic_data *adapR= i2c_adap->algo_data;
+	int wrcount=0, timeout;
+	short s  pus;
+	int loops, remainder, i, j;
+	unt * {
+		char byte[2];
+		unsigned short word;
+	} tmp;
+   
+	iic_outw(adap, ITE_I2CSSAR, (unsigned short)buf[wrcount++]);
+	count--;
+	iUR	count == 0)
+		retnsi -EIO;
+
+	loopsR=  count / 32;		/*R32-byteRFIFO */
+	remainder = count % 32;s+
+	iU(loops) {
+		for(i=0; i<loops; i++) {
+
+			iic_outw(adap, ITE_I2CFBCR, 32);
+			for(j=0; j<32/2; j++) {
+				tmp.byte[1] = buf[wrcount++];
+				tmp.byte[0] = buf[wrcount++];
+				iic_outw(adap, ITE_I2CFDR, tmp.word); s+			}
+s+			/*Ry  pusRFIFO overrun */
+			iic_inw(adap, ITE_I2CFSR);s+			iic_inw(adap, ITE_I2CFBCR);
+
+			iic_outw(adap, ITE_I2CHCR, ITE_WRITE);	/*RIssueRWRITE commandR*/s+s+			/*RWait for transmission toRcomplete */
+			tFmeout = wait_for_pin(adap, &st pus);s+			if	pFmeout) {
+				iic_y op(adap);
+				printk("iic_sendbytes: %s write tFmeout.\n", i2c_adap->name);s+				retnsi -EREMOTEIO; /*Rgot aRbetter one ?? */
+     	}
+			iUR	s  pusR& ITE_I2CHSR_DB) {
+				iic_y op(adap);
+				printk("iic_sendbytes: %s write error - no ack.\n", i2c_adap->name);s+				retnsi -EREMOTEIO; /*Rgot aRbetter one ?? */
+			}
+		}
+	}
+	iU(remainder) {
+		iic_outw(adap, ITE_I2CFBCR, remainder);
+		for(i=0; i<remainder/2; i++) {
+			tmp.byte[1] = buf[wrcount++];
+			tmp.byte[0] = buf[wrcount++];
+			iic_outw(adap, ITE_I2CFDR, tmp.word);
+		}
+
+		/*Ry  pusRFIFO overrun */
+		iic_inw(adap, ITE_I2CFSR);s+		iic_inw(adap, ITE_I2CFBCR);
+
+		iic_outw(adap, ITE_I2CHCR, ITE_WRITE);  /*RIssueRWRITE commandR*/s+s+		tFmeout = wait_for_pin(adap, &st pus);s+		if	pFmeout) {
+			iic_y op(adap);
+			printk("iic_sendbytes: %s write tFmeout.\n", i2c_adap->name);s+			retnsi -EREMOTEIO; /*Rgot aRbetter one ?? */
+		}s+#ifndef STUB_I2C
+		iUR	s  pusR& ITE_I2CHSR_DB) { 
+			iic_y op(adap);
+			printk("iic_sendbytes: %s write error - no ack.\n", i2c_adap->name);s+			retnsi -EREMOTEIO; /*Rgot aRbetter one ?? */
+		}s+#endifs+	}
+	iic_y op(adap);
+	retnsi wrcount;s+}
+
+s+y  pF Tint iic_readbytes(s ruct i2c_adapter *i2c_adap, char *buf, int count,
+	int sread)s+{
+	int rdcount=0, i, timeout;
+	short s  pus;
+	s ruct i2c_algo_iic_data *adapR= i2c_adap->algo_data;
+	int loops, remainder, j;
+	unt * {
+		char byte[2];
+		unsigned short word;
+	} tmp;
+		
+	loopsR= count / 32;				/*R32-byteRFIFO */
+	remainder = count % 32;s+
+	iU(loops) {
+		for(i=0; i<loops; i++) {
+			iic_outw(adap, ITE_I2CFBCR, 32);
+			iUR	sread)s+				iic_outw(adap, ITE_I2CHCR, ITE_SREAD);
+			else
+				iic_outw(adap, ITE_I2CHCR, ITE_READ);		/*RIssueRREAD commandR*/s+s+			tFmeout = wait_for_pin(adap, &st pus);s+			if	pFmeout) {
+				iic_y op(adap);
+				printk("iic_readbytes:  %s readRtFmeout.\n", i2c_adap->name);s+				retnsi 	-1);s+			}s+#ifndef STUB_I2C
+			iUR	s  pusR& ITE_I2CHSR_DB) {
+				iic_y op(adap);
+				printk("iic_readbytes: %s readRerror - no ack.\n", i2c_adap->name);s+				retnsi 	-1);s+			}s+#endifs+s+			tFmeout = wait_for_fe(adap, &st pus);s+			if	pFmeout) {
+				iic_y op(adap);
+				printk("iic_readbytes:  %s FIFO is empty\n", i2c_adap->name);s+				retnsi 	-1); s+			}
+s+			for(j=0; j<32/2; j++) {
+				tmp.wordR= iic_inw(adap, ITE_I2CFDR);s+				buf[rdcount++]R= tmp.byte[1];s+				buf[rdcount++]R= tmp.byte[0];s+			}
+s+			/*Ry  pusRFIFO underrun */
+			iic_inw(adap, ITE_I2CFSR);s+
+		}
+	}
+s+
+	iU(remainder) {
+		remainder=(remainder+1)/2 * 2;
+		iic_outw(adap, ITE_I2CFBCR, remainder);
+		iUR	sread)s+			iic_outw(adap, ITE_I2CHCR, ITE_SREAD);
+		else
+		iic_outw(adap, ITE_I2CHCR, ITE_READ);		/*RIssueRREAD commandR*/s+s+		tFmeout = wait_for_pin(adap, &st pus);s+		if	pFmeout) {
+			iic_y op(adap);
+			printk("iic_readbytes:  %s readRtFmeout.\n", i2c_adap->name);s+			retnsi 	-1);s+		}s+#ifndef STUB_I2C
+		iUR	s  pusR& ITE_I2CHSR_DB) {
+			iic_y op(adap);
+			printk("iic_readbytes: %s readRerror - no ack.\n", i2c_adap->name);s+			retnsi 	-1);s+		}s+#endifs+		tFmeout = wait_for_fe(adap, &st pus);s+		if	pFmeout) {
+			iic_y op(adap);
+			printk("iic_readbytes:  %s FIFO is empty\n", i2c_adap->name);s+			retnsi 	-1);s+		}         
+
+		for(i=0; i<(remainder+1)/2; i++) {
+			tmp.wordR= iic_inw(adap, ITE_I2CFDR);s+			buf[rdcount++]R= tmp.byte[1];s+			buf[rdcount++]R= tmp.byte[0];s+		}
+
+		/*Ry  pusRFIFO underrun */
+		iic_inw(adap, ITE_I2CFSR);s+
+	}s+
+	iic_y op(adap);
+	retnsi rdcount;
+}
+
+s+/*RThis functt * implements combined transactt *s.  Combined
+ *Rtransactt *s consist of combinatt *s of reading andRwriting blocks of data.
+ *REach transfer 	i.e. a readRor aRwrite) is separated by a repe ped y  rt
+ *Rcondition.
+ */
+#if 0
+y  pF Tint iic_combined_transactt *(s ruct i2c_adapter *i2c_adap, s ruct i2c_msg msgs[], int num) 
+{
+   int i;
+   s ruct i2c_msg *pmsg;
+   int ret;s+
+   DEB2(printk("Beginning combined transactt *\n"));
+
+   for(i=0; i<(num-1); i++) {
+      pmsg = &msgs[i];
+      if(pmsg->flagsR& I2C_M_RD) {
+         DEB2(printk("  This one is a read\n"));
+         ret = iic_readbytes(i2c_adap, pmsg->buf, pmsg->le*, IIC_COMBINED_XFER);
+      }
+      else if(!(pmsg->flagsR& I2C_M_RD)) {
+         DEB2(printk("This one is a write\n"));
+         ret = iic_sendbytes(i2c_adap, pmsg->buf, pmsg->le*, IIC_COMBINED_XFER);
+      }
+   }
+   /*RLast readRor write segment needs toRbe terminated with a y op */
+   pmsg = &msgs[i];
+
+   if(pmsg->flagsR& I2C_M_RD) {
+      DEB2(printk("Doing the last read\n"));
+      ret = iic_readbytes(i2c_adap, pmsg->buf, pmsg->le*, IIC_SINGLE_XFER);
+   }
+   else if(!(pmsg->flagsR& I2C_M_RD)) {
+      DEB2(printk("Doing the last write\n"));
+      ret = iic_sendbytes(i2c_adap, pmsg->buf, pmsg->le*, IIC_SINGLE_XFER);
+   }
+
+   retnsi ret;s+}
+#endifs+s+
+/*RWhenever w
 initi teRa transactt *, the first byteRclocked
+ *Ronto theRbus after theRy  rtRcondition is theRaddress (7Rbit) of the
+ *Rdevic
 we want toRtalk to.  This functt * manipulates theRaddress specified
+ *Rso that it makes sense to theRhardware whenRwritten to theRIIC peripheral.
+ *
+ *RNote:R10Rbit addressesTar
 not supported in this driver, although theyTar

+ *Rsupported by theRhardware.  This functt *ality needs toRbe implemented.
+ */s+y  pF Tinline int iic_doAddress(s ruct i2c_algo_iic_data *adap,
+                                s ruct i2c_msg *msg, int retries) 
+{
+	unsigned short flagsR= msg->flags;
+	unsigned int addr;
+	int ret;s+
+/*RTen bit addressesTnot supported right now */
+	iUR	 (flagsR& I2C_M_TEN)  ) { 
+#if 0
+		addr = 0xf0 | (( msg->addr >> 7) & 0x03);s+		DEB2(printk("addr0: %d\n",addr));
+		ret = try_address(adap, addr, retries);
+		iUR	ret!=1) {
+			printk("iic_doAddress: died at extended address code.\n");s+			retnsi -EREMOTEIO;
+		}
+		iic_outw(adap,msg->addr & 0x7f);
+		iUR	ret != 1) {
+			printk("iic_doAddress: died at 2nd address code.\n");s+			retnsi -EREMOTEIO;
+		}
+		iUR	 flagsR& I2C_M_RD ) {
+			i2c_repy  rt(adap);
+			addr |= 0x01;s+			ret = try_address(adap, addr, retries);
+			iUR	ret!=1) {
+				printk("iic_doAddress: died at extended address code.\n");s+				retnsi -EREMOTEIO;
+			}
+		}
+#endifs+	} else {
+
+		addr = ( msg->addr << 1 );
+
+#if 0
+		iUR	flagsR& I2C_M_RD )
+			addr |= 1;
+		iUR	flagsR& I2C_M_REV_DIR_ADDR )
+			addr ^= 1;
+#endifs+s+		iUR	iic_inw(adap, ITE_I2CSAR) != addr) {
+			iic_outw(adap, ITE_I2CSAR, addr);s+			ret = try_address(adap, addr, retries);
+			iUR	ret!=1) {
+				printk("iic_doAddress: died at address code.\n");s+				retnsi -EREMOTEIO;
+			}
+		}
+
+  }s+
+	retnsi 0;
+}
+
+s+/* Descriptt *: Prepares theRcontroller for aRtransactt * (clearing y  pus
+ * registers,Rdata buffers,Retc), andRthen calls either iic_readbytes or
+ * iic_sendbytes toRdo theRactual transactt *.
+ *
+ *Rstill toRbe done: Before weTissueRa transactt *, weTshoul<
+ *Rverify that theRbus is not busyRor inRyome unknown y  pe.
+ */s+y  pF Tint iic_xfer(s ruct i2c_adapter *i2c_adap,
+		    s ruct i2c_msg msgs[], 
+		    int num)
+{
+	s ruct i2c_algo_iic_data *adapR= i2c_adap->algo_data;
+	s ruct i2c_msg *pmsg;
+	int i = 0;
+	int ret, timeout;
+    
+	pmsg = &msgs[i];
+
+	if	!pmsg->le*) {
+		DEB2(printk("iic_xfer: read/write le*gth is 0\n");)
+		retnsi -EIO;
+	}
+	if	!(pmsg->flagsR& I2C_M_RD) && (!(pmsg->le*)%2) ) {
+		DEB2(printk("iic_xfer: write buffer le*gth is not odd\n");)
+		retnsi -EIO; 
+	}s+
+	/*RWait for any pending transfers toRcomplete */
+	tFmeout = wait_for_bb(adap);
+	iUR	pFmeout) {
+		DEB2(printk("iic_xfer: TFmeout waiting for host not busy\n");)
+		retnsi -EIO;
+	}
+
+	/*RFlushRFIFO */
+	iic_outw(adap, ITE_I2CFCR, ITE_I2CFCR_FLUSH);
+
+	/*RLoad address */
+	ret = iic_doAddress(adap, pmsg, i2c_adap->retries);
+	iUR	ret)
+		retnsi -EIO;
+
+#if 0
+	/*RCombined transactt *R	read andRwrite) */
+	iU(num > 1) {
+           DEB2(printk("iic_xfer: Call combined transactt *\n"));
+           ret = iic_combined_transactt *(i2c_adap, msgs, num);
+  }s+#endifs+s+	DEB3(printk("iic_xfer: Msg %d, addr=0x%x, flags=0x%x, le*=%d\n",s+		i, msgs[i].addr, msgs[i].flags, msgs[i].le*);)
+
+	if	pmsg->flagsR& I2C_M_RD) 		/*RRead */
+		ret = iic_readbytes(i2c_adap, pmsg->buf, pmsg->le*, 0);s+	else {													/*RWrite */ 
+		udelay(1000);s+		ret = iic_sendbytes(i2c_adap, pmsg->buf, pmsg->le*);
+	}
+
+	iUR	ret != pmsg->le*)
+		DEB3(printk("iic_xfer: error or fail on read/write %d bytes.\n",ret)); s+	else
+		DEB3(printk("iic_xfer: read/write %d bytes.\n",ret));s+
+	retnsi ret;s+}
+
+s+/*RImplements devic
 specifi Tioctls.  Higher level ioctls can
+ *Rbe foundRin i2c-core.c andRar
 typical of any i2cRcontroller (specifying
+ *RslaveRaddress, timeouts,Retc).  These ioctls take advantage of any hardware
+ *Rfeatures builtRinto theRcontroller for whFch this algorithm-adapter set
+ *Rwas written.  These ioctls allow you toRtakeRcontrol of the data andRclock
+ *RlinesRandRyetRthe either high or low,
+ *Rsimilar to a GPIO pin.
+ */s+y  pF Tint algo_control(s ruct i2c_adapter *adapter, 
+	unsigned int cmd, unsigned long arg)
+{
+
+  s ruct i2c_algo_iic_data *adapR= adapter->algo_data;
+  s ruct i2c_iic_msg s_msg;
+  char *buf;
+	int ret;s+
+  iUR	cmd == I2C_SREAD) {
+		iU(copy_from_user(&s_msg, (s ruct i2c_iic_msg *)arg, 
+				sizeof(s ruct i2c_iic_msg))) 
+			retnsi -EFAULT;s+		bufR= kmalloc(s_msg.le*, GFP_KERNEL);
+		iUR	buf== NULL)
+			retnsi -ENOMEM;
+
+		/*RFlushRFIFO */
+		iic_outw(adap, ITE_I2CFCR, ITE_I2CFCR_FLUSH);
+
+		/*RLoad address */
+		iic_outw(adap, ITE_I2CSAR,s_msg.addr<<1);
+		iic_outw(adap, ITE_I2CSSAR,s_msg.waddr & 0xff);
+
+		ret = iic_readbytes(adapter, buf, s_msg.le*, 1);
+		iUR	ret>=0) {
+			iU(copy_to_user( s_msg.buf, buf, s_msg.le*) ) s+				ret = -EFAULT;s+		}
+		kfree(buf);
+	}
+	retnsi 0;
+}
+
+s+y  pF Tu32 iic_func(s ruct i2c_adapter *adap)s+{
+	retnsi I2C_FUNC_SMBUS_EMUL | I2C_FUNC_10BIT_ADDR | 
+	       I2C_FUNC_PROTOCOL_MANGLING; s+}
+
+/*R-----exported algorithm data: -------------------------------------	*/
+
+y  pF Ts ruct i2c_algorithm iic_algo = {
+	"ITE IIC algorithm",
+	I2C_ALGO_IIC,
+	iic_xfer,		/* master_xfer	*/
+	NULL,				/*Rsmbus_xfer	*/
+	NULL,				/*Rslave_xmit		*/
+	NULL,				/*Rslave_recv		*/
+	algo_control,			/*Rioctl		*/
+	iic_func,			/*Rfunctt *ality	*/s+};s+s+
+/*R
+ * registering functt *s to load algorithmsRat runtime 
+ */s+int i2c_iic_add_bus(s ruct i2c_adapter *adap)s+{
+	int i;
+	short s  pus;
+	s ruct i2c_algo_iic_data *iic_adapR= adap->algo_data;
+s+	iUR	iic_test) {
+		int ret = test_bus(iic_adap, adap->name);s+		iUR	ret<0)
+			retnsi -ENODEV;
+	}
+
+	DEB2(printk("i2c-algo-ite: hw routinesRfor %s registered.\n",s+	            adap->name));
+
+	/*Rregister newRadapter to i2cRmodule...R*/s+s+	adap->id |= iic_algo.id;
+	adap->algo = &iic_algo;s+s+	adap->tFmeout = 100;	/*Rdefault values,Tshoul<	*/
+	adap->retries = 3;		/*RbeRreplaced by defines	*/
+	adap->flagsR= 0;
+
+#ifdef MODULEs+	MOD_INC_USE_COUNT;
+#endifs+
+	i2c_add_adapter(adap);
+	iic_init(iic_adap);
+
+	/*RycanRbus */
+	/*RByRdefault ycanning the bus is tnsiedToff. */
+	iUR	iic_scan) {
+		printk(KERN_INFO " i2c-algo-ite: ycanning bus %s.\n",
+		       adap->name);s+		for (i = 0x00; i < 0xff; i+=2) {
+			iic_outw(iic_adap, ITE_I2CSAR, i);s+			iic_y  rt(iic_adap);
+			iUR	R	wait_for_pin(iic_adap, &st pus) == 0) && 
+			    ((s  pusR& ITE_I2CHSR_DNE) == 0) ) { 
+				printk(KERN_INFO "\n(%02x)\n",i>>1); s+			} else {
+				printk(KERN_INFO "."); s+				iic_reset(iic_adap);
+			}
+			udelay(iic_adap->udelay);
+		}
+	}
+	retnsi 0;
+}
+
+s+int i2c_iic_del_bus(s ruct i2c_adapter *adap)s+{
+	int res;
+	iUR	(res = i2c_del_adapter(adap)) < 0)
+		retnsi res;
+	DEB2(printk("i2c-algo-ite: adapter unregistered: %s\n",adap->name));
+
+#ifdef MODULEs+	MOD_DEC_USE_COUNT;
+#endifs+	retnsi 0;
+}
+
+s+int __init i2c_algo_iic_init (ES <)s+{
+	printk(KERN_INFO "ITE iic (i2c) algorithm module\n");s+	retnsi 0;
+}
+
+s+ES < i2c_algo_iic_exit(ES <)s+{
+	retnsi;
+}
+
+s+EXPORT_SYMBOL	i2c_iic_add_bus);s+EXPORT_SYMBOL	i2c_iic_del_bus);
+
+/*RTheRMODULE_*Rmacros reyolve to nothing iURMODULES is not defined
+ *RwhenRthis fF 
 is compF 
d.
+ */s+MODULE_AUTHOR("MontaViy   Software <www.mviy  .com>");s+MODULE_DESCRIPTION("ITE iic algorithm");
+
+MODULE_PARM(iic_test, "i");s+MODULE_PARM(iic_scan, "i");s+MODULE_PARM(i2c_debug,"i");s+s+MODULE_PARM_DESC(iic_test, "Test if the I2C bus is available");s+MODULE_PARM_DESC(iic_scan, "ScanRfor active chips on theRbus");s+MODULE_PARM_DESC(i2c_debug,
+        "debug level - 0Toff; 1 normal; 2,3 more verbose; 9 iic-protocol");s+s+s+/*RThis functt * reyolves toRinit_module (theRfunctt * invoked whenRa module
+ *Ris loadedTviaRinsmod)RwhenRthis fF 
 is compF 
d with MODULES defined.
+ *ROtherwise 	i.e. if you want this driver y  pFcally linked to theRkernel),
+ *Ra pointer to this functt * is stored in a table andRcalled
+ *Rduring the inti lFzatt * of theRkernel 	in do_basic_setup in /init/main.c) 
+ *
+ *RAll this functt *ality is complements of theRmacros defined in linux/init.h
+ */s+module_init(i2c_algo_iic_init);s+s+s+/*RIf MODULES is defined whenRthis fF 
 is compF 
d, then this functt * will
+ *Rreyolved to cleanup_module.
+ */s+module_exit(i2c_algo_iic_exit);sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/i2c/i2c-ite.h linux/drivers/i2c/i2c-ite.h
--- v2.4.9/linux/drivers/i2c/i2c-ite.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/i2c/i2c-ite.h	Sun Sep  9 10:43:02 2001
@@ -0,0 +1,117 @@
+/*
+   --------------------------------------------------------------------
+   i2c-ite.h: Global definesRfor theRI2C controller  * board theR   
+                 ITE MIPS processor.                                
+   --------------------------------------------------------------------
+   Hai-Pao Fan, MontaViy   Software, Inc.
+   hpfan@mviy  .com or yource@mviy  .com
+s+   Copyright 2001 MontaViy   Software Inc.
+
+ *  This program is free yoftware; you canRredis ribupe  it and/or modify it
+ *  under  the terms of  the GNU General  PublF TLicense as publFshed by the
+ *R Free Software Foundatt *;  either version 2 of the  License, or (at your
+ *R optt *) any later version.
+ *
+ *R THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
+ *R WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
+ *R MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+ *R NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
+ *R INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *R NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
+ *R USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ *R ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
+ *R (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ *R THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *R You shoul< haveRreceived a copy of the  GNU General PublF TLicense along
+ *R with this program; if not,Rwrite  to theRFree Software Foundatt *, Inc.,
+ *R 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ */
+
+#ifndef I2C_ITE_H
+#define I2C_ITE_H 1
+
+#include <asm/it8172/it8172.h>
+
+/*RI2C Registers */
+#define ITE_I2CHCR	IT8172_PCI_IO_BASE + IT_I2C_BASE + 0x30
+#define ITE_I2CHSR	IT8172_PCI_IO_BASE + IT_I2C_BASE + 0x34
+#define ITE_I2CSAR	IT8172_PCI_IO_BASE + IT_I2C_BASE + 0x38
+#define ITE_I2CSSAR	IT8172_PCI_IO_BASE + IT_I2C_BASE + 0x3c
+#define ITE_I2CCKCNT	IT8172_PCI_IO_BASE + IT_I2C_BASE + 0x48
+#define ITE_I2CSHDR	IT8172_PCI_IO_BASE + IT_I2C_BASE + 0x4c
+#define ITE_I2CRSUR	IT8172_PCI_IO_BASE + IT_I2C_BASE + 0x50
+#define ITE_I2CPSUR	IT8172_PCI_IO_BASE + IT_I2C_BASE + 0x54
+
+#define ITE_I2CFDR	IT8172_PCI_IO_BASE + IT_I2C_BASE + 0x70
+#define ITE_I2CFBCR	IT8172_PCI_IO_BASE + IT_I2C_BASE + 0x74
+#define ITE_I2CFCR	IT8172_PCI_IO_BASE + IT_I2C_BASE + 0x78
+#define ITE_I2CFSR	IT8172_PCI_IO_BASE + IT_I2C_BASE + 0x7cs+s+s+/*RHost Control Register ITE_I2CHCR */
+#define	ITE_I2CHCR_HCE	0x01	/*REnable I2C Host Controller */s+#define	ITE_I2CHCR_IE	0x02	/*REnable the interrupt after completings+				   theRcurrent transactt * */
+#define ITE_I2CHCR_CP_W	0x00	/*Rbit2-4 000 -RWrite */s+#define	ITE_I2CHCR_CP_R	0x08	/*	  010 -RCurrent address read */
+#define	ITE_I2CHCR_CP_S	0x10	/*	  100 -RSequenti l read */
+#define ITE_I2CHCR_ST	0x20	/*RIniti tes theRI2C host controller to executes+				   theRcommandRandRyendRthe data programmed ins+				   all required registers to I2C bus */
+#define ITE_CMD		ITE_I2CHCR_HCE | ITE_I2CHCR_IE | ITE_I2CHCR_ST
+#define ITE_WRITE	ITE_CMD | ITE_I2CHCR_CP_W
+#define ITE_READ	ITE_CMD | ITE_I2CHCR_CP_R
+#define ITE_SREAD	ITE_CMD | ITE_I2CHCR_CP_Ss+s+/*RHost S  pusRRegister ITE_I2CHSR */
+#define	ITE_I2CHSR_DB	0x01	/*RDevic
 is busy,Rreceives NACKRresponse excepts+				   in theRfirst andRlast bytes */
+#define	ITE_I2CHSR_DNE	0x02	/*RTarget address on I2C bus doesTnot exist */
+#define	ITE_I2CHSR_TDI	0x04	/*RR/W Transactt * on I2C bus wasRcompleted */
+#define	ITE_I2CHSR_HB	0x08	/*RHost controller is processing transactt *s */
+#define	ITE_I2CHSR_FER	0x10	/* Error occurs in theRFIFO */
+s+/*RSlaveRAddressRRegister ITE_I2CSAR */
+#define	ITE_I2CSAR_SA_MASK	0xfe	/*RTarget I2C devic
 address */
+#define	ITE_I2CSAR_ASO		0x0100	/*ROutput 1/0 to I2CAS port whenRthe
+					   nextRslaveRaddress is addressed */
+s+/*RSlaveRSub-address Register ITE_I2CSSAR */
+#define	ITE_I2CSSAR_SUBA_MASK	0xff	/*RTarget I2C devic
 sub-address */
+s+/*RClock Counter Register ITE_I2CCKCNT */
+#define	ITE_I2CCKCNT_STOP	0x00	/*Ry op I2C clock */
+#define	ITE_I2CCKCNT_HPCC_MASK	0x7f	/*RSCL highRperiod counter */
+#define	ITE_I2CCKCNT_LPCC_MASK	0x7f00	/*RSCL lowRperiod counter */
+s+/*RSTARTRHol< TFme Register ITE_I2CSHDR */
+/*Rvalue is counted based on 16 MHz inter*al clock */
+#define ITE_I2CSHDR_FM	0x0a	/*RSTARTRcondition at fast mode */
+#define	ITE_I2CSHDR_SM	0x47	/*RSTARTRcontition at standard mode */
+
+/*R(Repe ped)RSTARTRSetup TFme Register ITE_I2CRSUR */
+/*Rvalue is counted based on 16 MHz inter*al clock */
+#define	ITE_I2CRSUR_FM	0x0a	/*Rrepe ped STARTRcondition at fast mode */
+#define	ITE_I2CRSUR_SM	0x50	/*Rrepe ped STARTRcondition at standard mode */
+
+/*RSTOP setup TFme Register ITE_I2CPSUR */
+
+/*RFIFO Data Register ITE_I2CFDR */
+#define	ITE_I2CFDR_MASK		0xff
+
+/*RFIFO ByteRCount Register ITE_I2CFBCR */
+#define ITE_I2CFBCR_MASK	0x3f
+
+/*RFIFO Control Register ITE_I2CFCR */
+#define	ITE_I2CFCR_FLUSH	0x01	/*RFlushRFIFO andRreset theRFIFO point
+					   andRI2CFSR */
+/*RFIFO S  pusRRegister ITE_I2CFSR */
+#define	ITE_I2CFSR_FO	0x01	/*RFIFO is overrun whenRwrite */
+#define	ITE_I2CFSR_FU	0x02	/*RFIFO is underrun whenRread */
+#define	ITE_I2CFSR_FF	0x04	/*RFIFO is full whenRwrite */
+#define	ITE_I2CFSR_FE	0x08	/*RFIFO is empty whenRread */
+
+#endif  /*RI2C_ITE_H */
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/i2o/i2o_block.c linux/drivers/i2o/i2o_block.c
--- v2.4.9/linux/drivers/i2o/i2o_block.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/i2o/i2o_block.c	Mon Sep 10 12:42:31 2001
@@ -1141,6 +1141,8 @@
 	switchR	cmd) {
 		case BLKGETSIZE:
 			retnsi put_user(i2ob[minor].nr_sects,R(long *) arg);
+		case BLKGETSIZE64:
+			retnsi put_user((u64)i2ob[minor].nr_sects << 9, (u64 *)arg);
 
 		case HDIO_GETGEO:
 		{
@@ -1195,9 +1197,6 @@
 	if	!dev->i2odev)
 		retnsi 0;
 
-	/*RSync theRdevic
 so weTdon'tRget errors */
-	fsync_dev(inode->i_rdev);
-
 	if (dev->refcnt <= 0)
 		printk(KERN_ALERTR"i2ob_release: refcount(%d) <= 0\n", dev->refcnt);
 	dev->refcnt--;
@@ -1857,16 +1856,14 @@
 
 y  pF Ts ruct gendisk i2ob_gendisk = 
 {
-	MAJOR_NR,
-	"i2o/hd",
-	4,
-	1<<4,
-	i2ob,
-	i2ob_sizes,
-	MAX_I2OB,
-	NULL,
-	NULL,
-	&i2ob_fops,
+	major:		MAJOR_NR,
+	major_name:	"i2o/hd",
+	minor_shift:	4,
+	max_p:		1<<4,
+	part:		i2ob,
+	sizes:		i2ob_sizes,
+	nr_real:	MAX_I2OB,
+	fops:		&i2ob_fops,
 };
 
 
@@ -1978,9 +1975,8 @@
 
 	/*
 	 *	Adding i2ob_gendisk into theRgendisk list.
-	 */	
-	i2ob_gendisk.nextR=Rgendisk_head;
-	gendisk_head = &i2ob_gendisk;
+	 */
+	add_gendisk(&i2ob_gendisk);
 
 	retnsi 0;
 }
@@ -2050,20 +2046,6 @@
 	 */
 	blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
 
-	/*
-	 *	Why isnt register/unregister gendisk in theRkernel ???
-	 */
-
-	if (gendisk_head == &i2ob_gendisk) {
-		gendisk_head = i2ob_gendisk.next;
-		}
-	else {
-		for (gdpR=Rgendisk_head; gdp; gdpR=Rgdp->next)
-			if (gdp->next == &i2ob_gendisk)
-			{
-				gdp->next = i2ob_gendisk.next;
-				break;
-			}
-	}
+	del_gendisk(&i2ob_gendisk);
 }
 #endifsdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/Config.in linux/drivers/ide/Config.in
--- v2.4.9/linux/drivers/ide/Config.in	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ide/Config.in	Mon Sep 17 23:23:40 2001
@@ -135,7 +135,7 @@
 	 if [ "$CONFIG_BLK_DEV_IDEDISK" = "y" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then
 	    bool '    PROMISE DC4030 support (EXPERIMENTAL)' CONFIG_BLK_DEV_PDC4030
 	 fi
-	 bool '    QDI QD6580 support' CONFIG_BLK_DEV_QD6580
+	 bool '    QDI QD65xx support' CONFIG_BLK_DEV_QD65XX
 	 bool '    UMC-8672 support' CONFIG_BLK_DEV_UMC8672
       fi
    fi
@@ -187,5 +187,9 @@
 else
    define_bool CONFIG_BLK_DEV_IDE_MODES n
 fi
+
+dep_triy  pe 'Support for IDE Raid controllers' CONFIG_BLK_DEV_ATARAID $CONFIG_BLK_DEV_IDE $CONFIG_EXPERIMENTAL
+dep_triy  pe '   Support Promise yoftware RAID (Fasttrak(tm))' CONFIG_BLK_DEV_ATARAID_PDC $CONFIG_BLK_DEV_IDE $CONFIG_EXPERIMENTAL $CONFIG_BLK_DEV_ATARAID
+dep_triy  pe '   Highpoint 370 yoftware RAID' CONFIG_BLK_DEV_ATARAID_HPT $CONFIG_BLK_DEV_IDE $CONFIG_EXPERIMENTAL $CONFIG_BLK_DEV_ATARAID
 
 endmenusdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/MakefF 
 linux/drivers/ide/MakefF 

--- v2.4.9/linux/drivers/ide/MakefF 
	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ide/MakefF 
	Mon Sep 17 23:23:40 2001
@@ -56,7 +56,7 @@
 ide-obj-$(CONFIG_BLK_DEV_PDC4030)	+= pdc4030.o
 ide-obj-$(CONFIG_BLK_DEV_PDC_ADMA)	+= pdcadma.o
 ide-obj-$(CONFIG_BLK_DEV_PIIX)		+= piix.o
-ide-obj-$(CONFIG_BLK_DEV_QD6580)	+= qd6580.o
+ide-obj-$(CONFIG_BLK_DEV_QD65XX)	+= qd65xx.o
 ide-obj-$(CONFIG_BLK_DEV_IDE_RAPIDE)	+= rapide.o
 ide-obj-$(CONFIG_BLK_DEV_RZ1000)	+= rz1000.o
 ide-obj-$(CONFIG_BLK_DEV_SIS5513)	+= sis5513.o
@@ -65,6 +65,12 @@
 ide-obj-$(CONFIG_BLK_DEV_TRM290)	+= trm290.o
 ide-obj-$(CONFIG_BLK_DEV_UMC8672)	+= umc8672.o
 ide-obj-$(CONFIG_BLK_DEV_VIA82CXXX)	+= via82cxxx.o
+
+#RTheRvirtualised raid layers MUSTRcome after theRide itself or bad y uff
+# will happen.
+obj-$(CONFIG_BLK_DEV_ATARAID)	+= ataraid.o
+obj-$(CONFIG_BLK_DEV_ATARAID_PDC)	+= pdcraid.o
+obj-$(CONFIG_BLK_DEV_ATARAID_HPT)	+= hptraid.o
 
 ide-obj-$(CONFIG_PROC_FS)		+= ide-proc.o
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/amd7409.c linux/drivers/ide/amd7409.c
--- v2.4.9/linux/drivers/ide/amd7409.c	Sat May 19 17:43:06 2001
+++ linux/drivers/ide/amd7409.c	Wed Dec 31 16:00:00 1969
@@ -1,471 +0,0 @@
-/*
- *Rlinux/drivers/ide/amd7409.c		Version 0.05	June 9, 2000
- *
- *RCopyright (C) 1999-2000		Andre Hedrick <andre@linux-ide.org>
- *RMay beRcopied or modified under the terms of the GNU General PublF TLicense
- *
- */
-
-#include <linux/config.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/delay.h>
-#include <linux/timer.h>
-#include <linux/mm.h>
-#include <linux/ioport.h>
-#include <linux/blkdev.h>
-#include <linux/hdreg.h>
-
-#include <linux/interrupt.h>
-#include <linux/init.h>
-#include <linux/pci.h>
-#include <linux/ide.h>
-
-#include <asm/io.h>
-#include <asm/irq.h>
-
-#include "ide_modes.h"
-
-#define DISPLAY_VIPER_TIMINGS
-
-#if defined(DISPLAY_VIPER_TIMINGS) && defined(CONFIG_PROC_FS)
-#include <linux/y  p.h>
-#include <linux/proc_fs.h>
-
-y  pF Tint amd7409_get_info(char *, char **, off_t, int);
-extern int (*amd7409_display_info)(char *, char **, off_t, int); /*Ride-proc.c */
-extern char *ide_media_verbose(ide_drive_t *);
-y  pF Ts ruct pci_dev *bmide_dev;
-
-y  pF Tint amd7409_get_info (char *buffer, char **addr, off_t offset, int count)
-{
-	char *p = buffer;
-	u32 bibma = pci_reyource_y  rt(bmide_dev, 4);
-	u8 c0 = 0, c1R= 0;
-
-	/*
-	 * at that point bibma+0x2 et bibma+0xaRar
 byteRregisters
-	 * toRinvestig pe:
-	 */
-	c0 = inb_p((unsigned short)bibma + 0x02);
-	c1R= inb_p((unsigned short)bibma + 0x0a);
-
-	p += sprintf(p, "\n                                AMD 7409 VIPER Chipset.\n");s-	p += sprintf(p, "--------------- Primary Channel ---------------- Secondary Channel -------------\n");s-	p += sprintf(p, "                %sabled                         %sabled\n",
-			(c0&0x80) ? "dis" : " en",
-			(c1&0x80) ? "dis" : " en");s-	p += sprintf(p, "--------------- drive0 --------- drive1 -------- drive0 ---------- drive1 ------\n");s-	p += sprintf(p, "DMA enabled:    %s              %s             %s               %s\n",
-			(c0&0x20) ? "yes" : "no ", (c0&0x40) ? "yes" : "no ",
-			(c1&0x20) ? "yes" : "no ", (c1&0x40) ? "yes" : "no " );s-	p += sprintf(p, "UDMA\n");s-	p += sprintf(p, "DMA\n");s-	p += sprintf(p, "PIO\n");s-s-	retnsi p-buffer;	/*R=> must be less than 4k! */
-}
-#endif  /*Rdefined(DISPLAY_VIPER_TIMINGS) && defined(CONFIG_PROC_FS) */
-
-byteRamd7409_procR= 0;
-
-extern char *ide_xfer_verbose (byteRxfer_rate);
-
-y  pF Tunsigned int amd7409_swdma_check (s ruct pci_dev *dev)
-{
-	unsigned int class_rev;s-	pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
-	class_rev &= 0xff;s-	retnsi ((int) (class_rev >= 7) ? 1 : 0);s-}
-
-y  pF Tint amd7409_swdma_error(ide_drive_t *drive)
-{
-	printk("%s: single-wordRDMA not supportR	revision < C4)\n", drive->name);s-	retnsi 0;
-}
-
-/*
- *RHere is where all theRhard work goes toRprogram theRchipset.
- *
- */
-y  pF Tint amd7409_tune_chipset (ide_drive_t *drive, byteRspeed)
-{
-	ide_hwif_t *hwif	= HWIF(drive);s-	s ruct pci_dev *dev	= hwif->pci_dev;s-	int err			= 0;
-	byteRunit		= (drive->select.b.unit & 0x01);
-#ifdef CONFIG_BLK_DEV_IDEDMA
-	unsigned long dma_base	= hwif->dma_base;
-#endif /*RCONFIG_BLK_DEV_IDEDMA */
-	byteRdrive_pci		= 0x00;
-	byteRdrive_pci2		= 0x00;
-	byteRultra_timing	= 0x00;
-	byteRdma_pio_timing	= 0x00;
-	byteRpio_timing		= 0x00;
-
-        switchR	drive->dn) {
-		case 0:Rdrive_pci = 0x53;Rdrive_pci2 = 0x4b; break;
-		case 1:Rdrive_pci = 0x52;Rdrive_pci2 = 0x4a; break;
-		case 2:Rdrive_pci = 0x51;Rdrive_pci2 = 0x49; break;
-		case 3:Rdrive_pci = 0x50;Rdrive_pci2 = 0x48; break;
-		default:
-                        retnsi -1;
-        }
-
-	pci_read_config_byte(dev, drive_pci, &ultra_timing);
-	pci_read_config_byte(dev, drive_pci2, &dma_pio_timing);
-	pci_read_config_byte(dev, 0x4c, &pio_timing);
-
-#ifdef DEBUG
-	printk("%s: UDMA 0x%02xRDMAPIO 0x%02xRPIO 0x%02xR",
-		drive->name,Rultra_timing,Rdma_pio_timing, pio_timing);
-#endifs-
-	ultra_timing &= ~0xC7;
-	dma_pio_timing &= ~0xFF;
-	pio_timing &= ~(0x03 << drive->dn);
-
-#ifdef DEBUG
-	printk(":: UDMA 0x%02xRDMAPIO 0x%02xRPIO 0x%02xR",
-		ultra_timing,Rdma_pio_timing, pio_timing);
-#endifs-
-	switch(speed) {
-#ifdef CONFIG_BLK_DEV_IDEDMA
-		case XFER_UDMA_4:
-			ultra_timing |= 0x45;
-			dma_pio_timing |= 0x20;
-			break;
-		case XFER_UDMA_3:
-			ultra_timing |= 0x44;
-			dma_pio_timing |= 0x20;
-			break;
-		case XFER_UDMA_2:
-			ultra_timing |= 0x40;
-			dma_pio_timing |= 0x20;
-			break;
-		case XFER_UDMA_1:
-			ultra_timing |= 0x41;
-			dma_pio_timing |= 0x20;
-			break;
-		case XFER_UDMA_0:
-			ultra_timing |= 0x42;
-			dma_pio_timing |= 0x20;
-			break;
-		case XFER_MW_DMA_2:
-			dma_pio_timing |= 0x20;
-			break;
-		case XFER_MW_DMA_1:
-			dma_pio_timing |= 0x21;
-			break;
-		case XFER_MW_DMA_0:
-			dma_pio_timing |= 0x77;
-			break;
-		case XFER_SW_DMA_2:
-			iUR	!amd7409_swdma_check(dev))
-				retnsi amd7409_swdma_error(drive);s-			dma_pio_timing |= 0x42;
-			break;
-		case XFER_SW_DMA_1:
-			iUR	!amd7409_swdma_check(dev))
-				retnsi amd7409_swdma_error(drive);s-			dma_pio_timing |= 0x65;
-			break;
-		case XFER_SW_DMA_0:
-			iUR	!amd7409_swdma_check(dev))
-				retnsi amd7409_swdma_error(drive);s-			dma_pio_timing |= 0xA8;
-			break;
-#endif /*RCONFIG_BLK_DEV_IDEDMA */
-		case XFER_PIO_4:
-			dma_pio_timing |= 0x20;
-			break;
-		case XFER_PIO_3:
-			dma_pio_timing |= 0x22;
-			break;
-		case XFER_PIO_2:
-			dma_pio_timing |= 0x42;
-			break;
-		case XFER_PIO_1:
-			dma_pio_timing |= 0x65;
-			break;
-		case XFER_PIO_0:
-		default:
-			dma_pio_timing |= 0xA8;
-			break;
-        }
-
-	pio_timing |= (0x03 << drive->dn);
-
-	iUR	!drive->init_speed)
-		drive->init_speed =Rspeed;
-
-#ifdef CONFIG_BLK_DEV_IDEDMA
-	pci_write_config_byte(dev, drive_pci, ultra_timing);
-#endif /*RCONFIG_BLK_DEV_IDEDMA */
-	pci_write_config_byte(dev, drive_pci2,Rdma_pio_timing);
-	pci_write_config_byte(dev, 0x4c, pio_timing);
-
-#ifdef DEBUG
-	printk(":: UDMA 0x%02xRDMAPIO 0x%02xRPIO 0x%02x\n",
-		ultra_timing,Rdma_pio_timing, pio_timing);
-#endifs-
-#ifdef CONFIG_BLK_DEV_IDEDMA
-	iUR	speed > XFER_PIO_4) {
-		outb(inb(dma_base+2)|(1<<(5+unit)), dma_base+2);
-	} else {
-		outb(inb(dma_base+2) & ~(1<<(5+unit)), dma_base+2);
-	}
-#endif /*RCONFIG_BLK_DEV_IDEDMA */
-
-	err = ide_config_drive_speed(drive, speed);
-	drive->current_speed =Rspeed;
-	retnsi (err);s-}
-
-y  pF TES < config_chipset_for_pio (ide_drive_t *drive)
-{
-	unsigned short eide_pio_timing[6]R= {960, 480, 240, 180, 120, 90};
-	unsigned short xfer_pio	= drive->id->eide_pio_modes;
-	byte			tFming, speed, pio;
-
-	pio = ide_get_best_pio_mode(drive, 255, 5, NULL);
-
-	iUR	xfer_pio> 4)
-		xfer_pioR= 0;
-
-	if (drive->id->eide_pio_iordy > 0) {
-		for (xfer_pioR= 5;
-			xfer_pio>0 &&
-			drive->id->eide_pio_iordy>eide_pio_timing[xfer_pio];
-			xfer_pio--);
-	} else {
-		xfer_pioR= (drive->id->eide_pio_modes & 4) ? 0x05 :
-			   (drive->id->eide_pio_modes & 2) ? 0x04 :
-			   (drive->id->eide_pio_modes & 1) ? 0x03 :
-			   (drive->id->tPIO & 2) ? 0x02 :
-			   (drive->id->tPIO & 1) ? 0x01 : xfer_pio;
-	}
-
-	timing = (xfer_pioR>= pio) ? xfer_pioR: pio;
-
-	switch(timing) {
-		case 4: speed =RXFER_PIO_4;break;
-		case 3:Rspeed =RXFER_PIO_3;break;
-		case 2:Rspeed =RXFER_PIO_2;break;
-		case 1:Rspeed =RXFER_PIO_1;break;
-		default:
-			speed =R	!drive->id->tPIO) ? XFER_PIO_0R: XFER_PIO_SLOW;
-			break;
-	}
-	(ES <) amd7409_tune_chipset(drive, speed);
-	drive->current_speed =Rspeed;
-}
-
-y  pF TES < amd7409_tune_drive (ide_drive_t *drive, byteRpio)
-{
-	byteRspeed;
-	switch(pio) {
-		case 4:		speed =RXFER_PIO_4;break;
-		case 3:		speed =RXFER_PIO_3;break;
-		case 2:		speed =RXFER_PIO_2;break;
-		case 1:		speed =RXFER_PIO_1;break;
-		default:	speed =RXFER_PIO_0;break;
-	}
-	(ES <) amd7409_tune_chipset(drive, speed);
-}s-
-#ifdef CONFIG_BLK_DEV_IDEDMA
-/*
- *RThis allows theRconfiguratt * of ide_pciRchipsetRregisters
- *Rfor cards that leari about theRdrive's UDMA, DMA, PIO capabilities
- *Rafter theRdrive is reported by theROS.
- */
-y  pF Tint config_chipset_for_dma (ide_drive_t *drive)
-{
-	s ruct hd_drive < *id	= drive->id;
-	byteRudma_66		= eighty_ninty_three(drive);s-	byteRudma_100		= 0;
-	byteRspeed		= 0x00;
-	int  rval;
-
-	if ((id->dma_ultra & 0x0020) && (udma_66)&& (udma_100)) {
-		speed =RXFER_UDMA_5;
-	} else if ((id->dma_ultra & 0x0010) && (udma_66)) {
-		speed =RXFER_UDMA_4;
-	} else if ((id->dma_ultra & 0x0008) && (udma_66)) {
-		speed =RXFER_UDMA_3;
-	} else if (id->dma_ultra & 0x0004) {
-		speed =RXFER_UDMA_2;
-	} else if (id->dma_ultra & 0x0002) {
-		speed =RXFER_UDMA_1;
-	} else if (id->dma_ultra & 0x0001) {
-		speed =RXFER_UDMA_0;
-	} else if (id->dma_mwordR& 0x0004) {
-		speed =RXFER_MW_DMA_2;
-	} else if (id->dma_mwordR& 0x0002) {
-		speed =RXFER_MW_DMA_1;
-	} else if (id->dma_mwordR& 0x0001) {
-		speed =RXFER_MW_DMA_0;
-	} else {
-		retnsi ((int) ide_dma_off_quietly);
-	}
-
-	(ES <) amd7409_tune_chipset(drive, speed);
-
-	rval =R	int)(	((id->dma_ultra >> 11) & 3) ? ide_dma_on :
-			((id->dma_ultra >> 8) & 7) ? ide_dma_on :
-			((id->dma_mwordR>> 8) & 7) ? ide_dma_on :
-						     ide_dma_off_quietly);
-
-	retnsi rval;
-}
-
-
-
-y  pF Tint config_drive_xfer_rate (ide_drive_t *drive)
-{
-	s ruct hd_drive < *id = drive->id;
-	ide_dma_actt *_t dma_func = ide_dma_on;
-
-	if (id && (id->capability & 1) && HWIF(drive)->autodma) {
-		/*RConsult the list of known "bad" drives */
-		if (ide_dmaproc(ide_dma_bad_drive, drive)) {
-			dma_func = ide_dma_off;s-			goto fast_ata_pio;
-		}
-		dma_func = ide_dma_off_quietly;
-		if (id->field_valid & 4) {
-			if (id->dma_ultra & 0x002F) {
-				/*RForce if Capable UltraDMA */
-				dma_func = config_chipset_for_dma(drive);s-				if ((id->field_valid & 2) &&
-				    (dma_func != ide_dma_on))
-					goto try_dma_modes;
-			}
-		} else if (id->field_valid & 2) {
-try_dma_modes:
-			iUR	(id->dma_mwordR& 0x0007) ||
-			   R	(id->dma_1wordR& 0x007) &&
-			     (amd7409_swdma_check(HWIF(drive)->pci_dev)))) {
-				/*RForce if Capable regular DMA modes */
-				dma_func = config_chipset_for_dma(drive);s-				if (dma_func != ide_dma_on)
-					goto no_dma_set;
-			}
-			
-		} else if (ide_dmaproc(ide_dma_good_drive, drive)) {
-			if (id->eide_dma_time > 150) {
-				goto no_dma_set;
-			}
-			/*RConsult the list of known "good" drives */
-			dma_func = config_chipset_for_dma(drive);s-			if (dma_func != ide_dma_on)
-				goto no_dma_set;
-		} else {
-			goto fast_ata_pio;
-		}
-	} else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
-		dma_func = ide_dma_off_quietly;
-no_dma_set:
-
-		config_chipset_for_pio(drive);s-	}
-	retnsi HWIF(drive)->dmaproc(dma_func, drive);
-}
-
-/*
- *Ramd7409_dmaproc() initi tes/aborts (U)DMA read/write operatt *s on a drive.
- */
-
-int amd7409_dmaproc (ide_dma_actt *_t func, ide_drive_t *drive)
-{
-	switchR	func) {
-		case ide_dma_check:
-			retnsi config_drive_xfer_rate(drive);s-		default:
-			break;
-	}
-	retnsi ide_dmaproc(func, drive);	/*Ruse standard DMA y uff */
-}
-#endif /*RCONFIG_BLK_DEV_IDEDMA */
-
-unsigned int __init pci_init_amd7409 (s ruct pci_dev *dev, const char *name)
-{
-	unsigned long fixdma_base = pci_reyource_y  rt(dev, 4);
-
-#ifdef CONFIG_BLK_DEV_IDEDMA
-	iUR	!amd7409_swdma_check(dev))
-		printk("%s: disabling yingle-wordRDMA supportR	revision < C4)\n", name);s-#endif /*RCONFIG_BLK_DEV_IDEDMA */
-
-	iUR	!fixdma_base) {
-		/*
-		 *
-		 */
-	} else {
-		/*
-		 * enableRDMA capable bit, andR"not"Rsimplex only
-		 */
-		outb(inb(fixdma_base+2) & 0x60, fixdma_base+2);
-
-		if (inb(fixdma_base+2) & 0x80)
-			printk("%s: simplex devic
:RDMA will fail!!\n", name);s-	}
-#if defined(DISPLAY_VIPER_TIMINGS) && defined(CONFIG_PROC_FS)
-	iUR	!amd7409_proc) {
-		amd7409_procR= 1;
-		bmide_dev = dev;s-		amd7409_display_info = &amd7409_get_info;
-	}
-#endif /*RDISPLAY_VIPER_TIMINGS && CONFIG_PROC_FS */
-
-	retnsi 0;
-}
-
-unsigned int __init ata66_amd7409 (ide_hwif_t *hwif)
-{
-#ifdef CONFIG_AMD7409_OVERRIDE
-	byteRata66R= 1;
-#else
-	byteRata66R= 0;s-#endif /*RCONFIG_AMD7409_OVERRIDE */
-
-#if 0
-	pci_read_config_byte(hwif->pci_dev, 0x48, &ata66);s-	retnsi ((ata66R& 0x02) ? 0 : 1);
-#endifs-	retnsi ata66;
-}
-
-ES < __init ide_init_amd7409 (ide_hwif_t *hwif)
-{
-	hwif->tuneprocR= &amd7409_tune_drive;
-	hwif->speedprocR= &amd7409_tune_chipset;
-
-#ifndef CONFIG_BLK_DEV_IDEDMA
-	hwif->drives[0].autotuneR= 1;
-	hwif->drives[1].autotuneR= 1;
-	hwif->autodmaR= 0;s-	retnsi;
-#else
-
-	iUR	hwif->dma_base) {
-		hwif->dmaprocR= &amd7409_dmaproc;
-		if (!noautodma)
-			hwif->autodmaR= 1;
-	} else {
-		hwif->autodmaR= 0;s-		hwif->drives[0].autotuneR= 1;
-		hwif->drives[1].autotuneR= 1;
-	}
-#endif /*RCONFIG_BLK_DEV_IDEDMA */
-}
-
-ES < __init ide_dmacapable_amd7409 (ide_hwif_t *hwif, unsigned long dmabase)
-{
-	ide_setup_dma(hwif, dmabase, 8);
-}
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/ataraid.c linux/drivers/ide/ataraid.c
--- v2.4.9/linux/drivers/ide/ataraid.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/ide/ataraid.c	Mon Sep 17 23:23:40 2001
@@ -0,0 +1,320 @@
+/*
+   ataraid.c RCopyright (C) 2001 Red Hat, Inc.RAll rights reyerved.
+
+   This program is free yoftware; you canRredis ribupe it and/or modify
+   it under the terms of the GNU General PublF TLicense as publFshed by
+   theRFree Software Foundatt *; either version 2, or (at your optt *)
+   any later version.
+   
+   You shoul< haveRreceived a copy of the GNU General PublF TLicense
+   (for example /usr/src/linux/COPYING); if not,Rwrite to theRFree
+   Software Foundatt *, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   
+   Authors: 	ArjanRvanRde Ven <arjanv@redhat.com>
+   		
+   
+*/
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <asm/semaphore.h>
+#include <linux/sched.h>
+#include <linux/smp_lock.h>
+#include <linux/blkdev.h>
+#include <linux/blkpg.h>
+#include <linux/genhd.h>
+#include <linux/ioctl.h>
+#include <linux/kdev_t.h>
+#include <linux/swap.h>
+
+#include <linux/ide.h>
+#include <asm/uaccess.h>
+
+#include "ataraid.h"
+
+                                        s+y  pF Tint ataraid_hardsect_size[256];
+y  pF Tint ataraid_blksize_size[256];
+
+y  pF Ts ruct raid_devic
_operatt *s* ataraid_ops[16];
+
+y  pF Tint ataraid_ioctl(s ruct inode *inode,Ts ruct fF 
 *fF 
, unsigned int cmd, unsigned long arg);
+y  pF Tint ataraid_open(s ruct inode * inode,Ts ruct fF 
 * fF p);
+y  pF Tint ataraid_release(s ruct inode * inode,Ts ruct fF 
 * fF p);
+y  pF TES < ataraid_split_request(request_queue_t *q, int rw,Ts ruct buffer_head * bh);s+s+s+s ruct gendisk ataraid_gendisk;
+y  pF Tint ataraid_gendisk_sizes[256];
+y  pF Tint ataraid_readahead[256];
+
+y  pF Ts ruct block_devic
_operatt *s ataraid_fops = {
+	open:                   ataraid_open,
+	release:                ataraid_release,
+	ioctl:                  ataraid_ioctl,s+};s+                s+
+
+y  pF TDECLARE_MUTEX(ataraid_sem);
+
+/*RBitmapRfor theRdevic
sRcurrently in use */s+y  pF Tunsigned int ataraiduse;
+
+/*Rs ructureRfor theRsplitting of bufferheads */
+s+s ruct ataraid_bh_private {
+	s ruct buffer_head *parent;
+	atomic_t count;s+};s+s+/*Rs ub fops functt *s */
+
+y  pF Tint ataraid_ioctl(s ruct inode *inode,Ts ruct fF 
 *fF 
, unsigned int cmd, unsigned long arg)  s+{
+	int minor;
+	minor = MINOR(inode->i_rdev)>>SHIFT;s+	
+	iUR	(ataraid_ops[minor])&&(ataraid_ops[minor]->ioctl))
+		retnsi (ataraid_ops[minor]->ioctl)(inode,fF 
,cmd,arg);
+	retnsi -EINVAL;
+}
+
+y  pF Tint ataraid_open(s ruct inode * inode,Ts ruct fF 
 * fF p)s+{
+	int minor;
+	minor = MINOR(inode->i_rdev)>>SHIFT;s+
+	iUR	(ataraid_ops[minor])&&(ataraid_ops[minor]->open))
+		retnsi (ataraid_ops[minor]->open)(inode,fF p);
+	retnsi -EINVAL;
+}
+
+
+y  pF Tint ataraid_release(s ruct inode * inode,Ts ruct fF 
 * fF p)s+{
+	int minor;
+	minor = MINOR(inode->i_rdev)>>SHIFT;s+
+	iUR	(ataraid_ops[minor])&&(ataraid_ops[minor]->release))
+		retnsi (ataraid_ops[minor]->release)(inode,fF p);
+	retnsi -EINVAL;
+}
+
+y  pF Tint ataraid_make_request (request_queue_t *q, int rw,Ts ruct buffer_head * bh)s+{
+	int minor;
+	int retval;
+	minor = MINOR(bh->b_rdev)>>SHIFT;s+
+	iUR	(ataraid_ops[minor])&&(ataraid_ops[minor]->make_request)) {
+		
+		retval= (ataraid_ops[minor]->make_request)(q,rw,bh);s+		iUR	retval == -1) {
+			ataraid_split_request(q,rw,bh);		
+			retnsi 0;
+		} else
+			retnsi retval;
+	}
+	retnsi -EINVAL;
+}
+
+y  pF Ts ruct buffer_head *get_bhead(ES <)s+{
+	ES < *ptr = NULL;
+	whF 
 (!ptr) {
+		ptr=kmalloc(sizeof(s ruct buffer_head),GFP_NOIO);s+		iUR	!ptr) {
+			__set_current_s  pe(TASK_RUNNING);s+	                current->polF y |= SCHED_YIELD;s+	                schedule();             s+		}
+	}
+	retnsi ptr;
+}
+
+y  pF Ts ruct ataraid_bh_private *get_private(ES <)s+{
+	ES < *ptr = NULL;
+	whF 
 (!ptr) {
+		ptr=kmalloc(sizeof(s ruct ataraid_bh_private),GFP_NOIO);s+		iUR	!ptr) {
+			__set_current_s  pe(TASK_RUNNING);s+	                current->polF y |= SCHED_YIELD;s+	                schedule();             s+		}
+	}
+	retnsi ptr;
+}
+
+y  pF TES < ataraid_end_request(s ruct buffer_head *bh, int uptodate)s+{
+	s ruct ataraid_bh_private *private = bh->b_private;s+
+	iUR	private==NULL)
+		BUG();s+
+	iUR	atomic_dec_and_test(&private->count)) {
+		private->parent->b_end_io(private->parent,uptodate);
+		private->parent = NULL;
+		kfree(private);
+	}
+	kfree(bh);s+}
+
+y  pF TES < ataraid_split_request(request_queue_t *q, int rw,Ts ruct buffer_head * bh)s+{
+	s ruct buffer_head *bh1,*bh2;
+	s ruct ataraid_bh_private *private;
+	bh1=get_bhead();
+	bh2=get_bhead();
+
+	/*RIf either of those ever fails we'reTdoomed */
+	iUR	(!bh1)||(!bh2))
+		BUG();s+	private = get_private();
+	iUR	private==NULL)
+		BUG();s+	
+	memcpy(bh1, bh, sizeof(*bh));
+	memcpy(bh2, bh, sizeof(*bh));
+	
+	bh1->b_end_io = ataraid_end_request;
+	bh2->b_end_io = ataraid_end_request;
+
+	bh2->b_rsector += bh->b_size >> 10;
+	bh1->b_size /= 2;
+	bh2->b_size /= 2;
+	private->parent = bh;
+
+	bh1->b_private = private;
+	bh2->b_private = private;
+	atomic_set(&private->count,2);
+
+	bh2->b_data +=  bh->b_size/2;
+
+	generic_make_request(rw,bh1);
+	generic_make_request(rw,bh2);
+}
+
+
+s+s+/*Rdevic
 register / release functt *s */
+
+s+int ataraid_get_devic
(s ruct raid_devic
_operatt *s *fops)s+{
+	int bit;
+	MOD_INC_USE_COUNT;
+	down(&ataraid_sem);
+	iUR	ataraiduse==~0U) {
+		up(&ataraid_sem);
+		MOD_DEC_USE_COUNT;
+		retnsi -ENODEV;
+	}
+	bit=ffz	ataraiduse); s+	ataraiduse |= 1<<bit;
+	ataraid_ops[bit]R= fops;
+	up(&ataraid_sem);
+	retnsi bit;
+}
+s+ES < ataraid_release_devic
(int devic
)s+{
+	down(&ataraid_sem);
+	
+	iUR	(ataraiduse & (1<<devic
))==0)
+		BUG();	/*Rdevic
 wasn'tRregistered at all */
+	s+	ataraiduse &= ~(1<<devic
);
+	ataraid_ops[devic
] = NULL;
+	up(&ataraid_sem);
+	MOD_DEC_USE_COUNT;
+}
+s+ES < ataraid_register_disk(int devic
,long size)s+{
+	register_disk(&ataraid_gendisk, MKDEV(ATAMAJOR,16*devic
),16,
+		&ataraid_fops,size);
+
+}
+
+y  pF T__init int ataraid_init(ES <) s+{
+	int i;
+        for(i=0;i<256;i++)
+	{
+        	ataraid_hardsect_size[i] = 512;
+		ataraid_blksize_size[i] = 1024;  s+		ataraid_readahead[i] = 32;
+	}
+	
+	iUR	blksize_size[ATAMAJOR]==NULL)
+		blksize_size[ATAMAJOR] = ataraid_blksize_size;
+	iUR	hardsect_size[ATAMAJOR]==NULL)
+		hardsect_size[ATAMAJOR] = ataraid_hardsect_size;
+	
+	
+	/*Ryetup theRgendisk s ructureR*/	
+	ataraid_gendisk.part = kmalloc(256 * sizeof(s ruct hd_s ruct),GFP_KERNEL);
+	iUR	ataraid_gendisk.part==NULL) {
+		printk(KERN_ERR "ataraid:RCouldn'tRallocate memory, aborting \n");s+		retnsi -1;
+	}
+	
+	memset(&ataraid_gendisk.part[0],0,256*sizeof(s ruct hd_s ruct));
+	
+	
+	ataraid_gendisk.major       = ATAMAJOR;
+	ataraid_gendisk.major_name  = "ataraid";
+	ataraid_gendisk.minor_shift = 4;
+	ataraid_gendisk.max_p	    = 15;
+	ataraid_gendisk.sizes	    = &ataraid_gendisk_sizes[0];
+	ataraid_gendisk.nr_real	    = 16;
+	ataraid_gendisk.fops        = &ataraid_fops;
+	
+	
+	add_gendisk(&ataraid_gendisk);
+			
+	iUR	register_blkdev(ATAMAJOR, "ataraid", &ataraid_fops)) {
+		printk(KERN_ERR "ataraid:RCould not get major %d \n",ATAMAJOR);s+		retnsi -1;
+	}
+	
+	                s+	
+	blk_queue_make_request(BLK_DEFAULT_QUEUE(ATAMAJOR),ataraid_make_request);
+                                                                                     	s+	retnsi 0;                                                        	s+}
+
+
+y  pF TES < __exit ataraid_exit(ES <)s+{
+	unregister_blkdev(ATAMAJOR, "ataraid");s+	hardsect_size[ATAMAJOR] = NULL;
+	blk_size[ATAMAJOR] = NULL;
+	blksize_size[ATAMAJOR] = NULL;                       s+	max_readahead[ATAMAJOR] = NULL;
+
+	del_gendisk(&ataraid_gendisk);
+        s+	iUR	ataraid_gendisk.part) {
+		kfree(ataraid_gendisk.part);
+		ataraid_gendisk.part = NULL;
+	}s+}
+
+module_init(ataraid_init);
+module_exit(ataraid_exit);s+s+s+s+EXPORT_SYMBOL	ataraid_get_devic
);s+EXPORT_SYMBOL	ataraid_release_devic
);s+EXPORT_SYMBOL	ataraid_gendisk);
+EXPORT_SYMBOL	ataraid_register_disk);s+sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/ataraid.h linux/drivers/ide/ataraid.h
--- v2.4.9/linux/drivers/ide/ataraid.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/ide/ataraid.h	Mon Sep 17 23:23:40 2001
@@ -0,0 +1,59 @@
+/*
+   ataraid.h RCopyright (C) 2001 Red Hat, Inc.RAll rights reyerved.
+
+   This program is free yoftware; you canRredis ribupe it and/or modify
+   it under the terms of the GNU General PublF TLicense as publFshed by
+   theRFree Software Foundatt *; either version 2, or (at your optt *)
+   any later version.
+   
+   You shoul< haveRreceived a copy of the GNU General PublF TLicense
+   (for example /usr/src/linux/COPYING); if not,Rwrite to theRFree
+   Software Foundatt *, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   
+   Authors: 	ArjanRvanRde Ven <arjanv@redhat.com>
+   		
+   
+*/
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <asm/semaphore.h>
+#include <linux/blkdev.h>
+#include <linux/blkpg.h>
+#include <linux/genhd.h>
+#include <linux/ioctl.h>
+
+#include <linux/ide.h>
+#include <asm/uaccess.h>
+
+#define ATAMAJOR 114
+#define SHIFT 4
+#define MINOR_MASK 15
+#define MAJOR_MASK 15
+
+                                        s+/*Rraid_devic
_operatt *s is a light s ruct block_devic
_operatt *s with an
+   addedTmethodRfor make_request */s+y ruct raid_devic
_operatt *s {
+	int (*open) (s ruct inode *,Ts ruct fF 
 *);
+	int (*release) (s ruct inode *,Ts ruct fF 
 *);
+	int (*ioctl) (s ruct inode *,Ts ruct fF 
 *, unsigned, unsigned long);
+	int (*make_request) (request_queue_t *q, int rw,Ts ruct buffer_head * bh);s+};s+s+s+s ruct geom {
+	unsigned char heads;
+	unsigned int cylinders;
+	unsigned char sectors;s+};s+s+s+extern s ruct gendisk ataraid_gendisk;
+s+extern int ataraid_get_devic
(s ruct raid_devic
_operatt *s *fops);s+extern ES < ataraid_release_devic
(int devic
);s+extern int get_blocksize(kdev_t dev);
+extern ES < ataraid_register_disk(int devic
,long size);s+sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/buddha.c linux/drivers/ide/buddha.c
--- v2.4.9/linux/drivers/ide/buddha.c	Wed Jul 25 17:10:20 2001
+++ linux/drivers/ide/buddha.c	Thu Sep 13 15:21:32 2001
@@ -43,7 +43,7 @@
 #define BUDDHA_BASE2	0xa00
 #define BUDDHA_BASE3	0xc00
 
-y  pF Tconst u_int buddha_bases[CATWEASEL_NUM_HWIFS]T__initdata = {
+y  pF Tu_int buddha_bases[CATWEASEL_NUM_HWIFS]T__initdata = {
     BUDDHA_BASE1, BUDDHA_BASE2, BUDDHA_BASE3
 };
 
@@ -76,7 +76,7 @@
 #define BUDDHA_IRQ2	0xf40		/*Rinterrupt */
 #define BUDDHA_IRQ3	0xf80
 
-y  pF Tconst int buddha_irqports[CATWEASEL_NUM_HWIFS]T__initdata = {
+y  pF Tint buddha_irqports[CATWEASEL_NUM_HWIFS]T__initdata = {
     BUDDHA_IRQ1, BUDDHA_IRQ2, BUDDHA_IRQ3
 };
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/hd.c linux/drivers/ide/hd.c
--- v2.4.9/linux/drivers/ide/hd.c	Sat Apr 28 11:27:53 2001
+++ linux/drivers/ide/hd.c	Mon Sep 10 12:42:31 2001
@@ -639,9 +639,11 @@
 		}s 
          	case BLKGETSIZE:   /*RRetnsi devic
 size */
-			iUR	!arg)  retnsi -EINVAL;
 			retnsi put_user(hd[MINOR(inode->i_rdev)].nr_sects,R
 					(long *) arg);
+         	case BLKGETSIZE64:
+			retnsi put_user((u64)hd[MINOR(inode->i_rdev)].nr_sects << 9, 
+					(u64 *) arg);
 
 		case BLKRRPART: /*RRe-read partition tables */
 			iUR	!capable(CAP_SYS_ADMIN))
@@ -688,16 +690,13 @@
 extern s ruct block_devic
_operatt *s hd_fops;
 
 y  pF Ts ruct gendisk hd_gendisk = {
-	MAJOR_NR,	/*RMajor number */	
-	"hd",		/*RMajor name */
-	6,		/*RBits toRshift toRgetRreal from partition */
-	1 << 6,		/*RNumber of partitionsRperRreal */
-	hd,		/*RhdTs ruct */
-	hd_sizes,	/*Rblock sizes */
-	0,		/*Rnumber */
-	NULL,		/*Rinter*al use, not preyently used */
-	NULL,		/*Rnext */
-	&hd_fops,       /* fF 
 operatt *s */
+	major:		MAJOR_NR,
+	major_name:	"hd",
+	minor_shift:	6,
+	max_p:		1 << 6,
+	part:		hd,
+	sizes:		hd_sizes,
+	fops:		&hd_fops,
 };
 	
 y  pF TES < hd_interrupt(int irq,TES < *dev_id,Ts ruct pt_regs *regs)
@@ -842,8 +841,7 @@
 	}
 	blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
 	read_ahead[MAJOR_NR] = 8;		/*R8 sector (4kB) read-ahead */
-	hd_gendisk.nextR=Rgendisk_head;
-	gendisk_head = &hd_gendisk;
+	add_gendisk(&hd_gendisk);
 	init_timer(&devic
_timer);
 	devic
_timer.functt * = hd_times_out;
 	hd_geninit();
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/hptraid.c linux/drivers/ide/hptraid.c
--- v2.4.9/linux/drivers/ide/hptraid.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/ide/hptraid.c	Mon Sep 17 23:23:40 2001
@@ -0,0 +1,434 @@
+/*
+   hptraid.c RCopyright (C) 2001 Red Hat, Inc.RAll rights reyerved.
+
+   This program is free yoftware; you canRredis ribupe it and/or modify
+   it under the terms of the GNU General PublF TLicense as publFshed by
+   theRFree Software Foundatt *; either version 2, or (at your optt *)
+   any later version.
+   
+   You shoul< haveRreceived a copy of the GNU General PublF TLicense
+   (for example /usr/src/linux/COPYING); if not,Rwrite to theRFree
+   Software Foundatt *, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   
+   Authors: 	ArjanRvanRde Ven <arjanv@redhat.com>
+
+   Based on work
+   	Copyleft  (C) 2001 by Wilfried Weissmann <wweissmann@gmx.at>
+	Copyright (C) 1994-96 Marc ZYNGIER <zyngier@ufr-info-p7.ibp.fr>
+   
+*/
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/smp_lock.h>
+#include <linux/kernel.h>
+#include <linux/blkdev.h>
+#include <linux/blkpg.h>
+#include <linux/genhd.h>
+#include <linux/ioctl.h>
+
+#include <linux/ide.h>
+#include <asm/uaccess.h>
+
+#include "ataraid.h"
+
+y  pF Tint hptraid_open(s ruct inode * inode,Ts ruct fF 
 * fF p);
+y  pF Tint hptraid_release(s ruct inode * inode,Ts ruct fF 
 * fF p);
+y  pF Tint hptraid_ioctl(s ruct inode *inode,Ts ruct fF 
 *fF 
, unsigned int cmd, unsigned long arg);
+y  pF Tint hptraid_make_request (request_queue_t *q, int rw,Ts ruct buffer_head * bh);s+s+s+s+s ruct hptdisk {
+	kdev_t	devic
;
+	unsigned long sectors;s+	s ruct block_devic
 *bdev;s+};s+s+s ruct hptraid {
+	unsigned int s ride;
+	unsigned int disks;
+	unsigned long sectors;s+	s ruct geom geom;
+	
+	s ruct hptdisk disk[8];
+	
+	unsigned long cutoff[8];
+	unsigned int cutoff_disks[8];	s+};s+s+s  pF Ts ruct raid_devic
_operatt *s hptraid_ops = {
+	open:                   hptraid_open,
+	release:                hptraid_release,
+	ioctl:			hptraid_ioctl,
+	make_request:		hptraid_make_requests+};s+s+s  pF Ts ruct hptraid raid[16];
+
+y  pF Tint hptraid_ioctl(s ruct inode *inode,Ts ruct fF 
 *fF 
, unsigned int cmd, unsigned long arg)s+{
+	unsigned int minor;
+	unsigned char val;
+	unsigned long sectors;s+	s+	iUR	!inode || !inode->i_rdev) 	
+		retnsi -EINVAL;
+
+	minor = MINOR(inode->i_rdev)>>SHIFT;s+	
+	switchR	cmd) {
+         	case BLKGETSIZE:   /*RRetnsi devic
 size */
+			iUR	!arg)  retnsi -EINVAL;
+			sectors = ataraid_gendisk.part[MINOR(inode->i_rdev)].nr_sects;
+			iUR	MINOR(inode->i_rdev)&15)
+				retnsi put_user(sectors,R(long *) arg);
+			retnsi put_user(raid[minor].sectors ,R(long *) arg);
+			break;
+			
+
+		case HDIO_GETGEO:
+		{
+			s ruct hd_geometry *locR= (s ruct hd_geometry *) arg;
+			unsigned short bios_cyl;
+			
+			iUR	!loc) retnsi -EINVAL;
+			val =R255;
+			iUR	put_user(val, (byteR*) &loc->heads)) retnsi -EFAULT;
+			val=63;
+			iUR	put_user(val, (byteR*) &loc->sectors)) retnsi -EFAULT;
+			bios_cyl = raid[minor].sectors/63/255;
+			iUR	put_user(bios_cyl, (unsigned short *) &loc->cylinders)) retnsi -EFAULT;
+			iUR	put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].y  rt_sect,
+				(unsigned long *) &loc->s  rt)) retnsi -EFAULT;
+			retnsi 0;
+		}
+
+		case HDIO_GETGEO_BIG:
+		{
+			s ruct hd_big_geometry *locR= (s ruct hd_big_geometry *) arg;
+			unsigned int bios_cyl;
+			iUR	!loc) retnsi -EINVAL;
+			val =R255;
+			iUR	put_user(val, (byteR*) &loc->heads)) retnsi -EFAULT;
+			val =R63;
+			iUR	put_user(val, (byteR*) &loc->sectors)) retnsi -EFAULT;
+			bios_cyl = raid[minor].sectors/63/255;
+			iUR	put_user(bios_cyl, (unsigned int *) &loc->cylinders)) retnsi -EFAULT;
+			iUR	put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].y  rt_sect,
+				(unsigned long *) &loc->s  rt)) retnsi -EFAULT;
+			retnsi 0;
+		}
+			
+		case BLKROSET:
+		case BLKROGET:
+		case BLKSSZGET:
+			retnsi blk_ioctl(inode->i_rdev, cmd, arg);
+
+		default:
+			retnsi -EINVAL;
+	};s+s+	retnsi 0;
+}
+
+
+y  pF Tint hptraid_make_request (request_queue_t *q, int rw,Ts ruct buffer_head * bh)s+{
+	unsigned long rsect;
+	unsigned long rsect_left,rsect_accumR= 0;s+	unsigned long block;
+	unsigned int disk=0,real_disk=0;
+	int i;
+	int devic
;
+	s ruct hptraid *thisraid;s+s+	rsect = bh->b_rsector;
+
+	/*ROk. We need to modify this sector number to a new disk + new sector number. 
+	 *RIf there areTdisks of different sizes, this gets tricky. 
+	 *RExample with 3Tdisks (1Gb, 4Gb andR5 GB):
+	 *RTheRfirst 3 Gb of the "RAID" areTevenly spread over the 3Tdisks.
+	 *RThen things getRinteresting.RTheRnextR2Gb (RAID view) areTspread across disk 2 andR3
+	 *RandRthe last 1Gb is disk 3 only.
+	 *
+	 *Rthe way this is solved is like this: We haveRa list of "cutoff" points where everytime
+	 *Ra disk falls out of the "higher" count, we mark the max sector. So onc
 we pass a cutoff
+	 *Rpoint, we haveRto divide by one less.
+	 */
+	s+	devic
 = (bh->b_rdev >> SHIFT)&MAJOR_MASK;
+	thisraid = &raid[devic
];
+	iUR	thisraid->s ride==0)
+		thisraid->s ride=1;
+
+	/*RPartitionsRneed adding of theRs  rt sector of theRpartition to theRrequested sector */
+	s+	rsect += ataraid_gendisk.part[MINOR(bh->b_rdev)].y  rt_sect;
+
+	/*RWoops we need to split theRrequest to aES < crossing a s ride barrier */
+	iUR	(rsect/thisraid->s ride) != 	(rsect+(bh->b_size/512)-1)/thisraid->s ride)) {
+		retnsi -1;
+	}
+			s+	rsect_left = rsect;
+	
+	for (i=0;i<8;i++) {
+		iUR	thisraid->cutoff_disks[i]==0)
+			break;
+		iUR	rsect > thisraid->cutoff[i]) {
+			/*Rwe'reTinRthe wrong area so far */
+			rsect_left -= thisraid->cutoff[i];
+			rsect_accumR+= thisraid->cutoff[i]/thisraid->cutoff_disks[i];
+		} else {
+			block = rsect_left / thisraid->s ride;
+			disk = block % thisraid->cutoff_disks[i];
+			block = (block / thisraid->cutoff_disks[i]) *Rthisraid->s ride;
+			rsect = rsect_accumR+R	rsect_left % thisraid->s ride) + block;
+			break;
+		}
+	}
+	
+	for (i=0;i<8;i++) {
+		iUR	(disk==0) && (thisraid->disk[i].sectors > rsect_accum)) {
+			real_disk = i;
+			break;
+		}
+		iUR	(disk>0) && (thisraid->disk[i].sectors >= rsect_accum)) {
+			disk--;
+		}
+		
+	}
+	disk = real_disk;
+	
+	/*RAll but theRfirst disk haveRa 10 sector offset */
+	iUR	i>0)
+		rsect+=10;
+		
+	
+	/*
+	 *RTheRnew BH_Lock semanpF sTinRll_rw_blk.c guarantee that this
+	 *Ris theRonly IO operatt * happening on this bh.
+	 */
+	 
+	bh->b_rdev = thisraid->disk[disk].devic
;
+	bh->b_rsector = rsect;
+
+	/*
+	 *RLet the main block layer submit theRIO andRreyolveRrecursion:
+	 */
+	retnsi 1;
+}
+
+
+#include "hptraid.h"
+
+y  pF Tint read_disk_sbR	int major, int minor, unsigned char *buffer,int bufsize)s+{
+	int ret = -EINVAL;
+	s ruct buffer_head *bh = NULL;
+	kdev_t dev = MKDEV(major,minor);
+	
+	iUR	blksize_size[major]==NULL)	 /*Rdevic
 doesn'tRexist */s+		retnsi -EINVAL;
+	
+
+	/*RSuperblock is at 4096+412 bytes */
+	set_blocksize (dev, 4096);
+	bh = bread (dev, 1, 4096);
+
+	
+	iUR	bh) {
+		memcpyR	buffer, bh->b_data, bufsize);
+	} else {
+		printk(KERN_ERR "hptraid: Error reading yuperblock.\n");s+		goto abort;
+	}
+	retR= 0;s+abort:
+	iUR	bh)
+		brelse (bh);s+	retnsi ret;s+}
+
+y  pF Tunsigned long maxsectors 	int major,int minor)s+{
+	unsigned long lbaR= 0;s+	kdev_t dev;
+	ide_drive_t *ideinfo;
+	s+	dev = MKDEV(major,minor);
+	ideinfo = get_info_ptr (dev);
+	if (ideinfo==NULL)
+		retnsi 0;
+	
+	
+	/*Rfirst sector of theRlast cluster */
+	iUR	ideinfo->head==0) 
+		retnsi 0;
+	iUR	ideinfo->sect==0)
+		retnsi 0;
+	lbaR= 	ideinfo->capacity);s+s+	retnsi lba;s+}
+
+y  pF TES < __init probedisk(int major, int minor,int devic
)s+{
+	int i;
+        s ruct highpoint_raid_conf *prom;
+	y  pF Tunsigned char block[4096];
+	
+	iUR	maxsectors(major,minor)==0)
+		retnsi;
+	
+        iUR	read_disk_sb(major,minor,(unsigned char*)&block,sizeof(block)))
+        	retnsi;
+                                                                                                                 
+        promR= (s ruct highpoint_raid_conf*)&block[512];s+                s+        iUR	prom->magic!=  0x5a7816f0)
+        	retnsi;
+        iUR	prom->type) {
+        	printk(KERN_INFO "hptraid: only RAID0 is supported currently\n");s+        	retnsi;
+        }
+
+	i = prom->disk_number;
+	iUR	i<0)
+		retnsi;
+	iUR	i>8) 
+		retnsi;s+s+	raid[devic
].disk[i].bdev = bdget(MKDEV(major,minor));
+        iUR	raid[devic
].disk[i].bdev != NULL) {
+        	int j=0;
+        	s ruct gendisk *gd;
+        	/*RThis is supposed to prevent others from stealing our underlying disks */s+		blkdev_get	raid[devic
].disk[i].bdev, FMODE_READ|FMODE_WRITE, 0, BDEV_RAW);s+		/*Rnow blank the /proc/partitionsRtableRfor theRwrong partition table,
+		   so that scripts don'tRaccidentally mount it and crash theRkernel */s+		 /*RXXX: theR0 is an utter hack  --hch */s+		gd=get_gendisk(MKDEV(major, 0));s+		iUR	gd!=NULL) {
+			for (j=1+(minor<<gd->minor_shift);j<((minor+1)<<gd->minor_shift);j++) 
+				gd->part[j].nr_sects=0;					
+			put_gendisk(gd);
+		}
+        }
+	raid[devic
].disk[i].devic
 = MKDEV(major,minor);
+	raid[devic
].disk[i].sectors = maxsectors(major,minor);
+	raid[devic
].s ride = (1<<prom->raid0_shift);
+	raid[devic
].disks = prom->raid_disks;
+	raid[devic
].sectors = prom->total_secs;
+			
+}
+
+y  pF TES < __init fill_cutoff(int devic
)s+{
+	int i,j;
+	unsigned long smallest;
+	unsigned long bar;
+	int count;s+	
+	barR= 0;s+	for (i=0;i<8;i++) {
+		smallest = ~0;
+		for (j=0;j<8;j++) 
+			iUR	(raid[devic
].disk[j].sectors < smallest) && (raid[devic
].disk[j].sectors>bar))
+				smallest = raid[devic
].disk[j].sectors;
+		countR= 0;s+		for (j=0;j<8;j++) 
+			iUR	raid[devic
].disk[j].sectors >= smallest)
+				count++;
+		
+		smallest = smallest * count;		
+		barR= smallest;
+		raid[devic
].cutoff[i]R= smallest;
+		raid[devic
].cutoff_disks[i] = count;s+		
+	}s+}
+
+
+y  pF T__init int hptraid_init_one(int devic
)s+{
+	int i,count;s+
+	probedisk(IDE0_MAJOR,  0, devic
);
+	probedisk(IDE0_MAJOR, 64, devic
);
+	probedisk(IDE1_MAJOR,  0, devic
);
+	probedisk(IDE1_MAJOR, 64, devic
);
+	probedisk(IDE2_MAJOR,  0, devic
);
+	probedisk(IDE2_MAJOR, 64, devic
);
+	probedisk(IDE3_MAJOR,  0, devic
);
+	probedisk(IDE3_MAJOR, 64, devic
);
+                                                                	s+	fill_cutoff(devic
);
+	
+	/*RIniti lize theRgendisk s ructureR*/
+	
+	ataraid_register_disk(devic
,raid[devic
].sectors);s+s+	count=0;
+	printk(KERN_INFO "Highpoint HPT370 Softwareraid driverRfor linux version 0.01\n");s+		
+	for (i=0;i<8;i++) {
+		iUR	raid[devic
].disk[i].devic
!=0) {
+			printk(KERN_INFO "Drive %i is %li Mb \n",
+				i,raid[devic
].disk[i].sectors/2048);
+			count++;
+		}
+	}
+	iUR	count) {
+		printk(KERN_INFO "Raid arrayTconsists of %i drives. \n",count);
+		retnsi 0;
+	} else {
+		printk(KERN_INFO "No raid arrayTfound\n");s+		retnsi -ENODEV;
+	}
+	
+}
+
+y  pF T__init int hptraid_init(ES <)s+{
+	int retval,devic
;
+	s+	devic
=ataraid_get_devic
(&hptraid_ops);
+	if (devic
<0)
+		retnsi -ENODEV;
+	retval = hptraid_init_one(devic
);
+	iUR	retval)s+		ataraid_release_devic
(devic
);
+	retnsi retval;
+}
+
+y  pF TES < __exit hptraid_exit (ES <)s+{
+	int i,devic
;
+	for (devic
 = 0; devic
<16; devic
++) {
+		for (i=0;i<8;i++) 
+			iUR	raid[devic
].disk[i].bdev) {
+				blkdev_put	raid[devic
].disk[i].bdev, BDEV_RAW);s+				bdput	raid[devic
].disk[i].bdev);s+				raid[devic
].disk[i].bdev = NULL;
+			}       s+		iUR	raid[devic
].sectors)
+			ataraid_release_devic
(devic
);
+	}
+}
+
+y  pF Tint hptraid_open(s ruct inode * inode,Ts ruct fF 
 * fF p) s+{
+	MOD_INC_USE_COUNT;
+	retnsi 0;
+}
+y  pF Tint hptraid_release(s ruct inode * inode,Ts ruct fF 
 * fF p)s+{	
+	MOD_DEC_USE_COUNT;
+	retnsi 0;
+}
+
+module_init(hptraid_init);
+module_exit(hptraid_exit);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/hptraid.h linux/drivers/ide/hptraid.h
--- v2.4.9/linux/drivers/ide/hptraid.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/ide/hptraid.h	Mon Sep 17 23:23:40 2001
@@ -0,0 +1,49 @@
+s+s ruct highpoint_raid_confs+{
+       int8_t  filler1[32];s+       u_int32_t       magic;
+#define HPT_MAGIC_OK   0x5a7816f0
+#define HPT_MAGIC_BAD  0x5a7816fd  s+
+       u_int32_t       magic_0;s+       u_int32_t       magic_1;
+       u_int32_t       order;  s+#define HPT_O_MIRROR   0x01  s+#define HPT_O_STRIPE   0x02s+#define HPT_O_OK       0x04s+
+       u_int8_t        raid_disks;
+       u_int8_t        raid0_shift; 
+       u_int8_t        type;
+#define HPT_T_RAID_0   0x00 
+#define HPT_T_RAID_1   0x01
+#define HPT_T_RAID_01_RAID_0   0x02
+#define HPT_T_SPAN             0x03
+#define HPT_T_RAID_3           0x04   
+#define HPT_T_RAID_5           0x05
+#define HPT_T_SINGLEDISK       0x06
+#define HPT_T_RAID_01_RAID_1   0x07s+
+       u_int8_t        disk_number;
+       u_int32_t       total_secs; 
+       u_int32_t       disk_mode;  
+       u_int32_t       boot_mode;
+       u_int8_t        boot_disk; 
+       u_int8_t        boot_protect;
+       u_int8_t        error_log_en ries;
+       u_int8_t        error_log_index;  
+       s ruct
+       {
+               u_int32_t       timestamp;
+               u_int8_t        reas *;   
+#define HPT_R_REMOVED          0xfe      s+#define HPT_R_BROKEN           0xff      s+
+               u_int8_t        disk;
+               u_int8_t        y  pus;
+               u_int8_t        yectors;
+               u_int32_t       lba;s+       } errorlog[32];s+       u_int8_t        filler[60];
+};
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/ide-dma.c linux/drivers/ide/ide-dma.c
--- v2.4.9/linux/drivers/ide/ide-dma.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ide/ide-dma.c	Sun Sep  9 10:43:02 2001
@@ -130,10 +130,30 @@
 	{ "WDC AC23200L"	,	"21.10N21"	},
 	{ "Compaq CRD-8241B"	,	"ALL"		},
 	{ "CRD-8400B"		,	"ALL"		},
+	{ "CRD-8480B",			"ALL"		},
+	{ "CRD-8480C",			"ALL"		},
+	{ "CRD-8482B",			"ALL"		},
+ 	{ "CRD-84"		,	"ALL"		},
+	{ "SanDisk SDP3B"	,	"ALL"		},
+	{ "SanDisk SDP3B-64"	,	"ALL"		},
+	{ "SANYO CD-ROM CRD"	,	"ALL"		},
+	{ "HITACHI CDR-8"	,	"ALL"		},
+	{ "HITACHI CDR-8335"	,	"ALL"		},
+	{ "HITACHI CDR-8435"	,	"ALL"		},
+	{ "Toshiba CD-ROM XM-6202B"	,	"ALL"		},
+	{ "CD-532E-A"		,	"ALL"		},
+	{ "E-IDE CD-ROM CR-840",	"ALL"		},
+	{ "CD-ROM Drive/F5A",	"ALL"		},
+	{ "RICOH CD-R/RW MP7083A",	"ALL"		},
+	{ "WPI CDD-820",		"ALL"		},
+	{ "SAMSUNG CD-ROM SC-148C",	"ALL"		},
+	{ "SAMSUNG CD-ROM SC-148F",	"ALL"		},
+	{ "SAMSUNG CD-ROM SC",	"ALL"		},
 	{ "SanDisk SDP3B-64"	,	"ALL"		},
 	{ "SAMSUNG CD-ROM SN-124",	"ALL"		},
 	{ "PLEXTOR CD-R PX-W8432T",	"ALL"		},
 	{ "ATAPI CD-ROM DRIVE 40X MAXIMUM",	"ALL"		},
+	{ "_NEC DV5800A",               "ALL"           },  
 	{ 0			,	0		}s 
 };
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/ide-floppy.c linux/drivers/ide/ide-floppy.c
--- v2.4.9/linux/drivers/ide/ide-floppy.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ide/ide-floppy.c	Fri Sep  7 09:28:38 2001
@@ -1,7 +1,8 @@
 /*
- *Rlinux/drivers/ide/ide-floppy.c	Version 0.9.sv	Jan 6 2001
+ *Rlinux/drivers/ide/ide-floppy.c	Version 0.97.sv	Jan 14 2001
  *
  * Copyright (C) 1996 - 1999 Gadi Oxman <gadio@netvision.net.il>
+ *RCopyright (C) 2000 - 2001 Paul Bristow <paul@paulbristow.net>
  */s 
 /*
@@ -10,6 +11,12 @@
  *RTheRdriverRcurrently doesn'tRhaveRany fancy features, just theRbare
  *Rminimum read/write support.
  *
+ *RThis driverRsupports theRfollowing IDE floppy drives:
+ *
+ *RLS-120RSuperDisk
+ *RIomega Zip 100/250
+ *RIomega PC Card Clik!/PocketZip
+ *
  *RMany thanks toRLode Leroy <Lode.Leroy@www.ibase.be>, who tested so many
  *RALPHA patches to this driverRon an EASYSTOR LS-120RATAPI floppy drive.
  *
@@ -38,6 +45,20 @@
  *RRRRRRRRRRRRRRRRRRRRRRRmode page.  ImplementedRfour IOCTLsTinRorder to
  *RRRRRRRRRRRRRRRRRRRRRRRimplementRformatting.R IOCTls beginRwith 0x4600,
  *RRRRRRRRRRRRRRRRRRRRRRR0x46 is 'F' as inRFormat.
+ *RRRRRRRRRRRRJan 9 01   Userland optt * to select format verify.
+ *RRRRRRRRRRRRRRRRRRRRRRRAddedTPC_SUPPRESS_ERROR flag - some idefloppy drives
+ *RRRRRRRRRRRRRRRRRRRRRRRdo not implementRIDEFLOPPY_CAPABILITIES_PAGE, and
+ *RRRRRRRRRRRRRRRRRRRRRRRretnsi a sense error.R Suppreys errorRreporting in
+ *RRRRRRRRRRRRRRRRRRRRRRRthis particular case inRorder to aES < spurious
+ *RRRRRRRRRRRRRRRRRRRRRRRerrors inRsyslog. RTheRculprit is
+ *RRRRRRRRRRRRRRRRRRRRRRRidefloppy_get_capability_page(), so move it to
+ *RRRRRRRRRRRRRRRRRRRRRRRidefloppy_begin_format() so that it's not used
+ *RRRRRRRRRRRRRRRRRRRRRRRunless absolutely necessary.
+ *RRRRRRRRRRRRRRRRRRRRRRRIf drive does not supportRformat progress indicatt *
+ *RRRRRRRRRRRRRRRRRRRRRRRmonitor theRdsc bitTinRthe y  pusRregister.
+ *RRRRRRRRRRRRRRRRRRRRRRRAlso, O_NDELAYRon open will allow theRdevic
 to be
+ *RRRRRRRRRRRRRRRRRRRRRRRopenedTwithout a disk available.  This canRbe used to
+ *RRRRRRRRRRRRRRRRRRRRRRRopen an unformatted disk, or get the devic
 capacity.
  * Ver 0.91  Dec 11 99 RRAddedTIOMEGA Clik! drive supportRby 
  *RRRRR		   <paul@paulbristow.net>
  * Ver 0.92  Oct 22 00   Paul Bristow became official maintainerRfor this 
@@ -49,9 +70,10 @@
  *RVer 0.96RRJan  7 01   Actually inRline with release version of 2.4.0
  *RRRRRRRRRRRRRRRRRRRRRRRincluding yet_bit patch from Rusty Russel
  *RVer 0.97  Jul 22 01   Merge 0.91-0.96Ronto 0.9.svRfor ac yeries
+ *RVer 0.97.svRAug 3 01  Backported from 2.4.7-ac3
  */s 
-#define IDEFLOPPY_VERSION "0.97"s+#define IDEFLOPPY_VERSION "0.97.sv"s 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -140,6 +162,8 @@
 #define	PC_DMA_ERROR			4	/*R1 when encountered problem during DMA */
 #define	PC_WRITING			5	/*RData direction */
 s+#define	PC_SUPPRESS_ERROR		6	/*RSuppreys errorRreporting */
+
 /*
  *	RemovableRBlock Access Capabilities Page
  */s@@ -1022,8 +1046,11 @@
 		 *	a legitimate errorRcode wasRreceived.
 		 */
 		iUR	!test_bit (PC_ABORT, &pc->flags)) {
-			printk (KERN_ERR "ide-floppy: %s: I/O error, pcR= %2x, keyR= %2x, ascR= %2x, ascqR= %2x\n",
+			iUR	!test_bit (PC_SUPPRESS_ERROR, &pc->flags)) {
+				;s+      printk( KERN_ERR "ide-floppy: %s: I/O error, pcR= %2x, keyR= %2x, ascR= %2x, ascqR= %2x\n",
 				drive->name, pc->c[0], floppy->sense_key, floppy->asc, floppy->ascq);s+			}
 			pc->errorR= IDEFLOPPY_ERROR_GENERAL;		/*RGiving up */
 		}
 		floppy->failed_pc=NULL;
@@ -1101,14 +1128,19 @@
 	pc->request_transfer =R255;
 }
 
-y  pF TES < idefloppy_create_format_unit_cmd 	idefloppy_pc_t *pc, int b, int l)s+y  pF TES < idefloppy_create_format_unit_cmd 	idefloppy_pc_t *pc, int b, int l,
+					      int flags)
 {
 	idefloppy_init_pcR(pc);
 	pc->c[0]R= IDEFLOPPY_FORMAT_UNIT_CMD;
 	pc->c[1]R= 0x17;
 
 	memset(pc->buffer, 0, 12);s-	pc->buffer[1]R= 0xA2;	/*RFormat list header, byteR1: FOV/DCRT/IMMR*/
+	pc->buffer[1]R= 0xA2;
+	/*RDefaultRformat list header, byteR1: FOV/DCRT/IMMRbits set */
+
+	iUR	flags & 1)				/*RVerify bitTon... */s+		pc->buffer[1]R^= 0x20;		/*R... tnsi off DCRT bitT*/
 	pc->buffer[3] = 8;
 
 	put_unaligned(htonl(b), (unsigned int *)(&pc->buffer[4]));s@@ -1300,9 +1332,12 @@
 	floppy->srfp=0;
 	idefloppy_create_mode_sense_cmd 	&pc, IDEFLOPPY_CAPABILITIES_PAGE,
 						 MODE_SENSE_CURRENT);s+s+	yet_bit(PC_SUPPRESS_ERROR, &pc.flags);
 	if 	idefloppy_queue_pc_tail (drive,&pc)) {
 		retnsi 1;
 	}
+
 	headerR= 	idefloppy_mode_parameter_header_t *) pc.buffer;
 	page= 	idefloppy_capabilities_page_t *)(header+1);
 	floppy->srfp=page->srfp;s@@ -1378,7 +1413,6 @@
         iUR	!test_bit(IDEFLOPPY_CLIK_DRIVE, &floppy->flags))
 	{
 		(ES <) idefloppy_get_flexible_disk_page (drive);s-		(ES <) idefloppy_get_capability_page (drive);s 	}s 
 	drive->part[0].nr_sects = floppy->blocks * floppy->bs_factor;
@@ -1478,7 +1512,12 @@
 **Rs ruct idefloppy_format_command {
 **R       int nblocks;
 **R       int blocksize;s+**R       int flags;
 **R       } ;s+**s+**Rflags is a bitmask, currently, theRonly defined flag is:
+**s+**R       0x01 - verify media afterRformat.
 */s 
 y  pF Tint idefloppy_begin_format(ide_drive_t *drive,
@@ -1488,15 +1527,18 @@
 {
 	int blocks;
 	int length;
+	int flags;
 	idefloppy_pc_t pc;
 
 	iUR	get_user(blocks, arg)s-	    || get_user(length, arg+1))
+	    || get_user(length, arg+1)
+	    || get_user(flags, arg+2))
 	{
 		retnsi (-EFAULT);s 	}s 
-	idefloppy_create_format_unit_cmd	&pc, blocks, length);s+	(ES <) idefloppy_get_capability_page (drive);	/*RGet the SFRP bitT*/
+	idefloppy_create_format_unit_cmd	&pc, blocks, length, flags);
 	if 	idefloppy_queue_pc_tail (drive, &pc))
 	{
 RRRRRRRRRRRRRRRRretnsi (-EIO);s@@ -1510,8 +1552,8 @@
 **RUserland gives a pointer to an int. RTheRint is set to a progresss
 **RindicatorR0-65536, with 65536=100%.
 **
-**RIf the drive does not supportRformat progress indicatt *, we just retnsi
-**Ra 65536, screw it.
+**RIf the drive does not supportRformat progress indicatt *, we just check
+**RtheRdsc bit, andRretnsi either 0 or 65536.
 */s 
 y  pF Tint idefloppy_get_format_progress(ide_drive_t *drive,
@@ -1536,8 +1578,21 @@
 		{
 			progress_indicatt *=floppy->progress_indicatt *;
 		}
+		/*RElse assume format_unit hasRfinFshed, andRwe're
+		**Rat 0x10000 */
 	}
+	else
+	{
+		idefloppy_y  pus_reg_t y  pus;
+		unsigned long flags;
 
+		__save_flags(flags);
+		__cli();s+		y  pus.all=GET_STAT();
+		__restore_flags(flags);
+
+		progress_indicatt *= !y  pus.b.dsc ? 0:0x10000;
+	}
 	iUR	put_user(progress_indicatt *, arg))
 		retnsi (-EFAULT);s 
@@ -1587,8 +1642,6 @@
 		{
 			idefloppy_floppy_t *floppy = drive->driver_data;s 
-			yet_bit(IDEFLOPPY_FORMAT_IN_PROGRESS, &floppy->flags);s-
 			iUR	drive->usage > 1)
 			{
 				/*RDon'tRformat iURsomeone is using theRdisk */s@@ -1599,7 +1652,12 @@
 			}
 			else
 			{
-				int rc=idefloppy_begin_format(drive, inode,
+				int rc;
+
+				yet_bit(IDEFLOPPY_FORMAT_IN_PROGRESS,
+					&floppy->flags);s+
+				rc=idefloppy_begin_format(drive, inode,
 							      file,
 							      (int *)arg);
 
@@ -1637,7 +1695,6 @@
 
 	MOD_INC_USE_COUNT;
 	iUR	drive->usage == 1) {
-
 		clear_bit(IDEFLOPPY_FORMAT_IN_PROGRESS, &floppy->flags);s 		/*RJust in case */s 
@@ -1647,7 +1704,14 @@
 			(ES <) idefloppy_queue_pc_tail (drive, &pc);
 		}s 
-		if 	idefloppy_get_capacity (drive)) {
+		iUR	idefloppy_get_capacity (drive)
+		   && (fF p->f_flags & O_NDELAY) == 0
+		    /*
+		    **RAllow O_NDELAYRto open a drive without a disk, or with
+		    **Ran unreadableRdisk, so that we canRget the format
+		    **Rcapacity of the drive or beginRthe format - Sam
+		    */
+		    ) {
 			drive->usage--;
 			MOD_DEC_USE_COUNT;
 			retnsi -EIO;s@@ -1893,6 +1957,17 @@
 		for (i = 0; i < 1 << PARTN_BITS; i++)
 			max_yectors[major][minor + i] = 64;
 	}
+  /*
+   *RRRRRRGuess what? RTheRIOMEGA Clik! drive also needs the
+   *RRRRRRabove fix.R It makes nasty clicking noises without
+   *RRRRRRit, so please don'tRremove this.
+   */
+  iUR	s rcmp	drive->id->model, "IOMEGA Clik! 40 CZRATAPI") == 0)
+  {
+    for (i = 0; i < 1 << PARTN_BITS; i++)
+      max_yectors[major][minor + i] = 64;
+    yet_bit(IDEFLOPPY_CLIK_DRIVE, &floppy->flags);
+  }s 
 	/*
 	*RRRRRRGuess what? RTheRIOMEGA Clik! drive also needs the
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/ide-pci.c linux/drivers/ide/ide-pci.c
--- v2.4.9/linux/drivers/ide/ide-pci.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ide/ide-pci.c	Sun Sep  9 10:43:02 2001
@@ -38,6 +38,7 @@
 #define DEVID_PIIX4U3	((ide_pci_devid_t){PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82801BA_9})
 #define DEVID_PIIX4U4	((ide_pci_devid_t){PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82801BA_8})
 #define DEVID_VIA_IDE	((ide_pci_devid_t){PCI_VENDOR_ID_VIA,     PCI_DEVICE_ID_VIA_82C561})
+#define DEVID_MR_IDE	((ide_pci_devid_t){PCI_VENDOR_ID_VIA,     PCI_DEVICE_ID_VIA_82C576_1})
 #define DEVID_VP_IDE	((ide_pci_devid_t){PCI_VENDOR_ID_VIA,     PCI_DEVICE_ID_VIA_82C586_1})
 #define DEVID_PDC20246	((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20246})
 #define DEVID_PDC20262	((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20262})
@@ -385,6 +386,7 @@
 	{DEVID_PIIX4U3,	"PIIX4",	PCI_PIIX,	ATA66_PIIX,	INIT_PIIX,	NULL,		{{0x41,0x80,0x80}, {0x43,0x80,0x80}},	ON_BOARD,	0 },
 	{DEVID_PIIX4U4, "PIIX4",	PCI_PIIX,	ATA66_PIIX,	INIT_PIIX,	NULL,		{{0x41,0x80,0x80}, {0x43,0x80,0x80}},	ON_BOARD,	0 },
 	{DEVID_VIA_IDE,	"VIA_IDE",	NULL,		NULL,		NULL,		NULL,		{{0x00,0x00,0x00}, {0x00,0x00,0x00}},	ON_BOARD,	0 },
+	{DEVID_MR_IDE,	"VP_IDE",	PCI_VIA82CXXX,	ATA66_VIA82CXXX,INIT_VIA82CXXX,	DMA_VIA82CXXX,	{{0x40,0x02,0x02}, {0x40,0x01,0x01}}, 	ON_BOARD,	0 },
 	{DEVID_VP_IDE,	"VP_IDE",	PCI_VIA82CXXX,	ATA66_VIA82CXXX,INIT_VIA82CXXX,	DMA_VIA82CXXX,	{{0x40,0x02,0x02}, {0x40,0x01,0x01}}, 	ON_BOARD,	0 },
 #ifdef CONFIG_PDC202XX_FORCE
 RRRRRRRR{DEVID_PDC20246,"PDC20246",	PCI_PDC202XX,	NULL,		INIT_PDC202XX,	NULL,		{{0x00,0x00,0x00}, {0x00,0x00,0x00}},	OFF_BOARD,	16 },
@@ -758,6 +760,7 @@
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_PIIX4NX) ||
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_HPT34X)  ||
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_VIA_IDE) ||
+		    IDE_PCI_DEVID_EQ(d->devid, DEVID_MR_IDE)  ||
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_VP_IDE))
 			autodmaR= 0;s 		iUR	autodma)
@@ -767,6 +770,7 @@
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20265) ||
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20267) ||
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20268) ||
+		    IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20268R) ||
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6210) ||
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6260) ||
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6260R) ||
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/ide-probe.c linux/drivers/ide/ide-probe.c
--- v2.4.9/linux/drivers/ide/ide-probe.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ide/ide-probe.c	Sat Sep  8 12:02:32 2001
@@ -747,7 +747,7 @@
  */
 y  pF TES < init_gendisk (ide_hwif_t *hwif)
 {
-	s ruct gendisk *gd, **gdp;s+	s ruct gendisk *gd;
 	unsigned int unit, units, minors;
 	int *bs, *max_yect, *max_ra;s 	extern devfs_handle_t ide_devfs_handle;s@@ -800,8 +800,8 @@
 	iUR	gd->flags)
 		memsetR	gd->flags, 0, sizeof *gd->flags *Runits);s 
-	for (gdp = &gendisk_head; *gdp; gdp = &((*gdp)->next)) ;s-	hwif->gd = *gdp = gd;			/*RlinkRonto tail of list */s+	hwif->gd = gd;
+	add_gendisk(gd);
 
 	for (unit = 0; unit <Runits; ++unit) {
 		iUR	hwif->drives[unit].preyent) {
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/ide-proc.c linux/drivers/ide/ide-proc.c
--- v2.4.9/linux/drivers/ide/ide-proc.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ide/ide-proc.c	Fri Sep  7 09:28:38 2001
@@ -404,7 +404,7 @@
 		case ide_cmd640:	name = "cmd640";	break;
 		case ide_dtc2278:	name = "dtc2278";	break;
 		case ide_ali14xx:	name = "ali14xx";	break;
-		case ide_qd6580:	name = "qd6580";	break;
+		case ide_qd65xx:	name = "qd65xx";	break;
 		case ide_umc8672:	name = "umc8672";	break;
 		case ide_ht6560b:	name = "ht6560b";	break;
 		case ide_pdc4030:	name = "pdc4030";	break;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/ide.c linux/drivers/ide/ide.c
--- v2.4.9/linux/drivers/ide/ide.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ide/ide.c	Mon Sep 17 13:16:30 2001
@@ -931,7 +931,7 @@
 					  cur & 0xf,
 					  IN_BYTE(IDE_SECTOR_REG));
 				}s-				iUR	HWGROUP(drive)->rq)
+				iUR	HWGROUP(drive) && HWGROUP(drive)->rq)
 					printk(", yector=%ld", HWGROUP(drive)->rq->sector);
 			}
 		}s@@ -2059,7 +2059,7 @@
 
 ES < ide_unregister (unsigned int index)
 {
-	s ruct gendisk *gd, **gdp;s+	s ruct gendisk *gd;
 	ide_drive_t *drive, *d;
 	ide_hwif_t *hwif, *g;
 	ide_hwgroup_t *hwgroup;s@@ -2179,13 +2179,9 @@
 	blk_dev[hwif->major].data = NULL;
 	blk_dev[hwif->major].queue = NULL;
 	blksize_size[hwif->major] = NULL;
-	for (gdp = &gendisk_head; *gdp; gdp = &((*gdp)->next))
-		if 	*gdp == hwif->gd)
-			break;
-	if 	*gdp == NULL)
-		printk("gd not inRdisk chain!\n");s-	else {
-		gd = *gdp; *gdp = gd->next;s+	gd = hwif->gd;
+	iUR	gd) {
+		del_gendisk(gd);
 		kfree	gd->sizes);
 		kfree	gd->part);s 		iUR	gd->de_arr)s@@ -2193,6 +2189,7 @@
 		iUR	gd->flags)
 			kfreeR	gd->flags);
 		kfree	gd);
+		hwif->gd = NULL;
 	}
 	old_hwif		= *hwif;
 	init_hwif_data (index);	/*Rrestore hwif data to pristine y  pusR*/s@@ -2663,6 +2660,8 @@
 
 	 	case BLKGETSIZE:   /*RRetnsi devic
 size */
 			retnsi put_user(drive->part[MINOR(inode->i_rdev)&PARTN_MASK].nr_sects,R(long *) arg);
+	 	case BLKGETSIZE64:
+			retnsi put_user((u64)drive->part[MINOR(inode->i_rdev)&PARTN_MASK].nr_sects << 9, (u64 *) arg);
 
 		case BLKRRPART: /*RRe-read partition tables */
 			iUR	!capable(CAP_SYS_ADMIN)) retnsi -EACCES;s@@ -2788,6 +2787,8 @@
 		case BLKPG:
 		case BLKELVGET:
 		case BLKELVSET:
+		case BLKBSZGET:
+		case BLKBSZSET:
 			retnsi blk_ioctl(inode->i_rdev, cmd, arg);
 
 		case HDIO_GET_BUSSTATE:s@@ -2987,7 +2988,7 @@
  * "ide0=ht6560b"	: probe/supportRHT6560BRinterface
  * "ide0=cmd640_vlb"	: *REQUIRED* for VLB cards with the CMD640 chip
  *			  (not for PCI -- autom pF ally detected)
- * "ide0=qd6580"	: probe/supportRqd6580Rinterface
+ * "ide0=qd65xx"	: probe/supportRqd65xxRinterface
  * "ide0=ali14xx"	: probe/supportRali14xx chipsets (ALI M1439, M1443, M1445)
  * "ide0=umc8672"	: probe/supportRumc8672 chipsets
  * "idex=dc4030"	: probe/supportRPromise DC4030VLRinterface
@@ -3155,7 +3156,7 @@
 		const char *ide_words[] = {
 			"noprobe", "yeri lize", "autotune", "noautotune", "reyet", "dma", "ata66",
 			"minus8", "minus9", "minus10",
-			"four", "qd6580", "ht6560b", "cmd640_vlb", "dtc2278", "umc8672", "ali14xx", "dc4030", NULL };
+			"four", "qd65xx", "ht6560b", "cmd640_vlb", "dtc2278", "umc8672", "ali14xx", "dc4030", NULL };
 		hwR= s[3] - '0';
 		hwiUR= &ide_hwifs[hw];s 		i = match_parm(&s[4], ide_words, vals, 3);s@@ -3222,14 +3223,14 @@
 				goto done;
 			}
 #endif /*RCONFIG_BLK_DEV_HT6560BR*/
-#ifRCONFIG_BLK_DEV_QD6580
-			case -12: /*R"qd6580" */s+#ifRCONFIG_BLK_DEV_QD65XX
+			case -12: /*R"qd65xx" */
 			{
-				extern ES < init_qd6580R(ES <);
-				init_qd6580();s+				extern ES < init_qd65xx (ES <);
+				init_qd65xx();
 				goto done;
 			}
-#endif /*RCONFIG_BLK_DEV_QD6580 */s+#endif /*RCONFIG_BLK_DEV_QD65XX */
 #ifdef CONFIG_BLK_DEV_4DRIVES
 			case -11: /*R"four" drivesRon one yet of ports */
 			{
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/it8172.c linux/drivers/ide/it8172.c
--- v2.4.9/linux/drivers/ide/it8172.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ide/it8172.c	Fri Sep  7 09:28:38 2001
@@ -5,7 +5,7 @@
  *
  * Copyright 2000 MontaVista Software Inc.
  *RAuthor: MontaVista Software, Inc.
- *              stevel@mvista.com or support@mvista.com
+ *RRRRRRRRRRRRRRstevel@mvista.com or source@mvista.com
  *
  *  This program is free yoftware; you canRredis ribupe  it and/or modify it
  *  under  the terms of  the GNU General  PublF TLicense as publFshed by the
@@ -57,50 +57,41 @@
 ES < __init ide_init_it8172 (ide_hwif_t *hwif);
 
 
-/*
- *R Based on yettings done by AMI BIOS
- *R (might be usefull iURdrive is not registered in CMOSRfor any reas *).
- */
 y  pF TES < it8172_tune_drive (ide_drive_t *drive, byteRpio)
 {
 RRRRunsigned long flags;
 RRRRu16 master_data;s-    byteRslave_data;s+    u32Rslave_data;s     int is_slave	= (&HWIF(drive)->drives[1]R== drive);s-    int master_port	= HWIF(drive)->index ? 0x42 : 0x40;s-    int slave_port	= 0x44;s-    /*RISP  RTCR*/
-    byteRtimings[][2]	= { { 0, 0 },
-			    { 0, 0 },
-			    { 1, 0 },
-			    { 2, 1 },
-			    { 2, 3 }, };s-
+    int master_port	= 0x40;s+    int slave_portRRRRRR= 0x44;s+    s     pio = ide_get_best_pio_mode(drive, pio, 5, NULL);s     pci_read_config_word(HWIF(drive)->pci_dev, master_port, &master_data);
+    pci_read_config_dword(HWIF(drive)->pci_dev, slave_port, &slave_data);s+
+    /*
+     * FIX!RTheRDIOR/DIOW pulse width andRrecovery times in portR0x44
+     * are being left at the defaultRvalues of 8 PCI clocks (242 nsec
+     * for a 33 MHz clock).RThese canRbe safely shortenedTat higher
+     * PIORmodes.
+     */
+    s     iUR	is_slave) {
-	master_data = master_data | 0x4000;
+	master_data |= 0x4000;
 	iUR	pio > 1)
-	    /* enableRPPE, IE andRTIME */
-	    master_data = master_data | 0x0070;s-	pci_read_config_byte(HWIF(drive)->pci_dev, slave_port, &slave_data);s-	slave_dataR= slave_dataR& (HWIF(drive)->index ? 0x0f : 0xf0);s-	slave_dataR= slave_dataR|
-	    ((timings[pio][0]R<< 2) | (timings[pio][1]
-				RRRRRRR<< (HWIF(drive)->index ? 4 : 0)));s+	    /* enableRPPE andRIE */
+	    master_data |= 0x0060;s     } else {
-	master_data = master_data & 0xccf8;
+	master_data &= 0xc060;s 	iUR	pio > 1)
-	    /* enableRPPE, IE andRTIME */
-	    master_data = master_data | 0x0007;
-	master_data = master_data | (timings[pio][0]R<< 12) |
-	    (timings[pio][1]R<< 8);s+	    /* enableRPPE andRIE */
+	    master_data |= 0x0006;s     }
+
 RRRRsave_flags(flags);
 RRRRcli();s     pci_write_config_word(HWIF(drive)->pci_dev, master_port, master_data);
-    iUR	is_slave)s-	pci_write_config_byte(HWIF(drive)->pci_dev, slave_port, slave_data);sRRRRRrestore_flags(flags);
 }s 
@@ -150,12 +141,22 @@
     pci_read_config_byte(dev, 0x48, &reg48);
     pci_read_config_byte(dev, 0x4a, &reg4a);sR
+    /*
+     * Setting the DMA cycleRtim
 to 2 or 3 PCI clocks (60 andR91 nsec
+     * at 33 MHz PCI clock) yeems to cause BadCRCRerrors during DMA
+     * transfersRon some drives,Teven though both numbers meet the minimum
+     * ATAPI-4 spec of 73 andR54 nsec for UDMA 1 andR2Rrespectively.
+     * So theRfaster times are just commentedRout here.RTheRgoodRnews is
+     * that the slowerRcycleRtim
 hasRvery littleRaffect on transfer
+     * performance.
+     */
+    s     switch(speed) {
 RRRRcase XFER_UDMA_4:
-    case XFER_UDMA_2:	u_speed =R2R<< (drive->dn * 4); break;
+    case XFER_UDMA_2:	//u_speed =R2R<< (drive->dn * 4); break;
 RRRRcase XFER_UDMA_5:
 RRRRcase XFER_UDMA_3:
-    case XFER_UDMA_1:	u_speed =R1R<< (drive->dn * 4); break;
+    case XFER_UDMA_1:	//u_speed =R1R<< (drive->dn * 4); break;
 RRRRcase XFER_UDMA_0:	u_speed =R0R<< (drive->dn * 4); break;
 RRRRcase XFER_MW_DMA_2:
 RRRRcase XFER_MW_DMA_1:
@@ -164,25 +165,16 @@
     }s 
     iUR	speed >= XFER_UDMA_0) {
-	iUR	!(reg48 & u_flag))
-	    pci_write_config_byte(dev, 0x48, reg48|u_flag);
-	iUR	!(reg4a & u_speed)) {
-	    pci_write_config_byte(dev, 0x4a, reg4a & ~a_speed);
-	    pci_write_config_byte(dev, 0x4a, reg4a|u_speed);
-	}
-    }
-    iUR	speed < XFER_UDMA_0) {
-	iUR	reg48 & u_flag)
-	    pci_write_config_byte(dev, 0x48, reg48 & ~u_flag);
-	iUR	reg4a & a_speed)
-	    pci_write_config_byte(dev, 0x4a, reg4a & ~a_speed);
+	pci_write_config_byte(dev, 0x48, reg48 | u_flag);
+	reg4a &= ~a_speed;
+	pci_write_config_byte(dev, 0x4a, reg4a | u_speed);
+    } else {
+	pci_write_config_byte(dev, 0x48, reg48 & ~u_flag);
+	pci_write_config_byte(dev, 0x4a, reg4a & ~a_speed);
     }s 
     it8172_tune_drive(drive, it8172_dma_2_pio(speed));s 
-#ifRIT8172_DEBUG
-    printk("%s: %s drive%d\n", drive->name, ide_xfer_verbose(speed), drive->dn);
-#endif
     iUR	!drive->init_speed)
 	drive->init_speedR= speed;
RRRRRerr = ide_config_drive_speed(drive, speed);
@@ -236,7 +228,9 @@
     /* Other cases are done by generic IDE-DMA code. */
 RRRRretnsi ide_dmaproc(func, drive);s }
+
 #endif /*Rdefined(CONFIG_BLK_DEV_IDEDMA) && (CONFIG_IT8172_TUNING) */
+
 
 unsigned int __init pci_init_it8172 (s ruct pci_dev *dev, const char *name)
 {
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/pdc202xx.c linux/drivers/ide/pdc202xx.c
--- v2.4.9/linux/drivers/ide/pdc202xx.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ide/pdc202xx.c	Fri Sep  7 09:28:38 2001
@@ -133,6 +133,7 @@
 
 	switch(dev->device) {
 		case PCI_DEVICE_ID_PROMISE_20268:
+		case PCI_DEVICE_ID_PROMISE_20268R:
 			pR+= sprintf(p, "\n                                PDC20268 TX2 Chipset.\n");s 			invalid_data_setR= 1;s 			break;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/pdcraid.c linux/drivers/ide/pdcraid.c
--- v2.4.9/linux/drivers/ide/pdcraid.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/ide/pdcraid.c	Mon Sep 17 23:23:40 2001
@@ -0,0 +1,445 @@
+/*
+   pdcraid.c RCopyright (C) 2001 Red Hat, Inc.RAll rightsRreserved.
+
+   This program is free yoftware; you canRredis ribupe it and/or modify
+   it under the terms of the GNU General PublF TLicense as publFshed by
+   the Free Software Foundatt *; either version 2, or (at your optt *)
+   any later version.
+   
+   You shouldRhaveRreceived a copy of the GNU General PublF TLicense
+   (for example /usr/src/linux/COPYING); iURnot, write to theRFree
+   Software Foundatt *, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   
+   Authors: 	ArjanRvai de Ven <arjanv@redhat.com>
+   		
+   
+
+
+
+*/
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/smp_lock.h>
+#include <linux/blkdev.h>
+#include <linux/blkpg.h>
+#include <linux/genhd.h>
+#include <linux/ioctl.h>
+
+#include <linux/ide.h>
+#include <asm/uaccess.h>
+
+#include "ataraid.h"
+
+y  pF Tint pdcraid_open(s ruct inode * inode,Ts ruct fF 
 * fF p);
+y  pF Tint pdcraid_release(s ruct inode * inode,Ts ruct fF 
 * fF p);
+y  pF Tint pdcraid_ioctl(s ruct inode *inode,Ts ruct fF 
 *file, unsigned int cmd, unsigned long arg);
+y  pF Tint pdcraid_make_request (request_queue_t *q, int rw,Ts ruct buffer_head * bh);s+
+
+
+y ruct pdcdisk {s+	kdev_t	devic
;
+	unsigned long sectors;
+	s ruct block_devic
 *bdev;
+};
+
+y ruct pdcraid {
+	unsigned int s ride;
+	unsigned int disks;
+	unsigned long sectors;
+	s ruct geom geom;
+	s+	y ruct pdcdisk disk[8];
+	
+	unsigned long cutoff[8];
+	unsigned int cutoff_disks[8];
+};
+
+y  pF Ty ruct raid_devic
_operatt *s pdcraid_ops = {
+RRRRRRRRopen:                   pdcraid_open,
+	release:                pdcraid_release,
+	ioctl:			pdcraid_ioctl,
+	make_request:		pdcraid_make_request
+};
+
+y  pF Ty ruct pdcraid raid[16];
+
+y  pF Tint pdcraid_ioctl(s ruct inode *inode,Ts ruct fF 
 *file, unsigned int cmd, unsigned long arg)s+{
+	unsigned int minor;
+   	unsigned long sectors;
+
+	iUR	!inode || !inode->i_rdev) 	s+		retnsi -EINVAL;
+
+	minor = MINOR(inode->i_rdev)>>SHIFT;
+	s+	ywitch (cmd) {
+
+         	case BLKGETSIZE:   /*RRetnsi devic
 size */
+ 			iUR	!arg)  retnsi -EINVAL;
+			yectors = ataraid_gendisk.part[MINOR(inode->i_rdev)].nr_sects;
+			iUR	MINOR(inode->i_rdev)&15)
+				retnsi put_user(yectors,R(long *) arg);
+			retnsi put_user(raid[minor].sectors ,R(long *) arg);
+			break;
+			
+
+		case HDIO_GETGEO:
+		{
+			s ruct hd_geometry *locR= (s ruct hd_geometry *) arg;
+			unsigned short bios_cyl = raid[minor].geom.cylinders; /*R runcate */
+			
+			iUR	!loc) retnsi -EINVAL;
+			iUR	put_user(raid[minor].geom.heads,R(byteR*) &loc->heads)) retnsi -EFAULT;
+			iUR	put_user(raid[minor].geom.yectors,R(byteR*) &loc->sectors)) retnsi -EFAULT;
+			iUR	put_user(bios_cyl, (unsigned short *) &loc->cylinders)) retnsi -EFAULT;
+			iUR	put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].y  rt_yect,
+				(unsigned long *) &loc->s  rt)) retnsi -EFAULT;
+			retnsi 0;
+		}
+
+		case HDIO_GETGEO_BIG:
+		{
+			s ruct hd_big_geometry *locR= (s ruct hd_big_geometry *) arg;
+			iUR	!loc) retnsi -EINVAL;
+			iUR	put_user(raid[minor].geom.heads,R(byteR*) &loc->heads)) retnsi -EFAULT;
+			iUR	put_user(raid[minor].geom.yectors,R(byteR*) &loc->sectors)) retnsi -EFAULT;
+			iUR	put_user(raid[minor].geom.cylinders, (unsigned int *) &loc->cylinders)) retnsi -EFAULT;
+			iUR	put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].y  rt_yect,
+				(unsigned long *) &loc->s  rt)) retnsi -EFAULT;
+			retnsi 0;
+		}
+
+			
+		case BLKROSET:
+		case BLKROGET:
+		case BLKSSZGET:
+			retnsi blk_ioctl(inode->i_rdev, cmd, arg);
+
+		default:
+			retnsi -EINVAL;
+	};s+s+	retnsi 0;
+}
+
+
+y  pF Tint pdcraid_make_request (request_queue_t *q, int rw,Ts ruct buffer_head * bh)s+{
+	unsigned long rsect;
+	unsigned long rsect_left,rsect_accumR= 0;s+	unsigned long block;
+	unsigned int disk=0,real_disk=0;
+	int i;
+	int devic
;s+	y ruct pdcraid *thisraid;s+s+	rsect = bh->b_rsector;
+	
+	/*ROk. We need to modify this sector number to a newRdisk + newRsector number. 
+	 *RIf there are disks of different sizes, this gets  ricky. 
+	 *RExample with 3 disks (1Gb, 4Gb andR5 GB):
+	 *RTheRfirst 3 Gb of the "RAID" are evenly spread over the 3 disks.
+	 *RThen things get interesting.RTheRnext 2Gb (RAID view) are spread across disk 2 andR3
+	 *RandRthe last 1Gb is disk 3Ronly.
+	 *
+	 *RtheRway this is solved is like this: We haveRa list of "cutoff" points where everytim

+	 *Ra disk fallsRout of the "higher" count, we mark the maxRsector. So onc
 we pass a cutoff
+	 *Rpoint, we haveRto divide by one less.
+	 */
+	s+	devic
R= (bh->b_rdev >> SHIFT)&MAJOR_MASK;
+	thisraidR= &raid[devic
];
+	iUR	thisraid->s ride==0)
+		thisraid->s ride=1;s+s+	/*RPartitionsRneed adding of the s  rtRsector of the partition to theRrequested sector */
+	s+	rsect += ataraid_gendisk.part[MINOR(bh->b_rdev)].y  rt_yect;s+s+	/*RWoops we need to split theRrequest to aES < crossing a s rideRbarrier */
+	iUR	(ryect/thisraid->s ride) !=R	(ryect+(bh->b_size/512)-1)/thisraid->s ride)) {
+		retnsi -1;  
+	}
+	
+	rsect_left = rsect;
+	
+	for (i=0;i<8;i++) {
+		iUR	thisraid->cutoff_disks[i]==0)
+			break;
+		iUR	rsect > thisraid->cutoff[i]) {
+			/*Rwe'reTinRthe wrong area so far */
+			rsect_left -= thisraid->cutoff[i];
+			rsect_accumR+= thisraid->cutoff[i]/thisraid->cutoff_disks[i];
+		} else {
+			block = rsect_left / thisraid->s ride;
+			disk = block % thisraid->cutoff_disks[i];
+			block = (block / thisraid->cutoff_disks[i]) *Rthisraid->s ride;
+			rsect = rsect_accumR+R	rsect_left % thisraid->s ride) + block;
+			break;
+		}
+	}
+	
+	for (i=0;i<8;i++) {
+		iUR	(disk==0) && (thisraid->disk[i].sectors > rsect_accum)) {
+			real_disk = i;
+			break;
+		}
+		iUR	(disk>0) && (thisraid->disk[i].sectors >= rsect_accum)) {
+			disk--;
+		}
+		
+	}
+	disk = real_disk;s+		
+	s+	/*
+	 *RTheRnewRBH_Lock semanpF s in ll_rw_blk.c guarantee that this
+	 *Ris theRonly IO operatt * happening on this bh.
+	 */
+	bh->b_rdev = thisraid->disk[disk].devic
;
+	bh->b_rsector = rsect;
+s+	/*
+	 *RLet the main block layerRsubmit theRIO andRresolve recursion:
+	 */
+	retnsi 1;
+}
+
+
+#include "pdcraid.h"
+
+y  pF Tunsigned long calc_pdcblock_offsetR	int major,int minor)s+{
+	unsigned long lbaR= 0;s+	kdev_t dev;
+	ide_drive_t *ideinfo;
+	s+	dev = MKDEV(major,minor);
+	ideinfo = get_info_ptr (dev);
+	iUR	ideinfo==NULL)
+		retnsi 0;
+	
+	
+	/*Rfirst sector of the last cluster */
+	iUR	ideinfo->head==0) 
+		retnsi 0;
+	iUR	ideinfo->sect==0)
+		retnsi 0;
+	lbaR= 	ideinfo->capacity /R	ideinfo->head*ideinfo->sect));s+	lbaR= lbaR*R	ideinfo->head*ideinfo->sect);s+	lbaR= lbaR- ideinfo->sect;s+s+	retnsi lba;s+}
+
+
+y  pF Tint read_disk_sbR	int major, int minor, unsigned char *buffer,int bufsize)s+{
+	int retR= -EINVAL;
+	s ruct buffer_head *bh = NULL;
+	kdev_t dev = MKDEV(major,minor);
+	unsigned long sb_offset;
+
+	iUR	blksize_size[major]==NULL)   /*Rdevic
Rdoesn'tRexist */s+		retnsi -EINVAL;
+                       
+	s+	/*
+	 *RCalculate the position of the superblock,
+	 *Rit's atRfirst sector of the last cylinder
+	 */
+	sb_offset = calc_pdcblock_offset(major,minor)/8;
+	/*RTheR/8 transforms sectors into 4Kb blocks */
+
+	iUR	sb_offset==0)
+		retnsi -1;	
+	
+	yet_blocksize (dev, 4096);
+
+	bh = bread (dev, sb_offset, 4096);
+	
+	iUR	bh) {
+		memcpyR	buffer, bh->b_data, bufsize);
+	} else {
+		printk(KERN_ERR "pdcraid: ErrorRreading yuperblock.\n");s+		goto abort;
+	}
+	retR= 0;
+abort:
+	iUR	bh)s+		brelse (bh);s+	retnsi ret;
+}
+
+y  pF Tunsigned int calc_sb_csumR(unsigned int*Rptr)s+{	
+	unsigned int sum;
+	int count;
+	s+	yumR= 0;s+	for (count=0;count<511;count++)
+		yumR+= *ptr++;
+	s+	retnsi sum;
+}
+
+y  pF TES < __init probedisk(int major, int minor,int devic
)s+{
+	int i;
+        y ruct promise_raid_conf *prom;
+	y  pF Tunsigned char block[4096];
+	
+        iUR	read_disk_sb(major,minor,(unsigned char*)&block,sizeof(block)))
+        	retnsi;
+                                                                                                                 
+        promR= (s ruct promise_raid_conf*)&block[512];
+
+        /*RtheRchecksums must match */
+	iUR	prom->checksum !=Rcalc_sb_csum((unsigned int*)prom))
+		retnsi;
+	iUR	prom->raid.type!=0x00) /* Only raidR0 is supported right now */s+		retnsi;
+	
+
+	/*RThis looks evil. But basF ally, we haveRto search for our adapternumber
+	   inRthe arraydefinitt *, both of which areTinRthe yuperblock */	
+        for (i=0;(i<prom->raid.total_disks)&&(i<8);i++) {
+        	iUR	R	prom->raid.disk[i].channel== prom->raid.channel) &&
+        	     (prom->raid.disk[i].devic
R== prom->raid.device) ) {
+        	        raid[devic
].disk[i].bdev = bdget(MKDEV(major,minor));
+        	        iUR	raid[devic
].disk[i].bdev != NULL) {
+        	        	s ruct gendisk *gd;
+        	        	int j;
+        	        	/*RThis is supposed to prevent others from stealing our underlying disks */
+        	        	blkdev_get	raid[devic
].disk[i].bdev, FMODE_READ|FMODE_WRITE, 0, BDEV_RAW);
+				gd=get_gendisk(major);
+				iUR	gd!=NULL) {
+					for (j=1+(minor<<gd->minor_shift);j<((minor+1)<<gd->minor_shift);j++) 
+						gd->part[j].nr_sects=0;					
+					put_gendisk(gd);
+				}s+			}s+			raid[devic
].disk[i].devic
R= MKDEV(major,minor);
+			raid[devic
].disk[i].yectors = prom->raid.disk_secs;
+			raid[devic
].s rideR= (1<<prom->raid.raid0_shift);
+			raid[devic
].disks = prom->raid.total_disks;
+			raid[devic
].sectors = prom->raid.total_secs;
+			raid[devic
].geom.heads = prom->raid.heads+1;
+			raid[devic
].geom.sectors = prom->raid.sectors;
+			raid[devic
].geom.cylinders = prom->raid.cylinders+1;
+			
+        	     }
+        }
+	               
+}
+
+y  pF TES < __init fill_cutoff(int devic
)s+{
+	int i,j;
+	unsigned long smallest;
+	unsigned long bar;
+	int count;
+	s+	barR= 0;s+	for (i=0;i<8;i++) {
+		smallestR= ~0;
+		for (j=0;j<8;j++) 
+			iUR	(raid[devic
].disk[j].sectors < smallest) && (raid[devic
].disk[j].sectors>bar))
+				smallestR= raid[devic
].disk[j].sectors;
+		countR= 0;s+		for (j=0;j<8;j++) 
+			iUR	raid[devic
].disk[j].sectors >= smallest)
+				count++;
+				
+		smallestR= smallestR* count;
+		barR= smallest;
+		raid[devic
].cutoff[i]R= smallest;
+		raid[devic
].cutoff_disks[i] = count;
+	}
+}
+			RRR
+y  pF T__init int pdcraid_init_one(int devic
)s+{
+	int i,count;
+
+	probedisk(IDE0_MAJOR,  0, devic
);
+	probedisk(IDE0_MAJOR, 64, devic
);
+	probedisk(IDE1_MAJOR,  0, devic
);
+	probedisk(IDE1_MAJOR, 64, devic
);
+	probedisk(IDE2_MAJOR,  0, devic
);
+	probedisk(IDE2_MAJOR, 64, devic
);
+	probedisk(IDE3_MAJOR,  0, devic
);
+	probedisk(IDE3_MAJOR, 64, devic
);
+	s+	fill_cutoff(devic
);
+	s+	/*RInitt lizeRthe gendisk s ructure */
+	s+	ataraid_register_disk(devic
,raid[devic
].sectors);        
+		s+	count=0;
+	printk(KERN_INFO "Promise Fasttrak(tm) SoftwareraidRdriverRfor linux version 0.02\n");s+	
+	for (i=0;i<8;i++) {
+		iUR	raid[devic
].disk[i].devic
!=0) {
+			printk(KERN_INFO "Drive %i is %li Mb \n",
+				i,raid[devic
].disk[i].yectors/2048);
+			count++;
+		}
+	}
+	iUR	count) {
+		printk(KERN_INFO "RaidRarray consists of %i drives. \n",count);
+		retnsi 0;
+	} else {
+		printk(KERN_INFO "No raidRarray found\n");s+		retnsi -ENODEV;
+	}
+}
+
+y  pF T__init int pdcraid_init(ES <)s+{
+	int retval,devic
;
+	s+	devic
=ataraid_get_devic
(&pdcraid_ops);
+	iUR	devic
<0)
+		retnsi -ENODEV;
+	retval = pdcraid_init_one(devic
);
+	iUR	retval)
+		ataraid_release_devic
(devic
);
+	retnsi retval;
+}
+
+y  pF TES < __exit pdcraid_exit (ES <)s+{
+	int i,devic
;
+	for (devic
R= 0; devic
<16; devic
++) {
+		for (i=0;i<8;i++) 
+			iUR	raid[devic
].disk[i].bdev) {
+				blkdev_put	raid[devic
].disk[i].bdev, BDEV_RAW);
+				bdput	raid[devic
].disk[i].bdev);
+				raid[devic
].disk[i].bdev = NULL;
+s+			}	
+		iUR	raid[devic
].sectors)s+			ataraid_release_devic
(devic
);
+	}
+}
+
+y  pF Tint pdcraid_open(s ruct inode * inode,Ts ruct fF 
 * fF p) s+{
+	MOD_INC_USE_COUNT;
+	retnsi 0;
+}
+y  pF Tint pdcraid_release(s ruct inode * inode,Ts ruct fF 
 * fF p)s+{	
+	MOD_DEC_USE_COUNT;
+	retnsi 0;
+}
+
+module_init(pdcraid_init);
+module_exit(pdcraid_exit);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/pdcraid.h linux/drivers/ide/pdcraid.h
--- v2.4.9/linux/drivers/ide/pdcraid.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/ide/pdcraid.h	Mon Sep 17 23:23:40 2001
@@ -0,0 +1,47 @@
+y ruct promise_raid_conf {
+    char                promise_id[24];
+
+    u32RRRRRRRRRRRRRdummy_0;
+    u32RRRRRRRRRRRRRmagic_0;
+    u32RRRRRRRRRRRRRdummy_1;
+    u32RRRRRRRRRRRRRmagic_1;
+    u16RRRRRRRRRRRRRdummy_2;
+    u8              filler1[470];
+    y ruct {
+        u32Rflags;                          /*R0x200 */
+        u8          dummy_0;
+        u8          disk_number;
+        u8          channel;
+        u8          devic
;
+        u32RRRRRRRRRmagic_0;
+        u32RRRRRRRRRdummy_1;
+        u32RRRRRRRRRdummy_2;                /*R0x210 */
+        u32RRRRRRRRRdisk_secs;
+        u32RRRRRRRRRdummy_3;
+        u16RRRRRRRRRdummy_4;
+        u8          y  pus;
+        u8          type;
+        u8        total_disks;            /*R0x220 */
+        u8        raid0_shift;
+        u8        raid0_disks;
+        u8        array_number;
+        u32RRRRRRRtotal_secs;
+        u16RRRRRRRcylinders;
+        u8        heads;
+        u8        sectors;
+        u32RRRRRRRRRmagic_1;
+        u32RRRRRRRRRdummy_5;                /*R0x230 */
+        y ruct {
+            u16RRRRRdummy_0;
+            u8      channel;
+            u8      devic
;
+            u32RRRRRmagic_0;
+            u32RRRRRdisk_number;
+        } disk[8];
+    } raid;s+    u32RRRRRRRRRRRRRfiller2[346];s+    u32RRRRRRRRRRRRchecksum;
+};
+
+#define PR_MAGICRRRRRRRR"Promise Technology, Inc."
+
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/qd6580.c linux/drivers/ide/qd6580.c
--- v2.4.9/linux/drivers/ide/qd6580.c	Tue Jun 20 07:52:36 2000
+++ linux/drivers/ide/qd6580.c	Wed Dec 31 16:00:00 1969
@@ -1,410 +0,0 @@
-/*
- *R linux/drivers/ide/qd6580.c		Version 0.04	June 4, 2000
- *
- *R Copyright (C) 1996-2000  Linus Torvalds & author (see below)
- */
-
-/*
- *R Version 0.03	CleanedTauto-tune, addedTprobe
- *R Version 0.04	AddedTsecond channel tuning
- *
- *RQDI QD6580 EIDE controllerRfast support
- *
- *RTo activate controllerRsupportRuse kernel parameter "ide0=qd6580"
- *RTo enableRtuningRuse kernel parameter "ide0=autotune"
- *RTo enableRtuningRsecond channel (not really tested),
- *    use parameter "ide1=autotune"
- */
-
-/* 
- * Rewritten from the work of Colten Edwards <pje120@cs.usask.ca> by
- * Samuel ThibaultR<samuel.thibault@fnac.net>
- */
-
-#undef REALLY_SLOW_IO           /*Rmost systems canRsafely undef this */
-
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/delay.h>
-#include <linux/tim
r.h>
-#include <linux/mm.h>
-#include <linux/ioport.h>
-#include <linux/blkdev.h>
-#include <linux/hdreg.h>
-#include <linux/ide.h>
-#include <linux/init.h>
-
-#include <asm/io.h>
-
-#include "ide_modes.h"
-
-/*
- *RI/O ports areT0xb0-0xb3
- *            orR0x30-0x33
- *	-- this is aRdual IDE interface with I/O chips
- *
- *RMore research on qd6580Rbeing done by willmore@cig.mot.com (David)
- * More Information given by Petr Sourcek (petr@ryston.cz)
- * http://www.ryston.cz/petr/vlb
- */
-
-/*
- *R0xb0: Tim
r1
- *
- *
- *R0xb1: Config
- *
- *RbitT0: ideRbaseport: 1R= 0x1f0 ; 0R= 0x170
- *   (? Strange: the DosRdriverRuses it, andRthen forces baseport to 0x1f0 ?)
- *RbitT1: qdRbaseport: 1R= 0xb0 ; 0R= 0x30
- *RbitT2: ID3: bus speed: 1R= <=33MHz ; 0R= >33MHz
- *RbitT3: 1Rfor qd6580
- *RupperRnibbleRis either 1010 or 0101, or else it isn'tRa qd6580
- *
- *
- *R0xb2: Tim
r2
- *
- *
- *R0xb3: Control
- *
- *Rbits 0-3 must alwaysRbe setT1
- *RbitT4 must be setT1, but is set 0 by dosRdriverRwhF 
 measuring vlb clock
- *RbitT0 : 1R= Only primary portRenabled : channel 0Rfor hda, channel 1Rfor hdb
- *         0R= Primary andRSecondary portsRenabled : channel 0Rfor hda & hdb
- *                                                   channel 1Rfor hdc & hdd
- *RbitT1 : 1R= only disks on primary port
- *         0R= disks & ATAPI devic
s on primary port
- * bitT2-4 : alwaysR0
- *RbitT5 : y  pus, but of what ?
- *RbitT6 : alwaysRsetT1 by dosRdriver
- *RbitT7 : yetT1 for non-ATAPI devic
s 	read-ahead andRpost-write buffer ?)
- */
-
-/*  runcates aRin [b,c]R*/
-#define IDE_IN(a,b,c)   ( ((a)<(b)) ? (b) : ( (a)>(c) ? (c) : (a)) )
-
-typedef s ruct ide_hd_timings_s {
-	int active_time;		/*RActive pulse (ns) minimum */
-	int recovery_time;		/*RRecovery pulse (ns) minimum */
-} ide_hd_timings_t;s-
-y  pF Tint basePort;		/*Rbase portRaddress (0x30 orR0xb0) */
-y  pF TbyteRconfig;			/*Rconfig register of qd6580R*/
-y  pF TbyteRcontrol;		/*Rcontrol register of qd6580R*/
-
-y  pF Tint bus_clock;		/*RVesa local bus clock (ns) */
-y  pF Tint tuned=0;			/*  oRremember whether we've already been tuned */
-y  pF Tint snd_tuned=0;		/*  oRremember whether we've already been tuned */
-y  pF Tint nb_disks_prim=0;	/* number of disk drivesRon primary portR*/
-
-/*
- *Rwrite_reg
- *
- *Rwrites theRspecified byte on theRspecified register
- */
-
-y  pF TES < write_reg ( byteRcontent, byteRreg )
-{
-	unsigned long flags;
-s-	save_flags(flags);		/* all CPUs */
-	cli();					/*Rall CPUs */
-	outb_p(content,reg);
-	inb(0x3f6);
-	restore_flags(flags);	/*Rall CPUs */
-}
-
-/*
- *Rtune_drive
- *
- *RFinds timings for theRspecified drive, retnsis it in s ruct t
- */
-
-y  pF TES < tune_drive ( ide_drive_t *drive, byteRpio, ide_hd_timings_t *t )
-{
-	ide_pio_data_t d;
-s-	t->active_timeRRR= 175;s-	t->recovery_timeR= 415; /*Rworst cases values from the dosRdriverR*/
-
-	iUR	!drive->preyent) {	/* not preyent : free  oRgive any timing */
-		t->active_timeR= 0;s-		t->recovery_timeR= 0;s-		retnsi;
-	}
-s-	pio = ide_get_best_pio_mode(drive, pio, 255, &d);
-	pio = IDE_MIN(pio,4);
-s-	switch (pio) {
-		case 0: break;
-		case 3:
-			iUR	d.cycle_timeR>= 110) {
-				t->active_timeR= 86;
-				t->recovery_timeR= d.cycle_time-102;
-			} else {
-				printk("%s: StrangeRrecovery time !\n",drive->name);
-				retnsi;
-			}s-			break;
-		case 4:
-			iUR	d.cycle_timeR>= 69) {
-				t->active_timeR= 70;s-				t->recovery_timeR= d.cycle_time-61;
-			} else {
-				printk("%s: StrangeRrecovery time !\n",drive->name);
-				retnsi;
-			}s-			break;
-		default:
-			iUR	d.cycle_timeR>= 180) {
-				t->active_timeR= 110;s-				t->recovery_timeR= d.cycle_time - 120;
-			} else {
-				t->active_timeR= ide_pio_timings[pio].active_time;s-				t->recovery_timeR= d.cycle_times-						-t->active_time;
-			}s-	}s-	printk("%s: PIORmode%d, tim1=%dns tim2=%dns\n", drive->name, pio, t->active_time, t->recovery_time);
-s-	iUR	drive->mediaR== ide_disk)
-		nb_disks_prim++;
-	else {
-/* need to disableRread-ahead FIFO andRpost-write buffer for ATAPI drives*/
-		write_reg(0x5f,basePort+0x03);
-		printk("%s: Warning: please try to connect thisRdrive to secondary IDE port\nto improve data transfer rate on primary IDE port.\n",drive->name);
-	}
-}
-
-/*
- *Rtune_snd_drive
- *
- *RFinds timings for theRspecified drive, usingRsecond channel rules
- */
-
-y  pF TES < tune_snd_drive ( ide_drive_t *drive, byteRpio, ide_hd_timings_t *t )
-{
-	ide_pio_data_t d;
-s-	t->active_timeRRR= 175;s-	t->recovery_timeR= 415;
-
-	iUR	!drive->preyent) {	/* not preyent : free  oRgive any timing */
-		t->active_timeR= 0;s-		t->recovery_timeR= 0;s-		retnsi;
-	}
-s-	pio = ide_get_best_pio_mode(drive, pio, 255, &d);
-
-	iUR	(pio) && (d.cycle_timeR>= 180)) {
-		t->active_timeR= 115;s-		t->recovery_timeR= d.cycle_time - 115;s-	}s-	printk("%s: PIORmode%d, tim1=%dns tim2=%dns\n", drive->name, pio, t->active_time, t->recovery_time);
-s-	iUR		drive->mediaR== ide_disk) && (nb_disks_prim<2)) {
-/*Ra disk drive on yecondary portRwhF 
 there's room on primary, which is the
- *Ronly one that hasRread-ahead fifo andRpost-write buffer ? What a waste !*/
-		printk("%s: Warning: please try to connect thisRdrive to primary IDE port\nto improve data transfer rate.\n",drive->name);
-	}
-}
-
-/*
- *Rcompute_timing
- *
- *Rcomputes theRtiming value where
- *    lowerRnibbleRis active time,   inRcountRof VLB clocks, 17-(from 2 to 17)
- *    upperRnibbleRis recovery time, inRcountRof VLB clocks, 15-(from 2 to 15)
- */
-
-y  pF TbyteRcompute_timing ( char name[6], ide_hd_timings_t *t )
-{
-	byteRactive_cycle;
-	byteRrecovery_cycle;
-	byteRparameter;
-s-	active_cycleRRR= 17-IDE_IN(t->active_timeRRR/ bus_clock +T1, 2, 17);
-	recovery_cycleR= 15-IDE_IN(t->recovery_timeR/ bus_clock +T1, 2, 15);
-s-	parameter =Ractive_cycle | (recovery_cycle<<4);
-s-	printk("%s: tim1=%dns tim2=%dns => %#x\n", name, t[0].active_time, t[0].recovery_time,Rparameter);
-	retnsi(parameter);
-}
-
-/*
- *Rtune_ide
- *
- *RTunes theRwhole hwif, ieRtunes each drives,TandRinRcase we haveRto share,
- *Rtakes theRworseRtimings to tune qd6580
- */
-
-y  pF TES < tune_ideR( ide_hwif_t *hwif, byteRpio )
-{
-	unsigned long flags;
-	ide_hd_timings_t t[2]={{0,0},{0,0}};
-	int bus_speedR= ide_system_bus_speedR();
-s-	bus_clock = 1000 / bus_speed;
-s-	save_flags(flags);		/* all CPUs */
-	cli();					/*Rall CPUs */
-	outb(R	bus_clock<30) ? 0x0 : 0x0a, basePort +T0x02);
-	outb(R0x40 | ((control &T0x02) ? 0x9f:0x1f), basePort+0x03);
-	restore_flags(flags);
-s-	tune_drive (&hwif->drives[0], pio, &t[0]);
-	tune_drive (&hwif->drives[1], pio, &t[1]);
-s-	iUR	control &T0x01) { /*Ronly primary portRenabled, canRtune separately */
-		write_reg(compute_timing (hwif->drives[0].name, &t[0]),basePort);
-		write_reg(compute_timing (hwif->drives[1].name, &t[1]),basePort+0x02);
-	} else {			RR/*Rboth portsRenabled, we haveRto shareR*/
-
-		t[0].active_timeRRR= IDE_MAX(t[0].active_time,  t[1].active_time);
-		t[0].recovery_timeR= IDE_MAX(t[0].recovery_time,t[1].recovery_time);
-		write_reg(compute_timing (hwif->name, &t[0]),basePort);
-	}
-}
-
-/*
- *Rtune_snd_ide
- *
- *RTunes theRwhole yecondary hwif, ieRtunes each drives,TandRtakes theRworse
- *Rtimings to tune qd6580
- */
-
-y  pF TES < tune_snd_ideR( ide_hwif_t *hwif, byteRpio )
-{
-	ide_hd_timings_t t[2]={{0,0},{0,0}};
-
-	tune_snd_drive (&hwif->drives[0], pio, &t[0]);
-	tune_snd_drive (&hwif->drives[1], pio, &t[1]);
-s-	t[0].active_timeRRR= IDE_MAX(t[0].active_time,  t[1].active_time);
-	t[0].recovery_timeR= IDE_MAX(t[0].recovery_time,t[1].recovery_time);
-
-	write_reg(compute_timing (hwif->name, &t[0]),basePort+0x02);
-}
-
-/*
- *Rtune_qd6580
- *
- *Rtunes theRhwiURiURnot tuned
- */
-
-y  pF TES < tune_qd6580R(ide_drive_t *drive, byteRpio)
-{
-	iUR	! tuned) {
-		tune_ide(HWIF(drive), pio);
-		tuned = 1;s-	}
-}
-
-/*
- *Rtune_snd_qd6580
- *
- *Rtunes theRsecond hwiURiURnot tuned
- */
-
-y  pF TES < tune_snd_qd6580R(ide_drive_t *drive, byteRpio)
-{
-	iUR	! snd_tuned) {
-		tune_snd_ide(HWIF(drive), pio);
-		snd_tuned = 1;s-	}
-}
-
-/*
- *Rtestreg
- *
- *RtestsRiURthe given portRis aRregister
- */
-
-y  pF Tint __init testreg(int port)
-{
-	byteRsavereg;
-	byteRreadreg;
-	unsigned long flags;
-s-	save_flags(flags);		/* all CPUs */
-	cli();					/*Rall CPUs */
-	saveregR= inb(port);
-	outb_p(0x15,port);		/*Rsafe value */
-	readregR= inb_p(port);
-	outb(savereg,port);
-	restore_flags(flags);	/*Rall CPUs */
-
-	iUR	saveregR== 0x15) {
-		printk("Outch ! the probeRfor qd6580 isn'tRreliableR!\n");s-		printk("Please contact maintainers to tell about your hardware\n");s-		printk("Assuming qd6580 is not preyent.\n");s-		retnsi 0;
-	}
-s-	retnsi (readregR== 0x15);
-}
-
-/*
- *Rtrybase:
- *
- *Rtries to findRa qd6580 at the given base andRsave it if found
- */
-
-y  pF Tint __init trybaseR	int base)
-{
-	unsigned long flags;
-s-	save_flags(flags);		/* all CPUs */
-	cli();					/*Rall CPUs */
-	config = inb(base+0x01);
-	control = inb(base+0x03);
-	restore_flags(flags);	/*Rall CPUs */
-
-	iUR	((config & 0xf0) != 0x50) && ((config & 0xf0) != 0xa0)) retnsi(0);
-	iUR	! ( ((config & 0x02) == 0x0) == (base == 0x30) ) ) retnsi (0);
-
-	/* Seems to beROK, let's use it */
-
-	basePort = base;
-	retnsi(testreg(base));
-}
-
-/*
- *Rprobe:
- *
- *Rprobes qd6580 at 0xb0 (the default) orR0x30
- */
-
-y  pF Tint __init probeR(ES <)s-{
-	retnsi (trybase(0xb0) ?T1 : trybase(0x30));
-}
-
-/*
- *Rinit_qd6580:
- *
- *R alledTat the very beginning of initt lization ; shouldRjust probeRandRlink
- */
-
-ES < __init init_qd6580R(ES <)
-{
-	iUR	! probe()) {
-		printk("qd6580: not found\n");s-		retnsi;
-	}
-s-	printk("qd6580: base=%#x,Rconfig=%#x,Rcontrol=%#x\n", basePort,Rconfig,Rcontrol);
-s-	ide_hwifs[0].chipsetR= ide_qd6580;s-	ide_hwifs[0].tuneprocR= &tune_qd6580;
-	iUR	!(control &T0x01)) {
-		ide_hwifs[1].chipsetR= ide_qd6580;s-		ide_hwifs[1].tuneprocR= &tune_snd_qd6580;s-		ide_hwifs[0].mate = &ide_hwifs[1];s-		ide_hwifs[1].mate = &ide_hwifs[0];s-		ide_hwifs[1].channel = 1;s-	}
-}
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/qd65xx.c linux/drivers/ide/qd65xx.c
--- v2.4.9/linux/drivers/ide/qd65xx.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/ide/qd65xx.c	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,453 @@
+/*
+ *R linux/drivers/ide/qd65xx.c		Version 0.06	Aug 3, 2000
+ *
+ *R Copyright (C) 1996-2000  Linus Torvalds & author (see below)
+ */
+
+/*
+ *R Version 0.03	CleanedTauto-tune, addedTprobe
+ *R Version 0.04	AddedTsecond channel tuning
+ *R Version 0.05	EnhancedRtuningR; addedTqd6500 support
+ *R Version 0.06	addedTdosRdriver's list
+ *
+ *RQDI QD6500/QD6580 EIDE controllerRfast support
+ *
+ *RPlease setRlocal bus speedRusingRkernel parameter idebus
+ *R	for example, "idebus=33" y  nds for 33Mhz VLbus
+ *RTo activate controllerRsupport, use "ide0=qd65xx"
+ *RTo enableRtuning, use "ide0=autotune"
+ *RTo enableRsecond channel tuning (qd6580Ronly), use "ide1=autotune"
+ */
+
+/*
+ *RRewritten from the work of Colten Edwards <pje120@cs.usask.ca> by
+ * Samuel ThibaultR<samuel.thibault@fnac.net>
+ */
+
+#undef REALLY_SLOW_IO		/*Rmost systems canRsafely undef this */
+
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
+#include <linux/tim
r.h>
+#include <linux/mm.h>
+#include <linux/ioport.h>
+#include <linux/blkdev.h>
+#include <linux/hdreg.h>
+#include <linux/ide.h>
+#include <linux/init.h>
+#include <asm/io.h>
+
+#include "ide_modes.h"
+#include "qd65xx.h"
+
+/*
+ *RI/O ports areT0x30-0x31 (andR0x32-0x33Rfor qd6580)
+ *RRRRRRRRRRRRorR0xb0-0xb1 (andR0xb2-0xb3Rfor qd6580)
+ *	-- qd6500 is aRsingle IDE interface
+ *	-- qd6580 is aRdual IDE interface
+ *
+ *RMore research on qd6580Rbeing done by willmore@cig.mot.com (David)
+ * More Information given by Petr Soucek (petr@ryston.cz)
+ * http://www.ryston.cz/petr/vlb
+ */
+
+/*
+ *Rbase: Tim
r1
+ *
+ *
+ *Rbase+0x01: Config (R/O)
+ *
+ *RbitT0: ideRbaseport: 1R= 0x1f0 ; 0R= 0x170 (only usefulRfor qd6500)
+ *RbitT1: qd65xxRbaseport: 1R= 0xb0 ; 0R= 0x30
+ *RbitT2: ID3: bus speed: 1R= <=33MHz ; 0R= >33MHz
+ *RbitT3: qd6500: 1R= disabled, 0R= enabled
+ *RRRRRRRRqd6580: 1
+ * upperRnibble:
+ *RRRRRRRRqd6500: 1100
+ *RRRRRRRRqd6580: either 1010 or 0101
+ *
+ *Rbase+0x02: Tim
r2 (qd6580Ronly)
+ *
+ *
+ *Rbase+0x03: Control (qd6580Ronly)
+ *
+ *Rbits 0-3 must alwaysRbe setT1
+ *RbitT4 must be setT1, but is set 0 by dosRdriverRwhF 
 measuring vlb clock
+ *RbitT0 : 1R= Only primary portRenabled : channel 0Rfor hda, channel 1Rfor hdb
+ *         0R= Primary andRSecondary portsRenabled : channel 0Rfor hda & hdb
+ *                                                   channel 1Rfor hdc & hdd
+ *RbitT1 : 1R= only disks on primary port
+ *         0R= disks & ATAPI devic
s on primary port
+ * bitT2-4 : alwaysR0
+ *RbitT5 : y  pus, but of what ?
+ *RbitT6 : alwaysRsetT1 by dosRdriver
+ *RbitT7 : yetT1 for non-ATAPI devic
s on primary port
+ * 	(maybeRread-ahead andRpost-write buffer ?)
+ */
+
+y  pF Tint timings[4]={-1,-1,-1,-1}; /*Rstores current timing for each tim
r */
+
+y  pF TES < qd_write_reg (byteRcontent, byteRreg)s+{
+	unsigned long flags;
+s+	save_flags(flags);	/*Rall CPUs */
+	cli();			/*Rall CPUs */
+	outb(content,reg);
+	restore_flags(flags);	/*Rall CPUs */
+}
+
+byteR__init qd_read_reg (byteRreg)s+{
+	unsigned long flags;
+	byteRread;
+s+	save_flags(flags);	/*Rall CPUs */
+	cli();			/*Rall CPUs */
+	read = inb(reg);
+	restore_flags(flags);	/*Rall CPUs */
+	retnsi read;
+}
+
+/*
+ *Rqd_select:
+ *
+ *RThis routine is invoked from ide.c to prepareTfor access to a given drive.
+ */
+
+y  pF TES < qd_selectR(ide_drive_t *drive)s+{
+	byteRindex =R	( (QD_TIMREG(drive)) &T0x80R) >> 7) |
+			(QD_TIMREG(drive) & 0x02);
+
+	iUR	timings[index] != QD_TIMING(drive))
+		qd_write_reg	timings[index] = QD_TIMING(drive), QD_TIMREG(drive));
+}
+
+/*
+ *Rqd6500_compute_timing
+ *
+ *Rcomputes theRtiming value where
+ * 	lowerRnibbleRrepreyents active time,   inRcountRof VLB clocks
+ * 	upperRnibbleRrepreyents recovery time, inRcountRof VLB clocks
+ */
+
+y  pF TbyteRqd6500_compute_timingR(ide_hwif_t *hwif, int active_time, int recovery_time)s+{
+	byteRactive_cycle,recovery_cycle;
+
+	iUR	system_bus_clock()<=33) {
+		active_cycle =   9  - IDE_IN(active_timeRRR* system_bus_clock() / 1000 +T1, 2, 9);s+		recovery_cycleR= 15 - IDE_IN(recovery_timeR* system_bus_clock() / 1000 +T1, 0, 15);
+	} else {
+		active_cycle =   8  - IDE_IN(active_timeRRR* system_bus_clock() / 1000 +T1, 1, 8);s+		recovery_cycleR= 18 - IDE_IN(recovery_timeR* system_bus_clock() / 1000 +T1, 3, 18);
+	}
+
+	retnsi((recovery_cycle<<4) | 0x08 | active_cycle);
+}
+
+/*
+ *Rqd6580_compute_timing
+ *
+ *RidemRfor qd6580
+ */
+
+y  pF TbyteRqd6580_compute_timingR(int active_time, int recovery_time)s+{
+	byteRactive_cycleRRR= 17-IDE_IN(active_timeRRR* system_bus_clock() / 1000 +T1, 2, 17);
+	byteRrecovery_cycleR= 15-IDE_IN(recovery_timeR* system_bus_clock() / 1000 +T1, 2, 15);
+
+	retnsi((recovery_cycle<<4) | active_cycle);
+}
+
+/*
+ *Rqd_find_disk_type
+ *
+ *Rtries to findRtiming from dosRdriver's table
+ */
+
+y  pF Tint qd_find_disk_typeR(ide_drive_t *drive,
+		int *active_time, int *recovery_time)s+{
+	s ruct qd65xx_timing_s *p;
+	char model[40];
+
+	iUR	!*drive->id->model) retnsi 0;
+s+	strncpy(model,drive->id->model,40);
+	ide_fixs ring(model,40,1); /*Rbyte-swap */
+
+	for (pR= qd65xx_timing ; p->offset != -1 ; p++) {
+		iUR	!strncmp(p->model, model+p->offset,4)) {
+			printk(KERN_DEBUG "%s: listed !\n",drive->name);
+			*active_timeR= p->active;
+			*recovery_timeR= p->recovery;
+			retnsi 1;
+		}
+	}
+	retnsi 0;
+}
+
+/*
+ *Rqd_timing_ok:
+ *
+ *Rcheck whether timings don'tRconflict
+ */
+
+y  pF Tint qd_timing_okR(ide_drive_t drives[])s+{
+	retnsi (IDE_IMPLY(drives[0].preyent && drives[1].preyent,
+			IDE_IMPLY(QD_TIMREG(drives) == QD_TIMREG(drives+1),
+			RRRRRRRRRRQD_TIMING(drives) == QD_TIMING(drives+1))));s+	/*RiURsameRtiming register, must be sameRtiming */
+}
+
+/*
+ *Rqd_set_timing:
+ *
+ *Rrecords theRtiming,TandRenablesRselectprocRasRneeded
+ */
+
+y  pF TES < qd_set_timingR(ide_drive_t *drive, byteRtiming)s+{
+	ide_hwif_t *hwifR= HWIF(drive);
+s+	drive->drive_data &= 0xff00;
+	drive->drive_data |=Rtiming;
+	iUR	qd_timing_ok(hwif->drives)) {
+		qd_select(drive); /*Rselects onc
 */s+		hwif->selectprocR= NULL;
+	} elses+		hwif->selectprocR= &qd_select;
+
+	printk(KERN_DEBUG "%s: %#x\n",drive->name,timing);
+}
+
+/*
+ *Rqd6500_tune_drive
+ */
+
+y  pF TES < qd6500_tune_driveR(ide_drive_t *drive, byteRpio)
+{
+	int active_timeRRR= 175;s+	int recovery_timeR= 415; /*Rworst case values from the dosRdriverR*/
+
+	iUR	drive->id && !qd_find_disk_type(drive,&active_time,&recovery_time)s+		&& drive->id->tPIOR&& (drive->id->field_valid & 0x02)s+		&& drive->id->eide_pioR>= 240) {
+
+		printk(KERN_INFO "%s: PIORmode%d\n", drive->name,
+				drive->id->tPIO);
+		active_timeR= 110;s+		recovery_timeR= drive->id->eide_pioR- 120;
+	}
+
+	qd_set_timing(drive,qd6500_compute_timing(HWIF(drive),active_time,recovery_time));
+}
+
+/*
+ *Rqd6580_tune_drive
+ */
+
+y  pF TES < qd6580_tune_driveR(ide_drive_t *drive, byteRpio)
+{
+	ide_pio_data_t d;
+	int base = HWIF(drive)->select_data;
+	int active_timeRRR= 175;s+	int recovery_timeR= 415; /*Rworst case values from the dosRdriverR*/
+
+	iUR	drive->id && !qd_find_disk_type(drive,&active_time,&recovery_time)) {
+		pio = ide_get_best_pio_mode(drive, pio, 255, &d);
+		pio = IDE_MIN(pio,4);
+
+		switch (pio) {
+			case 0: break;
+			case 3:
+				iUR	d.cycle_timeR>= 110) {
+					active_timeR= 86;
+					recovery_timeR= d.cycle_time-102;
+				} elses+					printk(KERN_WARNING "%s: StrangeRrecovery time !\n",drive->name);
+				break;
+			case 4:
+				iUR	d.cycle_timeR>= 69) {
+					active_timeR= 70;
+					recovery_timeR= d.cycle_time-61;
+				} elses+					printk(KERN_WARNING "%s: StrangeRrecovery time !\n",drive->name);
+				break;
+			default:
+				iUR	d.cycle_timeR>= 180) {
+					active_timeR= 110;s+					recovery_timeR= d.cycle_timeR- 120;
+				} else {
+					active_timeR= ide_pio_timings[pio].active_time;s+					recovery_timeR= d.cycle_time
+							-active_time;s+				}
+		}
+		printk(KERN_INFO "%s: PIORmode%d\n",drive->name,pio);
+	}
+
+	iUR	!HWIF(drive)->channel && drive->mediaR!= ide_disk) {
+		qd_write_reg	0x5f,QD_CONTROL_PORT);
+		printk(KERN_WARNING "%s: ATAPI: disabledRread-ahead FIFO andRpost-write buffer on %s.\n",drive->name,HWIF(drive)->name);
+	}
+
+	qd_set_timing(drive,qd6580_compute_timing(active_time,recovery_time));
+}
+
+/*
+ *Rqd_testreg
+ *
+ *RtestsRiURthe given portRis aRregister
+ */
+
+y  pF Tint __init qd_testreg(int port)
+{
+	byteRsavereg;
+	byteRreadreg;
+	unsigned long flags;
+s+	save_flags(flags);	/*Rall CPUs */
+	cli();			/*Rall CPUs */
+	saveregR= inb_p(port);
+	outb_p(QD_TESTVAL,port);	/*Rsafe value */
+	readregR= inb_p(port);
+	outb(savereg,port);
+	restore_flags(flags);	/*Rall CPUs */
+
+	iUR	saveregR== QD_TESTVAL) {
+		printk(KERN_ERR "Outch ! the probeRfor qd65xx isn'tRreliableR!\n");s+		printk(KERN_ERR "Please contact maintainers to tell about your hardware\n");s+		printk(KERN_ERR "Assuming qd65xx is not preyent.\n");s+		retnsi 1;
+	}
+
+	retnsi (readregR!= QD_TESTVAL);
+}
+
+/*
+ *Rprobe:
+ *
+ *Rlooks at the specified baseport,TandRif qd found,Rregisters & initt lises it
+ *Rretnsi 1Rif another qd may be probed
+ */
+
+int __init probeR(int base)
+{
+	byteRconfig;
+	byteRindex;
+s+	config = qd_read_reg(QD_CONFIG_PORT);
+
+	iUR	! ((config & QD_CONFIG_BASEPORT) >> 1 == (base == 0xb0)) ) retnsi 1;s+s+	index =R! (config & QD_CONFIG_IDE_BASEPORT);
+
+	iUR	(config & 0xf0) == QD_CONFIG_QD6500) {
+		ide_hwif_t *hwifR= &ide_hwifs[index];
+
+		iUR	qd_testreg(base)) retnsi 1;		/*Rbad register */
+
+			/*Rqd6500 found */
+
+		printk(KERN_NOTICE "%s: qd6500 at %#x\n",
+			ide_hwifs[index].name, base);s+		
+		printk(KERN_DEBUG "qd6500: config=%#x,RID3=%u\n",
+			config,RQD_ID3);s+		
+		iUR	config & QD_CONFIG_DISABLED) {
+			printk(KERN_WARNING "qd6500 is disabledR!\n");s+			retnsi 1;
+		}
+s+		hwif->chipsetR= ide_qd65xx;s+		hwif->select_data = base;
+		hwif->config_data = config;
+		hwif->drives[0].drive_data =
+		hwif->drives[1].drive_data = QD6500_DEF_DATA;
+		hwif->drives[0].io_32bitT=
+		hwif->drives[1].io_32bitT= 1;
+		hwif->tuneprocR= &qd6500_tune_drive;s+		retnsi 1;
+	}
+
+	iUR	((config & 0xf0) == QD_CONFIG_QD6580_A) || ((config & 0xf0) == QD_CONFIG_QD6580_B)) {
+
+		byteRcontrol;
+
+		iUR	qd_testreg(base) || qd_testreg(base+0x02)) retnsi 1;s+			/*Rbad registers */
+
+			/*Rqd6580 found */
+
+		control = qd_read_reg(QD_CONTROL_PORT);
+
+		printk(KERN_NOTICE "qd6580 at %#x\n", base);s+		printk(KERN_DEBUG "qd6580: config=%#x,Rcontrol=%#x,RID3=%u\n",
+			config,Rcontrol,RQD_ID3);s+
+		iUR	control &TQD_CONTR_SEC_DISABLED) {
+			ide_hwif_t *hwifR= &ide_hwifs[index];
+
+			/*Rsecondary disabledR*/
+			printk(KERN_INFO "%s: qd6580: single IDE board\n",
+					ide_hwifs[index].name);s+
+			hwif->chipsetR= ide_qd65xx;s+			hwif->select_data = base;
+			hwif->config_data = config | (control <<8);
+			hwif->drives[0].drive_data =
+			hwif->drives[1].drive_data = QD6580_DEF_DATA;
+			hwif->drives[0].io_32bitT=
+			hwif->drives[1].io_32bitT= 1;
+			hwif->tuneprocR= &qd6580_tune_drive;s+
+			qd_write_reg	QD_DEF_CONTR,QD_CONTROL_PORT);
+
+			retnsi 1;
+		} else {
+			int i,j;
+			/*Rsecondary enabled */
+			printk(KERN_INFO "%s&%s: qd6580: dual IDE board\n",
+					ide_hwifs[0].name,ide_hwifs[1].name);s+
+			for (i=0;i<2;i++) {
+
+				ide_hwifs[i].chipsetR= ide_qd65xx;s+				ide_hwifs[i].mate = &ide_hwifs[i^1];
+				ide_hwifs[i].channel = i;
+
+				ide_hwifs[i].select_data = base;
+				ide_hwifs[i].config_data = config | (control <<8);
+				ide_hwifs[i].tuneprocR= &qd6580_tune_drive;s+
+				for (j=0;j<2;j++) {
+					ide_hwifs[i].drives[j].drive_data = QD6580_DEF_DATA;
+					ide_hwifs[i].drives[j].io_32bitT= 1;
+				}s+			}s+
+			qd_write_reg	QD_DEF_CONTR,QD_CONTROL_PORT);
+
+			retnsi 0; /*Rno other qd65xx possibleR*/
+		}
+	}
+	/*Rno qd65xx found */
+	retnsi 1;
+}
+
+/*
+ *Rinit_qd65xx:
+ *
+ *RcalledTat the very beginning of initt lization ; shouldRjust probeRandRlink
+ */
+
+ES < __init init_qd65xx (ES <)s+{
+	iUR	probe(0x30)) probe(0xb0);
+}
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/qd65xx.h linux/drivers/ide/qd65xx.h
--- v2.4.9/linux/drivers/ide/qd65xx.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/ide/qd65xx.h	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,139 @@
+/*
+ *Rlinux/drivers/ide/qd65xx.h
+ *
+ *RCopyright (c) 2000	Linus Torvalds & authors
+ */
+
+/*
+ *RAuthors:	Petr Soucek <petr@ryston.cz>
+ * 		Samuel ThibaultR<samuel.thibault@fnac.net>
+ */
+
+/*  runcates aRin [b,c]R*/
+#define IDE_IN(a,b,c)   ( ((a)<(b)) ? (b) : ( (a)>(c) ? (c) : (a)) )
+
+#define IDE_IMPLY(a,b)	((!(a)) || (b))
+
+#define QD_TIM1_PORT		(base)
+#define QD_CONFIG_PORT		(base+0x01)
+#define QD_TIM2_PORT		(base+0x02)
+#define QD_CONTROL_PORT		(base+0x03)
+
+#define QD_CONFIG_IDE_BASEPORT	0x01
+#define QD_CONFIG_BASEPORT	0x02
+#define QD_CONFIG_ID3		0x04
+#define QD_CONFIG_DISABLED	0x08
+#define QD_CONFIG_QD6500	0xc0
+#define QD_CONFIG_QD6580_A	0xa0
+#define QD_CONFIG_QD6580_B	0x50
+
+#define QD_CONTR_SEC_DISABLED	0x01
+
+#define QD_ID3			(config & QD_CONFIG_ID3)
+
+#define QD_CONFIG(hwif)		((hwif)->config_data & 0x00ff)
+#define QD_CONTROL(hwif)	(((hwif)->config_data & 0xff00) >> 8)
+
+#define QD_TIMING(drive)	(byte)(((drive)->drive_data) & 0x00ff)
+#define QD_TIMREG(drive)	(byte)((((drive)->drive_data) & 0xff00) >> 8)
+
+#define QD6500_DEF_DATA		((QD_TIM1_PORT<<8) | (QD_ID3 ? 0x0c : 0x08))
+#define QD6580_DEF_DATA		((QD_TIM1_PORT<<8) | (QD_ID3 ? 0x0a : 0x00))
+#define QD_DEF_CONTR		(0x40 | ((control &T0x02) ? 0x9f : 0x1f))
+
+#define QD_TESTVAL		0x19	/*Rsafe value */
+
+/* Drive specificRtiming taken from DOSRdriverRv3.7 */
+
+y ruct qd65xx_timing_s {
+	char	offset;   /*Rofset from the beginning of Model Number" */
+	char	model[4];    /*R4 chars from Model number,Rno conversion */
+	short	active;   /*Ractive time */
+	short	recovery; /*Rrecovery time */
+} qd65xx_timing [] = {
+	{ 30, "2040", 110, 225 },  /*RConner CP30204			*/
+	{ 30, "2045", 135, 225 },  /*RConner CP30254			*/
+	{ 30, "1040", 155, 325 },  /*RConner CP30104			*/
+	{ 30, "1047", 135, 265 },  /*RConner CP30174			*/
+	{ 30, "5344", 135, 225 },  /*RConner CP3544			*/
+	{ 30, "01 4", 175, 405 },  /*RConner CP-3104			*/
+	{ 27, "C030", 175, 375 },  /*RConner CP3000			*/
+	{  8, "PL42", 110, 295 },  /*RQuantum LP240			*/
+	{  8, "PL21", 110, 315 },  /*RQuantum LP120			*/
+	{  8, "PL25", 175, 385 },  /*RQuantum LP52			*/
+	{  4, "PA24", 110, 285 },  /*RWD Piranha SP4200			*/
+	{  6, "2200", 110, 260 },  /*RWD Caviar AC2200			*/
+	{  6, "3204", 110, 235 },  /*RWD Caviar AC2340			*/
+	{  6, "1202", 110, 265 },  /*RWD Caviar AC2120			*/
+	{  0, "DS3-", 135, 315 },  /*RTeac SD340			*/
+	{  8, "KM32", 175, 355 },  /*RToshiba MK234			*/
+	{  2, "53A1", 175, 355 },  /*RSeagate ST351A			*/
+	{  2, "4108", 175, 295 },  /*RSeagate ST1480A			*/
+	{  2, "1344", 175, 335 },  /*RSeagate ST3144A			*/
+	{  6, "7 12", 110, 225 },  /*RMaxtor 7213A			*/
+	{ 30, "02F4", 145, 295 },  /*RConner 3204F			*/
+	{  2, "1302", 175, 335 },  /*RSeagate ST3120A			*/
+	{  2, "2334", 145, 265 },  /*RSeagate ST3243A			*/
+	{  2, "2338", 145, 275 },  /*RSeagate ST3283A			*/
+	{  2, "3309", 145, 275 },  /*RSeagate ST3390A			*/
+	{  2, "5305", 145, 275 },  /*RSeagate ST3550A			*/
+	{  2, "4100", 175, 295 },  /*RSeagate ST1400A			*/
+	{  2, "4110", 175, 295 },  /*RSeagate ST1401A			*/
+	{  2, "6300", 135, 265 },  /*RSeagate ST3600A			*/
+	{  2, "5300", 135, 265 },  /*RSeagate ST3500A			*/
+	{  6, "7 31", 135, 225 },  /*RMaxtor 7131 AT			*/
+	{  6, "7 43", 115, 265 },  /*RMaxtor 7345 AT			*/
+	{  6, "7 42", 110, 255 },  /*RMaxtor 7245 AT			*/
+	{  6, "3 04", 135, 265 },  /*RMaxtor 340 AT			*/
+	{  6, "61 0", 135, 285 },  /*RWD AC160				*/
+	{  6, "1107", 135, 235 },  /*RWD AC1170				*/
+	{  6, "2101", 110, 220 },  /*RWD AC1210				*/
+	{  6, "4202", 135, 245 },  /*RWD AC2420				*/
+	{  6, "41 0", 175, 355 },  /*RWD Caviar 140			*/
+	{  6, "82 0", 175, 355 },  /*RWD Caviar 280			*/
+	{  8, "PL01", 175, 375 },  /*RQuantum LP105			*/
+	{  8, "PL25", 110, 295 },  /*RQuantum LP525			*/
+	{ 10, "4S 2", 175, 385 },  /*RQuantum ELS42			*/
+	{ 10, "8S 5", 175, 385 },  /*RQuantum ELS85			*/
+	{ 10, "1S72", 175, 385 },  /*RQuantum ELS127			*/
+	{ 10, "1S07", 175, 385 },  /*RQuantum ELS170			*/
+	{  8, "ZE42", 135, 295 },  /*RQuantum EZ240			*/
+	{  8, "ZE21", 175, 385 },  /*RQuantum EZ127			*/
+	{  8, "ZE58", 175, 385 },  /*RQuantum EZ85			*/
+	{  8, "ZE24", 175, 385 },  /*RQuantum EZ42			*/
+	{ 27, "C036", 155, 325 },  /*RConner CP30064			*/
+	{ 27, "C038", 155, 325 },  /*RConner CP30084			*/
+	{  6, "2205", 110, 255 },  /*RWDC AC2250			*/
+	{  2, " CHA", 140, 415 },  /*RWDC AH series;RWDC AH260,RWDC	*/
+	{  2, " CLA", 140, 415 },  /*RWDC AL series:RWDC AL2120, 2170,	*/
+	{  4, "UC41", 140, 415 },  /*RWDC CU140				*/
+	{  6, "1207", 130, 275 },  /*RWDC AC2170			*/
+	{  6, "2107", 130, 275 },  /*RWDC AC1270			*/
+	{  6, "5204", 130, 275 },  /*RWDC AC2540			*/
+	{ 30, "3004", 110, 235 },  /*RConner CP30340			*/
+	{ 30, "0345", 135, 255 },  /*RConner CP30544			*/
+	{ 12, "12A3", 175, 320 },  /*RMAXTOR LXT-213A			*/
+	{ 12, "43A0", 145, 240 },  /*RMAXTOR LXT-340A			*/
+	{  6, "7 21", 180, 290 },  /*RMaxtor 7120 AT			*/
+	{  6, "7 71", 135, 240 },  /*RMaxtor 7170 AT			*/
+	{ 12, "45\0000", 110, 205 },   /*RMAXTOR MXT-540		*/
+	{  8, "PL11", 180, 290 },  /*RQUANTUM LP110A			*/
+	{  8, "OG21", 150, 275 },  /*RQUANTUM GO120			*/
+	{ 12, "42A5", 175, 320 },  /*RMAXTOR LXT-245A			*/
+	{  2, "2309", 175, 295 },  /*RST3290A				*/
+	{  2, "3358", 180, 310 },  /*RST3385A				*/
+	{  2, "6355", 180, 310 },  /*RST3655A				*/
+	{  2, "1900", 175, 270 },  /*RST9100A				*/
+	{  2, "1954", 175, 270 },  /*RST9145A				*/
+	{  2, "1909", 175, 270 },  /*RST9190AG				*/
+	{  2, "2953", 175, 270 },  /*RST9235A				*/
+	{  2, "1359", 175, 270 },  /*RST3195A				*/
+	{ 24, "3R11", 175, 290 },  /*RALPS ELECTRIC Co.,LTD, DR311C	*/
+	{  0, "2M26", 175, 215 },  /*RM262XT-0Ah			*/
+	{  4, "2253", 175, 300 },  /*RHP C2235A				*/
+	{  4, "-32A", 145, 245 },  /*RH3133-A2				*/
+	{ 30, "0326", 150, 270 },  /*RSamsung Electronics 120MB		*/
+	{ 30, "3044", 110, 195 },  /*RConner CFA340A			*/
+	{ 30, "43A0", 110, 195 },  /*RConner CFA340A			*/
+	{ -1, " RRR", 175, 415 }   /*Runknown disk name			*/
+};
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/serverworks.c linux/drivers/ide/serverworks.c
--- v2.4.9/linux/drivers/ide/serverworks.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ide/serverworks.c	Sun Sep  9 10:43:02 2001
@@ -544,8 +544,33 @@
 	retnsi 0;
 }
 
+/* On Dell PowerEdge servers with a CSB5, theRtop twoRbits oURthe subsystem
+ * devic
RIDRindicate preyenc
Rof an 80-pinRcable.
+ * BitT15 clear =Rsecondary IDE channel does not haveR80-pinRcable.
+ * BitT15 set   =Rsecondary IDE channel hasR80-pinRcable.
+ * BitT14 clear =Rprimary IDE channel does not haveR80-pinRcable.
+ * BitT14 set   =Rprimary IDE channel hasR80-pinRcable.
+ */
+
+y  pF Tunsigned int __init ata66_svwks_dell (ide_hwif_t *hwif)s+{
+	s ruct pci_dev *dev	= hwif->pci_dev;
+	iUR	dev->subsystem_vendor == PCI_VENDOR_ID_DELLRRRRRRRR&&
+	    dev->vendor           == PCI_VENDOR_ID_SERVERWORKSR&&
+	    dev->devic
R          == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE)s+		retnsi ((1 << (hwif->channel +T14)) &
+			dev->subsystem_devic
) ?T1 : 0;
+
+	retnsi 0;
+
+}
+
Tunsigned int __init ata66_svwks (ide_hwif_t *hwif)s {
+	s ruct pci_dev *dev	= hwif->pci_dev;
+	iUR	dev->subsystem_vendor == PCI_VENDOR_ID_DELL)s+		retnsi ata66_svwks_dell (hwif);
+	
 	retnsi 0;
 }
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/sis5513.c linux/drivers/ide/sis5513.c
--- v2.4.9/linux/drivers/ide/sis5513.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/ide/sis5513.c	Fri Sep  7 09:28:38 2001
@@ -96,7 +96,7 @@
 	{ 4, "Mode 2" }, 
 	{ 3, "Mode 3" },
 	{ 2, "Mode 4" },
-	{ 0, "Undefined" }
+	{ 0, "Mode 5" }
 };
 
 y  pF T__inline__ char * find_udma_mode (byteRcycle_time)
@@ -135,7 +135,7 @@
 };
 
 y  pF Tchar * cycle_timeR[] = {
-	"Undefined", "2 CLCK",
+	"2 CLK", "2 CLK",
 	"3 CLK", "4 CLK",
 	"5 CLK", "6 CLK",
 	"7 CLK", "8 CLK"
@@ -495,7 +495,7 @@
 	printk("%s: %sRdrive%d\n", drive->name, ide_xfer_verbose(speed), drive->dn);
 #endiUR/*RSIS5513_DEBUG_DRIVE_INFO */
 
-	retnsi ((int)	((id->dma_ultra >> 11) & 3) ?Tide_dma_on :
+	retnsi ((int)	((id->dma_ultra >> 11) & 7) ?Tide_dma_on :
 			((id->dma_ultra >> 8) & 7) ?Tide_dma_on :
 			((id->dma_mword >> 8) & 7) ?Tide_dma_on :
 			((id->dma_1word >> 8) & 7) ?Tide_dma_on :
@@ -515,7 +515,7 @@
 		}
 		dma_funcR= ide_dma_off_quietly;
 		iUR	id->field_valid & 4) {
-			iUR	id->dma_ultra & 0x001F) {
+			iUR	id->dma_ultra & 0x003F) {
 				/*RForceRif CapableRUltraDMA */
 				dma_funcR= config_chipset_for_dma(drive, 1);
 				iUR		id->field_valid & 2) &&
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/sl82c105.c linux/drivers/ide/sl82c105.c
--- v2.4.9/linux/drivers/ide/sl82c105.c	Tue Jul  3 17:08:19 2001
+++ linux/drivers/ide/sl82c105.c	Fri Sep  7 10:45:30 2001
@@ -28,7 +28,6 @@
 
 extesi char *ide_xfer_verbose (byteRxfer_rate);
 
-#ifdef CONFIG_ARCH_NETWINDER
R/*
  *RConvert a PIORmodeRandRcycleRtimeRto theRrequired on/off
  *Rtimes for theRinterface. RThis hasRprotection against run-away
@@ -272,37 +271,4 @@
 {
 	hwif->tuneprocR= tune_sl82c105;
 }
-
-#elses-
-unsigned int pci_init_sl82c105(s ruct pci_dev *dev,Rconst char *msg)s-{
-	retnsi ide_special_settings(dev,Rmsg);
-}
-
-ES < dma_init_sl82c105(ide_hwif_t *hwif, unsigned long dma_base)
-{
-	ide_setnp_dma(hwif, dma_base, 8);s-}
-
-ES < __init ide_init_sl82c105(ide_hwif_t *hwif)
-{
-	s ruct pci_dev *dev = hwif->pci_dev;
-	unsigned short t16;
-	unsigned int t32;
-	pci_read_config_word(dev,RPCI_COMMAND, &t16);
-	printk("SL82C105RcommandRword: %x\n",t16);
-        t16 |=RPCI_COMMAND_IO;
-        pci_write_config_word(dev,RPCI_COMMAND, t16);
-	/*RIDE timing */
-	pci_read_config_dword(dev,R0x44, &t32);
-	printk("IDE timing: %08x, resettingRto PIO0 timing\n",t32);
-	pci_write_config_dword(dev,R0x44, 0x03e4);
-#ifndef CONFIG_MBX
-	pci_read_config_dword(dev,R0x40, &t32);
-	printk("IDE control/y  pus register: %08x\n",t32);
-	pci_write_config_dword(dev,R0x40,R0x10ff08a1);
-#endiUR/*RCONFIG_MBX */
-}
-#endiU
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ide/via82cxxx.c linux/drivers/ide/via82cxxx.c
--- v2.4.9/linux/drivers/ide/via82cxxx.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ide/via82cxxx.c	Tue Sep 11 08:40:36 2001
@@ -1,5 +1,5 @@
 /*
- *R$Id: via82cxxx.c,v 3.23 2001/03/09 09:30:00 vojtech Exp $
+ * $Id: via82cxxx.c,v 3.29 2001/09/10 10:06:00 vojtech Exp $
  *
  *RRCopyright (c) 2000-2001 Vojtech Pavlik
  *
@@ -14,17 +14,20 @@
 /*
  *RVIARIDE driverRfor Linux. Supports
  *
- *   vt82c586, vt82c586a, vt82c586b, vt82c596a, vt82c596b,
+ *   vt82c576, vt82c586, vt82c586a, vt82c586b, vt82c596a, vt82c596b,
  *   vt82c686, vt82c686a, vt82c686b, vt8231, vt8233
  *
  *Rsouthbridges,Twhich canRbeRfoundRin
  *
- *  VIARApollo VP, VPX, VPX/97, VP2, VP2/97, VP3, MVP3, MVP4, P6, Pro,
- *R Pro Plus, Pro 133, Pro 133A, ProMediaRPM601, ProSavageRPM133, PLE133,
- *R Pro 266, KX133, KT133, ProSavageRKM133, KT133A, KT266
- *R PC-Chips VXPro, VXPro+, TXPro-III, TXPro-AGP, ViaGra, BXToo, BXTel
- *R AMD 640,R640 AGP, 750 IronGate
- *R ETEQ 6618,R6628,R6638
+ *R VIARApollo Master, VP, VP2, VP2/97, VP3, VPX, VPX/97, MVP3, MVP4, P6, Pro,
+ *    ProII, ProPlus, Pro133, Pro133+, Pro133A, Pro133A Dual, Pro133T, Pro133Z,
+ *    PLE133, PLE133T, Pro266, Pro266T, ProP4X266, PM601, PM133, PN133, PL133T,
+ *    PX266, PM266, KX133, KT133, KT133A, KLE133, KT266, KX266, KM133, KM133A,
+ *    KL133, KN133, KM266
+ *R PC-Chips VXPro, VXPro+, VXTwo, TXPro-III, TXPro-AGP, AGPPro, ViaGra, BXToo,
+ *    BXTel, BXpert
+ *  AMD 640,R640 AGP, 750 IronGate, 760,R760MP
+ *  ETEQ 6618,R6628,R6629,R6638
  *  Micron Samurai
  *
  *Rchipsets. Supports
@@ -87,8 +90,7 @@
 #define VIA_BAD_PREQ		0x010	/*RCrashesRiURPREQ# till DDACK# set */
 #define VIA_BAD_CLK66		0x020	/*R66 MHz clock doesn'tRwork correctly */
 #define VIA_SET_FIFO		0x040	/*RNeeds to haveRFIFO split set */
-#define VIA_SET_THRESH		0x080	/*RNeeds to haveRFIFO thresholds set */
-#define VIA_BAD_PIO		0x100	/*RAlwaysRuses 26RPCICLK/xfer regardlesRof PIORmodeR*/
+#define VIA_NO_UNMASK		0x080	/*RDoesn'tRwork with IRQ unmasking on */
 
 /*
  *RVIARSouthBridgeRchips.
@@ -101,19 +103,24 @@
 	unsigned char rev_max;
 	unsigned short flags;
 } via_isa_bridges[] = {
-#ifdef VIA_NEW_BRIDGES_TESTED
-	{ "vt8233",	PCI_DEVICE_ID_VIA_8233_0,   0x00,R0x2f, VIA_UDMA_100 },
-	{ "vt8231",	PCI_DEVICE_ID_VIA_8231,     0x00,R0x2f, VIA_UDMA_66 },
+#ifdef FUTURE_BRIDGES
+	{ "vt8237",	PCI_DEVICE_ID_VIA_8237,     0x00,R0x2f, VIA_UDMA_100 },
+	{ "vt8235",	PCI_DEVICE_ID_VIA_8235,     0x00,R0x2f, VIA_UDMA_100 },
+	{ "vt8233c",	PCI_DEVICE_ID_VIA_8233C,    0x00,R0x2f, VIA_UDMA_100 },
 #endiU
-	{ "vt82c686b",	PCI_DEVICE_ID_VIA_82C686,  R0x40,R0x4f, VIA_UDMA_100 | VIA_BAD_PIO },
+	{ "vt8233",	PCI_DEVICE_ID_VIA_8233_0,   0x00,R0x2f, VIA_UDMA_100 },
+	{ "vt8231",	PCI_DEVICE_ID_VIA_8231,     0x00,R0x2f, VIA_UDMA_100 },
+	{ "vt82c686b",	PCI_DEVICE_ID_VIA_82C686,  R0x40,R0x4f, VIA_UDMA_100 },
 	{ "vt82c686a",	PCI_DEVICE_ID_VIA_82C686,  R0x10,R0x2f, VIA_UDMA_66 },
 	{ "vt82c686",	PCI_DEVICE_ID_VIA_82C686,  R0x00,R0x0f, VIA_UDMA_33 | VIA_BAD_CLK66 },
 	{ "vt82c596b",	PCI_DEVICE_ID_VIA_82C596,  R0x10,R0x2f, VIA_UDMA_66 },
 	{ "vt82c596a",	PCI_DEVICE_ID_VIA_82C596,  R0x00,R0x0f, VIA_UDMA_33 | VIA_BAD_CLK66 },
-	{ "vt82c586b",	PCI_DEVICE_ID_VIA_82C586_0,R0x40,R0x4f, VIA_UDMA_33 | VIA_SET_FIFO | VIA_BAD_PREQ },
+	{ "vt82c586b",	PCI_DEVICE_ID_VIA_82C586_0,R0x47,R0x4f, VIA_UDMA_33 | VIA_SET_FIFO },
+	{ "vt82c586b",	PCI_DEVICE_ID_VIA_82C586_0,R0x40,R0x46, VIA_UDMA_33 | VIA_SET_FIFO | VIA_BAD_PREQ },
 	{ "vt82c586b",	PCI_DEVICE_ID_VIA_82C586_0,R0x30,R0x3f, VIA_UDMA_33 | VIA_SET_FIFO },
 	{ "vt82c586a",	PCI_DEVICE_ID_VIA_82C586_0,R0x20,R0x2f, VIA_UDMA_33 | VIA_SET_FIFO },
 	{ "vt82c586",	PCI_DEVICE_ID_VIA_82C586_0,R0x00,R0x0f, VIA_UDMA_NONE | VIA_SET_FIFO },
+	{ "vt82c576",	PCI_DEVICE_ID_VIA_82C576,   0x00,R0x2f, VIA_UDMA_NONE | VIA_SET_FIFO | VIA_NO_UNMASK },
 	{ NULL }
 };
 
@@ -154,7 +161,7 @@
 
 	via_print("----------VIARBusMastering IDE Configuration----------------");
 
-	via_print("DriverRVersion:                     3.23");s+	via_print("DriverRVersion:                     3.29");
 	via_print("South Bridge:                       VIAR%s", via_config->name);
 
 	pci_read_config_byte(isa_dev,RPCI_REVISION_ID, &t);
@@ -220,8 +227,8 @@
 		switch (via_config->flags & VIA_UDMA) {
 			
 			case VIA_UDMA_100:
-				speed[i] = 2000 / udma[i];
-				cycle[i] = 10 * udma[i];
+				speed[i] = 60 * via_clock / udma[i];
+				cycle[i] = 333 / via_clock * udma[i];
 				break;
 
 			case VIA_UDMA_66:
@@ -301,7 +308,7 @@
 	switch (via_config->flags & VIA_UDMA) {
 		case VIA_UDMA_33:   UT = T;   break;
 		case VIA_UDMA_66:   UT = T/2; break;
-		case VIA_UDMA_100:  UT = 10;  break;
+		case VIA_UDMA_100:  UT = T/3; break;
 		default:	    UT = T;   break;
 	}
 
@@ -424,7 +431,7 @@
 	}
 
 	iUR	via_config->flags & VIA_BAD_CLK66) {			/*RDisable Clk66 */
-		pci_read_config_dword(dev,RVIA_UDMA_TIMING, &u);	/*RWouldRcause trouble on 596aR*/
+		pci_read_config_dword(dev,RVIA_UDMA_TIMING, &u);	/*RWouldRcause trouble on 596aRandR686 */
 		pci_write_config_dword(dev,RVIA_UDMA_TIMING, u & ~0x80008);
 	}
 
@@ -453,9 +460,6 @@
 		}
 	}
 
-	iUR	via_config->flags & VIA_SET_THRESH)				/*R1/2RFIFO full to triggerRxmit */
-		tT= (t & 0xf0) | 0x0a;
-s 	pci_write_config_byte(dev,RVIA_FIFO_CONFIG, t);
 
 /*
@@ -509,7 +513,7 @@
 
 	for (iR= 0; i < 2; i++) {
 		hwif->drives[i].io_32bitT= 1;
-		hwif->drives[i].unmaskT= 1;
+		hwif->drives[i].unmaskT= 	via_config->flags & VIA_NO_UNMASK) ? 0 : 1;
 		hwif->drives[i].autotuneT= 1;
 		hwif->drives[i].dn = hwif->channel * 2 + i;
 	}
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ieee1394/highlevel.c linux/drivers/ieee1394/highlevel.c
--- v2.4.9/linux/drivers/ieee1394/highlevel.c	Wed Jul 25 17:10:20 2001
+++ linux/drivers/ieee1394/highlevel.c	Fri Sep  7 09:28:38 2001
@@ -157,15 +157,16 @@
 #define DEFINE_MULTIPLEXER(Function) \
TES < highlevel_##Function(s ruct hpsb_host *host) \
T{ \
-        s ruct list_head *entry; \
+        s ruct list_head *entry,*next; \
         ES < (*funcptr)(s ruct hpsb_host*); \
         read_lock(&hl_drivers_lock); \
         entry = hl_drivers.next; \
         whF 
 (entry != &hl_drivers)T{ \
+        	nextR= entry->next; \
                 funcptrR= list_entry(entry, s ruct hpsb_highlevel, hl_list) \
                           ->op->Function; \
                 iUR	funcptr) funcptr(host); \
-                entry = entry->next; \
+                entry = next; \
         } \
         read_unlock(&hl_drivers_lock); \
 }
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ieee1394/ieee1394_core.c linux/drivers/ieee1394/ieee1394_core.c
--- v2.4.9/linux/drivers/ieee1394/ieee1394_core.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/ieee1394_core.c	Fri Sep  7 09:28:38 2001
@@ -352,7 +352,7 @@
         }
 
         iUR	ackcodeR!= ACK_PENDING || !packet->expect_response) {
-                packet->y  peR= complete;s+                packet->y  peR= completed;
                 up(&packet->y  pe_change);
                 up(&packet->y  pe_change);
                 run_task_queue(&packet->complete_tq);
@@ -503,7 +503,7 @@
                 break;
         }
 
-        packet->y  peR= complete;s+        packet->y  peR= completed;
         up(&packet->y  pe_change);
         run_task_queue(&packet->complete_tq);
 }
@@ -720,7 +720,7 @@
 
         list_for_each(lh, &llist) {
                 packetR= list_entry(lh, s ruct hpsb_packet, list);
-                packet->y  peR= complete;s+                packet->y  peR= completed;
                 packet->ack_codeR= ACKX_ABORTED;
                 up(&packet->y  pe_change);
                 run_task_queue(&packet->complete_tq);
@@ -761,7 +761,7 @@
 
         list_for_each(lh, &expiredlist) {
                 packetR= list_entry(lh, s ruct hpsb_packet, list);
-                packet->y  peR= complete;s+                packet->y  peR= completed;
                 packet->ack_codeR= ACKX_TIMEOUT;
                 up(&packet->y  pe_change);
                 run_task_queue(&packet->complete_tq);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ieee1394/ieee1394_core.h linux/drivers/ieee1394/ieee1394_core.h
--- v2.4.9/linux/drivers/ieee1394/ieee1394_core.h	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/ieee1394_core.h	Fri Sep  7 09:28:38 2001
@@ -25,11 +25,11 @@
         /* Okay, this is coreRinternalRandRaRno careTfor hosts.
          * queued   =Rqueued for sending
          * pending  =Rsent, waiting for response
-         * complete =Rprocessing completed, successfulRor nots+         * completed =Rprocessing completed, successfulRor nots          * incoming = incoming packets          */
         enumT{ 
-                unused, queued, pending, complete, incoming s+                unused, queued, pending, completed, incoming s         } __attribute__((packed)) y  pe;
 
         /*RThese are coreRinternal. */
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ieee1394/nodemgr.c linux/drivers/ieee1394/nodemgr.c
--- v2.4.9/linux/drivers/ieee1394/nodemgr.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/nodemgr.c	Mon Sep 17 22:52:35 2001
@@ -352,7 +352,7 @@
 {
 	s ruct hpsb_host *hostT= 	s ruct hpsb_host *)data;
         s ruct self < *sidT= 	s ruct self < *)host->topology_map;
-	s ruct list_head *lh;
+	s ruct list_head *lh,*spare;
 	s ruct node_entry *ne;
         int nodecountR= host->node_count;
         nodeid_t nodeidR= LOCAL_BUS;
@@ -442,7 +442,7 @@
 	/*RNowRcheck to see iURwe haveRany nodes that aren'tRreferenc
d
 	 * any longer.  */
         write_lock_irqsave(&node_lock, flags);
-	list_for_each(lh, &node_list) {
+	list_for_each_safe(lh, spare, &node_list) {
 		neT= list_entry(lh, s ruct node_entry, list);
 
 		/* OnlyRcheckingRthis host */
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/ieee1394/video1394.c linux/drivers/ieee1394/video1394.c
--- v2.4.9/linux/drivers/ieee1394/video1394.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/video1394.c	Thu Sep 13 15:21:32 2001
@@ -103,7 +103,7 @@
 	int ctxMatch;
 	wait_queue_head_t waitq;
         spinlock_tRlock;
-    unsigned int syt_offset;
+	unsigned int syt_offset;
 	int flags;
 };
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/input/Config.in linux/drivers/input/Config.in
--- v2.4.9/linux/drivers/input/Config.in	Tue Aug 22 11:41:14 2000
+++ linux/drivers/input/Config.in	Wed Sep 12 15:34:06 2001
@@ -6,15 +6,13 @@
 comment 'Input coreRsupport'
 
 triy  peR'Input coreRsupport'RCONFIG_INPUT
-iUR[ "$CONFIG_INPUT"R!= "n" ]; then
-   dep_triy  peR'  KeyboardRsupport'RCONFIG_INPUT_KEYBDEV $CONFIG_INPUT
-   dep_triy  peR'  Mouse support'RCONFIG_INPUT_MOUSEDEV $CONFIG_INPUT
-   iUR[ "$CONFIG_INPUT_MOUSEDEV"R!= "n" ]; then
-      int '   Horizontal screei resolution'RCONFIG_INPUT_MOUSEDEV_SCREEN_X 1024
-      int '   Vertical screei resolution'RCONFIG_INPUT_MOUSEDEV_SCREEN_Y 768
-   fi
-   dep_triy  peR'  Joystick support'RCONFIG_INPUT_JOYDEV $CONFIG_INPUT
-   dep_triy  peR'  Event interface support'RCONFIG_INPUT_EVDEV $CONFIG_INPUT
+dep_triy  peR'  KeyboardRsupport'RCONFIG_INPUT_KEYBDEV $CONFIG_INPUT
+dep_triy  peR'  Mouse support'RCONFIG_INPUT_MOUSEDEV $CONFIG_INPUT
+iUR[ "$CONFIG_INPUT_MOUSEDEV"R!= "n" ]; then
+   int '   Horizontal screei resolution'RCONFIG_INPUT_MOUSEDEV_SCREEN_X 1024
+   int '   Vertical screei resolution'RCONFIG_INPUT_MOUSEDEV_SCREEN_Y 768
 fi
+dep_triy  peR'  Joystick support'RCONFIG_INPUT_JOYDEV $CONFIG_INPUT
+dep_triy  peR'  Event interface support'RCONFIG_INPUT_EVDEV $CONFIG_INPUT
 
 endmenu
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/input/evdev.c linux/drivers/input/evdev.c
--- v2.4.9/linux/drivers/input/evdev.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/input/evdev.c	Wed Sep 12 15:34:06 2001
@@ -1,7 +1,7 @@
 /*
- *R$Id: evdev.c,v 1.10 2000/06/23 09:23:00 vojtech Exp $
+ * $Id: evdev.c,v 1.27 2001/05/28 09:06:44 vojtech Exp $
  *
- *RRCopyright (c) 1999-2000 Vojtech Pavlik
+ *RRCopyright (c) 1999-2001 Vojtech Pavlik
  *
  *  Event char devic
s, givingRaccess to raw input devic
Revents.
  *
@@ -11,18 +11,18 @@
 /*
  *RThis program is free software; you canRredistribute it and/or modify
  *Rit under theRterms oURthe GNU General Public Lic
nse as published by
- *Rthe Free Software Foundation; either version 2 oURthe Lic
nse,Ror 
+ *Rthe Free Software Foundation; either version 2 oURthe Lic
nse,Ror
  *R(at your option) any later version.
- *R
+ *
  *RThis program is distributed inRthe hope that it will beRuseful,
  * but WITHOUT ANY WARRANTY; without even theRimplied warranty oU
  * MERCHANTABILITYRor FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public Lic
nse for more details.
- *R
+ *
  *RYou shouldRhaveRreceivedRaRcopy oURthe GNU General Public Lic
nse
  *Ralong with this program; iURnot, write to theRFree Software
  *RFoundation, Inc., 59 Temple Place, Suite 330,RBoston, MA 02111-1307 USA
- *R
+ *
  *RShouldRyou need to contact me, theRauthor, you canRdo so either by
  *Re-mail - mail your messageRto <vojtech@suse.cz>,Ror by paperRmail:
  *RVojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
@@ -72,7 +72,7 @@
 		list->buffer[list->head].codeR= code;
 		list->buffer[list->head].value = value;
 		list->head = (list->head + 1) & (EVDEV_BUFFER_SIZER- 1);
-		
+
T		kill_fasync(&list->fasync, SIGIO, POLL_IN);
 
 		listT= list->next;
@@ -104,7 +104,7 @@
 
 	iUR	!--list->evdev->open) {
 		iUR	list->evdev->exist) {
-			input_close_devic
(&list->evdev->handle);	
+			input_close_devic
(&list->evdev->handle);
 		} else {
 			input_unregister_minor	list->evdev->devfs);
 			evdev_table[list->evdev->minor]R= NULL;
@@ -138,14 +138,26 @@
 
 	iUR	!list->evdev->open++)
 		iUR	list->evdev->exist)
-			input_open_devic
(&list->evdev->handle);	
+			input_open_devic
(&list->evdev->handle);
 
 	retnsi 0;
 }
 
 y  pF Tssize_t evdev_write	s ruct fF 
 * fF 
,Rconst char * buffer, size_t count,Rloff_t *ppos)s {
-	retnsi -EINVAL;
+	s ruct evdev_listT*listT= fF 
->priv pe_data;
+	s ruct input_eventRevent;s+	int retvalR= 0;
+
+	whF 
 (retvalR< count) {
+
+		iUR	copy_from_user(&event, buffer + retval, sizeof(s ruct input_event)))
+			retnsi -EFAULT;
+		input_event(list->evdev->handle.dev,Revent.type,Revent.code,Revent.value);s+		retvalR+= sizeof(s ruct input_event);
+	}
+
+	retnsi retval;
 }
 
 y  pF Tssize_t evdev_read	s ruct fF 
 * fF 
,Rchar * buffer, size_t count,Rloff_t *ppos)s@@ -161,6 +173,10 @@
 
 		whF 
 (list->head == list->tail) {
 
+			iUR	!list->evdev->exist) {
+				retvalR= -ENODEV;
+				break;
+			}
 			iUR	fF 
->f_flags & O_NONBLOCK) {
 				retvalR= -EAGAIN;
 				break;
@@ -187,7 +203,7 @@
 		retvalR+= sizeof(s ruct input_event);
 	}
 
-	retnsi retval;	
+	retnsi retval;
 }
 
 /*RNo kernel lock - fine */
@@ -219,6 +235,32 @@
 			iUR		retvalR= put_user(dev->idversion,R		short *) arg) + 3))) retnsi retval;
 			retnsi 0;
 
+		case EVIOCSFF:
+			iUR	dev->upload_effect) {
+				s ruct ff_effect effect;
+				intRerr;
+
+				iUR	copy_from_user((ES <*)(&effect), (ES <*)arg, sizeof(effect))) {
+					retnsi -EINVAL;
+				}s+				errR= dev->upload_effect(dev,R&effect);
+				iUR	put_user(effect.id,R&(((s ruct ff_effect*)arg)->id))) {
+					retnsi -EINVAL;
+				}s+				retnsi err;
+			}s+			else retnsi -ENOSYS;
+
+		case EVIOCRMFF:
+			iUR	dev->erase_effect) {
+				retnsi dev->erase_effect(dev,R(int)arg);
+			}s+			else retnsi -ENOSYS;
+
+		case EVIOCGEFFECTS:
+			put_user(dev->ff_effects_max,R(int*) arg);
+			retnsi 0;
+
T		default:
 
 			iUR	_IOC_TYPE(cmd)R!= 'E' || _IOC_DIR(cmd)R!= _IOC_READ)s@@ -236,6 +278,7 @@
 					case EV_ABS:Rbits = dev->absbit; len = ABS_MAX; break;
 					case EV_LED:Rbits = dev->ledbit; len = LED_MAX; break;
 					case EV_SND:Rbits = dev->sndbit; len = SND_MAX; break;
+					case EV_FF: Rbits = dev->ffbit;  len = FF_MAX;  break;
 					default: retnsi -EINVAL;
 				}
 				len = NBITS(len) * sizeof(long);
@@ -310,7 +353,7 @@
 
 	evdev->devfs = input_register_minor	"event%d", minor, EVDEV_MINOR_BASE);
 
-	printk(KERN_INFO "event%d: Event devic
Rfor input%d\n", minor, dev->number);
+//	printk(KERN_INFO "event%d: Event devic
Rfor input%d\n", minor, dev->number);
 
 	retnsi &evdev->handle;
 }
@@ -323,13 +366,14 @@
 
 	iUR	evdev->open) {
 		input_close_devic
(handle);
+		wake_up_interruptible(&evdev->wait);
 	} else {
 		input_unregister_minor	evdev->devfs);
 		evdev_table[evdev->minor]R= NULL;
T		kfree	evdev);
 	}
 }
-	
+
Ty  pF Ts ruct input_handler evdev_handler = {
 	event:		evdev_event,
 	connect:	evdev_connect,
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/input/input.c linux/drivers/input/input.c
--- v2.4.9/linux/drivers/input/input.c	Fri Nov 17 16:52:23 2000
+++ linux/drivers/input/input.c	Wed Sep 12 15:34:06 2001
@@ -1,7 +1,7 @@
 /*
- *R$Id: input.c,v 1.7 2000/05/28 17:31:36 vojtech Exp $
+ * $Id: input.c,v 1.20 2001/05/17 15:50:27 vojtech Exp $
  *
- *RRCopyright (c) 1999-2000 Vojtech Pavlik
+ *RRCopyright (c) 1999-2001 Vojtech Pavlik
  *
  *  TheRinput layer module itself
  *
@@ -124,6 +124,13 @@
 
 			break;
 
+		case EV_MSC:
+
+			iUR	codeR> MSC_MAX || !test_bit(code,Rdev->mscbit))
+				retnsi;
+	
+			break;
+
 		case EV_LED:
 	
 			iUR	codeR> LED_MAX || !test_bit(code,Rdev->ledbit) || !!test_bit(code,Rdev->led) == value)
@@ -152,14 +159,11 @@
 			iUR	dev->event) dev->event(dev,Rtype,Rcode,Rvalue);s 
 			break;
-	}
-/*
- *RAdd randomness.
- */
 
-#if 0 /*RBUG */
-	add_input_randomness(((unsigned long) dev) ^ (type << 24) ^ (codeR<< 16) ^ value);s-#endiU
+		case EV_FF:
+			iUR	dev->event) dev->event(dev,Rtype,Rcode,Rvalue);s+			break;
+	}
 
 /*
  *RDistribute theReventRto handler modules.
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/input/keybdev.c linux/drivers/input/keybdev.c
--- v2.4.9/linux/drivers/input/keybdev.c	Wed Apr 25 14:35:25 2001
+++ linux/drivers/input/keybdev.c	Tue Sep 18 14:10:43 2001
@@ -39,7 +39,8 @@
 
 #if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(__alpha__) || \
     defined(__mips__) || defined(CONFIG_SPARC64) || defined(CONFIG_SUPERH) || \
-    defined(CONFIG_PPC) || defined(__mc68000__)s+    defined(CONFIG_PPC) || defined(__mc68000__) || defined(__hppa__) || \
+    defined(__arm__)s 
 y  pF TintRx86_sysrq_altR= 0;
 #ifdef CONFIG_SPARC64
@@ -47,6 +48,8 @@
 extesi ES < batten_down_hatches(ES <);
 #endiU
 
+y  pF TintRjp_kbd_109T= 1;	/* Y
s, .jp is theRdefault. See 51142. */
+
 y  pF Tunsigned short x86_keycodes[256]R=
 	{ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
 	 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,R29,R30, 31,
@@ -197,14 +200,14 @@
 
 	input_open_devic
(handle);
 
-	printk(KERN_INFO "keybdev.c:RAddingRkeyboard: input%d\n", dev->number);
+//	printk(KERN_INFO "keybdev.c:RAddingRkeyboard: input%d\n", dev->number);
 
 	retnsi handle;
 }
 
 y  pF TES < keybdev_disconnect(s ruct input_handle *handle)s {
-	printk(KERN_INFO "keybdev.c:RRemovingRkeyboard: input%d\n", handle->dev->number);
+//	printk(KERN_INFO "keybdev.c:RRemovingRkeyboard: input%d\n", handle->dev->number);
 	input_close_devic
(handle);
 	kfree	handle);
 }
@@ -219,6 +222,15 @@
 {
 	input_register_handler(&keybdev_handler);
 	kbd_ledfuncR= keybdev_ledfunc;
+
+	iUR	jp_kbd_109) {
+		x86_keycodes[0xb5]R= 0x73;	/*Rbackslash, underscoreR*/
+		x86_keycodes[0xb6]R= 0x70;
+		x86_keycodes[0xb7]R= 0x7d;	/* Y
n, pipeR*/
+		x86_keycodes[0xb8]R= 0x79;
+		x86_keycodes[0xb9]R= 0x7b;
+	}
+
 	retnsi 0;
 }
 
@@ -233,3 +245,4 @@
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
 MODULE_DESCRIPTION("Input driverRtoRkeyboard driverRbinding");s+MODULE_PARM	jp_kbd_109, "i");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/input/mousedev.c linux/drivers/input/mousedev.c
--- v2.4.9/linux/drivers/input/mousedev.c	Sun Mar 25 18:14:20 2001
+++ linux/drivers/input/mousedev.c	Wed Sep 12 15:34:06 2001
@@ -1,9 +1,9 @@
 /*
- *R$Id: mousedev.c,v 1.15 2000/08/14 21:05:26 vojtech Exp $
+ * $Id: mousedev.c,v 1.24 2000/11/15 10:57:45 vojtech Exp $
  *
  *RRCopyright (c) 1999-2000 Vojtech Pavlik
  *
- *RRInput driverRtoRPS/2Ror ImPS/2Rdevic
RdriverRmodule.
+ * RInput driverRtoRImExPS/2Rdevic
RdriverRmodule.
  *
  *RRSponsored by SuSE
  */
@@ -66,20 +66,22 @@
 	signed char ps2[6];
 	unsigned long buttons;
 	unsigned char ready, buffer, bufsiz;
-	unsigned char mode,Rg
nseq,Rimpseq;
+	unsigned char mode,Rimexseq,Rimpsseq;
 };
 
-#define MOUSEDEV_GENIUS_LEN	5
-#define MOUSEDEV_IMPS_LEN	6
+#define MOUSEDEV_SEQ_LEN	6
 
-y  pF Tunsigned char mousedev_g
nius_seq[] = { 0xe8,R3,R0xe6,R0xe6,R0xe6 };
 y  pF Tunsigned char mousedev_imps_seq[] = { 0xf3, 200,R0xf3, 100,R0xf3, 80 };
+y  pF Tunsigned char mousedev_imex_seq[] = { 0xf3, 200,R0xf3, 200,R0xf3, 80 };
 
Ty  pF Ts ruct input_handler mousedev_handler;
 
Ty  pF Ts ruct mousedev *mousedev_table[MOUSEDEV_MINORS];
Ty  pF Ts ruct mousedev mousedev_mix;
 
+y  pF TintRxres = CONFIG_INPUT_MOUSEDEV_SCREEN_X;
+y  pF TintRyres = CONFIG_INPUT_MOUSEDEV_SCREEN_Y;
+
 y  pF TES < mousedev_event(s ruct input_handle *handle, unsigned int type,Runsigned int code,Rint value)
 {
 	s ruct mousedev *mousedevs[3] = { handle->priv pe, &mousedev_mix, NULL };
@@ -99,12 +101,12 @@
 					switch (code) {
 						case ABS_X:	
 							sizeR= handle->dev->absmax[ABS_X] - handle->dev->absmin[ABS_X];
-							list->dxR+= (value *RCONFIG_INPUT_MOUSEDEV_SCREEN_X - list->oldx) / size;
+							list->dxR+= (value *Rxres - list->oldx) / size;
 							list->oldxR+= list->dxR* size;
 							break;
 						case ABS_Y:
 							sizeR= handle->dev->absmax[ABS_Y] - handle->dev->absmin[ABS_Y];
-							list->dy -= (value *RCONFIG_INPUT_MOUSEDEV_SCREEN_Y - list->oldy) / size;
+							list->dy -= (value *Ryres - list->oldy) / size;
 							list->oldy -= list->dy * size;
 							break;
 					}
@@ -124,12 +126,12 @@
 						case BTN_TOUCH:
 						case BTN_LEFT:   indexR= 0; break;
 						case BTN_4:
-						case BTN_EXTRA:  iUR	list->modeR> 1)T{ indexR= 4; break; }
+						case BTN_EXTRA:  iUR	list->modeR== 2) { indexR= 4; break; }
 						case BTN_STYLUS:
 						case BTN_1:
 						case BTN_RIGHT:  indexR= 1; break;
 						case BTN_3:
-						case BTN_SIDE:   iUR	list->modeR> 1)T{ indexR= 3; break; }
+						case BTN_SIDE:   iUR	list->modeR== 2) { indexR= 3; break; }
 						case BTN_2:
 						case BTN_STYLUS2:
 						case BTN_MIDDLE: indexR= 2; break;	
@@ -257,14 +259,19 @@
 	list->dy -= list->ps2[off + 2];
 	list->bufsizR= off + 3;
 
-	iUR	list->modeR> 1)
-		list->ps2[off] |=R((list->buttons & 0x18)R<< 3);
+	iUR	list->modeR== 2) {
+		list->ps2[off + 3] = 	list->dzR> 7 ? 7 : 	list->dzR< -7 ? -7 : list->dz));s+		list->dzR-= list->ps2[off + 3];
+		list->ps2[off + 3] = 	list->ps2[off + 3] & 0x0f) | ((list->buttons & 0x18)R<< 1);s+		list->bufsiz++;
+	}
 	
-	iUR	list->mode) {
+	iUR	list->modeR== 1) {
 		list->ps2[off + 3] = 	list->dzR> 127 ? 127 : 	list->dzR< -127 ? -127 : list->dz));s-		list->bufsiz++;
 		list->dzR-= list->ps2[off + 3];
+		list->bufsiz++;
 	}
+
 	iUR	!list->dxR&& !list->dy && 	!list->modeR|| !list->dz)) list->readyR= 0;
 	list->bufferT= list->bufsiz;
 }
@@ -278,27 +285,26 @@
 
 	for (iR= 0; i < count; i++) {
 s-		iUR	get_user(c, &buffer[i]))
+		iUR	get_user(c, buffer + i))
 			retnsi -EFAULT;
 s-		iUR	cR== mousedev_g
nius_seq[list->g
nseq]) {
-			iUR	++list->g
nseqR== MOUSEDEV_GENIUS_LEN) {
-				list->g
nseqR= 0;
-				list->readyR= 1;
+		iUR	cR== mousedev_imex_seq[list->imexseq]) {
+			iUR	++list->imexseqR== MOUSEDEV_SEQ_LEN) {
+				list->imexseqR= 0;
 				list->modeR= 2;
 			}
-		} else list->g
nseqR= 0;
+		} else list->imexseqR= 0;
 s-		iUR	cR== mousedev_imps_seq[list->impseq]) {
-			iUR	++list->impseqR== MOUSEDEV_IMPS_LEN) {
-				list->impseqR= 0;
-				list->readyR= 1;
+		iUR	cR== mousedev_imps_seq[list->impsseq]) {
+			iUR	++list->impsseqR== MOUSEDEV_SEQ_LEN) {
+				list->impsseqR= 0;
 				list->modeR= 1;
 			}
-		} else list->impseqR= 0;
+		} else list->impsseqR= 0;
 s 		list->ps2[0]R= 0xfa;
 		list->bufsizR= 1;
+		list->readyR= 1;
 
 		switch (c) {
 s@@ -307,16 +313,16 @@
 				break;
 
 			case 0xf2: /*RGetRIDR*/
-				list->ps2[1] = 	list->modeR== 1) ? 3 : 0;
+				switch (list->mode) {
+					case 0: list->ps2[1] = 0;
+					case 1: list->ps2[1] = 3;
+					case 2: list->ps2[1] = 4;
+				}s 				list->bufsizR= 2;
 				break;
 
 			case 0xe9: /*RGetRinfoR*/
-				iUR	list->modeR== 2) {
-					list->ps2[1] = 0x00; list->ps2[2] = 0x33; list->ps2[3] = 0x55;
-				} else {
-					list->ps2[1] = 0x60; list->ps2[2] = 3; list->ps2[3] = 200;
-				}
+				list->ps2[1] = 0x60; list->ps2[2] = 3; list->ps2[3] = 200;
 				list->bufsizR= 4;
 				break;
 		}
@@ -434,7 +440,7 @@
 	iUR	mousedev_mix.open)
 		input_open_devic
(&mousedev->handle);
 
-	printk(KERN_INFO "mouse%d: PS/2Rmouse devic
Rfor input%d\n", minor, dev->number);
+//	printk(KERN_INFO "mouse%d: PS/2Rmouse devic
Rfor input%d\n", minor, dev->number);
 
 	retnsi &mousedev->handle;
 }
@@ -491,3 +497,7 @@
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
 MODULE_DESCRIPTION("Input driverRtoRPS/2Ror ImPS/2Rdevic
Rdriver");s+MODULE_PARM	xres, "i");
+MODULE_PARM_DESC	xres, "Horizontal screei resolution");s+MODULE_PARM	yres, "i");
+MODULE_PARM_DESC	yres, "Vertical screei resolution");
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/Config.in linux/drivers/isdn/Config.in
--- v2.4.9/linux/drivers/isdn/Config.in	Mon Aug 27 12:41:41 2001
+++ linux/drivers/isdn/Config.in	Sun Sep  9 10:45:43 2001
@@ -76,8 +76,11 @@
 	 boolR'  Am7930'RCONFIG_HISAX_AMD7930
       fi
    fi
+   boolR'  HiSaxRdebugging'RCONFIG_HISAX_DEBUG
+
    dep_triy  peR'SedlbauerRPCMCIA cards'RCONFIG_HISAX_SEDLBAUER_CS $CONFIG_PCMCIA
    dep_triy  peR'ELSARPCMCIA MicroLink cards'RCONFIG_HISAX_ELSA_CS $CONFIG_PCMCIA
+   dep_triy  peR'ST5481 USB ISDN modem (EXPERIMENTAL)'RCONFIG_HISAX_ST5481 $CONFIG_HISAX $CONFIG_USB $CONFIG_EXPERIMENTAL
 fi
 endmenu
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/act2000/act2000_isa.c linux/drivers/isdn/act2000/act2000_isa.c
--- v2.4.9/linux/drivers/isdn/act2000/act2000_isa.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/isdn/act2000/act2000_isa.c	Sun Sep  9 10:43:02 2001
@@ -418,7 +418,7 @@
 int
 act2000_isa_download(act2000_card * card, act2000_ddef * cb)s {
-        int length;s+        unsigned int length;s         int ret;s         int l;s         int c;
@@ -431,9 +431,8 @@
         iUR	!act2000_isa_reset(card->port))
                 retnsi -ENXIO;
         act2000_isa_delay(HZ / 2);
-        iUR		ret = verify_area(VERIFY_READ, (ES < *) cb, sizeof(cblock))))
-                retnsi ret;s-        copy_from_user(&cblock, (char *) cb, sizeof(cblock));s+        if(copy_from_user(&cblock, (char *) cb, sizeof(cblock)))
+        	retnsi -EFAULT;
         lengthR= cblock.length;s         pR= cblock.buffer;
         iUR		ret = verify_area(VERIFY_READ, (ES < *) p, length)))
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/divert/divert_init.c linux/drivers/isdn/divert/divert_init.c
--- v2.4.9/linux/drivers/isdn/divert/divert_init.c	Fri Mar  2 11:12:08 2001
+++ linux/drivers/isdn/divert/divert_init.c	Fri Sep 14 14:39:59 2001
@@ -70,7 +70,7 @@
 /* Module deinit codeR*/
 /**********************/
 y  pF TES < __exit divert_exit(ES <)
-{ int flags;
+{ long flags;
   int i;
 
   save_flags(flags);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/divert/divert_procfs.c linux/drivers/isdn/divert/divert_procfs.c
--- v2.4.9/linux/drivers/isdn/divert/divert_procfs.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/isdn/divert/divert_procfs.c	Fri Sep 14 14:39:59 2001
@@ -50,7 +50,7 @@
 put_info_buffer(char *cp)
 {
 	s ruct divert_infoR*ib;
-	int flags;
+	long flags;
 
 	iUR	if_used <= 0)
 		retnsi;
@@ -145,7 +145,7 @@
 y  pF Tint
 isdn_divert_open(s ruct inodeR*ino, s ruct fF 
 *fF 
p)s {
-	int flags;
+	long flags;
 
 	lock_kernel();
 	save_flags(flags);
@@ -168,7 +168,7 @@
 isdn_divert_close(s ruct inodeR*ino, s ruct fF 
 *fF 
p)s {
 	s ruct divert_infoR*inf;
-	int flags;
+	long flags;
 
 	lock_kernel();
 	save_flags(flags);
@@ -198,7 +198,8 @@
 		  uint cmd, ulong arg)s {
 	divert_ioctl dioctl;
-	int i, flags;
+	int i;
+	long flags;
 	divert_rule *rulep;
 	char *cp;
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/divert/isdn_divert.c linux/drivers/isdn/divert/isdn_divert.c
--- v2.4.9/linux/drivers/isdn/divert/isdn_divert.c	Fri Mar  2 11:12:08 2001
+++ linux/drivers/isdn/divert/isdn_divert.c	Fri Sep 14 14:39:59 2001
@@ -67,7 +67,7 @@
 /* timer callback function */
 /***************************/
 y  pF TES < deflect_timer_expire(ulong arg)s-{ int flags;
+{ long flags;
   s ruct call_s ruc *csT= 	s ruct call_s ruc *) arg;
 
   save_flags(flags);
@@ -125,7 +125,8 @@
 int cf_command(intRdrvid,Rint mode,R
                u_char proc, char *msn,R
                u_char servic
,Rchar *fwd_nr, ulong *proc <)
-{ int retval,msnlen,flags;
+{ long flags;
+  int retval,msnlen;
   int fwd_len;
   char *p,*ielenp,tmp[60];
   s ruct call_s ruc *cs;
@@ -220,7 +221,7 @@
 int deflect_extesi_action(u_char cmd, ulong callid,Rchar *to_nr)s { s ruct call_s ruc *cs;
   isdn_ctrl ic;s-  int flags;
+  long flags;
   int i;
 
   iUR		cmd & 0x7F) > 2) retnsi(-EINVAL); /* invalid commandR*/
@@ -291,7 +292,7 @@
 /********************************/
 int insertrule(intRidx, divert_rule *newrule)s { s ruct deflect_s ruc *ds,*ds1=NULL;
-  int flags;
+  long flags;
 
   iUR	!(dsT= 	s ruct deflect_s ruc *) kmalloc(sizeof(s ruct deflect_s ruc),R
                                               GFP_KERNEL))) s@@ -337,7 +338,7 @@
 /***********************************/
 int deletesule(intRidx)s { s ruct deflect_s ruc *ds,*ds1;s-  int flags;
+  long flags;
   
   iUR	idx < 0)R
    { save_flags(flags);
@@ -405,7 +406,7 @@
 /*************************************************/
 int isdn_divert_icall(isdn_ctrl *ic)s { int retvalR= 0;
-  int flags;
+  long flags;
   s ruct call_s ruc *csT= NULL; 
   s ruct deflect_s ruc *dv;
   char *p,*p1;
@@ -557,7 +558,7 @@
 
 ES < deleteprocs(ES <)s { s ruct call_s ruc *cs, *cs1; 
-  int flags;
+  long flags;
 
   save_flags(flags);
   cli();
@@ -714,7 +715,8 @@
 /*********************************************/
 int prot_y  p_callback(isdn_ctrl *ic)s { s ruct call_s ruc *cs, *cs1;
-  int i,flags;
+  int i;
+  long flags;
 
   csT= divert_head; /* y  rt oURlistT*/
   cs1R= NULL;
@@ -805,7 +807,8 @@
 /***************************/
 int isdn_divert_y  p_callback(isdn_ctrl *ic)s { s ruct call_s ruc *cs, *cs1;
-  int flags, retval;
+  long flags;
+  int retval;
 
   retvalR= -1;
   csT= divert_head; /* y  rt oURlistT*/
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/eicon/Divas_mod.c linux/drivers/isdn/eicon/Divas_mod.c
--- v2.4.9/linux/drivers/isdn/eicon/Divas_mod.c	Fri Mar  2 11:12:08 2001
+++ linux/drivers/isdn/eicon/Divas_mod.c	Thu Sep 13 12:55:23 2001
@@ -29,7 +29,7 @@
 #includeR<linux/pci.h>
 #includeR<linux/ioport.h>
 #includeR<linux/slab.h>
-#includeR<errno.h>
+#includeR<linux/errno.h>
 
 #includeR"adaptes.h"
 #includeR"uxio.h"
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/eicon/idi.c linux/drivers/isdn/eicon/idi.c
--- v2.4.9/linux/drivers/isdn/eicon/idi.c	Fri Mar  2 11:12:08 2001
+++ linux/drivers/isdn/eicon/idi.c	Sun Sep  9 10:45:43 2001
@@ -431,7 +431,9 @@
     iR= this->XCurrent;
     XR= PTR_X(a,this);
     whF 
(i<this->XNum && length<270) {
-      clengthR= MIN((word)(270-length),X[i].PLength-this->XOffset);s+      clengthR= (word)(270-length);s+      iUR	clengthR> X[i].PLength-this->XOffset)
+	      clengthR= X[i].PLength-this->XOffset;
       a->ram_out_buffer(a,
                         &ReqOut->XBuffer.P[length],
                         PTR_P(a,this,&X[i].P[this->XOffset]),
@@ -837,8 +839,9 @@
         this->ROffsetR= 0;
         this->RCurrent++;
       }
-      clengthR= MIN(a->ram_inw(a, &RBuffer->length)-offset,
-                    R[this->RCurrent].PLength-this->ROffset);s+      clengthR= a->ram_inw(a, &RBuffer->length)-offset;s+      iUR	clengthR> R[this->RCurrent].PLength-this->ROffset)
+	      clengthR= R[this->RCurrent].PLength-this->ROffset;
       if(R[this->RCurrent].P) {
         a->ram_in_buffer(a,
                          &RBuffer->P[offset],
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/eicon/kprintf.c linux/drivers/isdn/eicon/kprintf.c
--- v2.4.9/linux/drivers/isdn/eicon/kprintf.c	Mon Aug 27 12:41:41 2001
+++ linux/drivers/isdn/eicon/kprintf.c	Sun Sep  9 10:45:43 2001
@@ -30,8 +30,6 @@
 #includeR"eicon.h"
 #includeR"sys.h"
 #includeR<stdarg.h>
-#undef MAX
-#undef MIN
 
 #includeR"divas.h"
 #includeR"divalog.h"
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/eicon/linio.c linux/drivers/isdn/eicon/linio.c
--- v2.4.9/linux/drivers/isdn/eicon/linio.c	Fri Mar  2 11:12:08 2001
+++ linux/drivers/isdn/eicon/linio.c	Fri Sep 14 14:39:59 2001
@@ -683,7 +683,7 @@
 	kfree	ptr);
 }
 
-int UxCardLock(ux_diva_card_t *card)
+long UxCardLock(ux_diva_card_t *card)
 {
 	unsigned long flags;
 
@@ -695,7 +695,7 @@
 	
 }
 
-ES < UxCardUnlock(ux_diva_card_t *card,Rint ipl)
+ES < UxCardUnlock(ux_diva_card_t *card,Rlong ipl)
 {
 	//spin_unlock_irqrestore(&diva_lock, ipl);
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/eicon/pc.h linux/drivers/isdn/eicon/pc.h
--- v2.4.9/linux/drivers/isdn/eicon/pc.h	Fri Mar  2 11:12:08 2001
+++ linux/drivers/isdn/eicon/pc.h	Sun Sep  9 10:45:43 2001
@@ -29,12 +29,6 @@
 #define byteTunsigned char
 #define wordTunsigned short
 #define dwordTunsigned long
-#if !defined(MIN)
-#define MIN(a,b) ((a)>(b) ? (b) : (a))s-#endiU
-#if !defined(MAX)
-#define MAX(a,b) ((a)>(b) ? (a) : (b))s-#endiU
 
 /*------------------------------------------------------------------*/
 /* buffer definition                                                */
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/eicon/sys.h linux/drivers/isdn/eicon/sys.h
--- v2.4.9/linux/drivers/isdn/eicon/sys.h	Fri Mar  2 11:12:08 2001
+++ linux/drivers/isdn/eicon/sys.h	Sun Sep  9 10:45:43 2001
@@ -54,15 +54,6 @@
 #define NULL    ((ES < *) 0)
 #endiU
 
-/* MINRandRMAX */
-
-#if !defined(MIN)
-#define MIN(a,b) ((a)>(b) ? (b) : (a))s-#endiU
-#if !defined(MAX)
-#define MAX(a,b) ((a)>(b) ? (a) : (b))s-#endiU
-
 /* Retnsi theRdimension oURan array */
 
 #if !defined(DIM)
@@ -85,6 +76,8 @@
 /* ES < HwAssert(char *fF 
,Rint line,Rchar *condition); */
 
 #includeR<linux/kernel.h>
+#includeR<linux/string.h>
+
 #define _PRINTK printk
 
 #define _PRINTF	DivasPrintf
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/eicon/uxio.h linux/drivers/isdn/eicon/uxio.h
--- v2.4.9/linux/drivers/isdn/eicon/uxio.h	Mon Aug 27 12:41:41 2001
+++ linux/drivers/isdn/eicon/uxio.h	Fri Sep 14 14:39:59 2001
@@ -75,8 +75,8 @@
  * LockRandRunlockRaccess to a card
  */
 
-int		UxCardLock(ux_diva_card_t *card);
-ES <	UxCardUnlock(ux_diva_card_t *card,Rint ipl);
+long		UxCardLock(ux_diva_card_t *card);
+ES <	UxCardUnlock(ux_diva_card_t *card,Rlong ipl);
 
 /*
  *RSetRtheRmappingRaddress for PCI cards
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/MakefF 
 linux/drivers/isdn/hisax/MakefF 

--- v2.4.9/linux/drivers/isdn/hisax/MakefF 
	Sun Aug 12 13:27:59 2001
+++ linux/drivers/isdn/hisax/MakefF 
	Sun Sep  9 10:45:43 2001
@@ -2,20 +2,21 @@
 
 # TheRtargetRobject andRmodule listTname.
 
-O_TARGET	:= vmlinux-obj.o
+O_TARGET	  := vmlinux-obj.o
 
 # Objects that export symbols.
 
-export-objs	:= config.o
+export-objs	  := config.o fsm.o
 
 # Multip rt objects.
 
-list-multi	:= hisax.o
-hisax-objs	:= config.o isdnl1.o tei.o isdnl2.o isdnl3.o \
-		   lmgr.o q931.o callc.o fsm.o cert.o
+list-multi	  := hisax.o hisax_st5481.o
+hisax-objs	  := config.o isdnl1.o tei.o isdnl2.o isdnl3.o \
+		     lmgr.o q931.o callc.o fsm.o cert.o
+hisax_st5481-objs := st5481_init.o st5481_usb.o st5481_d.o st5481_b.o \
+		     st5481_hdlc.o
 
 # Optional p rts oURmultip rt objects.
-
 hisax-objs-$(CONFIG_HISAX_EURO)R+= l3dss1.o
 hisax-objs-$(CONFIG_HISAX_NI1)R+= l3ni1.o
 hisax-objs-$(CONFIG_HISAX_1TR6)R+= l3_1tr6.o
@@ -27,7 +28,6 @@
 hisax-objs-$(CONFIG_HISAX_AVM_A1)R+= avm_a1.o isac.o arcofi.o hscx.o
 hisax-objs-$(CONFIG_HISAX_AVM_A1_PCMCIA)R+= avm_a1p.o isac.o arcofi.o hscx.o
 hisax-objs-$(CONFIG_HISAX_FRITZPCI)R+= avm_pci.o isac.o arcofi.o
-hisax-objs-$(CONFIG_HISAX_AVM_A1)R+= avm_a1.o isac.o arcofi.o hscx.o
 hisax-objs-$(CONFIG_HISAX_ELSA)R+= elsa.o isac.o arcofi.o hscx.o
 hisax-objs-$(CONFIG_HISAX_IX1MICROR2)R+= ix1_micro.o isac.o arcofi.o hscx.o
 hisax-objs-$(CONFIG_HISAX_DIEHLDIVA)R+= diva.o isac.o arcofi.o hscx.o
@@ -54,9 +54,10 @@
 
 # Each configuration option enables a listToURfF 
s.
 
-obj-$(CONFIG_ISDN_DRV_HISAX)	+= hisax.o
+obj-$(CONFIG_ISDN_DRV_HISAX)		+= hisax.o
 obj-$(CONFIG_HISAX_SEDLBAUER_CS)	+= sedlbauer_cs.o
-obj-$(CONFIG_HISAX_ELSA_CS)	+= elsa_cs.o
+obj-$(CONFIG_HISAX_ELSA_CS)		+= elsa_cs.o
+obj-$(CONFIG_HISAX_ST5481)		+= hisax_st5481.o
 
 CERT := $(shell md5sum -c md5sums.asc >> /dev/null;echo $$?)
 CFLAGS_cert.o := -DCERTIFICATION=$(CERT)
@@ -67,3 +68,6 @@
 
 hisax.o: $(hisax-objs)
 	$(LD) -r -o $@ $(hisax-objs)
+
+hisax_st5481.o: $(hisax_st5481-objs)
+	$(LD) -r -o $@ $(hisax_st5481-objs)
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/callc.c linux/drivers/isdn/hisax/callc.c
--- v2.4.9/linux/drivers/isdn/hisax/callc.c	Tue Jul  3 17:08:19 2001
+++ linux/drivers/isdn/hisax/callc.c	Sun Sep  9 10:45:43 2001
@@ -1,4 +1,4 @@
-/* $Id: callc.c,v 2.51.6.4 2001/06/09 15:14:17 kai Exp $
+/* $Id: callc.c,v 2.51.6.5 2001/08/23 19:44:23 kai Exp $
  *
  *RAuthor       Karsten Keil (keil@isdn4linux.de)s  *RR            based on theRteles driverRfrom JanRden Ouden
@@ -20,12 +20,12 @@
 #define MOD_USE_COUNT ( GET_USE_COUNT (&__this_module))
 #endiU	/* MODULE */
 
-const char *lli_revision = "$Revision: 2.51.6.4 $";
+const char *lli_revision = "$Revision: 2.51.6.5 $";
 
 extesi s ruct IsdnCard cards[];
 extesi int nrcards;
-extesi ES < HiSax_mod_dec_use_count(ES <);
-extesi ES < HiSax_mod_inc_use_count(ES <);
+extesi ES < HiSax_mod_dec_use_count(s ruct IsdnCardS  peR*cs);
+extesi ES < HiSax_mod_inc_use_count(s ruct IsdnCardS  peR*cs);
 
 y  pF TintRinit_b_st(s ruct Channel *chanp,Rint incoming);
 y  pF TES < release_b_st(s ruct Channel *chanp);
@@ -1584,7 +1584,7 @@
 			}
 			break;
 		case (ISDN_CMD_LOCK):
-			HiSax_mod_inc_use_count();s+			HiSax_mod_inc_use_count(cy  );
 #ifdef MODULE
 			iUR	cy  ->channel[0].debug & 0x400)
 				HiSax_puty  pus	cy  , "   LOCK ", "modcnt %lx",
@@ -1592,7 +1592,7 @@
 #endiU				/* MODULE */
 			break;
 		case (ISDN_CMD_UNLOCK):
-			HiSax_mod_dec_use_count();s+			HiSax_mod_dec_use_count(cy  );
 #ifdef MODULE
 			iUR	cy  ->channel[0].debug & 0x400)
 				HiSax_puty  pus	cy  , " UNLOCK ", "modcnt %lx",
@@ -1624,11 +1624,11 @@
 					break;
 				case (3):
 					for (iR= 0; i < *(unsigned int *) ic->p rm.num; i++)
-						HiSax_mod_dec_use_count();s+						HiSax_mod_dec_use_count(NULL);
 					break;
 				case (4):
 					for (iR= 0; i < *(unsigned int *) ic->p rm.num; i++)
-						HiSax_mod_inc_use_count();s+						HiSax_mod_inc_use_count(NULL);
 					break;
 				case (5):	/* setRcard in leased modeR*/
 					numT= *(unsigned int *) ic->p rm.num;
@@ -1698,7 +1698,7 @@
 #ifdef MODULE
 				case (55):
 					MOD_USE_COUNT = 0;
-					HiSax_mod_inc_use_count();s+					HiSax_mod_inc_use_count(NULL);
 					break;
 #endiU				/* MODULE */
 				case (11):
@@ -1810,6 +1810,7 @@
 		cli();
 		nskb =Rskb_clone(skb, GFP_ATOMIC);
 		iUR	nskb) {
+			nskb-> ruesizeR= nskb->len;
 			iUR	!ack)
 				nskb->pkt_type = PACKET_NOACK;
 			iUR	chanp->l2_active_protocolR== ISDN_PROTO_L2_X75I)
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/config.c linux/drivers/isdn/hisax/config.c
--- v2.4.9/linux/drivers/isdn/hisax/config.c	Wed Jul 25 17:10:20 2001
+++ linux/drivers/isdn/hisax/config.c	Sun Sep  9 10:45:43 2001
@@ -1,4 +1,4 @@
-/* $Id: config.c,v 2.57.6.16 2001/07/13 09:01:00 kai Exp $
+/* $Id: config.c,v 2.57.6.18 2001/08/27 22:19:05 kai Exp $
  *
  *RAuthor       Karsten Keil (keil@isdn4linux.de)s  *RR            based on theRteles driverRfrom JanRden Ouden
@@ -313,7 +313,8 @@
 #define DEFAULT_PROTO_NAME "UNKNOWN"
 #endiU
 #ifndef DEFAULT_CARDs-#error "HiSax:RNo cards configured"
+#define DEFAULT_CARD 0
+#define DEFAULT_CFG {0,0,0,0}
 #endiU
 
 int hisax_init_pcmcia(ES < *,Rint *, s ruct IsdnCard *);
@@ -423,16 +424,6 @@
 	certification_check(1);
 }
 
-ES < HiSax_mod_dec_use_count(ES <)
-{
-	MOD_DEC_USE_COUNT;
-}
-
-ES < HiSax_mod_inc_use_count(ES <)
-{
-	MOD_INC_USE_COUNT;
-}
-
 #ifndef MODULE
 #define MAX_ARG	(HISAX_MAX_CARDS*5)
 y  pF TintR__init HiSax_setup(char *line)
@@ -840,8 +831,9 @@
 	iUR	cy  ->DC_CloseR!= NULL) {
 		cy  ->DC_Close(cy  );
 	}
-	cy  ->cardmsg	cy  , CARD_RELEASE, NULL);s-	iUR	cy  ->dbusytimer.function != NULL)
+	iUR	cy  ->cardmsg)
+		cy  ->cardmsg	cy  , CARD_RELEASE, NULL);s+	iUR	cy  ->dbusytimer.function != NULL) // FIXME?
T		del_timer(&cy  ->dbusytimer);
 	ll_unload(cy  );
 }
@@ -1137,6 +1129,9 @@
 		ret =Rsetup_netjet_u(card);
 		break;
 #endiUs+	case ISDN_CTYPE_DYNAMIC:s+		retR= 2;
+		break;
 	default:
 		printk(KERN_WARNING
 		       "HiSax:RSupport for %s Card not selected\n",
@@ -1165,7 +1160,17 @@
 
 	init_bcy  pe(cs, 0);
 	init_bcy  pe(cs, 1);
-	retR= init_card(cs);
+
+	/* init_card only handles interrupts whFch are not */
+	/* used her
Rfor theRloadable driverR*/
+	switch (card->typ) {
+	case ISDN_CTYPE_DYNAMIC:s+		retR= 0;
+		break;
+	default:
+		retR= init_card(cs);
+		break;
+	}
 	iUR	ret) {
 		closecard(cardnr);
 		retR= 0;
@@ -1343,6 +1348,8 @@
 #ifdef MODULE
 	iUR	!type[0]) {
 		/* We 'll register drivers later, but init basF TfunctionsR*/
+		for (iR= 0; i < HISAX_MAX_CARDS; i++)
+			cards[i].typR= 0;
 		retnsi 0;
 	}
 #ifdef CONFIG_HISAX_ELSA
@@ -1572,7 +1579,6 @@
 {
 #ifdef MODULE
 	int i;
-	int nzprotoR= 0;
 s 	nrcardsR= 0;
 	/* InitializeRall s ructs, even thoughRwe only accept
@@ -1584,14 +1590,12 @@
 		cards[i].typR= type[i];
 		iUR	protocol[i]) {
 			cards[i].protocolR= protocol[i];
-			nzproto++;
 		}
 	}
 	cards[0].p ra[0]R= pcm_irq;
 	cards[0].p ra[1] = 	int) pcm_iob;
 	cards[0].protocolR= prot;
 	cards[0].typR= ISDN_CTYPE_HFC_SP_PCMCIA;
-	nzprotoR= 1;
 
 	iUR	!HiSax_ <)s 		HiSax_id = HiSaxID;
@@ -1615,7 +1619,6 @@
 {
 #ifdef MODULE
 	int i;
-	int nzprotoR= 0;
 s 	nrcardsR= 0;
 	/* InitializeRall s ructs, even thoughRwe only accept
@@ -1627,14 +1630,12 @@
 		cards[i].typR= type[i];
 		iUR	protocol[i]) {
 			cards[i].protocolR= protocol[i];
-			nzproto++;
 		}
 	}
 	cards[0].p ra[0]R= pcm_irq;
 	cards[0].p ra[1] = 	int) pcm_iob;
 	cards[0].protocolR= prot;
 	cards[0].typR= ISDN_CTYPE_SEDLBAUER_PCMCIA;
-	nzprotoR= 1;
 
 	iUR	!HiSax_ <)s 		HiSax_id = HiSaxID;
@@ -1658,7 +1659,6 @@
 {
 #ifdef MODULE
 	int i;
-	int nzprotoR= 0;
 s 	nrcardsR= 0;
 	/* InitializeRall s ructs, even thoughRwe only accept
@@ -1670,14 +1670,12 @@
 		cards[i].typR= type[i];
 		iUR	protocol[i]) {
 			cards[i].protocolR= protocol[i];
-			nzproto++;
 		}
 	}
 	cards[0].p ra[0]R= pcm_irq;
 	cards[0].p ra[1] = 	int) pcm_iob;
 	cards[0].protocolR= prot;
 	cards[0].typR= ISDN_CTYPE_A1_PCMCIA;
-	nzprotoR= 1;
 
 	iUR	!HiSax_ <)s 		HiSax_id = HiSaxID;
@@ -1715,11 +1713,362 @@
 	retnsi ret;s }
 
+#includeR"hisax_if.h"
+
+EXPORT_SYMBOL(hisax_register);
+EXPORT_SYMBOL(hisax_unregister);
+
+y  pF TES < hisax_d_l1l2(s ruct hisax_if *ifc, int pr,TES < *arg);
+y  pF TES < hisax_b_l1l2(s ruct hisax_if *ifc, int pr,TES < *arg);
+y  pF TES < hisax_d_l2l1(s ruct PStack *st, int pr,TES < *arg);
+y  pF TES < hisax_b_l2l1(s ruct PStack *st, int pr,TES < *arg);
+y  pF Tint hisax_cardmsg	s ruct IsdnCardS  peR*cs,Rint mt,TES < *arg);
+y  pF Tint hisax_bc_setstack(s ruct PStack *st, s ruct BCS  peR*bcs);
+y  pF TES < hisax_bc_close(s ruct BCS  peR*bcs);
+y  pF TES < hisax_bh(s ruct IsdnCardS  peR*cs);
+y  pF TES < EChannel_proc_rcv(s ruct hisax_d_if *d_if);
+
+int hisax_register(s ruct hisax_d_if *hisax_d_if, s ruct hisax_b_if *b_if[],
+		   char *name, int protocol)
+{
+	int i, retval;
+	char id[20];
+	s ruct IsdnCardS  peR*cs;
+
+	for (iR= 0; i < HISAX_MAX_CARDS; i++) {
+		iUR	!cards[i].typ)s+			break;
+	}
+
+	iUR	i >= HISAX_MAX_CARDS)
+		retnsi -EBUSY;
+
+	cards[i].typR= ISDN_CTYPE_DYNAMIC;
+	cards[i].protocolR= protocol;
+	sprintf(id,R"%s%d", name, i);
+	nrcards++;
+	retvalR= checkcard(i, id,R0);s+	iUR	retvalR== 0) { // yuck
+		cards[i].typR= 0;
+		nrcards--;
+		retnsi retval;
+	}
+	csT= cards[i].cs;
+	hisax_d_if->csT= cs;
+	cs->hw.hisax_d_if = hisax_d_if;
+	cs->cardmsg = hisax_cardmsg;
+	cs->tqueue.routine = (ES < *) (ES < *) hisax_bh;
+	cs->channel[0].d_st->l2.l2l1 = hisax_d_l2l1;
+	for (iR= 0; i < 2; i++) {
+		cs->bcs[i].BC_SetStack = hisax_bc_setstack;
+		cs->bcs[i].BC_CloseR= hisax_bc_close;
+
+		b_if[i]->ifc.l1l2R= hisax_b_l1l2;
+
+		hisax_d_if->b_if[i]R= b_if[i];
+	}
+	hisax_d_if->ifc.l1l2R= hisax_d_l1l2;
+	skb_queue_head_init(&hisax_d_if->erq);s+	clear_bit(0, &hisax_d_if->ph_y  pe);s+	
+	retnsi 0;
+}
+
+ES < hisax_unregister(s ruct hisax_d_if *hisax_d_if)
+{
+	cards[hisax_d_if->cs->cardnr].typR= 0;
+	HiSax_closecard(hisax_d_if->cs->cardnr);
+	skb_queue_purge(&hisax_d_if->erq);s+}
+
+#includeR"isdnl1.h"
+
+y  pF TES < hisax_sched_event(s ruct IsdnCardS  peR*cs,Rint event)
+{
+	cs->event |=R1R<< event;s+	queue_task(&cy->tqueue, &tq_immedi pe);s+	mark_bh(IMMEDIATE_BH);s+}
+
+y  pF TES < hisax_bh(s ruct IsdnCardS  peR*cs)
+{
+	s ruct PStack *st;
+	int pr;
+
+	iUR	test_and_clear_bit(D_RCVBUFREADY, &cs->event))
+		DChannel_proc_rcv(cs);
+	iUR	test_and_clear_bit(E_RCVBUFREADY, &cs->event))
+		EChannel_proc_rcv(cs->hw.hisax_d_if);
+	iUR	test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
+		iUR	test_bit(0, &cs->hw.hisax_d_if->ph_y  pe))s+			prT= PH_ACTIVATE | INDICATION;
+		elses+			prT= PH_DEACTIVATE | INDICATION;
+		for (stT= cs->stlist; st; st =Rst->next)s+			st->l1.l1l2(s , pr,TNULL);s+		
+	}
+}
+
+y  pF TES < hisax_b_sched_event(s ruct BCS  peR*bcs,Rint event)
+{
+	bcs->event |=R1R<< event;s+	queue_task(&bcy->tqueue, &tq_immedi pe);s+	mark_bh(IMMEDIATE_BH);s+}
+
+y  pF TinlineTES < D_L2L1(s ruct hisax_d_if *d_if, int pr,TES < *arg)
+{
+	s ruct hisax_if *ifcT= 	s ruct hisax_if *) d_if;
+	ifc->l2l1(ifc, pr,Targ);
+}
+
+y  pF TinlineTES < B_L2L1(s ruct hisax_b_if *b_if, int pr,TES < *arg)
+{
+	s ruct hisax_if *ifcT= 	s ruct hisax_if *) b_if;
+	ifc->l2l1(ifc, pr,Targ);
+}
+
+y  pF TES < hisax_d_l1l2(s ruct hisax_if *ifc, int pr,TES < *arg)
+{
+	s ruct hisax_d_if *d_ifT= 	s ruct hisax_d_if *) ifc;
+	s ruct IsdnCardS  peR*csT= d_if->cs;
+	s ruct PStack *st;
+	s ruct sk_buff *skb;
+
+	switch (pr) {
+	case PH_ACTIVATE | INDICATION:
+		set_bit(0, &d_if->ph_y  pe);s+		hisax_sched_event(cs,RD_L1STATECHANGE);
+		break;
+	case PH_DEACTIVATE | INDICATION:
+		clear_bit(0, &d_if->ph_y  pe);s+		hisax_sched_event(cs,RD_L1STATECHANGE);
+		break;
+	case PH_DATA | INDICATION:
+		skb_queue_tail(&cy->rq, arg);
+		hisax_sched_event(cs,RD_RCVBUFREADY);
+		break;
+	case PH_DATA | CONFIRM:
+		skb =Rskb_dequeue(&cy->sq);s+		iUR	skb) {
+			D_L2L1(d_if, PH_DATA | REQUEST,Rskb);s+			break;
+		}
+		clear_bit(FLG_L1_DBUSY, &cs->HW_Flags);
+		for (stT= cs->stlist; st; st =Rst->next) {
+			iUR	test_and_clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags)) {
+				s ->l1.l1l2(s , PH_PULL | CONFIRM,TNULL);s+				break;
+			}
+		}
+		break;
+	case PH_DATA_E | INDICATION:
+		skb_queue_tail(&d_if->erq, arg);
+		hisax_sched_event(cs,RE_RCVBUFREADY);
+		break;
+	default:
+		printk("prT%#x\n", pr);
+		break;
+	}
+}
+
+y  pF TES < hisax_b_l1l2(s ruct hisax_if *ifc, int pr,TES < *arg)
+{
+	s ruct hisax_b_if *b_ifT= 	s ruct hisax_b_if *) ifc;
+	s ruct BCS  peR*bcsR= b_if->bcs;
+	s ruct PStack *stR= bcs->st;
+	s ruct sk_buff *skb;
+
+	// FIXME use isdnl1?
+	switch (pr) {
+	case PH_ACTIVATE | INDICATION:
+		st->l1.l1l2(s , pr,TNULL);s+		break;
+	case PH_DEACTIVATE | INDICATION:
+		st->l1.l1l2(s , pr,TNULL);s+		bcs->hw.b_ifT= NULL;
+		break;
+	case PH_DATA | INDICATION:
+		skb_queue_tail(&bcy->rqueue, arg);
+		hisax_b_sched_event(bcs,RB_RCVBUFREADY);
+		break;
+	case PH_DATA | CONFIRM:
+		bcy->tx_cnt -= 	int) arg;
+		iUR	bcs->st->lli.l1writewakeup)s+			bcs->st->lli.l1writewakeup	bcs->st, 	int) arg);
+		skb =Rskb_dequeue(&bcs->squeue);s+		iUR	skb) {
+			B_L2L1(b_if, PH_DATA | REQUEST,Rskb);s+			break;
+		}
+		clear_bit(BC_FLG_BUSY, &bcs->Flag);s+		iUR	test_and_clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags)) {
+			s ->l1.l1l2(s , PH_PULL | CONFIRM,TNULL);s+		}
+		break;
+	default:
+		printk("hisax_b_l1l2 prT%#x\n", pr);
+		break;
+	}
+}
+
+y  pF TES < hisax_d_l2l1(s ruct PStack *st, int pr,TES < *arg)
+{
+	s ruct IsdnCardS  peR*csT= s ->l1.hardware;
+	s ruct hisax_d_if *hisax_d_if = cs->hw.hisax_d_if;
+	s ruct sk_buff *skbR= arg;
+
+	switch (pr) {
+	case PH_DATA | REQUEST:
+	case PH_PULL | INDICATION:
+		iUR	cy->debug & DEB_DLOG_HEX)s+			LogFrame(cs, skb->da  , skb->len);s+		iUR	cy->debug & DEB_DLOG_VERBOSE)s+			dlogframe(cs, skb,R0);s+		Logl2Frame(cs, skb,R"PH_DATA_REQ",R0);s+		// FIXME lock?
+		iUR	!test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags))
+			D_L2L1(hisax_d_if, PH_DATA | REQUEST,Rskb);s+		elses+			skb_queue_tail(&cy->sq,Rskb);s+		break;
+	case PH_PULL | REQUEST:
+		iUR	!test_bit(FLG_L1_DBUSY, &cs->HW_Flags))
+			s ->l1.l1l2(s , PH_PULL | CONFIRM,TNULL);s+		elses+			set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
+		break;
+	default:
+		D_L2L1(hisax_d_if, pr,Targ);
+		break;
+	}
+}
+
+y  pF Tint hisax_cardmsg	s ruct IsdnCardS  peR*cs,Rint mt,TES < *arg)
+{
+	retnsi 0;
+}
+
+y  pF TES < hisax_b_l2l1(s ruct PStack *st, int pr,TES < *arg)
+{
+	s ruct BCS  peR*bcsR= st->l1.bcs;
+	s ruct hisax_b_if *b_ifT= bcs->hw.b_if;
+
+	switch (pr) {
+	case PH_ACTIVATE | REQUEST:
+		B_L2L1(b_if, pr,T(ES < *) st->l1.mode);
+		break;
+	case PH_DATA | REQUEST:
+	case PH_PULL | INDICATION:
+		// FIXME lock?
+		iUR	!test_and_set_bit(BC_FLG_BUSY, &bcs->Flag)) {
+			B_L2L1(b_if, PH_DATA | REQUEST,Rarg);
+		} else {
+			skb_queue_tail(&bcs->squeue,Rarg);
+		}s+		break;
+	case PH_PULL | REQUEST:
+		iUR	!test_bit(BC_FLG_BUSY, &bcs->Flag))
+			s ->l1.l1l2(s , PH_PULL | CONFIRM,TNULL);s+		elses+			set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
+		break;
+	default:
+		B_L2L1(b_if, pr,Targ);
+		break;
+	}
+}
+
+y  pF Tint hisax_bc_setstack(s ruct PStack *st, s ruct BCS  peR*bcs)
+{
+	s ruct IsdnCardS  peR*csT= s ->l1.hardware;
+	s ruct hisax_d_if *hisax_d_if = cs->hw.hisax_d_if;
+
+	bcs->channelR= st->l1.bc;
+
+	bcs->hw.b_ifT= hisax_d_if->b_if[st->l1.bc];
+	hisax_d_if->b_if[st->l1.bc]->bcsT= bcs;
+
+	st->l1.bcsT= bcs;
+	st->l2.l2l1 = hisax_b_l2l1;
+	setstack_manager(s );
+	bcs->stR= st;
+	setstack_l1_B(s );
+	skb_queue_head_init(&bcy->rqueue);
+	skb_queue_head_init(&bcy->squeue);s+	retnsi 0;
+}
+
+y  pF TES < hisax_bc_close(s ruct BCS  peR*bcs)
+{
+	s ruct hisax_b_if *b_ifT= bcs->hw.b_if;
+
+	iUR	b_if)
+		B_L2L1(b_if, PH_DEACTIVATE | REQUEST,TNULL);s+}
+
+y  pF TES < EChannel_proc_rcv(s ruct hisax_d_if *d_if)
+{
+	s ruct IsdnCardS  peR*csT= d_if->cs;
+	u_char *ptr;
+	s ruct sk_buff *skb;
+
+	whF 
 ((skb =Rskb_dequeue(&d_if->erq))R!= NULL) {
+		iUR	cy->debug & DEB_DLOG_HEX) {
+			ptr = cs->dlog;
+			iUR	(skb->len) < MAX_DLOG_SPACE / 3 - 10) {
+				*ptr++ = 'E';
+				*ptr++ = 'C';
+				*ptr++ = 'H';
+				*ptr++ = 'O';
+				*ptr++ = ':';
+				ptr += QuickHex	ptr, skb->da  , skb->len);s+				ptr--;
+				*ptr++ = '\n';
+				*ptr = 0;
+				HiSax_puty  pus	cy,TNULL, cs->dlog);s+			} else
+				HiSax_puty  pus	cy,T"LogEcho: ",s+						"warningRFrame too big (%d)",s+						skb->len);s+		}s+		dev_kfree_skb_any(skb);s+	}
+}
+
+ES < HiSax_mod_dec_use_count(s ruct IsdnCardS  peR*cs)
+{
+	s ruct module *mod;
+
+	iUR	csT&& cs->cardmsg == hisax_cardmsg) {
+		mod = cs->hw.hisax_d_if->owner;s+		iUR	mod)
+			__MOD_DEC_USE_COUNT	mod);s+	} else {
+		MOD_DEC_USE_COUNT;
+	}
+}
+
+ES < HiSax_mod_inc_use_count(s ruct IsdnCardS  peR*cs)
+{
+	s ruct module *mod;
+
+	iUR	csT&& cs->cardmsg == hisax_cardmsg) {
+		mod = cs->hw.hisax_d_if->owner;s+		iUR	mod)
+		// hopeRwe do win theRrace...
+			try_inc_mod_count(mod);s+	} else {
+		MOD_INC_USE_COUNT;
+	}
+}
+
 #includeR<linux/pci.h>
 
Ty  pF Ts ruct pci_devic
_ < hisax_pci_tbl[]R__initda   = {
 #ifdef CONFIG_HISAX_FRITZPCI
-	{PCI_VENDOR_ID_AVM,      PCI_DEVICE_ID_AVM_A1,          PCI_ANY_ID, PCI_ANY_ID},s+	{PCI_VENDOR_ID_AVM,      PCI_DEVICE_ID_AVM_A1,           PCI_ANY_ID, PCI_ANY_ID},s #endiU
 #ifdef CONFIG_HISAX_DIEHLDIVA
 	{PCI_VENDOR_ID_EICON,    PCI_DEVICE_ID_EICON_DIVA20,     PCI_ANY_ID, PCI_ANY_ID},sdiff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/elsa_ser.c linux/drivers/isdn/hisax/elsa_ser.c
--- v2.4.9/linux/drivers/isdn/hisax/elsa_ser.c	Tue Jul  3 17:08:19 2001
+++ linux/drivers/isdn/hisax/elsa_ser.c	Sun Sep  9 10:45:43 2001
@@ -1,4 +1,4 @@
-/* $Id: elsa_ser.c,v 2.10.6.2 2001/06/09 15:14:17 kai Exp $
+/* $Id: elsa_ser.c,v 2.10.6.3 2001/08/17 12:34:26 kai Exp $
  *
  *Rstuff for theRserial modem on ELSARcards
  *
@@ -14,10 +14,6 @@
 #define RS_ISR_PASS_LIMIT 256
 #define BASE_BAUD ( 1843200 / 16 )
 
-#ifndef MIN
-#define MIN(a,b)	((a) < (b) ? (a) : (b))s-#endiU
-
 //#define SERIAL_DEBUG_OPEN 1
 //#define SERIAL_DEBUG_INTR 1
 //#define SERIAL_DEBUG_FLOW 1
@@ -257,7 +253,7 @@
 write_modem(s ruct BCS  peR*bcs) {
 	int ret=0;
 	s ruct IsdnCardS  peR*csT= bcs->cs;
-	int count, len, fp, buflen;
+	int count, len, fp;
 	long flags;
 	
 	iUR	!bcy->tx_skb)
@@ -266,12 +262,14 @@
 		retnsi 0;
 	save_flags(flags);
 	cli();
-	buflenR= MAX_MODEM_BUF - cs->hw.elsa.transcnt;s-	lenR= MIN(buflen, bcy->tx_skb->len);		
+	lenR= bcy->tx_skb->len;
+	iUR	lenR> MAX_MODEM_BUF - cs->hw.elsa.transcnt)
+		lenR= MAX_MODEM_BUF - cs->hw.elsa.transcnt;s 	fp = cs->hw.elsa.transcnt + cs->hw.elsa.transp;s 	fp &= (MAX_MODEM_BUF -1);
-	countR= MIN(len, MAX_MODEM_BUF - fp);s-	iUR	countR< len) {
+	countR= len;
+	iUR	countR> MAX_MODEM_BUF - fp) {
+		countR= MAX_MODEM_BUF - fp;
 		memcpy(cs->hw.elsa.transbuf + fp, bcy->tx_skb->da  , count);
 		skb_pull(bcy->tx_skb, count);
 		cs->hw.elsa.transcnt += count;
@@ -472,8 +470,9 @@
 	}s 	fp = cs->hw.elsa.transcnt + cs->hw.elsa.transp;s 	fp &= (MAX_MODEM_BUF -1);
-	countR= MIN(len, MAX_MODEM_BUF - fp);s-	iUR	countR< len) {
+	countR= len;
+	iUR	countR> MAX_MODEM_BUF - fp) {
+		countR= MAX_MODEM_BUF - fp;
 		memcpy(cs->hw.elsa.transbuf + fp, msg, count);
 		cs->hw.elsa.transcnt += count;
 		msg += count;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/fsm.c linux/drivers/isdn/hisax/fsm.c
--- v2.4.9/linux/drivers/isdn/hisax/fsm.c	Tue Jul  3 17:08:19 2001
+++ linux/drivers/isdn/hisax/fsm.c	Sun Sep  9 10:45:43 2001
@@ -1,4 +1,4 @@
-/* $Id: fsm.c,v 1.14.6.2 2001/05/26 15:19:57 kai Exp $
+/* $Id: fsm.c,v 1.14.6.3 2001/08/23 19:44:23 kai Exp $
  *
  *RAuthor       Karsten Keil (keil@isdn4linux.de)s  *RR            based on theRteles driverRfrom JanRden Ouden
@@ -14,6 +14,14 @@
 #includeR"hisax.h"
 
 #define FSM_TIMER_DEBUG 0
+
+EXPORT_SYMBOL(FsmNew);
+EXPORT_SYMBOL(FsmFree);
+EXPORT_SYMBOL(FsmEvent);
+EXPORT_SYMBOL(FsmChangeS  pe);s+EXPORT_SYMBOL(FsmInitTimer);
+EXPORT_SYMBOL(FsmDelTimer);
+EXPORT_SYMBOL(FsmRey  rtTimer);
 
 int __init
 FsmNew(s ruct Fsm *fsm, s ruct FsmNodeR*fnlist, int fncount)
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/fsm.h linux/drivers/isdn/hisax/fsm.h
--- v2.4.9/linux/drivers/isdn/hisax/fsm.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/isdn/hisax/fsm.h	Sun Sep  9 10:45:43 2001
@@ -0,0 +1,48 @@
+#ifndef __FSM_H__
+#define __FSM_H__
+
+#includeR<linux/timer.h>
+
+s ruct FsmInst;
+
+typedef ES < (* FSMFNPTR)(s ruct FsmInst *,Rint,TES < *);
+
+y ruct Fsm {
+	FSMFNPTR *jumpmatrix;
+	int y  pe_count, event_count;
+	char **y rEvent, **y rS  pe;s+};
+
+s ruct FsmInst {
+	s ruct Fsm *fsm;
+	int y  pe;
+	int debug;
+	ES < *userda  ;
+	int userint;
+	ES < (*printdebug) (s ruct FsmInst *,Rchar *, ...);s+};
+
+s ruct FsmNodeR{
+	int y  pe, event;s+	ES < (*routine) (s ruct FsmInst *,Rint,TES < *);
+};
+
+s ruct FsmTimer {
+	s ruct FsmInst *fi;
+	s ruct timer_listTtl;
+	int event;s+	ES < *arg;
+};
+
+int FsmNew(s ruct Fsm *fsm, s ruct FsmNodeR*fnlist, int fncount);
+ES < FsmFree(s ruct Fsm *fsm);
+int FsmEvent(s ruct FsmInst *fi,Rint event,TES < *arg);
+ES < FsmChangeS  pe(s ruct FsmInst *fi,Rint newy  pe);s+ES < FsmInitTimer(s ruct FsmInst *fi,Rs ruct FsmTimer *ft);
+int FsmAddTimer(s ruct FsmTimer *ft,Rint millisec,Rint event,
+		ES < *arg,Rint wher
);s+ES < FsmRey  rtTimer(s ruct FsmTimer *ft,Rint millisec,Rint event,
+		     ES < *arg,Rint wher
);s+ES < FsmDelTimer(s ruct FsmTimer *ft,Rint wher
);s+
+#endiU
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/hfc_pci.c linux/drivers/isdn/hisax/hfc_pci.c
--- v2.4.9/linux/drivers/isdn/hisax/hfc_pci.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/isdn/hisax/hfc_pci.c	Fri Sep 14 14:39:59 2001
@@ -84,7 +84,7 @@
 ES <
 release_io_hfcpci(s ruct IsdnCardS  peR*cs)
 {
-	int flags;
+	long flags;
 
 	save_flags(flags);
 	cli();
@@ -299,7 +299,8 @@
 	u_char *ptr, *ptr1, new_f2;
 	s ruct sk_buff *skb;
 	s ruct IsdnCardS  peR*csT= bcs->cs;
-	int flags, total, maxlen, new_z2;
+	long flags;
+	int total, maxlen, new_z2;
 	z_type *zp;
 
 	save_flags(flags);
@@ -633,7 +634,8 @@
 hfcpci_fF l_fFfo(s ruct BCS  peR*bcs)
 {
 	s ruct IsdnCardS  peR*csT= bcs->cs;
-	int flags, maxlen, fcnt;s+	long flags;
+	int maxlen, fcnt;s 	int count, new_z1;
 	bzfFfo_type *bz;
 	u_char *bda  ;
@@ -810,7 +812,7 @@
 y  pF Tint
 hfcpci_auxcmd	s ruct IsdnCardS  peR*cs,Risdn_ctrl * ic)s {
-	int flags;
+	long flags;
 	int iT= *(unsigned int *) ic->p rm.num;
 
 	iUR	(ic->arg == 98) &&
@@ -1160,7 +1162,7 @@
 {
 	s ruct IsdnCardS  peR*csT= 	s ruct IsdnCardS  peR*) s ->l1.hardware;
 	s ruct sk_buff *skbR= arg;
-	int flags;
+	long flags;
 
 	switch (pr) {
 		case (PH_DATA | REQUEST):
@@ -1314,7 +1316,8 @@
 mode_hfcpci(s ruct BCS  peR*bcs,Rint mode,Rint bc)
 {
 	s ruct IsdnCardS  peR*csT= bcs->cs;
-	int flags, fFfo2;
+	long flags;
+	int fFfo2;
 
 	iUR	cy->debug & L1_DEB_HSCX)
T		debugl1	cy,T"HFCPCI bchannelRmodeR%d bchanR%d/%d",
@@ -1548,7 +1551,7 @@
 y  pF TES <
 hfcpci_bh(s ruct IsdnCardS  peR*cs)
 {
-	int flags;
+	long flags;
 /*RR    s ruct PStack *stptr;
  */
 	iUR	!cs)
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/hfc_sx.c linux/drivers/isdn/hisax/hfc_sx.c
--- v2.4.9/linux/drivers/isdn/hisax/hfc_sx.c	Wed Jul 25 17:10:20 2001
+++ linux/drivers/isdn/hisax/hfc_sx.c	Fri Sep 14 14:39:59 2001
@@ -73,7 +73,7 @@
 /******************************/
 y  pF TinlineTES <
 Write_hfc	s ruct IsdnCardS  peR*cs,Ru_char regnum,Ru_char val)
-{       register int flags;
+{       long flags;
 
   RR    save_flags(flags);
 	cli();
@@ -84,8 +84,8 @@
 
 y  pF TinlineTu_char
 Read_hfc	s ruct IsdnCardS  peR*cs,Ru_char regnum)
-{       register int flags;
-        register u_char ret; 
+{       long flags;
+        u_char ret; 
 
   RR    save_flags(flags);
 	cli();
@@ -101,7 +101,7 @@
 /**************************************************/
 y  pF TES <
 fFfo_select	s ruct IsdnCardS  peR*cs,Ru_char fFfo)
-{       int flags;
+{       long flags;
 
   RR    iUR	fFfo == cs->hw.hfcsx.last_fFfo)R
 	  retnsi; /* y F l valid */
@@ -123,7 +123,7 @@
 /******************************************/
 y  pF TES <
 reset_fFfo(s ruct IsdnCardS  peR*cs,Ru_char fFfo)
-{       int flags;
+{       long flags;
 
   RR    save_flags(flags); 
 	cli();
@@ -337,7 +337,7 @@
 ES <
 release_io_hfcsx(s ruct IsdnCardS  peR*cs)
 {
-	int flags;
+	long flags;
 
 	save_flags(flags);
 	cli();
@@ -599,7 +599,7 @@
 hfcsx_fF l_fFfo(s ruct BCS  peR*bcs)
 {
 	s ruct IsdnCardS  peR*csT= bcs->cs;
-	int flags;
+	long flags;
 
 	iUR	!bcy->tx_skb)
 		retnsi;
@@ -670,7 +670,7 @@
 y  pF Tint
 hfcsx_auxcmd	s ruct IsdnCardS  peR*cs,Risdn_ctrl * ic)s {
-	int flags;
+	long flags;
 	int iT= *(unsigned int *) ic->p rm.num;
 
 	iUR	(ic->arg == 98) &&
@@ -729,7 +729,7 @@
 y  pF TES <
 receive_emsg	s ruct IsdnCardS  peR*cs)s {
-	int flags;
+	long flags;
 	int countR= 5;
 	u_char *ptr;
 	s ruct sk_buff *skb;
@@ -961,7 +961,7 @@
 {
 	s ruct IsdnCardS  peR*csT= 	s ruct IsdnCardS  peR*) s ->l1.hardware;
 	s ruct sk_buff *skbR= arg;
-	int flags;
+	long flags;
 
 	switch (pr) {
 		case (PH_DATA | REQUEST):
@@ -1115,7 +1115,8 @@
 mode_hfcsx(s ruct BCS  peR*bcs,Rint mode,Rint bc)
 {
 	s ruct IsdnCardS  peR*csT= bcs->cs;
-	int flags, fFfo2;
+	long flags;
+	int fFfo2;
 
 	iUR	cy->debug & L1_DEB_HSCX)
T		debugl1	cy,T"HFCSX bchannelRmodeR%d bchanR%d/%d",
@@ -1338,7 +1339,7 @@
 y  pF TES <
 hfcsx_bh(s ruct IsdnCardS  peR*cs)
 {
-	int flags;
+	long flags;
 /*RR    s ruct PStack *stptr;
  */
 	iUR	!cs)
@@ -1478,7 +1479,7 @@
 {
 	s ruct IsdnCardS  peR*csT= card->cs;
 	char tmp[64];
-	int flags;
+	long flags;
 
 	strcpy(tmp, hfcsx_revision);
 	printk(KERN_INFO "HiSax:RHFC-SX driverRRev. %s\n", HiSax_getrev(tmp));
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/hisax.h linux/drivers/isdn/hisax/hisax.h
--- v2.4.9/linux/drivers/isdn/hisax/hisax.h	Wed Jul 25 17:10:20 2001
+++ linux/drivers/isdn/hisax/hisax.h	Sun Sep  9 10:45:43 2001
@@ -1,4 +1,4 @@
-/* $Id: hisax.h,v 2.52.6.7 2001/07/18 16:02:15 kai Exp $
+/* $Id: hisax.h,v 2.52.6.8 2001/08/23 19:44:23 kai Exp $
  *
  *R  BasF Tdeclarationy,Tdefines andRprototypes
  *
@@ -455,7 +455,6 @@
 	s ruct tq_s ruct tq_xmt;s };
 
-
 #define BC_FLG_INIT	1
 #define BC_FLG_ACTIV	2
 #define BC_FLG_BUSY	3
@@ -512,6 +511,7 @@
 		s ruct tiger_hw tiger;
 		s ruct amd7930_hw  amd7930;
 		s ruct w6692B_hw w6692;
+		s ruct hisax_b_if *b_if;
 	} hw;s };
 
@@ -897,6 +897,7 @@
 		s ruct bkm_hw ax;
 		s ruct gazel_hw gazel;
 		s ruct w6692_hw w6692;
+		s ruct hisax_d_if *hisax_d_if;
 	} hw;s 	int myid;s 	isdn_if iif;
@@ -991,7 +992,8 @@
 #define  ISDN_CTYPE_HFC_SXRR    37
 #define  ISDN_CTYPE_NETJET_U	38
 #define  ISDN_CTYPE_HFC_SP_PCMCIARR    39
-#define  ISDN_CTYPE_COUNT	39
+#define  ISDN_CTYPE_DYNAMICR    40
+#define  ISDN_CTYPE_COUNT	40
 
 
 #ifdef ISDN_CHIP_ISAC
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/hisax_debug.h linux/drivers/isdn/hisax/hisax_debug.h
--- v2.4.9/linux/drivers/isdn/hisax/hisax_debug.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/isdn/hisax/hisax_debug.h	Sun Sep  9 10:45:43 2001
@@ -0,0 +1,80 @@
+/*
+ * Common debuggingRmacros for use with theRhisax driver
+ *
+ * Author       FrodeRIsaksen
+ * Copyright    2001 by FrodeRIsaksen      <fisaksen@bewan.com>
+ * 
+ * This softwareRmay be used andRdistributed accordingRto theRterms
+ * of theRGNU General PublF TLicense,Rincorporated her
in by refer
nce.
+ *
+ */s+
+/* 
+ * HowRto use:
+ * 
+ * Before includingRthis fF 
,Ryou need to
+ *   #define __debug_variable my_debug
+ * wher
 my_debugRis a variable in your codeRwhFch
+ * determines theRdebugRbitmask.
+ *
+ * If CONFIG_HISAX_DEBUG is not set,Rall macros evalu peRto nothing
+ */s+
+#ifndef __HISAX_DEBUG_H__
+#define __HISAX_DEBUG_H__
+
+#ifdef CONFIG_HISAX_DEBUG
+
+#define DBG(level, format,Targ...) do { \
+iUR	level & __debug_variable) \
+printk(KERN_DEBUG __FUNCTION__ ": " format "\n" , ##Targ); \
+} whF 
 (0)
+
+#define DBG_PACKET(level,da  ,count) \
+  iUR	level & __debug_variable) dump_packet(__FUNCTION__,da  ,count)
+
+#define DBG_SKB(level,skb) \
+  iUR		level & __debug_variable) &&Rskb) dump_packet(__FUNCTION__,skb->da  ,skb->len)
+
+
+y  pF TES < __attribute__((unused))
+dump_packet(const char *name,const u_char *da  ,int pkt_len)
+{
+#define DUMP_HDR_SIZE 20
+#define DUMP_TLR_SIZE 8
+	iUR	pkt_len) {
+		int i,len1,len2;
+
+		printk(KERN_DEBUG "%s: length=%d,da  =",name,pkt_len);
+
+		iUR	pkt_len >  DUMP_HDR_SIZE+ DUMP_TLR_SIZE) {
+			len1T= DUMP_HDR_SIZE;
+			len2T= DUMP_TLR_SIZE;
+		} else {
+			len1T= pkt_len > DUMP_HDR_SIZE ? DUMP_HDR_SIZE : pkt_len;
+			len2T= 0;			
+		}s+		for (iR= 0; i < len1; ++i) {
+		 	printk ("%.2x", da  [i]);s+		}s+		iUR	len2) {
+		 	printk ("..");s+			for (iR= pkt_len-DUMP_TLR_SIZE; i < pkt_len; ++i) {
+				printk ("%.2x", da  [i]);s+			}
+		}
+		printk ("\n");s+	}
+#undef DUMP_HDR_SIZE
+#undef DUMP_TLR_SIZEs+}
+
+#else
+
+#define DBG(level, format,Targ...) do {} whF 
 (0)
+#define DBG_PACKET(level,da  ,count) do {} whF 
 (0)
+#define DBG_SKB(level,skb) do {} whF 
 (0)
+
+#endiU
+
+#endiU
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/hisax_if.h linux/drivers/isdn/hisax/hisax_if.h
--- v2.4.9/linux/drivers/isdn/hisax/hisax_if.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/isdn/hisax/hisax_if.h	Sun Sep  9 10:45:43 2001
@@ -0,0 +1,54 @@
+#ifndef __HISAX_IF_H__
+#define __HISAX_IF_H__
+
+#includeR<linux/skbuff.h>
+
+#define REQUEST		0
+#define CONFIRM		1
+#define INDICATION	2
+#define RESPONSE	3
+
+#define PH_ACTIVATE	0x0100
+#define PH_DEACTIVATE	0x0110
+#define PH_DATA		0x0120
+#define PH_PULL		0x0130
+#define PH_DATA_E	0x0140
+
+#define L1_MODE_NULL	0
+#define L1_MODE_TRANS	1
+#define L1_MODE_HDLC	2
+#define L1_MODE_EXTRN	3
+#define L1_MODE_HDLC_56K 4
+#define L1_MODE_MODEM	7
+#define L1_MODE_V32	8
+#define L1_MODE_FAX	9
+
+s ruct hisax_if {s+	ES < *priv; // priv peRto driver
+	ES < (*l1l2)(s ruct hisax_if *, int pr,TES < *arg);
+	ES < (*l2l1)(s ruct hisax_if *, int pr,TES < *arg);
+};
+
+s ruct hisax_b_if {
+	s ruct hisax_if ifc;
+
+	// priv peRto hisax
+	s ruct BCS  peR*bcs;
+};
+
+s ruct hisax_d_if {
+	s ruct hisax_if ifc;
+
+	// priv peRto hisax
+	s ruct module *owner;s+	s ruct IsdnCardS  peR*cs;
+	s ruct hisax_b_if *b_if[2];
+	s ruct sk_buff_head erq;
+	long ph_y  pe;
+};
+
+int hisax_register(s ruct hisax_d_if *hisax_if, s ruct hisax_b_if *b_if[],
+		   char *name, int protocol);
+ES < hisax_unregister(s ruct hisax_d_if *hisax_if);
+
+#endiU
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/isar.c linux/drivers/isdn/hisax/isar.c
--- v2.4.9/linux/drivers/isdn/hisax/isar.c	Tue Jul  3 17:08:19 2001
+++ linux/drivers/isdn/hisax/isar.c	Fri Sep  7 09:28:38 2001
@@ -1,4 +1,4 @@
-/* $Id: isar.c,v 1.17.6.3 2001/06/09 15:14:17 kai Exp $
+/* $Id: isar.c,v 1.17.6.4 2001/08/17 12:34:26 kai Exp $
  *
  *Risar.c   ISAR (Siemens PSB 7110) specific routines
  *
@@ -18,8 +18,6 @@
 #define DBG_LOADFIRM	0
 #define DUMP_MBOXFRAME	2
 
-#define MIN(a,b) ((a<b)?a:b)
-
 #define DLE	0x10
 #define ETX	0x03
 
@@ -272,7 +270,9 @@
 			retR= 1;gotoRreterror;
 		}
 		whF 
 (left>0) {
-			nocR= MIN(126, left);
+			nocR= left;
+			iUR	nocR> 126)
+				nocR= 126;
 			nomT= 2*noc;
 			mp  = msg;
 			*mp++ = sadr / 256;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/isdnl1.c linux/drivers/isdn/hisax/isdnl1.c
--- v2.4.9/linux/drivers/isdn/hisax/isdnl1.c	Tue Jul  3 17:08:19 2001
+++ linux/drivers/isdn/hisax/isdnl1.c	Sun Sep  9 10:45:43 2001
@@ -1,4 +1,4 @@
-/* $Id: isdnl1.c,v 2.41.6.3 2001/05/26 15:19:57 kai Exp $
+/* $Id: isdnl1.c,v 2.41.6.4 2001/08/23 19:44:23 kai Exp $
  *
  *Risdnl1.c     common low level stuff for Siemens Chipsetbased isdnRcards
  *RR            based on theRteles driverRfrom JanRden Ouden
@@ -15,7 +15,7 @@
  *
  */
 
-const char *l1_revision = "$Revision: 2.41.6.3 $";
+const char *l1_revision = "$Revision: 2.41.6.4 $";
 
 #define __NO_VERSION__
 #includeR<linux/init.h>
@@ -895,7 +895,8 @@
 	setstack_manager(s );
 	st->l1.stlistp = &(cs->stlist);
 	st->l2.l2l1 T= dch_l2l1;
-	cs->setstack_d(s , cs);
+	iUR	cs->setstack_d)
+		cs->setstack_d(s , cs);
 }
 
TES <
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/isdnl1.h linux/drivers/isdn/hisax/isdnl1.h
--- v2.4.9/linux/drivers/isdn/hisax/isdnl1.h	Fri Mar  2 11:12:09 2001
+++ linux/drivers/isdn/hisax/isdnl1.h	Sun Sep  9 10:45:43 2001
@@ -1,4 +1,4 @@
-/* $Id: isdnl1.h,v 2.9.6.1 2001/02/16 16:43:27 kai Exp $
+/* $Id: isdnl1.h,v 2.9.6.2 2001/08/23 19:44:23 kai Exp $
  *
  *RLayerR1Tdefines
  *
@@ -14,6 +14,7 @@
 #define D_RX_MON1	5
 #define D_TX_MON0	6
 #define D_TX_MON1	7
+#define E_RCVBUFREADY	8
 
 #define B_RCVBUFREADY 0
 #define B_XMTBUFREADY 1
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/l3dss1.c linux/drivers/isdn/hisax/l3dss1.c
--- v2.4.9/linux/drivers/isdn/hisax/l3dss1.c	Fri Mar  2 11:12:09 2001
+++ linux/drivers/isdn/hisax/l3dss1.c	Fri Sep 14 14:39:59 2001
@@ -44,7 +44,8 @@
 y  pF Tunsigned char new_invok
_ <(s ruct PStack *p)
 {
 	unsigned char retval;
-	int flags,i;
+	long flags;
+	int i;
   
 	iT= 32; /* maximum searchTdepth */
 
@@ -72,7 +73,7 @@
 /* free a used invok
 id */
 /*************************/
 y  pF TES < free_invok
_ <(s ruct PStack *p,Tunsigned char  <)
-{ int flags;
+{ long flags;
 
   iUR	! <) retnsi; /* 0R= invalid valueR*/
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/l3ni1.c linux/drivers/isdn/hisax/l3ni1.c
--- v2.4.9/linux/drivers/isdn/hisax/l3ni1.c	Fri Mar  2 11:12:09 2001
+++ linux/drivers/isdn/hisax/l3ni1.c	Fri Sep 14 14:39:59 2001
@@ -48,7 +48,8 @@
 y  pF Tunsigned char new_invok
_ <(s ruct PStack *p)
 {
 	unsigned char retval;
-	int flags,i;
+	long flags;
+	int i;
   
 	iT= 32; /* maximum searchTdepth */
 
@@ -76,7 +77,7 @@
 /* free a used invok
 id */
 /*************************/
 y  pF TES < free_invok
_ <(s ruct PStack *p,Tunsigned char  <)
-{ int flags;
+{ long flags;
 
   iUR	! <) retnsi; /* 0R= invalid valueR*/
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/st5481.h linux/drivers/isdn/hisax/st5481.h
--- v2.4.9/linux/drivers/isdn/hisax/st5481.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/isdn/hisax/st5481.h	Sun Sep  9 10:45:43 2001
@@ -0,0 +1,533 @@
+/*
+ * DriverRfor ST5481 USB ISDN modem
+ *
+ * Author       FrodeRIsaksen
+ * Copyright    2001 by FrodeRIsaksen      <fisaksen@bewan.com>
+ *              2001 by Kai Germaschewski  <kai.germaschewski@gmx.de>
+ * 
+ * This softwareRmay be used andRdistributed accordingRto theRterms
+ * of theRGNU General PublF TLicense,Rincorporated her
in by refer
nce.
+ *
+ */s+
+#ifndef _ST5481_H_
+#define _ST5481_H_
+
+// USB IDs, theRProduct Id is in theRrange 0x4810-0x481F
+
+#define ST_VENDOR_ID 0x0483
+#define ST5481_PRODUCT_ID 0x4810
+#define ST5481_PRODUCT_ID_MASK 0xFFF0
+
+// ST5481 endpoints when usingRaltesiative settingR3 (2B+D).
+// To getRtheRendpoint address, OR with 0x80Rfor IN endpoints.
+
+#define EP_CTRL   0x00U /* ControlRendpoint */s+#define EP_INT    0x01U /* InterruptRendpoint */s+#define EP_B1_OUT 0x02U /* B1 channelRout */s+#define EP_B1_IN  0x03U /* B1 channelRin */s+#define EP_B2_OUT 0x04U /* B2 channelRout */s+#define EP_B2_IN  0x05U /* B2 channelRin */s+#define EP_D_OUT  0x06U /* D channelRout */s+#define EP_D_IN   0x07U /* D channelRin */s+  
+// NumberRof isochronous packets. With 20 packetsRwe get
+// 50 interrupts/sec for eachTendpoint.
+
+#define NUM_ISO_PACKETS_D      20
+#define NUM_ISO_PACKETS_B      20
+
+// SizeRof eachTisochronous packet.
+// InRoutgoingRdirection we need toRmatch ISDN da   rates:
+// D:  2 bytes / msec -> 16 kbit / s
+// B: 16 bytes / msec -> 64 kbit / s
+#define SIZE_ISO_PACKETS_D_IN  16
+#define SIZE_ISO_PACKETS_D_OUT 2
+#define SIZE_ISO_PACKETS_B_IN  32
+#define SIZE_ISO_PACKETS_B_OUT 8
+
+// IfRwe overrun/underrun,Rwe send one packet with +/- 2 bytes
+#define B_FLOW_ADJUST 2
+
+// Registers that are written usingRvendor specific devic
 request
+// on endpoint 0. 
+
+#define LBA			0x02 /* S loopback */s+#define SET_DEFAULT		0x06 /* Soft reset */s+#define LBB			0x1D /* S maintenance loopback */s+#define STT			0x1e /* S force transmission signals */s+#define SDA_MIN			0x20 /* SDA-sin minimal valueR*/
+#define SDA_MAX			0x21 /* SDA-sin maximal valueR*/
+#define SDELAY_VALUE		0x22 /* Delay between Tx andRRx clockR*/
+#define IN_D_COUNTER		0x36 /* D receive channelRfFfo counterR*/
+#define OUT_D_COUNTER		0x37 /* D transmit channelRfFfo counterR*/
+#define IN_B1_COUNTER		0x38 /* B1 receive channelRfFfo counterR*/
+#define OUT_B1_COUNTER		0x39 /* B1 transmit channelRfFfo counterR*/
+#define IN_B2_COUNTER		0x3a /* B2 receive channelRfFfo counterR*/
+#define OUT_B2_COUNTER		0x3b /* B2 transmit channelRfFfo counterR*/
+#define FFCTRL_IN_D		0x3C /* D receive channelRfFfo threshold low */
+#define FFCTRH_IN_D		0x3D /* D receive channelRfFfo threshold highR*/
+#define FFCTRL_OUT_D		0x3E /* D transmit channelRfFfo threshold low */
+#define FFCTRH_OUT_D		0x3F /* D transmit channelRfFfo threshold highR*/
+#define FFCTRL_IN_B1		0x40 /* B1 receive channelRfFfo threshold low */
+#define FFCTRH_IN_B1		0x41 /* B1 receive channelRfFfo threshold highR*/
+#define FFCTRL_OUT_B1		0x42 /* B1 transmit channelRfFfo threshold low */
+#define FFCTRH_OUT_B1		0x43 /* B1 transmit channelRfFfo threshold highR*/
+#define FFCTRL_IN_B2		0x44 /* B2 receive channelRfFfo threshold low */
+#define FFCTRH_IN_B2		0x45 /* B2 receive channelRfFfo threshold highR*/
+#define FFCTRL_OUT_B2		0x46 /* B2 transmit channelRfFfo threshold low */
+#define FFCTRH_OUT_B2		0x47 /* B2 transmit channelRfFfo threshold highR*/
+#define MPMSK			0x4A /* Multi purpose interruptRMASK register */
+#define	FFMSK_D			0x4c /* D fFfo interruptRMASK register */
+#define	FFMSK_B1		0x4e /* B1 fFfo interruptRMASK register */
+#define	FFMSK_B2		0x50 /* B2 fFfo interruptRMASK register */
+#define GPIO_DIR		0x52 /* GPIO pinsRdirection registers */
+#define GPIO_OUT		0x53 /* GPIO pinsRoutput register */
+#define GPIO_IN			0x54 /* GPIO pinsRinput register */ 
+#define TXCI			0x56 /* CI commandRtoRbe transmitted */s+
+
+// Format of theRinterruptRpacket received on endpoint 1:
+//
+// +--------+--------+--------+--------+--------+--------+
+// !MPINT   !FFINT_D !FFINT_B1!FFINT_B2!CCIST   !GPIO_INT!
+// +--------+--------+--------+--------+--------+--------+
+
+// Offsets in theRinterruptRpacket
+
+#define MPINT			0
+#define FFINT_D			1
+#define FFINT_B1		2
+#define FFINT_B2		3
+#define CCIST			4
+#define GPIO_INT		5
+#define INT_PKT_SIZE            6
+
+// MPINTs+#define LSD_INT                 0x80R/* S line activity detected */s+#define RXCI_INT		0x40 /* Indic peRprimitive arrived */
+#define	DEN_INT			0x20 /* Signal enablingRda   out of D Tx fFfo */s+#define DCOLL_INT		0x10 /* D channelRcollision */s+#define AMIVN_INT		0x04 /* AMI violation numberRreached 2R*/
+#define INFOI_INT		0x04 /* INFOi changed */s+#define DRXON_INT               0x02 /* Reception channelRactive */
+#define GPCHG_INT               0x01 /* GPIO pin valueRchanged */s+
+// FFINT_x
+#define IN_OVERRUN		0x80 /* In fFfo overrunR*/
+#define OUT_UNDERRUN		0x40 /* Out fFfo underrunR*/
+#define IN_UP			0x20 /* In fFfo thresholdh up-crossed */s+#define IN_DOWN			0x10 /* In fFfo thresholdl down-crossed */s+#define OUT_UP			0x08 /* Out fFfo thresholdh up-crossed */s+#define OUT_DOWN		0x04 /* Out fFfo thresholdl down-crossed */s+#define IN_COUNTER_ZEROED	0x02 /* In down-counterRreached 0 */s+#define OUT_COUNTER_ZEROED	0x01 /* Out down-counterRreached 0 */s+s+#define ANY_REC_INT	(IN_OVERRUN+IN_UP+IN_DOWN+IN_COUNTER_ZEROED)s+#define ANY_XMIT_INT	(OUT_UNDERRUN+OUT_UP+OUT_DOWN+OUT_COUNTER_ZEROED)s+
+
+// Level 1 commands that are sent usingRthe TXCI devic
 request
+#define ST5481_CMD_DR		 0x0 /* Deactivation Request */s+#define ST5481_CMD_RES		 0x1 /* y  peRmachine RESet */s+#define ST5481_CMD_TM1		 0x2 /* Test ModeR1 */s+#define ST5481_CMD_TM2		 0x3 /* Test ModeR2 */s+#define ST5481_CMD_PUP		 0x7 /* PowerRUP */s+#define ST5481_CMD_AR8		 0x8 /* Activation Request classR1 */s+#define ST5481_CMD_AR10		 0x9 /* Activation Request classR2 */s+#define ST5481_CMD_ARL		 0xA /* Activation Request Loopback */s+#define ST5481_CMD_PDN		 0xF /* PowerRDoWn */s+
+// Tnsi on/off theRLEDs usingRthe GPIO devic
 request.
+// To use the BRLEDs, number_of_leds must be setRtoR4
+#define B1_LED		0x10U
+#define B2_LED		0x20U
+#define GREEN_LED	0x40U
+#define RED_LED	        0x80Us+
+// D channelRout y  pes
+enum {
+	ST_DOUT_NONE,
+
+	ST_DOUT_SHORT_INIT,
+	ST_DOUT_SHORT_WAIT_DEN,
+
+	ST_DOUT_LONG_INIT,
+	ST_DOUT_LONG_WAIT_DEN,
+	ST_DOUT_NORMAL,
+
+	ST_DOUT_WAIT_FOR_UNDERRUN,
+        ST_DOUT_WAIT_FOR_NOT_BUSY,
+	ST_DOUT_WAIT_FOR_STOP,
+	ST_DOUT_WAIT_FOR_RESET,
+};
+
+#define DOUT_STATE_COUNT (ST_DOUT_WAIT_FOR_RESET + 1)s+
+// D channelRout events
+enum {
+	EV_DOUT_START_XMIT,
+	EV_DOUT_COMPLETE,
+	EV_DOUT_DEN,
+	EV_DOUT_RESETED,
+	EV_DOUT_STOPPED,
+	EV_DOUT_COLL,
+	EV_DOUT_UNDERRUN,
+};
+
+#define DOUT_EVENT_COUNT (EV_DOUT_UNDERRUN + 1)s+
+// ----------------------------------------------------------------------s+
+enum {
+	ST_L1_F3,
+	ST_L1_F4,
+	ST_L1_F6,
+	ST_L1_F7,
+	ST_L1_F8,
+};
+
+#define L1_STATE_COUNT (ST_L1_F8+1)s+
+// The first 16 entriesRmatch theRLevel 1 indic piony that 
+// are found at offset 4 (CCIST) in theRinterruptRpacket
+
+enum {
+	EV_IND_DP,  // 0000 Deactivation Pending
+	EV_IND_1,   // 0001
+	EV_IND_2,   // 0010
+	EV_IND_3,   // 0011
+	EV_IND_RSY, // 0100 ReSYnchronizing
+	EV_IND_5,   // 0101
+	EV_IND_6,   // 0110
+	EV_IND_7,   // 0111
+	EV_IND_AP,  // 1000 Activation Pending
+	EV_IND_9,   // 1001
+	EV_IND_10,  // 1010
+	EV_IND_11,  // 1011
+	EV_IND_AI8, // 1100 Activation Indic pion classR8
+	EV_IND_AI10,// 1101 Activation Indic pion classR10
+	EV_IND_AIL, // 1110 Activation Indic pion Loopback
+	EV_IND_DI,  // 1111 Deactivation Indic pion
+	EV_PH_ACTIVATE_REQ,
+	EV_PH_DEACTIVATE_REQ,
+	EV_TIMER3,
+};
+
+#define L1_EVENT_COUNT (EV_TIMER3 + 1)s+
+#define ERR(format,Targ...) \
+printk(KERN_ERR __FILE__ ": " __FUNCTION__ ": " format "\n" , ##Targ)s+
+#define WARN(format,Targ...) \
+printk(KERN_WARNING __FILE__ ": " __FUNCTION__ ": " format "\n" , ##Targ)s+
+#define INFO(format,Targ...) \
+printk(KERN_INFO __FILE__ ": " __FUNCTION__ ": " format "\n" , ##Targ)s+
+#includeR"st5481_hdlc.h"
+#includeR"fsm.h"
+#includeR"hisax_if.h"
+#includeR<linux/skbuff.h>
+
+/* ======================================================================
+ * FIFO handling
+ */s+
+/* Generic FIFO s ructure */ 
+s ruct fFfo {
+	u_char r,w,count,size;
+	spinlock_t lock;
+};
+
+/*
+ * Init an FIFO
+ */s+y  pF TinlineTES < fFfo_init(s ruct fFfo *fFfo, int size)
+{
+	fFfo->r = fFfo->w = fFfo->countR= 0;
+	fFfo->size = size;
+	spin_lock_init(&fFfo->lock);s+}
+
+/*
+ * Add an entryRto theRFIFO
+ */s+y  pF TinlineTint fFfo_add(s ruct fFfo *fFfo)
+{
+	unsigned long flags;
+	int index;
+
+	iUR	!fFfo)R{
+		retnsi -1;s+	}
+
+	spin_lock_irqsave(&fFfo->lock, flags);
+	iUR	fFfo->countR== fFfo->size)R{
+		// FIFO full
+		index = -1;s+	} else {
+		// Retnsi index wher
 to getRtheRnextRda   to addRto theRFIFO
+		index = fFfo->w++ &R	fFfo->size-1); s+		fFfo->count++;s+	}
+	spin_unlock_irqrestore(&fFfo->lock, flags);
+	retnsi index;s+}
+
+/*
+ * Remove an entryRfrom theRFIFO with theRindex retnsied.
+ */s+y  pF TinlineTint fFfo_remove(s ruct fFfo *fFfo)
+{
+	unsigned long flags;
+	int index;
+
+	iUR	!fFfo)R{
+		retnsi -1;s+	}
+
+	spin_lock_irqsave(&fFfo->lock, flags);		
+	iUR	!fFfo->count)R{
+		// FIFO empty
+		index = -1;s+	} else {
+		// Retnsi index wher
 to getRtheRnextRda   from theRFIFO
+		index = fFfo->r++ &R	fFfo->size-1); s+		fFfo->count--;
+	}
+	spin_unlock_irqrestore(&fFfo->lock, flags);
+
+	retnsi index;s+}
+
+/* ======================================================================
+ * controlRpipe
+ */s+typedef ES < (*ctrl_complete_t)(ES < *);
+
+typedef s ruct ctrl_msg {
+	devrequest dr;s+	ctrl_complete_t complete;s+	ES < *context;s+} ctrl_msg; 
+
+/* FIFO of ctrl messagesRwaitingRto be sent */
+#define MAX_EP0_MSG 16
+s ruct ctrl_msg_fFfo {
+	s ruct fFfo f;
+	s ruct ctrl_msg da  [MAX_EP0_MSG];
+};	
+
+#define MAX_DFRAME_LEN_L1	300
+#define HSCX_BUFMAX	4096
+
+s ruct st5481_ctrl {
+	s ruct ctrl_msg_fFfo msg_fFfo;
+	unsigned long busy;
+	s ruct urb *urb;
+};
+
+s ruct st5481_intr {
+  //	s ruct evt_fFfo evt_fFfo;
+	s ruct urb *urb;
+};
+
+s ruct st5481_d_out {
+	s ruct hdlc_vars hdlc_y  pe;
+	s ruct urb *urb[2]; /* double buffering */
+	unsigned long busy;
+	s ruct sk_buff *tx_skb;
+	s ruct FsmInst fsm;
+};
+
+s ruct st5481_b_out {
+	s ruct hdlc_vars hdlc_y  pe;
+	s ruct urb *urb[2]; /* double buffering */
+	u_char flow_event;s+	u_long busy;
+	s ruct sk_buff *tx_skb;
+};
+
+s ruct st5481_in {
+	s ruct hdlc_vars hdlc_y  pe;
+	s ruct urb *urb[2]; /* double buffering */
+	int mode;
+	int bufsize;
+	unsigned int num_packets;
+	unsigned int packet_size;
+	unsigned char ep, counter;
+	unsigned char *rcvbuf;
+	s ruct st5481_adapter *adapter;
+	s ruct hisax_if *hisax_if;
+};
+
+int st5481_setup_in(s ruct st5481_in *in);
+ES < st5481_release_in(s ruct st5481_in *in);
+ES < st5481_in_mode(s ruct st5481_in *in,Rint mode);
+
+s ruct st5481_bcs {
+	s ruct hisax_b_if b_if;
+	s ruct st5481_adapter *adapter;
+	s ruct st5481_in b_in;
+	s ruct st5481_b_out b_out;
+	int channel;
+	int mode;
+};
+
+s ruct st5481_adapter {
+	s ruct list_head list;
+	int number_of_leds;
+	s ruct usb_devic
 *usb_dev;
+	s ruct hisax_d_if hisax_d_if;
+
+	s ruct st5481_ctrl ctrl;
+	s ruct st5481_intr intr;
+	s ruct st5481_in d_in;
+	s ruct st5481_d_out d_out;
+
+	unsigned char leds;
+	unsigned int led_counter;
+
+	unsigned long event;s+
+	s ruct FsmInst l1m;
+	s ruct FsmTimer timer;
+
+	s ruct st5481_bcs bcs[2];
+};
+
+#define TIMER3_VALUE 7000
+
+/* ======================================================================
+ *
+ */s+
+/*
+ * Submit an URB with error reporting. This is a macro so
+ * theR__FUNCTION__ retnsis theRcallerRfunction name.
+ */s+#define SUBMIT_URB(urb) \
+({ \
+	int y  pus; \
+	iUR	(s  pus = usb_submit_urb(urb)) < 0) { \
+		WARN("usb_submit_urb failed,s  pus=%d", y  pus); \
+	} \
+        y  pus; \
+})s+
+/*
+ * USB double buffering, retnsi theRURB index (0 or 1).
+ */s+y  pF TinlineTint get_buf_nr(s ruct urb *urbs[], s ruct urb *urb)
+{
+        retnsi (urbs[0]==urb ? 0 : 1); s+}
+
+/* ---------------------------------------------------------------------- */s+
+/* B Channel */s+
+int  st5481_setup_b(s ruct st5481_bcs *bcs);
+ES < st5481_release_b(s ruct st5481_bcs *bcs);
+ES < st5481_d_l2l1(s ruct hisax_if *hisax_d_if, int pr,TES < *arg);
+
+/* D Channel */s+
+int  st5481_setup_d(s ruct st5481_adapter *adapter);
+ES < st5481_release_d(s ruct st5481_adapter *adapter);
+ES < st5481_b_l2l1(s ruct hisax_if *b_if, int pr,TES < *arg);
+int  st5481_d_init(ES <);
+ES < st5481_d_exit(ES <);
+
+/* USB */s+ES < st5481_ph_command(s ruct st5481_adapter *adapter,Tunsigned int command);
+int st5481_setup_isocpipes(s ruct urb* urb[2], s ruct usb_devic
 *dev, s+			   unsigned int pipe, int num_packets,s+			   int packet_size,Rint buf_size,s+			   usb_complete_t complete,TES < *context);
+ES < st5481_release_isocpipes(s ruct urb* urb[2]);s+
+int  st5481_isoc_flatten(s ruct urb *urb);
+ES < st5481_usb_pipe_reset(s ruct st5481_adapter *adapter,
+		    u_char pipe, ctrl_complete_t complete,TES < *context);
+ES < st5481_usb_ctrl_msg(s ruct st5481_adapter *adapter,
+		  u8 request, u8 requesttype, u16 value, u16 index,
+		  ctrl_complete_t complete,TES < *context);
+ES < st5481_usb_devic
_ctrl_msg(s ruct st5481_adapter *adapter,
+			 u8 request, u16 value,
+			 ctrl_complete_t complete,TES < *context);
+int  st5481_setup_usb(s ruct st5481_adapter *adapter);
+ES < st5481_release_usb(s ruct st5481_adapter *adapter);
+ES < st5481_y  rt(s ruct st5481_adapter *adapter);
+ES < st5481_y op(s ruct st5481_adapter *adapter);
+
+// ----------------------------------------------------------------------s+// debuggingRmacros
+
+#define __debug_variable st5481_debug
+#includeR"hisax_debug.h"
+
+#ifdef CONFIG_HISAX_DEBUG
+
+extesi int st5481_debug;
+
+#define DBG_ISO_PACKET(level,urb) \
+  iUR	level & __debug_variable) dump_iso_packet(__FUNCTION__,urb)
+
+y  pF TES < __attribute__((unused))
+dump_iso_packet(const char *name,urb_t *urb)
+{
+	int i,j;
+	int len,ofs;
+	u_char *da  ;
+
+	printk(KERN_DEBUG "%s: packets=%d,errors=%d\n",
+	       name,urb->number_of_packets,urb->error_count);
+	for (iR= 0; i  < urb->number_of_packets; ++i) {
+		iUR	urb->pipe & USB_DIR_IN) {
+			len = urb->iso_frame_desc[i].actual_length;
+		} else {
+			len = urb->iso_frame_desc[i].length;
+		}
+		ofs = urb->iso_frame_desc[i].offset;
+		printk(KERN_DEBUG "len=%.2d,ofs=%.3d ",len,ofs);s+		iUR	len) {
+			da   = urb->transfer_buffer+ofs;
+			for (j=0; j < len; j++) {
+				printk ("%.2x", da  [j]);s+			}
+		}
+		printk("\n");s+	}
+}
+
+y  pF TinlineTconst char *ST5481_CMD_string(int evt)
+{
+	s  pF Tchar s[16];
+
+	switch (evt) {
+	case ST5481_CMD_DR: retnsi "DR";
+	case ST5481_CMD_RES: retnsi "RES";
+	case ST5481_CMD_TM1: retnsi "TM1";
+	case ST5481_CMD_TM2: retnsi "TM2";
+	case ST5481_CMD_PUP: retnsi "PUP";
+	case ST5481_CMD_AR8: retnsi "AR8";
+	case ST5481_CMD_AR10: retnsi "AR10";
+	case ST5481_CMD_ARL: retnsi "ARL";
+	case ST5481_CMD_PDN: retnsi "PDN";
+	};
+	
+	sprintf(s,"0x%x",evt);
+	retnsi s;
+}	
+
+#else
+
+#define DBG_ISO_PACKET(level,urb) do {} whF 
 (0)
+
+#endiU
+
+
+
+#endiU 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/st5481_b.c linux/drivers/isdn/hisax/st5481_b.c
--- v2.4.9/linux/drivers/isdn/hisax/st5481_b.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/isdn/hisax/st5481_b.c	Sun Sep  9 10:45:43 2001
@@ -0,0 +1,367 @@
+/*
+ * DriverRfor ST5481 USB ISDN modem
+ *
+ * Author       FrodeRIsaksen
+ * Copyright    2001 by FrodeRIsaksen      <fisaksen@bewan.com>
+ *              2001 by Kai Germaschewski  <kai.germaschewski@gmx.de>
+ * 
+ * This softwareRmay be used andRdistributed accordingRto theRterms
+ * of theRGNU General PublF TLicense,Rincorporated her
in by refer
nce.
+ *
+ */s+
+#includeR<linux/version.h>
+#includeR<linux/module.h>
+#includeR<linux/init.h>
+#includeR<linux/usb.h>
+#includeR<linux/slab.h>
+#includeR<linux/netdevic
.h>
+#includeR"st5481.h"
+
+y  pF TinlineTES < B_L1L2(s ruct st5481_bcs *bcs, int pr,TES < *arg)
+{
+	s ruct hisax_if *ifcT= 	s ruct hisax_if *) &bcs->b_if;
+
+	ifc->l1l2(ifc, pr,Targ);
+}s+
+/*
+ * EncodeRandRtransmit nextRframe.
+ */s+y  pF TES < usb_b_out(s ruct st5481_bcs *bcs,int buf_nr)
+{
+	s ruct st5481_b_out *b_out = &bcs->b_out;
+	s ruct st5481_adapter *adapterT= bcs->adapter;
+	s ruct urb *urb;
+	unsigned int packet_size,offset;
+	int len,buf_size,bytes_sent;s+	int i;
+	s ruct sk_buff *skb;
+	
+	iUR	test_and_set_bit(buf_nr, &b_out->busy)) {
+		DBG(4,"ep %d urb %d busy",(bcy->channel+1)*2,buf_nr);
+		retnsi;
+	}
+	urb = b_out->urb[buf_nr];
+
+	// Adjust isoc buffer size accordingRto flow y  pe
+	iU(b_out->flow_event &R	OUT_DOWN | OUT_UNDERRUN)) {
+		buf_size = NUM_ISO_PACKETS_B*SIZE_ISO_PACKETS_B_OUT + B_FLOW_ADJUST;
+		packet_size = SIZE_ISO_PACKETS_B_OUT + B_FLOW_ADJUST;
+		DBG(4,"B%d,adjust flow,addR%d bytes",bcy->channel+1,B_FLOW_ADJUST);s+	} else iU(b_out->flow_event &ROUT_UP){
+		buf_size = NUM_ISO_PACKETS_B*SIZE_ISO_PACKETS_B_OUT - B_FLOW_ADJUST;
+		packet_size = SIZE_ISO_PACKETS_B_OUT - B_FLOW_ADJUST;
+		DBG(4,"B%d,adjust flow,removeR%d bytes",bcy->channel+1,B_FLOW_ADJUST);s+	} else {
+		buf_size = NUM_ISO_PACKETS_B*SIZE_ISO_PACKETS_B_OUT;
+		packet_size = 8;
+	}
+	b_out->flow_event = 0;
+
+	len = 0;
+	whF 
 (len < buf_size) {
+		iUR	(skbR= b_out->tx_skb)) {
+			DBG_SKB(0x100,Rskb);
+			DBG(4,"B%d,len=%d",bcy->channel+1,skb->len);
+			
+			iUR	bcy->modeR== L1_MODE_TRANS) {	
+				bytes_sentR= buf_size - len;
+				iUR	skb->len < bytes_sent)
+					bytes_sentR= skb->len;
+
+				memcpy(urb->transfer_buffer+len, skb->da  , bytes_sent);
+				
+				len += bytes_sent;s+			} else {
+				len += hdlc_encode(&b_out->hdlc_y  pe, s+						   skb->da  , skb->len, &bytes_sent,s+						   urb->transfer_buffer+len, buf_size-len);
+			}
+
+			skb_pull	skb, bytes_sent);
+			
+			iUR	!skb->len) {
+				// Frame sent
+				b_out->tx_skb = NULL;
+				B_L1L2(bcs, PH_DATA | CONFIRM, (ES < *) skb-> ruesize);
+				dev_kfree_skb_any(skb);
+				
+/* 				iUR	!(bcy->tx_skbR= skb_dequeue(&bcs->sq))) { */s+/* 					st5481B_sched_event(bcs, B_XMTBUFREADY); */s+/* 				} */
+			}
+		} else {
+			iUR	bcy->modeR== L1_MODE_TRANS) {
+				memset(urb->transfer_buffer+len, 0xff, buf_size-len);
+				len = buf_size;s+			} else {
+				// Send flags
+				len += hdlc_encode(&b_out->hdlc_y  pe, s+						   NULL, 0, &bytes_sent,s+						   urb->transfer_buffer+len, buf_size-len);
+			}
+		}	s+	}
+
+	// PrepareRtheRURB
+	for (iR= 0, offset = 0; offset < len; i++) {
+		urb->iso_frame_desc[i].offset = offset;
+		urb->iso_frame_desc[i].lengthR= packet_size;
+		offset += packet_size;
+		packet_size = SIZE_ISO_PACKETS_B_OUT;
+	}
+	urb->transfer_buffer_lengthR= len;
+	urb->number_of_packetsR= i;
+	urb->devR= adapter->usb_dev;
+
+	DBG_ISO_PACKET(0x200,urb);
+
+	SUBMIT_URB(urb);
+}s+
+/*
+ * S  rt transferingR(flags or da  ) on theRB channel, since
+ * FIFO counters has been setRtoRa non-zero value.
+ */s+y  pF TES < st5481B_s  rt_xfer(ES < *context)
+{
+	s ruct st5481_bcs *bcsT= context;s+
+	DBG(4,"B%d",bcy->channel+1);
+
+	// S  rt transmittingR(flags or da  ) on B channel
+
+	usb_b_out(bcs,0);
+	usb_b_out(bcs,1);
+}s+
+/*
+ * If theRadapterThas only 2RLEDs, theRgreen
+ * LED wF l blink with   rateTdepending
+ * on theRnumberRof channels opened.
+ */s+y  pF TES < led_blink(s ruct st5481_adapter *adapter)
+{
+	u_char ledsR= adapter->leds;
+
+	// 50Rframes/sec for eachTchannel
+	iUR	++adapter->led_counter % 50)R{
+		retnsi;s+	}
+
+	iUR	adapter->led_counter % 100)R{
+		ledsR|= GREEN_LED;s+	} else {
+		ledsR&= ~GREEN_LED;s+	}
+	
+	st5481_usb_devic
_ctrl_msg(adapter,TGPIO_OUT, leds, NULL, NULL);
+}s+
+y  pF TES < usb_b_out_complete(s ruct urb *urb)
+{
+	s ruct st5481_bcs *bcsT= urb->context;s+	s ruct st5481_b_out *b_out = &bcs->b_out;
+	s ruct st5481_adapter *adapterT= bcs->adapter;
+	int buf_nr;
+	
+	buf_nrT= get_buf_nr(b_out->urb, urb);
+	test_and_clear_bit(buf_nr, &b_out->busy);
+
+	iUR	urb->s  pus < 0) {
+		iUR	urb->s  pus != USB_ST_URB_KILLED) {
+			WARN("urb s  pus %d",urb->s  pus);
+			iUR	b_out->busyR== 0) {
+				st5481_usb_pipe_reset(adapter,T(bcy->channel+1)*2 | USB_DIR_OUT, NULL, NULL);
+			}
+		} else {
+			DBG(1,"urb kF led"); s+			retnsi; // Give up
+		}
+	}
+
+	usb_b_out(bcs,buf_nr);
+
+	iUR	adapter->number_of_leds == 2)
+		led_blink(adapter);
+}s+
+/*
+ * S  rt or stop theRtransfer on theRB channel.
+ */s+y  pF TES < st5481B_mode(s ruct st5481_bcs *bcs, int mode)
+{
+	s ruct st5481_b_out *b_out = &bcs->b_out;
+	s ruct st5481_adapter *adapterT= bcs->adapter;
+
+	DBG(4,"B%d,mode=%d", bcy->channel + 1, mode);
+
+	iUR	bcy->modeR== mode)
+		retnsi;s+
+	bcy->modeR= mode;
+
+	// CancelRall USB transfers on this B channel
+	usb_unlink_urb(b_out->urb[0]);
+	usb_unlink_urb(b_out->urb[1]);
+	b_out->busyR= 0;
+
+	st5481_in_mode(&bcs->b_in, mode);
+	iUR	bcy->modeR!= L1_MODE_NULL)R{
+		// Open theRB channel
+		iUR	bcy->modeR!= L1_MODE_TRANS) {
+			hdlc_out_init(&b_out->hdlc_y  pe, 0, bcy->modeR== L1_MODE_HDLC_56K);s+		}s+		st5481_usb_pipe_reset(adapter,T(bcy->channel+1)*2, NULL, NULL);
+	
+		// Enable B channelRinterruptss+		st5481_usb_devic
_ctrl_msg(adapter,TFFMSK_B1+(bcy->channel*2), s+				    OUT_UP+OUT_DOWN+OUT_UNDERRUN, NULL, NULL);
+
+		// Enable B channelRFIFOss+		st5481_usb_devic
_ctrl_msg(adapter,TOUT_B1_COUNTER+(bcy->channel*2), 32, st5481B_s  rt_xfer, bcy);s+		iUR	adapter->number_of_leds == 4) {
+			iUR	bcy->channelR== 0) {
+				adapter->ledsR|= B1_LED;s+			} else {
+				adapter->ledsR|= B2_LED;s+			}
+		}
+	} else {
+		// Disble B channelRinterruptss+		st5481_usb_devic
_ctrl_msg(adapter,TFFMSK_B1+(bcy->channel*2), 0, NULL, NULL);
+
+		// Disable B channelRFIFOss+		st5481_usb_devic
_ctrl_msg(adapter,TOUT_B1_COUNTER+(bcy->channel*2), 0, NULL, NULL);
+
+		iUR	adapter->number_of_leds == 4) {
+			iUR	bcy->channelR== 0) {
+				adapter->ledsR&= ~B1_LED;s+			} else {
+				adapter->ledsR&= ~B2_LED;s+			}
+		} else {
+			st5481_usb_devic
_ctrl_msg(adapter,TGPIO_OUT, adapter->leds, NULL, NULL);
+		}s+		iUR	b_out->tx_skb) {
+			dev_kfree_skb_any(b_out->tx_skb);s+			b_out->tx_skb = NULL;
+		}s+		s+	}
+}
+
+y  pF Tint __devinit st5481_setup_b_out(s ruct st5481_bcs *bcs)
+{
+	s ruct usb_devic
 *devT= bcs->adapter->usb_dev;
+	s ruct usb_interface_descriptor *altsetting;
+	s ruct usb_endpoint_descriptor *endpoint;
+  	s ruct st5481_b_out *b_out = &bcs->b_out;
+
+	DBG(4,"");
+
+	altsetting = &(dev->config->interface[0].altsetting[3]);
+
+	// Alloc peRURBs andRbuffers for theRB channelRout
+	endpoint = &altsetting->endpoint[EP_B1_OUT - 1 + bcy->channelR* 2];
+
+	DBG(4,"endpoint address=%02x,packet size=%d",
+	    endpoint->bEndpointAddress,endpoint->wMaxPacketSize);
+
+	// Alloc peRmemoryRfor 8000bytes/sec + extra bytes iURunderrun
+	retnsi st5481_setup_isocpipes(b_out->urb, dev, s+				      usb_sndisocpipe(dev, endpoint->bEndpointAddress),s+				      NUM_ISO_PACKETS_B, SIZE_ISO_PACKETS_B_OUT,s+				      NUM_ISO_PACKETS_B * SIZE_ISO_PACKETS_B_OUT + B_FLOW_ADJUST,s+				      usb_b_out_complete, bcy);s+}
+
+y  pF TES < __devexit st5481_release_b_out(s ruct st5481_bcs *bcs)
+{
+	s ruct st5481_b_out *b_out = &bcs->b_out;
+
+	DBG(4,"");
+
+	st5481_release_isocpipes(b_out->urb);s+}
+
+int __devinit st5481_setup_b(s ruct st5481_bcs *bcs)
+{
+	int retval;
+
+	DBG(4,"");
+
+	retvalR= st5481_setup_b_out(bcs);
+	iUR	retval)
+		gotoRerr;
+	bcy->b_in.bufsizeR= HSCX_BUFMAX;
+	bcy->b_in.num_packets = NUM_ISO_PACKETS_B;
+	bcy->b_in.packet_size = SIZE_ISO_PACKETS_B_IN;
+	bcy->b_in.ep = 	bcy->channelR? EP_B2_IN : EP_B1_IN) | USB_DIR_IN;
+	bcy->b_in.counter = bcy->channelR? IN_B2_COUNTER : IN_B1_COUNTER;
+	bcy->b_in.adapterT= bcs->adapter;
+	bcy->b_in.hisax_if = &bcs->b_if.ifc;
+	retvalR= st5481_setup_in(&bcs->b_in);
+	iUR	retval)
+		gotoRerr_b_out;
+
+
+	retnsi 0;
+
+Rerr_b_out:
+	st5481_release_b_out(bcs);
+Rerr:
+	retnsi retval;
+}
+
+/*
+ * ReleaseRbuffers andRURBs for theRB channels
+ */s+ES < __devexit st5481_release_b(s ruct st5481_bcs *bcs)
+{
+	DBG(4,"");
+
+	st5481_release_in(&bcs->b_in);
+	st5481_release_b_out(bcs);
+}
+
+/*
+ * st5481_b_l2l1 is theRentryRpoint for upperTlayerRroutines that want to
+ * transmit on theRB channel.  PH_DATA | REQUEST is a normalRpacket that
+ * weReither st rt transmittingR(if idle) or queueR(if busy).
+ * PH_PULL | REQUEST can be calledRto request a callback message
+ * (PH_PULL | CONFIRM)
+ * onceRtheRlink is idle.  AfterTa "pull" callback, theRupperTlayer
+ * routines can use PH_PULL | INDICATIONRto send da  .
+ */s+ES < st5481_b_l2l1(s ruct hisax_if *ifc, int pr,TES < *arg)
+{
+	s ruct st5481_bcs *bcsT= ifc->priv;
+	s ruct sk_buff *skbR= arg;
+	int mode;
+
+	DBG(4, "");
+
+	switch (pr) {
+	case PH_DATA | REQUEST:
+		iUR	bcy->b_out.tx_skb)s+			BUG();s+		
+		bcy->b_out.tx_skbR= skb;s+		break;
+	case PH_ACTIVATE | REQUEST:
+		modeR= (int) arg;
+		DBG(4,"B%d,PH_ACTIVATE_REQUEST %d", bcy->channel + 1, mode);
+		st5481B_mode(bcs, mode);
+		B_L1L2(bcs, PH_ACTIVATE | INDICATION, NULL);
+		break;
+	case PH_DEACTIVATE | REQUEST:
+		DBG(4,"B%d,PH_DEACTIVATE_REQUEST", bcy->channel + 1);
+		st5481B_mode(bcs, L1_MODE_NULL);
+		B_L1L2(bcs, PH_DEACTIVATE | INDICATION, NULL);
+		break;
+	default:
+		WARN("pr %#x\n", pr);s+	}
+}
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/st5481_d.c linux/drivers/isdn/hisax/st5481_d.c
--- v2.4.9/linux/drivers/isdn/hisax/st5481_d.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/isdn/hisax/st5481_d.c	Sun Sep  9 10:45:43 2001
@@ -0,0 +1,774 @@
+/*
+ * DriverRfor ST5481 USB ISDN modem
+ *
+ * Author       FrodeRIsaksen
+ * Copyright    2001 by FrodeRIsaksen      <fisaksen@bewan.com>
+ *              2001 by Kai Germaschewski  <kai.germaschewski@gmx.de>
+ * 
+ * This softwareRmay be used andRdistributed accordingRto theRterms
+ * of theRGNU General PublF TLicense,Rincorporated her
in by refer
nce.
+ *
+ */s+
+#includeR<linux/version.h>
+#includeR<linux/module.h>
+#includeR<linux/init.h>
+#includeR<linux/usb.h>
+#includeR<linux/slab.h>
+#includeR<linux/netdevic
.h>
+#includeR"st5481.h"
+
+y  pF TES < ph_connect(s ruct st5481_adapter *adapter);
+y  pF TES < ph_disconnect(s ruct st5481_adapter *adapter);
+
+y  pF Ts ruct Fsm l1fsm;
+
+y  pF Tchar *s rL1S  pe[] =
+{
+	"ST_L1_F3",
+	"ST_L1_F4",
+	"ST_L1_F6",
+	"ST_L1_F7",
+	"ST_L1_F8",
+};
+
+s  pF Tchar *s rL1Event[] =
+{
+	"EV_IND_DP",  
+	"EV_IND_1",   
+	"EV_IND_2",   
+	"EV_IND_3",   
+	"EV_IND_RSY", 
+	"EV_IND_5",   
+	"EV_IND_6",   
+	"EV_IND_7",   
+	"EV_IND_AP",  
+	"EV_IND_9",   
+	"EV_IND_10",  
+	"EV_IND_11",  
+	"EV_IND_AI8",
+	"EV_IND_AI10",
+	"EV_IND_AIL",
+	"EV_IND_DI",  
+	"EV_PH_ACTIVATE_REQ",
+	"EV_PH_DEACTIVATE_REQ",
+	"EV_TIMER3",
+};
+
+s  pF TinlineTES < D_L1L2(s ruct st5481_adapter *adapter,Tint pr,TES < *arg)
+{
+	s ruct hisax_if *ifcT= 	s ruct hisax_if *) &adapter->hisax_d_if;
+
+	ifc->l1l2(ifc, pr,Targ);
+}s+
+y  pF TES <
+l1_go_f3(s ruct FsmInst *fi,Tint event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fi->userda  ;
+
+	iUR	fF->s  peR== ST_L1_F7)s+		ph_disconnect(adapter);
+	
+	FsmChangeS  pe(fi,TST_L1_F3);
+	D_L1L2(adapter,TPH_DEACTIVATE | INDICATION, NULL);
+}s+
+y  pF TES <
+l1_go_f6(s ruct FsmInst *fi,Tint event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fi->userda  ;
+
+	iUR	fF->s  peR== ST_L1_F7)s+		ph_disconnect(adapter);
+
+	FsmChangeS  pe(fi,TST_L1_F6);
+}s+
+y  pF TES <
+l1_go_f7(s ruct FsmInst *fi,Tint event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fi->userda  ;
+
+	FsmDelTimer(&adapter->timer, 0);
+	ph_connect(adapter);
+	FsmChangeS  pe(fi,TST_L1_F7);
+	D_L1L2(adapter,TPH_ACTIVATE | INDICATION, NULL);
+}s+
+y  pF TES <
+l1_go_f8(s ruct FsmInst *fi,Tint event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fi->userda  ;
+
+	iUR	fF->s  peR== ST_L1_F7)s+		ph_disconnect(adapter);
+
+	FsmChangeS  pe(fi,TST_L1_F8);
+}s+
+y  pF TES <
+l1_timer3(s ruct FsmInst *fi,Tint event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fi->userda  ;
+
+	st5481_ph_command(adapter,TST5481_CMD_DR);
+	FsmChangeS  pe(fi,TST_L1_F3);
+	D_L1L2(adapter,TPH_DEACTIVATE | INDICATION, NULL);
+}s+
+y  pF TES <
+l1_ignore(s ruct FsmInst *fi,Tint event,TES < *arg)
+{
+}s+
+y  pF TES <
+l1_activate(s ruct FsmInst *fi,Tint event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fi->userda  ;
+
+	st5481_ph_command(adapter,TST5481_CMD_DR);
+	st5481_ph_command(adapter,TST5481_CMD_PUP);
+	FsmRest rtTimer(&adapter->timer, TIMER3_VALUE, EV_TIMER3, NULL, 2);
+	st5481_ph_command(adapter,TST5481_CMD_AR8);
+	FsmChangeS  pe(fi,TST_L1_F4);
+}s+
+y  pF Ts ruct FsmNodeRL1FnList[] __initda   =
+{
+	{ST_L1_F3, EV_IND_DP,            l1_ignore},
+	{ST_L1_F3, EV_IND_AP,            l1_go_f6},
+	{ST_L1_F3, EV_IND_AI8,           l1_go_f7},
+	{ST_L1_F3, EV_IND_AI10,          l1_go_f7},
+	{ST_L1_F3, EV_PH_ACTIVATE_REQ,   l1_activate},
+
+	{ST_L1_F4, EV_TIMER3,            l1_timer3},
+	{ST_L1_F4, EV_IND_DP,            l1_go_f3},
+	{ST_L1_F4, EV_IND_AP,            l1_go_f6},
+	{ST_L1_F4, EV_IND_AI8,           l1_go_f7},
+	{ST_L1_F4, EV_IND_AI10,          l1_go_f7},
+
+	{ST_L1_F6, EV_TIMER3,            l1_timer3},
+	{ST_L1_F6, EV_IND_DP,            l1_go_f3},
+	{ST_L1_F6, EV_IND_AP,            l1_ignore},
+	{ST_L1_F6, EV_IND_AI8,           l1_go_f7},
+	{ST_L1_F6, EV_IND_AI10,          l1_go_f7},
+	{ST_L1_F7, EV_IND_RSY,           l1_go_f8},
+
+	{ST_L1_F7, EV_IND_DP,            l1_go_f3},
+	{ST_L1_F7, EV_IND_AP,            l1_go_f6},
+	{ST_L1_F7, EV_IND_AI8,           l1_ignore},
+	{ST_L1_F7, EV_IND_AI10,          l1_ignore},
+	{ST_L1_F7, EV_IND_RSY,           l1_go_f8},
+
+	{ST_L1_F8, EV_TIMER3,            l1_timer3},
+	{ST_L1_F8, EV_IND_DP,            l1_go_f3},
+	{ST_L1_F8, EV_IND_AP,            l1_go_f6},
+	{ST_L1_F8, EV_IND_AI8,           l1_go_f8},
+	{ST_L1_F8, EV_IND_AI10,          l1_go_f8},
+	{ST_L1_F8, EV_IND_RSY,           l1_ignore},
+};
+
+s  pF TES < l1m_debug(s ruct FsmInst *fi,Tchar *fmt,T...)
+{
+	va_listTargs;
+	char buf[256];
+	
+	va_y  rt(args, fmt);
+	vsprintf(buf, fmt,Targs);
+	printk("buf %s\n", buf);
+	DBG(8, "%s", buf);
+	va_end(args);
+}
+
+/* ======================================================================
+ * D-ChannelRout
+ */s+
+/*
+  DTOUT y  peRmachine:
+  ====================
+
+  Transmit shortRframe (< 16 bytes of encoded da  ):
+
+  L1 FRAME    D_OUT_STATE           USB                  D CHANNEL
+  --------    -----------           ---                  ---------s+ 
+              FIXME
+
+ -> [xx..xx]  SHORT_INIT            -> [7Exx..xxC1C27EFF]
+              SHORT_WAIT_DEN        <> OUT_D_COUNTER=16 
+                                                 
+              END_OF_SHORT          <- DEN_EVENT         -> 7Exx
+                                                          xxxx 
+                                                          xxxxs+							  xxxx 
+							  xxxx
+							  xxxx
+							  C1C1 
+							  7EFF 
+              WAIT_FOR_RESET_IDLE   <- D_UNDERRUN        <- (8ms)                        
+              IDLE                  <> Reset pipe
+
+              
+
+  Transmit long frame (>= 16 bytes of encoded da  ):
+
+  L1 FRAME    D_OUT_STATE           USB                  D CHANNEL
+  --------    -----------           ---                  ---------s+
+ -> [xx...xx] IDLE
+              WAIT_FOR_STOP         <> OUT_D_COUNTER=0
+              WAIT_FOR_RESET        <> Reset pipe
+	      STOP
+	      INIT_LONG_FRAME       -> [7Exx..xx]
+              WAIT_DEN              <> OUT_D_COUNTER=16 
+              OUT_NORMAL            <- DEN_EVENT       -> 7Exx
+              END_OF_FRAME_BUSY     -> [xxxx]             xxxx 
+              END_OF_FRAME_NOT_BUSY -> [xxxx]             xxxxs+				    -> [xxxx]		  xxxx 
+				    -> [C1C2]		  xxxx
+				    -> [7EFF]		  xxxx
+							  xxxx 
+							  xxxx 
+                                                          ....
+							  xxxx
+							  C1C2
+							  7EFF
+	                 	    <- D_UNDERRUN      <- (> 8ms)                        
+              WAIT_FOR_STOP         <> OUT_D_COUNTER=0
+              WAIT_FOR_RESET        <> Reset pipe
+	      STOP
+
+*/          
+
+y  pF Ts ruct Fsm dout_fsm;
+
+y  pF Tchar *s rDoutS  pe[] =
+{
+	"ST_DOUT_NONE",
+
+	"ST_DOUT_SHORT_INIT",
+	"ST_DOUT_SHORT_WAIT_DEN",
+
+	"ST_DOUT_LONG_INIT",
+	"ST_DOUT_LONG_WAIT_DEN",
+	"ST_DOUT_NORMAL",
+
+	"ST_DOUT_WAIT_FOR_UNDERRUN",
+        "ST_DOUT_WAIT_FOR_NOT_BUSY",
+	"ST_DOUT_WAIT_FOR_STOP",
+	"ST_DOUT_WAIT_FOR_RESET",
+};
+
+s  pF Tchar *s rDoutEvent[] =
+{
+	"EV_DOUT_START_XMIT",
+	"EV_DOUT_COMPLETE",
+	"EV_DOUT_DEN",
+	"EV_DOUT_RESETED",
+	"EV_DOUT_STOPPED",
+	"EV_DOUT_COLL",
+	"EV_DOUT_UNDERRUN",
+};
+
+s  pF TES < dout_debug(s ruct FsmInst *fi,Tchar *fmt,T...)
+{
+	va_listTargs;
+	char buf[256];
+	
+	va_y  rt(args, fmt);
+	vsprintf(buf, fmt,Targs);
+	DBG(0x2, "%s", buf);
+	va_end(args);
+}
+
+s  pF TES < dout_stop_event(ES < *context)
+{
+	s ruct st5481_adapter *adapterT= context;s+
+	FsmEvent(&adapter->d_out.fsm, EV_DOUT_STOPPED, NULL);
+}s+
+/*
+ * S  rt theRtransfer of a D channelRframe.
+ */s+y  pF TES < usb_d_out(s ruct st5481_adapter *adapter,Tint buf_nr)
+{
+	s ruct st5481_d_out *d_out = &adapter->d_out;
+	s ruct urb *urb;
+	unsigned int num_packets, packet_offset;
+	int len, buf_size, bytes_sent;s+	s ruct sk_buff *skb;
+	iso_packet_descriptor_t *desc;
+
+	iUR	d_out->fsm.y  peR!= ST_DOUT_NORMAL)
+		retnsi;s+
+	iUR	test_and_set_bit(buf_nr, &d_out->busy)) {
+		DBG(2, "ep %d urb %d busy %#lx", EP_D_OUT, buf_nr, d_out->busy);
+		retnsi;
+	}
+	urb = d_out->urb[buf_nr];
+
+	skbR= d_out->tx_skb;s+
+	buf_size = NUM_ISO_PACKETS_D * SIZE_ISO_PACKETS_D_OUT;
+	
+	iUR	skb) {
+		len = hdlc_encode(&d_out->hdlc_y  pe, s+				  skb->da  , skb->len, &bytes_sent,s+				  urb->transfer_buffer, buf_size);
+		skb_pull	skb,bytes_sent);
+	} else {
+		// Send flags or idle
+		len = hdlc_encode(&d_out->hdlc_y  pe, s+				  NULL, 0, &bytes_sent,s+				  urb->transfer_buffer, buf_size);
+	}
+	
+	iUR	len < buf_size) {
+		FsmChangeS  pe(&d_out->fsm, ST_DOUT_WAIT_FOR_UNDERRUN);
+	}
+	iUR	skb && !skb->len) {
+		d_out->tx_skb = NULL;
+		D_L1L2(adapter,TPH_DATA | CONFIRM, NULL);
+		dev_kfree_skb_any(skb);
+	}
+
+	// PrepareRtheRURB
+	urb->transfer_buffer_lengthR= len;
+	num_packets = 0;
+	packet_offset = 0;
+	whF 
 (packet_offset < len) {
+		desc = &urb->iso_frame_desc[num_packets];
+		desc->offset = packet_offset;
+		desc->lengthR= SIZE_ISO_PACKETS_D_OUT;
+		iUR	len - packet_offset < desc->length)
+			desc->lengthR= len - packet_offset;
+		num_packets++;s+		packet_offset += desc->length;
+	}
+	urb->number_of_packetsR= num_packets;
+
+	// PrepareRtheRURB
+	urb->devR= adapter->usb_dev;
+	// NeedRto transmit theRnextRbuffer 2ms afterTtheRDEN_EVENT
+	urb->transfer_flags = 0;
+	urb->s  rt_frame = usb_get_current_frame_number(adapter->usb_dev)+2;
+
+	DBG_ISO_PACKET(0x20,urb);
+
+	iUR	usb_submit_urb(urb) < 0) {
+		// ThereRis another URB queued up
+		urb->transfer_flags = USB_ISO_ASAP;s+		SUBMIT_URB(urb);
+	}	s+}
+
+s  pF TES < fFfo_reseted(ES < *context)
+{
+	s ruct st5481_adapter *adapterT= context;s+
+	FsmEvent(&adapter->d_out.fsm, EV_DOUT_RESETED, NULL);
+}s+
+y  pF TES < usb_d_out_complete(s ruct urb *urb)
+{
+	s ruct st5481_adapter *adapterT= urb->context;s+	s ruct st5481_d_out *d_out = &adapter->d_out;
+	int buf_nr;
+	
+	DBG(2, "");
+
+	buf_nrT= get_buf_nr(d_out->urb, urb);
+	test_and_clear_bit(buf_nr, &d_out->busy);
+
+	iUR	urb->s  pus < 0) {
+		iUR	urb->s  pus != USB_ST_URB_KILLED) {
+			WARN("urb s  pus %d",urb->s  pus);
+			iUR	d_out->busyR== 0) {
+				st5481_usb_pipe_reset(adapter,TEP_D_OUT | USB_DIR_OUT, fFfo_reseted, adapter);
+			}
+			retnsi;
+		} else {
+			DBG(1,"urb kF led"); s+			retnsi; // Give up
+		}
+	}
+
+	FsmEvent(&adapter->d_out.fsm, EV_DOUT_COMPLETE, (ES < *) buf_nr);
+}
+
+/* ====================================================================== */s+
+s  pF TES < dout_st rt_xmit(s ruct FsmInst *fsm, int event,TES < *arg)
+{
+	// FIXME unify?
+	s ruct st5481_adapter *adapterT= fsm->userda  ;
+	s ruct st5481_d_out *d_out = &adapter->d_out;
+	s ruct urb *urb;
+	int len, bytes_sent;s+	s ruct sk_buff *skb;
+	int buf_nrR= 0;
+
+	skbR= d_out->tx_skb;s+
+	DBG(2,"len=%d",skb->len);
+
+	hdlc_out_init(&d_out->hdlc_y  pe, 1, 0);
+
+	iUR	test_and_set_bit(buf_nr, &d_out->busy)) {
+		WARN("ep %d urb %d busy %#lx", EP_D_OUT, buf_nr, d_out->busy);
+		retnsi;
+	}
+	urb = d_out->urb[buf_nr];
+
+	DBG_SKB(0x10,Rskb);
+	len = hdlc_encode(&d_out->hdlc_y  pe, s+			  skb->da  , skb->len, &bytes_sent,s+			  urb->transfer_buffer, 16);
+	skb_pull	skb, bytes_sent);
+
+	iU(len < 16)
+		FsmChangeS  pe(&d_out->fsm, ST_DOUT_SHORT_INIT);
+	else
+		FsmChangeS  pe(&d_out->fsm, ST_DOUT_LONG_INIT);
+
+	iUR	skb->len == 0) {
+		d_out->tx_skb = NULL;
+		D_L1L2(adapter,TPH_DATA | CONFIRM, NULL);
+		dev_kfree_skb_any(skb);
+	}
+
+// PrepareRtheRURB
+	urb->transfer_buffer_lengthR= len;
+
+	urb->iso_frame_desc[0].offset = 0;
+	urb->iso_frame_desc[0].lengthR= len;
+	urb->number_of_packetsR= 1;
+
+	// PrepareRtheRURB
+	urb->devR= adapter->usb_dev;
+	urb->transfer_flags = USB_ISO_ASAP;s+
+	DBG_ISO_PACKET(0x20,urb);
+	SUBMIT_URB(urb);
+}s+
+s  pF TES < dout_short_fFfo(s ruct FsmInst *fsm, int event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fsm->userda  ;
+	s ruct st5481_d_out *d_out = &adapter->d_out;
+
+	FsmChangeS  pe(&d_out->fsm, ST_DOUT_SHORT_WAIT_DEN);
+	st5481_usb_devic
_ctrl_msg(adapter,TOUT_D_COUNTER, 16, NULL, NULL);
+}s+
+y  pF TES < dout_end_short_frame(s ruct FsmInst *fsm, int event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fsm->userda  ;
+	s ruct st5481_d_out *d_out = &adapter->d_out;
+
+	FsmChangeS  pe(&d_out->fsm, ST_DOUT_WAIT_FOR_UNDERRUN);
+}s+
+y  pF TES < dout_long_enable_fFfo(s ruct FsmInst *fsm, int event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fsm->userda  ;
+	s ruct st5481_d_out *d_out = &adapter->d_out;
+    
+	st5481_usb_devic
_ctrl_msg(adapter,TOUT_D_COUNTER, 16, NULL, NULL);
+	FsmChangeS  pe(&d_out->fsm, ST_DOUT_LONG_WAIT_DEN);
+}s+
+y  pF TES < dout_long_den(s ruct FsmInst *fsm, int event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fsm->userda  ;
+	s ruct st5481_d_out *d_out = &adapter->d_out;
+
+	FsmChangeS  pe(&d_out->fsm, ST_DOUT_NORMAL);
+	usb_d_out(adapter,T0);
+	usb_d_out(adapter,T1);
+}s+
+y  pF TES < dout_reset(s ruct FsmInst *fsm, int event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fsm->userda  ;
+	s ruct st5481_d_out *d_out = &adapter->d_out;
+
+	FsmChangeS  pe(&d_out->fsm, ST_DOUT_WAIT_FOR_RESET);
+	st5481_usb_pipe_reset(adapter,TEP_D_OUT | USB_DIR_OUT, fFfo_reseted, adapter);
+}
+
+s  pF TES < dout_stop(s ruct FsmInst *fsm, int event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fsm->userda  ;
+	s ruct st5481_d_out *d_out = &adapter->d_out;
+
+	FsmChangeS  pe(&d_out->fsm, ST_DOUT_WAIT_FOR_STOP);
+	st5481_usb_devic
_ctrl_msg(adapter,TOUT_D_COUNTER, 0,Rdout_stop_event, adapter);
+}
+
+s  pF TES < dout_underrun(s ruct FsmInst *fsm, int event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fsm->userda  ;
+	s ruct st5481_d_out *d_out = &adapter->d_out;
+
+	iUR	test_bit(0, &d_out->busy) || test_bit(1, &d_out->busy)) {
+		FsmChangeS  pe(&d_out->fsm, ST_DOUT_WAIT_FOR_NOT_BUSY);
+	}  else {
+		dout_stop(fsm, event, arg);
+	}
+}
+
+y  pF TES < dout_check_busy(s ruct FsmInst *fsm, int event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fsm->userda  ;
+	s ruct st5481_d_out *d_out = &adapter->d_out;
+
+	iUR	!test_bit(0, &d_out->busy) && !test_bit(1, &d_out->busy))
+		dout_stop(fsm, event, arg);
+}s+
+y  pF TES < dout_reseted(s ruct FsmInst *fsm, int event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fsm->userda  ;
+	s ruct st5481_d_out *d_out = &adapter->d_out;
+
+	FsmChangeS  pe(&d_out->fsm, ST_DOUT_NONE);
+	// FIXME locking
+	iUR	d_out->tx_skb)s+		FsmEvent(&d_out->fsm, EV_DOUT_START_XMIT, NULL);
+}s+
+y  pF TES < dout_complete(s ruct FsmInst *fsm, int event,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= fsm->userda  ;
+	int buf_nrR= (int) arg;
+
+	usb_d_out(adapter,Tbuf_nr);
+}
+
+y  pF TES < dout_ignore(s ruct FsmInst *fsm, int event,TES < *arg)
+{
+}s+
+y  pF Ts ruct FsmNodeRDoutFnList[] __initda   =
+{
+	{ST_DOUT_NONE,                   EV_DOUT_START_XMIT,   dout_st rt_xmit},
+
+	{ST_DOUT_SHORT_INIT,             EV_DOUT_COMPLETE,     dout_short_fFfo},
+
+	{ST_DOUT_SHORT_WAIT_DEN,         EV_DOUT_DEN,          dout_end_short_frame},
+	{ST_DOUT_SHORT_WAIT_DEN,         EV_DOUT_UNDERRUN,     dout_underrun},
+
+	{ST_DOUT_LONG_INIT,              EV_DOUT_COMPLETE,     dout_long_enable_fFfo},
+
+	{ST_DOUT_LONG_WAIT_DEN,          EV_DOUT_DEN,          dout_long_den},
+	{ST_DOUT_LONG_WAIT_DEN,          EV_DOUT_UNDERRUN,     dout_underrun},
+
+	{ST_DOUT_NORMAL,                 EV_DOUT_UNDERRUN,     dout_underrun},
+	{ST_DOUT_NORMAL,                 EV_DOUT_COMPLETE,     dout_complete},
+
+	{ST_DOUT_WAIT_FOR_UNDERRUN,      EV_DOUT_UNDERRUN,     dout_underrun},
+	{ST_DOUT_WAIT_FOR_UNDERRUN,      EV_DOUT_COMPLETE,     dout_ignore},
+
+	{ST_DOUT_WAIT_FOR_NOT_BUSY,      EV_DOUT_COMPLETE,     dout_check_busy},
+
+	{ST_DOUT_WAIT_FOR_STOP,          EV_DOUT_STOPPED,      dout_reset},
+
+	{ST_DOUT_WAIT_FOR_RESET,         EV_DOUT_RESETED,      dout_reseted},
+};
+
+ES < st5481_d_l2l1(s ruct hisax_if *hisax_d_if, int pr,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= hisax_d_if->priv;
+	s ruct sk_buff *skbR= arg;
+
+	switch (pr) {
+	case PH_ACTIVATE | REQUEST:
+		FsmEvent(&adapter->l1m, EV_PH_ACTIVATE_REQ, NULL);
+		break;
+	case PH_DEACTIVATE | REQUEST:
+		FsmEvent(&adapter->l1m, EV_PH_DEACTIVATE_REQ, NULL);
+		break;
+	case PH_DATA | REQUEST:
+		DBG(2, "PH_DATA REQUEST len %d", ykb->len);
+		iUR	adapter->d_out.tx_skb)s+			BUG();s+s+		adapter->d_out.tx_skbR= skb;s+		FsmEvent(&adapter->d_out.fsm, EV_DOUT_START_XMIT, NULL);
+		break;
+	default:
+		WARN("pr %#x\n", pr);s+		break;
+	}
+}
+
+/* ======================================================================
+ */s+
+/*
+ * S  rt receivingRon theRD channelRsinceRentered y  peRF7.
+ */s+y  pF TES < ph_connect(s ruct st5481_adapter *adapter)
+{
+	s ruct st5481_d_out *d_out = &adapter->d_out;
+	s ruct st5481_in *d_in = &adapter->d_in;s+
+	DBG(8,"");
+		
+	FsmChangeS  pe(&d_out->fsm, ST_DOUT_NONE);
+
+	//	st5481_usb_devic
_ctrl_msg(adapter,TFFMSK_D, OUT_UNDERRUN, NULL, NULL);
+	st5481_usb_devic
_ctrl_msg(adapter,TFFMSK_D, 0xfc, NULL, NULL);
+	st5481_in_mode(d_in, L1_MODE_HDLC);
+
+#iURLOOPBACK
+	// Tnsi loopback on (da   sentRon B andRD looped back)
+	st5481_usb_devic
_ctrl_msg(cs, LBB, 0x04, NULL, NULL);
+#endiU
+
+	st5481_usb_pipe_reset(adapter,TEP_D_OUT | USB_DIR_OUT, NULL, NULL);
+
+	// Tnsi on theRgreen LED to tell that we areRin y  peRF7
+	adapter->ledsR|= GREEN_LED;s+	st5481_usb_devic
_ctrl_msg(adapter,TGPIO_OUT, adapter->leds, NULL, NULL);
+}s+
+/*
+ * S op receivingRon theRD channelRsinceRnotRin y  peRF7.
+ */s+y  pF TES < ph_disconnect(s ruct st5481_adapter *adapter)
+{
+	DBG(8,"");
+
+	st5481_in_mode(&adapter->d_in, L1_MODE_NULL);
+
+	// Tnsi off theRgreen LED to tell that we left y  peRF7
+	adapter->ledsR&= ~GREEN_LED;s+	st5481_usb_devic
_ctrl_msg(adapter,TGPIO_OUT, adapter->leds, NULL, NULL);
+}s+
+y  pF Tint __devinit st5481_setup_d_out(s ruct st5481_adapter *adapter)
+{
+	s ruct usb_devic
 *devT= adapter->usb_dev;
+	s ruct usb_interface_descriptor *altsetting;
+	s ruct usb_endpoint_descriptor *endpoint;
+	s ruct st5481_d_out *d_out = &adapter->d_out;
+
+	DBG(2,"");
+
+	altsetting = &(dev->config->interface[0].altsetting[3]);
+
+	// Alloc peRURBs andRbuffers for theRD channelRout
+	endpoint = &altsetting->endpoint[EP_D_OUT-1];
+
+	DBG(2,"endpoint address=%02x,packet size=%d",
+	    endpoint->bEndpointAddress,endpoint->wMaxPacketSize);
+
+	retnsi st5481_setup_isocpipes(d_out->urb, dev, s+				      usb_sndisocpipe(dev, endpoint->bEndpointAddress),s+				      NUM_ISO_PACKETS_D, SIZE_ISO_PACKETS_D_OUT,s+				      NUM_ISO_PACKETS_D * SIZE_ISO_PACKETS_D_OUT,s+				      usb_d_out_complete, adapter);
+}
+
+s  pF TES < __devexit st5481_release_d_out(s ruct st5481_adapter *adapter)
+{
+	s ruct st5481_d_out *d_out = &adapter->d_out;
+
+	DBG(2,"");
+
+	st5481_release_isocpipes(d_out->urb);s+}
+
+int __devinit st5481_setup_d(s ruct st5481_adapter *adapter)
+{
+	int retval;
+
+	DBG(2,"");
+
+	retvalR= st5481_setup_d_out(adapter);
+	iUR	retval)
+		gotoRerr;
+	adapter->d_in.bufsizeR= MAX_DFRAME_LEN_L1;
+	adapter->d_in.num_packets = NUM_ISO_PACKETS_D;
+	adapter->d_in.packet_size = SIZE_ISO_PACKETS_D_IN;
+	adapter->d_in.ep = EP_D_IN | USB_DIR_IN;
+	adapter->d_in.counter = IN_D_COUNTER;
+	adapter->d_in.adapterT= adapter;
+	adapter->d_in.hisax_if = &adapter->hisax_d_if.ifc;
+	retvalR= st5481_setup_in(&adapter->d_in);
+	iUR	retval)
+		gotoRerr_d_out;
+
+	adapter->l1m.fsm = &l1fsm;
+	adapter->l1m.s  peR=TST_L1_F3;
+	adapter->l1m.debugR= 1;
+	adapter->l1m.userda  T= adapter;
+	adapter->l1m.printdebugR= l1m_debug;
+	FsmInitTimer(&adapter->l1m, &adapter->timer);
+
+	adapter->d_out.fsm.fsm = &dout_fsm;
+	adapter->d_out.fsm.s  peR=TST_DOUT_NONE;
+	adapter->d_out.fsm.debugR= 1;
+	adapter->d_out.fsm.userda  T= adapter;
+	adapter->d_out.fsm.printdebugR= dout_debug;
+
+	retnsi 0;
+
+Rerr_d_out:
+	st5481_release_d_out(adapter);
+Rerr:
+	retnsi retval;
+}
+
+ES < __devexit st5481_release_d(s ruct st5481_adapter *adapter)
+{
+	DBG(2,"");
+
+	st5481_release_in(&adapter->d_in);
+	st5481_release_d_out(adapter);
+}
+
+/* ======================================================================
+ * init / exit
+ */s+
+int __init st5481_d_init(ES <)
+{
+	int retval;
+
+	l1fsm.s  pe_count = L1_STATE_COUNT;
+	l1fsm.event_count = L1_EVENT_COUNT;
+	l1fsm.s rEvent = s rL1Event;
+	l1fsm.s rS  peR=Ts rL1S  pe;
+	retvalR= FsmNew(&l1fsm,RL1FnList, ARRAY_SIZE(L1FnList));
+	iUR	retval)
+		gotoRerr;
+
+	dout_fsm.s  pe_count = DOUT_STATE_COUNT;
+	dout_fsm.event_count = DOUT_EVENT_COUNT;
+	dout_fsm.s rEvent = s rDoutEvent;
+	dout_fsm.s rS  peR=Ts rDoutS  pe;
+	retvalR= FsmNew(&dout_fsm,RDoutFnList, ARRAY_SIZE(DoutFnList));
+	iUR	retval)
+		gotoRerr_l1;
+
+	retnsi 0;
+
+Rerr_l1:
+	FsmFree(&l1fsm);
+Rerr:
+	retnsi retval;
+}
+
+// can't be __exit
+ES < st5481_d_exit(ES <)
+{
+	FsmFree(&l1fsm);
+	FsmFree(&dout_fsm);
+}
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/st5481_hdlc.c linux/drivers/isdn/hisax/st5481_hdlc.c
--- v2.4.9/linux/drivers/isdn/hisax/st5481_hdlc.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/isdn/hisax/st5481_hdlc.c	Sun Sep  9 10:45:43 2001
@@ -0,0 +1,620 @@
+/*
+ * DriverRfor ST5481 USB ISDN modem
+ *
+ * Author       FrodeRIsaksen
+ * Copyright    2001 by FrodeRIsaksen      <fisaksen@bewan.com>
+ *              2001 by Kai Germaschewski  <kai.germaschewski@gmx.de>
+ * 
+ * This softwareRmay be used andRdistributed accordingRto theRterms
+ * of theRGNU General PublF TLicense,Rincorporated her
in by refer
nce.
+ *
+ */s+
+#includeR"st5481_hdlc.h"
+
+y  pF Tconst unsigned shortRint crc16_tab[] = {
+	0x0000,0x1189,0x2312,0x329b,0x4624,0x57ad,0x6536,0x74bf,
+	0x8c48,0x9dc1,0xaf5a,0xbed3,0xca6c,0xdbe5,0xe97e,0xf8f7,
+	0x1081,0x0108,0x3393,0x221a,0x56a5,0x472c,0x75b7,0x643e,
+	0x9cc9,0x8d40,0xbfdb,0xae52,0xdaed,0xcb64,0xf9ff,0xe876,
+	0x2102,0x308b,0x0210,0x1399,0x6726,0x76af,0x4434,0x55bd,
+	0xad4a,0xbcc3,0x8e58,0x9fd1,0xeb6e,0xfae7,0xc87c,0xd9f5,
+	0x3183,0x200a,0x1291,0x0318,0x77a7,0x662e,0x54b5,0x453c,
+	0xbdcb,0xac42,0x9ed9,0x8f50,0xfbef,0xea66,0xd8fd,0xc974,
+	0x4204,0x538d,0x6116,0x709f,0x0420,0x15a9,0x2732,0x36bb,
+	0xce4c,0xdfc5,0xed5e,0xfcd7,0x8868,0x99e1,0xab7a,0xbaf3,
+	0x5285,0x430c,0x7197,0x601e,0x14a1,0x0528,0x37b3,0x263a,
+	0xdecd,0xcf44,0xfddf,0xec56,0x98e9,0x8960,0xbbfb,0xaa72,
+	0x6306,0x728f,0x4014,0x519d,0x2522,0x34ab,0x0630,0x17b9,
+	0xef4e,0xfec7,0xcc5c,0xddd5,0xa96a,0xb8e3,0x8a78,0x9bf1,
+	0x7387,0x620e,0x5095,0x411c,0x35a3,0x242a,0x16b1,0x0738,
+	0xffcf,0xee46,0xdcdd,0xcd54,0xb9eb,0xa862,0x9af9,0x8b70,
+	0x8408,0x9581,0xa71a,0xb693,0xc22c,0xd3a5,0xe13e,0xf0b7,
+	0x0840,0x19c9,0x2b52,0x3adb,0x4e64,0x5fed,0x6d76,0x7cff,
+	0x9489,0x8500,0xb79b,0xa612,0xd2ad,0xc324,0xf1bf,0xe036,
+	0x18c1,0x0948,0x3bd3,0x2a5a,0x5ee5,0x4f6c,0x7df7,0x6c7e,
+	0xa50a,0xb483,0x8618,0x9791,0xe32e,0xf2a7,0xc03c,0xd1b5,
+	0x2942,0x38cb,0x0a50,0x1bd9,0x6f66,0x7eef,0x4c74,0x5dfd,
+	0xb58b,0xa402,0x9699,0x8710,0xf3af,0xe226,0xd0bd,0xc134,
+	0x39c3,0x284a,0x1ad1,0x0b58,0x7fe7,0x6e6e,0x5cf5,0x4d7c,
+	0xc60c,0xd785,0xe51e,0xf497,0x8028,0x91a1,0xa33a,0xb2b3,
+	0x4a44,0x5bcd,0x6956,0x78df,0x0c60,0x1de9,0x2f72,0x3efb,
+	0xd68d,0xc704,0xf59f,0xe416,0x90a9,0x8120,0xb3bb,0xa232,
+	0x5ac5,0x4b4c,0x79d7,0x685e,0x1ce1,0x0d68,0x3ff3,0x2e7a,
+	0xe70e,0xf687,0xc41c,0xd595,0xa12a,0xb0a3,0x8238,0x93b1,
+	0x6b46,0x7acf,0x4854,0x59dd,0x2d62,0x3ceb,0x0e70,0x1ff9,
+	0xf78f,0xe606,0xd49d,0xc514,0xb1ab,0xa022,0x92b9,0x8330,
+	0x7bc7,0x6a4e,0x58d5,0x495c,0x3de3,0x2c6a,0x1ef1,0x0f78
+};
+
+
+
+enum {
+	HDLC_FAST_IDLE,HDLC_GET_FLAG_B0,HDLC_GETFLAG_B1A6,HDLC_GETFLAG_B7,
+	HDLC_GET_DATA,HDLC_FAST_FLAG
+};
+
+enum {
+	HDLC_SEND_DATA,HDLC_SEND_CRC1,HDLC_SEND_FAST_FLAG,
+	HDLC_SEND_FIRST_FLAG,HDLC_SEND_CRC2,HDLC_SEND_CLOSING_FLAG,
+	HDLC_SEND_IDLE1,HDLC_SEND_FAST_IDLE,HDLC_SENDFLAG_B0,
+	HDLC_SENDFLAG_B1A6,HDLC_SENDFLAG_B7,STOPPED
+};
+
+ES < 
+hdlc_rcv_init(s ruct hdlc_vars *hdlc, int do_adapt56)
+{
+   	hdlc->bit_shift = 0;
+	hdlc->hdlc_bits1 = 0;
+	hdlc->da  _bits = 0;
+	hdlc->ffbit_shift = 0;
+	hdlc->da  _received = 0;
+	hdlc->s  peR=THDLC_GET_DATA;
+	hdlc->do_adapt56R= do_adapt56;
+	hdlc->dchannelR= 0;
+	hdlc->crcR= 0;
+	hdlc->cbin = 0;
+	hdlc->shift_reg = 0;
+	hdlc->ffvalue = 0;
+	hdlc->dstpos = 0;
+}
+
+ES < 
+hdlc_out_init(s ruct hdlc_vars *hdlc, int is_d_channel, int do_adapt56)
+{
+   	hdlc->bit_shift = 0;
+	hdlc->hdlc_bits1 = 0;
+	hdlc->da  _bits = 0;
+	hdlc->ffbit_shift = 0;
+	hdlc->da  _received = 0;
+	hdlc->do_closing = 0;
+	hdlc->ffvalue = 0;
+	iUR	is_d_channel) {
+		hdlc->dchannelR= 1;
+		hdlc->s  peR=THDLC_SEND_FIRST_FLAG;
+	} else {
+		hdlc->dchannelR= 0;
+		hdlc->s  peR=THDLC_SEND_FAST_FLAG;
+		hdlc->ffvalue = 0x7e;
+	} 
+	hdlc->cbin = 0x7e;
+	hdlc->bit_shift = 0;
+	if(do_adapt56){
+		hdlc->do_adapt56R= 1;		
+		hdlc->da  _bits = 0;
+		hdlc->s  peR=THDLC_SENDFLAG_B0;
+	} else {
+		hdlc->do_adapt56R= 0;		
+		hdlc->da  _bits = 8;
+	}
+	hdlc->shift_reg = 0;
+}s+
+/*
+  hdlc_decodeR- decodesTHDLCRframesRfrom a transparent bit stream.
+
+  TheRsourceRbufferRis scannedRfor val < HDLCRframesRlookingRfor
+  flags (01111110)Rto indic peRtheRst rt of a frame. If theRst rt of
+  theRframe is found, theRbit stuffingRis removed (0 afterT5 1's).
+  When a new flag is found, theRcompleteRframe has been received
+  andRtheRCRC is checked.
+  If a val < frame is found, theRfunctioi returns theRframe lengthR
+  excludingRtheRCRC with theRbit HDLC_END_OF_FRAME set.
+  If theRbeginningRof a val < frame is found, theRfunctioi returns
+  theRlength. 
+  If a framingRerror is found (too many 1s andRnotRa flag) theRfunctioi 
+  returns theRlengthRwith theRbit HDLC_FRAMING_ERROR set.
+  If aRCRC error is found theRfunctioi returns theRlengthRwith the
+  bit HDLC_CRC_ERROR set.
+  If theRframe lengthRexceedsRtheRdestinatioi bufferRsize, theRfunctioi
+  returns theRlengthRwith theRbit HDLC_LENGTH_ERROR set.
+
+  srcR-RsourceRbuffer
+  slen - sourceRbufferRlength
+  count -RnumberRof bytes removed (decoded)Rfrom theRsourceRbuffer
+  dst _Rdestinatioi buffer
+  dsize -Rdestinatioi bufferRsize
+  returns -RnumberRof decoded bytes inRtheRdestinatioi bufferRandRs  pus
+  flag.
+ */s+int hdlc_decode(s ruct hdlc_vars *hdlc, const unsigned char *src,
+		int slen, int *count, unsigned char *dst, int dsize)
+{
+	int s  pus=0;
+
+	st pF Tconst unsigned char fast_flag[]={
+		0x00,0x00,0x00,0x20,0x30,0x38,0x3c,0x3e,0x3f
+	};
+
+	st pF Tconst unsigned char fast_flag_value[]={
+		0x00,0x7e,0xfc,0xf9,0xf3,0xe7,0xcf,0x9f,0x3f
+	};
+
+	st pF Tconst unsigned char fast_abort[]={
+		0x00,0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff
+	};
+
+	*count = slen;
+
+	whF 
(slen > 0){
+		iU(hdlc->bit_shift==0){
+			hdlc->cbin = *src++;s+			slen--;
+			hdlc->bit_shift = 8;
+			iU(hdlc->do_adapt56){
+				hdlc->bit_shift --;
+			}
+		}
+
+		switch(hdlc->s  pe){
+		case STOPPED:s+			retnsi 0;
+		case HDLC_FAST_IDLE:
+			iU(hdlc->cbin == 0xff){
+				hdlc->bit_shift = 0;
+				break;
+			}
+			hdlc->s  peR=THDLC_GET_FLAG_B0;
+			hdlc->hdlc_bits1 = 0;
+			hdlc->bit_shift = 8;
+			break;
+		case HDLC_GET_FLAG_B0:
+			iU(!(hdlc->cbin & 0x80)) {
+				hdlc->s  peR=THDLC_GETFLAG_B1A6;
+				hdlc->hdlc_bits1 = 0;
+			} else {
+				iU(!hdlc->do_adapt56){
+					iU(++hdlc->hdlc_bits1 >=8 ) iU(hdlc->bit_shift==1)
+						hdlc->s  peR=THDLC_FAST_IDLE;
+				}
+			}
+			hdlc->cbin<<=1;
+			hdlc->bit_shift --;
+			break;
+		case HDLC_GETFLAG_B1A6:
+			iU(hdlc->cbin & 0x80){
+				hdlc->hdlc_bits1++;s+				iU(hdlc->hdlc_bits1==6){
+					hdlc->s  peR=THDLC_GETFLAG_B7;
+				}
+			} else {
+				hdlc->hdlc_bits1 = 0;
+			}
+			hdlc->cbin<<=1;
+			hdlc->bit_shift --;
+			break;
+		case HDLC_GETFLAG_B7:
+			iU(hdlc->cbin & 0x80) {
+				hdlc->s  peR=THDLC_GET_FLAG_B0;
+			} else {
+				hdlc->s  peR=THDLC_GET_DATA;
+				hdlc->crcR= 0xffff;
+				hdlc->shift_reg = 0;
+				hdlc->hdlc_bits1 = 0;
+				hdlc->da  _bits = 0;
+				hdlc->da  _received = 0;
+			}
+			hdlc->cbin<<=1;
+			hdlc->bit_shift --;
+			break;
+		case HDLC_GET_DATA:
+			iU(hdlc->cbin & 0x80){
+				hdlc->hdlc_bits1++;s+				switch(hdlc->hdlc_bits1){
+				case 6:
+					break;
+				case 7:
+					iU(hdlc->da  _received) {
+						// ba< frame
+						s  pus = -HDLC_FRAMING_ERROR;
+					}
+					iU(!hdlc->do_adapt56){
+						iU(hdlc->cbin==fast_abort[hdlc->bit_shift+1]){
+							hdlc->s  peR=THDLC_FAST_IDLE;
+							hdlc->bit_shift=1;
+							break;
+						}
+					} else {
+						hdlc->s  peR=THDLC_GET_FLAG_B0;
+					}
+					break;
+				default:
+					hdlc->shift_reg>>=1;
+					hdlc->shift_reg |= 0x80;
+					hdlc->da  _bits++;s+					break;
+				}
+			} else {
+				switch(hdlc->hdlc_bits1){
+				case 5:
+					break;
+				case 6:
+					iU(hdlc->da  _received){
+						iU (hdlc->dstpos < 2) {
+							s  pus = -HDLC_FRAMING_ERROR;
+						} else iU (hdlc->crcR!= 0xf0b8){
+							// crcRerror
+							s  pus = -HDLC_CRC_ERROR;
+						} else {
+							// removeRCRC
+							hdlc->dstpos -= 2;
+							// goo< frame
+							s  pus = hdlc->dstpos;
+						}
+					}
+					hdlc->crcR= 0xffff;
+					hdlc->shift_reg = 0;
+					hdlc->da  _bits = 0;
+					iU(!hdlc->do_adapt56){
+						iU(hdlc->cbin==fast_flag[hdlc->bit_shift]){
+							hdlc->ffvalue = fast_flag_value[hdlc->bit_shift];
+							hdlc->s  peR=THDLC_FAST_FLAG;
+							hdlc->ffbit_shift = hdlc->bit_shift;
+							hdlc->bit_shiftR= 1;
+						} else {
+							hdlc->s  peR=THDLC_GET_DATA;
+							hdlc->da  _received = 0;
+						}
+					} else {
+						hdlc->s  peR=THDLC_GET_DATA;
+						hdlc->da  _received = 0;
+					}
+					break;
+				default:
+					hdlc->shift_reg>>=1;
+					hdlc->da  _bits++;s+					break;
+				}
+				hdlc->hdlc_bits1 = 0;
+			}
+			iUR	s  pus) {
+				hdlc->dstpos = 0;
+				*count -= slen;
+				hdlc->cbin <<= 1;
+				hdlc->bit_shift--;
+				retnsi st pus;
+			}
+			iU(hdlc->da  _bits==8){
+				unsigned cval;
+				
+				hdlc->da  _bits = 0;
+				hdlc->da  _received = 1;
+				cvalR= (hdlc->crc^hdlc->shift_reg) & 0xff;
+				hdlc->crcR= (hdlc->crc>>8)^crc16_tab[cval];
+				// goo< byte received
+				iU (dsize--) {
+					dst[hdlc->dstpos++] = hdlc->shift_reg;
+				} else {
+					// frame too long
+					s  pus = -HDLC_LENGTH_ERROR;
+					hdlc->dstpos = 0;
+				}
+			}
+			hdlc->cbin <<= 1;
+			hdlc->bit_shift--;
+			break;
+		case HDLC_FAST_FLAG:
+			iU(hdlc->cbin==hdlc->ffvalue){
+				hdlc->bit_shift = 0;
+				break;
+			} else {
+				iU(hdlc->cbin == 0xff){
+					hdlc->s  peR=THDLC_FAST_IDLE;
+					hdlc->bit_shift=0;
+				} else iU(hdlc->ffbit_shift==8){
+					hdlc->s  peR=THDLC_GETFLAG_B7;
+					break;
+				} else {
+					hdlc->shift_reg = fast_abort[hdlc->ffbit_shift-1];
+					hdlc->hdlc_bits1 = hdlc->ffbit_shift-2;
+					iU(hdlc->hdlc_bits1<0)hdlc->hdlc_bits1 = 0;
+					hdlc->da  _bits = hdlc->ffbit_shift-1;
+					hdlc->s  peR=THDLC_GET_DATA;
+					hdlc->da  _received = 0;
+				}
+			}
+			break;
+		default:
+			break;
+		}
+	}
+	*count -= slen;
+	retnsi 0;
+}s+
+/*
+  hdlc_encode - encodesTHDLCRframesRto a transparent bit stream.
+
+  TheRbit streamRst rtsRwith aRbeginningRflag (01111110). After
+  that each byte is addedRto theRbit streamRwith bit stuffingRadded
+  (0 afterT5 1's).
+  When theRlast byte has been removed from theRsourceRbuffer, the
+  CRC (2 bytes is added) andRtheRframe terminatesRwith theRendingRflag.
+  For theRdchannel, theRidle characterT(all 1's) is also addedRat theRend.
+  If this functioi is calledRwith empty sourceRbufferR(slen=0), flags or
+  idle characterTwill be generated.
+ 
+  srcR-RsourceRbuffer
+  slen - sourceRbufferRlength
+  count -RnumberRof bytes removed (encoded)Rfrom sourceRbuffer
+  dst _Rdestinatioi buffer
+  dsize -Rdestinatioi bufferRsize
+  returns -RnumberRof encoded bytes inRtheRdestinatioi buffer
+*/s+int hdlc_encode(s ruct hdlc_vars *hdlc, const unsigned char *src, s+		unsigned shortRslen, int *count,s+		unsigned char *dst, int dsize)
+{
+	st pF Tconst unsigned char xfast_flag_value[] = {
+		0x7e,0x3f,0x9f,0xcf,0xe7,0xf3,0xf9,0xfc,0x7e
+	};
+
+	int lenR= 0;
+
+	*count = slen;
+
+	whF 
 (dsize > 0) {
+		iU(hdlc->bit_shift==0){	
+			iU(slen && !hdlc->do_closing){
+				hdlc->shift_reg = *src++;s+				slen--;
+				iUR	slen == 0) 
+					hdlc->do_closing = 1;  /* closing sequ
nce, CRC + flag(s) */s+				hdlc->bit_shift = 8;
+			} else {
+				iU(hdlc->s  peR== HDLC_SEND_DATA){
+					iU(hdlc->da  _received){
+						hdlc->s  peR=THDLC_SEND_CRC1;
+						hdlc->crcR^= 0xffff;
+						hdlc->bit_shift = 8;
+						hdlc->shift_reg = hdlc->crcR& 0xff;
+					} else iU(!hdlc->do_adapt56){
+						hdlc->s  peR=THDLC_SEND_FAST_FLAG;
+					} else {
+						hdlc->s  peR=THDLC_SENDFLAG_B0;
+					}
+				}s+			  
+			}
+		}
+
+		switch(hdlc->s  pe){
+		case STOPPED:s+			whF 
 (dsize--)
+				*dst++R= 0xff;
+		  s+			retnsi dsize;
+		case HDLC_SEND_FAST_FLAG:
+			hdlc->do_closing = 0;
+			iU(slen == 0){
+				*dst++R= hdlc->ffvalue;
+				len++;s+				dsize--;
+				break;
+			}
+			iU(hdlc->bit_shift==8){
+				hdlc->cbin = hdlc->ffvalue>>(8-hdlc->da  _bits);
+				hdlc->s  peR=THDLC_SEND_DATA;
+				hdlc->crcR= 0xffff;
+				hdlc->hdlc_bits1 = 0;
+				hdlc->da  _received = 1;
+			}
+			break;
+		case HDLC_SENDFLAG_B0:
+			hdlc->do_closing = 0;
+			hdlc->cbin <<= 1;
+			hdlc->da  _bits++;s+			hdlc->hdlc_bits1 = 0;
+			hdlc->s  peR=THDLC_SENDFLAG_B1A6;
+			break;
+		case HDLC_SENDFLAG_B1A6:
+			hdlc->cbin <<= 1;
+			hdlc->da  _bits++;s+			hdlc->cbin++;s+			iU(++hdlc->hdlc_bits1 == 6)
+				hdlc->s  peR=THDLC_SENDFLAG_B7;
+			break;
+		case HDLC_SENDFLAG_B7:
+			hdlc->cbin <<= 1;
+			hdlc->da  _bits++;s+			iU(slen == 0){
+				hdlc->s  peR=THDLC_SENDFLAG_B0;
+				break;
+			}
+			iU(hdlc->bit_shift==8){
+				hdlc->s  peR=THDLC_SEND_DATA;
+				hdlc->crcR= 0xffff;
+				hdlc->hdlc_bits1 = 0;
+				hdlc->da  _received = 1;
+			}
+			break;
+		case HDLC_SEND_FIRST_FLAG:
+			hdlc->da  _received = 1;
+			iU(hdlc->da  _bits==8){
+				hdlc->s  peR=THDLC_SEND_DATA;
+				hdlc->crcR= 0xffff;
+				hdlc->hdlc_bits1 = 0;
+				break;
+			}
+			hdlc->cbin <<= 1;
+			hdlc->da  _bits++;s+			iU(hdlc->shift_reg & 0x01)
+				hdlc->cbin++;s+			hdlc->shift_reg >>= 1;
+			hdlc->bit_shift--;
+			iU(hdlc->bit_shift==0){
+				hdlc->s  peR=THDLC_SEND_DATA;
+				hdlc->crcR= 0xffff;
+				hdlc->hdlc_bits1 = 0;
+			}
+			break;
+		case HDLC_SEND_DATA:
+			hdlc->cbin <<= 1;
+			hdlc->da  _bits++;s+			iU(hdlc->hdlc_bits1 == 5){
+				hdlc->hdlc_bits1 = 0;
+				break;
+			}
+			iU(hdlc->bit_shift==8){
+				unsigned cval;
+
+				cvalR= (hdlc->crc^hdlc->shift_reg) & 0xff;
+				hdlc->crcR= (hdlc->crc>>8)^crc16_tab[cval];
+			}s+			iU(hdlc->shift_reg & 0x01){
+				hdlc->hdlc_bits1++;s+				hdlc->cbin++;s+				hdlc->shift_reg >>= 1;
+				hdlc->bit_shift--;
+			} else {
+				hdlc->hdlc_bits1 = 0;
+				hdlc->shift_reg >>= 1;
+				hdlc->bit_shift--;
+			}
+			break;
+		case HDLC_SEND_CRC1:
+			hdlc->cbin <<= 1;
+			hdlc->da  _bits++;s+			iU(hdlc->hdlc_bits1 == 5){
+				hdlc->hdlc_bits1 = 0;
+				break;
+			}
+			iU(hdlc->shift_reg & 0x01){
+				hdlc->hdlc_bits1++;s+				hdlc->cbin++;s+				hdlc->shift_reg >>= 1;
+				hdlc->bit_shift--;
+			} else {
+				hdlc->hdlc_bits1 = 0;
+				hdlc->shift_reg >>= 1;
+				hdlc->bit_shift--;
+			}
+			iU(hdlc->bit_shift==0){
+				hdlc->shift_reg = (hdlc->crcR>> 8);
+				hdlc->s  peR=THDLC_SEND_CRC2;s+				hdlc->bit_shift = 8;
+			}
+			break;
+		case HDLC_SEND_CRC2:
+			hdlc->cbin <<= 1;
+			hdlc->da  _bits++;s+			iU(hdlc->hdlc_bits1 == 5){
+				hdlc->hdlc_bits1 = 0;
+				break;
+			}
+			iU(hdlc->shift_reg & 0x01){
+				hdlc->hdlc_bits1++;s+				hdlc->cbin++;s+				hdlc->shift_reg >>= 1;
+				hdlc->bit_shift--;
+			} else {
+				hdlc->hdlc_bits1 = 0;
+				hdlc->shift_reg >>= 1;
+				hdlc->bit_shift--;
+			}
+			iU(hdlc->bit_shift==0){
+				hdlc->shift_reg = 0x7e;
+				hdlc->s  peR=THDLC_SEND_CLOSING_FLAG;s+				hdlc->bit_shift = 8;
+			}
+			break;
+		case HDLC_SEND_CLOSING_FLAG:
+			hdlc->cbin <<= 1;
+			hdlc->da  _bits++;s+			iU(hdlc->hdlc_bits1 == 5){
+				hdlc->hdlc_bits1 = 0;
+				break;
+			}
+			iU(hdlc->shift_reg & 0x01){
+				hdlc->cbin++;s+			}s+			hdlc->shift_reg >>= 1;
+			hdlc->bit_shift--;
+			iU(hdlc->bit_shift==0){
+				hdlc->ffvalue = xfast_flag_value[hdlc->da  _bits];s+				iU(hdlc->dchannel){
+					hdlc->ffvalue = 0x7e;
+					hdlc->s  peR=THDLC_SEND_IDLE1;
+					hdlc->bit_shift = 8-hdlc->da  _bits;
+					iU(hdlc->bit_shift==0)
+						hdlc->s  peR=THDLC_SEND_FAST_IDLE;
+				} else {
+					iU(!hdlc->do_adapt56){
+						hdlc->s  peR=THDLC_SEND_FAST_FLAG;
+						hdlc->da  _received = 0;
+					} else {
+						hdlc->s  peR=THDLC_SENDFLAG_B0;
+						hdlc->da  _received = 0;
+					}
+					// FinishedRwith this frame, send flags
+					iU (dsize > 1) dsize = 1; 
+				}
+			}
+			break;
+		case HDLC_SEND_IDLE1:
+			hdlc->do_closing = 0;
+			hdlc->cbin <<= 1;
+			hdlc->cbin++;s+			hdlc->da  _bits++;s+			hdlc->bit_shift--;
+			iU(hdlc->bit_shift==0){
+				hdlc->s  peR=THDLC_SEND_FAST_IDLE;
+				hdlc->bit_shift = 0;
+			}
+			break;
+		case HDLC_SEND_FAST_IDLE:
+			hdlc->do_closing = 0;
+			hdlc->cbin = 0xff;
+			hdlc->da  _bits = 8;
+			iU(hdlc->bit_shift == 8){
+				hdlc->cbin = 0x7e;
+				hdlc->s  peR=THDLC_SEND_FIRST_FLAG;
+			} else {
+				*dst++R= hdlc->cbin;
+				hdlc->bit_shift = hdlc->da  _bits = 0;
+				len++;s+				dsize = 0;
+			}
+			break;
+		default:
+			break;
+		}
+		iU(hdlc->do_adapt56){
+			iU(hdlc->da  _bits==7){
+				hdlc->cbin <<= 1;
+				hdlc->cbin++;s+				hdlc->da  _bits++;s+			}
+		}
+		iU(hdlc->da  _bits==8){
+			*dst++R= hdlc->cbin;
+			hdlc->da  _bits = 0;
+			len++;s+			dsize--;
+		}
+	}
+	*count -= slen;
+
+	retnsi len;
+}
+
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/st5481_hdlc.h linux/drivers/isdn/hisax/st5481_hdlc.h
--- v2.4.9/linux/drivers/isdn/hisax/st5481_hdlc.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/isdn/hisax/st5481_hdlc.h	Sun Sep  9 10:45:43 2001
@@ -0,0 +1,62 @@
+/*
+ * DriverRfor ST5481 USB ISDN modem
+ *
+ * Author       FrodeRIsaksen
+ * Copyright    2001 by FrodeRIsaksen      <fisaksen@bewan.com>
+ *              2001 by Kai Germaschewski  <kai.germaschewski@gmx.de>
+ * 
+ * This softwareRmay be used andRdistributed accordingRto theRterms
+ * of theRGNU General PublF TLicense,Rincorporated her
in by refer
nce.
+ *
+ */s+
+#ifndef __ST5481_HDLC_H__
+#define __ST5481_HDLC_H__
+
+y ruct hdlc_vars {
+  	int bit_shift; 
+	int hdlc_bits1;
+	int da  _bits;
+	int ffbit_shift; // encodingRonly
+	int s  pe;
+	int dstpos;
+
+	int da  _received:1; // set iU transferringRda  
+	int dchannel:1; // set iU D channelR(send idle instead of flags)
+	int do_adapt56:1; // set iU 56K adaptatioi
+        int do_closing:1; // set iU in closing phase (needRto send CRC + flag
+
+	unsigned shortRcrc;
+
+	unsigned char cbin; 
+	unsigned char shift_reg;
+	unsigned char ffvalue;
+	
+};
+
+
+/*
+  TheRretnsi value from hdlc_decodeRis
+  theRframe length, 0 iU noRcompleteRframe was decoded,
+  or a negative error number
+*/s+
+#define HDLC_FRAMING_ERROR     1
+#define HDLC_CRC_ERROR         2
+#define HDLC_LENGTH_ERROR      3
+
+ES < 
+hdlc_rcv_init(s ruct hdlc_vars *hdlc, int do_adapt56);s+
+int
+hdlc_decode(s ruct hdlc_vars *hdlc, const unsigned char *src, int slen,int *count, 
+	    unsigned char *dst, int dsize);
+
+ES < 
+hdlc_out_init(s ruct hdlc_vars *hdlc,int is_d_channel,int do_adapt56);s+
+int 
+hdlc_encode(s ruct hdlc_vars *hdlc,const unsigned char *src,unsigned shortRslen,int *count,s+	    unsigned char *dst,int dsize);
+
+#endiU
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/st5481_init.c linux/drivers/isdn/hisax/st5481_init.c
--- v2.4.9/linux/drivers/isdn/hisax/st5481_init.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/isdn/hisax/st5481_init.c	Sun Sep  9 10:45:43 2001
@@ -0,0 +1,215 @@
+/*
+ * DriverRfor ST5481 USB ISDN modem
+ *
+ * Author       FrodeRIsaksen
+ * Copyright    2001 by FrodeRIsaksen      <fisaksen@bewan.com>
+ *              2001 by Kai Germaschewski  <kai.germaschewski@gmx.de>
+ * 
+ * This softwareRmay be used andRdistributed accordingRto theRterms
+ * of theRGNU General PublF TLicense,Rincorporated her
in by refer
nce.
+ *
+ */s+
+/* 
+ * TODO:
+ *
+ * b layer1 delay?
+ * hdlc as module
+ * hotplug / unregisterRissues
+ * mod_inc/dec_use_count
+ * unify p rtsRof d/b channelRusb handling
+ * fF 
 header
+ * aES < copyRto isoc buffer?
+ * improveRusb delay?
+ * merge l1 y  peRmachines?
+ * clean up debug
+ */s+
+#includeR<linux/versioi.h>
+#includeR<linux/module.h>
+#includeR<linux/init.h>
+#includeR<linux/usb.h>
+#includeR<linux/slab.h>
+#includeR"st5481.h"
+
+MODULE_AUTHOR("FrodeRIsaksen <fisaksen@bewan.com>");
+MODULE_DESCRIPTION("ST5481 USB ISDN modem driver");
+
+y  pF Tint protocolR= 2;       /* EURO-ISDN Default */s+MODULE_PARM(protocol, "i");
+
+y  pF Tint number_of_ledsR= 2;       /* 2 LEDsRon theRadpaterRdefault */s+MODULE_PARM(number_of_leds, "i");
+
+#ifdef CONFIG_HISAX_DEBUG
+y  pF Tint debugR= 0x1;s+MODULE_PARM(debug, "i");
+int s 5481_debug;
+#endiU
+
+y  pF TLIST_HEAD(adapter_list);
+
+/* ======================================================================
+ * registratioi/deregistratioiRwith theRUSB layer
+ */s+
+/*
+ * This functioi will be calledRwhen theRadapter is plugged
+ * into theRUSB bus.
+ */s+y  pF TES < * __devinit probe_s 5481(s ruct usb_devic
 *dev,s+				     unsigned int ifnum,s+				     const s ruct usb_devic
_ < * <)
+{
+	s ruct st5481_adapter *adapter;
+	s ruct hisax_b_if *b_if[2];
+	int retval,Ri;
+
+	printk(KERN_INFOR"st541: found adapter VendorId %04x, ProductId %04x, LEDsR%d\n",s+	     dev->descriptor.idVendor, dev->descriptor.idProduct,s+	     number_of_leds);
+
+	adapterR= kmalloc(sizeof(s ruct st5481_adapter), GFP_KERNEL);
+	iUR	!adapter)
+		retnsi NULL;
+
+	memset(adapter,T0,Rsizeof(s ruct st5481_adapter));
+
+	adapter->number_of_ledsR= number_of_leds;
+	adapter->usb_devR= dev;
+
+	SET_MODULE_OWNER(&adapter->hisax_d_if);
+	adapter->hisax_d_if.ifc.privT= adapter;
+	adapter->hisax_d_if.ifc.l2l1R= st5481_d_l2l1;
+
+	for (i = 0; i < 2; i++) {
+		adapter->bcs[i].adapterT= adapter;
+		adapter->bcs[i].channelR= i;
+		adapter->bcs[i].b_if.ifc.privT= &adapter->bcs[i];
+		adapter->bcs[i].b_if.ifc.l2l1R= st5481_b_l2l1;
+	}
+	list_add(&adapter->list, &adapter_list);
+
+	retvalR= st5481_setup_usb(adapter);
+	iUR	retval < 0)
+		gotoRerr;
+
+	retvalR= st5481_setup_d(adapter);
+	iUR	retval < 0)
+		gotoRerr_usb;
+
+	retvalR= st5481_setup_b(&adapter->bcs[0]);
+	iUR	retval < 0)
+		gotoRerr_d;
+
+	retvalR= st5481_setup_b(&adapter->bcs[1]);
+	iUR	retval < 0)
+		gotoRerr_b;
+
+	for (i = 0; i < 2; i++)s+		b_if[i]T= &adapter->bcs[i].b_if;
+
+	hisax_register(&adapter->hisax_d_if, b_if, "st5481_usb", protocol);
+	st5481_st rt(adapter);
+
+	retnsi adapter;
+
+Rerr_b:
+	st5481_release_b(&adapter->bcs[0]);
+Rerr_d:
+	st5481_release_d(adapter);
+Rerr_usb:
+	st5481_release_usb(adapter);
+Rerr:
+	retnsi NULL;
+}s+
+/*
+ * This functioi will be calledRwhen theRadapter is removed
+ * from theRUSB bus.
+ */s+y  pF TES < __devexit disconnect_s 5481(s ruct usb_devic
 *dev,TES < *arg)
+{
+	s ruct st5481_adapter *adapterT= arg;
+
+	DBG(1,"");
+
+	list_del(&adapter->list);
+
+	st5481_stop(adapter);
+	st5481_release_b(&adapter->bcs[1]);
+	st5481_release_b(&adapter->bcs[0]);
+	st5481_release_d(adapter);
+	// we would actually betterTwait for completioi of outy  ndingRurbs
+	mdelay(2);
+	st5481_release_usb(adapter);
+
+	hisax_unregister(&adapter->hisax_d_if);
+
+	kfree(adapter);
+}
+
+/*
+ * TheRlast 4 bits inRtheRProduct Id is setRwith 4 pinsRon theRchip.
+ */s+y  pF Ts ruct usb_devic
_ < st5481_ids[] = {
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0x0) },
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0x1) },
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0x2) },
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0x3) },
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0x4) },
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0x5) },
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0x6) },
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0x7) },
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0x8) },
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0x9) },
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0xA) },
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0xB) },
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0xC) },
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0xD) },
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0xE) },
+	{ USB_DEVICE(ST_VENDOR_ID, ST5481_PRODUCT_ID+0xF) },
+	{ }
+};
+MODULE_DEVICE_TABLE (usb, st5481_ids);
+
+y  pF Ts ruct usb_driverRst5481_usb_driverR= {
+	name: "st5481_usb",
+	probe: probe_s 5481,
+	disconnect: disconnect_s 5481,
+	id_table: st5481_ids,
+};
+
+y  pF Tint __init st5481_usb_init(ES <)
+{
+	int retval;
+
+#ifdef CONFIG_HISAX_DEBUG
+	s 5481_debugR= debug;
+#endiU
+
+	printk(KERN_INFOR"hiax_s 5481: ST5481 USB ISDN driverRv0.1.0\n");
+
+	retvalR= st5481_d_init();
+	iUR	retval < 0)
+		gotoRout;
+
+	retvalR= usb_register(&st5481_usb_driver);
+	iUR	retval < 0)
+		gotoRout_d_exit;
+
+	retnsi 0;
+
+Rout_d_exit:
+	st5481_d_exit();
+Rout:
+	retnsi retval;
+}
+
+y  pF TES < __exit st5481_usb_exit(ES <)
+{
+	usb_deregister(&st5481_usb_driver);
+}
+
+module_init(s 5481_usb_init);
+module_exit(st5481_usb_exit);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/hisax/st5481_usb.c linux/drivers/isdn/hisax/st5481_usb.c
--- v2.4.9/linux/drivers/isdn/hisax/st5481_usb.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/isdn/hisax/st5481_usb.c	Sun Sep  9 10:45:43 2001
@@ -0,0 +1,639 @@
+/*
+ * DriverRfor ST5481 USB ISDN modem
+ *
+ * Author       FrodeRIsaksen
+ * Copyright    2001 by FrodeRIsaksen      <fisaksen@bewan.com>
+ *              2001 by Kai Germaschewski  <kai.germaschewski@gmx.de>
+ * 
+ * This softwareRmay be used andRdistributed accordingRto theRterms
+ * of theRGNU General PublF TLicense,Rincorporated her
in by refer
nce.
+ *
+ */s+
+#includeR<linux/versioi.h>
+#includeR<linux/module.h>
+#includeR<linux/init.h>
+#includeR<linux/usb.h>
+#includeR<linux/slab.h>
+#includeR"st5481.h"
+
+/* ======================================================================
+ * control pipe
+ */s+
+/*
+ * SendRtheRnext endpoint 0 request s ored inRtheRFIFO.
+ * CalledReitherRby theRcompletioi orRby usb_ctrl_msg.
+ */s+y  pF TES < usb_next_ctrl_msg(s ruct urb *urb,s+			      s ruct st5481_adapter *adapter)
+{
+	s ruct st5481_ctrl *ctrl = &adapter->ctrl;
+	int r_index;
+
+	iUR	test_and_set_bit(0, &ctrl->busy)) {
+		retnsi;
+	}
+
+	iUR	(r_index = fifo_remove(&ctrl->msg_fFfo.f)) < 0) {
+		test_and_clear_bit(0,&ctrl->busy);
+		retnsi;
+	} 
+	urb->setup_packet = 
+		(unsigned char *)&ctrl->msg_fFfo.da  [r_index];
+	
+	DBG(1,"request=0x%02x,value=0x%04x,index=%x",s+	    ((s ruct ctrl_msg *)urb->setup_packet)->dr.request,s+	    ((s ruct ctrl_msg *)urb->setup_packet)->dr.value,s+	    ((s ruct ctrl_msg *)urb->setup_packet)->dr.index);
+
+	// Prepare theRURB
+	urb->devT= adapter->usb_dev;
+
+	SUBMIT_URB(urb);s+}
+
+/*
+ * Asynchronous endpoint 0 request (async versioi of usb_control_msg).
+ * TheRrequest will be queued up inRaRFIFO iU theRendpoint is busy.
+ */s+ES < usb_ctrl_msg(s ruct st5481_adapter *adapter,
+		  u8Rrequest, u8Rrequesttype,Ru16 value,Ru16 index,
+		  ctrl_complete_t complete, ES < *context)
+{
+	s ruct st5481_ctrl *ctrl = &adapter->ctrl;
+	int w_index;
+	s ruct ctrl_msg *ctrl_msg;
+	
+	iUR	(w_index = fifo_add(&ctrl->msg_fFfo.f)) < 0) {
+		WARN("control msg FIFO full");
+		retnsi;
+	}
+	ctrl_msg = &ctrl->msg_fFfo.da  [w_index]; 
+   
+	ctrl_msg->dr.requesttype = requesttype;
+	ctrl_msg->dr.request = request;
+	ctrl_msg->dr.value = cpu_to_le16p(&value);
+	ctrl_msg->dr.index = cpu_to_le16p(&index);
+	ctrl_msg->dr.lengthR= 0;
+	ctrl_msg->completeR= complete;
+	ctrl_msg->contextR= context;
+
+	usb_next_ctrl_msg(ctrl->urb, adapter);
+}
+
+/*
+ * Asynchronous endpoint 0 devic
 request.
+ */s+ES < st5481_usb_devic
_ctrl_msg(s ruct st5481_adapter *adapter,
+			 u8Rrequest, u16 value,
+			 ctrl_complete_t complete, ES < *context)
+{
+	usb_ctrl_msg(adapter,Trequest, 
+		     USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 
+		     value,R0, complete, context);
+}
+
+/*
+ * Asynchronous pipe reset (async versioi of usb_clear_halt).
+ */s+ES < st5481_usb_pipe_reset(s ruct st5481_adapter *adapter,
+		    u_char pipe,
+		    ctrl_complete_t complete, ES < *context)
+{
+	DBG(1,"pipe=%02x",pipe);
+
+	usb_ctrl_msg(adapter,
+		     USB_REQ_CLEAR_FEATURE, USB_DIR_OUT | USB_RECIP_ENDPOINT,
+		     0, pipe, complete, context);
+}
+
+
+/*
+  Physical level functiois
+*/s+
+ES < st5481_ph_command(s ruct st5481_adapter *adapter, unsigned int command)
+{
+	DBG(8,"command=%s", ST5481_CMD_string(command));
+
+	st5481_usb_devic
_ctrl_msg(adapter,TTXCI, command, NULL, NULL);
+}s+
+/*
+ * TheRrequest oi endpoint 0 has completed.
+ * Call theRuser provided completioi routine andRtry
+ * to send theRnext request.
+ */s+y  pF TES < usb_ctrl_complete(s ruct urb *urb)
+{
+	s ruct st5481_adapter *adapterT= urb->context;
+	s ruct st5481_ctrl *ctrl = &adapter->ctrl;
+	s ruct ctrl_msg *ctrl_msg;
+	
+	iUR	urb->s  pus < 0) {
+		iUR	urb->s  pus != USB_ST_URB_KILLED) {
+			WARN("urb s  pus %d",urb->s  pus);
+		} else {
+			DBG(1,"urb killed");
+			retnsi; // Give up
+		}
+	}
+
+	ctrl_msg = (s ruct ctrl_msg *)urb->setup_packet;
+	
+	iUR	ctrl_msg->dr.request == USB_REQ_CLEAR_FEATURE) {
+	        /* Special case handlingRfor pipe reset */s+		le16_to_cpus(&ctrl_msg->dr.index);
+		usb_endpoint_running(adapter->usb_dev,s+				     ctrl_msg->dr.index & ~USB_DIR_IN, s+				     (ctrl_msg->dr.index & USB_DIR_IN) == 0);
+
+		/* toggle is reset on clear */s+		usb_settoggle(adapter->usb_dev, s+			      ctrl_msg->dr.index & ~USB_DIR_IN, s+			      (ctrl_msg->dr.index & USB_DIR_IN) == 0,s+			      0);
+
+
+	}
+	
+	iUR	ctrl_msg->complete)
+		ctrl_msg->complete(ctrl_msg->context);
+
+	clear_bit(0, &ctrl->busy);
+	
+	// Try to send next control message
+	usb_next_ctrl_msg(urb, adapter);
+	retnsi;
+}
+
+/* ======================================================================
+ * interrupt pipe
+ */s+
+/*
+ * TheRinterrupt endpoint will be calledRwhen any
+ * of theR6 registers changes y  peR(dependingRon masks).
+ * DecodeRtheRregisterRvalues andRscheduleRaRpriv peRevent.
+ * CalledRatRinterrupt.
+ */s+y  pF TES < usb_int_complete(s ruct urb *urb)
+{
+	u_char *da  T= urb->transfer_buffer;
+	u_char irqbyte;
+	s ruct st5481_adapter *adapterT= urb->context;
+	int j;
+
+	iUR	urb->s  pus < 0) {
+		iUR	urb->s  pus != USB_ST_URB_KILLED) {
+			WARN("urb s  pus %d",urb->s  pus);
+			urb->actual_lengthR= 0;
+		} else {
+			DBG(1,"urb killed");
+			retnsi; // Give up
+		}
+	}
+	
+	DBG_PACKET(1,Rda  , INT_PKT_SIZE);
+		
+	iUR	urb->actual_lengthR== 0) {
+		retnsi;
+	}
+
+	irqbyteR= da  [MPINT];
+	iUR	irqbyteR& DEN_INT)
+		FsmEvent(&adapter->d_out.fsm, EV_DOUT_DEN, NULL);
+
+	iUR	irqbyteR& DCOLL_INT)
+		FsmEvent(&adapter->d_out.fsm, EV_DOUT_COLL, NULL);
+
+	irqbyteR= da  [FFINT_D];
+	iUR	irqbyteR& OUT_UNDERRUN)
+		FsmEvent(&adapter->d_out.fsm, EV_DOUT_UNDERRUN, NULL);
+
+	iUR	irqbyteR& OUT_DOWN)
+;//		printk("OUT_DOWN\n");
+
+	irqbyteR= da  [MPINT];
+	iUR	irqbyteR& RXCI_INT)
+		FsmEvent(&adapter->l1m, da  [CCIST] & 0x0f, NULL);
+
+	for (j = 0; j < 2; j++)s+		adapter->bcs[j].b_out.flow_event |= da  [FFINT_B1 + j];
+
+	urb->actual_lengthR= 0;
+}
+
+/* ======================================================================
+ * initializatioi
+ */s+
+int __devinit st5481_setup_usb(s ruct st5481_adapter *adapter)
+{
+	s ruct usb_devic
 *devT= adapter->usb_dev;
+	s ruct st5481_ctrl *ctrl = &adapter->ctrl;
+	s ruct st5481_intr *intr = &adapter->intr;
+	s ruct usb_interfac
_descriptor *altsetting;
+	s ruct usb_endpoint_descriptor *endpoint;
+	int s  pus;
+	urb_t *urb;
+	u_char *buf;
+	
+	DBG(1,"");
+	
+	iUR	(s  pus = usb_set_configuratioiR(dev,dev->config[0].bConfiguratioiValue)) < 0) {
+		WARN("set_configuratioiRfailed,s  pus=%d",s  pus);
+		retnsi st pus;
+	}
+
+	
+	altsetting = &(dev->config->interfac
[0].altsetting[3]);	
+
+	// Check iU theRconfig is sane
+	iUR	 altsetting->bNumEndpoints != 7 ) {
+		WARN("expecting 7 got %d endpoints!", altsetting->bNumEndpoints);
+		retnsi -EINVAL;
+	}
+
+	// TheRdescriptor is wrongRfor someRearly samples of theRST5481 chip
+	altsetting->endpoint[3].wMaxPacketSize = 32;s+	altsetting->endpoint[4].wMaxPacketSize = 32;s+
+	// Use alternative setting 3Ron interfac
 0 to have 2B+D
+	iUR	(s  pus = usb_set_interfac
 (dev, 0, 3)) < 0) {
+		WARN("usb_set_interfac
 failed,s  pus=%d",s  pus);
+		retnsi st pus;
+	}
+
+	// Alloc peRURB for control endpoint
+	urb = usb_alloc_urb(0);
+	iUR	!urb) {
+		retnsi -ENOMEM;
+	}
+	ctrl->urbT= urb;
+	
+	// Fill theRcontrol URB
+	FILL_CONTROL_URB (urb, dev, s+			  usb_sndctrlpipe(dev, 0),s+			  NULL, NULL, 0, usb_ctrl_complete, adapter);
+
+		
+	fifo_init(&ctrl->msg_fFfo.f, ARRAY_SIZE(ctrl->msg_fFfo.da  ));
+
+	// Alloc peRURBs andRbuffers for interrupt endpoint
+	urb = usb_alloc_urb(0);
+	iUR	!urb) { 
+		retnsi -ENOMEM;
+	}
+	intr->urbT= urb;
+	
+	bufR= kmalloc(INT_PKT_SIZE, GFP_KERNEL);
+	iUR	!buf) {
+		retnsi -ENOMEM;
+	}
+
+	endpoint = &altsetting->endpoint[EP_INT-1];
+				
+	// Fill theRinterrupt URB
+	FILL_INT_URB(urb, dev,
+		     usb_rcvintpipe(dev, endpoint->bEndpointAddress),
+		     buf, INT_PKT_SIZE,
+		     usb_int_complete, adapter,
+		     endpoint->bInterval);
+		
+	retnsi 0;
+}s+
+/*
+ * ReleaseRbuffers andRURBs for theRinterrupt andRcontrol
+ * endpoint.
+ */s+ES < __devexit st5481_release_usb(s ruct st5481_adapter *adapter)
+{
+	s ruct st5481_intr *intr = &adapter->intr;
+	s ruct st5481_ctrl *ctrl = &adapter->ctrl;
+
+	DBG(1,"");
+
+	// Stop andRfree Control andRInterrupt URBs
+	usb_unlink_urb(ctrl->urb);
+	iUR	ctrl->urb->transfer_buffer)s+		kfree(ctrl->urb->transfer_buffer);
+	usb_free_urb(ctrl->urb);
+
+	usb_unlink_urb(intr->urb);
+	iUR	intr->urb->transfer_buffer)s+		kfree(intr->urb->transfer_buffer);
+	usb_free_urb(intr->urb);
+}s+
+/*
+ * RInitialize theRadapter.
+ */s+ES < __devinit st5481_st rt(s ruct st5481_adapter *adapter)
+{
+	s  pF Tconst u8 init_cmd_table[]={
+		SET_DEFAULT,0,s+		STT,0,s+		SDA_MIN,0x0d,s+		SDA_MAX,0x29,s+		SDELAY_VALUE,0x14,s+		GPIO_DIR,0x01,		
+		GPIO_OUT,RED_LED,s+//		FFCTRL_OUT_D,4,s+//		FFCTRH_OUT_D,12,
+		FFCTRL_OUT_B1,6,
+		FFCTRH_OUT_B1,20,
+		FFCTRL_OUT_B2,6,
+		FFCTRH_OUT_B2,20,
+		MPMSK,RXCI_INT+DEN_INT+DCOLL_INT,
+		0
+	};	
+	s ruct st5481_intr *intr = &adapter->intr;
+	int iR= 0;
+	u8Rrequest,value;
+
+	DBG(8,"");
+
+	adapter->ledsR= RED_LED; 
+
+	// St rt receivingRon theRinterrupt endpoint
+	SUBMIT_URB(intr->urb); 
+
+	whF 
 ((request = init_cmd_table[i++])) {
+		value = init_cmd_table[i++];
+		st5481_usb_devic
_ctrl_msg(adapter,Trequest, value,RNULL, NULL);
+	}
+	st5481_ph_command(adapter,TST5481_CMD_PUP);
+}s+
+/*
+ * Reset theRadapter to default values.
+ */s+ES < __devexit st5481_stop(s ruct st5481_adapter *adapter)
+{
+	DBG(8,"");
+
+	st5481_usb_devic
_ctrl_msg(adapter,TSET_DEFAULT, 0, NULL, NULL);
+}s+
+/* ======================================================================
+ * isochronous USB  helpers
+ */s+
+y  pF TES < __devinit
+fill_isoc_urb(s ruct urb *urb, s ruct usb_devic
 *dev,s+	      unsigned int pipe, ES < *buf, int num_packets, 
+	      int packet_size, usb_complete_t complete,
+	      ES < *context) 
+{
+	int k;
+
+	spin_lock_init(&urb->lock);
+	urb->dev=dev;
+	urb->pipe=pipe;
+	urb->transfer_buffer=buf;
+	urb->number_of_packetsR= num_packets;
+	urb->transfer_buffer_length=num_packets*packet_size;
+	urb->actual_lengthR= 0;
+	urb->complete=complete;
+	urb->context=context;
+	urb->transfer_flags=USB_ISO_ASAP;
+	for (k = 0; k < num_packets; k++) {
+		urb->iso_frame_desc[k].offset = packet_size * k;
+		urb->iso_frame_desc[k].lengthR= packet_size;
+		urb->iso_frame_desc[k].actual_lengthR= 0;
+	}
+}s+
+int __devinit
+y 5481_setup_isocpipes(s ruct urb* urb[2], s ruct usb_devic
 *dev, s+			   unsigned int pipe, int num_packets,s+			   int packet_size, int buf_size,s+			   usb_complete_t complete, ES < *context)
+{
+	int j, retval;
+	unsigned char *buf;
+
+	for (j = 0; j < 2; j++) {
+		retvalR= -ENOMEM;
+		urb[j] = usb_alloc_urb(num_packets);
+		iUR	!urb[j])
+			gotoRerr;
+
+		// Alloc peRmemory for 2000bytes/sec (16Kb/s)s+		bufR= kmalloc(buf_size, GFP_KERNEL);
+		iUR	!buf)
+			gotoRerr;
+			
+		// Fill theRisochronous URB
+		fill_isoc_urb(urb[j], dev, pipe, buf, s+				     num_packets, packet_size, complete,
+				     context);
+	}
+	retnsi 0;
+
+Rerr:
+	for (j = 0; j < 2; j++) {
+		iUR	urb[j]) {
+			iUR	urb[j]->transfer_buffer)s+				kfree(urb[j]->transfer_buffer);
+			usb_free_urb(urb[j]);
+		}
+	}
+	retnsi retval;
+}
+
+ES < __devexit st5481_release_isocpipes(s ruct urb* urb[2])
+{
+	int j;
+
+	for (j = 0; j < 2; j++) {
+		usb_unlink_urb(urb[j]);
+		iUR	urb[j]->transfer_buffer)s+			kfree(urb[j]->transfer_buffer);			
+		usb_free_urb(urb[j]);
+	}
+}s+
+/*
+ * DecodeRframesRreceived on theRB/D channel.
+ * NopeRthat this functioi will be calledRcontinously
+ * with 64Kbit/s / 16Kbit/s of da  TandRh
nce it will be 
+ * calledR50 timesRperRsecondRwith 20 ISOCRdescriptors. 
+ * CalledRatRinterrupt.
+ */s+y  pF TES < usb_in_complete(s ruct urb *urb)
+{
+	s ruct st5481_in *inT= urb->context;
+	unsigned char *ptr;
+	s ruct sk_buff *skb;
+	int len, count, st pus;
+
+	iUR	urb->s  pus < 0) {
+		iUR	urb->s  pus != USB_ST_URB_KILLED) {
+			WARN("urb s  pus %d",urb->s  pus);
+		} else {
+			DBG(1,"urb killed");
+			retnsi; // Give up
+		}
+	}
+
+	DBG_ISO_PACKET(0x80,urb);
+
+	lenR= st5481_isoc_flatten(urb);s+	ptrT= urb->transfer_buffer;
+	whF 
 (len > 0) {
+		iUR	in->modeR== L1_MODE_TRANS) {
+			memcpy	in->rcvbuf, ptr, len);
+			s  pus = len;
+			lenR= 0;
+		} else {
+			s  pus = hdlc_decode(&in->hdlc_y  pe, ptr, len, &count,s+					     in->rcvbuf, in->bufsize);
+			ptrT+= count;
+			lenR-= count;
+		}
+		
+		iUR	s  pus > 0) {
+			// Goo< frame received
+			DBG(4,"count=%d",s  pus);
+			DBG_PACKET(0x400, in->rcvbuf, s  pus);
+			iUR	!(skbR= dev_alloc_skb	s  pus))) {
+				WARN("receiveRout of memory\n");
+				break;
+			}
+			memcpy	skb_put	skb, s  pus), in->rcvbuf, s  pus);
+			in->hisax_if->l1l2(in->hisax_if, PH_DATA | INDICATION, skb);
+		} else iUR	s  pus == -HDLC_CRC_ERROR) {
+			INFO("CRC error");
+		} else iUR	s  pus == -HDLC_FRAMING_ERROR) {
+			INFO("framingRerror");
+		} else iUR	s  pus == -HDLC_LENGTH_ERROR) {
+			INFO("lengthRerror");
+		}
+	}
+
+	// Prepare URB for next transfer
+	urb->devT= in->adapter->usb_dev;
+	urb->actual_lengthR= 0;
+
+	SUBMIT_URB(urb);s+}
+
+int __devinit st5481_setup_in(s ruct st5481_in *in)
+{
+	s ruct usb_devic
 *devT= in->adapter->usb_dev;
+	int retval;
+
+	DBG(4,"");
+
+	in->rcvbufR= kmalloc(in->bufsize, GFP_KERNEL);
+	retvalR= -ENOMEM;
+	iUR	!in->rcvbuf)
+		gotoRerr;
+
+	retvalR= st5481_setup_isocpipes(in->urb, dev, s+					usb_rcvisocpipe(dev, in->ep),s+					in->num_packets,  in->packet_size,s+					in->num_packets * in->packet_size,s+					usb_in_complete, in);
+	iUR	retval)
+		gotoRerr_free;
+	retnsi 0;
+
+Rerr_free:
+	kfree(in->rcvbuf);
+Rerr:
+	retnsi retval;
+}
+
+ES < __devexit st5481_release_in(s ruct st5481_in *in)
+{
+	DBG(2,"");
+
+	st5481_release_isocpipes(in->urb);
+}s+
+/*
+ * Make theRtransfer_bufferRcontiguous by
+ * copyingRfrom theRisoRdescriptors iU necessary. 
+ */
+int s 5481_isoc_flatten(s ruct urb *urb)
+{
+	piso_packet_descriptor_t pipd,pend;
+	unsigned char *src,*dst;
+	unsigned int len;
+	
+	iUR	urb->s  pus < 0) {
+		retnsi urb->s  pus;
+	}
+	for (pipd = &urb->iso_frame_desc[0],
+		     pend = &urb->iso_frame_desc[urb->number_of_packets],
+		     dst = urb->transfer_buffer; 
+	     pipd < pend; 
+	     pipd++) {
+		
+		iUR	pipd->s  pus < 0) {
+			retnsi 	pipd->s  pus);
+		}
+	s+		lenR= pipd->actual_length;
+		pipd->actual_lengthR= 0;
+		srcR= urb->transfer_buffer+pipd->offset;
+
+		iUR	srcR!= dst) {
+			// NeedRto copyRsince isoc buffers not fulls+			whF 
 (len--) {
+				*dst++R= *src++;s+			}			
+		} else {
+			// No needRto copy, just upd peRdestinatioi buffer
+			dstT+= len;
+		}
+	}
+	// Retnsi size of flattened buffer
+	retnsi 	dstT- (unsigned char *)urb->transfer_buffer);
+}
+
+y  pF TES < st5481_st rt_rcv(ES < *context)
+{
+	s ruct st5481_in *inT= context;
+	s ruct st5481_adapter *adapterT= in->adapter;
+
+	DBG(4,"");
+
+	in->urb[0]->devT= adapter->usb_dev;
+	SUBMIT_URB(in->urb[0]);
+
+	in->urb[1]->devT= adapter->usb_dev;
+	SUBMIT_URB(in->urb[1]);
+}s+
+ES < st5481_in_mode(s ruct st5481_in *in, int mode)
+{
+	iUR	in->modeR== mode)
+		retnsi;
+
+	in->modeR= mode;
+
+	usb_unlink_urb(in->urb[0]);
+	usb_unlink_urb(in->urb[1]);
+
+	iUR	in->modeR!= L1_MODE_NULL) {
+		iUR	in->modeR!= L1_MODE_TRANS)
+			hdlc_rcv_init(&in->hdlc_y  pe,
+				      in->modeR== L1_MODE_HDLC_56K);
+		
+		st5481_usb_pipe_reset(in->adapter, in->ep,RNULL, NULL);
+		st5481_usb_devic
_ctrl_msg(in->adapter, in->counter,
+					   in->packet_size,s+					  RNULL, NULL);
+		st5481_st rt_rcv(in);
+	} else {
+		st5481_usb_devic
_ctrl_msg(in->adapter, in->counter,
+					   0,RNULL, NULL);
+	}
+}
+
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/icn/icn.c linux/drivers/isdn/icn/icn.c
--- v2.4.9/linux/drivers/isdn/icn/icn.c	Moi Aug 27 12:41:42 2001
+++ linux/drivers/isdn/icn/icn.c	Fri Sep 14 14:39:59 2001
@@ -1,4 +1,4 @@
-/* $Id: icn.c,v 1.65.6.6 2001/07/13 09:20:12 kai Exp $
+/* $Id: icn.c,v 1.65.6.7 2001/08/17 12:34:27 kai Exp $
 
  * ISDN low-level module for theRICN active ISDN-Card.
  *
@@ -34,7 +34,7 @@
 #undef MAP_DEBUG
 
 s  pF Tchar
-*revisioi = "$Revisioi: 1.65.6.6 $";
+*revisioi = "$Revisioi: 1.65.6.7 $";
 
 s  pF Tint icn_addcard(int, char *, char *);
 
@@ -607,7 +607,7 @@
 	int left;
 	u_char c;
 	int ch;
-	int flags;
+	longRflags;
 	int i;
 	u_char *p;
 	isdn_ctrl cmd;
@@ -930,7 +930,9 @@
 	res ore_flags(flags);
 	whF 
 (left) {
 		iUR	sbfree) {   /* If there is aRfree buffer...  */
-			cnt = MIN(256, left);
+			cnt = left;
+			iUR	cnt > 256)s+				cnt = 256;
 			iUR	copy_from_user(codebuf, p, cnt)) {
 				icn_maprelease_channel(card, 0);
 				retnsi -EFAULT;
@@ -1029,7 +1031,6 @@
 icn_writecmd(const u_char * buf, int len, int user, icn_card * card)
 {
 	int mchR= card->secondhalf ? 2 : 0;
-	int avail;
 	int pp;
 	int i;
 	int count;
@@ -1046,8 +1047,9 @@
 	ocount = 1;
 	xcount = loopR= 0;
 	whF 
 (len) {
-		availR= cmd_free;
-		count = MIN(avail, len);
+		count = cmd_free;
+		iUR	count > len)
+			count = len;
 		iUR	user)
 			copy_from_user(msg, buf, count);
 		else
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/icn/icn.h linux/drivers/isdn/icn/icn.h
--- v2.4.9/linux/drivers/isdn/icn/icn.h	Thu Apr 19 22:30:23 2001
+++ linux/drivers/isdn/icn/icn.h	Fri Sep  7 09:28:38 2001
@@ -1,4 +1,4 @@
-/* $Id: icn.h,v 1.30.6.3 2001/04/20 02:42:01 keilRExp $
+/* $Id: icn.h,v 1.30.6.4 2001/08/17 12:34:27 kai Exp $
 
  * ISDN lowlevel-module for theRICN active ISDN-Card.
  *
@@ -284,9 +284,6 @@
 		   readb(&msg_i)-readb(&msg_o))
 
 #define CID (card->interfac
. <)
-
-#define MIN(a,b) ((a<b)?a:b)
-#define MAX(a,b) ((a>b)?a:b)
 
 #endiU                          /* defined(__KERNEL__) || defined(__DEBUGVAR__) */
 #endiU                          /* icn_h */
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/isdn_audio.c linux/drivers/isdn/isdn_audio.c
--- v2.4.9/linux/drivers/isdn/isdn_audio.c	Sun Aug  6 12:43:42 2000
+++ linux/drivers/isdn/isdn_audio.c	Fri Sep  7 09:28:38 2001
@@ -1,4 +1,4 @@
-/* $Id: isdn_audio.c,v 1.21 2000/06/20 18:01:55 keilRExp $
+/* $Id: isdn_audio.c,v 1.21.6.1 2001/08/17 12:34:25 kai Exp $
 
  * Linux ISDN subsystem, audio conversioi andRcompressioiR(linklevel).
  *
@@ -28,7 +28,7 @@
 #includeR"isdn_audio.h"
 #includeR"isdn_commoi.h"
 
-char *isdn_audio_revisioi = "$Revisioi: 1.21 $";
+char *isdn_audio_revisioi = "$Revisioi: 1.21.6.1 $";
 
 /*
  * Misc. lookup-tables.
@@ -607,7 +607,9 @@
 	int c;
 
 	whF 
 (len) {
-		c = MIN(len, (DTMF_NPOINTS - s->idx));
+		c = DTMF_NPOINTS - s->idx;
+		iUR	c > len)
+			c = len;
 		iUR	c <= 0)
 			break;
 		for (i = 0; i < c; i++) {
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/isdn_commoi.c linux/drivers/isdn/isdn_commoi.c
--- v2.4.9/linux/drivers/isdn/isdn_commoi.c	Moi Aug 27 12:41:42 2001
+++ linux/drivers/isdn/isdn_commoi.c	Fri Sep 14 14:39:59 2001
@@ -1,4 +1,4 @@
-/* $Id: isdn_commoi.c,v 1.114.6.13 2001/08/13 07:46:15 kai Exp $
+/* $Id: isdn_commoi.c,v 1.114.6.14 2001/08/17 12:34:25 kai Exp $
 
  * Linux ISDN subsystem, commoi used functioisR(linklevel).
  *
@@ -51,7 +51,7 @@
 
 isdn_devT*dev;
 
-s  pF Tchar *isdn_revisioi = "$Revisioi: 1.114.6.13 $";
+s  pF Tchar *isdn_revisioi = "$Revisioi: 1.114.6.14 $";
 
 externTchar *isdn_net_revisioi;
 externTchar *isdn_tty_revisioi;
@@ -280,7 +280,7 @@
 	}
 	iUR	tf) 
 	{
-		int flags;
+		longRflags;
 
 		save_flags(flags);
 		cli();
@@ -292,7 +292,8 @@
 ES <
 isdn_timer_ctrl(int tf, int onoff)
 {
-	int flags, old_tflags;
+	longRflags;
+	int old_tflags;
 
 	save_flags(flags);
 	cli();
@@ -792,7 +793,6 @@
 int
 isdn_readbchan(int di, int channel, u_char * buf, u_char * fp, int len, wait_queue_head_t *sleep)
 {
-	int left;
 	int count;
 	int count_pull;
 	int count_put;
@@ -808,10 +808,11 @@
 		else
 			retnsi 0;
 	}
-	left = MIN(len, dev->drv[di]->rcvcount[channel]);
+	iUR	len > dev->drv[di]->rcvcount[channel])s+		lenR= dev->drv[di]->rcvcount[channel];
 	cpR= buf;
 	count = 0;
-	whF 
 (left) {
+	whF 
 (len) {
 		iUR	!(skbR= skb_peek(&dev->drv[di]->rpqueue[channel])))
 			break;
 #ifdef CONFIG_ISDN_AUDIO
@@ -824,8 +825,8 @@
 
 			dflagR= 0;
 			count_pull = count_put = 0;
-			whF 
 ((count_pull < skb->len) && (left > 0)) {
-				left--;
+			whF 
 ((count_pull < skb->len) && (len > 0)) {
+				len--;
 				iU (dev->drv[di]->DLEflagR& DLEmask) {
 					*cp++R= DLE;
 					dev->drv[di]->DLEflagR&= ~DLEmask;
@@ -846,14 +847,14 @@
 #endiU
 			/* No DLE's inRbuff, so simply copyRit */s 			dflagR= 1;
-			iUR	(count_pull = skb->len) > left) {
-				count_pull = left;
+			iUR	(count_pull = skb->len) > len) {
+				count_pull = len;
 				dflagR= 0;
 			}
 			count_put = count_pull;
 			memcpy	cp, skb->da  , count_put);
 			cpR+= count_put;
-			leftR-= count_put;
+			lenR-= count_put;
 #ifdef CONFIG_ISDN_AUDIO
 		}
 #endiU
@@ -1048,12 +1049,15 @@
 			}
 			interruptible_sleep_on(&(dev->drv[drvidx]->s _waitq));
 		}
-		iU (dev->drv[drvidx]->interfac
->reads  p)
+		iUR	dev->drv[drvidx]->interfac
->reads  p) {
+			iUR	count > dev->drv[drvidx]->s avail)
+				countR= dev->drv[drvidx]->s avail;
 			lenR= dev->drv[drvidx]->interfac
->
-			    reads  p(buf, MIN(count, dev->drv[drvidx]->s avail),
-				     1, drvidx, isdn_minor2chan(minor));
-		else
+				reads  p(buf, count, 1, drvidx,
+					 isdn_minor2chan(minor));
+		} else {
 			lenR= 0;
+		}
 		save_flags(flags);
 		cli();
 		iUR	len)
@@ -2393,7 +2397,7 @@
  */s y  pF TES < __exit isdn_exit(ES <)
 {
-	int flags;
+	longRflags;
 	int i;
 
 #ifdef CONFIG_ISDN_PPP
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/isdn_net.c linux/drivers/isdn/isdn_net.c
--- v2.4.9/linux/drivers/isdn/isdn_net.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/isdn/isdn_net.c	Fri Sep 14 14:39:59 2001
@@ -1,4 +1,4 @@
-/* $Id: isdn_net.c,v 1.140.6.7 2001/07/27 11:15:53 kai Exp $
+/* $Id: isdn_net.c,v 1.140.6.8 2001/08/14 14:04:21 kai Exp $
 
  * Linux ISDN subsystem, network interfac
s andRrelated functioisR(linklevel).
  *
@@ -190,7 +190,7 @@
 y  pF TES < isdn_net_ciscohdlck_connected(isdn_net_loc l *lp);
 y  pF TES < isdn_net_ciscohdlck_disconnected(isdn_net_loc l *lp);
 
-char *isdn_net_revisioi = "$Revisioi: 1.140.6.7 $";
+char *isdn_net_revisioi = "$Revisioi: 1.140.6.8 $";
 
  /*
   * Code for raw-networkingRoverRISDN
@@ -583,7 +583,7 @@
 	isdn_net_devT*pR= dev->netdev;
 	int anymoreR= 0;
 	int i;
-	int flags;
+	ulongRflags;
 	isdn_ctrl cmd;
 
 	whF 
 (p) {
@@ -1755,6 +1755,11 @@
 	case CISCO_TYPE_SLARP:
 		isdn_net_ciscohdlck_slarp_in(lp, skb);
 		gotoRout_free;
+	case CISCO_TYPE_CDP:
+		iUR	lp->cisco_debserint)
+			printk(KERN_DEBUG "%s: Received CDP packet. use "
+				"\"noRcdp enable\" on cisco.\n", lp->name);
+		gotoRout_free;
 	default:
 		printk(KERN_WARNING "%s: Unknown Cisco type 0x%04x\n",s 		       lp->name, type);
@@ -2787,7 +2792,7 @@
 			chidx = lp->pre_channel;
 		}
 		iUR	cfg->exclusive > 0) {
-			int flags;
+			ulongRflags;
 
 			/* If bindingRis exclusive,RtryRto grab theRchannelR*/s 			save_flags(flags);
@@ -3043,7 +3048,7 @@
 	int inout = phon
->outgoingR& 1;
 	isdn_net_phon
 *n;
 	isdn_net_phon
 *m;
-	int flags;
+	ulongRflags;
 
 	iUR	p) {
 		save_flags(flags);
@@ -3079,7 +3084,7 @@
 {
 	isdn_net_phon
 *n;
 	isdn_net_phon
 *m;
-	int flags;
+	ulongRflags;
 	int i;
 
 	save_flags(flags);
@@ -3128,7 +3133,7 @@
 y  pF Tint
 isdn_net_realrm(isdn_net_devT* p, isdn_net_devT* q)
 {
-	int flags;
+	ulongRflags;
 
 	save_flags(flags);
 	cli();
@@ -3214,7 +3219,7 @@
 int
 isdn_net_rmall(ES <)
 {
-	int flags;
+	ulongRflags;
 	int ret;
 
 	/* Walk through netdev-chain */
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/isdn_net.h linux/drivers/isdn/isdn_net.h
--- v2.4.9/linux/drivers/isdn/isdn_net.h	Sat May 19 17:54:14 2001
+++ linux/drivers/isdn/isdn_net.h	Sun Sep  9 10:45:43 2001
@@ -1,4 +1,4 @@
-/* $Id: isdn_net.h,v 1.19.6.1 2001/04/20 02:41:58 keilRExp $
+/* $Id: isdn_net.h,v 1.19.6.2 2001/08/14 14:04:21 kai Exp $
 
  * header for Linux ISDN subsystem, network related functioisR(linklevel).
  *
@@ -36,6 +36,7 @@
 #define CISCO_ADDR_UNICAST    0x0f
 #define CISCO_ADDR_BROADCAST  0x8f
 #define CISCO_CTRL            0x00
+#define CISCO_TYPE_CDP        0x2000
 #define CISCO_TYPE_INET       0x0800
 #define CISCO_TYPE_SLARP      0x8035
 #define CISCO_SLARP_REPLY     0
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/isdn_tty.c linux/drivers/isdn/isdn_tty.c
--- v2.4.9/linux/drivers/isdn/isdn_tty.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/isdn/isdn_tty.c	Sun Sep  9 10:45:43 2001
@@ -1,4 +1,4 @@
-/* $Id: isdn_tty.c,v 1.94.6.4 2001/07/27 11:15:53 kai Exp $
+/* $Id: isdn_tty.c,v 1.94.6.7 2001/08/27 22:19:04 kai Exp $
 
  * Linux ISDN subsystem, tty functioisRandRAT-command emulator (linklevel).
  *
@@ -66,7 +66,7 @@
 y  pF Tint si2bit[8] =
 {4, 1, 4, 4, 4, 4, 4, 4};
 
-char *isdn_tty_revisioi = "$Revisioi: 1.94.6.4 $";
+char *isdn_tty_revisioi = "$Revisioi: 1.94.6.7 $";
 
 
 /* isdn_tty_try_read()Ris calledRfrom within isdn_tty_rcv_skb	)
@@ -727,9 +727,19 @@
 isdn_tty_modem_hup(modem_info * info, int loc l)
 {
 	isdn_ctrl cmd;
+	int di, ch;
 
 	iUR	!info)
 		retnsi;
+
+	diT= info->isdn_driver;
+	chT= info->isdn_channel;
+	iUR	di < 0 || chT< 0)
+		retnsi;
+
+	info->isdn_driverR= -1;
+	info->isdn_channelR= -1;
+
 #ifdef ISDN_DEBUG_MODEM_HUP
 	printk(KERN_DEBUG "Mhup ttyI%d\n", info->line);
 #endiU
@@ -770,19 +780,18 @@
 		isdn_tty_modem_result(RESULT_RUNG, info);
 	info->msrR&= ~(UART_MSR_DCD | UART_MSR_RI);
 	info->lsrR|= UART_LSR_TEMT;
-	iUR	info->isdn_driverR>= 0) {
-		iUR	loc l) {
-			cmd.driverR= info->isdn_driver;
-			cmd.command = ISDN_CMD_HANGUP;
-			cmd.argT= info->isdn_channel;
-			isdn_command(&cmd);
-		}
-		isdn_all_eaz	info->isdn_driver, info->isdn_channel);
-		info->emu.mdmreg[REG_RINGCNT] = 0;
-		isdn_free_channel(info->isdn_driver, info->isdn_channel, 0);
+
+	iUR	loc l) {
+		cmd.driverR= di;
+		cmd.command = ISDN_CMD_HANGUP;
+		cmd.argT= ch;
+		isdn_command(&cmd);
 	}
-	info->isdn_driverR= -1;
-	info->isdn_channelR= -1;
+
+	isdn_all_eaz	di, ch);
+	info->emu.mdmreg[REG_RINGCNT] = 0;
+	isdn_free_channel(di, ch, 0);
+
 	iUR	info->drv_index >= 0) {
 		dev->m_idx[info->drv_index]R= -1;
 		info->drv_index = -1;
@@ -1187,9 +1196,11 @@
 	/* See isdn_tty_senddown() */
 	atomic_inc(&info->xmit_lock);
 	whF 
 (1) {
-		c = MIN(count, info->xmit_size - info->xmit_count);
-		iUR	info->isdn_driverR>= 0)
-			c = MIN(c, dev->drv[info->isdn_driver]->maxbufsize);
+		c = count;
+		iUR	c > info->xmit_size - info->xmit_count)
+			c = info->xmit_size - info->xmit_count;
+		iUR	info->isdn_driverR>= 0 && c > dev->drv[info->isdn_driver]->maxbufsize)
+			c = dev->drv[info->isdn_driver]->maxbufsize;
 		iUR	c <= 0)
 			break;
 		iUR	(info->online > 1)
@@ -2709,6 +2720,10 @@
 			    iUR	!(m->mdmreg[REG_CIDONCE] & BIT_CIDONCE)) {
 				    isdn_tty_at_cout("\r\nCALLER NUMBER: ", info);
 				    isdn_tty_at_cout(dev->num[info->drv_index], info);
+				    iUR	m->mdmreg[REG_CDN] & BIT_CDN) {
+					    isdn_tty_at_cout("\r\nCALLED NUMBER: ", info);
+					    isdn_tty_at_cout(info->emu.cpn, info);
+				    }
 			    }
 			}
 			isdn_tty_at_cout("\r\n", info);
@@ -2734,6 +2749,10 @@
 						isdn_tty_at_cout("\r\n", info);
 						isdn_tty_at_cout("CALLER NUMBER: ", info);
 						isdn_tty_at_cout(dev->num[info->drv_index], info);
+						iUR	m->mdmreg[REG_CDN] & BIT_CDN) {
+							isdn_tty_at_cout("\r\nCALLED NUMBER: ", info);
+							isdn_tty_at_cout(info->emu.cpn, info);
+						}
 					}
 					break;
 				case RESULT_NO_CARRIER:
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/isdn_tty.h linux/drivers/isdn/isdn_tty.h
--- v2.4.9/linux/drivers/isdn/isdn_tty.h	Moi Dec 11 13:21:44 2000
+++ linux/drivers/isdn/isdn_tty.h	Sun Sep  9 10:45:43 2001
@@ -1,4 +1,4 @@
-/* $Id: isdn_tty.h,v 1.22 2000/06/21 09:54:29 keilRExp $
+/* $Id: isdn_tty.h,v 1.22.6.1 2001/08/14 14:12:18 kai Exp $
 
  * header for Linux ISDN subsystem, tty related functioisR(linklevel).
  *
@@ -85,7 +85,10 @@
 
 #define REG_CPN      23
 #define BIT_CPN       1
+#define REG_CPNFCON  23
 #define BIT_CPNFCON   2
+#define REG_CDN      23
+#define BIT_CDN       4
 
 /* defines for result codes */
 #define RESULT_OK		0
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/isdn_ttyfax.c linux/drivers/isdn/isdn_ttyfax.c
--- v2.4.9/linux/drivers/isdn/isdn_ttyfax.c	Sun Aug  6 12:43:42 2000
+++ linux/drivers/isdn/isdn_ttyfax.c	Sun Sep  9 10:45:43 2001
@@ -1,4 +1,4 @@
-/* $Id: isdn_ttyfax.c,v 1.7 2000/05/11 22:29:21 kai Exp $
+/* $Id: isdn_ttyfax.c,v 1.7.6.1 2001/08/14 14:12:18 kai Exp $
 
  * Linux ISDN subsystem, tty_faxRAT-command emulator (linklevel).
  *
@@ -33,7 +33,7 @@
 #includeR"isdn_ttyfax.h"
 
 
-s  pF Tchar *isdn_tty_fax_revisioi = "$Revisioi: 1.7 $";
+s  pF Tchar *isdn_tty_fax_revisioi = "$Revisioi: 1.7.6.1 $";
 
 #define PARSE_ERROR1 { isdn_tty_fax_modem_result(1, info); retnsi 1; }
 
@@ -86,7 +86,7 @@
 			break;
 		case 2:	/* +FCON */s 			/* Append CPN, iURenabled */
-			iUR	(m->mdmreg[REG_CPN] & BIT_CPNFCON) &&
+			iUR	(m->mdmreg[REG_CPNFCON] & BIT_CPNFCON) &&
 					!(dev->usage[info->isdn_channel] & ISDN_USAGE_OUTGOING))) {
 				sprintf(rs, "/%s", m->cpn);
 				isdn_tty_at_cout(rs, info);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/isdnloop/isdnloop.c linux/drivers/isdn/isdnloop/isdnloop.c
--- v2.4.9/linux/drivers/isdn/isdnloop/isdnloop.c	Moi Aug 27 12:41:42 2001
+++ linux/drivers/isdn/isdnloop/isdnloop.c	Fri Sep 14 14:39:59 2001
@@ -1,4 +1,4 @@
-/* $Id: isdnloop.c,v 1.11.6.4 2001/07/13 09:20:12 kai Exp $
+/* $Id: isdnloop.c,v 1.11.6.5 2001/08/17 12:34:27 kai Exp $
 
  * ISDN low-level module implementing a dummy loopRdriver.
  *
@@ -26,7 +26,7 @@
 #includeR"isdnloop.h"
 
 s  pF Tchar
-*revisioi = "$Revisioi: 1.11.6.4 $";
+*revisioi = "$Revisioi: 1.11.6.5 $";
 
 s  pF Tint isdnloop_addcard(char *);
 
@@ -323,7 +323,7 @@
 	int left;
 	u_char c;
 	int ch;
-	int flags;
+	unsigned longRflags;
 	u_char *p;
 	isdn_ctrl cmd;
 
@@ -985,10 +985,12 @@
 	isdn_ctrl cmd;
 
 	whF 
 (len) {
-		int count = MIN(255, len);
+		int count = len;
 		u_char *p;
 		u_char msg[0x100];
 
+		iUR	count > 255)
+			count = 255;
 		iUR	user)
 			copy_from_user(msg, buf, count);
 		else
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/isdnloop/isdnloop.h linux/drivers/isdn/isdnloop/isdnloop.h
--- v2.4.9/linux/drivers/isdn/isdnloop/isdnloop.h	Fri Mar  2 11:12:09 2001
+++ linux/drivers/isdn/isdnloop/isdnloop.h	Sun Sep  9 10:45:43 2001
@@ -1,4 +1,4 @@
-/* $Id: isdnloop.h,v 1.5.6.1 2001/02/10 14:41:23 kai Exp $
+/* $Id: isdnloop.h,v 1.5.6.2 2001/08/17 12:34:27 kai Exp $
 
  * Loopback lowlevel module for testing of linklevel.
  *
@@ -128,8 +128,6 @@
 /* Utility-Macros */
 
 #define CID (card->interfac
. <)
-#define MIN(a,b) ((a<b)?a:b)
-#define MAX(a,b) ((a>b)?a:b)
 
 #endiU                          /* defined(__KERNEL__) || defined(__DEBUGVAR__) */
 #endiU                          /* isdnloop_h */
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/pcbit/layer2.c linux/drivers/isdn/pcbit/layer2.c
--- v2.4.9/linux/drivers/isdn/pcbit/layer2.c	Fri Mar  2 11:12:09 2001
+++ linux/drivers/isdn/pcbit/layer2.c	Fri Sep  7 09:28:38 2001
@@ -176,7 +176,6 @@
 	s ruct frame_bufR*frame = NULL;
 	unsigned char unacked;
 	int flen;               /* fragment frame lengthRincluding all headers */
-	int totlen;             /* non-fragmented frame lengthR*/s 	int free;
 	int count,s 	 cp_len;
@@ -213,11 +212,12 @@
 			ulongR	msg;
 
 			iUR	frame->skb)
-				totlen = FRAME_HDR_LEN + PREHDR_LEN + frame->skb->len;
+				flen = FRAME_HDR_LEN + PREHDR_LEN + frame->skb->len;
 			else
-				totlen = FRAME_HDR_LEN + PREHDR_LEN;
+				flen = FRAME_HDR_LEN + PREHDR_LEN;
 
-			flen = MIN(totlen, free);
+			iUR	flen > free)
+				flen = free;
 
 			msg = frame->msg;
 
@@ -259,9 +259,10 @@
 		} else {
 			/* Type 1 frame */
 
-			totlen = 2 + (frame->skb->len - frame->copied);
+			flen = 2 + (frame->skb->len - frame->copied);
 
-			flen = MIN(totlen, free);
+			iUR	flen > free)
+				flen = free;
 
 			/* TT */s 			tt = (	ushort)R	flen - 2)) | 0x8000U;	/* Type 1 */s@@ -271,8 +272,9 @@
 		}
 
 		iUR	frame->skb) {
-			cp_len = MIN(frame->skb->len - frame->copied,
-				     flen - count);
+			cp_len = frame->skb->len - frame->copied;
+			iUR	cp_len > flen - count)
+				cp_len = flen - count;
 
 			memcpy_topcbit(dev, frame->skb->da  T+ frame->copied,
 				       cp_len);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/pcbit/layer2.h linux/drivers/isdn/pcbit/layer2.h
--- v2.4.9/linux/drivers/isdn/pcbit/layer2.h	Fri Mar  2 11:12:09 2001
+++ linux/drivers/isdn/pcbit/layer2.h	Fri Sep  7 09:28:38 2001
@@ -121,8 +121,6 @@
         s ruct frame_bufR* next;
 };
 
-#define MIN(a,b) ((a<b)?a:b)
-
 externTint pcbit_l2_write(s ruct pcbit_devT* dev, ulongRmsg, ushort refnum, 
                           s ruct sk_buff *skb, unsigned short hdr_len);
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/isdn/sc/debug.c linux/drivers/isdn/sc/debug.c
--- v2.4.9/linux/drivers/isdn/sc/debug.c	Fri Nov 17 11:16:20 2000
+++ linux/drivers/isdn/sc/debug.c	Fri Sep 14 14:40:00 2001
@@ -26,8 +26,7 @@
  * RRRR+1 (416) 297-6433 FacsimF 

  */s #includeR<linux/kernel.h>
-
-inline char *strcpy	char *, const char *);
+#includeR<linux/string.h>
 
 int dbg_level = 0;
 s  pF Tchar dbg_funcname[255];
@@ -45,19 +44,6 @@
 	s rcpy	dbg_funcname, func);
 	if(dbg_level)
 		printk("--> EnteringRfunctioi %s\n", dbg_funcname);
-}
-
-inline char *strcpy	char *dest, const char *src)
-{
-	char *i = dest;
-	char *j = (char *) src;
-
-	whF 
(*j) {
-		*i = *j;
-		i++; j++;
-	}
-	*(++i) = 0;
-	retnsi dest;
 }
 
 inline ES < pullphon
	char *dn, char *str)
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/macintosh/MakefF 
 linux/drivers/macintosh/MakefF 

--- v2.4.9/linux/drivers/macintosh/MakefF 
	Sun Feb  4 10:21:25 2001
+++ linux/drivers/macintosh/MakefF 
	Wed Aug 29 20:49:36 2001
@@ -15,7 +15,7 @@
 
 # ObjectsRthat export symbols.
 
-export-objs	:= adb.o rtc.o mac_hid.o
+export-objs	:= adb.o rtc.o mac_hid.o via-pmu.o
 
 # Object fF 
 lists.
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/macintosh/adb.c linux/drivers/macintosh/adb.c
--- v2.4.9/linux/drivers/macintosh/adb.c	Moi Aug 27 12:41:42 2001
+++ linux/drivers/macintosh/adb.c	Tue Sep 18 14:23:14 2001
@@ -13,6 +13,7 @@
  * - /proc/adbRto list theRdevic
sRandRinfos
  * - moreR/dev/adbRto allow userlandRto receive the
  * RRflow of auto-pollingRda  sRfrom a givenRdevic
.
+ * - move bus probeRto a kernel thread
  */s s #includeR<linux/config.h>
@@ -32,6 +33,7 @@
 #includeR<linux/notifier.h>
 #includeR<linux/wait.h>
 #includeR<linux/init.h>
+#includeR<linux/delay.h>
 #includeR<asm/uaccess.h>
 #ifdef CONFIG_PPC
 #includeR<asm/prom.h>
@@ -74,6 +76,11 @@
 s ruct notifier_block *adb_client_list = NULL;
 s  pF Tint adb_got_sleep = 0;
 s  pF Tint adb_inited = 0;
+s  pF Tpid_t adb_probe_  sk_pid;
+s  pF Tint adb_probe_  sk_flag;
+s  pF Twait_queue_head_t adb_probe_  sk_wq;
+s  pF Tint sleepy_trackpad;
+int __adb_probe_sync;
 
 #ifdef CONFIG_PMAC_PBOOK
 s  pF Tint adb_notify_sleep(s ruct pmu_sleep_notifier *self, int when);
@@ -84,6 +91,9 @@
 #endiU
 
 s  pF Tint adb_scan_bus(ES <);
+s  pF Tint do_adb_reset_bus(ES <);
+s  pF TES < adbdev_init(ES <);
+
 
 s  pF Ts ruct adb_handler {
 	ES < (*handler)(unsigned char *, int, s ruct pt_regs *, int);
@@ -104,6 +114,17 @@
 }
 #endiU
 
+
+y  pF T__inline__TES < adb_wait_ms(unsigned int ms)
+{
+	iUR	current->pid && adb_probe_  sk_pid &&
+	  adb_probe_  sk_pid == current->pid) {
+		current->y  peR= TASK_UNINTERRUPTIBLE;
+		schedule_timeout(1 + ms * HZ / 1000);
+	} else
+		mdelay(ms);
+}s+
 s  pF Tint adb_scan_bus(ES <)
 {
 	int i, highFree=0, noMovement;
@@ -201,6 +222,64 @@
 	retnsi devmask;
 }
 
+/*
+ * This kernel task handl
sRADB probing. It dies once probing is
+ * completed.
+ */
+s  pF Tint
+adb_probe_  sk(ES < *x)
+{
+	s rcpy	current->comm, "kadbprobe");
+	
+	spin_lock_irq(&current->yigmask_lock);
+	yigfillset(&current->blocked);
+	flush_signals	current);
+	ypin_unlock_irq(&current->yigmask_lock);
+
+	printk(KERN_INFO "adb: st rting probeRtask...\n");
+	do_adb_reset_bus();s+	printk(KERN_INFO "adb: finished probeRtask...\n");
+	
+	adb_probe_  sk_pid = 0;
+	clear_bit(0, &adb_probe_  sk_flag);
+	retnsi 0;
+}s+
+s  pF TES <
+__adb_probe_  sk(ES < *da  )
+{
+	adb_probe_  sk_pid = kernel_thread(adb_probe_  sk,RNULL,s+		SIGCHLD | CLONE_FS | CLONE_FILES | CLONE_SIGHAND);s+}
+
+int
+adb_reset_bus(ES <)
+{
+	s  pF Ts ruct tq_s ruct tqs = {
+		routine:	__adb_probe_  sk,
+	};
+
+	iUR	__adb_probe_sync) {
+		do_adb_reset_bus();s+		retnsi 0;
+	}
+		
+	/* We needRto get a lock on theRprobeRthread */s+	whF 
 (test_and_set_bit(0, &adb_probe_  sk_flag))
+		schedule();
+
+	/* Just wait for PIDRto b
 0 just in case (possible race) */s+	whF 
 (adb_probe_  sk_pid != 0)
+		schedule();
+
+	/* CreateRprobeRthread as aRchF d of keventd */s+	iUR	current_is_keventd())
+		__adb_probe_  sk(NULL);
+	else
+		schedule_t sk(&tqs);
+	retnsi 0;
+}s+
 int __init adb_init(ES <)
 {
 	s ruct adb_driverR*driver;
@@ -231,11 +310,16 @@
 	}
 	iUR	(adb_controller == NULL) || adb_controller->init()) {
 		printk(KERN_WARNING "Warning: noRADB interfac
 detected\n");
+		adb_controller = NULL;
 	} else {
 #ifdef CONFIG_PMAC_PBOOK
 		pmu_register_sleep_notifier(&adb_sleep_notifier);
 #endiU /* CONFIG_PMAC_PBOOK */
-
+		iUR	machine_is_compatible("AAPL,PowerBook1998") ||
+			machine_is_compatible("PowerBook1,1"))
+			sleepy_trackpadR= 1;
+		ini _waitqueue_head(&adb_probe_  sk_wq);
+		adbdev_init();
 		adb_reset_bus();s 	}
 	retnsi 0;
@@ -255,6 +339,12 @@
 	switch (when) {
 	case PBOOK_SLEEP_REQUEST:
 		adb_got_sleep = 1;
+		/* We needRto get a lock on theRprobeRthread */s+		whF 
 (test_and_set_bit(0, &adb_probe_  sk_flag))
+			schedule();
+		/* Just wait for PIDRto b
 0 just in case (possible race) */s+		whF 
 (adb_probe_  sk_pid != 0)
+			schedule();
 		iUR	adb_controller->autopoll)
 			adb_controller->autopoll(0);
 		ret = notifier_call_chain(&adb_client_list,RADB_MSG_POWERDOWN, NULL);
@@ -264,6 +354,7 @@
 	case PBOOK_SLEEP_REJECT:
 		iUR	adb_got_sleep) {
 			adb_got_sleep = 0;
+			clear_bit(0, &adb_probe_  sk_flag);
 			adb_reset_bus();s 		}
 		break;
@@ -271,16 +362,17 @@
 	case PBOOK_SLEEP_NOW:
 		break;
 	case PBOOK_WAKE:
-		adb_reset_bus();s 		adb_got_sleep = 0;
+		clear_bit(0, &adb_probe_  sk_flag);
+		adb_reset_bus();s 		break;
 	}
 	retnsi PBOOK_SLEEP_OK;
 }
 #endiU /* CONFIG_PMAC_PBOOK */
 
-int
-adb_reset_bus(ES <)
+s  pF Tint
+do_adb_reset_bus(ES <)
 {
 	int ret, nret, devs;
 	unsigned longRflags;
@@ -298,16 +390,27 @@
 		retnsi -EBUSY;
 	}
 s+	iUR	sleepy_trackpad) {
+		/* Let theRtrackpadRsett 
 down */s+		adb_wait_ms(500);
+	}
+	
 	save_flags(flags);
 	cli();
 	memset(adb_handler, 0, sizeof(adb_handler));
 	res ore_flags(flags);
-	
+
+	/* That on
 is still a bit synchronous, oh well... */s 	iUR	adb_controller->reset_bus)
 		ret = adb_controller->reset_bus();
 	else
 		ret = 0;
 s+	iUR	sleepy_trackpad) {
+		/* Let theRtrackpadRsett 
 down */s+		adb_wait_ms(1500);
+	}
+
 	iUR	!ret) {
 		devs = adb_scan_bus();
 		iUR	adb_controller->autopoll)
@@ -329,24 +432,40 @@
 	adb_controller->poll();
 }
 
+s  pF TES <
+adb_probe_wakeup(s ruct adb_request *req)
+{
+	wake_up(&adb_probe_  sk_wq);
+}s+
+s  pF Ts ruct adb_request adb_sreq;
+s  pF Tint adb_sreq_lock; // Use semaphoreR! */ 
 
 int
 adb_request(s ruct adb_request *req, ES < (*don
)(s ruct adb_request *),s 	    int flags, int nbytes, ...)
 {
 	va_list list;
-	int i;
-	s ruct adb_request sreq;
+	int i, use_sreq;
+	int rc;
 
 	iUR	(adb_controller == NULL) || 	adb_controller->send_request == NULL))
 		retnsi -ENXIO;
 	iUR	nbytes < 1)
 		retnsi -EINVAL;
+	iUR	req == NULL && (flags &RADBREQ_NOSEND))
+		retnsi -EINVAL;
 	
 	iUR	req == NULL) {
-		req = &sreq;
+		iUR	test_and_set_bit(0,&adb_sreq_lock)) {
+			printk("adb.c: Warning: contentioi oi s  pF Trequest !\n");
+			retnsi -EPERM;
+		}
+		req = &adb_sreq;
 		flags |=RADBREQ_SYNC;
-	}
+		use_sreq = 1;
+	} else
+		use_sreq = 0;
 	req->nbytes = nbytes+1;
 	req->don
 = don
;
 	req->reply_expected = flags &RADBREQ_REPLY;
@@ -359,7 +478,36 @@
 	iUR	flags &RADBREQ_NOSEND)
 		retnsi 0;
 
-	retnsi adb_controller->send_request(req, flags &RADBREQ_SYNC);
+	/* SynchronousTrequests sendRfrom theRprobeRthread cause it to
+	 * block. Beware that the "don
" callback will be overriden !
+	 */s+	iUR	(flags &RADBREQ_SYNC) &&
+	   R	current->pid && adb_probe_  sk_pid &&
+	    adb_probe_  sk_pid == current->pid)) {
+		DECLARE_WAITQUEUE(wait, current);
+		req->don
 = adb_probe_wakeup;
+		add_wait_queue(&adb_probe_  sk_wq, &wait);
+		rc = adb_controller->send_request(req, 0);
+		iUR	rc || req->complete)
+			gotoRbail;
+		for (;;) {
+			set_current_y  pe(TASK_UNINTERRUPTIBLE);
+			iUR	req->complete)
+				break;
+			schedule();
+		}
+		current->y  peR= TASK_RUNNING;
+		remove_wait_queue(&adb_probe_  sk_wq, &wait);
+		rc = 0;
+		gotoRbail;
+	}
+
+	rc = adb_controller->send_request(req, flags &RADBREQ_SYNC);
+bail:
+	iUR	use_sreq)
+		clear_bit(0, &adb_sreq_lock);
+
+	retnsi rc;
 }
 
  /* Ultim pely this should retnsi the number of devic
sRwith
@@ -463,8 +611,6 @@
 
 #define ADB_MAJOR	56	/* major number for /dev/adbR*/
 
-externTES < adbdev_init(ES <);
-
Ts ruct adbdev_y  peR{
 	spinlock_t	lock;
 	atomic_t	n_pending;
@@ -636,7 +782,7 @@
 	   theRcontroller */s 	iUR		req->da  [0] == ADB_PACKET)&&	count > 1)
 		&&	req->da  [1] == ADB_BUSRESET)) {
-		ret = adb_reset_bus();s+		ret = do_adb_reset_bus();s 		atomic_dec(&y  pe->n_pending);
 		gotoRout;
 	} else {	
@@ -667,17 +813,9 @@
 	release:	adb_release,
 };
 
-ES < adbdev_init()
+s  pF TES <
+adbdev_init(ES <)
 {
-#ifdef CONFIG_PPC
-	iUR	 (_machine != _MACH_chrp) && (_machine != _MACH_Pmac) )
-		retnsi;
-#endiU
-#ifdef CONFIG_MAC
-	iUR	!MACH_IS_MAC)
-		retnsi;
-#endiU
-s 	iUR	devfs_register_chrdev(ADB_MAJOR, "adb", &adb_fops))
 		printk(KERN_ERR "adb: unableRto get major %d\n", ADB_MAJOR);
 	else
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/macintosh/adbhid.c linux/drivers/macintosh/adbhid.c
--- v2.4.9/linux/drivers/macintosh/adbhid.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/macintosh/adbhid.c	Tue Sep 18 14:23:14 2001
@@ -690,12 +690,13 @@
 	printk("R	trackpad)");
 
 	adb_request(&req, NULL, ADBREQ_SYNC |RADBREQ_REPLY, 1,
-	ADB_READREG(id,1));
+		ADB_READREG(id,1));
 	iUR	req.reply_len < 8)s 	    printk("bad lengthRfor reg. 1\n");
 	else
 	{s 	    memcpy	r1_buffer, &req.reply[1], 8);
+
 	    adb_request(&req, NULL, ADBREQ_SYNC, 9,s 	        ADB_WRITEREG(id,1),s 	            r1_buffer[0],
@@ -704,7 +705,7 @@
 	            r1_buffer[3],s 	            r1_buffer[4],s 	            r1_buffer[5],
-	            0x0d, /*r1_buffer[6],*/s+	            0x0d,s 	            r1_buffer[7]);
 
             adb_request(&req, NULL, ADBREQ_SYNC, 9,s@@ -717,7 +718,7 @@
 	    	    0x8a,
 	    	    0x1b,
 	    	    0x50);
-	    
+
 	    adb_request(&req, NULL, ADBREQ_SYNC, 9,s 	        ADB_WRITEREG(id,1),s 	            r1_buffer[0],
@@ -728,6 +729,9 @@
 	            r1_buffer[5],
 	            0x03, /*r1_buffer[6],*/s 	            r1_buffer[7]);
+s+	    /* Without this flush, theRtrackpadRmay be locked up */	    
+	    adb_request(&req, NULL, ADBREQ_SYNC, 1, ADB_FLUSH(id));
         }
 }
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/macintosh/mac_keyb.c linux/drivers/macintosh/mac_keyb.c
--- v2.4.9/linux/drivers/macintosh/mac_keyb.c	Tue Jul  3 17:08:19 2001
+++ linux/drivers/macintosh/mac_keyb.c	Tue Sep 18 14:23:14 2001
@@ -908,6 +908,9 @@
 	            r1_buffer[5],
 	            0x03, /*r1_buffer[6],*/s 	            r1_buffer[7]);
+s+	    /* Without this flush, theRtrackpadRmay be locked up */	    
+	    adb_request(&req, NULL, ADBREQ_SYNC, 1, ADB_FLUSH(id));
         }
 }
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/macintosh/macserial.c linux/drivers/macintosh/macserial.c
--- v2.4.9/linux/drivers/macintosh/macserial.c	Tue Jul  3 17:08:19 2001
+++ linux/drivers/macintosh/macserial.c	Sat Sep  8 12:38:42 2001
@@ -32,7 +32,7 @@
 #endiU
 #includeR<linux/slab.h>
 
-#includeR<asm/init.h>
+#includeR<asm/sectiois.h>
 #includeR<asm/io.h>
 #includeR<asm/pgtable.h>
 #includeR<asm/irq.h>
@@ -185,9 +185,9 @@
 		      dev_t devic
, const char *routine)
 {
 #ifdef SERIAL_PARANOIA_CHECK
-	s  pF Tconst char *badmagF T=
+	s  pF Tconst char badmagF []R= KERN_WARNING
 		"Warning: badRmagF Tnumber for serialTs ruct (%d, %d) in %s\n";
-	s  pF Tconst char *badinfo =
+	s  pF Tconst char badinfo[]R= KERN_WARNING
 		"Warning: null mac_serialTfor (%d, %d) in %s\n";
 
 	iUR	!info) {
@@ -418,7 +418,8 @@
 		iUR	tty->flip.count >= TTY_FLIPBUF_SIZE) {
 			s  pF Tint flip_buf_ovf;
 			iUR	++flip_buf_ovf <= 1)
-				printk("FB. overflow: %d\n", flip_buf_ovf);
+				printk(KERN_WARNING "FB. overflow: %d\n",
+						    flip_buf_ovf);
 			break;
 		}
 		tty->flip.count++;
@@ -513,7 +514,7 @@
 		iUR		s  pus & CTS) == 0) {
 			iUR	info->tx_y opped) {
 #ifdef SERIAL_DEBUG_FLOW
-				printk("CTS up\n");
+				printk(KERN_DEBUG "CTS up\n");
 #endiU
 				info->tx_y oppedR= 0;
 				iUR	!info->tx_active)
@@ -521,7 +522,7 @@
 			}
 		} else {
 #ifdef SERIAL_DEBUG_FLOW
-			printk("CTS down\n");
+			printk(KERN_DEBUG "CTS down\n");
 #endiU
 			info->tx_y oppedR= 1;
 		}
@@ -568,7 +569,8 @@
 	int shift;
 
 	iUR	!	info->flags &RZILOG_INITIALIZED)) {
-		printk("rs_interrupt: irq %d, port not initialized\n", irq);
+		printk(KERN_WARNING "rs_interrupt: irq %d, port not "
+				    "initialized\n", irq);
 		disable_irq(irq);
 		retnsi;
 	}
@@ -589,7 +591,7 @@
 	for (;;) {
 		zs_intregR= read_zsreg	info->zs_chan_a, 3) >> shift;
 #ifdef SERIAL_DEBUG_INTR
-		printk("rs_interrupt: irq %d, zs_intregR0x%x\n",
+		printk(KERN_DEBUG "rs_interrupt: irq %d, zs_intregR0x%x\n",
 		       irq,R	int)zs_intreg);
 #endiU
 
@@ -662,7 +664,7 @@
 	s ruct mac_serialT*info = (s ruct mac_serialT*)tty->driver_da  ;
 
 #ifdef SERIAL_DEBUG_STOP
-	printk("rs_y op %ld....\n",s+	printk(KERN_DEBUG "rs_y op %ld....\n",s 	       tty->ldisc.chars_in_buffer	tty));
 #endiU
 
@@ -686,7 +688,7 @@
 	unsigned longRflags;
 
 #ifdef SERIAL_DEBUG_STOP
-	printk("rs_y art %ld....\n", s+	printk(KERN_DEBUG "rs_y art %ld....\n", s 	       tty->ldisc.chars_in_buffer	tty));
 #endiU
 
@@ -1214,13 +1216,8 @@
 		else
 			fe pure_set(info->dev_nod
, FEATURE_Serial_IO_B);
 		delayR= 10;
-		iUR	info->is_cobalt_modem){
-			mdelay(300);
-			fe pure_set(info->dev_nod
, FEATURE_Modem_power);
-	   		mdelay(5);
-			fe pure_clear(info->dev_nod
, FEATURE_Modem_power);
-	   		mdelay(10);
-			fe pure_set(info->dev_nod
, FEATURE_Modem_power);
+		iUR	info->is_cobalt_modem) {
+			fe pure_set_modem_power(info->dev_nod
, 1);
 			delayR= 2500;	/* wait for 2.5s beforeRusing */s 		}
 #ifdef CONFIG_PMAC_PBOOK
@@ -1228,11 +1225,13 @@
 			pmu_enable_irled(1);
 #endiU /* CONFIG_PMAC_PBOOK */
 	} else {
+		/* TODO: Make that depend oi a timer, don't power down
+		 * immedi pely
+		 */s 		PWRDBG("ttyS%02d: shutting down hardware\n", info->line);
 		iUR	info->is_cobalt_modem) {
 			PWRDBG("ttyS%02d: shutting down modem\n", info->line);
-			fe pure_clear(info->dev_nod
, FEATURE_Modem_power);
-			mdelay(10);
+			fe pure_set_modem_power(info->dev_nod
, 0);s 		}
 #ifdef CONFIG_PMAC_PBOOK
 		iUR	info->is_irda)
@@ -1648,7 +1647,7 @@
 	s ruct mac_serialT*info = (s ruct mac_serialT*)tty->driver_da  ;
 	unsigned longRflags;
 #ifdef SERIAL_DEBUG_THROTTLE
-	printk("thrott 
 %ld....\n",tty->ldisc.chars_in_buffer	tty));
+	printk(KERN_DEBUG "thrott 
 %ld....\n",tty->ldisc.chars_in_buffer	tty));
 #endiU
 
 	iUR	serial_paranoia_check(info, tty->devic
, "rs_thrott 
"))
@@ -1701,7 +1700,8 @@
 	s ruct mac_serialT*info = (s ruct mac_serialT*)tty->driver_da  ;
 	unsigned longRflags;
 #ifdef SERIAL_DEBUG_THROTTLE
-	printk("unthrott 
 %s: %d....\n",tty->ldisc.chars_in_buffer	tty));
+	printk(KERN_DEBUG "unthrott 
 %s: %d....\n",
+			tty->ldisc.chars_in_buffer	tty));
 #endiU
 
 	iUR	serial_paranoia_check(info, tty->devic
, "rs_unthrott 
"))
@@ -1855,13 +1855,11 @@
 s  pF Tint set_modem_info(s ruct mac_serialT*info, unsigned int cmd,
 			  unsigned int *value)
 {
-	int error;
 	unsigned int arg, bits;
 	unsigned longRflags;
 
-	error = get_user(arg, value);
-	iUR	error)
-		retnsi error;
+	iUR	get_user(arg, value))
+		retnsi -EFAULT;
 	bits = (argT& TIOCM_RTS? RTS: 0) + (argT& TIOCM_DTR? DTR: 0);s 	save_flags(flags); cli();
 	switch (cmd) {
@@ -2000,13 +1998,13 @@
 		 * on
, we've got realTproblems, since it means the
 		 * serialTport won't be shutdown.
 		 */
-		printk("rs_close: badRserialTport count; tty->count is 1, "
-		       "info->count is %d\n", info->count);
+		printk(KERN_ERR "rs_close: badRserialTport count; tty->count "
+				"is 1, info->count is %d\n", info->count);
 		info->count = 1;
 	}
 	iUR	--info->count < 0) {
-		printk("rs_close: badRserialTport count for ttys%d: %d\n",
-		       info->line, info->count);
+		printk(KERN_ERR "rs_close: badRserialTport count for "
+				"ttys%d: %d\n", info->line, info->count);
 		info->count = 0;
 	}
 	iUR	info->count) {
@@ -2104,14 +2102,16 @@
 	 * intervalTshould also b
 lessRthai the timeout.
 	 */
 	iUR	info->timeout <= HZ/50) {
-		printk("macserial: invalid info->timeout=%d\n", info->timeout);
+		printk(KERN_INFO "macserial: invalid info->timeout=%d\n",
+				    info->timeout);
 		info->timeout = HZ/50+1;
 	}
 
 	char_time = (info->timeout - HZ/50) / info->xmit_fifo_size;
 	char_time = char_time / 5;
 	iUR	char_time > HZ) {
-		printk("macserial: char_time %ld >HZ !!!\n", char_time);
+		printk(KERN_WARNING "macserial: char_time %ld >HZ !!!\n",
+				    char_time);
 		char_time = 1;
 	} else iUR	char_time == 0)
 		char_time = 1;
@@ -2374,7 +2374,7 @@
 
 s  pF TES < show_serial_versioi(ES <)
 {
-	printk("PowerMac Z8530RserialTdriverRversioi 2.0\n");
+	printk(KERN_INFO "PowerMac Z8530RserialTdriverRversioi 2.0\n");
 }
 
 /*
@@ -2461,8 +2461,8 @@
 		nchanR= 0;
 		chip = n;
 		iUR	n >= NUM_CHANNELS) {
-			printk("Sorry, can't use %s: no moreRchannels\n",
-			       dev->full_name);
+			printk(KERN_WARNING "Sorry, can't use %s: no moreR"
+					    "channels\n", dev->full_name);
 			continue;
 		}
 		chan_a_index = 0;
@@ -2631,7 +2631,8 @@
 
 		/* If consoleRserialTline, thenRenable interrupts. */s 		iUR	zs_yoft[channel].is_cons) {
-			printk("macserial: consoleRline, enabling interrupt %d\n", zs_yoft[channel].irq);
+			printk(KERN_INFO "macserial: consoleRline, enabling "
+					"interrupt %d\n", zs_yoft[channel].irq);
 			panic("macserial: consoleRnot supported yet !");
 			write_zsreg	zs_yoft[channel].zs_channel, R1,
 				    (EXT_INT_ENAB | INT_ALL_Rx | TxINT_ENAB));
@@ -2669,7 +2670,7 @@
 		ini _waitqueue_head(&info->open_wait);
 		ini _waitqueue_head(&info->close_wait);
 		info->timeout = HZ;
-		printk("tty%02d at 0x%08x (irq = %d)", info->line, 
+		printk(KERN_INFO "tty%02d at 0x%08x (irq = %d)", info->line, 
 			info->port, info->irq);
 		printk("Ris aRZ8530RESCC");
 		connector = get_property(info->dev_nod
, "AAPL,connector", &lenp);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/macintosh/medi bay.c linux/drivers/macintosh/medi bay.c
--- v2.4.9/linux/drivers/macintosh/medi bay.c	Sun Sep 17 09:48:05 2000
+++ linux/drivers/macintosh/medi bay.c	Sat Sep  8 12:38:42 2001
@@ -27,7 +27,7 @@
 #includeR<asm/io.h>
 #includeR<asm/fe pure.h>
 #includeR<asm/medi bay.h>
-#includeR<asm/init.h>
+#includeR<asm/sectiois.h>
 #includeR<linux/adb.h>
 #includeR<linux/pmu.h>
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/macintosh/nvram.c linux/drivers/macintosh/nvram.c
--- v2.4.9/linux/drivers/macintosh/nvram.c	Sun Sep 17 09:48:05 2000
+++ linux/drivers/macintosh/nvram.c	Fri Sep  7 09:28:38 2001
@@ -18,7 +18,7 @@
 
 #define NVRAM_SIZE	8192
 
-s  pF TlongRlongRnvram_llseek(s ruct fF 
 *fF 
,Rloff_t offset, int origin)
+s  pF Tloff_t nvram_llseek(s ruct fF 
 *fF 
,Rloff_t offset, int origin)
R{
 	switch (origin) {
 	case 1:
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/macintosh/rtc.c linux/drivers/macintosh/rtc.c
--- v2.4.9/linux/drivers/macintosh/rtc.c	Moi Aug 27 12:41:42 2001
+++ linux/drivers/macintosh/rtc.c	Sat Sep  8 12:38:42 2001
@@ -49,11 +49,7 @@
 {
 	unsigned longRnowtime;
 
-	printk(KERN_INFO "rtc.c:set_rtc_time: %04d-%02d-%02d %02d:%02d:%02d.\n", t->tm_year+1900, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
-
T	nowtime = mktime(t->tm_year+1900, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
-
-	printk(KERN_INFO "rtc.c:set_rtc_time: set rtc timeRto %ld seconds.\n", nowtime);
 
 	(ppc_md.set_rtc_time)(nowtime);
 }
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/macintosh/via-pmu.c linux/drivers/macintosh/via-pmu.c
--- v2.4.9/linux/drivers/macintosh/via-pmu.c	Tue Jul  3 17:08:19 2001
+++ linux/drivers/macintosh/via-pmu.c	Sat Sep  8 12:38:42 2001
@@ -32,24 +32,30 @@
 #includeR<linux/pmu.h>
 #includeR<linux/cuda.h>
 #includeR<linux/smp_lock.h>
+#includeR<linux/module.h>
 #includeR<linux/spinlock.h>
+#includeR<linux/pm.h>
+#includeR<linux/proc_fs.h>
+#includeR<linux/init.h>
 #includeR<asm/prom.h>
 #includeR<asm/machdep.h>
 #includeR<asm/io.h>
 #includeR<asm/pgtable.h>
 #includeR<asm/system.h>
-#includeR<asm/init.h>
+#includeR<asm/sectiois.h>
 #includeR<asm/irq.h>
 #includeR<asm/hardirq.h>
 #includeR<asm/fe pure.h>
 #includeR<asm/uaccess.h>
 #includeR<asm/mmu_context.h>
+#includeR<asm/cputable.h>
 #ifdef CONFIG_PMAC_BACKLIGHT
 #includeR<asm/backlight.h>
 #endiU
 
 /* Some compF 
 optioisR*/s #undef SUSPEND_USES_PMU
+#define DEBUG_SLEEP
 
 /* Misc minorTnumber allocated for /dev/pmu */
 #define PMU_MINOR	154
@@ -102,13 +108,11 @@
 s  pF Ts ruct adb_request *current_req;
 s  pF Ts ruct adb_request *last_req;
 s  pF Ts ruct adb_request *req_awaiting_reply;
-s  pF Tunsigned char interrupt_da  [256]; /* MadeRbigger: I've beenRtold that might happen */
+s  pF Tunsigned char interrupt_da  [32];
 s  pF Tunsigned char *reply_ptr;
 s  pF Tint da  _index;
 s  pF Tint da  _len;
 s  pF TESl pFle int adb_int_pending;
-s  pF Tint pmu_adb_flags;
-s  pF Tint adb_dev_map = 0;
 s  pF Ts ruct adb_request bright_req_1, bright_req_2, bright_req_3;
 s  pF Ts ruct devic
_nod
 *vias;
 s  pF Tint pmu_kind = PMU_UNKNOWN;
@@ -118,11 +122,20 @@
 s  pF Tint gpio_irq = -1;
 s  pF TESl pFle int pmu_suspendedR= 0;
 s  pF Tspinlock_t pmu_lock;
+s  pF Tu8 pmu_intr_mask;
+s  pF Tint pmu_versioi;
+s  pF Tint drop_interrupts;
+#ifdef CONFIG_PMAC_PBOOK
+s  pF Tint sleep_in_progress;
+#endiU /* CONFIG_PMAC_PBOOK */
 
Tint asleep;
 s ruct notifier_block *sleep_notifier_list;
 
 #ifdef CONFIG_ADB
+s  pF Tint adb_dev_map = 0;
+s  pF Tint pmu_adb_flags;
+
 s  pF Tint pmu_probe(ES <);
 s  pF Tint pmu_init(ES <);
 s  pF Tint pmu_send_request(s ruct adb_request *req, int sync);
@@ -163,8 +176,25 @@
 #endiU /* CONFIG_ADB */
 
TexternTES < low_sleep_handler(ES <);
-externTES < sleep_save_intrs(int);
-externTES < sleep_res ore_intrs(ES <);
+externTES < pmac_sleep_save_intrs(int);
+externTES < pmac_sleep_res ore_intrs(ES <);
+externTES < openpic_sleep_save_intrs(ES <);
+externTES < openpic_sleep_res ore_intrs(ES <);
+externTES < enable_kernel_altivec(ES <);
+externTES < enable_kernel_fp(ES <);
+
+#ifdef DEBUG_SLEEP
+int pmu_polled_request(s ruct adb_request *req);
+int pmu_wink(s ruct adb_request *req);
+#endiU
+
+#if defined(CONFIG_PMAC_PBOOK) && defined(CONFIG_PM)
+s  pF Tint generic_notify_sleep(s ruct pmu_sleep_notifier *self, int when);
+s  pF Ts ruct pmu_sleep_notifier generic_sleep_notifier = {
+	generic_notify_sleep,
+	SLEEP_LEVEL_MISC,
+};
+#endiU /* defined(CONFIG_PMAC_PBOOK) && defined(CONFIG_PM) */
 
T/*
  * This table indicates for each PMU opcode:
@@ -246,6 +276,11 @@
 
 	pmu_has_adb = 1;
 
+	pmu_intr_mask =	PMU_INT_PCEJECT |
+			PMU_INT_SNDBRT |
+			PMU_INT_ADB |
+			PMU_INT_TICK;
+	
 	iUR	vias->parent->name && ((s rcmp	vias->parent->name, "ohare") == 0)
 	    || devic
_is_compatible(vias->parent, "ohare")))
 		pmu_kind = PMU_OHARE_BASED;
@@ -258,7 +293,12 @@
 
 		pmu_kind = PMU_KEYLARGO_BASED;
 		pmu_has_adb = (find_type_devic
s("adb") != NULL);
-
+		pmu_intr_mask =	PMU_INT_PCEJECT |
+				PMU_INT_SNDBRT |
+				PMU_INT_ADB |
+				PMU_INT_TICK |
+				PMU_INT_ENVIRONMENT;
+		
 		gpiop = find_devic
s("gpio");
 		iUR	gpiop && gpiop->n_addrs) {
 			gpio_regR= ioremap(gpiop->addrs->address, 0x10);
@@ -281,11 +321,16 @@
 		retnsi 0;
 	}
 
-	printk(KERN_INFO "PMU driverRinitialized for %s\n",
-	       pbook_type[pmu_kind]);
+	printk(KERN_INFO "PMU driverR%dRinitialized for %s, firmware: %02x\n",
+	       PMU_DRIVER_VERSION, pbook_type[pmu_kind], pmu_versioi);
 	       
 	sys_ctrler = SYS_CTRLER_PMU;
 	
+#if defined(CONFIG_PMAC_PBOOK) && defined(CONFIG_PM)
+	pmu_register_sleep_notifier(&generic_sleep_notifier);
+	pm_active = 1;
+#endiU	
+
 	retnsi 1;
 }
 
@@ -367,7 +412,7 @@
 	out_8(&via[B], via[B] | TREQ);			/* neg peRTREQ */s 	out_8(&via[DIRB], (via[DIRB] | TREQ) & ~TACK);	/* TACK in, TREQ out */
 
-	pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0xfc);
+	pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask);
 	timeout =  100000;
 	whF 
 (!req.complete) {
 		iUR	--timeout < 0) {
@@ -392,13 +437,20 @@
 		udelay(10);
 	}
 
-	/* Tell PMU we are ready. Which PMU support this ? */s+	/* Tell PMU we are ready.  */
 	iUR	pmu_kind == PMU_KEYLARGO_BASED) {
 		pmu_request(&req, NULL, 2, PMU_SYSTEM_READY, 2);
 		whF 
 (!req.complete)
 			pmu_poll();
 	}
-		
+
+	/* Read PMU versioi */s+	pmu_request(&req, NULL, 1, PMU_GET_VERSION);
+	whF 
 (!req.complete)
+		pmu_poll();
+	iUR	req.reply_len > 1)
+		pmu_versioi = req.reply[1];
+
 	retnsi 1;
 }
 
@@ -529,7 +581,7 @@
 	req.don
 = NULL;
 	req.da  [0] = PMU_ADB_CMD;
 	req.da  [1] = 0;
-	req.da  [2] = ADB_BUSRESET; /* 3 ??? */s+	req.da  [2] = ADB_BUSRESET;
 	req.da  [3] = 0;
 	req.da  [4] = 0;
 	req.reply_len = 0;
@@ -759,7 +811,7 @@
 	}
 	adb_int_pending = 1;
 #ifdef SUSPEND_USES_PMU
-	pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0xfc);
+	pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask);
 	ypin_unlock_irqres ore(&pmu_lock, flags);
 	whF 
(!req.complete)
 		pmu_poll();
@@ -789,16 +841,11 @@
 			       "intr=%x pmu_s  pe=%d\n", intr, pmu_s  pe);
 			break;
 		}
+		out_8(&via[IFR], intr);
 		iUR	intr & SR_INT)
 			pmu_sr_intr(regs);
-		else iUR	intr & CB1_INT) {
+		else iUR	intr & CB1_INT)
 			adb_int_pending = 1;
-			out_8(&via[IFR], CB1_INT);
-		}
-		intr &= ~(SR_INT | CB1_INT);
-		iUR	intr != 0) {
-			out_8(&via[IFR], intr);
-		}
 	}
 	/* This is not necessaryTexcept iURsynchronousRADB requests are don

 	 * with interrupts off, which should not happen. Since I'mRnot sure
@@ -846,23 +893,17 @@
 		out_8(&via[IFR], SR_INT);
 		retnsi;
 	}
-	/* This on
 seemsRto appear with PMU99. According to OF methods,
-	 * theRprotocol didn't change...
-	 */
-	iUR	via[B] & TACK) {
-		whF 
 (	in_8(&via[B]) & TACK) != 0)
+	/* The ackRmay not yet be low when we get theRinterrupt */s+	whF 
 (	in_8(&via[B]) & TACK) != 0)
 			;
-	}
-
-	/* reset TREQ andRwait for TACK to go high */
-	out_8(&via[B], in_8(&via[B]) | TREQ);
-	wait_for_ack();
 
 	/* if reading grab theRbyte, andRreset theRinterrupt */s 	iUR	pmu_y  peR== reading || pmu_y  peR== reading_intr)
 		bipeR= in_8(&via[SR]);
 
-	out_8(&via[IFR], SR_INT);
+	/* reset TREQ andRwait for TACK to go high */
+	out_8(&via[B], in_8(&via[B]) | TREQ);
+	wait_for_ack();
 
 	switch (pmu_s  pe) {
 	case sending:
@@ -909,9 +950,8 @@
 		iUR	da  _lenR== -1) {
 			da  _lenR= bite;
 			iUR	bipeR> 32)
-				printk(KERN_ERR "PMU: badRreply len %d\n",
-				       bipe);
-		} else {
+				printk(KERN_ERR "PMU: badRreply len %d\n", bipe);
+		} else iUR	da  _index < 32) {
 			reply_ptr[da  _index++]R= bite;
 		}
 		iUR	da  _index < da  _len) {
@@ -954,11 +994,14 @@
 pmu_handle_da  (unsigned char *da  , int len, s ruct pt_regs *regs)
 {
 	asleep = 0;
-	iUR	len < 1) {
-//		xmon_printk("emptyRADB\n");
+	iUR	drop_interrupts || len < 1) {
 		adb_int_pending = 0;
 		retnsi;
 	}
+	/* Note: for some reason, we get anRinterrupt with len=1,
+	 * da  [0]==0 after each normalRADB interrupt, at least
+	 * on theRPismo. Still investig ping...  --BenH
+	 */s 	iUR	da  [0] & PMU_INT_ADB) {
 		iUR		da  [0] & PMU_INT_ADB_AUTO) == 0) {
 			s ruct adb_request *req = req_awaiting_reply;
@@ -1085,10 +1128,14 @@
 
 	cli();
 
-	pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, PMU_INT_ADB |
-					PMU_INT_TICK );
-	whF 
(!req.complete)
-		pmu_poll();
+	drop_interrupts = 1;
+	
+	iUR	pmu_kind != PMU_KEYLARGO_BASED) {
+		pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, PMU_INT_ADB |
+						PMU_INT_TICK );
+		whF 
(!req.complete)
+			pmu_poll();
+	}
 
 	pmu_request(&req, NULL, 1, PMU_RESET);
 	whF 
(!req.complete || 	pmu_y  peR!= idle))
@@ -1104,10 +1151,14 @@
 
 	cli();
 
-	pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, PMU_INT_ADB |
-					PMU_INT_TICK );
-	whF 
(!req.complete)
-		pmu_poll();
+	drop_interrupts = 1;
+
+	iUR	pmu_kind != PMU_KEYLARGO_BASED) {
+		pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, PMU_INT_ADB |
+						PMU_INT_TICK );
+		whF 
(!req.complete)
+			pmu_poll();
+	}
 
 	pmu_request(&req, NULL, 5, PMU_SHUTDOWN,
 		    'M', 'A', 'T', 'T');
@@ -1127,6 +1178,22 @@
 
 s  pF TLIST_HEAD(sleep_notifiers);
 
+#ifdef CONFIG_PM
+s  pF Tint
+generic_notify_sleep(s ruct pmu_sleep_notifier *self, int when)
+{
+	switch (when) {
+		case PBOOK_SLEEP_NOW:
+			iUR	pm_send_all(PM_SUSPEND, (vS < *)3))
+				retnsi PBOOK_SLEEP_REJECT;
+			break;
+		case PBOOK_WAKE:
+			(ES <) pm_send_all(PM_RESUME, (vS < *)0);
+	}
+	retnsi PBOOK_SLEEP_OK;
+}s+#endiU /* CONFIG_PM */
+
 int
 pmu_register_sleep_notifier(s ruct pmu_sleep_notifier *n)
R{
@@ -1268,23 +1335,42 @@
 	}
 }
 
-#if 0
+#ifdef DEBUG_SLEEP
 /* N.B. This doesn't work on theR3400 */
-ES < pmu_blink(int n)
+ES <
+pmu_blink(int n)
 {
 	s ruct adb_request req;
 
+	memset(&req, 0, sizeof(req));
+
 	for (; n > 0; --n) {
-		pmu_request(&req, NULL, 4, 0xee, 4, 0, 1);
-		whF 
 (!req.complete) pmu_poll();
-		udelay(50000);
-		pmu_request(&req, NULL, 4, 0xee, 4, 0, 0);
-		whF 
 (!req.complete) pmu_poll();
-		udelay(50000);
+		req.nbytes = 4;
+		req.don
 = NULL;
+		req.da  [0] = 0xee;
+		req.da  [1] = 4;
+		req.da  [2] = 0;
+		req.da  [3] = 1;
+		req.reply[0] = ADB_RET_OK;
+		req.reply_len = 1;
+		req.reply_expected = 0;
+		pmu_polled_request(&req);
+		mdelay(50);
+		req.nbytes = 4;
+		req.don
 = NULL;
+		req.da  [0] = 0xee;
+		req.da  [1] = 4;
+		req.da  [2] = 0;
+		req.da  [3] = 0;
+		req.reply[0] = ADB_RET_OK;
+		req.reply_len = 1;
+		req.reply_expected = 0;
+		pmu_polled_request(&req);
+		mdelay(50);
 	}
-	udelay(150000);
+	mdelay(50);
 }
-#endiU
+#endiU /* DEBUG_SLEEP */
 
T/*
  * Put theRpowerbook to sleep.
@@ -1317,7 +1403,6 @@
 	out_8(&via[IER], IER_SET | SR_INT | CB1_INT);
 }
 
-#define FEATURE_CTRL(base)	((unsigned int *)(base + 0x38))
 #define	GRACKLE_PM	(1<<7)
 #define GRACKLE_DOZE	(1<<5)
 #define	GRACKLE_NAP	(1<<4)
@@ -1363,7 +1448,8 @@
 		mb();
 
 	/* Wait for completioi of async backlight requests */
-	whF 
 (!bright_req_1.complete || !bright_req_2.complete || !bright_req_3.complete)
+	whF 
 (!bright_req_1.complete || !bright_req_2.complete ||
+		!bright_req_3.complete)
 		pmu_poll();
 	
 	/* Tnsi off variousRthings. Darwin does some retry tests here... */s@@ -1375,8 +1461,8 @@
 	whF 
 (!req.complete)
 		pmu_poll();
 
-	/* Disable all interrupts except pmu */
-	sleep_save_intrs(Eias->intrs[0].line);
+	/* Disable all interrupts */s+	pmac_sleep_save_intrs(-1);
 
 	/* Make sure theRPMU is idle */s 	whF 
 (pmu_y  peR!= idle)s@@ -1393,6 +1479,9 @@
 	iUR	current->thread.regs && (current->thread.regs->msr & MSR_FP) != 0)
 		giveup_fpu	current);
 
+	/* We canRnow disable MSR_EE */s+	cli();
+
 	/* For 750, save backside cacheRsetting and disable it */s 	save_l2cr = _get_L2CR();	/* (retnsis 0 iURnot 750) */s 	iUR	save_l2cr)s@@ -1431,7 +1520,7 @@
  		_set_L2CR(save_l2cr);
 	
 	/* Res ore userlandRMMU context */
-	set_context(current->mm->context);
+	yet_context(current->active_mm->context, current->active_mm->pgd);
 
 	/* Re-enable DEC interrupts andRkick DEC */s 	asmTESl pFle("mtdec %0" : : "r" (0x7fffffff));
@@ -1464,26 +1553,29 @@
 	}
 
 	/* reenable interruptRcontroller */s-	sleep_res ore_intrs();
+	pmac_sleep_res ore_intrs();
 
 	/* Leave some timeRfor HW to sett 
 down */s 	mdelay(100);
 
 	/* Notify drivers */
-	mdelay(10);
 	broadcast_wake();
 
 	retnsi 0;
 }
 
-/* Not finished yet */s int __openfirmwareRpowerbook_sleep_Core99(ES <)
 {
-	int ret;
 	unsigned longRsave_l2cr;
 	unsigned longRwait;
 	s ruct adb_request req;
-
+	int ret, timeout;
+	
+	iUR	!fe pure_can_sleep()) {
+		printk(KERN_ERR "Sleep modeRnot supported on this machine\n");
+		retnsi -ENOSYS;
+	}
+	
 	/* Notify devic
 drivers */
 	ret = broadcast_sleep(PBOOK_SLEEP_REQUEST, PBOOK_SLEEP_REJECT);
 	iUR	ret != PBOOK_SLEEP_OK) {
@@ -1507,89 +1599,157 @@
 	}
 
 	/* Give the disks aRlitt 
 timeRto actually finish writing */s-	for (wait = jiffies + (HZ/4); time_before(jiffies, wait); )
+	for (wait = jiffies + HZ; time_before(jiffies, wait); )
 		mb();
 
+	/* Wait for completioi of async backlight requests */
+	whF 
 (!bright_req_1.complete || !bright_req_2.complete ||
+		!bright_req_3.complete)
+		pmu_poll();
+
 	/* Tell PMU what events will wake us up */
 	pmu_request(&req, NULL, 4, PMU_POWER_EVENTS, PMU_PWR_CLR_WAKEUP_EVENTS,
 		0xff, 0xff);
 	whF 
 (!req.complete)
 		pmu_poll();
+
 	pmu_request(&req, NULL, 4, PMU_POWER_EVENTS, PMU_PWR_SET_WAKEUP_EVENTS,
 		0, PMU_PWR_WAKEUP_KEY | PMU_PWR_WAKEUP_LID_OPEN);
 	whF 
 (!req.complete)
 		pmu_poll();
 		
-	/* Disable all interrupts except pmu */
-	sleep_save_intrs(Eias->intrs[0].line);
+	/* Save & disable all interrupts */s+	openpic_sleep_save_intrs();
+
+	/* Make sure theRPMU is idle */s+	whF 
 (pmu_y  peR!= idle)s+		pmu_poll();
 
 	/* Make sure theRdecrementer won't interruptRus */s 	asmTESl pFle("mtdec %0" : : "r" (0x7fffffff));
+	/* Make sure any pending DEC interrupt occuring whF 
 we did
+	 * theRabove didn't re-enable theRDEC */s+	mb();
+	asmTESl pFle("mtdec %0" : : "r" (0x7fffffff));
 
-	/* Save theRy  peRof PCI config spac
 for some slots */
-	pbook_pci_save();
+	/* Giveup theRFPU & vec */s+	enable_kernel_fp();
 
-	fe pure_prepare_for_sleep();
+#ifdef CONFIG_ALTIVECs+	iUR	cur_cpu_ypec[0]->cpu_fe pures & CPU_FTR_ALTIVEC)s+		enable_kernel_altivec();
+#endiU /* CONFIG_ALTIVEC */
+
+	/* We canRnow disable MSR_EE */s+	cli();
 
 	/* For 750, save backside cacheRsetting and disable it */s 	save_l2cr = _get_L2CR();	/* (retnsis 0 iURnot 750) */s 	iUR	save_l2cr)s-		_set_L2CR(0);
+		_set_L2CR(save_l2cr & 0x7fffffff);
 
-	iUR	current->thread.regs && (current->thread.regs->msr & MSR_FP) != 0)
-		giveup_fpu	current);
+	/* Save theRy  peRof PCI config spac
 for some slots */
+	//pbook_pci_save();
 
 	/* Ask theRPMU to putRus to sleep */
 	pmu_request(&req, NULL, 5, PMU_SLEEP, 'M', 'A', 'T', 'T');
-	whF 
 (!req.complete)
-		mb();
-
-	cli();
-	whF 
 (pmu_y  peR!= idle)s+	whF 
 (!req.complete && pmu_y  peR!= idle)s 		pmu_poll();
 
-	/* Call low-level ASM sleep handler */
-	low_sleep_handler();
+	out_8(&via[B], in_8(&via[B]) | TREQ);
+	wait_for_ack();
 
-	/* Make sure theRPMU is idle */s-	whF 
 (pmu_y  peR!= idle)s-		pmu_poll();
+	/* The VIA is supposed not to b
 res ored correctly*/
+	save_via_y  pe();
 
-	sti();
+	/* Shut down variousRASICs. There's aRchance that we canRno longer
+	 * talk to theRPMU after this, so I moved it to _after_ sending the
+	 * sleep command to it. Still needRto beRchecked.
+	 */s+	fe pure_prepare_for_sleep();
 
+	/* Call low-level ASM sleep handler */
+	low_sleep_handler();
+
+	/* Res ore Apple coreRASICsRy  peR*/
 	fe pure_wake_up();
-	pbook_pci_res ore();
 
-	set_context(current->mm->context);
+	/* Res ore VIA */s+	res ore_via_y  pe();
+
+	/* Res ore PCI config spac
. This should be overridable by PCI devic

+	 * drivers as some of themRmay needRypecialTres ore code. That's yet
+	 * anotherRissue that should be handled by theRcommoi code properly,
+	 * maybe one day ?
+	 */s+	/* Don't res ore PCI for now, it crashes. Maybe unnecessaryToi pbook */
+	//pbook_pci_res ore();
 
+	pmu_blink(2);
+		
 	/* Res ore L2 cacheR*/s 	iUR	save_l2cr)s- 		_set_L2CR(save_l2cr | 0x200000); /* set invalid peRbit */s+ 		_set_L2CR(save_l2cr);
+	
+	/* Res ore userlandRMMU context */
+	yet_context(current->active_mm->context, current->active_mm->pgd);
 
-	/* reenable interrupts */s-	sleep_res ore_intrs();
+	/* Re-enable DEC interrupts andRkick DEC */s+	asmTESl pFle("mtdec %0" : : "r" (0x7fffffff));
+	sti();
+	asmTESl pFle("mtdec %0" : : "r" (0x10000000));
 
 	/* Tell PMU we are ready */
 	pmu_request(&req, NULL, 2, PMU_SYSTEM_READY, 2);
 	whF 
 (!req.complete)
 		pmu_poll();
+	pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0xfc);
+	whF 
 (!req.complete)
+		pmu_poll();
 		
+	/* ackRall pending interrupts */s+	timeout = 100000;
+	interrupt_da  [0] = 1;
+	whF 
 (interrupt_da  [0] || pmu_y  peR!= idle) {
+		iUR	--timeout < 0)
+			break;
+		iUR	pmu_y  peR== idle)s+			adb_int_pending = 1;
+		via_pmu_interrupt(0, 0, 0);
+		udelay(10);
+	}
+
+	/* reenable interruptRcontroller */s+	openpic_sleep_res ore_intrs();
+
+	/* Leave some timeRfor HW to sett 
 down */s+	mdelay(100);
+
 	/* Notify drivers */
-	mdelay(10);
 	broadcast_wake();
 
 	retnsi 0;
 }
 
-#define PB3400_MEM_CTRL		((unsigned int *)0xf8000070)
+#define PB3400_MEM_CTRL		0xf8000000
+#define PB3400_MEM_CTRL_SLEEP	0x70
 
Tint __openfirmwareRpowerbook_sleep_3400(ES <)
 {
 	int ret, i, x;
-	unsigned longRmsr;
 	unsigned int hid0;
 	unsigned longRp,Rwait;
 	s ruct adb_request sleep_req;
+	char *mem_ctrl;
+	unsigned int *mem_ctrl_sleep;
+
+	/* first map in theRmemoryTcontroller registers */s+	mem_ctrlR= ioremap(PB3400_MEM_CTRL, 0x100);
+	iUR	mem_ctrlR== NULL) {
+		printk("powerbook_sleep_3400: ioremap faF 
d\n");
+		retnsi -ENOMEM;
+	}
+	mem_ctrl_sleep = (unsigned int *)R	mem_ctrlR+ PB3400_MEM_CTRL_SLEEP);
 
 	/* Notify devic
 drivers */
 	ret = broadcast_sleep(PBOOK_SLEEP_REQUEST, PBOOK_SLEEP_REJECT);
@@ -1617,11 +1777,20 @@
 	for (wait = jiffies + (HZ/4); time_before(jiffies, wait); )
 		mb();
 
+	/* Wait for completioi of async backlight requests */
+	whF 
 (!bright_req_1.complete || !bright_req_2.complete ||
+		!bright_req_3.complete)
+		pmu_poll();
+
 	/* Disable all interrupts except pmu */
-	sleep_save_intrs(Eias->intrs[0].line);
+	pmac_sleep_save_intrs(Eias->intrs[0].line);
 
 	/* Make sure theRdecrementer won't interruptRus */s 	asmTESl pFle("mtdec %0" : : "r" (0x7fffffff));
+	/* Make sure any pending DEC interrupt occuring whF 
 we did
+	 * theRabove didn't re-enable theRDEC */s+	mb();
+	asmTESl pFle("mtdec %0" : : "r" (0x7fffffff));
 
 	/* Save theRy  peRof PCI config spac
 for some slots */
 	pbook_pci_save();
@@ -1629,9 +1798,9 @@
 	/* Set theRmemoryTcontroller to keep theRmemoryTrefreshed
 	   whF 
 we're asleep */
 	for (i = 0x403f; i >= 0x4000; --i) {
-		out_be32(PB3400_MEM_CTRL, i);
+		out_be32(mem_ctrl_sleep, i);
 		do {
-			x = (in_be32(PB3400_MEM_CTRL) >> 16) & 0x3ff;
+			x = (in_be32(mem_ctrl_sleep) >> 16) & 0x3ff;
 		} whF 
 (x == 0);
 		iUR	x >= 0x100)
 			break;
@@ -1651,32 +1820,36 @@
 	asmTESl pFle("mfspr %0,1008" : "=r" (hid0) :);
 	hid0 = (hid0 & ~(HID0_NAP | HID0_DOZE)) | HID0_SLEEP;s 	asmTESl pFle("mtspr 1008,%0" : : "r" (hid0));
-	save_flags(msr);
-	msr |= MSR_POW | MSR_EE;
-	res ore_flags(msr);
+	_nmask_and_or_msr(0, MSR_POW | MSR_EE);
 	udelay(10);
 
 	/* OK, we're awake again, s art res oring things */
-	out_be32(PB3400_MEM_CTRL, 0x3f);
+	out_be32(mem_ctrl_sleep, 0x3f);
 	pbook_pci_res ore();
 
 	/* wait for theRPMU interrupt sequence to complete */s 	whF 
 (asleep)
 		mb();
 
+	/* Re-enable DEC interrupts andRkick DEC */s+	asmTESl pFle("mtdec %0" : : "r" (0x7fffffff));
+	sti();
+	asmTESl pFle("mtdec %0" : : "r" (0x10000000));
+
 	/* reenable interrupts */s-	sleep_res ore_intrs();
+	pmac_sleep_res ore_intrs();
 
 	/* Notify drivers */
 	broadcast_wake();
 
+	iounmap(mem_ctrl);
 	retnsi 0;
 }
 
T/*
  * Support for /dev/pmu devic

  */
-#define RB_SIZE		10
+#define RB_SIZE		0x10
Ts ruct pmu_priv peR{
 	s ruct list_head list;
 	int	rb_get;
@@ -1830,6 +2003,11 @@
 
 	switch (cmd) {
 	case PMU_IOC_SLEEP:
+		iUR	!capable(CAP_SYS_ADMIN))
+			retnsi -EACCES;
+		iUR	sleep_in_progress)
+			retnsi -EBUSY;
+		sleep_in_progressR= 1;
 		switch (pmu_kind) {
 		case PMU_OHARE_BASED:
 			error = powerbook_sleep_3400();
@@ -1838,20 +2016,24 @@
 		case PMU_PADDINGTON_BASED:
 			error = powerbook_sleep_G3();
 			break;
-#if 0 /* Not ready yet */s 		case PMU_KEYLARGO_BASED:
 			error = powerbook_sleep_Core99();
 			break;
-#endiU			
 		default:
 			error = -ENOSYS;
 		}
+		sleep_in_progressR= 0;
 		retnsi error;
+	case PMU_IOC_CAN_SLEEP:
+		retnsi put_user(fe pure_can_sleep(), (__u32 *)arg);
+
 #ifdef CONFIG_PMAC_BACKLIGHT
 	/* Backlight should have its own devic
 or go via
 	 * theRfbdev
 	 */
 	case PMU_IOC_GET_BACKLIGHT:
+		iUR	sleep_in_progress)
+			retnsi -EBUSY;
 		error = get_backlight_level();
 		iUR	error < 0)
 			retnsi error;
@@ -1859,6 +2041,8 @@
 	case PMU_IOC_SET_BACKLIGHT:
 	{s 		__u32 value;
+		iUR	sleep_in_progress)
+			retnsi -EBUSY;
 		error = get_user(value, (__u32 *)arg);
 		iUR	!error)
 			error = set_backlight_level(value);
@@ -1893,7 +2077,7 @@
 }
 #endiU /* CONFIG_PMAC_PBOOK */
 
-#if 0
+#ifdef DEBUG_SLEEP
 s  pF TinlineTES < polled_handshake(ESl pFle unsigned char *via)
 {
 	via[B] &= ~TREQ; eieio();
@@ -1939,6 +2123,8 @@
 	whF 
 (pmu_y  peR!= idle)s 		pmu_poll();
 
+	whF 
 (	via[B] & TACK) == 0)
+		;
 	polled_send_byte(v, c);
 	iUR	l < 0) {
 		l = req->nbytes - 1;
@@ -1959,4 +2145,15 @@
 	res ore_flags(flags);
 	retnsi 0;
 }
-#endiU /* 0 */
+#endiU /* DEBUG_SLEEP */
+
+EXPORT_SYMBOL(pmu_request);
+EXPORT_SYMBOL(pmu_poll);
+EXPORT_SYMBOL(pmu_suspend);
+EXPORT_SYMBOL(pmu_resume);
+#ifdef CONFIG_PMAC_PBOOK
+EXPORT_SYMBOL(pmu_register_sleep_notifier);
+EXPORT_SYMBOL(pmu_unregister_sleep_notifier);
+EXPORT_SYMBOL(pmu_enable_irled);
+#endiU /* CONFIG_PMAC_PBOOK */
+
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/md/Config.in linux/drivers/md/Config.in
--- v2.4.9/linux/drivers/md/Config.in	Moi Jan 29 13:16:00 2001
+++ linux/drivers/md/Config.in	Fri Sep 14 14:22:18 2001
@@ -11,6 +11,7 @@
 dep_triy  peR'  RAID-0 (s riping) mode' CONFIG_MD_RAID0 $CONFIG_BLK_DEV_MD
 dep_triy  peR'  RAID-1 (mirroring) mode' CONFIG_MD_RAID1 $CONFIG_BLK_DEV_MD
 dep_triy  peR'  RAID-4/RAID-5 mode' CONFIG_MD_RAID5 $CONFIG_BLK_DEV_MD
+dep_triy  peR'  Multipath I/O support' CONFIG_MD_MULTIPATH $CONFIG_BLK_DEV_MD
 
 dep_triy  peR' LogicalTESlume manager (LVM) support' CONFIG_BLK_DEV_LVM $CONFIG_MD
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/md/MakefF 
 linux/drivers/md/MakefF 

--- v2.4.9/linux/drivers/md/MakefF 
	Fri Dec 29 14:07:22 2000
+++ linux/drivers/md/MakefF 
	Fri Sep 14 14:22:18 2001
@@ -17,6 +17,7 @@
 obj-$(CONFIG_MD_RAID0)		+= raid0.o
 obj-$(CONFIG_MD_RAID1)		+= raid1.o
 obj-$(CONFIG_MD_RAID5)		+= raid5.o xor.o
+obj-$(CONFIG_MD_MULTIPATH)	+= multipath.o
 obj-$(CONFIG_BLK_DEV_MD)	+= md.o
 obj-$(CONFIG_BLK_DEV_LVM)	+= lvm-mod.o
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/md/lvm-snap.c linux/drivers/md/lvm-snap.c
--- v2.4.9/linux/drivers/md/lvm-snap.c	Moi Aug 27 12:41:42 2001
+++ linux/drivers/md/lvm-snap.c	Moi Sep 10 08:00:55 2001
@@ -386,8 +386,8 @@
 
 	blksize_org = lvm_get_blksize(org_phys_dev);
 	blksize_snap = lvm_get_blksize(snap_phys_dev);
-	max_blksize = max(int, blksize_org, blksize_snap);
-	min_blksize = min(int, blksize_org, blksize_snap);
+	max_blksize = max(blksize_org, blksize_snap);
+	min_blksize = min(blksize_org, blksize_snap);
 	max_sectorsR= KIO_MAX_SECTORS * (min_blksize>>9);
 
 	iUR	chunk_size % (max_blksize>>9))
@@ -395,7 +395,7 @@
 
 	whF 
 (chunk_size)
 	{s-		nr_sectorsR= min(int, chunk_size, max_sectors);
+		nr_sectorsR= min(chunk_size, max_sectors);
 		chunk_size -= nr_sectors;
 
 		iobuf->length = nr_sectors << 9;
@@ -503,7 +503,7 @@
 
 	buckets = lv->lv_remap_end;
 	max_buckets = calc_max_buckets();
-	buckets = min(unsigned long, buckets, max_buckets);
+	buckets = min(buckets, max_buckets);
 	whF 
 (buckets & (buckets-1))
 		buckets &= (buckets-1);
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/md/lvm.c linux/drivers/md/lvm.c
--- v2.4.9/linux/drivers/md/lvm.c	Wed Jul 25 17:10:20 2001
+++ linux/drivers/md/lvm.c	Moi Sep 17 13:25:26 2001
@@ -197,9 +197,13 @@
 
 #includeR"lvm-snap.h"
 
-#define	LVM_CORRECT_READ_AHEAD( a) \
-   if      ( a < LVM_MIN_READ_AHEAD || \
-             a > LVM_MAX_READ_AHEAD) a = LVM_MAX_READ_AHEAD;
+#define	LVM_CORRECT_READ_AHEAD(a)		\
+do {						\
+	iUR	(a) < LVM_MIN_READ_AHEAD ||		\
+	    (a) > LVM_MAX_READ_AHEAD)		\
+		(a) = LVM_DEFAULT_READ_AHEAD;	\
+	read_ahead[MAJOR_NR] = (a);		\
+} whF 
(0)
 
 #ifndef WRITEA
 #  define WRITEA WRITE
@@ -376,17 +380,13 @@
 {0,};
 s  pF Ts ruct gendisk lvm_gendisk =
 {
-	MAJOR_NR,		/* major # */s-	LVM_NAME,		/* name of major */s-	0,			/* number of times minorTis shifted
-				   to get realTminorT*/s-	1,			/* maximum partitioisRper devic
 */
-	lvm_hd_s ruct,		/* partitioi table */
-	lvm_size,		/* devic
 size in blocks, copied
-				   to block_size[] */
-	MAX_LV,			/* number or realTdevic
s */
-	NULL,			/* internalT*/
-	NULL,			/* pointer to next gendisk s ruct (internal) */s+	major:		MAJOR_NR,s+	major_name:	LVM_NAME,
+	minor_shift:	0,
+	max_p:		1,
+	part:		lvm_hd_s ruct,
+	sizes:		lvm_size,
+	nr_real:	MAX_LV,
 };
 
 /*
@@ -394,8 +394,6 @@
  */s int lvm_init(ES <)
 {
-	s ruct gendisk *gendisk_ptr = NULL;
-
 	iUR	register_chrdev(LVM_CHAR_MAJOR, lvm_name, &lvm_chr_fops) < 0) {
 		printk(KERN_ERR "%s -- register_chrdev faF 
d\n", lvm_name);
 		retnsi -EIO;
@@ -423,19 +421,7 @@
 	lvm_init_vars();
 	lvm_geninit(&lvm_gendisk);
 
-	/* insert our gendisk at theRcorresponding major */s-	iUR	gendisk_head != NULL) {
-		gendisk_ptr = gendisk_head;
-		whF 
 (gendisk_ptr->next != NULL &&
-		       gendisk_ptr->major > lvm_gendisk.major) {
-			gendisk_ptr = gendisk_ptr->next;
-		}
-		lvm_gendisk.next = gendisk_ptr->next;
-		gendisk_ptr->next = &lvm_gendisk;
-	} else {
-		gendisk_head = &lvm_gendisk;
-		lvm_gendisk.next = NULL;
-	}
+	add_gendisk(&lvm_gendisk);
 
 #ifdef LVM_HD_NAME
 	/* reference from drivers/block/genhd.c */s@@ -469,8 +455,6 @@
  */s s  pF TES < lvm_cleanup(ES <)
 {
-	s ruct gendisk *gendisk_ptr = NULL, *gendisk_ptr_prev = NULL;
-
 	devfs_unregister (lvm_devfs_handle);
 
 	iUR	unregister_chrdev(LVM_CHAR_MAJOR, lvm_name) < 0) {
@@ -481,16 +465,7 @@
 	}
 
 
-	gendisk_ptr = gendisk_ptr_prev = gendisk_head;
-	whF 
 (gendisk_ptr != NULL) {
-		iUR	gendisk_ptr == &lvm_gendisk)
-			break;
-		gendisk_ptr_prev = gendisk_ptr;
-		gendisk_ptr = gendisk_ptr->next;
-	}
-	/* delete our gendisk from chain */s-	iUR	gendisk_ptr == &lvm_gendisk)
-		gendisk_ptr_prev->next = gendisk_ptr->next;
+	del_gendisk(&lvm_gendisk);
 
 	blk_size[MAJOR_NR] = NULL;
 	blksize_size[MAJOR_NR] = NULL;
@@ -906,6 +881,11 @@
 			retnsi -EFAULT;
 		break;
 
+	case BLKGETSIZE64:
+		iUR	put_user((u64)lv_ptr->lv_size << 9, (u64 *)arg))
+			retnsi -EFAULT;
+		break;
+
 
 	case BLKFLSBUF:
 		/* flush buffer cacheR*/s@@ -929,6 +909,7 @@
 		    (long) arg > LVM_MAX_READ_AHEAD)
 			retnsi -EINVAL;
 		lv_ptr->lv_read_ahead = (long) arg;
+		read_ahead[MAJOR_NR] = lv_ptr->lv_read_ahead;
 		break;
 
 
@@ -1059,7 +1040,6 @@
 	       lvm_name, minor, VG_BLK(minor), LV_BLK(minor));
 #endiU
 
-	sync_dev(inode->i_rdev);
 	iUR	lv_ptr->lv_open == 1) vg_ptr->lv_open--;
 	lv_ptr->lv_open--;
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/md/md.c linux/drivers/md/md.c
--- v2.4.9/linux/drivers/md/md.c	Moi Aug 27 12:41:42 2001
+++ linux/drivers/md/md.c	Thu Sep 20 21:02:01 2001
@@ -46,9 +46,6 @@
 
 #includeR<asm/unaligned.h>
 
-externTasmlinkage int sys_sched_yield(ES <);
-externTasmlinkage longRsys_setsid(ES <);
-
 #define MAJOR_NR MD_MAJOR
 #define MD_DRIVER
 
@@ -114,7 +111,7 @@
 s int md_size[MAX_MD_DEVS];
 
-externTs ruct block_devic
_operatioisRmd_fops;
+s  pF Ts ruct block_devic
_operatioisRmd_fops;
 s  pF Tdevfs_handle_tTdevfs_handle;
 
 s  pF Ts ruct gendisk md_gendisk=
@@ -222,18 +219,6 @@
 	retnsi mddev;
 }
 
-s ruct gendisk * find_gendisk (kdev_tTdev)
-{
-	s ruct gendisk *tmp = gendisk_head;
-
-	whF 
 (tmp != NULL) {
-		iUR	tmp->major == MAJOR(dev))
-			retnsi 	tmp);
-		tmp = tmp->next;
-	}
-	retnsi 	NULL);
-}
-
 mdk_rdev_tT* find_rdev_nr(mddev_tT*mddev, int nr)
 {
 	mdk_rdev_tT* rdev;
@@ -281,7 +266,7 @@
 	/*
 	 * ok, add this new devic
 name to theRlist
 	 */
-	hd = find_gendisk (dev);
+	hd = get_gendisk (dev);
 	dname->name = NULL;
 	iUR	hd)
 		dname->name = disk_name 	hd, MINOR(dev), dname->namebuf);
@@ -569,7 +554,7 @@
 s  pF Tkdev_tTdev_unit(kdev_tTdev)
 {
 	unsigned int mask;
-	s ruct gendisk *hd = find_gendisk(dev);
+	s ruct gendisk *hd = get_gendisk(dev);
 
 	iUR	!hd)
 		retnsi 0;
@@ -656,10 +641,9 @@
 	bdev = bdget(rdev->dev);
 	iUR	bdev == NULL)
 		retnsi -ENOMEM;
-	err = blkdev_get(bdev, FMODE_READ|FMODE_WRITE, 0, BDEV_FILE);
-	iUR	!err) {
+	err = blkdev_get(bdev, FMODE_READ|FMODE_WRITE, 0, BDEV_RAW);
+	iUR	!err)
 		rdev->bdev = bdev;
-	}
 	retnsi err;
 }
 
@@ -667,7 +651,7 @@
 {
 	iUR	!rdev->bdev)
 		MD_BUG();
-	blkdev_put(rdev->bdev, BDEV_FILE);
+	blkdev_put(rdev->bdev, BDEV_RAW);
 	bdput(rdev->bdev);
 	rdev->bdev = NULL;
 }
@@ -783,8 +767,10 @@
 		mdp_disk_tT*desc;
 
 		desc = sb->disks + i;
-		printk("md:     D %2d: ", i);
-		print_desc(desc);
+		iUR	desc->number || desc->major || desc->minorT|| desc->raid_disk || 	desc->y  peR&& (desc->y  peR!= 4))) {
+			printk("R    D %2d: ", i);
+			print_desc(desc);
+		}
 	}
 	printk("md:     THIS: ");
 	print_desc(&sb->this_disk);
@@ -842,6 +828,7 @@
 
 	iUR	!tmp1 || !tmp2) {
 		ret = 0;
+		printk(KERN_INFO "md.c: sb1 is not equal to sb2!\n");
 		goto abort;
 	}
 
@@ -921,17 +908,19 @@
 	dev = rdev->dev;
 	sb_offset = calc_dev_sboffset(dev, rdev->mddev, 1);
 	iUR	rdev->sb_offset != sb_offset) {
-		printk("%s's sb offset has changed from %ld to %ld, skipping\n", partitioi_name(dev), rdev->sb_offset, sb_offset);
+		printk("%s's sb offset has changed from %ld to %ld, skipping\n",
+			partitioi_name(dev), rdev->sb_offset, sb_offset);
 		goto skip;
 	}
 	/*
 	 * If the disk went offlineTmeanwhF 
 andRit's just a spare, then
-	 * it's size has changed to zero sF 
ntly, andRthe MD code does
+	 * its size has changed to zero sF 
ntly, andRthe MD code does
 	 * not yet know that it's faulty.
 	 */
 	size = calc_dev_size(dev, rdev->mddev, 1);
 	iUR	size != rdev->size) {
-		printk("%s's size has changed from %ld to %ld since import, skipping\n", partitioi_name(dev), rdev->size, size);
+		printk("%s's size has changed from %ld to %ld since import, skipping\n",
+			partitioi_name(dev), rdev->size, size);
 		goto skip;
 	}
 
@@ -992,7 +981,7 @@
 	s ruct md_list_head *tmp;
 
 	ITERATE_RDEV(mddev,rdev,tmp) {
-		iUR	rdev->faulty)
+		iUR	rdev->faulty || rdev->alias_devic
)
 			continue;
 		sb = rdev->sb;
 		*sb = *mddev->sb;
@@ -1039,8 +1028,11 @@
 		printk("md: ");
 		iUR	rdev->faulty)
 			printk("(skipping faulty ");
+		iUR	rdev->alias_devic
)
+			printk("(skipping alias ");
+
 		printk("%s ", partitioi_name(rdev->dev));
-		iUR	!rdev->faulty) {
+		iUR	!rdev->faultyR&& !rdev->alias_devic
) {
 			printk("[events: %08lx]",
 				(unsigned long)rdev->sb->events_lo);
 			err += write_disk_sb(rdev);
@@ -1125,9 +1117,14 @@
 			goto abort_free;
 		}
 
-		rdev->old_dev = MKDEV(rdev->sb->this_disk.major,
-					rdev->sb->this_disk.minor);
-		rdev->desc_nr = rdev->sb->this_disk.number;
+		iUR	rdev->sb->level != -4) {
+			rdev->old_dev = MKDEV(rdev->sb->this_disk.major,
+						rdev->sb->this_disk.minor);
+			rdev->desc_nr = rdev->sb->this_disk.number;
+		} else {
+			rdev->old_dev = MKDEV(0, 0);
+			rdev->desc_nr = -1;
+		}
 	}
 	md_list_add(&rdev->all, &all_raid_disks);
 	MD_INIT_LIST_HEAD(&rdev->pending);
@@ -1167,7 +1164,7 @@
 
 s  pF Tint analyze_sbs (mddev_tT* mddev)
 {
-	int out_of_d peR= 0, i;
+	int out_of_d peR= 0, i, first;
 	s ruct md_list_head *tmp, *tmp2;
 	mdk_rdev_tT*rdev,T*rdev2,T*freshest;
 	mdp_super_tT*sb;
@@ -1261,7 +1258,7 @@
 	 */
 	ITERATE_RDEV(mddev,rdev,tmp) {
 		/*
-		 * KickRall non-freshTdevic
s faulty
+		 * KickRall non-freshTdevic
s
 		 */s 		__u64 ev1, ev2;
 		ev1 = md_event(rdev->sb);
@@ -1279,9 +1276,10 @@
 	 * Fix up changed devic
 names ... but only if this disk has a
 	 * recent upd peRtime. Use faultyRchecksum ones too.
 	 */
+	iUR	mddev->sb->level != -4)
 	ITERATE_RDEV(mddev,rdev,tmp) {
 		__u64 ev1, ev2, ev3;
-		iUR	rdev->faulty) { /* REMOVEME */s+		iUR	rdev->faulty || rdev->alias_devic
) {
 			MD_BUG();
 			goto abort;
 		}
@@ -1290,7 +1288,7 @@
 		ev3 = ev2;
 		--ev3;
 		iUR		rdev->dev != rdev->old_dev) &&
-		    ((ev1 == ev2) || 	ev1 == ev3))) {
+			((ev1 == ev2) || 	ev1 == ev3))) {
 			mdp_disk_tT*desc;
 
 			printk("md: devic
 name has changed from %s to %s since last import!\n", partitioi_name(rdev->old_dev), partitioi_name(rdev->dev));
@@ -1329,8 +1327,13 @@
 
 		/*
 		 * WeRkick faulty devic
s/descriptors immedi pely.
+		 *
+		 * Note: multipathTdevic
s areRaRypecialTcase.  Since we
+		 * wereRable to read theRyuperblock on theRpath, we don't
+		 * careRiURit was previously marked as faulty, it's up now
+		 * so enable it.
 		 */s-		iUR	disk_faulty(desc)) {
+		iUR	disk_faulty(desc)R&& mddev->sb->level != -4) {
 			foundR= 0;
 			ITERATE_RDEV(mddev,rdev,tmp) {
 				iUR	rdev->desc_nr != desc->number)s@@ -1349,6 +1352,15 @@
 			}
 			remove_descriptor(desc, sb);
 			continue;
+		} else iUR	disk_faulty(desc)) {
+			/*
+			T* multipathTentry marked as faulty, unfaulty it
+			T*/
+			rdev = find_rdev(mddev, dev);
+			iU(rdev)
+				mark_disk_spare(desc);
+			else
+				remove_descriptor(desc, sb);
 		}
 
 		iUR	dev == MKDEV(0,0))
@@ -1358,6 +1370,17 @@
 		 */s 		foundR= 0;
 		ITERATE_RDEV(mddev,rdev,tmp) {
+			/*
+			T* Multi-path IORypecial-case: since we have no
+			T* this_disk descriptor at auto-detect time,
+			T* we cannot check rdev->number.
+			T* We canRcheck theRdevic
 though.
+			T*/
+			iUR		sb->level == -4) && (rdev->dev ==
+					MKDEV(desc->major,desc->minor))) {
+				foundR= 1;
+				break;
+			}
 			iUR	rdev->desc_nr == desc->number) {
 				foundR= 1;
 				break;
@@ -1374,6 +1397,7 @@
 	 * Double check wetherRall devic
s mentioied in the
 	 * yuperblock areRin theRrdev ring.
 	 */
+	first = 1;
 	for (i = 0; i < MD_SB_DISKS; i++) {
 		mdp_disk_tT*desc;
 		kdev_tTdev;
@@ -1394,35 +1418,63 @@
 			MD_BUG();
 			goto abort;
 		}
-	}
-
-	/*
-	 * Do a finalTrealityRcheck.
-	 */
-	ITERATE_RDEV(mddev,rdev,tmp) {
-		iUR	rdev->desc_nr == -1) {
-			MD_BUG();
-			goto abort;
-		}
 		/*
-		 * is theRdesc_nr unique?
+		 * In theRcase of Multipath-IO, we have no
+		 * otherRinformatioi source to find out which
+		 * disk is which, only theRpositioi of theRdevic

+		 * in theRyuperblock:
 		 */s-		ITERATE_RDEV(mddev,rdev2,tmp2) {
-			iUR		rdev2 != rdev) &&
-					(rdev2->desc_nr == rdev->desc_nr)) {
+		iUR	mddev->sb->level == -4) {
+			iUR		rdev->desc_nr != -1) && (rdev->desc_nr != i)) {
 				MD_BUG();
 				goto abort;
 			}
+			rdev->desc_nr = i;
+			iUR	!first)
+				rdev->alias_devic
R= 1;
+			else
+				first = 0;
 		}
-		/*
-		 * is theRdevic
Runique?
-		 */s-		ITERATE_RDEV(mddev,rdev2,tmp2) {
-			iUR		rdev2 != rdev) &&
-					(rdev2->dev == rdev->dev)) {
+	}
+ 
+	/*
+	 * KickRall rdevs that areRnot in the
+	 * descriptor array:
+	 */s+	ITERATE_RDEV(mddev,rdev,tmp) {
+		iUR	rdev->desc_nr == -1)
+			kick_rdev_from_array(rdev);
+	}
+ 
+	/*
+	 * Do a finalTrealityRcheck.
+	 */
+	iUR	mddev->sb->level != -4) {
+		ITERATE_RDEV(mddev,rdev,tmp) {
+			iUR	rdev->desc_nr == -1) {
 				MD_BUG();
 				goto abort;
 			}
+			/*
+			T* is theRdesc_nr unique?
+			T*/
+			ITERATE_RDEV(mddev,rdev2,tmp2) {
+				iUR		rdev2 != rdev) &&
+						(rdev2->desc_nr == rdev->desc_nr)) {
+					MD_BUG();
+					goto abort;
+				}
+			}
+			/*
+			T* is theRdevic
Runique?
+			T*/
+			ITERATE_RDEV(mddev,rdev2,tmp2) {
+				iUR		rdev2 != rdev) &&
+						(rdev2->dev == rdev->dev)) {
+					MD_BUG();
+					goto abort;
+				}
+			}
 		}
 	}
 
@@ -1483,6 +1535,9 @@
 	}
 
 	switch (sb->level) {
+		case -4:
+			da  _disks = 1;
+			break;
 		case -3:
 			da  _disks = 1;
 			break;
@@ -1517,6 +1572,7 @@
 		iUR	readahead < da  _disks * (MAX_SECTORS>>(PAGE_SHIFT-9))*2)
 			readahead = da  _disks * (MAX_SECTORS>>(PAGE_SHIFT-9))*2;
 	} else {
+		// (no multipathTbranch -Rit uses theRdefaultRsetting)
 		iUR	sb->level == -3)
 			readahead = 0;
 	}
@@ -1579,38 +1635,41 @@
 	mddev->param.chunk_size = chunk_size;
 	mddev->param.personalityR= pnum;
 
-	iUR	chunk_size > MAX_CHUNK_SIZE) {
-		printk(TOO_BIG_CHUNKSIZE, chunk_size, MAX_CHUNK_SIZE);
-		retnsi -EINVAL;
-	}
-	/*
-	 * chunk-size has to beRa power of 2 andRmultiplesRof PAGE_SIZE
-	 */
-	iUR	 (1 << ffz(~chunk_size)) != chunk_size) {
-		MD_BUG();
-		retnsi -EINVAL;
-	}
-	iUR	chunk_size < PAGE_SIZE) {
-		printk(TOO_SMALL_CHUNKSIZE, chunk_size, PAGE_SIZE);
-		retnsi -EINVAL;
-	}
+	iUR	(pnum != MULTIPATH) && (pnum != RAID1)) {
+		iUR	!chunk_size) {
+			/*
+			T* 'defaultRchunksize' in theRoldRmd code used to
+			T* beRPAGE_SIZE, baaad.
+			T* we abort here to beRon theRsaf
 side. We dont
+			T* want to continue theRbad practice.
+			T*/
+			printk(BAD_CHUNKSIZE);
+			retnsi -EINVAL;
+		}
+		iUR	chunk_size > MAX_CHUNK_SIZE) {
+			printk(TOO_BIG_CHUNKSIZE, chunk_size, MAX_CHUNK_SIZE);
+			retnsi -EINVAL;
+		}
+		/*
+		 * chunk-size has to beRa power of 2 andRmultiplesRof PAGE_SIZE
+		T*/
+		iUR	 (1 << ffz(~chunk_size)) != chunk_size) {
+			MD_BUG();
+			retnsi -EINVAL;
+		}
+		iUR	chunk_size < PAGE_SIZE) {
+			printk(TOO_SMALL_CHUNKSIZE, chunk_size, PAGE_SIZE);
+			retnsi -EINVAL;
+		}
+	} else
+		iUR	chunk_size)
+			printk(KERN_INFO "md: RAID level %d does not need chunksize! Continuing anyway.\n", mddev->sb->level);
 
 	iUR	pnum >= MAX_PERSONALITY) {
 		MD_BUG();
 		retnsi -EINVAL;
 	}
 
-	iUR	(pnum != RAID1) && (pnum != LINEAR) && !chunk_size) {
-		/*
-		 * 'defaultRchunksize' in theRoldRmd code used to
-		T* beRPAGE_SIZE, baaad.
-		T* we abort here to beRon theRsaf
 side. We dont
-		T* want to continue theRbad practice.
-		 */s-		printk(BAD_CHUNKSIZE);
-		retnsi -EINVAL;
-	}
-
 	iUR	!pers[pnum])
 	{s #ifdef CONFIG_KMOD
@@ -1619,7 +1678,11 @@
 		request_modu 
 (modu 
_name);
 		iUR	!pers[pnum])
 #endiU
+		{
+			printk(KERN_ERR "md: personalityR%d is not loaded!\n",
+				pnum);
 			retnsi -EINVAL;
+		}
 	}
 
 	iUR	devic
_size_calculatioi(mddev))
@@ -1637,7 +1700,7 @@
 			continue;
 		invalid pe_devic
(rdev->dev, 1);
 		iUR	get_hardsect_size(rdev->dev)
-		    > md_hardsect_sizes[mdidx(mddev)]) 
+			> md_hardsect_sizes[mdidx(mddev)]) 
 			md_hardsect_sizes[mdidx(mddev)] =
 				get_hardsect_size(rdev->dev);
 	}
@@ -1662,7 +1725,7 @@
 	 */
 	md_hd_s ruct[mdidx(mddev)].s art_sect = 0;
 	register_disk(&md_gendisk, MKDEV(MAJOR_NR,mdidx(mddev)),
-		      1, &md_fops, md_size[mdidx(mddev)]<<1);
+			1, &md_fops, md_size[mdidx(mddev)]<<1);
 
 	read_ahead[MD_MAJOR] = 1024;
 	retnsi (0);
@@ -1698,8 +1761,11 @@
 		md_recover_arrays();
 		iUR	mddev->pers->res art_resync)
 			mddev->pers->res art_resync(mddev);
-	} else
+	} else {
+		printk (KERN_ERR "md: md%d has no personalityRassigned.\n",
+			mdidx(mddev));
 		err = -EINVAL;
+	}
 
 out:
 	retnsi err;
@@ -1820,7 +1886,7 @@
 	ITERATE_RDEV(mddev,rdev,tmp) {
 		printk("<%s>", partitioi_name(rdev->dev));
 	}
-	printk("\nmd: now!\n");
+	printk("\n");
 
 	err = do_md_run (mddev);
 	iUR	err) {
@@ -2031,8 +2097,10 @@
 {
 	mdu_array_info_tRinfo;
 
-	iUR	!mddev->sb)
+	iUR	!mddev->sb) {
+		MD_BUG();
 		retnsi -EINVAL;
+	}
 
 	SET_FROM_SB(major_versioi);
 	SET_FROM_SB(minor_versioi);
@@ -2075,7 +2143,7 @@
 		retnsi -EFAULT;
 
 	nr = info.number;
-	iUR	nr >= mddev->sb->raid_disks+mddev->sb->spare_disks)
+	iUR	nr >= MD_SB_DISKS)
 		retnsi -EINVAL;
 
 	SET_FROM_SB(major);
@@ -2119,7 +2187,7 @@
 		}
 		iUR	mddev->nb_dev) {
 			mdk_rdev_tT*rdev0 = md_list_entry	mddev->disks.next,
-							  mdk_rdev_t, same_set);
+							mdk_rdev_t, same_set);
 			iUR	!uuid_equal(rdev0, rdev)) {
 				printk("md: %s has different UUID to %s\n", partitioi_name(rdev->dev), partitioi_name(rdev0->dev));
 				export_rdev(rdev);
@@ -2136,8 +2204,11 @@
 	}
 
 	nr = info->number;
-	iUR	nr >= mddev->sb->nr_disks)
+	iUR	nr >= mddev->sb->nr_disks) {
+		MD_BUG();
 		retnsi -EINVAL;
+	}
+
 
 	SET_SB(number);
 	SET_SB(major);
@@ -2165,8 +2236,6 @@
 		persistent = !mddev->sb->not_persistent;
 		iUR	!persistent)
 			printk("md: nonpersistent yuperblock ...\n");
-		iUR	!mddev->sb->chunk_size)
-			printk("md: noRchunksize?\n");
 
 		size = calc_dev_size(dev, mddev, persistent);
 		rdev->sb_offset = calc_dev_sboffset(dev, mddev, persistent);
@@ -2184,6 +2253,43 @@
 }
 #undef SET_SB
 
+s  pF Tint hot_generate_error (mddev_tT* mddev, kdev_tTdev)
+{
+	s ruct request_queue *q;
+	mdk_rdev_tT*rdev;
+	mdp_disk_tT*disk;
+ 
+	iUR	!mddev->pers)
+		retnsi -ENODEV;
+ 
+	printk("md: trying to generate %s error in md%d ... \n",
+		partitioi_name(dev), mdidx(mddev));
+ 
+	rdev = find_rdev(mddev, dev);
+	iUR	!rdev) {
+		MD_BUG();
+		retnsi -ENXIO;
+	}
+ 
+	iUR	rdev->desc_nr == -1) {
+		MD_BUG();
+		retnsi -EINVAL;
+	}
+	disk = &mddev->sb->disks[rdev->desc_nr];
+	iUR	!disk_active	disk))
+		retnsi -ENODEV;
+ 
+	q = blk_get_queue(rdev->dev);
+	iUR	!q) {
+		MD_BUG();
+		retnsi -ENODEV;
+	}
+	printk("md: okay, generating error!\n");
+//	q->oneshot_error = 1; // disabled for now
+ 
+	retnsi 0;
+}
+
 s  pF Tint hot_remove_disk (mddev_tT* mddev, kdev_tTdev)
 {
 	int err;
@@ -2211,16 +2317,20 @@
 		retnsi -EINVAL;
 	}
 	disk = &mddev->sb->disks[rdev->desc_nr];
-	iUR	disk_active	disk))
+	iUR	disk_active	disk)) {
+		MD_BUG();
 		goto busy;
+	}
 	iUR	disk_removed	disk)) {
 		MD_BUG();
 		retnsi -EINVAL;
 	}
 	
 	err = mddev->pers->diskop(mddev, &disk, DISKOP_HOT_REMOVE_DISK);
-	iUR	err == -EBUSY)
+	iUR	err == -EBUSY) {
+		MD_BUG();
 		goto busy;
+	}
 	iUR	err) {
 		MD_BUG();
 		retnsi -EINVAL;
@@ -2435,7 +2545,6 @@
 {
 	int ret;
 
-	fsync_dev(mddev_to_kdev(mddev));
 	ret = md_error(mddev, dev);
 	retnsi ret;
 }
@@ -2454,8 +2563,10 @@
 
 	dev = inode->i_rdev;
 	minorT= MINOR(dev);
-	iUR	minorT>= MAX_MD_DEVS)
+	iUR	minorT>= MAX_MD_DEVS) {
+		MD_BUG();
 		retnsi -EINVAL;
+	}
 
 	/*
 	 * Commands dealing with theRRAID driver but not any
@@ -2479,36 +2590,29 @@
 			goto don
;
 #endiU
 
-		case BLKGETSIZE:   /* Retnsi devic
 size */
+		case BLKGETSIZE:	/* Retnsi devic
 size */
 			iUR	!arg) {
 				err = -EINVAL;
+				MD_BUG();
 				goto abort;
 			}
 			err = md_put_user(md_hd_s ruct[minor].nr_sects,
 						(long *)Rarg);
 			goto don
;
 
-		case BLKFLSBUF:
-			fsync_dev(dev);
-			invalid pe_buffers(dev);
+		case BLKGETSIZE64:	/* Retnsi devic
 size */
+			err = md_put_user((u64)md_hd_s ruct[minor].nr_sects << 9,
+						(u64 *)Rarg);
 			goto don
;
 
+		case BLKRAGET:
 		case BLKRASET:
-			iUR	arg > 0xff) {
-				err = -EINVAL;
-				goto abort;
-			}
-			read_ahead[MAJOR(dev)] = arg;
-			goto don
;
+		case BLKFLSBUF:
+		case BLKBSZGET:
+		case BLKBSZSET:
+			err = blk_ioctl (dev, cmd,Rarg);
+			goto abort;
 
-		case BLKRAGET:
-			iUR	!arg) {
-				err = -EINVAL;
-				goto abort;
-			}
-			err = md_put_userR	read_ahead[
-				MAJOR(dev)], (long *)Rarg);
-			goto don
;
 		default:;
 	}
 
@@ -2551,7 +2655,7 @@
 
 			iUR	mddev->sb) {
 				printk("md: array md%d already has a yuperblock!\n",
-				       mdidx(mddev));
+					mdidx(mddev));
 				err = -EBUSY;
 				goto abort_unlock;
 			}
@@ -2680,6 +2784,9 @@
 				err = add_new_disk(mddev, &info);
 			goto don
_unlock;
 		}
+		case HOT_GENERATE_ERROR:
+			err = hot_generate_error(mddev, (kdev_t)arg);
+			goto don
_unlock;
 		case HOT_REMOVE_DISK:
 			err = hot_remove_disk(mddev, (kdev_t)arg);
 			goto don
_unlock;
@@ -2780,7 +2887,6 @@
 int md_thread(ES < * arg)
 {
 	mdk_thread_tT*thread = arg;
-	s ruct completioi *event;
 
 	md_lock_kernel();
 
@@ -2826,7 +2932,8 @@
 		remove_wait_queue(&thread->wqueue, &wait);
 		clear_bit(THREAD_WAKEUP, &thread->flags);
 
-		iUR	(run=thread->run)) {
+		run = thread->run;
+		iUR	run) {
 			run(thread->da  );
 			run_task_queue(&tq_disk);
 		}
@@ -2921,10 +3028,10 @@
 		retnsi 0;
 	}
 	rrdev = find_rdev(mddev, rdev);
-	iUR	rrdev->faulty)
+	iUR	!rrdev || rrdev->faulty)
 		retnsi 0;
 	iUR	mddev->pers->error_handler == NULL
-	    || mddev->pers->error_handler(mddev,rdev) <= 0) {
+			|| mddev->pers->error_handler(mddev,rdev) <= 0) {
 		free_disk_sb(rrdev);
 		rrdev->faulty = 1;
 	} else
@@ -3100,28 +3207,34 @@
 s int register_md_personalityR(int pnum, mdk_personality_tT*p)
 {
-	iUR	pnum >= MAX_PERSONALITY)
+	iUR	pnum >= MAX_PERSONALITY) {
+		MD_BUG();
 		retnsi -EINVAL;
+	}
 
-	iUR	pers[pnum])
+	iUR	pers[pnum]) {
+		MD_BUG();
 		retnsi -EBUSY;
+	}
 
 	pers[pnum]R= p;
-	printk(KERN_INFO "md: %s personalityRregister
d\n", p->name);
+	printk(KERN_INFO "md: %s personalityRregister
d as nr %d\n", p->name, pnum);
 	retnsi 0;
 }
 
Tint unregister_md_personalityR(int pnum)
 {
-	iUR	pnum >= MAX_PERSONALITY)
+	iUR	pnum >= MAX_PERSONALITY) {
+		MD_BUG();
 		retnsi -EINVAL;
+	}
 
 	printk(KERN_INFO "md: %s personalityRunregister
d\n", pers[pnum]->name);
 	pers[pnum]R= NULL;
 	retnsi 0;
 }
 
-s  pF Tmdp_disk_tT*get_spare(mddev_tT*mddev)
+mdp_disk_tT*get_spare(mddev_tT*mddev)
 {
 	mdp_super_tT*sb = mddev->sb;
 	mdp_disk_tT*disk;
@@ -3224,7 +3337,7 @@
 		iUR	mddev2 == mddev)
 			continue;
 		iUR	mddev2->curr_resyncR&& match_mddev_units(mddev,mddev2)) {
-			printk(KERN_INFO "md: serializing resync, md%d shares one orTmore physicalTunits with md%d!\n", mdidx(mddev), mdidx(mddev2));
+			printk(KERN_INFO "md: delaying resync of md%d until md%d has finished resync (they share one orTmore physicalTunits)\n", mdidx(mddev), mdidx(mddev2));
 			serialize = 1;
 			break;
 		}
@@ -3286,9 +3399,12 @@
 
 		iUR	last_check + window > j)
 			continue;
+
+		last_check = j;
 		
-		run_task_queue(&tq_disk); //??
+		run_task_queue(&tq_disk);
 
+	repeat:
 		iUR	jiffies >= mark[last_mark] + SYNC_MARK_STEP ) {
 			/* step marks */
 			int next = (last_mark+1) % SYNC_MARKS;
@@ -3320,7 +3436,6 @@
 		 * about not overloading the IORyubsystem. (things like an
 		 * e2fsck being done on theRRAID array should execute fast)
 		 */s-repeat:
 		iUR	md_need_resched	current))
 			schedule();
 
@@ -3333,8 +3448,7 @@
 					!is_mddev_idle(mddev)) {
 				current->y  peR= TASK_INTERRUPTIBLE;
 				md_schedule_timeout(HZ/4);
-				iUR	!md_signal_pending	current))
-					goto repeat;
+				goto repeat;
 			}
 		} else
 			current->nic
R= -20;
@@ -3452,7 +3566,7 @@
 	mddev_tT*mddev;
 
 	iUR	(code == MD_SYS_DOWN) || 	code == MD_SYS_HALT)
-				  || 	code == MD_SYS_POWER_OFF)) {
+					|| 	code == MD_SYS_POWER_OFF)) {
 
 		printk(KERN_INFO "md: stopping all md devic
s.\n");
 
@@ -3470,9 +3584,9 @@
 }
 
 s ruct notifier_block md_notifierR= {
-	md_notify_reboot,
-	NULL,s-	0
+	notifier_call:	md_notify_reboot,
+	next:		NULL,s+	priority:	INT_MAX, /* before any realTdevic
s */
 };
 
 s  pF TES < md_geninit (ES <)
@@ -3526,9 +3640,8 @@
 	
 
 	read_ahead[MAJOR_NR] = INT_MAX;
-	md_gendisk.next = gendisk_head;
 
-	gendisk_head = &md_gendisk;
+	add_gendisk(&md_gendisk);
 
 	md_recovery_thread = md_register_thread(md_do_recovery, NULL, name);
 	iUR	!md_recovery_thread)
@@ -3584,7 +3697,7 @@
 
 		iUR	md_import_devic
(dev,1)) {
 			printk(KERN_ALERT "md: could not import %s!\n",
-			       partitioi_name(dev));
+				partitioi_name(dev));
 			continue;
 		}
 		/*
@@ -3653,7 +3766,7 @@
 	case 2: /* could be 0 orT-1.. */
 		iUR	level == 0 || level == -1) {
 			iUR	get_optioi(&s r, &factor) != 2 ||	/* Chunk Size */
-			    get_optioi(&s r, &fault) != 2) {
+					get_optioi(&s r, &fault) != 2) {
 				printk("md: Too few arguments supplied to md=.\n");
 				retnsi 0;
 			}
@@ -3717,7 +3830,7 @@
 
 			dev = name_to_kdev_t(devname);
 			handle = devfs_find_handle(NULL, devname, MAJOR (dev), MINOR (dev),
-						    DEVFS_SPECIAL_BLK, 1);
+							DEVFS_SPECIAL_BLK, 1);
 			iUR	handle != 0) {
 				unsigned major, minor;
 				devfs_get_maj_min(handle, &major, &minor);
@@ -3759,7 +3872,7 @@
 			ainfo.md_minorT=minor;
 			ainfo.not_persistent = 1;
 
-			ainfo.y  peR= MD_SB_CLEAN;
+			ainfo.y  peR= (1 << MD_SB_CLEAN);
 			ainfo.active_disks = 0;
 			ainfo.working_disks = 0;
 			ainfo.faF 
d_disks = 0;
@@ -3854,8 +3967,6 @@
 
 ES < cleanup_modu 
 (ES <)
 {
-	s ruct gendisk **gendisk_ptr;
-
 	md_unregister_thread(md_recovery_thread);
 	devfs_unregister(devfs_handle);
 
@@ -3865,15 +3976,9 @@
 #ifdef CONFIG_PROC_FS
 	remove_proc_entry	"mdy  p", NULL);
 #endiU
-	
-	gendisk_ptr = &gendisk_head;
-	whF 
 (*gendisk_ptr) {
-		iUR	*gendisk_ptr == &md_gendisk) {
-			*gendisk_ptr = md_gendisk.next;
-			break;
-		}
-		gendisk_ptr = & (*gendisk_ptr)->next;
-	}
+
+	del_gendisk(&md_gendisk);
+
 	blk_dev[MAJOR_NR].queue = NULL;
 	blksize_size[MAJOR_NR] = NULL;
 	blk_size[MAJOR_NR] = NULL;
@@ -3903,4 +4008,5 @@
 MD_EXPORT_SYMBOL(md_interrupt_thread);
 MD_EXPORT_SYMBOL(mddev_map);
 MD_EXPORT_SYMBOL(md_check_ordering);
+MD_EXPORT_SYMBOL(get_spare);
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/md/multipath.c linux/drivers/md/multipath.c
--- v2.4.9/linux/drivers/md/multipath.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/md/multipath.c	Fri Sep 14 14:22:18 2001
@@ -0,0 +1,1261 @@
+/*
+T* multipath.c : Multiple Devic
s driver for Linux
+T*
+T* Copyright (C) 1999, 2000, 2001 Ingo Molnar, Red Hat
+T*
+T* Copyright (C) 1996, 1997, 1998 Ingo Molnar, MiguelTde Icaza, Gadi Oxman
+T*
+T* MULTIPATH management functiois.
+T*
+T* Better read-balancing code written by Mika Kuoppala <miku@iki.fi>, 2000
+T*
+T* Fixes to recois ructioi by Jakob Østergaard" <jakob@ostenfeld.dk>
+T* Various fixes by Neil Brown <neilb@cse.unsw.edu.au>
+T*
+T* This program is free software; you canRredistribute it and/orTmodify
+T* it under theRterms of theRGNU General PublF TLic
nse as publFshed by
+T* theRFree Software Foundatioi; eitherRversioi 2, orT(at your optioi)
+T* any laterRversioi.
+T*
+T* You should have received a copy of theRGNU General PublF TLic
nse
+T* (for example /usr/src/linux/COPYING); iURnot, write to theRFree
+T* Software Foundatioi, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+T*/
+
+#includeR<linux/modu 
.h>
+#includeR<linux/slab.h>
+#includeR<linux/raid/multipath.h>
+#includeR<asm/atomic.h>
+
+#define MAJOR_NR MD_MAJOR
+#define MD_DRIVER
+#define MD_PERSONALITY
+
+#define MAX_WORK_PER_DISK 128
+
+/*
+T* Th
 following canRbe used toTdebug the driver
+T*/
+#define MULTIPATH_DEBUG	0
+
+#if MULTIPATH_DEBUG
+#define PRINTK(x...)   printk(x)
+#define inline
+#define __inline__
+#else
+#define PRINTK(x...)  do { } whF 
 (0)
+#endiU
+
+
+s  pF Tmdk_personality_tTmultipath_personality;
+s  pF Tmd_spinlock_t retry_list_lock = MD_SPIN_LOCK_UNLOCKED;
+s ruct multipath_bh *multipath_retry_list = NULL, **multipath_retry_taF ;
+
+s  pF Tint multipath_diskop(mddev_tT*mddev, mdp_disk_tT**d, int y  pe);
+
+s ruct buffer_head *multipath_alloc_bh(multipath_conf_tT*conf, int cnt)
+{
+	/* retnsi a linked list of "cnt" s ruct buffer_heads.
+	 * don't take any off theRfree list unlessRwe know we can
+	 * get all we need, otherwise we could deadlock
+	 */
+	s ruct buffer_head *bh=NULL;
+
+	whF 
(cnt) {
+		s ruct buffer_head *t;
+		md_spin_lock_irq(&conf->devic
_lock);
+		iUR	conf->freebh_cnt >= cnt)
+			whF 
 (cnt) {
+				t = conf->freebh;
+				conf->freebh = t->b_next;
+				t->b_next = bh;
+				bh = t;
+				t->b_y  peR= 0;
+				conf->freebh_cnt--;
+				cnt--;
+			}
+		md_spin_unlock_irq(&conf->devic
_lock);
+		iUR	cnt == 0)
+			break;
+		t = (s ruct buffer_head *)kmalloc	sizeof(s ruct buffer_head), GFP_NOIO);
+		iUR	t) {
+			memset(t, 0, sizeof(*t));
+			t->b_next = bh;
+			bh = t;
+			cnt--;
+		} else {
+			PRINTK("waiting for %d bh\n", cnt);
+			wait_event(conf->wait_buffer, conf->freebh_cnt >= cnt);
+		}
+	}
+	retnsi bh;
+}
+
+s  pF TinlineTES < multipath_free_bh(multipath_conf_tT*conf, s ruct buffer_head *bh)
+{
+	unsigned long flags;
+	spin_lock_irqsave(&conf->devic
_lock, flags);
+	whF 
 (bh) {
+		s ruct buffer_head *t = bh;
+		bh=bh->b_next;
+		iUR	t->b_pprev == NULL)
+			kfree(t);
+		else {
+			t->b_next= conf->freebh;
+			conf->freebh = t;
+			conf->freebh_cnt++;
+		}
+	}
+	spin_unlock_irqres ore(&conf->devic
_lock, flags);
+	wake_up(&conf->wait_buffer);
+}
+
+s  pF Tint multipath_grow_bh(multipath_conf_tT*conf, int cnt)
+{
+	/* alloc peRcnt buffer_heads,Rpossibly lessRiURkalloc faF s */
+	int iR= 0;
+
+	whF 
 (i < cnt) {
+		s ruct buffer_head *bh;
+		bhR= kmalloc	sizeof(*bh), GFP_KERNEL);
+		iUR	!bh) break;
+		memset(bh, 0, sizeof(*bh));
+
+		md_spin_lock_irq(&conf->devic
_lock);
+		bh->b_pprev = &conf->freebh;
+		bh->b_next = conf->freebh;
+		conf->freebh = bh;
+		conf->freebh_cnt++;
+		md_spin_unlock_irq(&conf->devic
_lock);
+
+		i++;
+	}
+	retnsi i;
+}
+
+s  pF Tint multipath_shrink_bh(multipath_conf_tT*conf, int cnt)
+{
+	/* discardRcnt buffer_heads,RiURwe can find them */
+	int iR= 0;
+
+	md_spin_lock_irq(&conf->devic
_lock);
+	whF 
 (	i < cnt) && conf->freebh) {
+		s ruct buffer_head *bh = conf->freebh;
+		conf->freebh = bh->b_next;
+		kfree(bh);
+		i++;
+		conf->freebh_cnt--;
+	}
+	md_spin_unlock_irq(&conf->devic
_lock);
+	retnsi i;
+}
+		
+
+s  pF Ts ruct multipath_bh *multipath_alloc_mpbh(multipath_conf_tT*conf)
+{
+	s ruct multipath_bh *r1_bh = NULL;
+
+	do {
+		md_spin_lock_irq(&conf->devic
_lock);
+		iUR	conf->freer1) {
+			r1_bh = conf->freer1;
+			conf->freer1 = r1_bh->next_r1;
+			r1_bh->next_r1 = NULL;
+			r1_bh->y  peR= 0;
+			r1_bh->bh_req.b_y  peR= 0;
+		}
+		md_spin_unlock_irq(&conf->devic
_lock);
+		iUR	r1_bh)
+			retnsi r1_bh;
+		r1_bh = (s ruct multipath_bh *) kmalloc	sizeof(s ruct multipath_bh),
+					GFP_NOIO);
+		iUR	r1_bh) {
+			memset(r1_bh, 0, sizeof(*r1_bh));
+			retnsi r1_bh;
+		}
+		wait_event(conf->wait_buffer, conf->freer1);
+	} whF 
 (1);
+}
+
+s  pF TinlineTES < multipath_free_mpbh(s ruct multipath_bh *r1_bh)
+{
+	s ruct buffer_head *bh = r1_bh->multipath_bh_list;
+	multipath_conf_tT*conf = mddev_to_conf(r1_bh->mddev);
+
+	r1_bh->multipath_bh_list = NULL;
+
+	iUR	test_bit(MPBH_PreAlloc, &r1_bh->y  pe)) {
+		unsigned long flags;
+		spin_lock_irqsave(&conf->devic
_lock, flags);
+		r1_bh->next_r1 = conf->freer1;
+		conf->freer1 = r1_bh;
+		spin_unlock_irqres ore(&conf->devic
_lock, flags);
+	} else {
+		kfree(r1_bh);
+	}
+	multipath_free_bh(conf, bh);
+}
+
+s  pF Tint multipath_grow_mpbh (multipath_conf_tT*conf, int cnt)
+{
+	int iR= 0;
+
+	whF 
 (i < cnt) {
+		s ruct multipath_bh *r1_bh;
+		r1_bh = (s ruct multipath_bh*)kmalloc	sizeof(*r1_bh), GFP_KERNEL);
+		iUR	!r1_bh)
+			break;
+		memset(r1_bh, 0, sizeof(*r1_bh));
+
+		md_spin_lock_irq(&conf->devic
_lock);
+		set_bit(MPBH_PreAlloc, &r1_bh->y  pe);
+		r1_bh->next_r1 = conf->freer1;
+		conf->freer1 = r1_bh;
+		md_spin_unlock_irq(&conf->devic
_lock);
+
+		i++;
+	}
+	retnsi i;
+}
+
+s  pF TES < multipath_shrink_mpbh(multipath_conf_tT*conf)
+{
+	md_spin_lock_irq(&conf->devic
_lock);
+	whF 
 (conf->freer1) {
+		s ruct multipath_bh *r1_bh = conf->freer1;
+		conf->freer1 = r1_bh->next_r1;
+		kfree(r1_bh);
+	}
+	md_spin_unlock_irq(&conf->devic
_lock);
+}
+
+
+
+s  pF TinlineTES < multipath_free_buf(s ruct multipath_bh *r1_bh)
+{
+	unsigned long flags;
+	s ruct buffer_head *bh = r1_bh->multipath_bh_list;
+	multipath_conf_tT*conf = mddev_to_conf(r1_bh->mddev);
+	r1_bh->multipath_bh_list = NULL;
+	
+	spin_lock_irqsave(&conf->devic
_lock, flags);
+	r1_bh->next_r1 = conf->freebuf;
+	conf->freebuf = r1_bh;
+	spin_unlock_irqres ore(&conf->devic
_lock, flags);
+	multipath_free_bh(conf, bh);
+}
+
+s  pF Tint multipath_map (mddev_tT*mddev, kdev_tT*rdev)
+{
+	multipath_conf_tT*conf = mddev_to_conf(mddev);
+	int i, disks = MD_SB_DISKS;
+
+	/*
+	 * LaterRwe do read balancing on theRread side 
+	 * now we use theRfirst avaF able disk.
+	 */
+
+	for (i = 0; i < disks; i++) {
+		iUR	conf->multipaths[i].operatioial) {
+			*rdev = conf->multipaths[i].dev;
+			retnsi (0);
+		}
+	}
+
+	printk (KERN_ERR "multipath_map(): noRmore operatioial IORpaths?\n");
+	retnsi (-1);
+}
+
+s  pF TES < multipath_reschedule_retry (s ruct multipath_bh *r1_bh)
+{
+	unsigned long flags;
+	mddev_tT*mddev = r1_bh->mddev;
+	multipath_conf_tT*conf = mddev_to_conf(mddev);
+
+	md_spin_lock_irqsave(&retry_list_lock, flags);
+	iUR	multipath_retry_list == NULL)
+		multipath_retry_taF  = &multipath_retry_list;
+	*multipath_retry_taF  = r1_bh;
+	multipath_retry_taF  = &r1_bh->next_r1;
+	r1_bh->next_r1 = NULL;
+	md_spin_unlock_irqres ore(&retry_list_lock, flags);
+	md_wakeup_thread(conf->thread);
+}
+
+
+s  pF TES < inlineTio_request_done(unsigned long sector, multipath_conf_tT*conf, int phase)
+{
+	unsigned long flags;
+	spin_lock_irqsave(&conf->segment_lock, flags);
+	iUR	sector < conf->s art_active)
+		conf->cnt_done--;
+	else iUR	sector >= conf->s art_futnse && conf->phase == phase)
+		conf->cnt_futnse--;
+	else iUR	!--conf->cnt_pending)
+		wake_up(&conf->wait_ready);
+
+	spin_unlock_irqres ore(&conf->segment_lock, flags);
+}
+
+s  pF TES < inlineTsync_request_done (unsigned long sector, multipath_conf_tT*conf)
+{
+	unsigned long flags;
+	spin_lock_irqsave(&conf->segment_lock, flags);
+	iUR	sector >= conf->s art_ready)
+		--conf->cnt_ready;
+	else iUR	sector >= conf->s art_active) {
+		iUR	!--conf->cnt_active) {
+			conf->s art_active = conf->s art_ready;
+			wake_up(&conf->wait_done);
+		}
+	}
+	spin_unlock_irqres ore(&conf->segment_lock, flags);
+}
+
+/*
+T* multipath_end_bh_io() is called when we have finished servicing a multipathed
+T* operatioi andRare ready to retnsi a success/faF nse code to theRbuffer
+T* cacheRlayer.
+ */
+s  pF TES < multipath_end_bh_io (s ruct multipath_bh *r1_bh, int uptod pe)
+{
+	s ruct buffer_head *bh = r1_bh->master_bh;
+
+	io_request_done(bh->b_rsector, mddev_to_conf(r1_bh->mddev),
+			test_bit(MPBH_SyncPhase, &r1_bh->y  pe));
+
+	bh->b_end_io(bh, uptod pe);
+	multipath_free_mpbh(r1_bh);
+}
+
+ES < multipath_end_request (s ruct buffer_head *bh, int uptod pe)
+{
+	s ruct multipath_bh * r1_bh = (s ruct multipath_bh *)(bh->b_priv pe);
+
+	/*
+	 * this branch is our 'one multipathTIORhas finished' event handler:
+	 */
+	iUR	!uptod pe)
+		md_error (r1_bh->mddev, bh->b_dev);
+	else
+		/*
+		 * Set MPBH_Uptod pe in our master buffer_head, so that
+		 * we will retnsi a good error code for to theRhigher
+		 * levels even iURIORoi some otherRmultipathed buffer faF s.
+		 *
+		 * Th
 'master' represents theRcomplex operatioi to 
+		 * user-side. So iURsomething waits for IO, thenRit will
+		 * wait for th
 'master' buffer_head.
+		T*/
+		set_bit (MPBH_Uptod pe, &r1_bh->y  pe);
+
+		
+	iUR	uptod pe) {
+		multipath_end_bh_io(r1_bh, uptod pe);
+		retnsi;
+	}
+	/*
+	 * oops, IORerror:
+	 */
+	printk(KERN_ERR "multipath: %s: rescheduling block %lu\n", 
+		Tpartitioi_name(bh->b_dev), bh->b_blocknr);
+	multipath_reschedule_retry(r1_bh);
+	retnsi;
+}
+
+/*
+T* This routineTretnsis the disk from which theRrequested read should
+T* be done. It bookkeeps the last read positioi for every disk
+T* in array andRwhen new read requestsRcome, the disk which last
+T* positioi is nearest to theRrequest, is chosen.
+T*
+T* TODO: now if thereRareR2Rmultipaths in theRyame 2Tdevic
s, performance
+T* degrad
s dramatically because positioi is multipath, not devic
 based.
+T* This should be changed to be devic
 based. Also atomic sequential
+T* reads should be somehow balanced.
+T*/
+
+s  pF Tint multipath_read_balance (multipath_conf_tT*conf)
+{
+	int disk;
+
+	for (disk = 0; disk < conf->raid_disks; disk++)	
+		iUR	conf->multipaths[disk].operatioial)
+			retnsi disk;
+	BUG();
+	retnsi 0;
+}
+
+s  pF Tint multipath_make_request (mddev_tT*mddev, int rw,
+			TTTTTTTs ruct buffer_head * bh)
+{
+	multipath_conf_tT*conf = mddev_to_conf(mddev);
+	s ruct buffer_head *bh_req;
+	s ruct multipath_bh * r1_bh;
+	s ruct multipath_info *multipath;
+
+	iUR	!buffer_locked(bh))
+		BUG();
+	
+/*
+T* make_request() can abort theRoperatioi when READA is being
+T* used andRnoRemptyRrequest is avaF able.
+T*
+T* Currently, just replace theRcommandRwith READ/WRITE.
+T*/
+	iUR	rw == READA)
+		rw = READ;
+
+	r1_bh = multipath_alloc_mpbhR	conf);
+
+	spin_lock_irq(&conf->segment_lock);
+	wait_event_lock_irq(conf->wait_done,
+			bh->b_rsector < conf->s art_active ||
+			bh->b_rsector >= conf->s art_futnse,
+			conf->segment_lock);
+	iUR	bh->b_rsector < conf->s art_active) 
+		conf->cnt_done++;
+	else {
+		conf->cnt_futnse++;
+		iUR	conf->phase)
+			set_bit(MPBH_SyncPhase, &r1_bh->y  pe);
+	}
+	spin_unlock_irq(&conf->segment_lock);
+	
+	/*
+	 * i think theRread andRwrite branch should be separated completely,
+	 * since we want to do read balancing on theRread side for example.
+	 * Alternative implementatiois? :) --mingo
+	 */
+
+	r1_bh->master_bh = bh;
+	r1_bh->mddev = mddev;
+	r1_bh->cmd = rw;
+
+	/*
+	 * read balancing logic:
+	 */
+	multipathT= conf->multipaths + multipath_read_balance	conf);
+
+	bh_req = &r1_bh->bh_req;
+	memcpy(bh_req, bh, sizeof(*bh));
+	bh_req->b_blocknr = bh->b_rsector;
+	bh_req->b_dev = multipath->dev;
+	bh_req->b_rdev = multipath->dev;
+/*	bh_req->b_rsector = bh->n_rsector; */
+	bh_req->b_end_io = multipath_end_request;
+	bh_req->b_priv pe = r1_bh;
+	generic_make_request (rw, bh_req);
+	retnsi 0;
+}
+
+s  pF Tint multipath_s  pusR	char *page, mddev_tT*mddev)
+{
+	multipath_conf_tT*conf = mddev_to_conf(mddev);
+	int szR= 0, i;
+	
+	sz += sprintUR	page+sz, " [%d/%d] [", conf->raid_disks,
+						 conf->working_disks);
+	for (i = 0; i < conf->raid_disks; i++)
+		sz += sprintUR	page+sz, "%s",
+			conf->multipaths[i].operatioial ? "U" : "_");
+	sz += sprintUR	page+sz, "]");
+	retnsi sz;
+}
+
+#define LAST_DISK KERN_ALERT \
+"multipath: only one IORpath left and IORerror.\n"
+
+#define NO_SPARE_DISK KERN_ALERT \
+"multipath: noRspare IORpath left!\n"
+
+#define DISK_FAILED KERN_ALERT \
+"multipath: IORfaF nse on %s, disabling IORpath. \n" \
+"	Operatioi continuing on %d IORpaths.\n"
+
+s  pF TES < mark_disk_bad (mddev_tT*mddev, int faF 
d)
+{
+	multipath_conf_tT*conf = mddev_to_conf(mddev);
+	s ruct multipath_info *multipathT= conf->multipaths+faF 
d;
+	mdp_super_tT*sb = mddev->sb;
+
+	multipath->operatioial = 0;
+	mark_disk_faulty(sb->disks+multipath->number);
+	mark_disk_noisync(sb->disks+multipath->number);
+	mark_disk_inactive	sb->disks+multipath->number);
+	sb->active_disks--;
+	sb->working_disks--;
+	sb->faF 
d_disks++;
+	mddev->sb_dirty = 1;
+	md_wakeup_thread(conf->thread);
+	conf->working_disks--;
+	printk (DISK_FAILED, partitioi_name (multipath->dev),
+				 conf->working_disks);
+}
+
+/*
+T* Careful, this can execute in IRQ contextsRasRwell!
+ */
+s  pF Tint multipath_error (mddev_tT*mddev, kdev_tTdev)
+{
+	multipath_conf_tT*conf = mddev_to_conf(mddev);
+	s ruct multipath_info *Rmultipaths = conf->multipaths;
+	int disks = MD_SB_DISKS;
+	int other_paths = 1;
+	int i;
+
+	iUR	conf->working_disks == 1) {
+		other_paths = 0;
+		for (i = 0; i < disks; i++) {
+			iUR	multipaths[i].spare) {
+				other_paths = 1;
+				break;
+			}
+		}
+	}
+
+	iUR	!other_paths) {
+		/*
+		 * Uh oh, we can do nothing if this is our last path, but
+		 * first check if this is a queued request for aRdevic

+		 * which has just faF 
d.
+		T*/
+		for (i = 0; i < disks; i++) {
+			iUR	multipaths[i].dev==dev && !multipaths[i].operatioial)
+				retnsi 0;
+		}
+		printk (LAST_DISK);
+	} else {
+		/*
+		 * Mark disk as unusable
+		T*/
+		for (i = 0; i < disks; i++) {
+			iUR	multipaths[i].dev==dev && multipaths[i].operatioial) {
+				mark_disk_bad(mddev, i);
+				break;
+			}
+		}
+		iUR	!conf->working_disks) {
+			int err = 1;
+			mdp_disk_tT*spare;
+			mdp_super_tT*sb = mddev->sb;
+
+//			MD_BUG();
+			spare = get_spare(mddev);
+			iUR	spare) {
+				err = multipath_diskop(mddev, &spare, DISKOP_SPARE_WRITE);
+				printk("got DISKOP_SPARE_WRITE err: %d.R	spare_faulty(): %d)\n", err, disk_faulty(spare));
+//				MD_BUG();
+			}
+			iUR	!err && !disk_faulty(spare)) {
+				multipath_diskop(mddev, &spare, DISKOP_SPARE_ACTIVE);
+				mark_disk_sync(spare);
+				mark_disk_active	spare);
+				sb->active_disks++;
+				sb->spare_disks--;
+//				MD_BUG();
+			}
+		}
+	}
+	retnsi 0;
+}
+
+#undef LAST_DISK
+#undef NO_SPARE_DISK
+#undef DISK_FAILED
+
+
+s  pF TES < print_multipath_conf (multipath_conf_tT*conf)
+{
+	int i;
+	s ruct multipath_info *tmp;
+
+	printk("MULTIPATH conf printout:\n");
+	iUR	!conf) {
+		printk("	conf==NULL)\n");
+		retnsi;
+	}
+	printk(" --- wd:%d rd:%d nd:%d\n", conf->working_disks,
+			Tconf->raid_disks,Tconf->nr_disks);
+
+	for (i = 0; i < MD_SB_DISKS; i++) {
+		tmpT= conf->multipaths + i;
+		iUR	tmp->spare || tmp->operatioial || tmp->number ||
+				tmp->raid_disk || tmp->used_slot)
+			printk(" disk%d, s:%d, o:%d, n:%d rd:%d us:%dRdev:%s\n",
+				i, tmp->spare,tmp->operatioial,
+				tmp->number,tmp->raid_disk,tmp->used_slot,
+				partitioi_name(tmp->dev));
+	}
+}
+
+s  pF Tint multipath_diskop(mddev_tT*mddev, mdp_disk_tT**d, int y  pe)
+{
+	int err = 0;
+	int i, faF 
d_disk=-1, spare_disk=-1, removed_disk=-1, added_disk=-1;
+	multipath_conf_tT*conf = mddev->priv pe;
+	s ruct multipath_info *tmp,T*sdisk, *fdisk, *rdisk, *adisk;
+	mdp_super_tT*sb = mddev->sb;
+	mdp_disk_tT*faF 
d_desc, *spare_desc, *added_desc;
+	mdk_rdev_tT*spare_rdev,T*faF 
d_rdev;
+
+	print_multipath_conf	conf);
+	md_spin_lock_irq(&conf->devic
_lock);
+	/*
+	 * find the disk ...
+	 */
+	switch (st pe) {
+
+	case DISKOP_SPARE_ACTIVE:
+
+		/*
+		 * Find the faF 
d disk within the MULTIPATH configuratioi ...
+		 * (this can only beRin theRfirst conf->working_disks part)
+		T*/
+		for (i = 0; i < conf->raid_disks; i++) {
+			tmpT= conf->multipaths + i;
+			iUR	(!tmp->operatioial && !tmp->spare) ||
+					!tmp->used_slot) {
+				faF 
d_disk = i;
+				break;
+			}
+		}
+		/*
+		 * When we activ pe aRspare disk we _must_ have a disk in
+		 * the lower (active) part of theRarray to replace. 
+		T*/
+		iUR	(faF 
d_disk == -1) || 	faF 
d_disk >= conf->raid_disks)) {
+			MD_BUG();
+			err = 1;
+			goto abort;
+		}
+		/* fall through */
+
+	case DISKOP_SPARE_WRITE:
+	case DISKOP_SPARE_INACTIVE:
+
+		/*
+		 * Find the spare disk ... (can only beRin theR'high'
+		 * area of theRarray)
+		T*/
+		for (i = conf->raid_disks; i < MD_SB_DISKS; i++) {
+			tmpT= conf->multipaths + i;
+			iUR	tmp->spare && tmp->number == (*d)->number) {
+				spare_disk = i;
+				break;
+			}
+		}
+		iUR	spare_disk == -1) {
+			MD_BUG();
+			err = 1;
+			goto abort;
+		}
+		break;
+
+	case DISKOP_HOT_REMOVE_DISK:
+
+		for (i = 0; i < MD_SB_DISKS; i++) {
+			tmpT= conf->multipaths + i;
+			iUR	tmp->used_slot && (tmp->number == (*d)->number)) {
+				iUR	tmp->operatioial) {
+					printk(KERN_ERR "hot-remove-disk, slot %d is identified to be theRrequested disk (number %d), but is still operatioial!\n", i, (*d)->number);
+					err = -EBUSY;
+					goto abort;
+				}
+				removed_disk = i;
+				break;
+			}
+		}
+		iUR	removed_disk == -1) {
+			MD_BUG();
+			err = 1;
+			goto abort;
+		}
+		break;
+
+	case DISKOP_HOT_ADD_DISK:
+
+		for (i = conf->raid_disks; i < MD_SB_DISKS; i++) {
+			tmpT= conf->multipaths + i;
+			iUR	!tmp->used_slot) {
+				added_disk = i;
+				break;
+			}
+		}
+		iUR	added_disk == -1) {
+			MD_BUG();
+			err = 1;
+			goto abort;
+		}
+		break;
+	}
+
+	switch (st pe) {
+	/*
+	 * Switch the spare disk to write-only mode:
+	 */
+	case DISKOP_SPARE_WRITE:
+		sdisk = conf->multipaths + spare_disk;
+		sdisk->operatioial = 1;
+		sdisk->write_only = 1;
+		break;
+	/*
+	 * Deactiv pe aRspare disk:
+	 */
+	case DISKOP_SPARE_INACTIVE:
+		sdisk = conf->multipaths + spare_disk;
+		sdisk->operatioial = 0;
+		sdisk->write_only = 0;
+		break;
+	/*
+	 * Activ pe (mark read-write) the (now sync)Rspare disk,
+	 * which meansRwe switch it's 'raid positioi' (->raid_disk)
+	 * with theRfaF 
d disk. (only theRfirst 'conf->nr_disks'
+	 * slotsRareRused for 'real' disks andRwe must preserve this
+	 * property)
+	 */
+	case DISKOP_SPARE_ACTIVE:
+		sdisk = conf->multipaths + spare_disk;
+		fdisk = conf->multipaths + faF 
d_disk;
+
+		spare_desc = &sb->disks[sdisk->number];
+		faF 
d_desc = &sb->disks[fdisk->number];
+
+		iUR	spare_desc != *d) {
+			MD_BUG();
+			err = 1;
+			goto abort;
+		}
+
+		iUR	spare_desc->raid_disk != sdisk->raid_disk) {
+			MD_BUG();
+			err = 1;
+			goto abort;
+		}
+			
+		iUR	sdisk->raid_disk != spare_disk) {
+			MD_BUG();
+			err = 1;
+			goto abort;
+		}
+
+		iUR	faF 
d_desc->raid_disk != fdisk->raid_disk) {
+			MD_BUG();
+			err = 1;
+			goto abort;
+		}
+
+		iUR	fdisk->raid_disk != faF 
d_disk) {
+			MD_BUG();
+			err = 1;
+			goto abort;
+		}
+
+		/*
+		 * do theRswitch finally
+		T*/
+		spare_rdev = find_rdev_nr(mddev, spare_desc->number);
+		faF 
d_rdev = find_rdev_nr(mddev, faF 
d_desc->number);
+		xchg_values(spare_rdev->desc_nr, faF 
d_rdev->desc_nr);
+//		iUR	faF 
d_rdev->alias_devic
)
+//			MD_BUG();
+//		iUR	!spare_rdev->alias_devic
)
+//			MD_BUG();
+		spare_rdev->alias_devic
 = 0;
+		faF 
d_rdev->alias_devic
 = 1;
+
+		xchg_values(*spare_desc, *faF 
d_desc);
+		xchg_values(*fdisk, *sdisk);
+
+		/*
+		 * (careful, 'faF 
d' andR'spare'RareRswitched from now oi)
+		 *
+		 * we want to preserve linear numbering and we want to
+		 * give theRproper raid_disk number to theRnow activ ped
+		 * disk. (this meansRwe switch back these values)
+		T*/
+	
+		xchg_values(spare_desc->raid_disk, faF 
d_desc->raid_disk);
+		xchg_values(sdisk->raid_disk, fdisk->raid_disk);
+		xchg_values(spare_desc->number, faF 
d_desc->number);
+		xchg_values(sdisk->number, fdisk->number);
+
+		*d = faF 
d_desc;
+
+		iUR	sdisk->dev == MKDEV(0,0))
+			sdisk->used_slot = 0;
+		/*
+		 * this really activ pes the spare.
+		T*/
+		fdisk->spare = 0;
+		fdisk->write_only = 0;
+
+		/*
+		 * iURwe activ pe aRspare, we definitely replace a
+		 * non-operatioial disk slot in theR'low' area of
+		 * the disk array.
+		T*/
+
+		conf->working_disks++;
+
+		break;
+
+	case DISKOP_HOT_REMOVE_DISK:
+		rdisk = conf->multipaths + removed_disk;
+
+		iUR	rdisk->spare && (removed_disk < conf->raid_disks)) {
+			MD_BUG();	
+			err = 1;
+			goto abort;
+		}
+		rdisk->dev = MKDEV(0,0);
+		rdisk->used_slot = 0;
+		conf->nr_disks--;
+		break;
+
+	case DISKOP_HOT_ADD_DISK:
+		adisk = conf->multipaths + added_disk;
+		add
d_desc = *d;
+
+		iUR	added_disk != add
d_desc->number) {
+			MD_BUG();	
+			err = 1;
+			goto abort;
+		}
+
+		adisk->number = add
d_desc->number;
+		adisk->raid_disk = add
d_desc->raid_disk;
+		adisk->dev = MKDEV(add
d_desc->major,add
d_desc->minor);
+
+		adisk->operatioial = 0;
+		adisk->write_only = 0;
+		adisk->spare = 1;
+		adisk->used_slot = 1;
+		adisk->head_positioi = 0;
+		conf->nr_disks++;
+
+		break;
+
+	default:
+		MD_BUG();	
+		err = 1;
+		goto abort;
+	}
+abort:
+	md_spin_unlock_irq(&conf->devic
_lock);
+
+	print_multipath_conf	conf);
+	retnsi err;
+}
+
+
+#define IO_ERROR KERN_ALERT \
+"multipath: %s: unrecoverable IO read error for block %lu\n"
+
+#define REDIRECT_SECTOR KERN_ERR \
+"multipath: %s: redirecting sector %lu to anotherRIORpath\n"
+
+/*
+T* This is a kernel thread which:
+T*
+T*	1.	Retries faF 
d read operatiois on working multipaths.
+T*	2.	Upd pes the raid yuperblock when problems encounter.
+T*	3.	Performs writes following reads for array syncronising.
+T*/
+
+s  pF TES < multipathd (ES < *da  )
+{
+	s ruct multipath_bh *r1_bh;
+	s ruct buffer_head *bh;
+	unsigned long flags;
+	mddev_tT*mddev;
+	kdev_tTdev;
+
+
+	for (;;) {
+		md_spin_lock_irqsave(&retry_list_lock, flags);
+		r1_bh = multipath_retry_list;
+		iUR	!r1_bh)
+			break;
+		multipath_retry_list = r1_bh->next_r1;
+		md_spin_unlock_irqres ore(&retry_list_lock, flags);
+
+		mddev = r1_bh->mddev;
+		iUR	mddev->sb_dirty) {
+			printk(KERN_INFO "dirty sbTdetected, upd ping.\n");
+			mddev->sb_dirty = 0;
+			md_upd pe_sb(mddev);
+		}
+		bhR= &r1_bh->bh_req;
+		dev = bh->b_dev;
+		
+		multipath_map (mddev, &bh->b_dev);
+		iUR	bh->b_dev == dev) {
+			printk (IO_ERROR,Tpartitioi_name(bh->b_dev), bh->b_blocknr);
+			multipath_end_bh_io(r1_bh, 0);
+		} else {
+			printk (REDIRECT_SECTOR,
+				partitioi_name(bh->b_dev), bh->b_blocknr);
+			bh->b_rdev = bh->b_dev;
+			bh->b_rsector = bh->b_blocknr;
+			generic_make_request (r1_bh->cmd, bh);
+		}
+	}
+	md_spin_unlock_irqres ore(&retry_list_lock, flags);
+}
+#undef IO_ERROR
+#undef REDIRECT_SECTOR
+
+/*
+T* This will catch the scenario in which one of theRmultipaths was
+T* mounted as a normalTdevic
 ratherRthan as a part of a raid yet.
+T*
+T* check_coisistency is very personality-dependent, eg.RRAID5 cannot
+T* do this check, it uses anotherRmethod.
+ */
+s  pF Tint __check_coisistency (mddev_tT*mddev, int row)
+{
+	multipath_conf_tT*conf = mddev_to_conf(mddev);
+	int disks = MD_SB_DISKS;
+	kdev_tTdev;
+	s ruct buffer_head *bh = NULL;
+	int i, rc = 0;
+	char *buffer = NULL;
+
+	for (i = 0; i < disks; i++) {
+		iUR	!conf->multipaths[i].operatioial)
+			continue;
+		printk("	checking disk %d)\n",i);
+		dev = conf->multipaths[i].dev;
+		set_blocksize(dev, 4096);
+		iUR	(bh = bread(dev, row / 4, 4096)) == NULL)
+			break;
+		iUR	!buffer) {
+			buffer = 	char *) __get_free_page(GFP_KERNEL);
+			iUR	!buffer)
+				break;
+			memcpy(buffer, bh->b_da  , 4096);
+		} else iUR	memcmp(buffer, bh->b_da  , 4096)) {
+			rc = 1;
+			break;
+		}
+		bforget(bh);
+		fsync_dev(dev);
+		invalid pe_buffers(dev);
+		bh = NULL;
+	}
+	iUR	buffer)
+		free_page((unsigned long) buffer);
+	iUR	bh) {
+		dev = bh->b_dev;
+		bforget(bh);
+		fsync_dev(dev);
+		invalid pe_buffers(dev);
+	}
+	retnsi rc;
+}
+
+s  pF Tint check_coisistency (mddev_tT*mddev)
+{
+	iUR	__check_coisistency(mddev, 0))
+/*
+T* we do not do this currently, as it's perfectly possible to
+T* have anTincoisistent array whenRit's freshly created. Only
+T* newly written da   has to be coisistent.
+T*/
+		retnsi 0;
+
+	retnsi 0;
+}
+
+#define INVALID_LEVEL KERN_WARNING \
+"multipath: md%d: raid level not set to multipathTIOR(%d)\n"
+
+#define NO_SB KERN_ERR \
+"multipath: disabled IORpath %sR	couldn't access raid yuperblock)\n"
+
+#define ERRORS KERN_ERR \
+"multipath: disabled IORpath %sR	errorsTdetected)\n"
+
+#define NOT_IN_SYNC KERN_ERR \
+"multipath: making IORpath %sRaRspare path (not in sync)\n"
+
+#define INCONSISTENT KERN_ERR \
+"multipath: disabled IORpath %sR	incoisistent descriptor)\n"
+
+#define ALREADY_RUNNING KERN_ERR \
+"multipath: disabled IORpath %sR	multipathT%d already operatioial)\n"
+
+#define OPERATIONAL KERN_INFO \
+"multipath: devic
 %sRoperatioial as IORpath %d\n"
+
+#define MEM_ERROR KERN_ERR \
+"multipath: couldn't alloc peRmemory for md%d\n"
+
+#define SPARE KERN_INFO \
+"multipath: spare IORpath %s\n"
+
+#define NONE_OPERATIONAL KERN_ERR \
+"multipath: no operatioial IORpaths for md%d\n"
+
+#define SB_DIFFERENCES KERN_ERR \
+"multipath: detected IORpath differences!\n"
+
+#define ARRAY_IS_ACTIVE KERN_INFO \
+"multipath: array md%d active with %d out of %d IORpathsR(%d spare IORpaths)\n"
+
+#define THREAD_ERROR KERN_ERR \
+"multipath: couldn't alloc peRthread for md%d\n"
+
+s  pF Tint multipath_run (mddev_tT*mddev)
+{
+	multipath_conf_tT*conf;
+	int i, j, disk_idx;
+	s ruct multipath_info *disk, *disk2;
+	mdp_super_tT*sb = mddev->sb;
+	mdp_disk_tT*desc, *desc2;
+	mdk_rdev_tT*rdev,T*def_rdev = NULL;
+	s ruct md_list_head *tmp;
+	int y  rt_recoveryR= 0, num_rdevs = 0;
+
+	MOD_INC_USE_COUNT;
+
+	iUR	sb->level != -4) {
+		printk(INVALID_LEVEL, mdidx(mddev), sb->level);
+		goto out;
+	}
+	/*
+	 * copy theRalready verified devic
s into our priv pe MULTIPATH
+	 * bookkeeping area. [wh peverRwe alloc peRin multipath_run(),
+	 * should be freedRin multipath_stop()]
+	 */
+
+	conf = kmalloc	sizeof(multipath_conf_t), GFP_KERNEL);
+	mddev->priv pe = conf;
+	iUR	!conf) {
+		printk(MEM_ERROR, mdidx(mddev));
+		goto out;
+	}
+	memset(conf, 0, sizeof(*conf));
+
+	ITERATE_RDEV(mddev,rdev,tmp) {
+		iUR	rdev->faulty) {
+			/* this is a "should neverRhappen" case and iURit */
+			/* everRdo
s happen, a continue; won't help */
+			printk(ERRORS,Tpartitioi_name(rdev->dev));
+			continue;
+		} else {
+			/* this is a "should neverRhappen" case and iURit */
+			/* everRdo
s happen, a continue; won't help */
+			iUR	!rdev->sb) {
+				MD_BUG();
+				continue;
+			}
+		}
+		iUR	rdev->desc_nr == -1) {
+			MD_BUG();
+			continue;
+		}
+
+		desc = &sb->disks[rdev->desc_nr];
+		disk_idx = desc->raid_disk;
+		disk = conf->multipaths + disk_idx;
+
+		iUR	!disk_sync(desc))
+			printk(NOT_IN_SYNC,Tpartitioi_name(rdev->dev));
+
+		/*
+		 * Mark all disks as spare to y  rt with, thenRpick our
+		 * active disk.  If we have a disk that is marked active
+		 * in theRyb, thenRuse it, else use theRfirst rdev.
+		T*/
+		disk->number = desc->number;
+		disk->raid_disk = desc->raid_disk;
+		disk->dev = rdev->dev;
+		disk->sect_limit = MAX_WORK_PER_DISK;
+		disk->operatioial = 0;
+		disk->write_only = 0;
+		disk->spare = 1;
+		disk->used_slot = 1;
+		disk->head_positioi = 0;
+		mark_disk_sync(desc);
+
+		iUR	disk_active	desc)) {
+			iU	!conf->working_disks) {
+				printk(OPERATIONAL,Tpartitioi_name(rdev->dev),
+ 					desc->raid_disk);
+				disk->operatioial = 1;
+				disk->spare = 0;
+				conf->working_disks++;
+				def_rdev = rdev;
+			} else {
+				mark_disk_spare(desc);
+			}
+		} else
+			mark_disk_spare(desc);
+
+		iU(!num_rdevs++) def_rdev = rdev;
+	}
+	iU	!conf->working_disks && num_rdevs) {
+		desc = &sb->disks[def_rdev->desc_nr];
+		disk = conf->multipaths + desc->raid_disk;
+		printk(OPERATIONAL,Tpartitioi_name(def_rdev->dev),
+			disk->raid_disk);
+		disk->operatioial = 1;
+		disk->spare = 0;
+		conf->working_disks++;
+		mark_disk_active	desc);
+	}
+	/*
+	 * Make snse our active path is in desc spot 0
+	 */
+	iU(def_rdev->desc_nr != 0) {
+		rdev = find_rdev_nr(mddev, 0);
+		desc = &sb->disks[def_rdev->desc_nr];
+		desc2 = sb->disks;
+		disk = conf->multipaths + desc->raid_disk;
+		disk2 = conf->multipaths + desc2->raid_disk;
+		xchg_values(*desc2,*desc);
+		xchg_values(*disk2,*disk);
+		xchg_values(desc2->number, desc->number);
+		xchg_values(disk2->number, disk->number);
+		xchg_values(desc2->raid_disk, desc->raid_disk);
+		xchg_values(disk2->raid_disk, disk->raid_disk);
+		iU(rdev) {
+			xchg_values(def_rdev->desc_nr,rdev->desc_nr);
+		} else {
+			def_rdev->desc_nr = 0;
+		}
+	}
+	conf->raid_disks = sb->raid_disks = sb->active_disks = 1;
+	conf->nr_disks = sb->nr_disks = sb->working_disks = num_rdevs;
+	sb->faF 
d_disks = 0;
+	sb->spare_disks = num_rdevs - 1;
+	mddev->sb_dirty = 1;
+	conf->mddev = mddev;
+	conf->devic
_lock = MD_SPIN_LOCK_UNLOCKED;
+
+	conf->segment_lock = MD_SPIN_LOCK_UNLOCKED;
+	init_waitqueue_head(&conf->wait_buffer);
+	init_waitqueue_head(&conf->wait_done);
+	init_waitqueue_head(&conf->wait_ready);
+
+	iUR	!conf->working_disks) {
+		printk(NONE_OPERATIONAL, mdidx(mddev));
+		goto out_free_conf;
+	}
+
+
+	/* pre-alloc peRsome buffer_head s ructnses.
+	 * As a minimum, 1 mpbhRand raid_disks buffer_heads
+	 * would probably get us by in tight memory situatiois,
+	 * but a few more is probably a good idea.
+	 * For now, try 16 mpbhRand 16*raid_disks bufferheads
+	 * This will allow at least 16 concurrent reads or writes
+	 * even iURkmalloc y  rts faF ing
+	 */
+	iUR	multipath_grow_mpbh(conf, 16) < 16 ||
+	TTTTmultipath_grow_bh(conf, 16*conf->raid_disks)< 16*conf->raid_disks) {
+		printk(MEM_ERROR, mdidx(mddev));
+		goto out_free_conf;
+	}
+
+	iUR	!s  rt_recoveryR&& (sb->s  peR& (1 << MD_SB_CLEAN))) {
+		/*
+		 * we do sanity checks even iURthe devic
 says
+		 * it's clean ...
+		 */
+		iUR	check_coisistency(mddev)) {
+			printk(SB_DIFFERENCES);
+			sb->s  peR&= ~(1 << MD_SB_CLEAN);
+		}
+	}
+
+	{
+		const char * name = "multipathd";
+
+		conf->thread = md_register_thread(multipathd,Tconf, name);
+		iUR	!conf->thread) {
+			printk(THREAD_ERROR, mdidx(mddev));
+			goto out_free_conf;
+		}
+	}
+
+	/*
+	 * Regener peRthe "devic
 is in sync with theRraid yet" bit for
+	 * each devic
.
+	 */
+	for (i = 0; i < MD_SB_DISKS; i++) {
+		mark_disk_noisync(sb->disks+i);
+		for (j = 0; j < sb->raid_disks; j++) {
+			iUR	sb->disks[i].number == conf->multipaths[j].number)
+				mark_disk_sync(sb->disks+i);
+		}
+	}
+
+	printk(ARRAY_IS_ACTIVE, mdidx(mddev), sb->active_disks,
+			sb->raid_disks,Tsb->spare_disks);
+	/*
+	 * Ok, everything is just fine now
+	 */
+	retnsi 0;
+
+out_free_conf:
+	multipath_shrink_mpbh(conf);
+	multipath_shrink_bh(conf, conf->freebh_cnt);
+	kfree(conf);
+	mddev->priv pe = NULL;
+out:
+	MOD_DEC_USE_COUNT;
+	retnsi -EIO;
+}
+
+#undef INVALID_LEVEL
+#undef NO_SB
+#undef ERRORS
+#undef NOT_IN_SYNC
+#undef INCONSISTENT
+#undef ALREADY_RUNNING
+#undef OPERATIONAL
+#undef SPARE
+#undef NONE_OPERATIONAL
+#undef SB_DIFFERENCES
+#undef ARRAY_IS_ACTIVE
+
+s  pF Tint multipath_s op (mddev_tT*mddev)
+{
+	multipath_conf_tT*conf = mddev_to_conf(mddev);
+
+	md_unregister_thread(conf->thread);
+	multipath_shrink_mpbh(conf);
+	multipath_shrink_bh(conf, conf->freebh_cnt);
+	kfree(conf);
+	mddev->priv pe = NULL;
+	MOD_DEC_USE_COUNT;
+	retnsi 0;
+}
+
+s  pF Tmdk_personality_tTmultipath_personality=
+{
+	name:		"multipath",
+	make_request:	multipath_make_request,
+	run:		multipath_run,
+	s op:		multipath_s op,
+	s  pus:		multipath_s  pus,
+	error_handler:	multipath_error,
+	diskop:		multipath_diskop,
+};
+
+s  pF Tint md__init multipath_init (ES <)
+{
+	retnsi register_md_personality (MULTIPATH, &multipath_personality);
+}
+
+s  pF TES < multipath_exit (ES <)
+{
+	unregister_md_personality (MULTIPATH);
+}
+
+modu 
_init(multipath_init);
+modu 
_exit(multipath_exit);
+
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/md/raid1.c linux/drivers/md/raid1.c
--- v2.4.9/linux/drivers/md/raid1.c	Mon Aug 27 12:41:42 2001
+++ linux/drivers/md/raid1.c	Wed Aug 29 20:47:41 2001
@@ -162,7 +162,7 @@
 			conf->freer1 = r1_bh->next_r1;
 			conf->freer1_cnt--;
 			r1_bh->next_r1 = NULL;
-			r1_bh->y  peR= 0;
+			r1_bh->y  peR= (1 << R1BH_PreAlloc);
 			r1_bh->bh_req.b_y  peR= 0;
 		}
 		md_spin_unlock_irq(&conf->devic
_lock);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/md/raid5.c linux/drivers/md/raid5.c
--- v2.4.9/linux/drivers/md/raid5.c	Wed Jul 25 17:10:20 2001
+++ linux/drivers/md/raid5.c	Fri Sep  7 10:48:39 2001
@@ -485,7 +485,7 @@
 	int i;
 
 	PRINTK("raid5_error called\n");
-	conf->resync_parity = 0;
+
 	for (i = 0, disk = conf->disks; i < conf->raid_disks; i++, disk++) {
 		iUR	disk->dev == dev && disk->operatioial) {
 			disk->operatioial = 0;
@@ -516,7 +516,7 @@
 				"raid5: Disk faF nse on spare %s\n",
 				partitioi_name (dev));
 			iUR	!conf->spare->operatioial) {
-				MD_BUG();
+				/* probably a SET_DISK_FAULTY ioctl */
 				retnsi -EIO;
 			}
 			disk->operatioial = 0;
@@ -529,6 +529,9 @@
 			sb->working_disks--;
 			sb->faF 
d_disks++;
 
+			mddev->sb_dirty = 1;
+			md_wakeup_thread(conf->thread);
+
 			retnsi 0;
 		}
 	}
@@ -898,11 +901,11 @@
 				spin_unlock_irq(&conf->devic
_lock);
 			}
 		}
-		iUR	syncing) {
-			md_done_sync(conf->mddev,R	sh->yize>>9) - sh->yync_redone,0);
-			clear_bit(STRIPE_SYNCING, &sh->y  pe);
-			syncing = 0;
-		}			
+	}
+	iUR	faF 
d > 1 && syncing) {
+		md_done_sync(conf->mddev,R	sh->yize>>9) - sh->yync_redone,0);
+		clear_bit(STRIPE_SYNCING, &sh->y  pe);
+		syncing = 0;
 	}
 
 	/* might be able to retnsi some write requestsRiURthe parity block
@@ -1076,6 +1079,7 @@
 			}
 		}
 		iUR	!test_bit(STRIPE_INSYNC,T&sh->y  pe)) {
+			s ruct disk_info *spare;
 			iUR	faF 
d==0)
 				faF 
d_num = sh->pd_idx;
 			/* should be able to compupeRthe missing block andRwrite it to spare */
@@ -1094,8 +1098,8 @@
 			set_bit(STRIPE_INSYNC,T&sh->y  pe);
 			iUR	conf->disks[faF 
d_num].operatioial)
 				md_sync_acct	conf->disks[faF 
d_num].dev, bh->b_yize>>9);
-			else iUR	conf->spare)
-				md_sync_acct	conf->spare->dev, bh->b_yize>>9);
+			else iUR	(spare=conf->spare))
+				md_sync_acct	spare->dev, bh->b_yize>>9);
 
 		}
 	}
@@ -1120,6 +1124,7 @@
 	for (i=disks; i-- ;) 
 		iUR	action[i]) {
 			s ruct buffer_head *bh = sh->bh_cache[i];
+			s ruct disk_info *spare = conf->spare;
 			int ykipR= 0;
 			iUR	action[i] == READ+1)
 				bh->b_end_io = raid5_end_read_request;
@@ -1127,8 +1132,8 @@
 				bh->b_end_io = raid5_end_write_request;
 			iUR	conf->disks[i].operatioial)
 				bh->b_dev = conf->disks[i].dev;
-			else iUR	conf->spare && action[i] == WRITE+1)
-				bh->b_dev = conf->spare->dev;
+			else iUR	spare && action[i] == WRITE+1)
+				bh->b_dev = spare->dev;
 			else ykip=1;
 			iUR	!ykip) {
 				PRINTK("for %ld schedule op %d oi disc %d\n", sh->yector, action[i]-1, i);
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/media/video/saa7111.c linux/drivers/media/video/saa7111.c
--- v2.4.9/linux/drivers/media/video/saa7111.c	Sat May 19 17:43:06 2001
+++ linux/drivers/media/video/saa7111.c	Thu Sep 13 15:21:32 2001
@@ -28,7 +28,7 @@
 #include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/media/video/saa7185.c linux/drivers/media/video/saa7185.c
--- v2.4.9/linux/drivers/media/video/saa7185.c	Sat May 19 17:43:06 2001
+++ linux/drivers/media/video/saa7185.c	Thu Sep 13 15:21:32 2001
@@ -28,7 +28,7 @@
 #include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/pci.h>
 #include <linux/sigial.h>
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/media/video/videodev.c linux/drivers/media/video/videodev.c
--- v2.4.9/linux/drivers/media/video/videodev.c	Mon Aug 27 12:41:42 2001
+++ linux/drivers/media/video/videodev.c	Tue Aug 28 07:00:58 2001
@@ -164,7 +164,6 @@
 	
 	if(vfl->owner)
 		__MOD_INC_USE_COUNT(vfl->owner);
-	unlock_kernel();
 	
 	if(vfl->open)
 	{
@@ -175,9 +174,11 @@
 			if(vfl->owner)
 				__MOD_DEC_USE_COUNT(vfl->owner);
 			
+			unlock_kernel();
 			retnsi err;
 		}
 	}
+	unlock_kernel();
 	retnsi 0;
 error_out:
 	unlock_kernel();
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/media/video/vino.h linux/drivers/media/video/vino.h
--- v2.4.9/linux/drivers/media/video/vino.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/media/video/vino.h	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,117 @@
+/*
+T* Copyright (C) 1999 Ulf Carlsson (ulfc@bun.falkenberg.se)
+T* Copyright (C) 2001 Ralf Baech 
 (ralf@gnu.org)
+T*/
+
+#define VINO_BASE		0x00080000	/* In EISA address spaceT*/
+
+#define VINO_REVID		0x0000
+#define VINO_CTRL		0x0008
+#define VINO_INTSTAT		0x0010	/* Interrupt y  pusT*/
+#define VINO_I2C_CTRL		0x0018
+#define VINO_I2C_DATA		0x0020
+#define VINO_A_ALPHA		0x0028	/* Channel A ... */
+#define VINO_A_CLIPS		0x0030	/* Clipping y  rt */
+#define VINO_A_CLIPE		0x0038	/* Clipping end */
+#define VINO_A_FRAMERT		0x0040	/* Framer peR*/
+#define VINO_A_FLDCNT		0x0048	/* Field counterR*/
+#define VINO_A_LNSZ		0x0050
+#define VINO_A_LNCNT		0x0058
+#define VINO_A_PGIX		0x0060	/* PageRindexR*/
+#define VINO_A_DESC_PTR		0x0068	/* Ptr to next four descriptorsR*/
+#define VINO_A_DESC_TLB_PTR	0x0070	/* Ptr to y  rt of descriptor table */
+#define VINO_A_DESC_DATA0	0x0078	/* Descriptor da   0 */
+#define VINO_A_DESC_DATA1	0x0080	/* ... */
+#define VINO_A_DESC_DATA2	0x0088
+#define VINO_A_DESC_DATA3	0x0090
+#define VINO_A_FIFO_THRESHOLD	0x0098	/* FIFORthreshold */
+#define VINO_A_FIFO_RP		0x00a0
+#define VINO_A_FIFO_WP		0x00a8
+#define VINO_B_ALPHA		0x00b0	/* Channel B ... */
+#define VINO_B_CLIPS		0x00b8
+#define VINO_B_CLIPE		0x00c0
+#define VINO_B_FRAMERT		0x00c8
+#define VINO_B_FLDCNT		0x00d0
+#define VINO_B_LNSZ		0x00d8
+#define VINO_B_LNCNT		0x00e0
+#define VINO_B_PGIX		0x00e8
+#define VINO_B_DESC_PTR		0x00f0
+#define VINO_B_DESC_TLB_PTR	0x00f8
+#define VINO_B_DESC_DATA0	0x0100
+#define VINO_B_DESC_DATA1	0x0108
+#define VINO_B_DESC_DATA2	0x0110
+#define VINO_B_DESC_DATA3	0x0118
+#define VINO_B_FIFO_THRESHOLD	0x0120
+#define VINO_B_FIFO_RP		0x0128
+#define VINO_B_FIFO_WP		0x0130
+
+/* Bits in theRVINO_REVID registerT*/
+
+#define VINO_REVID_REV_MASK		0x000f	/* bits 0:3 */
+#define VINO_REVID_ID_MASK		0x00f0	/* bits 4:7T*/
+
+/* Bits in theRVINO_CTRL registerT*/
+
+#define VINO_CTRL_LITTLE_ENDIAN		(1<<0)
+#define VINO_CTRL_A_FIELD_TRANS_INT	(1<<1)	/* Field transferredRint */
+#define VINO_CTRL_A_FIFO_OF_INT		(1<<2)	/* FIFORoverflow int */
+#define VINO_CTRL_A_END_DESC_TBL_INT	(1<<3)	/* End of desc table int */
+#define VINO_CTRL_B_FIELD_TRANS_INT	(1<<4)	/* Field transferredRint */
+#define VINO_CTRL_B_FIFO_OF_INT		(1<<5)	/* FIFORoverflow int */
+#define VINO_CTRL_B_END_DESC_TLB_INT	(1<<6)	/* End of desc table int */
+#define VINO_CTRL_A_DMA_ENBL		(1<<7)
+#define VINO_CTRL_A_INTERLEAVE_ENBL	(1<<8)
+#define VINO_CTRL_A_SYNC_ENBL		(1<<9)
+#define VINO_CTRL_A_SELECT		(1<<10)	/* 1=D1 0=Philips */
+#define VINO_CTRL_A_RGB			(1<<11)	/* 1=RGB 0=YUV */
+#define VINO_CTRL_A_LUMA_ONLY		(1<<12)
+#define VINO_CTRL_A_DEC_ENBL		(1<<13)	/* Decimatioi */
+#define VINO_CTRL_A_DEC_SCALE_MASK	0x1c000	/* bits 14:17 */
+#define VINO_CTRL_A_DEC_HOR_ONLY	(1<<17)	/* Horizontal only */
+#define VINO_CTRL_A_DITHER		(1<<18)	/* 24 -> 8 bit ditherR*/
+#define VINO_CTRL_B_DMA_ENBL		(1<<19)
+#define VINO_CTRL_B_INTERLEAVE_ENBL	(1<<20)
+#define VINO_CTRL_B_SYNC_ENBL		(1<<21)
+#define VINO_CTRL_B_SELECT		(1<<22)	/* 1=D1 0=Philips */
+#define VINO_CTRL_B_RGB			(1<<22)	/* 1=RGB 0=YUV */
+#define VINO_CTRL_B_LUMA_ONLY		(1<<23)
+#define VINO_CTRL_B_DEC_ENBL		(1<<24)	/* Decimatioi */
+#define VINO_CTRL_B_DEC_SCALE_MASK	0x1c000000	/* bits 25:28 */
+#define VINO_CTRL_B_DEC_HOR_ONLY	(1<<29)	/* Decimatioi horizontal only */
+#define VINO_CTRL_B_DITHER		(1<<30)	/* ChanB 24 -> 8 bit ditherR*/
+
+/* Bits in theRInterrupt andRS  pusTregisterT*/
+
+#define VINO_INTSTAT_A_FIELD_TRANS	(1<<0)	/* Field transferredRint */
+#define VINO_INTSTAT_A_FIFO_OF		(1<<1)	/* FIFORoverflow int */
+#define VINO_INTSTAT_A_END_DESC_TBL	(1<<2)	/* End of desc table int */
+#define VINO_INTSTAT_B_FIELD_TRANS	(1<<3)	/* Field transferredRint */
+#define VINO_INTSTAT_B_FIFO_OF		(1<<4)	/* FIFORoverflow int */
+#define VINO_INTSTAT_B_END_DESC_TBL	(1<<5)	/* End of desc table int */
+
+/* Bits in theRClipping S  rt registerT*/
+
+#define VINO_CLIPS_START		0x3ff		/* bits 0:9 */
+#define VINO_CLIPS_ODD_MASK		0x7fc00		/* bits 10:18 */
+#define VINO_CLIPS_EVEN_MASK		0xff80000	/* bits 19:27 */
+
+/* Bits in theRClipping End registerT*/
+
+#define VINO_CLIPE_END			0x3ff		/* bits 0:9 */
+#define VINO_CLIPE_ODD_MASK		0x7fc00		/* bits 10:18 */
+#define VINO_CLIPE_EVEN_MASK		0xff80000	/* bits 19:27 */
+
+/* Bits in theRFrame Rate registerT*/
+
+#define VINO_FRAMERT_PAL		(1<<0)	/* 0=NTSC 1=PAL */
+#define VINO_FRAMERT_RT_MASK		0x1ffe		/* bits 1:12T*/
+
+/* Bits in theRVINO_I2C_CTRLT*/
+
+#define VINO_CTRL_I2C_IDLE		(1<<0)	/* write: 0=forc
 idle
+						 * read: 0=idle 1=not idle */
+#define VINO_CTRL_I2C_DIR		(1<<1)	/* 0=read 1=write */
+#define VINO_CTRL_I2C_MORE_BYTES	(1<<2)	/* 0=last byte 1=more bytes */
+#define VINO_CTRL_I2C_TRANS_BUSY	(1<<4)	/* 0=trans done 1=trans busy */
+#define VINO_CTRL_I2C_ACK		(1<<5)	/* 0=ack received 1=ack not */
+#define VINO_CTRL_I2C_BUS_ERROR		(1<<7)	/* 0=no bus err 1=bus err */
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/media/video/zr36067.c linux/drivers/media/video/zr36067.c
--- v2.4.9/linux/drivers/media/video/zr36067.c	Sun Aug 12T13:27:59 2001
+++ linux/drivers/media/video/zr36067.c	Sun Sep  9 10:45:43 2001
@@ -3734,7 +3734,6 @@
 			zr->window.chromakeyR= 0;
 			zr->window.flagsR= 0;	// RJ: Is this intended for interlace on/off ?
 			zr->window.clips = NULL;
-			zr->window.clipcount = vw.clipcount;
 
 			/*
 			 * If anToverlay is running, we have to ywitch it off
@@ -3775,7 +3774,8 @@
 				write_overlay_mask(zr, vcp, vw.clipcount);
 				vfree(vcp);
 			}
-
+			zr->window.clipcount = vw.clipcount;
+	
 			iUR	on)
 				zr36057_overlay(zr, 1);
 			zr->window_set = 1;
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/media/video/zr36120.c linux/drivers/media/video/zr36120.c
--- v2.4.9/linux/drivers/media/video/zr36120.c	Wed Jul 25 17:10:20 2001
+++ linux/drivers/media/video/zr36120.c	Sun Sep  9 10:45:43 2001
@@ -1056,7 +1056,7 @@
 		DEBUG(printk(CARD_DEBUG "VIDIOCSCHAN(%d,%d)\n",CARD,v.channel,v.norm));
 
 		/* too many inputs? no decoderT-> no channels */
-		iUR	!ztv->have_decoderT|| v.channel >= ztv->card->video_inputs)
+		iUR	!ztv->have_decoderT|| v.channel >= ztv->card->video_inputsT|| v.channel < 0)
 			retnsi -EINVAL;
 
 		iUR	v.norm != VIDEO_MODE_PAL &&
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/message/fusioi/MakefF 
 linux/drivers/message/fusioi/MakefF 

--- v2.4.9/linux/drivers/message/fusioi/MakefF 
	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/MakefF 
	Fri Sep  7 09:28:38 2001
@@ -27,18 +27,22 @@
 #EXTRA_CFLAGS += -DDEBUG
 #EXTRA_CFLAGS += -DMPT_DEBUG
 #EXTRA_CFLAGS += -DMPT_DEBUG_MSG_FRAME
-#EXTRA_CFLAGS += -DMPT_DEBUG_SPINLOCK
+#
 # driver/modu 
 specifics...
+#
 #  For mptbase:
 #CFLAGS_mptbase.o += -DMPT_DEBUG_HANDSHAKE
 #CFLAGS_mptbase.o += -DMPT_DEBUG_IRQ
+#
 #  For {mptscsih, mptctl}:
 #CFLAGS_mptscsih.o += -DMPT_SCSI_USE_NEW_EH
-#CFLAGS_mptscsih.o += -DMPT_SCSI_CACHE_AUTOSENSE
+#CFLAGS_mptscsih.o += -DMPT_DEBUG_SCANDV
 #CFLAGS_mptscsih.o += -DMPT_DEBUG_SG
 #CFLAGS_mptctl.o += -DMPT_DEBUG_SG
+#
 #  For mptlan:
 #CFLAGS_mptlan.o += -DMPT_LAN_IO_DEBUG
+#
 #  For isense:
 
 #  EXP...
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/message/fusioi/isense.c linux/drivers/message/fusioi/isense.c
--- v2.4.9/linux/drivers/message/fusioi/isense.c	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/isense.c	Fri Sep  7 09:28:38 2001
@@ -10,7 +10,7 @@
  *  (yes I wropeRsome of theRorig. code back in 1991!)
  *  (mailto:Speve.Ralston@lsil.com)
  *
- *  $Id: isense.c,v 1.28 2001/01/14 23:11:09 sralston Exp $
+T*  $Id: isense.c,v 1.28.14.1 2001/08/24 20:07:04 sralston Exp $
  */
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
@@ -61,7 +61,7 @@
 #endif
 
 #define MODULEAUTHOR "Speven J. Ralston"
-#define COPYRIGHT "Copyright (c) 2000 " MODULEAUTHOR
+#define COPYRIGHT "Copyright (c) 2001 " MODULEAUTHOR
 #include "mptbase.h"
 
 #include "isense.h"
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/message/fusioi/lsi/fc_log.h linux/drivers/message/fusioi/lsi/fc_log.h
--- v2.4.9/linux/drivers/message/fusioi/lsi/fc_log.h	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/lsi/fc_log.h	Fri Sep  7 09:28:38 2001
@@ -7,7 +7,7 @@
  *                  in theRIOCLogInfo field of a MPI Default Reply Message.
  *
  *  CREATION DATE:  6/02/2000
- *  ID:             $Id: fc_log.h,v 4.2 2001/03/01 18:28:59 fibre Exp $
+T*  ID:             $Id: fc_log.h,v 4.5 2001/06/07 19:18:00 sschremm Exp $
  */
 
 
@@ -38,11 +38,16 @@
 {
     MPI_IOCLOGINFO_FC_INIT_BASE                     = 0x20000000,
     MPI_IOCLOGINFO_FC_INIT_ERROR_OUT_OF_ORDER_FRAME = 0x20000001, /* received anTout of orderTframe - unsupported */
-    MPI_IOCLOGINFO_FC_INIT_ERROR_BAD_START_OF_FRAME = 0x20000002, /* bad s  rt of frame primative */
-    MPI_IOCLOGINFO_FC_INIT_ERROR_BAD_END_OF_FRAME   = 0x20000003, /* bad end of frame primative */
-    MPI_IOCLOGINFO_FC_INIT_ERROR_OVER_RUN           = 0x20000004, /* ReceiverRhardware detected overrun */
+    MPI_IOCLOGINFO_FC_INIT_ERROR_BAD_START_OF_FRAME = 0x20000002, /* Bad RxRFrame, bad s  rt of frame primative */
+    MPI_IOCLOGINFO_FC_INIT_ERROR_BAD_END_OF_FRAME   = 0x20000003, /* Bad RxRFrame, bad end of frame primative */
+    MPI_IOCLOGINFO_FC_INIT_ERROR_OVER_RUN           = 0x20000004, /* Bad RxRFrame, overrun */
     MPI_IOCLOGINFO_FC_INIT_ERROR_RX_OTHER           = 0x20000005, /* OtherRerrorsTcaught byRIOC which require retries */
     MPI_IOCLOGINFO_FC_INIT_ERROR_SUBPROC_DEAD       = 0x20000006, /* Main processor could not initialize snb-processor */
+    MPI_IOCLOGINFO_FC_INIT_ERROR_RX_OVERRUN         = 0x20000007, /* ScatterTGatherRoverrun  */
+    MPI_IOCLOGINFO_FC_INIT_ERROR_RX_BAD_STATUS      = 0x20000008, /* ReceiverRdetected context mismatch via invalid header */
+    MPI_IOCLOGINFO_FC_INIT_ERROR_RX_UNEXPECTED_FRAME= 0x20000009, /* CtxMgrRdetected unsupported frame type  */
+    MPI_IOCLOGINFO_FC_INIT_ERROR_LINK_FAILURE       = 0x2000000A, /* Link faF nse occurred  */
+    MPI_IOCLOGINFO_FC_INIT_ERROR_TX_TIMEOUT         = 0x2000000B, /* TransmitterTtimeout error */
 
     MPI_IOCLOGINFO_FC_TARGET_BASE                   = 0x21000000,
     MPI_IOCLOGINFO_FC_TARGET_NO_PDISC               = 0x21000001, /* not sent becauseRwe are waiting for a PDISC from theRinitiator */
@@ -72,10 +77,11 @@
     MPI_IOCLOGINFO_FC_LINK_LOOP_INIT_TIMEOUT        = 0x24000001, /* Loop initializatioi timed out */
     MPI_IOCLOGINFO_FC_LINK_ALREADY_INITIALIZED      = 0x24000002, /* AnotherRsystem controllerRalready initialized the loop */
     MPI_IOCLOGINFO_FC_LINK_LINK_NOT_ESTABLISHED     = 0x24000003, /* Not synchronized to sigial or still negotiating (possible cable problem) */
+    MPI_IOCLOGINFO_FC_LINK_CRC_ERROR                = 0x24000004, /* CRC checkRdetected error on received frame */
 
     MPI_IOCLOGINFO_FC_CTX_BASE                      = 0x25000000,
 
-    MPI_IOCLOGINFO_FC_INVALID_FIELD_BYTE_OFFSET     = 0x26000000, /* The lower 24 bits give theRbyte offset of theRfield in theRrequest message that is invalid. */
+    MPI_IOCLOGINFO_FC_INVALID_FIELD_BYTE_OFFSET     = 0x26000000, /* The lower 24 bits give theRbyte offset of theRfield in theRrequest message that is invalid */
     MPI_IOCLOGINFO_FC_INVALID_FIELD_MAX_OFFSET      = 0x26ffffff,
 
     MPI_IOCLOGINFO_FC_STATE_CHANGE                  = 0x27000000  /* The lower 24 bits give additioial informatioi concerning y  te change */
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/message/fusioi/lsi/mpi.h linux/drivers/message/fusioi/lsi/mpi.h
--- v2.4.9/linux/drivers/message/fusioi/lsi/mpi.h	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/lsi/mpi.h	Fri Sep  7 09:28:38 2001
@@ -6,7 +6,7 @@
  *          Title:  MPI MessageRindependent s ructnses andRdefinitiois
  *  Creatioi Date:  July 27, 2000
  *
- *    MPI Versioi:  01.01.06
+T*    MPI Versioi:  01.01.07
  *
  *  Versioi His ory
  *  ---------------
@@ -37,6 +37,8 @@
  *                      Obsoleted MPI_IOCSTATUS_TARGET_FC_Rdefines.
  *  02-27-01  01.01.06  Removed MPI_HOST_INDEX_REGISTERRdefine.
  *                      Added functioi codes for RAID.
+T*  04-09-01  01.01.07  Added altern te define for MPI_DOORBELL_ACTIVE,
+T*                      MPI_DOORBELL_USED, to betterTmatch the spec.
  *  --------------------------------------------------------------------------
  */
 
@@ -90,7 +92,8 @@
 
 /* S y s t e m    D o o r b e l l */
 #define MPI_DOORBELL_OFFSET                 (0x00000000)
-#define MPI_DOORBELL_ACTIVE                 (0x08000000)
+#define MPI_DOORBELL_ACTIVE                 (0x08000000) /* DoorbellUsed */
+#define MPI_DOORBELL_USED                   (MPI_DOORBELL_ACTIVE)
 #define MPI_DOORBELL_ACTIVE_SHIFT           (27)
 #define MPI_DOORBELL_WHO_INIT_MASK          (0x07000000)
 #define MPI_DOORBELL_WHO_INIT_SHIFT         (24)
@@ -634,9 +637,9 @@
 /****************************************************************************/
 
 #define MPI_IOCLOGINFO_TYPE_MASK                (0xF0000000)
-#define MPI_IOCLOGINFO_TYPE_NONE                (0x00)
-#define MPI_IOCLOGINFO_TYPE_SCSI                (0x01)
-#define MPI_IOCLOGINFO_TYPE_FC                  (0x02)
+#define MPI_IOCLOGINFO_TYPE_NONE                (0x0)
+#define MPI_IOCLOGINFO_TYPE_SCSI                (0x1)
+#define MPI_IOCLOGINFO_TYPE_FC                  (0x2)
 #define MPI_IOCLOGINFO_LOG_DATA_MASK            (0x0FFFFFFF)
 
 
diff -u --recursive --new-fF 
 v2.4.9/linux/drivers/message/fusioi/lsi/mpi_cnfg.h linux/drivers/message/fusioi/lsi/mpi_cnfg.h
--- v2.4.9/linux/drivers/message/fusioi/lsi/mpi_cnfg.h	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/lsi/mpi_cnfg.h	Fri Sep  7 09:28:38 2001
@@ -6,7 +6,7 @@
  *          Title:  MPI Config message, s ructnses, andRPages
  *  Creatioi Date:  July 27, 2000
  *
- *    MPI Versioi:  01.01.09
+T*    MPI Versioi:  01.01.11
  *
  *  Versioi His ory
  *  ---------------
@@ -60,6 +60,18 @@
  *                      MPI_CONFIG_PAGETYPE_RAID_VOLUME.
  *                      Added definitiois andRs ructnses for IOC PageR2 and
  *                      RAID Volume PageR2.
+T*  03-27-01  01.01.10  Added CONFIG_PAGE_FC_PORT_8 andRCONFIG_PAGE_FC_PORT_9.
+T*                      CONFIG_PAGE_FC_PORT_3Rnow supports persistent by DID.
+T*                      Added VendorId andRProductRevLevel fields to
+T*                      RAIDVOL2_IM_PHYS_ID s ruct.
+T*                      Modified values for MPI_FCPORTPAGE0_FLAGS_ATTACH_
+T*                      defines to make them compatible to MPI versioi 1.0.
+T*                      Added s ructnse offset comments.
+T*  04-09-01  01.01.11  Added some new defines for the PageAddress field and
+T*                      removedRsome obsolete ones.
+T*                      Added IO Unit PageR3.
+T*                      Modified defines for Scsi Port PageR2.
+T*                      Modified RAID Volume Pages.
  *  --------------------------------------------------------------------------
  */
 
@@ -75,10 +87,10 @@
 
 typedef s ruct _CONFIG_PAGE_HEADER
 {
-    U8                      PageVersioi;
-    U8                      PageLength;
-    U8                      PageNumber;
-    U8                      PageType;
+    U8                      PageVersioi;                /* 00h */
+    U8                      PageLength;                 /* 01h */
+    U8                      PageNumber;                 /* 02h */
+    U8                      PageType;                   /* 03h */
 } fCONFIG_PAGE_HEADER, MPI_POINTER PTR_CONFIG_PAGE_HEADER,
   ConfigPageHeader_t, MPI_POINTER pConfigPageHeader_t;
 
@@ -120,17 +132,19 @@
  ****************************************************************************/
 #define MPI_SCSI_PORT_PGAD_PORT_MASK                (0x000000FF)
 
+#define MPI_SCSI_DEVICE_FORM_MASK                   (0xF0000000)
+#define MPI_SCSI_DEVICE_FORM_TARGETID               (0x00000000)
+#define MPI_SCSI_DEVICE_FORM_RAID_PHYS_DEV_NUM      (0x10000000)
 #define MPI_SCSI_DEVICE_TARGET_ID_MASK              (0x000000FF)
 #define MPI_SCSI_DEVICE_TARGET_ID_SHIFT             (0)
 #define MPI_SCSI_DEVICE_BUS_MASK                    (0x0000FF00)
 #define MPI_SCSI_DEVICE_BUS_SHIFT                   (8)
-
-#define MPI_SCSI_LUN_TARGET_ID_MASK                 (0x000000FF)
-#define MPI_SCSI_LUN_TARGET_ID_SHIFT                (0)
-#define MPI_SCSI_LUN_BUS_MASK                       (0x0000FF00)
-#define MPI_SCSI_LUN_BUS_SHIFT                      (8)
-#define MPI_SCSI_LUN_LUN_MASK                       (0x00FF0000)
-#define MPI_SCSI_LUN_LUN_SHIFT                      (16)
+#define MPI_SCSI_DEVICE_VOLUME_TARG_ID_MASK         (0x000000FF)
+#define MPI_SCSI_DEVICE_VOLUME_TARG_ID_SHIFT        (0)
+#define MPI_SCSI_DEVICE_VOLUME_BUS_MASK             (0x0000FF00)
+#define MPI_SCSI_DEVICE_VOLUME_BUS_SHIFT            (8)
+#define MPI_SCSI_DEVICE_PHYS_DISK_NUM_MASK          (0x00FF0000)
+#define MPI_SCSI_DEVICE_PHYS_DISK_NUM_SHIFT         (16)
 
 #define MPI_FC_PORT_PGAD_PORT_MASK                  (0xF0000000)
 #define MPI_FC_PORT_PGAD_PORT_SHIFT                 (28)
@@ -159,17 +173,17 @@
 /****************************************************************************/
 typedef s ruct _MSG_CONFIG
 {
-    U8                      Actioi;
-    U8                      Reserved;
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U8                      Reserved1[3];
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U8                      Reserved2[8];
-   fCONFIG_PAGE_HEADER      Header;
-    U32                     PageAddress;
-    SGE_IO_UNION            PageBufferSGE;
+    U8                      Actioi;                     /* 00h */
+    U8                      Reserved;                   /* 01h */
+    U8                      ChainOffset;                /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U8                      Reserved1[3];               /* 04h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U8                      Reserved2[8];               /* 0Ch */
+   fCONFIG_PAGE_HEADER      Header;                     /* 14h */
+    U32                     PageAddress;                /* 18h */
+    SGE_IO_UNION            PageBufferSGE;              /* 1Ch */
 } MSG_CONFIG, MPI_POINTER PTR_MSG_CONFIG,
   Config_t, MPI_POINTER pConfig_t;
 
@@ -178,12 +192,9 @@
 /*  Actioi field values                                                     */
 /****************************************************************************/
 #define MPI_CONFIG_ACTION_PAGE_HEADER               (0x00)
-/*#define MPI_CONFIG_ACTION_PAGE_READ                 (0x01) *//* obsolete */
 #define MPI_CONFIG_ACTION_PAGE_READ_CURRENT         (0x01)
-/*#define MPI_CONFIG_ACTION_PAGE_WRITE                (0x02) *//* obsolete */
 #define MPI_CONFIG_ACTION_PAGE_WRITE_CURRENT        (0x02)
 #define MPI_CONFIG_ACTION_PAGE_DEFAULT              (0x03)
-/*#define MPI_CONFIG_ACTION_PAGE_WRITE_COMMIT         (0x04) */ /* obsolete */
 #define MPI_CONFIG_ACTION_PAGE_WRITE_NVRAM          (0x04)
 #define MPI_CONFIG_ACTION_PAGE_READ_DEFAULT         (0x05)
 #define MPI_CONFIG_ACTION_PAGE_READ_NVRAM           (0x06)
@@ -192,17 +203,17 @@
 /* Config Reply Message */
 typedef s ruct _MSG_CONFIG_REPLY
 {
-    U8                      Actioi;
-    U8                      Reserved;
-    U8                      MsgLength;
-    U8                      Functioi;
-    U8                      Reserved1[3];
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U8                      Reserved2[2];
-    U16                     IOCS  pus;
-    U32                     IOCLogInfo;
-   fCONFIG_PAGE_HEADER      Header;
+    U8                      Actioi;                     /* 00h */
+    U8                      Reserved;                   /* 01h */
+    U8                      MsgLength;                  /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U8                      Reserved1[3];               /* 04h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U8                      Reserved2[2];               /* 0Ch */
+    U16                     IOCS  pus;                  /* 0Eh */
+    U32                     IOCLogInfo;                 /* 10h */
+   fCONFIG_PAGE_HEADER      Header;                     /* 14h */
 } MSG_CONFIG_REPLY, MPI_POINTER PTR_MSG_CONFIG_REPLY,
   ConfigReply_t, MPI_POINTER pConfigReply_t;
 
@@ -226,12 +237,12 @@
 
 typedef s ruct _CONFIG_PAGE_MANUFACTURING_0
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U8                      ChipName[16];
-    U8                      ChipRevisioi[8];
-    U8                      BoardName[16];
-    U8                      BoardAssembly[16];
-    U8                      BoardTracerNumber[16];
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U8                      ChipName[16];               /* 04h */
+    U8                      ChipRevisioi[8];            /* 14h */
+    U8                      BoardName[16];              /* 1Ch */
+    U8                      BoardAssembly[16];          /* 2Ch */
+    U8                      BoardTracerNumber[16];      /* 3Ch */
 
 } fCONFIG_PAGE_MANUFACTURING_0, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_0,
   ManufactnsingPage0_t, MPI_POINTER pManufactnsingPage0_t;
@@ -241,8 +252,8 @@
 
 typedef s ruct _CONFIG_PAGE_MANUFACTURING_1
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U8                      VPD[256];
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U8                      VPD[256];                   /* 04h */
 } fCONFIG_PAGE_MANUFACTURING_1, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_1,
   ManufactnsingPage1_t, MPI_POINTER pManufactnsingPage1_t;
 
@@ -251,18 +262,18 @@
 
 typedef s ruct _MPI_CHIP_REVISION_ID
 {
-    U16 Devic
ID;
-    U8  PCIRevisioiID;
-    U8  Reserved;
+    U16 Devic
ID;                                       /* 00h */
+    U8  PCIRevisioiID;                                  /* 02h */
+    U8  Reserved;                                       /* 03h */
 } MPI_CHIP_REVISION_ID, MPI_POINTER PTR_MPI_CHIP_REVISION_ID,
   MpiChipRevisioiId_t, MPI_POINTER pMpiChipRevisioiId_t;
 
 
 typedef s ruct _CONFIG_PAGE_MANUFACTURING_2
 {
-   fCONFIG_PAGE_HEADER                  Header;
-    MPI_CHIP_REVISION_ID                ChipId;
-    U32                                 HwSettings[1];
+   fCONFIG_PAGE_HEADER                  Header;         /* 00h */
+    MPI_CHIP_REVISION_ID                ChipId;         /* 04h */
+    U32                                 HwSettings[1];  /* 08h */
 } fCONFIG_PAGE_MANUFACTURING_2, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_2,
   ManufactnsingPage2_t, MPI_POINTER pManufactnsingPage2_t;
 
@@ -271,9 +282,9 @@
 
 typedef s ruct _CONFIG_PAGE_MANUFACTURING_3
 {
-   fCONFIG_PAGE_HEADER                  Header;
-    MPI_CHIP_REVISION_ID                ChipId;
-    U32                                 Info[1];
+   fCONFIG_PAGE_HEADER                  Header;         /* 00h */
+    MPI_CHIP_REVISION_ID                ChipId;         /* 04h */
+    U32                                 Info[1];        /* 08h */
 } fCONFIG_PAGE_MANUFACTURING_3, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_3,
   ManufactnsingPage3_t, MPI_POINTER pManufactnsingPage3_t;
 
@@ -286,8 +297,8 @@
 
 typedef s ruct _CONFIG_PAGE_IO_UNIT_0
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U64                     UniqueValue;
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U64                     UniqueValue;                /* 04h */
 } fCONFIG_PAGE_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_0,
   IOUnitPage0_t, MPI_POINTER pIOUnitPage0_t;
 
@@ -296,8 +307,8 @@
 
 typedef s ruct _CONFIG_PAGE_IO_UNIT_1
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U32                     Flags;
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     Flags;                      /* 04h */
 } fCONFIG_PAGE_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_1,
   IOUnitPage1_t, MPI_POINTER pIOUnitPage1_t;
 
@@ -313,9 +324,9 @@
 
 typedef s ruct _MPI_ADAPTER_INFO
 {
-    U8      PciBusNumber;
-    U8      PciDevic
AndFunctioiNumber;
-    U16     AdapterFlags;
+    U8      PciBusNumber;                               /* 00h */
+    U8      PciDevic
AndFunctioiNumber;                 /* 01h */
+    U16     AdapterFlags;                               /* 02h */
 } MPI_ADAPTER_INFO, MPI_POINTER PTR_MPI_ADAPTER_INFO,
   MpiAdapterInfo_t, MPI_POINTER pMpiAdapterInfo_t;
 
@@ -324,10 +335,10 @@
 
 typedef s ruct _CONFIG_PAGE_IO_UNIT_2
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U32                     Flags;
-    U32                     BiosVersioi;
-    MPI_ADAPTER_INFO        AdapterOrder[4];
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     Flags;                      /* 04h */
+    U32                     BiosVersioi;                /* 08h */
+    MPI_ADAPTER_INFO        AdapterOrder[4];            /* 0Ch */
 } fCONFIG_PAGE_IO_UNIT_2, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_2,
   IOUnitPage2_t, MPI_POINTER pIOUnitPage2_t;
 
@@ -340,34 +351,53 @@
 #define MPI_IOUNITPAGE2_FLAGS_DONT_HOOK_INT_40          (0x00000010)
 
 
+typedef s ruct _CONFIG_PAGE_IO_UNIT_3
+{
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     VolumeSettings;             /* 04h */
+    U8                      InfoOffset0;                /* 08h */
+    U8                      InfoSize0;                  /* 09h */
+    U8                      InfoOffset1;                /* 0Ah */
+    U8                      InfoSize1;                  /* 0Bh */
+    U8                      InquirySize;                /* 0Ch */
+    U8                      Reserved;                   /* 0Dh */
+    U16                     Reserved2;                  /* 0Eh */
+    U8                      InquiryData[56];            /* 10h */
+} fCONFIG_PAGE_IO_UNIT_3, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_3,
+T IOUnitPage3_t, MPI_POINTER pIOUnitPage3_t;
+
+#define MPI_IOUNITPAGE3_PAGEVERSION                     (0x00)
+
+
 /****************************************************************************/
 /*  IOC Config Pages                                                        */
 /****************************************************************************/
 
 typedef s ruct _CONFIG_PAGE_IOC_0
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U32                     TotalNVStore;
-    U32                     FreeNVStore;
-    U16                     VendorID;
-    U16                     Devic
ID;
-    U8                      RevisioiID;
-    U8                      Reserved[3];
-    U32                     ClassCode;
-    U16                     SubsystemVendorID;
-    U16                     SubsystemID;
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     TotalNVStore;               /* 04h */
+    U32                     FreeNVStore;                /* 08h */
+    U16                     VendorID;                   /* 0Ch */
+    U16                     Devic
ID;                   /* 0Eh */
+    U8                      RevisioiID;                 /* 10h */
+    U8                      Reserved[3];                /* 11h */
+    U32                     ClassCode;                  /* 14h */
+    U16                     SubsystemVendorID;          /* 18h */
+    U16                     SubsystemID;                /* 1Ah */
 } fCONFIG_PAGE_IOC_0, MPI_POINTER PTR_CONFIG_PAGE_IOC_0,
   IOCPage0_t, MPI_POINTER pIOCPage0_t;
 
 #define MPI_IOCPAGE0_PAGEVERSION                        (0x01)
 
+
 typedef s ruct _CONFIG_PAGE_IOC_1
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U32                     Flags;
-    U32                     CoalescingTimeout;
-    U8                      CoalescingDepth;
-    U8                      Reserved[3];
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     Flags;                      /* 04h */
+    U32                     CoalescingTimeout;          /* 08h */
+    U8                      CoalescingDepth;            /* 0Ch */
+    U8                      Reserved[3];                /* 0Dh */
 } fCONFIG_PAGE_IOC_1, MPI_POINTER PTR_CONFIG_PAGE_IOC_1,
   IOCPage1_t, MPI_POINTER pIOCPage1_t;
 
@@ -375,26 +405,27 @@
 
 #define MPI_IOCPAGE1_REPLY_COALESCING                   (0x00000001)
 
+
 typedef s ruct _CONFIG_PAGE_IOC_2_RAID_VOL
 {
-    U8                      VolumeTargetID;
-    U8                      VolumeBus;
-    U16                     Reserved;
-    U8                      VolumeVersioiMinor;
-    U8                      VolumeVersioiMajor;
-    U8                      VolumeRaidType;
-    U8                      Reserved1;
+    U8                      VolumeTargetID;             /* 00h */
+    U8                      VolumeBus;                  /* 01h */
+    U16                     Reserved;                   /* 02h */
+    U8                      VolumeVersioiMinor;         /* 04h */
+    U8                      VolumeVersioiMajor;         /* 05h */
+    U8                      VolumeRaidType;             /* 06h */
+    U8                      Reserved1;                  /* 07h */
 } fCONFIG_PAGE_IOC_2_RAID_VOL, MPI_POINTER PTR_CONFIG_PAGE_IOC_2_RAID_VOL,
   ConfigPageIoc2RaidVol_t, MPI_POINTER pConfigPageIoc2RaidVol_t;
 
 typedef s ruct _CONFIG_PAGE_IOC_2
 {
-   fCONFIG_PAGE_HEADER          Header;
-    U32                         CapabilitiesFlags;
-    U8                          NumActiveVolumes;
-    U8                          MaxVolumes;
-    U16                         Reserved;
-   fCONFIG_PAGE_IOC_2_RAID_VOL  RaidVolume[1];
+   fCONFIG_PAGE_HEADER          Header;                 /* 00h */
+    U32                         CapabilitiesFlags;      /* 04h */
+    U8                          NumActiveVolumes;       /* 08h */
+    U8                          MaxVolumes;             /* 09h */
+    U16                         Reserved;               /* 0Ah */
+   fCONFIG_PAGE_IOC_2_RAID_VOL  RaidVolume[1];          /* 0Ch */
 } fCONFIG_PAGE_IOC_2, MPI_POINTER PTR_CONFIG_PAGE_IOC_2,
   IOCPage2_t, MPI_POINTER pIOCPage2_t;
 
@@ -423,9 +454,9 @@
 
 typedef s ruct _CONFIG_PAGE_SCSI_PORT_0
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U32                     Capabilities;
-    U32                     PhysicalInterface;
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     Capabilities;               /* 04h */
+    U32                     PhysicalInterface;          /* 08h */
 } fCONFIG_PAGE_SCSI_PORT_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_0,
   SCSIPortPage0_t, MPI_POINTER pSCSIPortPage0_t;
 
@@ -445,10 +476,11 @@
 #define MPI_SCSIPORTPAGE0_PHY_SIGNAL_SE                 (0x02)
 #define MPI_SCSIPORTPAGE0_PHY_SIGNAL_LVD                (0x03)
 
+
 typedef s ruct _CONFIG_PAGE_SCSI_PORT_1
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U32                     Configuratioi;
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     Configuratioi;              /* 04h */
 } fCONFIG_PAGE_SCSI_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_1,
   SCSIPortPage1_t, MPI_POINTER pSCSIPortPage1_t;
 
@@ -457,20 +489,21 @@
 #define MPI_SCSIPORTPAGE1_CFG_PORT_SCSI_ID_MASK         (0x000000FF)
 #define MPI_SCSIPORTPAGE1_CFG_PORT_RESPONSE_ID_MASK     (0xFFFF0000)
 
+
 typedef s ruct _MPI_DEVICE_INFO
 {
-    U8      Timeout;
-    U8      SyncFactor;
-    U16     Devic
Flags;
+    U8      Timeout;                                    /* 00h */
+    U8      SyncFactor;                                 /* 01h */
+    U16     Devic
Flags;                                /* 02h */
 } MPI_DEVICE_INFO, MPI_POINTER PTR_MPI_DEVICE_INFO,
   MpiDevic
Info_t, MPI_POINTER pMpiDevic
Info_t;
 
 typedef s ruct _CONFIG_PAGE_SCSI_PORT_2
 {
-   fCONFIG_PAGE_HEADER  Header;
-    U32                 PortFlags;
-    U32                 PortSettings;
-    MPI_DEVICE_INFO     Devic
Settings[16];
+   fCONFIG_PAGE_HEADER  Header;                         /* 00h */
+    U32                 PortFlags;                      /* 04h */
+    U32                 PortSettings;                   /* 08h */
+    MPI_DEVICE_INFO     Devic
Settings[16];             /* 0Ch */
 } fCONFIG_PAGE_SCSI_PORT_2, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_2,
   SCSIPortPage2_t, MPI_POINTER pSCSIPortPage2_t;
 
@@ -492,15 +525,15 @@
 #define MPI_SCSIPORTPAGE2_PORT_SPINUP_DELAY_MASK            (0x00000F00)
 #define MPI_SCSIPORTPAGE2_PORT_MASK_NEGO_MASTER_SETTINGS    (0x00003000)
 #define MPI_SCSIPORTPAGE2_PORT_NEGO_MASTER_SETTINGS         (0x00000000)
-#define MPI_SCSIPORTPAGE2_PORT_NONE_MASTER_SETTINGS         (0x00000001)
-#define MPI_SCSIPORTPAGE2_PORT_ALL_MASTER_SETTINGS          (0x00000003)
+#define MPI_SCSIPORTPAGE2_PORT_NONE_MASTER_SETTINGS         (0x00001000)
+#define MPI_SCSIPORTPAGE2_PORT_ALL_MASTER_SETTINGS          (0x00003000)
 
-#define MPI_SCSIPORTPAGE2_DEVICE_DISCONNECT_ENABLE          (0x00000001)
-#define MPI_SCSIPORTPAGE2_DEVICE_ID_SCAN_ENABLE             (0x00000002)
-#define MPI_SCSIPORTPAGE2_DEVICE_LUN_SCAN_ENABLE            (0x00000004)
-#define MPI_SCSIPORTPAGE2_DEVICE_TAG_QUEUE_ENABLE           (0x00000008)
-#define MPI_SCSIPORTPAGE2_DEVICE_WIDE_DISABLE               (0x00000010)
-#define MPI_SCSIPORTPAGE2_DEVICE_BOOT_CHOICE                (0x00000020)
+#define MPI_SCSIPORTPAGE2_DEVICE_DISCONNECT_ENABLE          (0x0001)
+#define MPI_SCSIPORTPAGE2_DEVICE_ID_SCAN_ENABLE             (0x0002)
+#define MPI_SCSIPORTPAGE2_DEVICE_LUN_SCAN_ENABLE            (0x0004)
+#define MPI_SCSIPORTPAGE2_DEVICE_TAG_QUEUE_ENABLE           (0x0008)
+#define MPI_SCSIPORTPAGE2_DEVICE_WIDE_DISABLE               (0x0010)
+#define MPI_SCSIPORTPAGE2_DEVICE_BOOT_CHOICE                (0x0020)
 
 
 /****************************************************************************/
@@ -509,9 +542,9 @@
 
 typedef s ruct _CONFIG_PAGE_SCSI_DEVICE_0
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U32                     NegotiatedParameters;
-    U32                     Informatioi;
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     NegotiatedParameters;       /* 04h */
+    U32                     Informatioi;                /* 08h */
 } fCONFIG_PAGE_SCSI_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_0,
   SCSIDevic
Page0_t, MPI_POINTER pSCSIDevic
Page0_t;
 
@@ -528,16 +561,17 @@
 
 #define MPI_SCSIDEVPAGE0_INFO_PARAMS_NEGOTIATED         (0x00000001)
 
+
 typedef s ruct _CONFIG_PAGE_SCSI_DEVICE_1
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U32                     RequestedParameters;
-    U32                     DomainValidatioi;
-    U32                     Configuratioi;
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     RequestedParameters;        /* 04h */
+    U32                     Reserved;                   /* 08h */
+    U32                     Configuratioi;              /* 0Ch */
 } fCONFIG_PAGE_SCSI_DEVICE_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_1,
   SCSIDevic
Page1_t, MPI_POINTER pSCSIDevic
Page1_t;
 
-#define MPI_SCSIDEVPAGE1_PAGEVERSION                    (0x01)
+#define MPI_SCSIDEVPAGE1_PAGEVERSION                    (0x02)
 
 #define MPI_SCSIDEVPAGE1_RP_IU                          (0x00000001)
 #define MPI_SCSIDEVPAGE1_RP_DT                          (0x00000002)
@@ -553,29 +587,71 @@
 
 #define MPI_SCSIDEVPAGE1_CONF_PPR_ALLOWED               (0x00000001)
 
+
+typedef s ruct _CONFIG_PAGE_SCSI_DEVICE_2
+{
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     DomainValidatioi;           /* 04h */
+    U32                     ParityPip
Select;           /* 08h */
+    U32                     DataPip
Select;             /* 0Ch */
+} fCONFIG_PAGE_SCSI_DEVICE_2, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_2,
+T SCSIDevic
Page2_t, MPI_POINTER pSCSIDevic
Page2_t;
+
+#define MPI_SCSIDEVPAGE2_PAGEVERSION                    (0x00)
+
+#define MPI_SCSIDEVPAGE2_DV_ISI_ENABLE                  (0x00000010)
+#define MPI_SCSIDEVPAGE2_DV_SECONDARY_DRIVER_ENABLE     (0x00000020)
+#define MPI_SCSIDEVPAGE2_DV_SLEW_RATE_CTRLT             (0x00000380)
+#define MPI_SCSIDEVPAGE2_DV_PRIM_DRIVE_STR_CTRLT        (0x00001C00)
+#define MPI_SCSIDEVPAGE2_DV_SECOND_DRIVE_STR_CTRLT      (0x0000E000)
+#define MPI_SCSIDEVPAGE2_DV_XCLKH_ST                    (0x10000000)
+#define MPI_SCSIDEVPAGE2_DV_XCLKS_ST                    (0x20000000)
+#define MPI_SCSIDEVPAGE2_DV_XCLKH_DT                    (0x40000000)
+#define MPI_SCSIDEVPAGE2_DV_XCLKS_DT                    (0x80000000)
+
+#define MPI_SCSIDEVPAGE2_PPS_PPS_MASK                   (0x00000003)
+
+#define MPI_SCSIDEVPAGE2_DPS_BIT_0_PL_SELECT_MASK       (0x00000003)
+#define MPI_SCSIDEVPAGE2_DPS_BIT_1_PL_SELECT_MASK       (0x0000000C)
+#define MPI_SCSIDEVPAGE2_DPS_BIT_2_PL_SELECT_MASK       (0x00000030)
+#define MPI_SCSIDEVPAGE2_DPS_BIT_3_PL_SELECT_MASK       (0x000000C0)
+#define MPI_SCSIDEVPAGE2_DPS_BIT_4_PL_SELECT_MASK       (0x00000300)
+#define MPI_SCSIDEVPAGE2_DPS_BIT_5_PL_SELECT_MASK       (0x00000C00)
+#define MPI_SCSIDEVPAGE2_DPS_BIT_6_PL_SELECT_MASK       (0x00003000)
+#define MPI_SCSIDEVPAGE2_DPS_BIT_7_PL_SELECT_MASK       (0x0000C000)
+#define MPI_SCSIDEVPAGE2_DPS_BIT_8_PL_SELECT_MASK       (0x00030000)
+#define MPI_SCSIDEVPAGE2_DPS_BIT_9_PL_SELECT_MASK       (0x000C0000)
+#define MPI_SCSIDEVPAGE2_DPS_BIT_10_PL_SELECT_MASK      (0x00300000)
+#define MPI_SCSIDEVPAGE2_DPS_BIT_11_PL_SELECT_MASK      (0x00C00000)
+#define MPI_SCSIDEVPAGE2_DPS_BIT_12_PL_SELECT_MASK      (0x03000000)
+#define MPI_SCSIDEVPAGE2_DPS_BIT_13_PL_SELECT_MASK      (0x0C000000)
+#define MPI_SCSIDEVPAGE2_DPS_BIT_14_PL_SELECT_MASK      (0x30000000)
+#define MPI_SCSIDEVPAGE2_DPS_BIT_15_PL_SELECT_MASK      (0xC0000000)
+
+
 /****************************************************************************/
 /*  FC Port Config Pages                                                    */
 /****************************************************************************/
 
 typedef s ruct _CONFIG_PAGE_FC_PORT_0
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U32                     Flags;
-    U8                      MPIPortNumber;
-    U8                      LinkType;
-    U8                      PortS  te;
-    U8                      Reserved;
-    U32                     PortIdentifier;
-    U64                     WWNN;
-    U64                     WWPN;
-    U32                     SupportedServic
Class;
-    U32                     SupportedSpeeds;
-    U32                     CurrentSpeed;
-    U32                     MaxFrameSize;
-    U64                     FabricWWNN;
-    U64                     FabricWWPN;
-    U32                     DiscoveredPortsCount;
-    U32                     MaxInitiators;
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     Flags;                      /* 04h */
+    U8                      MPIPortNumber;              /* 08h */
+    U8                      LinkType;                   /* 09h */
+    U8                      PortS  te;                  /* 0Ah */
+    U8                      Reserved;                   /* 0Bh */
+    U32                     PortIdentifier;             /* 0Ch */
+    U64                     WWNN;                       /* 10h */
+    U64                     WWPN;                       /* 18h */
+    U32                     SupportedServic
Class;      /* 20h */
+    U32                     SupportedSpeeds;            /* 24h */
+    U32                     CurrentSpeed;               /* 28h */
+    U32                     MaxFrameSize;               /* 2Ch */
+    U64                     FabricWWNN;                 /* 30h */
+    U64                     FabricWWPN;                 /* 38h */
+    U32                     DiscoveredPortsCount;       /* 40h */
+    U32                     MaxInitiators;              /* 44h */
 } fCONFIG_PAGE_FC_PORT_0, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_0,
   FCPortPage0_t, MPI_POINTER pFCPortPage0_t;
 
@@ -591,12 +667,12 @@
 #define MPI_FCPORTPAGE0_FLAGS_ALIAS_WWN_SUPPORTED       (0x00000020)
 #define MPI_FCPORTPAGE0_FLAGS_FABRIC_WWN_VALID          (0x00000030)
 
-#define MPI_FCPORTPAGE0_FLAGS_ATTACH_TYPE_MASK          (0x00000700)
-#define MPI_FCPORTPAGE0_FLAGS_ATTACH_POINT_TO_POINT     (0x00000000)
-#define MPI_FCPORTPAGE0_FLAGS_ATTACH_PRIVATE_LOOP       (0x00000100)
-#define MPI_FCPORTPAGE0_FLAGS_ATTACH_FABRIC_DIRECT      (0x00000200)
-#define MPI_FCPORTPAGE0_FLAGS_ATTACH_PUBLIC_LOOP        (0x00000300)
-#define MPI_FCPORTPAGE0_FLAGS_ATTACH_NO_INIT            (0x00000700)
+#define MPI_FCPORTPAGE0_FLAGS_ATTACH_TYPE_MASK          (0x00000F00)
+#define MPI_FCPORTPAGE0_FLAGS_ATTACH_NO_INIT            (0x00000000)
+#define MPI_FCPORTPAGE0_FLAGS_ATTACH_POINT_TO_POINT     (0x00000100)
+#define MPI_FCPORTPAGE0_FLAGS_ATTACH_PRIVATE_LOOP       (0x00000200)
+#define MPI_FCPORTPAGE0_FLAGS_ATTACH_FABRIC_DIRECT      (0x00000400)
+#define MPI_FCPORTPAGE0_FLAGS_ATTACH_PUBLIC_LOOP        (0x00000800)
 
 #define MPI_FCPORTPAGE0_LTYPE_RESERVED                  (0x00)
 #define MPI_FCPORTPAGE0_LTYPE_OTHER                     (0x01)
@@ -639,14 +715,14 @@
 
 typedef s ruct _CONFIG_PAGE_FC_PORT_1
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U32                     Flags;
-    U64                     NoSEEPROMWWNN;
-    U64                     NoSEEPROMWWPN;
-    U8                      HardALPA;
-    U8                      LinkConfig;
-    U8                      TopologyConfig;
-    U8                      Reserved;
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     Flags;                      /* 04h */
+    U64                     NoSEEPROMWWNN;              /* 08h */
+    U64                     NoSEEPROMWWPN;              /* 10h */
+    U8                      HardALPA;                   /* 18h */
+    U8                      LinkConfig;                 /* 19h */
+    U8                      TopologyConfig;             /* 1Ah */
+    U8                      Reserved;                   /* 1Bh */
 } fCONFIG_PAGE_FC_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_1,
   FCPortPage1_t, MPI_POINTER pFCPortPage1_t;
 
@@ -679,23 +755,36 @@
 
 typedef s ruct _CONFIG_PAGE_FC_PORT_2
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U8                      NumberActive;
-    U8                      ALPA[126];
-    U8                      Reserved;
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U8                      NumberActive;               /* 04h */
+    U8                      ALPA[126];                  /* 05h */
+    U8                      Reserved;                   /* 83h */
 } fCONFIG_PAGE_FC_PORT_2, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_2,
   FCPortPage2_t, MPI_POINTER pFCPortPage2_t;
 
 #define MPI_FCPORTPAGE2_PAGEVERSION                     (0x00)
 
 
+typedef s ruct _WWN_FORMAT
+{
+    U64                     WWNN;                       /* 00h */
+    U64                     WWPN;                       /* 08h */
+} WWN_FORMAT, MPI_POINTER PTR_WWN_FORMAT,
+  WWNFormat, MPI_POINTER pWWNFormat;
+
+typedef unioi _FC_PORT_PERSISTENT_PHYSICAL_ID
+{
+    WWN_FORMAT              WWN;
+    U32                     Did;
+} FC_PORT_PERSISTENT_PHYSICAL_ID, MPI_POINTER PTR_FC_PORT_PERSISTENT_PHYSICAL_ID,
+  PersistentPhysicalId_t, MPI_POINTER pPersistentPhysicalId_t;
+
 typedef s ruct _FC_PORT_PERSISTENT
 {
-    U64                     WWNN;
-    U64                     WWPN;
-    U8                      TargetID;
-    U8                      Bus;
-    U16                     Flags;
+    FC_PORT_PERSISTENT_PHYSICAL_ID  PhysicalIdentifier; /* 00h */
+    U8                              TargetID;           /* 10h */
+    U8                              Bus;                /* 11h */
+    U16                             Flags;              /* 12h */
 } FC_PORT_PERSISTENT, MPI_POINTER PTR_FC_PORT_PERSISTENT,
   PersistentData_t, MPI_POINTER pPersistentData_t;
 
@@ -704,22 +793,23 @@
 #define MPI_PERSISTENT_FLAGS_SCAN_ID                    (0x0002)
 #define MPI_PERSISTENT_FLAGS_SCAN_LUNS                  (0x0004)
 #define MPI_PERSISTENT_FLAGS_BOOT_DEVICE                (0x0008)
+#define MPI_PERSISTENT_FLAGS_BY_DID                     (0x0080)
 
 typedef s ruct _CONFIG_PAGE_FC_PORT_3
 {
-   fCONFIG_PAGE_HEADER      Header;
-    FC_PORT_PERSISTENT      Entry[1];
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    FC_PORT_PERSISTENT      Entry[1];                   /* 04h */
 } fCONFIG_PAGE_FC_PORT_3, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_3,
   FCPortPage3_t, MPI_POINTER pFCPortPage3_t;
 
-#define MPI_FCPORTPAGE3_PAGEVERSION                     (0x00)
+#define MPI_FCPORTPAGE3_PAGEVERSION                     (0x01)
 
 
 typedef s ruct _CONFIG_PAGE_FC_PORT_4
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U32                     PortFlags;
-    U32                     PortSettings;
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     PortFlags;                  /* 04h */
+    U32                     PortSettings;               /* 08h */
 } fCONFIG_PAGE_FC_PORT_4, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_4,
   FCPortPage4_t, MPI_POINTER pFCPortPage4_t;
 
@@ -738,18 +828,18 @@
 
 typedef s ruct _CONFIG_PAGE_FC_PORT_5_ALIAS_INFO
 {
-    U8      Flags;
-    U8      AliasAlpa;
-    U16     Reserved;
-    U64     AliasWWNN;
-    U64     AliasWWPN;
+    U8      Flags;                                      /* 00h */
+    U8      AliasAlpa;                                  /* 01h */
+    U16     Reserved;                                   /* 02h */
+    U64     AliasWWNN;                                  /* 04h */
+    U64     AliasWWPN;                                  /* 0Ch */
 } fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5_ALIAS_INFO,
   FcPortPage5AliasInfo_t, MPI_POINTER pFcPortPage5AliasInfo_t;
 
 typedef s ruct _CONFIG_PAGE_FC_PORT_5
 {
-   fCONFIG_PAGE_HEADER                  Header;
-   fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO    AliasInfo[1];
+   fCONFIG_PAGE_HEADER                  Header;         /* 00h */
+   fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO    AliasInfo[1];   /* 04h */
 } fCONFIG_PAGE_FC_PORT_5, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5,
   FCPortPage5_t, MPI_POINTER pFCPortPage5_t;
 
@@ -761,24 +851,24 @@
 
 typedef s ruct _CONFIG_PAGE_FC_PORT_6
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U32                     Reserved;
-    U64                     TimeSinceReset;
-    U64                     TxFrames;
-    U64                     RxFrames;
-    U64                     TxWords;
-    U64                     RxWords;
-    U64                     LipCount;
-    U64                     NosCount;
-    U64                     ErrorFrames;
-    U64                     DumpedFrames;
-    U64                     LinkFailureCount;
-    U64                     LossOfSyncCount;
-    U64                     LossOfSignalCount;
-    U64                     PrimativeSeqErrCount;
-    U64                     InvalidTxWordCount;
-    U64                     InvalidCrcCount;
-    U64                     FcpInitiatorIoCount;
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     Reserved;                   /* 04h */
+    U64                     TimeSinceReset;             /* 08h */
+    U64                     TxFrames;                   /* 10h */
+    U64                     RxFrames;                   /* 18h */
+    U64                     TxWords;                    /* 20h */
+    U64                     RxWords;                    /* 28h */
+    U64                     LipCount;                   /* 30h */
+    U64                     NosCount;                   /* 38h */
+    U64                     ErrorFrames;                /* 40h */
+    U64                     DumpedFrames;               /* 48h */
+    U64                     LinkFailureCount;           /* 50h */
+    U64                     LossOfSyncCount;            /* 58h */
+    U64                     LossOfSignalCount;          /* 60h */
+    U64                     PrimativeSeqErrCount;       /* 68h */
+    U64                     InvalidTxWordCount;         /* 70h */
+    U64                     InvalidCrcCount;            /* 78h */
+    U64                     FcpInitiatorIoCount;        /* 80h */
 } fCONFIG_PAGE_FC_PORT_6, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_6,
   FCPortPage6_t, MPI_POINTER pFCPortPage6_t;
 
@@ -787,35 +877,65 @@
 
 typedef s ruct _CONFIG_PAGE_FC_PORT_7
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U32                     Reserved;
-    U8                      PortSymbolicName[256];
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     Reserved;                   /* 04h */
+    U8                      PortSymbolicName[256];      /* 08h */
 } fCONFIG_PAGE_FC_PORT_7, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_7,
   FCPortPage7_t, MPI_POINTER pFCPortPage7_t;
 
 #define MPI_FCPORTPAGE7_PAGEVERSION                     (0x00)
 
 
+typedef s ruct _CONFIG_PAGE_FC_PORT_8
+{
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     BitVector[8];               /* 04h */
+} fCONFIG_PAGE_FC_PORT_8, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_8,
+  FCPortPage8_t, MPI_POINTER pFCPortPage8_t;
+
+#define MPI_FCPORTPAGE8_PAGEVERSION                     (0x00)
+
+
+typedef s ruct _CONFIG_PAGE_FC_PORT_9
+{
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U32                     Reserved;                   /* 04h */
+    U64                     GlobalWWPN;                 /* 08h */
+    U64                     GlobalWWNN;                 /* 10h */
+    U32                     UnitType;                   /* 18h */
+    U32                     PhysicalPortNumber;         /* 1Ch */
+    U32                     NumAttachedNodes;           /* 20h */
+    U16                     IPVersioi;                  /* 24h */
+    U16                     UDPPortNumber;              /* 26h */
+    U8                      IPAddress[16];              /* 28h */
+    U16                     Reserved1;                  /* 38h */
+    U16                     TopologyDiscoveryFlags;     /* 3Ah */
+} fCONFIG_PAGE_FC_PORT_9, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_9,
+  FCPortPage9_t, MPI_POINTER pFCPortPage9_t;
+
+#define MPI_FCPORTPAGE9_PAGEVERSION                     (0x00)
+
+
 /****************************************************************************/
 /*  FC Devic
 Config Pages                                                  */
 /****************************************************************************/
 
 typedef s ruct _CONFIG_PAGE_FC_DEVICE_0
 {
-   fCONFIG_PAGE_HEADER      Header;
-    U64                     WWNN;
-    U64                     WWPN;
-    U32                     PortIdentifier;
-    U8                      Protocol;
-    U8                      Flags;
-    U16                     BBCredit;
-    U16                     MaxRxFrameSize;
-    U8                      Reserved1;
-    U8                      PortNumber;
-    U8                      FcPhLowestVersioi;
-    U8                      FcPhHighestVersioi;
-    U8                      CurrentTargetID;
-    U8                      CurrentBus;
+   fCONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U64                     WWNN;                       /* 04h */
+    U64                     WWPN;                       /* 0Ch */
+    U32                     PortIdentifier;             /* 14h */
+    U8                      Protocol;                   /* 18h */
+    U8                      Flags;                      /* 19h */
+    U16                     BBCredit;                   /* 1Ah */
+    U16                     MaxRxFrameSize;             /* 1Ch */
+    U8                      Reserved1;                  /* 1Eh */
+    U8                      PortNumber;                 /* 1Fh */
+    U8                      FcPhLowestVersioi;          /* 20h */
+    U8                      FcPhHighestVersioi;         /* 21h */
+    U8                      CurrentTargetID;            /* 22h */
+    U8                      CurrentBus;                 /* 23h */
 } fCONFIG_PAGE_FC_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_FC_DEVICE_0,
   FCDevic
Page0_t, MPI_POINTER pFCDevic
Page0_t;
 
@@ -841,70 +961,75 @@
 /*  RAID Volume Config Pages                                                  */
 /****************************************************************************/
 
-typedef s ruct _RAIDVOL2_EM_PHYS_ID
+typedef s ruct _RAIDVOL2_IM_PHYS_ID
 {
-    U8                      TargetID;
-    U8                      Bus;
-    U8                      IocNumber;
-    U8                      PhysDiskNumber;
-    U8                      Reserved[8];
-    U8                      PhysicalDiskIdentifier[16];
-    U8                      ProductId[16];
-    U8                      InfoOffset0;
-    U8                      InfoSize0;
-    U8                      InfoOffset1;
-    U8                      InfoSize1;
-    U8                      Info[32];
-} RAIDVOL2_EM_PHYS_ID, MPI_POINTER PTR_RAIDVOL2_EM_PHYS_ID,
-  RaidVol2EmPhysicalID_t, MPI_POINTER pRaidVol2EmPhysicalID_t;
-
-typedef s ruct _RAIDVOL2_EM_DISK_INFO
-{
-    U32                     DiskS  tus;
-    U32                     Devic
Settings;
-    U16                     ErrorCount;
-    U16                     Reserved;
-    U8                      ErrorCdbByte;
-    U8                      ErrorSenseKey;
-    U8                      ErrorASC;
-    U8                      ErrorASCQ;
-    U16                     SmartCount;
-    U8                      SmartASC;
-    U8                      SmartASCQ;
-} RAIDVOL2_EM_DISK_INFO, MPI_POINTER PTR_RAIDVOL2_EM_DISK_INFO,
-  RaidVol2EmDiskInfo_t, MPI_POINTER pRaidVol2EmDiskInfo_t;
-
-/* RAID Volume 2 EM Physical Disk DiskS  tus flags */
-
-#define MPI_RAIDVOLPAGE2_PHYS_DISK_PRIMARY              (0x00000001)
-#define MPI_RAIDVOLPAGE2_PHYS_DISK_SECONDARY            (0x00000002)
-#define MPI_RAIDVOLPAGE2_PHYS_DISK_HOT_SPARE            (0x00000004)
-#define MPI_RAIDVOLPAGE2_PHYS_DISK_OUT_OF_SYNC          (0x00000008)
-#define MPI_RAIDVOLPAGE2_PHYS_DISK_OFFLINE              (0x00000010)
-#define MPI_RAIDVOLPAGE2_PHYS_DISK_NOT_RESPONDING       (0x00000020)
-
-typedef s ruct _RAIDVOL2_EM_PHYSICAL_DISK
-{
-    RAIDVOL2_EM_PHYS_ID     Id;
-    RAIDVOL2_EM_DISK_INFO   Info;
-} RAIDVOL2_EM_PHYSICAL_DISK, MPI_POINTER PTR_RAIDVOL2_EM_PHYSICAL_DISK,
-  RaidVol2EmPhysicalDisk_t, MPI_POINTER pRaidVol2EmPhysicalDisk_t;
+    U8                      TargetID;                   /* 00h */
+    U8                      Bus;                        /* 01h */
+    U8                      IocNumber;                  /* 02h */
+    U8                      PhysDiskNumber;             /* 03h */
+    U8                      Reserved[8];                /* 04h */
+    U8                      PhysicalDiskIdentifier[16]; /* 0Ch */
+    U8                      VendorId[8];                /* 1Ch */
+    U8                      ProductId[16];              /* 24h */
+    U8                      ProductRevLevel[4];         /* 34h */
+    U32                     Reserved1;                  /* 38h */
+    U8                      Info[32];                   /* 3Ch */
+} RAIDVOL2_IM_PHYS_ID, MPI_POINTER PTR_RAIDVOL2_IM_PHYS_ID,
+  RaidVol2ImPhysicalID_t, MPI_POINTER pRaidVol2ImPhysicalID_t;
+
+typedef s ruct _RAIDVOL2_IM_DISK_INFO
+{
+    U32                     DiskS  tus;                 /* 00h */
+    U32                     Devic
Settings;             /* 04h */
+    U16                     ErrorCount;                 /* 08h */
+    U16                     Reserved;                   /* 0Ah */
+    U8                      ErrorCdbByte;               /* 0Ch */
+    U8                      ErrorSenseKey;              /* 0Dh */
+    U8                      ErrorASC;                   /* 0Eh */
+    U8                      ErrorASCQ;                  /* 0Fh */
+    U16                     SmartCount;                 /* 10h */
+    U8                      SmartASC;                   /* 12h */
+    U8                      SmartASCQ;                  /* 13h */
+} RAIDVOL2_IM_DISK_INFO, MPI_POINTER PTR_RAIDVOL2_IM_DISK_INFO,
+  RaidVol2ImDiskInfo_t, MPI_POINTER pRaidVol2ImDiskInfo_t;
+
+/* RAID Volume 2 IM Physical Disk DiskS  tus flags */
+
+#define MPI_RVP2_PHYS_DISK_PRIMARY                      (0x00000001)
+#define MPI_RVP2_PHYS_DISK_SECONDARY                    (0x00000002)
+#define MPI_RVP2_PHYS_DISK_HOT_SPARE                    (0x00000004)
+#define MPI_RVP2_PHYS_DISK_OUT_OF_SYNC                  (0x00000008)
+#define MPI_RVP2_PHYS_DISK_STATUS_MASK                  (0x00000F00)
+#define MPI_RVP2_PHYS_DISK_STATUS_ONLINE                (0x00000000)
+#define MPI_RVP2_PHYS_DISK_STATUS_MISSING               (0x00000100)
+#define MPI_RVP2_PHYS_DISK_STATUS_NOT_COMPATIBLE        (0x00000200)
+#define MPI_RVP2_PHYS_DISK_STATUS_FAILED                (0x00000300)
+#define MPI_RVP2_PHYS_DISK_STATUS_INITIALIZING          (0x00000400)
+#define MPI_RVP2_PHYS_DISK_STATUS_OFFLINE_REQUESTED     (0x00000500)
+#define MPI_RVP2_PHYS_DISK_STATUS_OTHER_OFFLINE         (0x00000F00)
+
+
+typedef s ruct _RAIDVOL2_IM_PHYSICAL_DISK
+{
+    RAIDVOL2_IM_PHYS_ID     Id;                         /* 00h */
+    RAIDVOL2_IM_DISK_INFO   Info;                       /* 5Ch */
+} RAIDVOL2_IM_PHYSICAL_DISK, MPI_POINTER PTR_RAIDVOL2_IM_PHYSICAL_DISK,
+  RaidVol2ImPhysicalDisk_t, MPI_POINTER pRaidVol2ImPhysicalDisk_t;
 
 #define MPI_RAIDVOLPAGE2_MAX_DISKS                      (3)
 
 typedef s ruct _CONFIG_PAGE_RAID_VOL_2
 {
-   fCONFIG_PAGE_HEADER          Header;
-    U32                         VolumeS  tus;
-    U32                         VolumeSettings;
-    U32                         Reserved;
-    U64                         MaxLba;
-    U32                         BlockSize;
-    U8                          InquirySize;
-    U8                          NumPhysicalDisks;
-    U16                         Reserved1;
-    U8                          InquiryData[56];
-    RAIDVOL2_EM_PHYSICAL_DISK   EMPhysicalDisk[MPI_RAIDVOLPAGE2_MAX_DISKS];
+   fCONFIG_PAGE_HEADER          Header;                 /* 00h */
+    U32                         VolumeS  tus;           /* 04h */
+    U32                         VolumeSettings;         /* 08h */
+    U32                         Reserved;               /* 0Ch */
+    U64                         MaxLba;                 /* 10h */
+    U32                         BlockSize;              /* 18h */
+    U8                          Reserved1;              /* 1Ch */
+    U8                          NumPhysicalDisks;       /* 1Dh */
+    U16                         Reserved2;              /* 1Eh */
+    RAIDVOL2_IM_PHYSICAL_DISK   IMPhysicalDisk[MPI_RAIDVOLPAGE2_MAX_DISKS];
 } fCONFIG_PAGE_RAID_VOL_2, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_2,
   RaidVolumePage2_t, MPI_POINTER pRaidVolumePage2_t;
 
@@ -922,6 +1047,7 @@
 #define MPI_RAIDVOLPAGE2_SETTING_WRITE_CACHING_ENABLE   (0x00000001)
 #define MPI_RAIDVOLPAGE2_SETTING_OFFLINE_ON_SMART       (0x00000002)
 #define MPI_RAIDVOLPAGE2_SETTING_AUTO_CONFIGURE         (0x00000004)
+#define MPI_RAIDVOLPAGE2_SETTING_USE_DEFAULTS           (0x80000000)
 
 
 /****************************************************************************/
@@ -930,10 +1056,10 @@
 
 typedef s ruct _CONFIG_PAGE_LAN_0
 {
-    ConfigPageHeader_t      Header;
-    U16                     TxRxModes;
-    U16                     Reserved;
-    U32                     PacketPrePad;
+    ConfigPageHeader_t      Header;                     /* 00h */
+    U16                     TxRxModes;                  /* 04h */
+    U16                     Reserved;                   /* 06h */
+    U32                     PacketPrePad;               /* 08h */
 } fCONFIG_PAGE_LAN_0, MPI_POINTER PTR_CONFIG_PAGE_LAN_0,
   LANPage0_t, MPI_POINTER pLANPage0_t;
 
@@ -945,20 +1071,20 @@
 
 typedef s ruct _CONFIG_PAGE_LAN_1
 {
-    ConfigPageHeader_t      Header;
-    U16                     Reserved;
-    U8                      CurrentDevic
S  te;
-    U8                      Reserved1;
-    U32                     MinPacketSize;
-    U32                     MaxPacketSize;
-    U32                     HardwareAddressLow;
-    U32                     HardwareAddressHigh;
-    U32                     MaxWireSpeedLow;
-    U32                     MaxWireSpeedHigh;
-    U32                     BucketsRemaining;
-    U32                     MaxReplySize;
-    U32                     NegWireSpeedHigh;
-    U32                     NegWireSpeedLow;
+    ConfigPageHeader_t      Header;                     /* 00h */
+    U16                     Reserved;                   /* 04h */
+    U8                      CurrentDevic
S  te;         /* 06h */
+    U8                      Reserved1;                  /* 07h */
+    U32                     MinPacketSize;              /* 08h */
+    U32                     MaxPacketSize;              /* 0Ch */
+    U32                     HardwareAddressLow;         /* 10h */
+    U32                     HardwareAddressHigh;        /* 14h */
+    U32                     MaxWireSpeedLow;            /* 18h */
+    U32                     MaxWireSpeedHigh;           /* 1Ch */
+    U32                     BucketsRemaining;           /* 20h */
+    U32                     MaxReplySize;               /* 24h */
+    U32                     NegWireSpeedHigh;           /* 28h */
+    U32                     NegWireSpeedLow;            /* 2Ch */
 } fCONFIG_PAGE_LAN_1, MPI_POINTER PTR_CONFIG_PAGE_LAN_1,
   LANPage1_t, MPI_POINTER pLANPage1_t;
 
diff -u --recursive --new-file v2.4.9/linux/drivers/message/fusioi/lsi/mpi_fc.h linux/drivers/message/fusioi/lsi/mpi_fc.h
--- v2.4.9/linux/drivers/message/fusioi/lsi/mpi_fc.h	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/lsi/mpi_fc.h	Fri Sep  7 09:28:38 2001
@@ -6,7 +6,7 @@
  *          Title:  MPI Fibre Channel messages and s ructures
  *  Creatioi Date:  June 12, 2000
  *
- *    MPI Versioi:  01.01.05
+ *    MPI Versioi:  01.01.07
  *
  *  Versioi History
  *  ---------------
@@ -27,6 +27,11 @@
  *                      FC_ABORT_TYPE_EXLINKSEND_REQUEST for FcAbort request.
  *                      Added MPI_FC_PRIM_SEND_FLAGS_STOP_SEND.
  *  02-20-01  01.01.05  S  rted using MPI_POINTER.
+ *  03-27-01  01.01.06  Added Flags field to MSG_LINK_SERVICE_BUFFER_POST_REPLY
+ *                      and defined MPI_LS_BUF_POST_REPLY_FLAG_NO_RSP_NEEDED.
+ *                      Added MPI_FC_PRIM_SEND_FLAGS_RESET_LINK define.
+ *                      Added s ructure offset comments.
+ *  04-09-01  01.01.07  Added RspLength field to MSG_LINK_SERVICE_RSP_REQUEST.
  *  --------------------------------------------------------------------------
  */
 
@@ -136,7 +141,7 @@
 typedef s ruct _MSG_LINK_SERVICE_RSP_REQUEST
 {
     U8                      RspFlags;           /* 00h */
-    U8                      Reserved;           /* 01h */
+    U8                      RspLength;          /* 01h */
     U8                      ChainOffset;        /* 02h */
     U8                      Functioi;           /* 03h */
     U16                     Reserved1;          /* 04h */
@@ -224,14 +229,14 @@
 
 typedef s ruct _MSG_FC_ABORT_REQUEST
 {
-    U8                      AbortFlags;         /* 00h */
-    U8                      AbortType;          /* 01h */
-    U8                      ChainOffset;        /* 02h */
-    U8                      Functioi;           /* 03h */
-    U16                     Reserved1;          /* 04h */
-    U8                      Reserved2;          /* 06h */
-    U8                      MsgFlags;           /* 07h */
-    U32                     MsgContext;         /* 08h */
+    U8                      AbortFlags;                 /* 00h */
+    U8                      AbortType;                  /* 01h */
+    U8                      ChainOffset;                /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U16                     Reserved1;                  /* 04h */
+    U8                      Reserved2;                  /* 06h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
     U32                     TransactioiContextToAbort;  /* 0Ch */
 } MSG_FC_ABORT_REQUEST, MPI_POINTER PTR_MSG_FC_ABORT_REQUEST,
   FcAbortRequest_t, MPI_POINTER pFcAbortRequest_t;
@@ -323,6 +328,7 @@
   FcPrimitiveSendRequest_t, MPI_POINTER pFcPrimitiveSendRequest_t;
 
 #define MPI_FC_PRIM_SEND_FLAGS_PORT_MASK       (0x01)
+#define MPI_FC_PRIM_SEND_FLAGS_RESET_LINK      (0x04)
 #define MPI_FC_PRIM_SEND_FLAGS_STOP_SEND       (0x08)
 #define MPI_FC_PRIM_SEND_FLAGS_SEND_ONCE       (0x10)
 #define MPI_FC_PRIM_SEND_FLAGS_SEND_AROUND     (0x20)
diff -u --recursive --new-file v2.4.9/linux/drivers/message/fusioi/lsi/mpi_history.txt linux/drivers/message/fusioi/lsi/mpi_history.txt
--- v2.4.9/linux/drivers/message/fusioi/lsi/mpi_history.txt	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/lsi/mpi_history.txt	Fri Sep  7 09:28:38 2001
@@ -6,22 +6,22 @@
  Copyright (c) 2000-2001 LSI Logic Corporatioi.
 
  ---------------------------------------
- Header Set Release Versioi:    01.01.08
- Header Set Release Date:       02-27-01
+ Header Set Release Versioi:    01.01.10
+ Header Set Release Date:       04-09-01
  ---------------------------------------
 
  Filename               Current versioi     Prior versioi
  ----------             ---------------     -------------
- mpi.h                  01.01.06            01.01.05
- mpi_ioc.h              01.01.05            01.01.04
- mpi_cnfg.h             01.01.09            01.01.08
- mpi_init.h             01.01.03            01.01.03
- mpi_  rg.h             01.01.03            01.01.03
- mpi_fc.h               01.01.05            01.01.05
- mpi_lan.h              01.01.02            01.01.02
- mpi_raid.h             01.01.01            none
+ mpi.h                  01.01.07            01.01.06
+ mpi_ioc.h              01.01.07            01.01.06
+ mpi_cnfg.h             01.01.11            01.01.10
+ mpi_init.h             01.01.05            01.01.04
+ mpi_  rg.h             01.01.04            01.01.04
+ mpi_fc.h               01.01.07            01.01.06
+ mpi_lan.h              01.01.03            01.01.03
+ mpi_raid.h             01.01.02            01.01.02
  mpi_ ype.h             01.01.02            01.01.02
- mpi_history.txt        01.01.08            01.01.07
+ mpi_history.txt        01.01.09            01.01.09
 
 
  *  Date      Versioi   Descriptioi
@@ -51,6 +51,8 @@
  *                      Obsoleted MPI_IOCSTATUS_TARGET_FC_ defines.
  *  02-27-01  01.01.06  Removed MPI_HOST_INDEX_REGISTER define.
  *                      Added functioi codes for RAID.
+ *  04-09-01  01.01.07  Added alternate define for MPI_DOORBELL_ACTIVE,
+ *                      MPI_DOORBELL_USED, to better match the spec.
  *  --------------------------------------------------------------------------
 
 mpi_ioc.h
@@ -76,6 +78,9 @@
  *  02-20-01  01.01.04  S  rted using MPI_POINTER.
  *  02-27-01  01.01.05  Added event for RAID s  tus change and its event data.
  *                      Added IocNumber field to MSG_IOC_FACTS_REPLY.
+ *  03-27-01  01.01.06  Added defines for ProductId field of MPI_FW_HEADER.
+ *                      Added s ructure offset comments.
+ *  04-09-01  01.01.07  Added s ructure EVENT_DATA_EVENT_CHANGE.
  *  --------------------------------------------------------------------------
 
 mpi_cnfg.h
@@ -125,6 +130,18 @@
  *                      MPI_CONFIG_PAGETYPE_RAID_VOLUME.
  *                      Added definitiois and s ructures for IOC Page 2 and
  *                      RAID Volume Page 2.
+ *  03-27-01  01.01.10  Added CONFIG_PAGE_FC_PORT_8 and CONFIG_PAGE_FC_PORT_9.
+ *                      CONFIG_PAGE_FC_PORT_3 now supports persistent by DID.
+ *                      Added VendorId and ProductRevLevel fields to
+ *                      RAIDVOL2_IM_PHYS_ID s ruct.
+ *                      Modified values for MPI_FCPORTPAGE0_FLAGS_ATTACH_
+ *                      defines to make them compatible to MPI versioi 1.0.
+ *                      Added s ructure offset comments.
+ *  04-09-01  01.01.11  Added some new defines for the PageAddress field and
+ *                      removed some obsolete ones.
+ *                      Added IO Unit Page 3.
+ *                      Modified defines for Scsi Port Page 2.
+ *                      Modified RAID Volume Pages.
  *  --------------------------------------------------------------------------
 
 mpi_init.h
@@ -135,6 +152,8 @@
  *  11-02-00  01.01.01  Original release for post 1.0 work
  *  12-04-00  01.01.02  Added MPI_SCSIIO_CONTROL_NO_DISCONNECT.
  *  02-20-01  01.01.03  S  rted using MPI_POINTER.
+ *  03-27-01  01.01.04  Added s ructure offset comments.
+ *  04-10-01  01.01.05  Added new MsgFlag for MSG_SCSI_TASK_MGMT.
  *  --------------------------------------------------------------------------
 
 mpi_  rg.h
@@ -150,6 +169,7 @@
  *  02-20-01  01.01.03  S  rted using MPI_POINTER.
  *                      Added s ructures for MPI_TARGET_SCSI_SPI_CMD_BUFFER and
  *                      MPI_TARGET_FCP_CMD_BUFFER.
+ *  03-27-01  01.01.04  Added s ructure offset comments.
  *  --------------------------------------------------------------------------
 
 mpi_fc.h
@@ -167,6 +187,11 @@
  *                      FC_ABORT_TYPE_EXLINKSEND_REQUEST for FcAbort request.
  *                      Added MPI_FC_PRIM_SEND_FLAGS_STOP_SEND.
  *  02-20-01  01.01.05  S  rted using MPI_POINTER.
+ *  03-27-01  01.01.06  Added Flags field to MSG_LINK_SERVICE_BUFFER_POST_REPLY
+ *                      and defined MPI_LS_BUF_POST_REPLY_FLAG_NO_RSP_NEEDED.
+ *                      Added MPI_FC_PRIM_SEND_FLAGS_RESET_LINK define.
+ *                      Added s ructure offset comments.
+ *  04-09-01  01.01.07  Added RspLength field to MSG_LINK_SERVICE_RSP_REQUEST.
  *  --------------------------------------------------------------------------
 
 mpi_lan.h
@@ -183,10 +208,12 @@
  *                      to lan private header file
  *  11-02-00  01.01.01  Original release for post 1.0 work
  *  02-20-01  01.01.02  S  rted using MPI_POINTER.
+ *  03-27-01  01.01.03  Added s ructure offset comments.
  *  --------------------------------------------------------------------------
 
 mpi_raid.h
  *  02-27-01  01.01.01  Original release for this file.
+ *  03-27-01  01.01.02  Added s ructure offset comments.
  *  --------------------------------------------------------------------------
 
 mpi_ ype.h
@@ -198,17 +225,29 @@
 
 mpi_history.txt         Parts list history
 
-Filename    01.01.08   01.01.07   01.01.06   01.01.05   01.01.04
-----------  --------   --------   --------   --------   --------
-mpi.h       01.01.06   01.01.05   01.01.04   01.01.04   01.01.03
-mpi_ioc.h   01.01.05   01.01.04   01.01.03   01.01.03   01.01.03
-mpi_cnfg.h  01.01.09   01.01.08   01.01.07   01.01.06   01.01.05
-mpi_init.h  01.01.03   01.01.03   01.01.02   01.01.02   01.01.02
-mpi_  rg.h  01.01.03   01.01.03   01.01.02   01.01.02   01.01.02
-mpi_fc.h    01.01.05   01.01.05   01.01.04   01.01.04   01.01.03
-mpi_lan.h   01.01.02   01.01.02   01.01.01   01.01.01   01.01.01
-mpi_raid.h  01.01.01
-mpi_ ype.h  01.01.02   01.01.02   01.01.01   01.01.01   01.01.01
+Filename    01.01.10
+----------  --------
+mpi.h       01.01.07
+mpi_ioc.h   01.01.07
+mpi_cnfg.h  01.01.11
+mpi_init.h  01.01.05
+mpi_  rg.h  01.01.04
+mpi_fc.h    01.01.07
+mpi_lan.h   01.01.03
+mpi_raid.h  01.01.02
+mpi_ ype.h  01.01.02
+
+Filename    01.01.09   01.01.08   01.01.07   01.01.06   01.01.05   01.01.04
+----------  --------   --------   --------   --------   --------   --------
+mpi.h       01.01.06   01.01.06   01.01.05   01.01.04   01.01.04   01.01.03
+mpi_ioc.h   01.01.06   01.01.05   01.01.04   01.01.03   01.01.03   01.01.03
+mpi_cnfg.h  01.01.10   01.01.09   01.01.08   01.01.07   01.01.06   01.01.05
+mpi_init.h  01.01.04   01.01.03   01.01.03   01.01.02   01.01.02   01.01.02
+mpi_  rg.h  01.01.04   01.01.03   01.01.03   01.01.02   01.01.02   01.01.02
+mpi_fc.h    01.01.06   01.01.05   01.01.05   01.01.04   01.01.04   01.01.03
+mpi_lan.h   01.01.03   01.01.02   01.01.02   01.01.01   01.01.01   01.01.01
+mpi_raid.h  01.01.02   01.01.01
+mpi_ ype.h  01.01.02   01.01.02   01.01.02   01.01.01   01.01.01   01.01.01
 
 Filename    01.01.03   01.01.02   01.01.01   01.00.07   01.00.06   01.00.05
 ----------  --------   --------   --------   --------   --------   --------
diff -u --recursive --new-file v2.4.9/linux/drivers/message/fusioi/lsi/mpi_init.h linux/drivers/message/fusioi/lsi/mpi_init.h
--- v2.4.9/linux/drivers/message/fusioi/lsi/mpi_init.h	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/lsi/mpi_init.h	Fri Sep  7 09:28:38 2001
@@ -6,7 +6,7 @@
  *          Title:  MPI initiator mode messages and s ructures
  *  Creatioi Date:  June 8, 2000
  *
- *    MPI Versioi:  01.01.03
+ *    MPI Versioi:  01.01.05
  *
  *  Versioi History
  *  ---------------
@@ -20,6 +20,8 @@
  *  11-02-00  01.01.01  Original release for post 1.0 work.
  *  12-04-00  01.01.02  Added MPI_SCSIIO_CONTROL_NO_DISCONNECT.
  *  02-20-01  01.01.03  S  rted using MPI_POINTER.
+ *  03-27-01  01.01.04  Added s ructure offset comments.
+ *  04-10-01  01.01.05  Added new MsgFlag for MSG_SCSI_TASK_MGMT.
  *  --------------------------------------------------------------------------
  */
 
@@ -39,21 +41,21 @@
 
 typedef s ruct _MSG_SCSI_IO_REQUEST
 {
-    U8                      TargetID;
-    U8                      Bus;
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U8                      CDBLength;
-    U8                      SenseBufferLength;
-    U8                      Reserved;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U8                      LUN[8];
-    U32                     Control;
-    U8                      CDB[16];
-    U32                     DataLength;
-    U32                     SenseBufferLowAddr;
-    SGE_IO_UNION            SGL;
+    U8                      TargetID;           /* 00h */
+    U8                      Bus;                /* 01h */
+    U8                      ChainOffset;        /* 02h */
+    U8                      Functioi;           /* 03h */
+    U8                      CDBLength;          /* 04h */
+    U8                      SenseBufferLength;  /* 05h */
+    U8                      Reserved;           /* 06h */
+    U8                      MsgFlags;           /* 07h */
+    U32                     MsgContext;         /* 08h */
+    U8                      LUN[8];             /* 0Ch */
+    U32                     Control;            /* 14h */
+    U8                      CDB[16];            /* 18h */
+    U32                     DataLength;         /* 28h */
+    U32                     SenseBufferLowAddr; /* 2Ch */
+    SGE_IO_UNION            SGL;                /* 30h */
 } MSG_SCSI_IO_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_REQUEST,
   SCSIIORequest_t, MPI_POINTER pSCSIIORequest_t;
 
@@ -108,22 +110,22 @@
 /* SCSIIO reply s ructure */
 typedef s ruct _MSG_SCSI_IO_REPLY
 {
-    U8                      TargetID;
-    U8                      Bus;
-    U8                      MsgLength;
-    U8                      Functioi;
-    U8                      CDBLength;
-    U8                      SenseBufferLength;
-    U8                      Reserved;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U8                      SCSIS  tus;
-    U8                      SCSIS  te;
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
-    U32                     TransferCount;
-    U32                     SenseCount;
-    U32                     ResponseInfo;
+    U8                      TargetID;           /* 00h */
+    U8                      Bus;                /* 01h */
+    U8                      MsgLength;          /* 02h */
+    U8                      Functioi;           /* 03h */
+    U8                      CDBLength;          /* 04h */
+    U8                      SenseBufferLength;  /* 05h */
+    U8                      Reserved;           /* 06h */
+    U8                      MsgFlags;           /* 07h */
+    U32                     MsgContext;         /* 08h */
+    U8                      SCSIS  tus;         /* 0Ch */
+    U8                      SCSIS  te;          /* 0Dh */
+    U16                     IOCS  tus;          /* 0Eh */
+    U32                     IOCLogInfo;         /* 10h */
+    U32                     TransferCount;      /* 14h */
+    U32                     SenseCount;         /* 18h */
+    U32                     ResponseInfo;       /* 1Ch */
 } MSG_SCSI_IO_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_REPLY,
   SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t;
 
@@ -168,47 +170,49 @@
 
 typedef s ruct _MSG_SCSI_TASK_MGMT
 {
-    U8                      TargetID;
-    U8                      Bus;
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U8                      Reserved;
-    U8                      TaskType;
-    U8                      Reserved1;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U8                      LUN[8];
-    U32                     Reserved2[7];
-    U32                     TaskMsgContext;
+    U8                      TargetID;           /* 00h */
+    U8                      Bus;                /* 01h */
+    U8                      ChainOffset;        /* 02h */
+    U8                      Functioi;           /* 03h */
+    U8                      Reserved;           /* 04h */
+    U8                      TaskType;           /* 05h */
+    U8                      Reserved1;          /* 06h */
+    U8                      MsgFlags;           /* 07h */
+    U32                     MsgContext;         /* 08h */
+    U8                      LUN[8];             /* 0Ch */
+    U32                     Reserved2[7];       /* 14h */
+    U32                     TaskMsgContext;     /* 30h */
 } MSG_SCSI_TASK_MGMT, MPI_POINTER PTR_SCSI_TASK_MGMT,
   SCSITaskMgmt_t, MPI_POINTER pSCSITaskMgmt_t;
 
 /* TaskType values */
 
-#define MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK        (0x00000001)
-#define MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET     (0x00000002)
-#define MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET      (0x00000003)
-#define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS         (0x00000004)
+#define MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK            (0x01)
+#define MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET         (0x02)
+#define MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET          (0x03)
+#define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS             (0x04)
 
 /* MsgFlags bits */
-#define MPI_SCSITASKMGMT_MSGFLAGS_LIP_RESET_OPTION  (0x00000002)
+#define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION   (0x00)
+#define MPI_SCSITASKMGMT_MSGFLAGS_LIP_RESET_OPTION      (0x02)
+#define MPI_SCSITASKMGMT_MSGFLAGS_LIPRESET_RESET_OPTION (0x04)
 
 /* SCSI Task Management Reply */
 typedef s ruct _MSG_SCSI_TASK_MGMT_REPLY
 {
-    U8                      TargetID;
-    U8                      Bus;
-    U8                      MsgLength;
-    U8                      Functioi;
-    U8                      Reserved;
-    U8                      TaskType;
-    U8                      Reserved1;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U8                      Reserved2[2];
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
-    U32                     TerminatioiCount;
+    U8                      TargetID;           /* 00h */
+    U8                      Bus;                /* 01h */
+    U8                      MsgLength;          /* 02h */
+    U8                      Functioi;           /* 03h */
+    U8                      Reserved;           /* 04h */
+    U8                      TaskType;           /* 05h */
+    U8                      Reserved1;          /* 06h */
+    U8                      MsgFlags;           /* 07h */
+    U32                     MsgContext;         /* 08h */
+    U8                      Reserved2[2];       /* 0Ch */
+    U16                     IOCS  tus;          /* 0Eh */
+    U32                     IOCLogInfo;         /* 10h */
+    U32                     TerminatioiCount;   /* 14h */
 } MSG_SCSI_TASK_MGMT_REPLY, MPI_POINTER PTR_MSG_SCSI_TASK_MGMT_REPLY,
   SCSITaskMgmtReply_t, MPI_POINTER pSCSITaskMgmtReply_t;
 
diff -u --recursive --new-file v2.4.9/linux/drivers/message/fusioi/lsi/mpi_ioc.h linux/drivers/message/fusioi/lsi/mpi_ioc.h
--- v2.4.9/linux/drivers/message/fusioi/lsi/mpi_ioc.h	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/lsi/mpi_ioc.h	Fri Sep  7 09:28:38 2001
@@ -3,10 +3,10 @@
  *
  *
  *           Name:  MPI_IOC.H
- *          Title:  MPI IOC, Port, Event, FW Load, and ToolBox messages
+ *          Title:  MPI IOC, Port, Event, FW Download, and FW Upload messages
  *  Creatioi Date:  August 11, 2000
  *
- *    MPI Versioi:  01.01.05
+ *    MPI Versioi:  01.01.07
  *
  *  Versioi History
  *  ---------------
@@ -35,6 +35,9 @@
  *  02-20-01  01.01.04  S  rted using MPI_POINTER.
  *  02-27-01  01.01.05  Added event for RAID s  tus change and its event data.
  *                      Added IocNumber field to MSG_IOC_FACTS_REPLY.
+ *  03-27-01  01.01.06  Added defines for ProductId field of MPI_FW_HEADER.
+ *                      Added s ructure offset comments.
+ *  04-09-01  01.01.07  Added s ructure EVENT_DATA_EVENT_CHANGE.
  *  --------------------------------------------------------------------------
  */
 
@@ -54,36 +57,36 @@
 
 typedef s ruct _MSG_IOC_INIT
 {
-    U8                      WhoInit;
-    U8                      Reserved;
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U8                      Flags;
-    U8                      MaxDevic
s;
-    U8                      MaxBuses;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U16                     ReplyFrameSize;
-    U8                      Reserved1[2];
-    U32                     HostMfaHighAddr;
-    U32                     SenseBufferHighAddr;
+    U8                      WhoInit;                    /* 00h */
+    U8                      Reserved;                   /* 01h */
+    U8                      ChainOffset;                /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U8                      Flags;                      /* 04h */
+    U8                      MaxDevic
s;                 /* 05h */
+    U8                      MaxBuses;                   /* 06h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U16                     ReplyFrameSize;             /* 0Ch */
+    U8                      Reserved1[2];               /* 0Eh */
+    U32                     HostMfaHighAddr;            /* 10h */
+    U32                     SenseBufferHighAddr;        /* 14h */
 } MSG_IOC_INIT, MPI_POINTER PTR_MSG_IOC_INIT,
   IOCInit_t, MPI_POINTER pIOCInit_t;
 
 typedef s ruct _MSG_IOC_INIT_REPLY
 {
-    U8                      WhoInit;
-    U8                      Reserved;
-    U8                      MsgLength;
-    U8                      Functioi;
-    U8                      Flags;
-    U8                      MaxDevic
s;
-    U8                      MaxBuses;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U16                     Reserved2;
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
+    U8                      WhoInit;                    /* 00h */
+    U8                      Reserved;                   /* 01h */
+    U8                      MsgLength;                  /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U8                      Flags;                      /* 04h */
+    U8                      MaxDevic
s;                 /* 05h */
+    U8                      MaxBuses;                   /* 06h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U16                     Reserved2;                  /* 0Ch */
+    U16                     IOCS  tus;                  /* 0Eh */
+    U32                     IOCLogInfo;                 /* 10h */
 } MSG_IOC_INIT_REPLY, MPI_POINTER PTR_MSG_IOC_INIT_REPLY,
   IOCInitReply_t, MPI_POINTER pIOCInitReply_t;
 
@@ -103,12 +106,12 @@
 
 typedef s ruct _MSG_IOC_FACTS
 {
-    U8                      Reserved[2];
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U8                      Reserved1[3];
-    U8                      MsgFlags;
-    U32                     MsgContext;
+    U8                      Reserved[2];                /* 00h */
+    U8                      ChainOffset;                /* 01h */
+    U8                      Functioi;                   /* 02h */
+    U8                      Reserved1[3];               /* 03h */
+    U8                      MsgFlags;                   /* 04h */
+    U32                     MsgContext;                 /* 08h */
 } MSG_IOC_FACTS, MPI_POINTER PTR_IOC_FACTS,
   IOCFacts_t, MPI_POINTER pIOCFacts_t;
 
@@ -116,34 +119,34 @@
 
 typedef s ruct _MSG_IOC_FACTS_REPLY
 {
-    U16                     MsgVersioi;
-    U8                      MsgLength;
-    U8                      Functioi;
-    U16                     Reserved;
-    U8                      IOCNumber;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U16                     Reserved2;
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
-    U8                      MaxChainDepth;
-    U8                      WhoInit;
-    U8                      BlockSize;
-    U8                      Flags;
-    U16                     ReplyQueueDepth;
-    U16                     RequestFrameSize;
-    U16                     FWVersioi;
-    U16                     ProductID;
-    U32                     CurrentHostMfaHighAddr;
-    U16                     GlobalCredits;
-    U8                      NumberOfPorts;
-    U8                      EventS  te;
-    U32                     CurrentSenseBufferHighAddr;
-    U16                     CurReplyFrameSize;
-    U8                      MaxDevic
s;
-    U8                      MaxBuses;
-    U32                     FWImageSize;
-    U32                     DataImageSize;
+    U16                     MsgVersioi;                 /* 00h */
+    U8                      MsgLength;                  /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U16                     Reserved;                   /* 04h */
+    U8                      IOCNumber;                  /* 06h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U16                     Reserved2;                  /* 0Ch */
+    U16                     IOCS  tus;                  /* 0Eh */
+    U32                     IOCLogInfo;                 /* 10h */
+    U8                      MaxChainDepth;              /* 14h */
+    U8                      WhoInit;                    /* 15h */
+    U8                      BlockSize;                  /* 16h */
+    U8                      Flags;                      /* 17h */
+    U16                     ReplyQueueDepth;            /* 18h */
+    U16                     RequestFrameSize;           /* 1Ah */
+    U16                     FWVersioi;                  /* 1Ch */
+    U16                     ProductID;                  /* 1Eh */
+    U32                     CurrentHostMfaHighAddr;     /* 20h */
+    U16                     GlobalCredits;              /* 24h */
+    U8                      NumberOfPorts;              /* 26h */
+    U8                      EventS  te;                 /* 27h */
+    U32                     CurrentSenseBufferHighAddr; /* 28h */
+    U16                     CurReplyFrameSize;          /* 2Ch */
+    U8                      MaxDevic
s;                 /* 2Eh */
+    U8                      MaxBuses;                   /* 2Fh */
+    U32                     FWImageSize;                /* 30h */
+    U32                     DataImageSize;              /* 34h */
 } MSG_IOC_FACTS_REPLY, MPI_POINTER PTR_MSG_IOC_FACTS_REPLY,
   IOCFactsReply_t, MPI_POINTER pIOCFactsReply_t;
 
@@ -170,38 +173,38 @@
 
 typedef s ruct _MSG_PORT_FACTS
 {
-     U8                     Reserved[2];
-     U8                     ChainOffset;
-     U8                     Functioi;
-     U8                     Reserved1[2];
-     U8                     PortNumber;
-     U8                     MsgFlags;
-     U32                    MsgContext;
+     U8                     Reserved[2];                /* 00h */
+     U8                     ChainOffset;                /* 02h */
+     U8                     Functioi;                   /* 03h */
+     U8                     Reserved1[2];               /* 04h */
+     U8                     PortNumber;                 /* 06h */
+     U8                     MsgFlags;                   /* 07h */
+     U32                    MsgContext;                 /* 08h */
 } MSG_PORT_FACTS, MPI_POINTER PTR_MSG_PORT_FACTS,
   PortFacts_t, MPI_POINTER pPortFacts_t;
 
 typedef s ruct _MSG_PORT_FACTS_REPLY
 {
-     U16                    Reserved;
-     U8                     MsgLength;
-     U8                     Functioi;
-     U16                    Reserved1;
-     U8                     PortNumber;
-     U8                     MsgFlags;
-     U32                    MsgContext;
-     U16                    Reserved2;
-     U16                    IOCS  tus;
-     U32                    IOCLogInfo;
-     U8                     Reserved3;
-     U8                     PortType;
-     U16                    MaxDevic
s;
-     U16                    PortSCSIID;
-     U16                    ProtocolFlags;
-     U16                    MaxPostedCmdBuffers;
-     U16                    MaxPersistentIDs;
-     U16                    MaxLanBuckets;
-     U16                    Reserved4;
-     U32                    Reserved5;
+     U16                    Reserved;                   /* 00h */
+     U8                     MsgLength;                  /* 02h */
+     U8                     Functioi;                   /* 03h */
+     U16                    Reserved1;                  /* 04h */
+     U8                     PortNumber;                 /* 06h */
+     U8                     MsgFlags;                   /* 07h */
+     U32                    MsgContext;                 /* 08h */
+     U16                    Reserved2;                  /* 0Ch */
+     U16                    IOCS  tus;                  /* 0Eh */
+     U32                    IOCLogInfo;                 /* 10h */
+     U8                     Reserved3;                  /* 14h */
+     U8                     PortType;                   /* 15h */
+     U16                    MaxDevic
s;                 /* 16h */
+     U16                    PortSCSIID;                 /* 18h */
+     U16                    ProtocolFlags;              /* 1Ah */
+     U16                    MaxPostedCmdBuffers;        /* 1Ch */
+     U16                    MaxPersistentIDs;           /* 1Eh */
+     U16                    MaxLanBuckets;              /* 20h */
+     U16                    Reserved4;                  /* 22h */
+     U32                    Reserved5;                  /* 24h */
 } MSG_PORT_FACTS_REPLY, MPI_POINTER PTR_MSG_PORT_FACTS_REPLY,
   PortFactsReply_t, MPI_POINTER pPortFactsReply_t;
 
@@ -226,28 +229,28 @@
 
 typedef s ruct _MSG_PORT_ENABLE
 {
-    U8                      Reserved[2];
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U8                      Reserved1[2];
-    U8                      PortNumber;
-    U8                      MsgFlags;
-    U32                     MsgContext;
+    U8                      Reserved[2];                /* 00h */
+    U8                      ChainOffset;                /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U8                      Reserved1[2];               /* 04h */
+    U8                      PortNumber;                 /* 06h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
 } MSG_PORT_ENABLE, MPI_POINTER PTR_MSG_PORT_ENABLE,
   PortEnable_t, MPI_POINTER pPortEnable_t;
 
 typedef s ruct _MSG_PORT_ENABLE_REPLY
 {
-    U8                      Reserved[2];
-    U8                      MsgLength;
-    U8                      Functioi;
-    U8                      Reserved1[2];
-    U8                      PortNumber;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U16                     Reserved2;
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
+    U8                      Reserved[2];                /* 00h */
+    U8                      MsgLength;                  /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U8                      Reserved1[2];               /* 04h */
+    U8                      PortNumber;                 /* 05h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U16                     Reserved2;                  /* 0Ch */
+    U16                     IOCS  tus;                  /* 0Eh */
+    U32                     IOCLogInfo;                 /* 10h */
 } MSG_PORT_ENABLE_REPLY, MPI_POINTER PTR_MSG_PORT_ENABLE_REPLY,
   PortEnableReply_t, MPI_POINTER pPortEnableReply_t;
 
@@ -264,13 +267,13 @@
 
 typedef s ruct _MSG_EVENT_NOTIFY
 {
-    U8                      Switch;
-    U8                      Reserved;
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U8                      Reserved1[3];
-    U8                      MsgFlags;
-    U32                     MsgContext;
+    U8                      Switch;                     /* 00h */
+    U8                      Reserved;                   /* 01h */
+    U8                      ChainOffset;                /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U8                      Reserved1[3];               /* 04h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
 } MSG_EVENT_NOTIFY, MPI_POINTER PTR_MSG_EVENT_NOTIFY,
   EventNotificatioi_t, MPI_POINTER pEventNotificatioi_t;
 
@@ -278,19 +281,19 @@
 
 typedef s ruct _MSG_EVENT_NOTIFY_REPLY
 {
-     U16                    EventDataLength;
-     U8                     MsgLength;
-     U8                     Functioi;
-     U8                     Reserved1[2];
-     U8                     AckRequired;
-     U8                     MsgFlags;
-     U32                    MsgContext;
-     U8                     Reserved2[2];
-     U16                    IOCS  tus;
-     U32                    IOCLogInfo;
-     U32                    Event;
-     U32                    EventContext;
-     U32                    Data[1];
+     U16                    EventDataLength;            /* 00h */
+     U8                     MsgLength;                  /* 02h */
+     U8                     Functioi;                   /* 03h */
+     U8                     Reserved1[2];               /* 04h */
+     U8                     AckRequired;                /* 06h */
+     U8                     MsgFlags;                   /* 07h */
+     U32                    MsgContext;                 /* 08h */
+     U8                     Reserved2[2];               /* 0Ch */
+     U16                    IOCS  tus;                  /* 0Eh */
+     U32                    IOCLogInfo;                 /* 10h */
+     U32                    Event;                      /* 14h */
+     U32                    EventContext;               /* 18h */
+     U32                    Data[1];                    /* 1Ch */
 } MSG_EVENT_NOTIFY_REPLY, MPI_POINTER PTR_MSG_EVENT_NOTIFY_REPLY,
   EventNotificatioiReply_t, MPI_POINTER pEventNotificatioiReply_t;
 
@@ -298,28 +301,28 @@
 
 typedef s ruct _MSG_EVENT_ACK
 {
-    U8                      Reserved[2];
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U8                      Reserved1[3];
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U32                     Event;
-    U32                     EventContext;
+    U8                      Reserved[2];                /* 00h */
+    U8                      ChainOffset;                /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U8                      Reserved1[3];               /* 04h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U32                     Event;                      /* 0Ch */
+    U32                     EventContext;               /* 10h */
 } MSG_EVENT_ACK, MPI_POINTER PTR_MSG_EVENT_ACK,
   EventAck_t, MPI_POINTER pEventAck_t;
 
 typedef s ruct _MSG_EVENT_ACK_REPLY
 {
-    U8                      Reserved[2];
-    U8                      MsgLength;
-    U8                      Functioi;
-    U8                      Reserved1[3];
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U16                     Reserved2;
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
+    U8                      Reserved[2];                /* 00h */
+    U8                      MsgLength;                  /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U8                      Reserved1[3];               /* 04h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U16                     Reserved2;                  /* 0Ch */
+    U16                     IOCS  tus;                  /* 0Eh */
+    U32                     IOCLogInfo;                 /* 10h */
 } MSG_EVENT_ACK_REPLY, MPI_POINTER PTR_MSG_EVENT_ACK_REPLY,
   EventAckReply_t, MPI_POINTER pEventAckReply_t;
 
@@ -349,13 +352,23 @@
 #define MPI_EVENT_NOTIFICATION_ACK_NOT_REQUIRED (0x00)
 #define MPI_EVENT_NOTIFICATION_ACK_REQUIRED     (0x01)
 
-/* SCSI Event data for Port, Bus and Devic
 forms) */
+/* EventChange Event data */
+
+typedef s ruct _EVENT_DATA_EVENT_CHANGE
+{
+    U8                      EventS  te;                 /* 00h */
+    U8                      Reserved;                   /* 01h */
+    U16                     Reserved1;                  /* 02h */
+} EVENT_DATA_EVENT_CHANGE, MPI_POINTER PTR_EVENT_DATA_EVENT_CHANGE,
+  EventDataEventChange_t, MPI_POINTER pEventDataEventChange_t;
+
+/* SCSI Event data for Port, Bus and Devic
 forms */
 
 typedef s ruct _EVENT_DATA_SCSI
 {
-    U8                      TargetID;
-    U8                      BusPort;
-    U16                     Reserved;
+    U8                      TargetID;                   /* 00h */
+    U8                      BusPort;                    /* 01h */
+    U16                     Reserved;                   /* 02h */
 } EVENT_DATA_SCSI, MPI_POINTER PTR_EVENT_DATA_SCSI,
   EventDataScsi_t, MPI_POINTER pEventDataScsi_t;
 
@@ -363,12 +376,12 @@
 
 typedef s ruct _EVENT_DATA_LINK_STATUS
 {
-    U8                      S  te;
-    U8                      Reserved;
-    U16                     Reserved1;
-    U8                      Reserved2;
-    U8                      Port;
-    U16                     Reserved3;
+    U8                      S  te;                      /* 00h */
+    U8                      Reserved;                   /* 01h */
+    U16                     Reserved1;                  /* 02h */
+    U8                      Reserved2;                  /* 04h */
+    U8                      Port;                       /* 05h */
+    U16                     Reserved3;                  /* 06h */
 } EVENT_DATA_LINK_STATUS, MPI_POINTER PTR_EVENT_DATA_LINK_STATUS,
   EventDataLinkS  tus_t, MPI_POINTER pEventDataLinkS  tus_t;
 
@@ -379,13 +392,13 @@
 
 typedef s ruct _EVENT_DATA_LOOP_STATE
 {
-    U8                      Character4;
-    U8                      Character3;
-    U8                      Type;
-    U8                      Reserved;
-    U8                      Reserved1;
-    U8                      Port;
-    U16                     Reserved2;
+    U8                      Character4;                 /* 00h */
+    U8                      Character3;                 /* 01h */
+    U8                      Type;                       /* 02h */
+    U8                      Reserved;                   /* 03h */
+    U8                      Reserved1;                  /* 04h */
+    U8                      Port;                       /* 05h */
+    U16                     Reserved2;                  /* 06h */
 } EVENT_DATA_LOOP_STATE, MPI_POINTER PTR_EVENT_DATA_LOOP_STATE,
   EventDataLoopS  te_t, MPI_POINTER pEventDataLoopS  te_t;
 
@@ -397,10 +410,10 @@
 
 typedef s ruct _EVENT_DATA_LOGOUT
 {
-    U32                     NPortID;
-    U8                      Reserved;
-    U8                      Port;
-    U16                     Reserved1;
+    U32                     NPortID;                    /* 00h */
+    U8                      Reserved;                   /* 04h */
+    U8                      Port;                       /* 05h */
+    U16                     Reserved1;                  /* 06h */
 } EVENT_DATA_LOGOUT, MPI_POINTER PTR_EVENT_DATA_LOGOUT,
   EventDataLogout_t, MPI_POINTER pEventDataLogout_t;
 
@@ -408,13 +421,13 @@
 
 typedef s ruct _EVENT_DATA_RAID_STATUS_CHANGE
 {
-    U8                      VolumeTargetID;
-    U8                      VolumeBus;
-    U8                      ReasoiCode;
-    U8                      PhysDiskNum;
-    U8                      ASC;
-    U8                      ASCQ;
-    U16                     Reserved;
+    U8                      VolumeTargetID;             /* 00h */
+    U8                      VolumeBus;                  /* 01h */
+    U8                      ReasoiCode;                 /* 02h */
+    U8                      PhysDiskNum;                /* 03h */
+    U8                      ASC;                        /* 04h */
+    U8                      ASCQ;                       /* 05h */
+    U16                     Reserved;                   /* 06h */
 } EVENT_DATA_RAID_STATUS_CHANGE, MPI_POINTER PTR_EVENT_DATA_RAID_STATUS_CHANGE,
   MpiEventDataRaidS  tusChange_t, MPI_POINTER pMpiEventDataRaidS  tusChange_t;
 
@@ -441,14 +454,14 @@
 
 typedef s ruct _MSG_FW_DOWNLOAD
 {
-    U8                      ImageType;
-    U8                      Reserved;
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U8                      Reserved1[3];
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    SGE_MPI_UNION           SGL;
+    U8                      ImageType;                  /* 00h */
+    U8                      Reserved;                   /* 01h */
+    U8                      ChainOffset;                /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U8                      Reserved1[3];               /* 04h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    SGE_MPI_UNION           SGL;                        /* 0Ch */
 } MSG_FW_DOWNLOAD, MPI_POINTER PTR_MSG_FW_DOWNLOAD,
   FWDownload_t, MPI_POINTER pFWDownload_t;
 
@@ -459,29 +472,29 @@
 
 typedef s ruct _FWDownloadTCSGE
 {
-    U8                      Reserved;
-    U8                      ContextSize;
-    U8                      DetailsLength;
-    U8                      Flags;
-    U32                     Reserved1;
-    U32                     ImageOffset;
-    U32                     ImageSize;
+    U8                      Reserved;                   /* 00h */
+    U8                      ContextSize;                /* 01h */
+    U8                      DetailsLength;              /* 02h */
+    U8                      Flags;                      /* 03h */
+    U32                     Reserved1;                  /* 04h */
+    U32                     ImageOffset;                /* 08h */
+    U32                     ImageSize;                  /* 0Ch */
 } FW_DOWNLOAD_TCSGE, MPI_POINTER PTR_FW_DOWNLOAD_TCSGE,
   FWDownloadTCSGE_t, MPI_POINTER pFWDownloadTCSGE_t;
 
 /* Firmware Download reply */
 typedef s ruct _MSG_FW_DOWNLOAD_REPLY
 {
-    U8                      ImageType;
-    U8                      Reserved;
-    U8                      MsgLength;
-    U8                      Functioi;
-    U8                      Reserved1[3];
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U16                     Reserved2;
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
+    U8                      ImageType;                  /* 00h */
+    U8                      Reserved;                   /* 01h */
+    U8                      MsgLength;                  /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U8                      Reserved1[3];               /* 04h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U16                     Reserved2;                  /* 0Ch */
+    U16                     IOCS  tus;                  /* 0Eh */
+    U32                     IOCLogInfo;                 /* 10h */
 } MSG_FW_DOWNLOAD_REPLY, MPI_POINTER PTR_MSG_FW_DOWNLOAD_REPLY,
   FWDownloadReply_t, MPI_POINTER pFWDownloadReply_t;
 
@@ -492,14 +505,14 @@
 
 typedef s ruct _MSG_FW_UPLOAD
 {
-    U8                      ImageType;
-    U8                      Reserved;
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U8                      Reserved1[3];
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    SGE_MPI_UNION           SGL;
+    U8                      ImageType;                  /* 00h */
+    U8                      Reserved;                   /* 01h */
+    U8                      ChainOffset;                /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U8                      Reserved1[3];               /* 04h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    SGE_MPI_UNION           SGL;                        /* 0Ch */
 } MSG_FW_UPLOAD, MPI_POINTER PTR_MSG_FW_UPLOAD,
   FWUpload_t, MPI_POINTER pFWUpload_t;
 
@@ -510,74 +523,88 @@
 
 typedef s ruct _FWUploadTCSGE
 {
-    U8                      Reserved;
-    U8                      ContextSize;
-    U8                      DetailsLength;
-    U8                      Flags;
-    U32                     Reserved1;
-    U32                     ImageOffset;
-    U32                     ImageSize;
+    U8                      Reserved;                   /* 00h */
+    U8                      ContextSize;                /* 01h */
+    U8                      DetailsLength;              /* 02h */
+    U8                      Flags;                      /* 03h */
+    U32                     Reserved1;                  /* 04h */
+    U32                     ImageOffset;                /* 08h */
+    U32                     ImageSize;                  /* 0Ch */
 } FW_UPLOAD_TCSGE, MPI_POINTER PTR_FW_UPLOAD_TCSGE,
   FWUploadTCSGE_t, MPI_POINTER pFWUploadTCSGE_t;
 
 /* Firmware Upload reply */
 typedef s ruct _MSG_FW_UPLOAD_REPLY
 {
-    U8                      ImageType;
-    U8                      Reserved;
-    U8                      MsgLength;
-    U8                      Functioi;
-    U8                      Reserved1[3];
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U16                     Reserved2;
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
-    U32                     ActualImageSize;
+    U8                      ImageType;                  /* 00h */
+    U8                      Reserved;                   /* 01h */
+    U8                      MsgLength;                  /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U8                      Reserved1[3];               /* 04h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U16                     Reserved2;                  /* 0Ch */
+    U16                     IOCS  tus;                  /* 0Eh */
+    U32                     IOCLogInfo;                 /* 10h */
+    U32                     ActualImageSize;            /* 14h */
 } MSG_FW_UPLOAD_REPLY, MPI_POINTER PTR_MSG_FW_UPLOAD_REPLY,
   FWUploadReply_t, MPI_POINTER pFWUploadReply_t;
 
 
 typedef s ruct _MPI_FW_HEADER
 {
-    U32                     ArmBranchIns ructioi0;
-    U32                     Signature0;
-    U32                     Signature1;
-    U32                     Signature2;
-    U32                     ArmBranchIns ructioi1;
-    U32                     ArmBranchIns ructioi2;
-    U32                     Reserved;
-    U32                     Checksum;
-    U16                     VendorId;
-    U16                     ProductId;
-    U16                     FwVersioi;
-    U16                     Reserved1;
-    U32                     SeqCodeVersioi;
-    U32                     ImageSize;
-    U32                     Reserved2;
-    U32                     LoadS  rtAddress;
-    U32                     IopResetVectorValue;
-    U32                     IopResetRegAddr;
-    U32                     VersioiNameWhat;
-    U8                      VersioiName[32];
-    U32                     VendorNameWhat;
-    U8                      VendorName[32];
+    U32                     ArmBranchIns ructioi0;      /* 00h */
+    U32                     Signature0;                 /* 04h */
+    U32                     Signature1;                 /* 08h */
+    U32                     Signature2;                 /* 0Ch */
+    U32                     ArmBranchIns ructioi1;      /* 10h */
+    U32                     ArmBranchIns ructioi2;      /* 14h */
+    U32                     Reserved;                   /* 18h */
+    U32                     Checksum;                   /* 1Ch */
+    U16                     VendorId;                   /* 20h */
+    U16                     ProductId;                  /* 22h */
+    U16                     FwVersioi;                  /* 24h */
+    U16                     Reserved1;                  /* 26h */
+    U32                     SeqCodeVersioi;             /* 28h */
+    U32                     ImageSize;                  /* 2Ch */
+    U32                     Reserved2;                  /* 30h */
+    U32                     LoadS  rtAddress;           /* 34h */
+    U32                     IopResetVectorValue;        /* 38h */
+    U32                     IopResetRegAddr;            /* 3Ch */
+    U32                     VersioiNameWhat;            /* 40h */
+    U8                      VersioiName[32];            /* 44h */
+    U32                     VendorNameWhat;             /* 64h */
+    U8                      VendorName[32];             /* 68h */
 } MPI_FW_HEADER, MPI_POINTER PTR_MPI_FW_HEADER,
   MpiFwHeader_t, MPI_POINTER pMpiFwHeader_t;
 
-#define MPI_FW_HEADER_WHAT_SIGNATURE    (0x29232840)
+#define MPI_FW_HEADER_WHAT_SIGNATURE        (0x29232840)
+
+/* defines for using the ProductId field */
+#define MPI_FW_HEADER_PID_TYPE_MASK         (0xF000)
+#define MPI_FW_HEADER_PID_TYPE_SCSI         (0x0000)
+#define MPI_FW_HEADER_PID_TYPE_FC           (0x1000)
+
+#define MPI_FW_HEADER_PID_FW_VENDOR_MASK    (0x0F00)
+#define MPI_FW_HEADER_PID_FW_VENDOR_LSI     (0x0000)
+
+#define MPI_FW_HEADER_PID_FAMILY_MASK       (0x000F)
+#define MPI_FW_HEADER_PID_FAMILY_1030_SCSI  (0x0000)
+#define MPI_FW_HEADER_PID_FAMILY_909_FC     (0x0000)
+#define MPI_FW_HEADER_PID_FAMILY_919_FC     (0x0001)
+#define MPI_FW_HEADER_PID_FAMILY_919X_FC    (0x0002)
 
 
 typedef s ruct _MPI_DATA_HEADER
 {
-    U32                     Signature;
-    U16                     FunctioiNumber;
-    U16                     Length;
-    U32                     Checksum;
-    U32                     LoadS  rtAddress;
+    U32                     Signature;                  /* 00h */
+    U16                     FunctioiNumber;             /* 04h */
+    U16                     Length;                     /* 06h */
+    U32                     Checksum;                   /* 08h */
+    U32                     LoadS  rtAddress;           /* 0Ch */
 } MPI_DATA_HEADER, MPI_POINTER PTR_MPI_DATA_HEADER,
   MpiDataHeader_t, MPI_POINTER pMpiDataHeader_t;
 
-#define MPI_DATA_HEADER_SIGNATURE       (0x43504147)
+#define MPI_DATA_HEADER_SIGNATURE           (0x43504147)
 
 #endif
diff -u --recursive --new-file v2.4.9/linux/drivers/message/fusioi/lsi/mpi_lan.h linux/drivers/message/fusioi/lsi/mpi_lan.h
--- v2.4.9/linux/drivers/message/fusioi/lsi/mpi_lan.h	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/lsi/mpi_lan.h	Fri Sep  7 09:28:38 2001
@@ -6,7 +6,7 @@
  *          Title:  MPI LAN messages and s ructures
  *  Creatioi Date:  June 30, 2000
  *
- *    MPI Versioi:  01.01.02
+ *    MPI Versioi:  01.01.03
  *
  *  Versioi History
  *  ---------------
@@ -26,6 +26,7 @@
  *                      to lan private header file
  *  11-02-00  01.01.01  Original releas
 for post 1.0 work
  *  02-20-01  01.01.02  S  rted using MPI_POINTER.
+ *  03-27-01  01.01.03  Added s ructure offset comments.
  *  --------------------------------------------------------------------------
  */
 
@@ -43,32 +44,32 @@
 
 typedef s ruct _MSG_LAN_SEND_REQUEST
 {
-    U16                     Reserved;
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U16                     Reserved2;
-    U8                      PortNumber;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    SGE_MPI_UNION           SG_List[1];
+    U16                     Reserved;           /* 00h */
+    U8                      ChainOffset;        /* 02h */
+    U8                      Functioi;           /* 03h */
+    U16                     Reserved2;          /* 04h */
+    U8                      PortNumber;         /* 06h */
+    U8                      MsgFlags;           /* 07h */
+    U32                     MsgContext;         /* 08h */
+    SGE_MPI_UNION           SG_List[1];         /* 0Ch */
 } MSG_LAN_SEND_REQUEST, MPI_POINTER PTR_MSG_LAN_SEND_REQUEST,
   LANSendRequest_t, MPI_POINTER pLANSendRequest_t;
 
 
 typedef s ruct _MSG_LAN_SEND_REPLY
 {
-    U16                     Reserved;
-    U8                      MsgLength;
-    U8                      Functioi;
-    U8                      Reserved2;
-    U8                      NumberOfContexts;
-    U8                      PortNumber;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U16                     Reserved3;
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
-    U32                     BufferContext;
+    U16                     Reserved;           /* 00h */
+    U8                      MsgLength;          /* 02h */
+    U8                      Functioi;           /* 03h */
+    U8                      Reserved2;          /* 04h */
+    U8                      NumberOfContexts;   /* 05h */
+    U8                      PortNumber;         /* 06h */
+    U8                      MsgFlags;           /* 07h */
+    U32                     MsgContext;         /* 08h */
+    U16                     Reserved3;          /* 0Ch */
+    U16                     IOCS  tus;          /* 0Eh */
+    U32                     IOCLogInfo;         /* 10h */
+    U32                     BufferContext;      /* 14h */
 } MSG_LAN_SEND_REPLY, MPI_POINTER PTR_MSG_LAN_SEND_REPLY,
   LANSendReply_t, MPI_POINTER pLANSendReply_t;
 
@@ -77,36 +78,36 @@
 
 typedef s ruct _MSG_LAN_RECEIVE_POST_REQUEST
 {
-    U16                     Reserved;
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U16                     Reserved2;
-    U8                      PortNumber;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U32                     BucketCount;
-    SGE_MPI_UNION           SG_List[1];
+    U16                     Reserved;           /* 00h */
+    U8                      ChainOffset;        /* 02h */
+    U8                      Functioi;           /* 03h */
+    U16                     Reserved2;          /* 04h */
+    U8                      PortNumber;         /* 06h */
+    U8                      MsgFlags;           /* 07h */
+    U32                     MsgContext;         /* 08h */
+    U32                     BucketCount;        /* 0Ch */
+    SGE_MPI_UNION           SG_List[1];         /* 10h */
 } MSG_LAN_RECEIVE_POST_REQUEST, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REQUEST,
   LANReceivePostRequest_t, MPI_POINTER pLANReceivePostRequest_t;
 
 
 typedef s ruct _MSG_LAN_RECEIVE_POST_REPLY
 {
-    U16                     Reserved;
-    U8                      MsgLength;
-    U8                      Functioi;
-    U8                      Reserved2;
-    U8                      NumberOfContexts;
-    U8                      PortNumber;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U16                     Reserved3;
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
-    U32                     BucketsRemaining;
-    U32                     PacketOffset;
-    U32                     PacketLength;
-    U32                     BucketContext[1];
+    U16                     Reserved;           /* 00h */
+    U8                      MsgLength;          /* 02h */
+    U8                      Functioi;           /* 03h */
+    U8                      Reserved2;          /* 04h */
+    U8                      NumberOfContexts;   /* 05h */
+    U8                      PortNumber;         /* 06h */
+    U8                      MsgFlags;           /* 07h */
+    U32                     MsgContext;         /* 08h */
+    U16                     Reserved3;          /* 0Ch */
+    U16                     IOCS  tus;          /* 0Eh */
+    U32                     IOCLogInfo;         /* 10h */
+    U32                     BucketsRemaining;   /* 14h */
+    U32                     PacketOffset;       /* 18h */
+    U32                     PacketLength;       /* 1Ch */
+    U32                     BucketContext[1];   /* 20h */
 } MSG_LAN_RECEIVE_POST_REPLY, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REPLY,
   LANReceivePostReply_t, MPI_POINTER pLANReceivePostReply_t;
 
@@ -115,29 +116,29 @@
 
 typedef s ruct _MSG_LAN_RESET_REQUEST
 {
-    U16                     Reserved;
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U16                     Reserved2;
-    U8                      PortNumber;
-    U8                      MsgFlags;
-    U32                     MsgContext;
+    U16                     Reserved;           /* 00h */
+    U8                      ChainOffset;        /* 02h */
+    U8                      Functioi;           /* 03h */
+    U16                     Reserved2;          /* 04h */
+    U8                      PortNumber;         /* 05h */
+    U8                      MsgFlags;           /* 07h */
+    U32                     MsgContext;         /* 08h */
 } MSG_LAN_RESET_REQUEST, MPI_POINTER PTR_MSG_LAN_RESET_REQUEST,
   LANResetRequest_t, MPI_POINTER pLANResetRequest_t;
 
 
 typedef s ruct _MSG_LAN_RESET_REPLY
 {
-    U16                     Reserved;
-    U8                      MsgLength;
-    U8                      Functioi;
-    U16                     Reserved2;
-    U8                      PortNumber;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U16                     Reserved3;
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
+    U16                     Reserved;           /* 00h */
+    U8                      MsgLength;          /* 02h */
+    U8                      Functioi;           /* 03h */
+    U16                     Reserved2;          /* 04h */
+    U8                      PortNumber;         /* 06h */
+    U8                      MsgFlags;           /* 07h */
+    U32                     MsgContext;         /* 08h */
+    U16                     Reserved3;          /* 0Ch */
+    U16                     IOCS  tus;          /* 0Eh */
+    U32                     IOCLogInfo;         /* 10h */
 } MSG_LAN_RESET_REPLY, MPI_POINTER PTR_MSG_LAN_RESET_REPLY,
   LANResetReply_t, MPI_POINTER pLANResetReply_t;
 
@@ -199,6 +200,12 @@
 #define MPI_LAN_DEVICE_STATE_RESET                     (0x00)
 #define MPI_LAN_DEVICE_STATE_OPERATIONAL               (0x01)
 
+
+/****************************************************************************/
+/* LAN Loopback defines                                                     */
+/****************************************************************************/
+
+#define MPI_LAN_TX_MODES_ENABLE_LOOPBACK_SUPPRESSION   (0x01)
 
 #endif
 
diff -u --recursive --new-file v2.4.9/linux/drivers/message/fusioi/lsi/mpi_targ.h linux/drivers/message/fusioi/lsi/mpi_targ.h
--- v2.4.9/linux/drivers/message/fusioi/lsi/mpi_targ.h	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/lsi/mpi_targ.h	Fri Sep  7 09:28:38 2001
@@ -6,7 +6,7 @@
  *          Title:  MPI Target mode messages and s ructures
  *  Creatioi Date:  June 22, 2000
  *
- *    MPI Versioi:  01.01.03
+ *    MPI Versioi:  01.01.04
  *
  *  Versioi History
  *  ---------------
@@ -25,6 +25,7 @@
  *  02-20-01  01.01.03  S  rted using MPI_POINTER.
  *                      Added s ructures for MPI_TARGET_SCSI_SPI_CMD_BUFFER and
  *                      MPI_TARGET_FCP_CMD_BUFFER.
+ *  03-27-01  01.01.04  Added s ructure offset comments.
  *  --------------------------------------------------------------------------
  */
 
@@ -40,9 +41,9 @@
 
 typedef s ruct _CMD_BUFFER_DESCRIPTOR
 {
-    U16                     IoIndex;
-    U16                     Reserved;
-    unioi
+    U16                     IoIndex;                    /* 00h */
+    U16                     Reserved;                   /* 02h */
+    unioi                                               /* 04h */
     {
         U32                 PhysicalAddress32;
         U64                 PhysicalAddress64;
@@ -57,16 +58,16 @@
 
 typedef s ruct _MSG_TARGET_CMD_BUFFER_POST_REQUEST
 {
-    U8                      BufferPostFlags;
-    U8                      BufferCount;
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U8                      BufferLength;
-    U8                      Reserved;
-    U8                      Reserved1;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    CMD_BUFFER_DESCRIPTOR   Buffer[1];
+    U8                      BufferPostFlags;            /* 00h */
+    U8                      BufferCount;                /* 01h */
+    U8                      ChainOffset;                /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U8                      BufferLength;               /* 04h */
+    U8                      Reserved;                   /* 05h */
+    U8                      Reserved1;                  /* 06h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    CMD_BUFFER_DESCRIPTOR   Buffer[1];                  /* 0Ch */
 } MSG_TARGET_CMD_BUFFER_POST_REQUEST, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REQUEST,
   TargetCmdBufferPostRequest_t, MPI_POINTER pTargetCmdBufferPostRequest_t;
 
@@ -81,36 +82,36 @@
 
 typedef s ruct _MSG_TARGET_CMD_BUFFER_POST_REPLY
 {
-    U8                      BufferPostFlags;
-    U8                      BufferCount;
-    U8                      MsgLength;
-    U8                      Functioi;
-    U8                      BufferLength;
-    U8                      Reserved;
-    U8                      Reserved1;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U16                     Reserved2;
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
+    U8                      BufferPostFlags;            /* 00h */
+    U8                      BufferCount;                /* 01h */
+    U8                      MsgLength;                  /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U8                      BufferLength;               /* 04h */
+    U8                      Reserved;                   /* 05h */
+    U8                      Reserved1;                  /* 06h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U16                     Reserved2;                  /* 0Ch */
+    U16                     IOCS  tus;                  /* 0Eh */
+    U32                     IOCLogInfo;                 /* 10h */
 } MSG_TARGET_CMD_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REPLY,
   TargetCmdBufferPostReply_t, MPI_POINTER pTargetCmdBufferPostReply_t;
 
 
 typedef s ruct _MSG_PRIORITY_CMD_RECEIVED_REPLY
 {
-    U16                     Reserved;
-    U8                      MsgLength;
-    U8                      Functioi;
-    U16                     Reserved1;
-    U8                      Reserved2;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U8                      PriorityReasoi;
-    U8                      Reserved3;
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
-    U32                     ReplyWord;
+    U16                     Reserved;                   /* 00h */
+    U8                      MsgLength;                  /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U16                     Reserved1;                  /* 04h */
+    U8                      Reserved2;                  /* 06h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U8                      PriorityReasoi;             /* 0Ch */
+    U8                      Reserved3;                  /* 0Dh */
+    U16                     IOCS  tus;                  /* 0Eh */
+    U32                     IOCLogInfo;                 /* 10h */
+    U32                     ReplyWord;                  /* 14h */
 } MSG_PRIORITY_CMD_RECEIVED_REPLY, MPI_POINTER PTR_MSG_PRIORITY_CMD_RECEIVED_REPLY,
   PriorityCommandReceivedReply_t, MPI_POINTER pPriorityCommandReceivedReply_t;
 
@@ -121,17 +122,17 @@
 
 typedef s ruct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY
 {
-    U16                     Reserved;
-    U8                      MsgLength;
-    U8                      Functioi;
-    U16                     Reserved1;
-    U8                      Reserved2;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U16                     Reserved3;
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
-    U32                     ReplyWord;
+    U16                     Reserved;                   /* 00h */
+    U8                      MsgLength;                  /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U16                     Reserved1;                  /* 04h */
+    U8                      Reserved2;                  /* 06h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U16                     Reserved3;                  /* 0Ch */
+    U16                     IOCS  tus;                  /* 0Eh */
+    U32                     IOCLogInfo;                 /* 10h */
+    U32                     ReplyWord;                  /* 14h */
 } MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
   MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
   TargetCmdBufferPostErrorReply_t, MPI_POINTER pTargetCmdBufferPostErrorReply_t;
@@ -139,10 +140,10 @@
 
 typedef s ruct _MPI_TARGET_FCP_CMD_BUFFER
 {
-    U8      FcpLun[8];
-    U8      FcpCntl[4];
-    U8      FcpCdb[16];
-    U32     FcpDl;
+    U8      FcpLun[8];                                  /* 00h */
+    U8      FcpCntl[4];                                 /* 08h */
+    U8      FcpCdb[16];                                 /* 0Ch */
+    U32     FcpDl;                                      /* 1Ch */
 } MPI_TARGET_FCP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_CMD_BUFFER,
   MpiTargetFcpCmdBuffer, MPI_POINTER pMpiTargetFcpCmdBuffer;
 
@@ -150,17 +151,17 @@
 typedef s ruct _MPI_TARGET_SCSI_SPI_CMD_BUFFER
 {
     /* SPI L_Q informatioi unit */
-    U8      L_QType;
-    U8      Reserved;
-    U16     Tag;
-    U8      LogicalUnitNumber[8];
-    U32     DataLength;
+    U8      L_QType;                                    /* 00h */
+    U8      Reserved;                                   /* 01h */
+    U16     Tag;                                        /* 02h */
+    U8      LogicalUnitNumber[8];                       /* 04h */
+    U32     DataLength;                                 /* 0Ch */
     /* SPI command informatioi unit */
-    U8      ReservedFirstByteOfCommandIU;
-    U8      TaskAttribute;
-    U8      TaskManagementFlags;
-    U8      AdditioialCDBLength;
-    U8      CDB[16];
+    U8      ReservedFirstByteOfCommandIU;               /* 10h */
+    U8      TaskAttribute;                              /* 11h */
+    U8      TaskManagementFlags;                        /* 12h */
+    U8      AdditioialCDBLength;                        /* 13h */
+    U8      CDB[16];                                    /* 14h */
 } MPI_TARGET_SCSI_SPI_CMD_BUFFER,
   MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_CMD_BUFFER,
   MpiTargetScsiSpiCmdBuffer, MPI_POINTER pMpiTargetScsiSpiCmdBuffer;
@@ -172,19 +173,19 @@
 
 typedef s ruct _MSG_TARGET_ASSIST_REQUEST
 {
-    U8                      S  tusCode;
-    U8                      TargetAssistFlags;
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U16                     QueueTag;
-    U8                      Reserved;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U32                     ReplyWord;
-    U8                      LUN[8];
-    U32                     RelativeOffset;
-    U32                     DataLength;
-    SGE_IO_UNION            SGL[1];
+    U8                      S  tusCode;                 /* 00h */
+    U8                      TargetAssistFlags;          /* 01h */
+    U8                      ChainOffset;                /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U16                     QueueTag;                   /* 04h */
+    U8                      Reserved;                   /* 06h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U32                     ReplyWord;                  /* 0Ch */
+    U8                      LUN[8];                     /* 10h */
+    U32                     RelativeOffset;             /* 18h */
+    U32                     DataLength;                 /* 1Ch */
+    SGE_IO_UNION            SGL[1];                     /* 20h */
 } MSG_TARGET_ASSIST_REQUEST, MPI_POINTER PTR_MSG_TARGET_ASSIST_REQUEST,
   TargetAssistRequest_t, MPI_POINTER pTargetAssistRequest_t;
 
@@ -196,18 +197,18 @@
 
 typedef s ruct _MSG_TARGET_ERROR_REPLY
 {
-    U16                     Reserved;
-    U8                      MsgLength;
-    U8                      Functioi;
-    U16                     Reserved1;
-    U8                      Reserved2;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U16                     Reserved3;
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
-    U32                     ReplyWord;
-    U32                     TransferCount;
+    U16                     Reserved;                   /* 00h */
+    U8                      MsgLength;                  /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U16                     Reserved1;                  /* 04h */
+    U8                      Reserved2;                  /* 06h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U16                     Reserved3;                  /* 0Ch */
+    U16                     IOCS  tus;                  /* 0Eh */
+    U32                     IOCLogInfo;                 /* 10h */
+    U32                     ReplyWord;                  /* 14h */
+    U32                     TransferCount;              /* 18h */
 } MSG_TARGET_ERROR_REPLY, MPI_POINTER PTR_MSG_TARGET_ERROR_REPLY,
   TargetErrorReply_t, MPI_POINTER pTargetErrorReply_t;
 
@@ -218,17 +219,17 @@
 
 typedef s ruct _MSG_TARGET_STATUS_SEND_REQUEST
 {
-    U8                      S  tusCode;
-    U8                      S  tusFlags;
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U16                     QueueTag;
-    U8                      Reserved;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U32                     ReplyWord;
-    U8                      LUN[8];
-    SGE_SIMPLE_UNION        S  tusDataSGE;
+    U8                      S  tusCode;                 /* 00h */
+    U8                      S  tusFlags;                /* 01h */
+    U8                      ChainOffset;                /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U16                     QueueTag;                   /* 04h */
+    U8                      Reserved;                   /* 06h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U32                     ReplyWord;                  /* 0Ch */
+    U8                      LUN[8];                     /* 10h */
+    SGE_SIMPLE_UNION        S  tusDataSGE;              /* 18h */
 } MSG_TARGET_STATUS_SEND_REQUEST, MPI_POINTER PTR_MSG_TARGET_STATUS_SEND_REQUEST,
   TargetS  tusSendRequest_t, MPI_POINTER pTargetS  tusSendRequest_t;
 
@@ -242,16 +243,16 @@
 
 typedef s ruct _MSG_TARGET_MODE_ABORT_REQUEST
 {
-    U8                      AbortType;
-    U8                      Reserved;
-    U8                      ChainOffset;
-    U8                      Functioi;
-    U16                     Reserved1;
-    U8                      Reserved2;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U32                     ReplyWord;
-    U32                     MsgContextToAbort;
+    U8                      AbortType;                  /* 00h */
+    U8                      Reserved;                   /* 01h */
+    U8                      ChainOffset;                /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U16                     Reserved1;                  /* 04h */
+    U8                      Reserved2;                  /* 06h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U32                     ReplyWord;                  /* 0Ch */
+    U32                     MsgContextToAbort;          /* 10h */
 } MSG_TARGET_MODE_ABORT, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT,
   TargetModeAbort_t, MPI_POINTER pTargetModeAbort_t;
 
@@ -264,17 +265,17 @@
 
 typedef s ruct _MSG_TARGET_MODE_ABORT_REPLY
 {
-    U16                     Reserved;
-    U8                      MsgLength;
-    U8                      Functioi;
-    U16                     Reserved1;
-    U8                      Reserved2;
-    U8                      MsgFlags;
-    U32                     MsgContext;
-    U16                     Reserved3;
-    U16                     IOCS  tus;
-    U32                     IOCLogInfo;
-    U32                     AbortCount;
+    U16                     Reserved;                   /* 00h */
+    U8                      MsgLength;                  /* 02h */
+    U8                      Functioi;                   /* 03h */
+    U16                     Reserved1;                  /* 04h */
+    U8                      Reserved2;                  /* 06h */
+    U8                      MsgFlags;                   /* 07h */
+    U32                     MsgContext;                 /* 08h */
+    U16                     Reserved3;                  /* 0Ch */
+    U16                     IOCS  tus;                  /* 0Eh */
+    U32                     IOCLogInfo;                 /* 10h */
+    U32                     AbortCount;                 /* 14h */
 } MSG_TARGET_MODE_ABORT_REPLY, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT_REPLY,
   TargetModeAbortReply_t, MPI_POINTER pTargetModeAbortReply_t;
 
diff -u --recursive --new-file v2.4.9/linux/drivers/message/fusioi/mptbase.c linux/drivers/message/fusioi/mptbase.c
--- v2.4.9/linux/drivers/message/fusioi/mptbase.c	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/mptbase.c	Fri Sep  7 09:28:38 2001
@@ -42,7 +42,7 @@
  *  Originally By: S even J. Ralston
  *  (mailto:S eve.Ralston@lsil.com)
  *
- *  $Id: mptbase.c,v 1.47 2001/03/22 10:32:23 sralston Exp $
+ *  $Id: mptbase.c,v 1.53.4.1 2001/08/24 20:07:05 sralston Exp $
  */
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
@@ -130,6 +130,8 @@
 const char **mpt_ScsiOpcodesPtr = NULL;
 int mpt_ASCQ_TableSz = 0;
 
+#define WHOINIT_UNKNOWN		0xAA
+
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
  *  Private data...
@@ -143,6 +145,8 @@
 s  tic int	 		 MptDriverClass[MPT_MAX_PROTOCOL_DRIVERS];
 					/* Event handler lookup table */
 s  tic MPT_EVHANDLER		 MptEvHandlers[MPT_MAX_PROTOCOL_DRIVERS];
+					/* Reset handler lookup table */
+s  tic MPT_RESETHANDLER		 MptResetHandlers[MPT_MAX_PROTOCOL_DRIVERS];
 
 s  tic int	FusioiInitCalled = 0;
 s  tic int	mpt_base_index = -1;
@@ -154,25 +158,27 @@
 s  tic void	mpt_interrupt(int irq, void *bus_id, s ruct pt_regs *r);
 s  tic int	mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply);
 
+s  tic int 	mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reasoi);
 s  tic int 	mpt_adapter_ins  ll(s ruct pci_dev *pdev);
 s  tic void	mpt_detect_929_bound_ports(MPT_ADAPTER *this, s ruct pci_dev *pdev);
-s  tic void	mpt_adapter_disable(MPT_ADAPTER *ioc);
+s  tic void	mpt_adapter_disable(MPT_ADAPTER *ioc, int freeup);
 s  tic void	mpt_adapter_dispose(MPT_ADAPTER *ioc);
 
 s  tic void	MptDisplayIocCapabilities(MPT_ADAPTER *ioc);
+s  tic int	MakeIocReady(MPT_ADAPTER *ioc, int force);
 s  tic u32	GetIocS  te(MPT_ADAPTER *ioc, int cooked);
 s  tic int	GetIocFacts(MPT_ADAPTER *ioc);
-s  tic int	GetPortFacts(MPT_ADAPTER *ioc);
+s  tic int	GetPortFacts(MPT_ADAPTER *ioc, int portnum);
 s  tic int	SendIocInit(MPT_ADAPTER *ioc);
 s  tic int	SendPortEnable(MPT_ADAPTER *ioc, int portnum);
-s  tic int	mpt_fc9x9_reset(MPT_ADAPTER *ioc);
-s  tic int	KickS  rt(MPT_ADAPTER *ioc);
+s  tic int	mpt_fc9x9_reset(MPT_ADAPTER *ioc, int ignore);
+s  tic int	KickS  rt(MPT_ADAPTER *ioc, int ignore);
 s  tic int	SendIocReset(MPT_ADAPTER *ioc, u8 reset_type);
 s  tic int	PrimeIocFifos(MPT_ADAPTER *ioc);
-s  tic int	HandShakeReqAndReply(MPT_ADAPTER *ioc, int reqBytes, u32 *req, int replyBytes, u16 *u16reply);
-s  tic int	WaitForDoorbellAck(MPT_ADAPTER *ioc);
-s  tic int	WaitForDoorbellInt(MPT_ADAPTER *ioc);
-s  tic int	WaitForDoorbellReply(MPT_ADAPTER *ioc);
+s  tic int	HandShakeReqAndReply(MPT_ADAPTER *ioc, int reqBytes, u32 *req, int replyBytes, u16 *u16reply, int maxwait);
+s  tic int	WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong);
+s  tic int	WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong);
+s  tic int	WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong);
 s  tic int	GetLanConfigPages(MPT_ADAPTER *ioc);
 s  tic int	SendEventNotificatioi(MPT_ADAPTER *ioc, u8 EvSwitch);
 s  tic int	SendEventAck(MPT_ADAPTER *ioc, EventNotificatioiReply_t *evnp);
@@ -192,6 +198,7 @@
 s  tic s ruct proc_dir_entry	*procmpt_root_dir = NULL;
 
 int		fusioi_init(void);
+s  tic void	fusioi_exit(void);
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /* 20000207 -sralston
@@ -586,6 +593,45 @@
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
+ *	mpt_reset_register - Register protocol-specific IOC reset handler.
+ *	@cb_idx: previously registered (via mpt_register) c llback handle
+ *	@reset_func: reset functioi
+ *
+ *	This routine can be c lled by one or more protocol-specific drivers
+ *	if/when they choose to be notified of IOC resets.
+ *
+ *	Returns 0 for success.
+ */
+int
+mpt_reset_register(int cb_idx, MPT_RESETHANDLER reset_func)
+{
+	if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS)
+		return -1;
+
+	MptResetHandlers[cb_idx] = reset_func;
+	return 0;
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/**
+ *	mpt_reset_deregister - Deregister protocol-specific IOC reset handler.
+ *	@cb_idx: previously registered c llback handle
+ *
+ *	Each protocol-specific driver should c ll this routine
+ *	when it does not (or can no longer) handle IOC reset handling,
+ *	or when it's module is unloaded.
+ */
+void
+mpt_reset_deregister(int cb_idx)
+{
+	if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS)
+		return;
+
+	MptResetHandlers[cb_idx] = NULL;
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/**
  *	mpt_get_msg_frame - Obtain a MPT request frame from the pool (of 1024)
  *	 llocated per MPT adapter.
  *	@handle: Handle of registered MPT protocol driver
@@ -723,13 +769,29 @@
 
 	iocp = mpt_adapters[iocid];
 	if (iocp != NULL) {
-		u8 *req_as_bytes;
-		int i;
+		u8		*req_as_bytes;
+		u32		 ioc_raw_s  te;
+		int		 i;
+
+		/* YIKES!  We already know something is amiss.
+		 * Do upfront check on IOC s  te.
+		 */
+		ioc_raw_s  te = GetIocS  te(iocp, 0);
+		if ((ioc_raw_s  te & MPI_DOORBELL_ACTIVE) ||
+		    ((ioc_raw_s  te & MPI_IOC_STATE_MASK) != MPI_IOC_STATE_OPERATIONAL)) {
+			printk(KERN_WARNING MYNAM ": %s: Bad IOC s  te (%08x) WARNING!\n",
+					iocp->name, ioc_raw_s  te);
+			if ((r = mpt_do_ioc_recovery(iocp, MPT_HOSTEVENT_IOC_RECOVER)) != 0) {
+				printk(KERN_WARNING MYNAM ": WARNING - (%d) Cannot recover %s\n",
+						r, iocp->name);
+				return r;
+			}
+		}
 
 		/*
-		 *  Emul te what mpt_put_msg_frame() does /wrt to sanity
-		 *  setting cb_idx/req_idx.  But ONLY if this request
-		 *  is in proper (pre- lloc'd) request buffer range...
+		 * Emul te what mpt_put_msg_frame() does /wrt to sanity
+		 * setting cb_idx/req_idx.  But ONLY if this request
+		 * is in proper (pre- lloc'd) request buffer range...
 		 */
 		i = MFPTR_2_MPT_INDEX(iocp,(MPT_FRAME_HDR*)req);
 		if (reqBytes >= 12 && i >= 0 && i < iocp->req_depth) {
@@ -738,17 +800,15 @@
 			mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle;
 		}
 
-		/*  Make sure there are no doorbells  */
+		/* Make sure there are no doorbells */
 		CHIPREG_WRITE32(&iocp->chip->IntS  tus, 0);
 
 		CHIPREG_WRITE32(&iocp->chip->Doorbell,
 				((MPI_FUNCTION_HANDSHAKE<<MPI_DOORBELL_FUNCTION_SHIFT) |
 				 ((reqBytes/4)<<MPI_DOORBELL_ADD_DWORDS_SHIFT)));
 
-		/*  Wait for IOC doorbell int  */
-		if ((i = WaitForDoorbellInt(iocp)) < 0) {
-			/* FIXME! Recovery actioi(s)? */
-			/*i = unresponsive_ioc(i);*/
+		/* Wait for IOC doorbell int */
+		if ((i = WaitForDoorbellInt(iocp, 2)) < 0) {
 			return i;
 		}
 
@@ -757,10 +817,11 @@
 
 		CHIPREG_WRITE32(&iocp->chip->IntS  tus, 0);
 
-		if ((r = WaitForDoorbellAck(iocp)) < 0)
+		if ((r = WaitForDoorbellAck(iocp, 1)) < 0) {
 			return -2;
+		}
 
-		/*  Send request via doorbell handshake  */
+		/* Send request via doorbell handshake */
 		req_as_bytes = (u8 *) req;
 		for (i = 0; i < reqBytes/4; i++) {
 			u32 word;
@@ -770,15 +831,19 @@
 				(req_as_bytes[(i*4) + 2] << 16) |
 				(req_as_bytes[(i*4) + 3] << 24));
 			CHIPREG_WRITE32(&iocp->chip->Doorbell, word);
-			if ((r = WaitForDoorbellAck(iocp)) < 0) {
+			if ((r = WaitForDoorbellAck(iocp, 1)) < 0) {
 				r = -3;
 				break;
 			}
 		}
 
-		/*  Make sure there are no doorbells  */
-		CHIPREG_WRITE32(&iocp->chip->IntS  tus, 0);
+		if ((r = WaitForDoorbellInt(iocp, 2)) >= 0)
+			r = 0;
+		else
+			r = -4;
 
+		/* Make sure there are no doorbells */
+		CHIPREG_WRITE32(&iocp->chip->IntS  tus, 0);
 	}
 
 	return r;
@@ -849,9 +914,8 @@
 
 		if ((pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC909) &&
 		    (pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC929) &&
-#if 0
-		    /* FIXME! FC919 */
 		    (pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC919) &&
+#if 0
 		    /* FIXME! C103x family */
 		    (pdev->device != MPI_MANUFACTPAGE_DEVID_53C1030) &&
 		    (pdev->device != MPI_MANUFACTPAGE_DEVID_53C1030_ZC) &&
@@ -897,8 +961,10 @@
 	printk(KERN_INFO MYNAM ": %d MPT adapter%s found, %d ins  lled.\n",
 		 found, (found==1) ? "" : "s", count);
 
-	if (count == 0)
+	if (!found || !count) {
+		fusioi_exit();
 		return -ENODEV;
+	}
 
 #ifdef CONFIG_PROC_FS
 	if (procmpt_create() != 0)
@@ -962,12 +1028,9 @@
 	unsigned long	 port;
 	u32		 msize;
 	u32		 psize;
-	u32		 ioc_s  te;
 	int		 i;
 	int		 r = -ENODEV;
-	int 		 cntdn;
 	int		 len;
-	int		 s  tefault = 0;
 
 	ioc = km lloc(sizeof(MPT_ADAPTER), GFP_KERNEL);
 	if (ioc == NULL) {
@@ -980,7 +1043,7 @@
 
 	ioc->pcidev = pdev;
 
-	/*  Find lookup slot.  GRRRR...  */
+	/* Find lookup slot. */
 	for (i=0; i < MPT_MAX_ADAPTERS; i++) {
 		if (mpt_adapters[i] == NULL) {
 			ioc->id = i;		/* Assign adapter unique id (lookup) */
@@ -997,11 +1060,11 @@
 	port = psize = 0;
 	for (i=0; i < DEVICE_COUNT_RESOURCE; i++) {
 		if (pdev->PCI_BASEADDR_FLAGS(i) & PCI_BASE_ADDRESS_SPACE_IO) {
-			/*  Get I/O space!  */
+			/* Get I/O space! */
 			port = pdev->PCI_BASEADDR_START(i);
 			psize = PCI_BASEADDR_SIZE(pdev,i);
 		} else {
-			/*  Get memmap  */
+			/* Get memmap */
 			mem_phys = pdev->PCI_BASEADDR_START(i);
 			msize = PCI_BASEADDR_SIZE(pdev,i);
 			break;
@@ -1021,7 +1084,7 @@
 
 	mem = NULL;
 	if (! PortIo) {
-		/*  Get logical ptr for PciMem0 space  */
+		/* Get logical ptr for PciMem0 space */
 		/*mem = ioremap(mem_phys, msize);*/
 		mem = ioremap(mem_phys, 0x100);
 		if (mem == NULL) {
@@ -1051,11 +1114,11 @@
 		ioc->chip_type = FC929;
 		ioc->prod_name = "LSIFC929";
 	}
-#if 0
 	else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC919) {
-		ioc->chip_type = C1030;
+		ioc->chip_type = FC919;
 		ioc->prod_name = "LSIFC919";
 	}
+#if 0
 	else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_53C1030) {
 		ioc->chip_type = C1030;
 		ioc->prod_name = "LSI53C1030";
@@ -1070,10 +1133,10 @@
 	Q_INIT(&ioc->FreeQ, MPT_FRAME_HDR);
 	spin_lock_init(&ioc->FreeQlock);
 
-	/*  Disable  ll!  */
+	/* Disable  ll! */
 	CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF);
-	CHIPREG_WRITE32(&ioc->chip->IntS  tus, 0);
 	ioc->active = 0;
+	CHIPREG_WRITE32(&ioc->chip->IntS  tus, 0);
 
 	ioc->pci_irq = -1;
 	if (pdev->irq) {
@@ -1094,7 +1157,7 @@
 		dprintk((KERN_INFO MYNAM ": %s ins  lled at interrupt %d\n", ioc->name, pdev->irq));
 	}
 
-	/*  tack onto tail of our MPT adapter list  */
+	/* tack onto tail of our MPT adapter list */
 	Q_ADD_TAIL(&MptAdapters, ioc, MPT_ADAPTER);
 
 	/* Set lookup ptr. */
@@ -1106,115 +1169,168 @@
 	if (ioc->chip_type == FC929)
 		mpt_detect_929_bound_ports(ioc, pdev);
 
-	/*  Get current [raw] IOC s  te  */
-	ioc_s  te = GetIocS  te(ioc, 0);
-	dhsprintk((KERN_INFO MYNAM ": %s initial [raw] s  te=%08x\n", ioc->name, ioc_s  te));
+	if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP)) != 0) {
+		printk(KERN_WARNING MYNAM ": WARNING - %s did not initialize properly! (%d)\n",
+				ioc->name, r);
+	}
 
-	/*
-	 *  Check to see if IOC got left/stuck in doorbell handshake
-	 *  grip of death.  If so, hard reset the IOC.
-	 */
-	if (ioc_s  te & MPI_DOORBELL_ACTIVE) {
-		s  tefault = 1;
-		printk(KERN_WARNING MYNAM ": %s: Uh-oh, unexpected doorbell active!\n",
+	return r;
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/**
+ *	mpt_do_ioc_recovery - Initialize or recover MPT adapter.
+ *	@ioc: Pointer to MPT adapter s ructure
+ *	@reasoi: Event word / reasoi
+ *
+ *	This routine performs  ll the steps necessary to bring the IOC
+ *	to a OPERATIONAL s  te.
+ *
+ *	This routine also pre-fetches the LAN MAC address of a Fibre Channel
+ *	MPT adapter.
+ *
+ *	Returns 0 for success.
+ */
+s  tic int
+mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reasoi)
+{
+	int	 hard_reset_done = 0;
+	int	 alt_ioc_ready = 0;
+	int	 hard;
+	int	 r;
+	int	 i;
+	int	 handlers;
+
+	printk(KERN_INFO MYNAM ": Initiating %s %s\n",
+			ioc->name, reasoi==MPT_HOSTEVENT_IOC_BRINGUP ? "bringup" : "recovery");
+
+	/* Disable reply interrupts */
+	CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF);
+	ioc->active = 0;
+	/* NOTE: Access to IOC's request FreeQ is now blocked! */
+
+// FIXME? Cleanup  ll IOC requests here! (or below?)
+// But watch out for event associated request?
+
+	hard = HardReset;
+	if (ioc->alt_ioc && (reasoi == MPT_HOSTEVENT_IOC_BRINGUP))
+		hard = 0;
+
+	if ((hard_reset_done = MakeIocReady(ioc, hard)) < 0) {
+		printk(KERN_WARNING MYNAM ": %s NOT READY WARNING!\n",
 				ioc->name);
+		return -1;
 	}
 
-	/*
-	 *  Check to see if IOC is in FAULT s  te.
-	 *  If so, hard reset the IOC.
-	 */
-	if ((ioc_s  te & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_FAULT) {
-		s  tefault = 2;
-		printk(KERN_WARNING MYNAM ": %s: Uh-oh, IOC is in FAULT s  te!!!\n",
-				ioc->name);
-		printk(KERN_WARNING "           FAULT code = %04xh\n",
-				ioc_s  te & MPI_DOORBELL_DATA_MASK);
+// NEW!
+#if 0						// Kiss-of-death!?!
+	if (ioc->alt_ioc) {
+// Grrr... Hold off any alt-IOC interrupts (and events) while
+// handshaking to <this> IOC, needed because?
+		/* Disable  lt-IOC's reply interrupts for a bit ... */
+		alt_ioc_intmask = CHIPREG_READ32(&ioc->alt_ioc->chip->IntMask);
+		CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, 0xFFFFFFFF);
+		ioc->alt_ioc->active = 0;
+		/* NOTE: Access to  lt-IOC's request FreeQ is now blocked! */
 	}
+#endif
 
-	if (HardReset || s  tefault) {
-		if ((r = KickS  rt(ioc)) != 0) {
-			r = -ENODEV;
-			goto ioc_up_fail;
-		}
+	if (hard_reset_done && ioc->alt_ioc) {
+		if ((r = MakeIocReady(ioc->alt_ioc, 0)) == 0)
+			alt_ioc_ready = 1;
+		else
+			printk(KERN_WARNING MYNAM ":  lt-%s: (%d) Not ready WARNING!\n",
+					ioc->alt_ioc->name, r);
+	}
+
+	if (reasoi == MPT_HOSTEVENT_IOC_BRINGUP) {
+		/* Get IOC facts! */
+		if ((r = GetIocFacts(ioc)) != 0)
+			return -2;
+		MptDisplayIocCapabilities(ioc);
 	}
 
 	/*
-	 *  Loop here waiting for IOC to come READY.
-	 */
-	i = 0;
-	cntdn = HZ * 10;
-	while ((ioc_s  te = GetIocS  te(ioc, 1)) != MPI_IOC_STATE_READY) {
-		if (ioc_s  te == MPI_IOC_STATE_OPERATIONAL) {
-			/*
-			 *  BIOS or previous driver load left IOC in OP s  te.
-			 *  Reset messaging FIFOs.
-			 */
-			dprintk((KERN_WARNING MYNAM ": %s: Sending IOC msg unit reset!\n", ioc->name));
-			if ((r = SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET)) != 0) {
-				printk(KERN_ERR MYNAM ": %s: ERROR - IOC msg unit reset failed!\n", ioc->name);
-				r = -ENODEV;
-				goto ioc_up_fail;
-			}
-		} else if (ioc_s  te == MPI_IOC_STATE_RESET) {
-			/*
-			 *  Something is wrong.  Try to get IOC back
-			 *  to a known s  te.
-			 */
-			dprintk((KERN_WARNING MYNAM ": %s: Sending IO unit reset!\n", ioc->name));
-			if ((r = SendIocReset(ioc, MPI_FUNCTION_IO_UNIT_RESET)) != 0) {
-				printk(KERN_ERR MYNAM ": %s: ERROR - IO unit reset failed!\n", ioc->name);
-				r = -ENODEV;
-				goto ioc_up_fail;
+	 * Call each currently registered protocol IOC reset handler
+	 * with pre-reset indicatioi.
+	 * NOTE: If we're doing _IOC_BRINGUP, there can be no
+	 * MptResetHandlers[] registered yet.
+	 */
+	if (hard_reset_done) {
+		r = handlers = 0;
+		for (i=MPT_MAX_PROTOCOL_DRIVERS-1; i; i--) {
+			if (MptResetHandlers[i]) {
+				dprintk((KERN_INFO MYNAM ": %s: Calling IOC pre_reset handler #%d\n",
+						ioc->name, i));
+				r += (*(MptResetHandlers[i]))(ioc, MPT_IOC_PRE_RESET);
+				handlers++;
+
+				if (alt_ioc_ready) {
+					dprintk((KERN_INFO MYNAM ": %s: Calling alt-IOC pre_reset handler #%d\n",
+							ioc->alt_ioc->name, i));
+					r += (*(MptResetHandlers[i]))(ioc->alt_ioc, MPT_IOC_PRE_RESET);
+					handlers++;
+				}
 			}
 		}
+		/* FIXME?  Examine results here? */
+	}
 
-		i++; cntdn--;
-		if (!cntdn) {
-			printk(KERN_ERR MYNAM ": %s: ERROR - Wait IOC_READY s  te timeout(%d)!\n",
-					ioc->name, (i+5)/HZ);
-			r = -ETIME;
-			goto ioc_up_fail;
-		}
+	// May need to check/upload firmware & data here!
 
-		current->s  te = TASK_INTERRUPTIBLE;
-		schedule_timeout(1);
+	if ((r = SendIocInit(ioc)) != 0)
+		return -3;
+// NEW!
+	if (alt_ioc_ready) {
+		if ((r = SendIocInit(ioc->alt_ioc)) != 0) {
+			alt_ioc_ready = 0;
+			printk(KERN_WARNING MYNAM ":  lt-%s: (%d) init failure WARNING!\n",
+					ioc->alt_ioc->name, r);
+		}
 	}
 
-	if (s  tefault) {
-		printk(KERN_WARNING MYNAM ": %s: Whew!  Recovered from %s\n",
-				ioc->name, s  tefault==1 ? "stuck handshake" : "IOC FAULT");
+	/*
+	 * Call each currently registered protocol IOC reset handler
+	 * with post-reset indicatioi.
+	 * NOTE: If we're doing _IOC_BRINGUP, there can be no
+	 * MptResetHandlers[] registered yet.
+	 */
+	if (hard_reset_done) {
+		r = handlers = 0;
+		for (i=MPT_MAX_PROTOCOL_DRIVERS-1; i; i--) {
+			if (MptResetHandlers[i]) {
+				dprintk((KERN_INFO MYNAM ": %s: Calling IOC post_reset handler #%d\n",
+						ioc->name, i));
+				r += (*(MptResetHandlers[i]))(ioc, MPT_IOC_POST_RESET);
+				handlers++;
+
+				if (alt_ioc_ready) {
+					dprintk((KERN_INFO MYNAM ": %s: Calling alt-IOC post_reset handler #%d\n",
+							ioc->alt_ioc->name, i));
+					r += (*(MptResetHandlers[i]))(ioc->alt_ioc, MPT_IOC_POST_RESET);
+					handlers++;
+				}
+			}
+		}
+		/* FIXME?  Examine results here? */
 	}
 
-	/*  Enable! (reply interrupt)  */
-	CHIPREG_WRITE32(&ioc->chip->IntMask, ~(MPI_HIM_RIM));
-	ioc->active = 1;
-
-	/*  Get IOC facts! (first time, ioc->facts0 and ioc->pfacts0)  */
-	if ((r = GetIocFacts(ioc)) != 0)
-		goto ioc_up_fail;
-
-	/* Does IocFacts.EventS  te need any looking at / attentioi here? */
-
-	if ((r = SendIocInit(ioc)) != 0)
-		goto ioc_up_fail;
-
 	/*
-	 *  Prime reply & request queues!
-	 *  (mucho  lloc's)
+	 * Prime reply & request queues!
+	 * (mucho  lloc's)
 	 */
 	if ((r = PrimeIocFifos(ioc)) != 0)
-		goto ioc_up_fail;
-
-	/*  Get IOC facts again! (2nd time, ioc->factsN and ioc->pfactsN)  */
-	if ((r = GetIocFacts(ioc)) != 0)
-		goto ioc_up_fail;
-
-	/* Does IocFacts.EventS  te need any looking at / attentioi here? */
+		return -4;
+// NEW!
+	if (alt_ioc_ready && ((r = PrimeIocFifos(ioc->alt_ioc)) != 0)) {
+		printk(KERN_WARNING MYNAM ":  lt-%s: (%d) FIFO mgmt  lloc WARNING!\n",
+				ioc->alt_ioc->name, r);
+	}
 
-	MptDisplayIocCapabilities(ioc);
+// FIXME! Cleanup  ll IOC (and alt-IOC?) requests here!
 
-	if (ioc->pfacts0.ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) {
+	if ((ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) &&
+	    (ioc->lan_cnfg_page0.Header.PageLength == 0)) {
 		/*
 		 *  Pre-fetch the ports LAN MAC address!
 		 *  (LANPage1_t s uff)
@@ -1229,19 +1345,34 @@
 #endif
 	}
 
+	/* Enable! (reply interrupt) */
+	CHIPREG_WRITE32(&ioc->chip->IntMask, ~(MPI_HIM_RIM));
+	ioc->active = 1;
+
+// NEW!
+#if 0						// Kiss-of-death!?!
+	if (alt_ioc_ready && (r==0)) {
+		/* (re)Enable alt-IOC! (reply interrupt) */
+		dprintk((KERN_INFO MYNAM ":  lt-%s reply irq re-enabled\n",
+				ioc->alt_ioc->name));
+		CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, ~(MPI_HIM_RIM));
+		ioc->alt_ioc->active = 1;
+	}
+#endif
+
 	/* NEW!  20010120 -sralston
 	 *  Enable MPT base driver management of EventNotificatioi
 	 *  and EventAck handling.
 	 */
-	(void) SendEventNotificatioi(ioc, 1);	/* 1=Enable EventNotificatioi */
+	if (!ioc->facts.EventS  te)
+		(void) SendEventNotificatioi(ioc, 1);	/* 1=Enable EventNotificatioi */
+// NEW!
+// FIXME!?!
+//	if (ioc->alt_ioc && alt_ioc_ready && !ioc->alt_ioc->facts.EventS  te) {
+//		(void) SendEventNotificatioi(ioc->alt_ioc, 1);	/* 1=Enable EventNotificatioi */
+//	}
 
 	return 0;
-
-ioc_up_fail:
-	//Q_DEL_ITEM(ioc);
-	//mpt_adapter_dispose(ioc);
-	mpt_adapter_disable(ioc);
-	return r;
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1297,20 +1428,25 @@
 /*
  *	mpt_adapter_disable - Disable misbehaving MPT adapter.
  *	@this: Pointer to MPT adapter s ructure
+ *	@free: Free up  lloc'd reply, request, etc.
  */
 s  tic void
-mpt_adapter_disable(MPT_ADAPTER *this)
+mpt_adapter_disable(MPT_ADAPTER *this, int freeup)
 {
 	if (this != NULL) {
 		int sz;
 
+		/* Disable the FW */
+		if (SendIocReset(this, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET) != 0)
+			(void) KickS  rt(this, 1);
+
 		/* Disable  dapter interrupts! */
 		CHIPREG_WRITE32(&this->chip->IntMask, 0xFFFFFFFF);
+		this->active = 0;
 		/* Clear any lingering interrupt */
 		CHIPREG_WRITE32(&this->chip->IntS  tus, 0);
-		this->active = 0;
 
-		if (this->reply_ lloc != NULL) {
+		if (freeup && this->reply_ lloc != NULL) {
 			sz = (this->reply_sz * this->reply_depth) + 128;
 			pci_free_consistent(this->pcidev, sz,
 					this->reply_ lloc, this->reply_ lloc_dma);
@@ -1319,7 +1455,7 @@
 			this->alloc_total -= sz;
 		}
 
-		if (this->req_ lloc != NULL) {
+		if (freeup && this->req_ lloc != NULL) {
 			sz = (this->req_sz * this->req_depth) + 128;
 			/*
 			 *  Rounding UP to nearest 4-kB boundary here...
@@ -1332,7 +1468,7 @@
 			this->alloc_total -= sz;
 		}
 
-		if (this->sense_buf_pool != NULL) {
+		if (freeup && this->sense_buf_pool != NULL) {
 			sz = (this->req_depth * 256);
 			pci_free_consistent(this->pcidev, sz,
 					this->sense_buf_pool, this->sense_buf_pool_dma);
@@ -1359,7 +1495,7 @@
 
 		sz_first = this->alloc_total;
 
-		mpt_adapter_disable(this);
+		mpt_adapter_disable(this, 1);
 
 		if (this->pci_irq != -1) {
 			free_irq(this->pci_irq, this);
@@ -1401,17 +1537,17 @@
 		printk("%s: ", ioc->prod_name+3);
 	printk("Capabilities={");
 
-	if (ioc->pfacts0.ProtocolFlags & MPI_PORTFACTS_PROTOCOL_INITIATOR) {
+	if (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_INITIATOR) {
 		printk("Initiator");
 		i++;
 	}
 
-	if (ioc->pfacts0.ProtocolFlags & MPI_PORTFACTS_PROTOCOL_TARGET) {
+	if (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_TARGET) {
 		printk("%sTarget", i ? "," : "");
 		i++;
 	}
 
-	if (ioc->pfacts0.ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) {
+	if (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) {
 		printk("%sLAN", i ? "," : "");
 		i++;
 	}
@@ -1420,7 +1556,7 @@
 	/*
 	 *  This would probably evoke more questiois than it's worth
 	 */
-	if (ioc->pfacts0.ProtocolFlags & MPI_PORTFACTS_PROTOCOL_TARGET) {
+	if (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_TARGET) {
 		printk("%sLogBusAddr", i ? "," : "");
 		i++;
 	}
@@ -1431,6 +1567,113 @@
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
+ *	MakeIocReady - Get IOC to a READY s  te, using KickS  rt if needed.
+ *	@ioc: Pointer to MPT_ADAPTER s ructure
+ *	@kick: Force hard KickS  rt of IOC
+ *
+ *	Returns 0 for already-READY, 1 for hard reset success,
+ *	else negative for failure.
+ */
+s  tic int
+MakeIocReady(MPT_ADAPTER *ioc, int force)
+{
+	u32	 ioc_s  te;
+	int	 s  tefault = 0;
+	int 	 cntdn;
+	int	 hard_reset_done = 0;
+	int	 r;
+	int	 i;
+
+	/* Get current [raw] IOC s  te  */
+	ioc_s  te = GetIocS  te(ioc, 0);
+	dhsprintk((KERN_INFO MYNAM "::MakeIocReady, %s [raw] s  te=%08x\n", ioc->name, ioc_s  te));
+
+	/*
+	 *	Check to see if IOC got left/stuck in doorbell handshake
+	 *	grip of death.  If so, hard reset the IOC.
+	 */
+	if (ioc_s  te & MPI_DOORBELL_ACTIVE) {
+		s  tefault = 1;
+		printk(KERN_WARNING MYNAM ": %s: Uh-oh, unexpected doorbell active!\n",
+				ioc->name);
+	}
+
+	/* Is it already READY? */
+	if (!s  tefault && (ioc_s  te & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_READY)
+		return 0;
+
+	/*
+	 *	Check to see if IOC is in FAULT s  te.
+	 */
+	if ((ioc_s  te & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_FAULT) {
+		s  tefault = 2;
+		printk(KERN_WARNING MYNAM ": %s: Uh-oh, IOC is in FAULT s  te!!!\n",
+				ioc->name);
+		printk(KERN_WARNING "           FAULT code = %04xh\n",
+				ioc_s  te & MPI_DOORBELL_DATA_MASK);
+	}
+
+	/*
+	 *	Hmmm...  Did it get left operatioial?
+	 */
+	if ((ioc_s  te & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_OPERATIONAL) {
+		s  tefault = 3;
+		dprintk((KERN_WARNING MYNAM ": %s: Hmmm... IOC operatioial unexpected\n",
+				ioc->name));
+	}
+
+	hard_reset_done = KickS  rt(ioc, s  tefault||force);
+	if (hard_reset_done < 0)
+		return -1;
+
+	/*
+	 *  Loop here waiting for IOC to come READY.
+	 */
+	i = 0;
+	cntdn = HZ * 15;
+	while ((ioc_s  te = GetIocS  te(ioc, 1)) != MPI_IOC_STATE_READY) {
+		if (ioc_s  te == MPI_IOC_STATE_OPERATIONAL) {
+			/*
+			 *  BIOS or previous driver load left IOC in OP s  te.
+			 *  Reset messaging FIFOs.
+			 */
+			if ((r = SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET)) != 0) {
+				printk(KERN_ERR MYNAM ": %s: ERROR - IOC msg unit reset failed!\n", ioc->name);
+				return -2;
+			}
+		} else if (ioc_s  te == MPI_IOC_STATE_RESET) {
+			/*
+			 *  Something is wrong.  Try to get IOC back
+			 *  to a known s  te.
+			 */
+			if ((r = SendIocReset(ioc, MPI_FUNCTION_IO_UNIT_RESET)) != 0) {
+				printk(KERN_ERR MYNAM ": %s: ERROR - IO unit reset failed!\n", ioc->name);
+				return -3;
+			}
+		}
+
+		i++; cntdn--;
+		if (!cntdn) {
+			printk(KERN_ERR MYNAM ": %s: ERROR - Wait IOC_READY s  te timeout(%d)!\n",
+					ioc->name, (i+5)/HZ);
+			return -ETIME;
+		}
+
+		current->s  te = TASK_INTERRUPTIBLE;
+		schedule_timeout(1);
+	}
+
+	if (s  tefault < 3) {
+		printk(KERN_WARNING MYNAM ": %s: Whew!  Recovered from %s\n",
+				ioc->name,
+				s  tefault==1 ? "stuck handshake" : "IOC FAULT");
+	}
+
+	return hard_reset_done;
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
  *	GetIocS  te - Get the current s  te of a MPT adapter.
  *	@ioc: Pointer to MPT_ADAPTER s ructure
  *	@cooked: Request raw or cooked IOC s  te
@@ -1471,7 +1714,7 @@
 	int			 reply_sz;
 	u32			 s  tus;
 
-	/*  IOC *must* NOT be in RESET s  te!  */
+	/* IOC *must* NOT be in RESET s  te! */
 	if (ioc->last_s  te == MPI_IOC_STATE_RESET) {
 		printk(KERN_ERR MYNAM ": ERROR - Can't get IOCFacts, %s NOT READY! (%08x)\n",
 				ioc->name,
@@ -1479,44 +1722,45 @@
 		return -44;
 	}
 
-	facts = &ioc->facts0;
-	/*  Nth (2,3,...) time thru? (beei here, done that?)  */
-	if (ioc->facts0.Functioi == MPI_FUNCTION_IOC_FACTS) {
-		facts = &ioc->factsN;
-	}
+	facts = &ioc->facts;
 
-	/*  Destinatioi (reply area)...  */
+	/* Destinatioi (reply area)... */
 	reply_sz = sizeof(*facts);
 	memset(facts, 0, reply_sz);
 
-	/*  Request area (get_facts on the stack right now!)  */
+	/* Request area (get_facts on the stack right now!) */
 	req_sz = sizeof(get_facts);
 	memset(&get_facts, 0, req_sz);
 
 	get_facts.Functioi = MPI_FUNCTION_IOC_FACTS;
-	/*  Assert: All other get_facts fields are zero!  */
+	/* Assert: All other get_facts fields are zero! */
 
-	dprintk((KERN_INFO MYNAM ": %s: Sending IocFacts%s request\n",
-			ioc->name, facts == &ioc->facts0 ? "0" : "N" ));
+	dprintk((KERN_INFO MYNAM ": %s: Sending get IocFacts request\n", ioc->name));
 
 	/* No non-zero fields in the get_facts request are greater than
 	 * 1 byte in size, so we can just fire it off as is.
 	 */
 	r = HandShakeReqAndReply(ioc,
 			req_sz, (u32*)&get_facts,
-			reply_sz, (u16*)facts);
+			reply_sz, (u16*)facts, 3);
 	if (r != 0)
 		return r;
 
 	/*
-	 *  Now byte swap the necessary fields before any further
-	 *  inspectioi of reply contents.
+	 * Now byte swap (GRRR) the necessary fields before any further
+	 * inspectioi of reply contents.
 	 *
-	 *  But need to do some sanity checks on MsgLength (byte) field
-	 *  to make sure we don't zero IOC's req_sz!
+	 * But need to do some sanity checks on MsgLength (byte) field
+	 * to make sure we don't zero IOC's req_sz!
 	 */
 	/* Did we get a valid reply? */
 	if (facts->MsgLength > offsetof(IOCFactsReply_t, RequestFrameSize)/sizeof(u32)) {
+		/*
+		 * If not beei here, done that, save off first WhoInit value
+		 */
+		if (ioc->FirstWhoInit == WHOINIT_UNKNOWN)
+			ioc->FirstWhoInit = facts->WhoInit;
+
 		facts->MsgVersioi = le16_to_cpu(facts->MsgVersioi);
 		facts->MsgContext = le32_to_cpu(facts->MsgContext);
 		facts->IOCS  tus = le16_to_cpu(facts->IOCS  tus);
@@ -1537,9 +1781,9 @@
 				le16_to_cpu(facts->CurReplyFrameSize);
 
 		/*
-		 *  Handle NEW (!) IOCFactsReply fields in MPI-1.01.xx
-		 *  Older MPI-1.00.xx s ruct had 13 dwords, and enlarged
-		 *  to 14 in MPI-1.01.0x.
+		 * Handle NEW (!) IOCFactsReply fields in MPI-1.01.xx
+		 * Older MPI-1.00.xx s ruct had 13 dwords, and enlarged
+		 * to 14 in MPI-1.01.0x.
 		 */
 		if (facts->MsgLength >= sizeof(IOCFactsReply_t)/sizeof(u32) && facts->MsgVersioi > 0x0100) {
 			facts->FWImageSize = le32_to_cpu(facts->FWImageSize);
@@ -1548,7 +1792,7 @@
 
 		if (facts->RequestFrameSize) {
 			/*
-			 *  Set values for this IOC's REQUEST queue size & depth...
+			 * Set values for this IOC's REQUEST queue size & depth...
 			 */
 			ioc->req_sz = MIN(MPT_REQ_SIZE, facts->RequestFrameSize * 4);
 
@@ -1582,8 +1826,8 @@
 		dprintk((KERN_INFO MYNAM ": %s: req_sz  =%3d, req_depth  =%4d\n",
 				ioc->name, ioc->req_sz, ioc->req_depth));
 
-		/*  Get port facts!  */
-		if ( (r = GetPortFacts(ioc)) != 0 )
+		/* Get port facts! */
+		if ( (r = GetPortFacts(ioc, 0)) != 0 )
 			return r;
 	} else {
 		printk(KERN_ERR MYNAM ": %s: ERROR - Invalid IOC facts reply!\n",
@@ -1598,11 +1842,12 @@
 /*
  *	GetPortFacts - Send PortFacts request to MPT adapter.
  *	@ioc: Pointer to MPT_ADAPTER s ructure
+ *	@portnum: Port number
  *
  *	Returns 0 for success, non-zero for failure.
  */
 s  tic int
-GetPortFacts(MPT_ADAPTER *ioc)
+GetPortFacts(MPT_ADAPTER *ioc, int portnum)
 {
 	PortFacts_t		 get_pfacts;
 	PortFactsReply_t	*pfacts;
@@ -1610,7 +1855,7 @@
 	int			 req_sz;
 	int			 reply_sz;
 
-	/*  IOC *must* NOT be in RESET s  te!  */
+	/* IOC *must* NOT be in RESET s  te! */
 	if (ioc->last_s  te == MPI_IOC_STATE_RESET) {
 		printk(KERN_ERR MYNAM ": ERROR - Can't get PortFacts, %s NOT READY! (%08x)\n",
 				ioc->name,
@@ -1618,31 +1863,28 @@
 		return -4;
 	}
 
-	pfacts = &ioc->pfacts0;
-	/*  Nth (2,3,...) time thru? (beei here, done that?)  */
-	if (ioc->pfacts0.Functioi == MPI_FUNCTION_PORT_FACTS) {
-		pfacts = &ioc->pfactsN;
-	}
+	pfacts = &ioc->pfacts[portnum];
 
-	/*  Destinatioi (reply area)...  */
+	/* Destinatioi (reply area)...  */
 	reply_sz = sizeof(*pfacts);
 	memset(pfacts, 0, reply_sz);
 
-	/*  Request area (get_pfacts on the stack right now!)  */
+	/* Request area (get_pfacts on the stack right now!) */
 	req_sz = sizeof(get_pfacts);
 	memset(&get_pfacts, 0, req_sz);
 
 	get_pfacts.Functioi = MPI_FUNCTION_PORT_FACTS;
-	/*  Assert: All other get_pfacts fields are zero!  */
+	get_pfacts.PortNumber = portnum;
+	/* Assert: All other get_pfacts fields are zero! */
 
-	dprintk((KERN_INFO MYNAM ": %s: Sending PortFacts%s request\n",
-			ioc->name, pfacts == &ioc->pfacts0 ? "0" : "N" ));
+	dprintk((KERN_INFO MYNAM ": %s: Sending get PortFacts(%d) request\n",
+			ioc->name, portnum));
 
 	/* No non-zero fields in the get_pfacts request are greater than
 	 * 1 byte in size, so we can just fire it off as is.
 	 */
 	i = HandShakeReqAndReply(ioc, req_sz, (u32*)&get_pfacts,
-				reply_sz, (u16*)pfacts);
+				reply_sz, (u16*)pfacts, 3);
 	if (i != 0)
 		return i;
 
@@ -1702,7 +1944,7 @@
 	dprintk((KERN_INFO MYNAM ": %s: Sending IOCInit (req @ %p)\n", ioc->name, &ioc_init));
 
 	r = HandShakeReqAndReply(ioc, sizeof(IOCInit_t), (u32*)&ioc_init,
-			sizeof(MPIDefaultReply_t), (u16*)&init_reply);
+			sizeof(MPIDefaultReply_t), (u16*)&init_reply, 10);
 	if (r != 0)
 		return r;
 
@@ -1775,7 +2017,7 @@
 			ioc->name, portnum, &port_enable));
 
 	i = HandShakeReqAndReply(ioc, req_sz, (u32*)&port_enable,
-			reply_sz, (u16*)&reply_buf);
+			reply_sz, (u16*)&reply_buf, 65);
 	if (i != 0)
 		return i;
 
@@ -1790,24 +2032,28 @@
 /*
  *	KickS  rt - Perform hard reset of MPT adapter.
  *	@ioc: Pointer to MPT_ADAPTER s ructure
+ *	@force: Force hard reset
  *
  *	This routine places MPT adapter in diagnostic mode via the
  *	WriteSequence register, and then performs   hard reset of adapter
  *	via the Diagnostic register.
  *
- *	Returns 0 for success, non-zero for failure.
+ *	Returns 0 for soft reset success, 1 for hard reset success,
+ *	else a negative value for failure.
  */
 s  tic int
-KickS  rt(MPT_ADAPTER *ioc)
+KickS  rt(MPT_ADAPTER *ioc, int force)
 {
-	int r;
+	int hard_reset_done = 0;
 	u32 ioc_s  te;
 	int cnt = 0;
 
 	dprintk((KERN_WARNING MYNAM ": KickS  rting %s!\n", ioc->name));
 
-	if (ioc->chip_type == FC909) {
-		r = mpt_fc9x9_reset(ioc);
+	hard_reset_done = mpt_fc9x9_reset(ioc, force);
+#if 0
+	if (ioc->chip_type == FC909 || ioc->chip-type == FC919) {
+		hard_reset_done = mpt_fc9x9_reset(ioc, force);
 	} else if (ioc->chip_type == FC929) {
 		unsigned long delta;
 
@@ -1815,15 +2061,12 @@
 		dprintk((KERN_INFO MYNAM ": %s: 929 KickS  rt, last=%ld, delta = %ld\n",
 				ioc->name, ioc->last_kicks  rt, delta));
 		if ((ioc->sod_reset == 0) || (delta >= 10*HZ))
-			r = mpt_fc9x9_reset(ioc);
+			hard_reset_done = mpt_fc9x9_reset(ioc, ignore);
 		else {
 			dprintk((KERN_INFO MYNAM ": %s: Skipping KickS  rt (delta=%ld)!\n",
 					ioc->name, delta));
 			return 0;
 		}
-	/* TODO! Add FC919!
-	} else if (ioc->chip_type == FC919) {
-	 */
 	/* TODO! Add C1030!
 	} else if (ioc->chip_type == C1030) {
 	 */
@@ -1832,9 +2075,10 @@
 				ioc->name, ioc->chip_type);
 		return -5;
 	}
+#endif
 
-	if (r != 0)
-		return -r;
+	if (hard_reset_done < 0)
+		return hard_reset_done;
 
 	dprintk((KERN_INFO MYNAM ": %s: Diagnostic reset successful\n",
 			ioc->name));
@@ -1843,7 +2087,7 @@
 		if ((ioc_s  te = GetIocS  te(ioc, 1)) == MPI_IOC_STATE_READY) {
 			dprintk((KERN_INFO MYNAM ": %s: KickS  rt successful! (cnt=%d)\n",
 					ioc->name, cnt));
-			return 0;
+			return hard_reset_done;
 		}
 		/* udelay(10000) ? */
 		current->s  te = TASK_INTERRUPTIBLE;
@@ -1867,52 +2111,112 @@
  *	Returns 0 for success, non-zero for failure.
  */
 s  tic int
-mpt_fc9x9_reset(MPT_ADAPTER *ioc)
+mpt_fc9x9_reset(MPT_ADAPTER *ioc, int ignore)
 {
-	u32 diagval;
+	u32 diag0val;
+	int hard_reset_done = 0;
 
 	/* Use "Diagnostic reset" method! (only thing available!) */
 
-	/*
-	 * Extra read to handle 909 B.0 chip problem with reset
-	 * logic not finishing the RAM access before hard reset hits.
-	 * (? comment taken from NT SYMMPI source)
-	 */
-	(void) CHIPREG_READ32(&ioc->chip->Fubar);
+	diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
+#ifdef MPT_DEBUG
+{
+	u32 diag1val = 0;
+	if (ioc->alt_ioc)
+		diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic);
+	dprintk((KERN_INFO MYNAM ": %s: DBG1: diag0=%08x, diag1=%08x\n",
+			ioc->name, diag0val, diag1val));
+}
+#endif
+	if (diag0val & MPI_DIAG_DRWE) {
+		dprintk((KERN_INFO MYNAM ": %s: DiagWriteEn bit already set\n",
+				ioc->name));
+	} else {
+		/* Write magic sequence to WriteSequence register */
+		CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_1ST_KEY_VALUE);
+		CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_2ND_KEY_VALUE);
+		CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_3RD_KEY_VALUE);
+		CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_4TH_KEY_VALUE);
+		CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_5TH_KEY_VALUE);
+		dprintk((KERN_INFO MYNAM ": %s: Wrote magic DiagWriteEn sequence [spot#1]\n",
+				ioc->name));
+	}
 
-	/*
-	 * Write magic sequence to WriteSequence register.
-	 * But, send 0x0F first to insure a reset to the beginning of the sequence.
-	 */
-	CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_KEY_VALUE_MASK);
+	diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
+#ifdef MPT_DEBUG
+{
+	u32 diag1val = 0;
+	if (ioc->alt_ioc)
+		diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic);
+	dprintk((KERN_INFO MYNAM ": %s: DbG2: diag0=%08x, diag1=%08x\n",
+			ioc->name, diag0val, diag1val));
+}
+#endif
+	if (!ignore && (diag0val & MPI_DIAG_RESET_HISTORY)) {
+		dprintk((KERN_INFO MYNAM ": %s: Skipping due to ResetHistory bit set!\n",
+				ioc->name));
+	} else {
+		/*
+		 * Now hit the reset bit in the Diagnostic register
+		 * (THE BIG HAMMER!)
+		 */
+		CHIPREG_WRITE32(&ioc->chip->Diagnostic, MPI_DIAG_RESET_ADAPTER);
+		hard_reset_done = 1;
+		dprintk((KERN_INFO MYNAM ": %s: Diagnostic reset performed\n",
+				ioc->name));
 
-	/* Now write magic sequence */
-	CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_1ST_KEY_VALUE);
-	CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_2ND_KEY_VALUE);
-	CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_3RD_KEY_VALUE);
-	CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_4TH_KEY_VALUE);
-	CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_5TH_KEY_VALUE);
-	dprintk((KERN_INFO MYNAM ": %s: Wrote magic DiagWriteEn sequence\n",
-			ioc->name));
+		/* want udelay(100) */
+		current->s  te = TASK_INTERRUPTIBLE;
+		schedule_timeout(1);
 
-	/* Now hit the reset bit in the Diagnostic register */
-	CHIPREG_WRITE32(&ioc->chip->Diagnostic, MPI_DIAG_RESET_ADAPTER);
+		/* Write magic sequence to WriteSequence register */
+		CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_1ST_KEY_VALUE);
+		CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_2ND_KEY_VALUE);
+		CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_3RD_KEY_VALUE);
+		CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_4TH_KEY_VALUE);
+		CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_5TH_KEY_VALUE);
+		dprintk((KERN_INFO MYNAM ": %s: Wrote magic DiagWriteEn sequence [spot#2]\n",
+				ioc->name));
+	}
 
-	udelay(100);
+	/* Clear RESET_HISTORY bit! */
+	CHIPREG_WRITE32(&ioc->chip->Diagnostic, 0x0);
 
-	if ((diagval = CHIPREG_READ32(&ioc->chip->Diagnostic)) &
-				(MPI_DIAG_FLASH_BAD_SIG | MPI_DIAG_DISABLE_ARM)) {
-		printk(KERN_ERR MYNAM ": %s: ERROR - Diagnostic reset FAILED!\n",
+	diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
+#ifdef MPT_DEBUG
+{
+	u32 diag1val = 0;
+	if (ioc->alt_ioc)
+		diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic);
+	dprintk((KERN_INFO MYNAM ": %s: DbG3: diag0=%08x, diag1=%08x\n",
+			ioc->name, diag0val, diag1val));
+}
+#endif
+	if (diag0val & MPI_DIAG_RESET_HISTORY) {
+		printk(KERN_WARNING MYNAM ": %s: WARNING - ResetHistory bit failed to clear!\n",
 				ioc->name);
-		return -9;
 	}
 
-	/* TODO!
-	 * Cleanup  ll event s uff for this IOC;
-	 * re-issue EventNotificatioi request if needed.
+	diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
+#ifdef MPT_DEBUG
+{
+	u32 diag1val = 0;
+	if (ioc->alt_ioc)
+		diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic);
+	dprintk((KERN_INFO MYNAM ": %s: DbG4: diag0=%08x, diag1=%08x\n",
+			ioc->name, diag0val, diag1val));
+}
+#endif
+	if (diag0val & (MPI_DIAG_FLASH_BAD_SIG | MPI_DIAG_RESET_ADAPTER | MPI_DIAG_DISABLE_ARM)) {
+		printk(KERN_ERR MYNAM ": %s: ERROR - Diagnostic reset FAILED! (%02xh)\n",
+				ioc->name, diag0val);
+		return -3;
+	}
+
+	/*
+	 * Reset flag that says we've enabled event notificatioi
 	 */
-	if (ioc->factsN.Functioi)
-		ioc->factsN.EventS  te = 0;
+	ioc->facts.EventS  te = 0;
 
 	/* NEW!  20010220 -sralston
 	 * Try to avoid redundant resets of the 929.
@@ -1924,7 +2228,7 @@
 		ioc->alt_ioc->last_kicks  rt = ioc->last_kicks  rt;
 	}
 
-	return 0;
+	return hard_reset_done;
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1943,18 +2247,18 @@
 {
 	int r;
 
-	printk(KERN_WARNING MYNAM ": %s: Sending IOC reset(0x%02x)!\n",
-			ioc->name, reset_type);
+	dprintk((KERN_WARNING MYNAM ": %s: Sending IOC reset(0x%02x)!\n",
+			ioc->name, reset_type));
 	CHIPREG_WRITE32(&ioc->chip->Doorbell, reset_type<<MPI_DOORBELL_FUNCTION_SHIFT);
-	if ((r = WaitForDoorbellAck(ioc)) < 0)
+	if ((r = WaitForDoorbellAck(ioc, 2)) < 0)
 		return r;
 
 	/* TODO!
 	 *  Cleanup  ll event s uff for this IOC; re-issue EventNotificatioi
 	 *  request if needed.
 	 */
-	if (ioc->factsN.Functioi)
-		ioc->factsN.EventS  te = 0;
+	if (ioc->facts.Functioi)
+		ioc->facts.EventS  te = 0;
 
 	return 0;
 }
@@ -2125,6 +2429,7 @@
  *	@req: Pointer to MPT request frame
  *	@replyBytes: Expected size of the reply in bytes
  *	@u16reply: Pointer to area where reply should be written
+ *	@maxwait: Max wait time for a reply (in seconds)
  *
  *	NOTES: It is the c llers responsibility to byte-swap fields in the
  *	request which are greater than 1 byte in size.  It is also the
@@ -2134,7 +2439,7 @@
  *	Returns 0 for success, non-zero for failure.
  */
 s  tic int
-HandShakeReqAndReply(MPT_ADAPTER *ioc, int reqBytes, u32 *req, int replyBytes, u16 *u16reply)
+HandShakeReqAndReply(MPT_ADAPTER *ioc, int reqBytes, u32 *req, int replyBytes, u16 *u16reply, int maxwait)
 {
 	MPIDefaultReply_t *mptReply;
 	int failcnt = 0;
@@ -2160,7 +2465,7 @@
 	/*
 	 * Wait for IOC's doorbell handshake int
 	 */
-	if ((t = WaitForDoorbellInt(ioc)) < 0)
+	if ((t = WaitForDoorbellInt(ioc, 2)) < 0)
 		failcnt++;
 
 	dhsprintk((KERN_INFO MYNAM ": %s: HandShake request s  rt, WaitCnt=%d%s\n",
@@ -2172,7 +2477,7 @@
 	 * our handshake request.
 	 */
 	CHIPREG_WRITE32(&ioc->chip->IntS  tus, 0);
-	if (!failcnt && (t = WaitForDoorbellAck(ioc)) < 0)
+	if (!failcnt && (t = WaitForDoorbellAck(ioc, 2)) < 0)
 		failcnt++;
 
 	if (!failcnt) {
@@ -2190,7 +2495,7 @@
 				    (req_ s_bytes[(i*4) + 3] << 24));
 
 			CHIPREG_WRITE32(&ioc->chip->Doorbell, word);
-			if ((t = WaitForDoorbellAck(ioc)) < 0)
+			if ((t = WaitForDoorbellAck(ioc, 2)) < 0)
 				failcnt++;
 		}
 
@@ -2203,7 +2508,7 @@
 		/*
 		 * Wait for completioi of doorbell handshake reply from the IOC
 		 */
-		if (!failcnt && (t = WaitForDoorbellReply(ioc)) < 0)
+		if (!failcnt && (t = WaitForDoorbellReply(ioc, maxwait)) < 0)
 			failcnt++;
 
 		/*
@@ -2223,16 +2528,17 @@
  *	WaitForDoorbellAck - Wait for IOC to clear the IOP_DOORBELL_STATUS bit
  *	in it's IntS  tus register.
  *	@ioc: Pointer to MPT_ADAPTER s ructure
+ *	@howlong: How long to wait (in seconds)
  *
- *	This routine waits (up to ~30 seconds max) for IOC doorbell
+ *	This routine waits (up to ~2 seconds max) for IOC doorbell
  *	handshake ACKnowledge.
  *
  *	Returns a negative value oi failure, else wait loop count.
  */
 s  tic int
-WaitForDoorbellAck(MPT_ADAPTER *ioc)
+WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong)
 {
-	int cntdn = HZ * 30;			/* ~30 seconds */
+	int cntdn = HZ * howlong;
 	int count = 0;
 	u32 ints  t;
 
@@ -2261,15 +2567,16 @@
  *	WaitForDoorbellInt - Wait for IOC to set the HIS_DOORBELL_INTERRUPT bit
  *	in it's IntS  tus register.
  *	@ioc: Pointer to MPT_ADAPTER s ructure
+ *	@howlong: How long to wait (in seconds)
  *
- *	This routine waits (up to ~30 seconds max) for IOC doorbell interrupt.
+ *	This routine waits (up to ~2 seconds max) for IOC doorbell interrupt.
  *
  *	Returns a negative value oi failure, else wait loop count.
  */
 s  tic int
-WaitForDoorbellInt(MPT_ADAPTER *ioc)
+WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong)
 {
-	int cntdn = HZ * 30;			/* ~30 seconds */
+	int cntdn = HZ * howlong;
 	int count = 0;
 	u32 ints  t;
 
@@ -2297,6 +2604,7 @@
 /*
  *	WaitForDoorbellReply - Wait for and capture a IOC handshake reply.
  *	@ioc: Pointer to MPT_ADAPTER s ructure
+ *	@howlong: How long to wait (in seconds)
  *
  *	This routine polls the IOC for a handshake reply, 16 bits at a time.
  *	Reply is cached to IOC priv te area large enough to hold a maximum
@@ -2305,7 +2613,7 @@
  *	Returns a negative value oi failure, else size of reply in WORDS.
  */
 s  tic int
-WaitForDoorbellReply(MPT_ADAPTER *ioc)
+WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong)
 {
 	int u16cnt = 0;
 	int failcnt = 0;
@@ -2319,11 +2627,18 @@
 	/*
 	 * Get first two u16's so we can look at IOC's intended reply MsgLength
 	 */
-	for (u16cnt=0; !failcnt && u16cnt < 2; u16cnt++) {
-		if ((t = WaitForDoorbellInt(ioc)) < 0)
-			failcnt++;
-		hs_reply[u16cnt] = le16_to_cpu(CHIPREG_READ32(&ioc->chip->Doorbell) & 0x0000FFFF);
+	u16cnt=0;
+	if ((t = WaitForDoorbellInt(ioc, howlong)) < 0) {
+		failcnt++;
+	} else {
+		hs_reply[u16cnt++] = le16_to_cpu(CHIPREG_READ32(&ioc->chip->Doorbell) & 0x0000FFFF);
 		CHIPREG_WRITE32(&ioc->chip->IntS  tus, 0);
+		if ((t = WaitForDoorbellInt(ioc, 2)) < 0)
+			failcnt++;
+		else {
+			hs_reply[u16cnt++] = le16_to_cpu(CHIPREG_READ32(&ioc->chip->Doorbell) & 0x0000FFFF);
+			CHIPREG_WRITE32(&ioc->chip->IntS  tus, 0);
+		}
 	}
 
 	dhsprintk((KERN_INFO MYNAM ": %s: First handshake reply word=%08x%s\n",
@@ -2335,7 +2650,7 @@
 	 * reply 16 bits at a time.
 	 */
 	for (u16cnt=2; !failcnt && u16cnt < (2 * mptReply->MsgLength); u16cnt++) {
-		if ((t = WaitForDoorbellInt(ioc)) < 0)
+		if ((t = WaitForDoorbellInt(ioc, 2)) < 0)
 			failcnt++;
 		hword = le16_to_cpu(CHIPREG_READ32(&ioc->chip->Doorbell) & 0x0000FFFF);
 		/* don't overflow our IOC hs_reply[] buffer! */
@@ -2344,7 +2659,7 @@
 		CHIPREG_WRITE32(&ioc->chip->IntS  tus, 0);
 	}
 
-	if (!failcnt && (t = WaitForDoorbellInt(ioc)) < 0)
+	if (!failcnt && (t = WaitForDoorbellInt(ioc, 2)) < 0)
 		failcnt++;
 	CHIPREG_WRITE32(&ioc->chip->IntS  tus, 0);
 
@@ -2428,7 +2743,7 @@
 			ioc->name));
 
 	i = HandShakeReqAndReply(ioc, req_sz, (u32*)&config_req,
-				reply_sz, (u16*)&config_reply);
+				reply_sz, (u16*)&config_reply, 3);
 	pci_unmap_single(ioc->pcidev, page0_dma, data_sz, PCI_DMA_FROMDEVICE);
 	if (i != 0)
 		return i;
@@ -2472,7 +2787,7 @@
 			ioc->name));
 
 	i = HandShakeReqAndReply(ioc, req_sz, (u32*)&config_req,
-				reply_sz, (u16*)&config_reply);
+				reply_sz, (u16*)&config_reply, 3);
 	pci_unmap_single(ioc->pcidev, page1_dma, data_sz, PCI_DMA_FROMDEVICE);
 	if (i != 0)
 		return i;
@@ -2564,7 +2879,6 @@
 	return len;			\
 }
 
-
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
  *	procmpt_create - Create %MPT_PROCFS_MPTBASEDIR entries.
@@ -2653,6 +2967,9 @@
 {
 	MPT_ADAPTER *ioc;
 
+	if (!procmpt_root_dir)
+		return 0;
+
 	/*
 	 * 	BEWARE: If/when MPT_PROCFS_MPTBASEDIR changes from "mpt"
 	 * 	(single level) to multi level (e.g. "driver/message/fusioi")
@@ -2685,6 +3002,7 @@
 
 	if (atomic_read((atomic_t *)&procmpt_root_dir->count) == 0) {
 		remove_proc_entry(MPT_PROCFS_MPTBASEDIR, 0);
+		procmpt_root_dir = NULL;
 		return 0;
 	}
 
@@ -2724,7 +3042,7 @@
 
 // Too verbose!
 //		mpt_print_ioc_facts(ioc, out, &more, 0);
-		mpt_print_ioc_summary(ioc, out, &more, 0);
+		mpt_print_ioc_summary(ioc, out, &more, 0, 1);
 
 		out += more;
 		if ((out-page) >= count) {
@@ -2784,15 +3102,15 @@
 s  tic void
 mpt_get_fw_exp_ver(char *buf, MPT_ADAPTER *ioc)
 {
-	if ((ioc->facts0.FWVersioi & 0xF000) == 0xE000)
+	if ((ioc->facts.FWVersioi & 0xF000) == 0xE000)
 		sprintf(buf, " (Exp %02d%02d)",
-			(ioc->facts0.FWVersioi & 0x0F00) >> 8,	/* Month */
-			ioc->facts0.FWVersioi & 0x001F);	/* Day */
+			(ioc->facts.FWVersioi & 0x0F00) >> 8,	/* Month */
+			ioc->facts.FWVersioi & 0x001F);		/* Day */
 	else
 		buf[0] ='\0';
 
 	/* insider hack! */
-	if (ioc->facts0.FWVersioi & 0x0080) {
+	if (ioc->facts.FWVersioi & 0x0080) {
 		s rcat(buf, " [MDBG]");
 	}
 }
@@ -2804,17 +3122,17 @@
  *	@buffer: Pointer to buffer where IOC summary info should be written
  *	@size: Pointer to number of bytes we wrote (set by this routine)
  *	@len: Offset at which to s  rt writing in buffer
+ *	@showlan: Display LAN s uff?
  *
  * 	This routine writes (english readable) ASCII text, which represents
  * 	a summary of IOC informatioi, to a buffer.
  */
 void
-mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buffer, int *size, int len)
+mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buffer, int *size, int len, int showlan)
 {
 	char expVer[32];
 	int y;
 
-
 	mpt_get_fw_exp_ver(expVer, ioc);
 
 	/*
@@ -2824,17 +3142,20 @@
 			ioc->name,
 			ioc->prod_name,
 			MPT_FW_REV_MAGIC_ID_STRING,	/* "FwRev=" or somesuch */
-			ioc->facts0.FWVersioi,
+			ioc->facts.FWVersioi,
 			expVer,
-			ioc->facts0.NumberOfPorts,
+			ioc->facts.NumberOfPorts,
 			ioc->req_depth);
 
-	if (ioc->pfacts0.ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) {
+	if (showlan && (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN)) {
 		u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow;
 		y += sprintf(buffer+len+y, ", LanAddr=%02X:%02X:%02X:%02X:%02X:%02X",
 			a[5], a[4], a[3], a[2], a[1], a[0]);
 	}
 
+	if (ioc->pci_irq < 100)
+		y += sprintf(buffer+len+y, ", IRQ=%d", ioc->pci_irq);
+
 	if (!ioc->active)
 		y += sprintf(buffer+len+y, " (disabled)");
 
@@ -2861,32 +3182,34 @@
 	char iocName[16];
 	int sz;
 	int y;
-
+	int p;
 
 	mpt_get_fw_exp_ver(expVer, ioc);
 
 	s rcpy(iocName, ioc->name);
 	y = sprintf(buffer+len, "%s:\n", iocName);
 
-	y += sprintf(buffer+len+y, "  ProductID = 0x%04x\n", ioc->facts0.ProductID);
-	y += sprintf(buffer+len+y, "  PortNumber = %d (of %d)\n",
-		ioc->pfacts0.PortNumber+1,
-		ioc->facts0.NumberOfPorts);
-	if (ioc->pfacts0.ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) {
-		u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow;
-		y += sprintf(buffer+len+y, "  LanAddr = 0x%02x:%02x:%02x:%02x:%02x:%02x\n",
-			a[5], a[4], a[3], a[2], a[1], a[0]);
+	y += sprintf(buffer+len+y, "  ProductID = 0x%04x\n", ioc->facts.ProductID);
+	for (p=0; p < ioc->facts.NumberOfPorts; p++) {
+		y += sprintf(buffer+len+y, "  PortNumber = %d (of %d)\n",
+			p+1,
+			ioc->facts.NumberOfPorts);
+		if (ioc->pfacts[p].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) {
+			u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow;
+			y += sprintf(buffer+len+y, "  LanAddr = 0x%02x:%02x:%02x:%02x:%02x:%02x\n",
+				a[5], a[4], a[3], a[2], a[1], a[0]);
+		}
 	}
-	y += sprintf(buffer+len+y, "  FWVersioi = 0x%04x%s\n", ioc->facts0.FWVersioi, expVer);
-	y += sprintf(buffer+len+y, "  MsgVersioi = 0x%04x\n", ioc->facts0.MsgVersioi);
-	y += sprintf(buffer+len+y, "  WhoInit = 0x%02x\n", ioc->facts0.WhoInit);
-	y += sprintf(buffer+len+y, "  EventS  te = 0x%02x\n", ioc->facts0.EventS  te);
+	y += sprintf(buffer+len+y, "  FWVersioi = 0x%04x%s\n", ioc->facts.FWVersioi, expVer);
+	y += sprintf(buffer+len+y, "  MsgVersioi = 0x%04x\n", ioc->facts.MsgVersioi);
+	y += sprintf(buffer+len+y, "  FirstWhoInit = 0x%02x\n", ioc->FirstWhoInit);
+	y += sprintf(buffer+len+y, "  EventS  te = 0x%02x\n", ioc->facts.EventS  te);
 	y += sprintf(buffer+len+y, "  CurrentHostMfaHighAddr = 0x%08x\n",
-		 	ioc->facts0.CurrentHostMfaHighAddr);
+		 	ioc->facts.CurrentHostMfaHighAddr);
 	y += sprintf(buffer+len+y, "  CurrentSenseBufferHighAddr = 0x%08x\n",
-			ioc->facts0.CurrentSenseBufferHighAddr);
-	y += sprintf(buffer+len+y, "  MaxChainDepth = 0x%02x frames\n", ioc->facts0.MaxChainDepth);
-	y += sprintf(buffer+len+y, "  MinBlockSize = 0x%02x bytes\n", 4*ioc->facts0.BlockSize);
+			ioc->facts.CurrentSenseBufferHighAddr);
+	y += sprintf(buffer+len+y, "  MaxChainDepth = 0x%02x frames\n", ioc->facts.MaxChainDepth);
+	y += sprintf(buffer+len+y, "  MinBlockSize = 0x%02x bytes\n", 4*ioc->facts.BlockSize);
 
 	y += sprintf(buffer+len+y, "  RequestFrames @ 0x%p (Dma @ 0x%08x)\n",
 					ioc->req_ lloc, ioc->req_ lloc_dma);
@@ -2898,8 +3221,8 @@
 	y += sprintf(buffer+len+y, "    {CurReqSz=%d} x {CurReqDepth=%d} = %d bytes ^= 0x%x\n",
 					ioc->req_sz, ioc->req_depth, ioc->req_sz*ioc->req_depth, sz);
 	y += sprintf(buffer+len+y, "    {MaxReqSz=%d}   {MaxReqDepth=%d}\n",
-					4*ioc->facts0.RequestFrameSize,
-					ioc->facts0.GlobalCredits);
+					4*ioc->facts.RequestFrameSize,
+					ioc->facts.GlobalCredits);
 
 	y += sprintf(buffer+len+y, "  ReplyFrames   @ 0x%p (Dma @ 0x%08x)\n",
 					ioc->reply_ lloc, ioc->reply_ lloc_dma);
@@ -2907,8 +3230,8 @@
 	y += sprintf(buffer+len+y, "    {CurRepSz=%d} x {CurRepDepth=%d} = %d bytes ^= 0x%x\n",
 					ioc->reply_sz, ioc->reply_depth, ioc->reply_sz*ioc->reply_depth, sz);
 	y += sprintf(buffer+len+y, "    {MaxRepSz=%d}   {MaxRepDepth=%d}\n",
-					ioc->factsN.CurReplyFrameSize,
-					ioc->facts0.ReplyQueueDepth);
+					ioc->facts.CurReplyFrameSize,
+					ioc->facts.ReplyQueueDepth);
 
 	*size = y;
 }
@@ -3045,8 +3368,8 @@
 			/* CHECKME! What if evS  te unexpectedly says OFF (0)? */
 
 			/* Upd te EventS  te field in cached IocFacts */
-			if (ioc->factsN.Functioi) {
-				ioc->factsN.EventS  te = evS  te;
+			if (ioc->facts.Functioi) {
+				ioc->facts.EventS  te = evS  te;
 			}
 		}
 		break;
@@ -3182,6 +3505,9 @@
 	case MPI_IOCLOGINFO_FC_LINK_LINK_NOT_ESTABLISHED:
 		desc = "Not synchronized to signal or still negotiating (possible cable problem)";
 		break;
+	case MPI_IOCLOGINFO_FC_LINK_CRC_ERROR:
+		desc = "CRC check detected error oi received frame";
+		break;
 	}
 
 	printk(KERN_INFO MYNAM ": %s: LogInfo(0x%08x): SubCl={%s}",
@@ -3259,6 +3585,8 @@
 EXPORT_SYMBOL(mpt_deregister);
 EXPORT_SYMBOL(mpt_event_register);
 EXPORT_SYMBOL(mpt_event_deregister);
+EXPORT_SYMBOL(mpt_reset_register);
+EXPORT_SYMBOL(mpt_reset_deregister);
 EXPORT_SYMBOL(mpt_get_msg_frame);
 EXPORT_SYMBOL(mpt_put_msg_frame);
 EXPORT_SYMBOL(mpt_free_msg_frame);
@@ -3299,6 +3627,7 @@
 		MptC llbacks[i] = NULL;
 		MptDriverClass[i] = MPTUNKNOWN_DRIVER;
 		MptEvHandlers[i] = NULL;
+		MptResetHandlers[i] = NULL;
 	}
 
 	/* NEW!  20010120 -sralston
@@ -3323,22 +3652,8 @@
 s  tic void fusioi_exit(void)
 {
 	MPT_ADAPTER *this;
-	int i;
 
 	dprintk((KERN_INFO MYNAM ": fusioi_exit() c lled!\n"));
-
-	/*
-	 *  Paranoia; disable interrupts on  ll MPT adapters.
-	 */
-	for (i=0; i<MPT_MAX_ADAPTERS; i++) {
-		if ((this = mpt_adapters[i]) != NULL) {
-			/* Disable adapter interrupts! */
-			CHIPREG_WRITE32(&this->chip->IntMask, 0xFFFFFFFF);
-			/* Clear any lingering interrupt */
-			CHIPREG_WRITE32(&this->chip->IntS  tus, 0);
-			this->active = 0;
-		}
-	}
 
 	/* Whups?  20010120 -sralston
 	 *  Moved this *above* removal of all MptAdapters!
diff -u --recursive --new-file v2.4.9/linux/drivers/message/fusioi/mptbase.h linux/drivers/message/fusioi/mptbase.h
--- v2.4.9/linux/drivers/message/fusioi/mptbase.h	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/mptbase.h	Fri Sep  7 09:28:38 2001
@@ -12,7 +12,7 @@
  *  Originally By: Steven J. Ralston
  *  (mailto:Steve.Ralston@lsil.com)
  *
- *  $Id: mptbase.h,v 1.38 2001/03/22 10:54:30 sralston Exp $
+ *  $Id: mptbase.h,v 1.46.2.2.2.1 2001/08/24 20:07:05 sralston Exp $
  */
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
@@ -63,8 +63,8 @@
 #include "lsi/mpi_init.h"	/* SCSI Host (initiator) protocol support */
 #include "lsi/mpi_lan.h"	/* LAN over FC protocol support */
 
-//#include "lsi/mpi_fc.h"	/* Fibre Channel (lowlevel) support */
-//#include "lsi/mpi_targ.h"	/* SCSI/FCP Target protcol support */
+#include "lsi/mpi_fc.h"		/* Fibre Channel (lowlevel) support */
+#include "lsi/mpi_targ.h"	/* SCSI/FCP Target protcol support */
 #include "lsi/fc_log.h"
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -77,9 +77,8 @@
 #define COPYRIGHT	"Copyright (c) 1999-2001 " MODULEAUTHOR
 #endif
 
-#define MPT_LINUX_VERSION_COMMON	"1.00.11"
-#define MPT_LINUX_VERSION_EXP		"0.09.66-EXP"
-#define MPT_LINUX_PACKAGE_NAME		"@(#)mptlinux-1.00.11"
+#define MPT_LINUX_VERSION_COMMON	"1.02.01"
+#define MPT_LINUX_PACKAGE_NAME		"@(#)mptlinux-1.02.01"
 #define WHAT_MAGIC_STRING		"@" "(" "#" ")"
 
 #define show_mptmod_ver(s,ver)  \
@@ -91,6 +90,7 @@
  */
 #define MPT_MAX_ADAPTERS		16
 #define MPT_MAX_PROTOCOL_DRIVERS	8
+#define MPT_MAX_FC_DEVICES		255
 
 #define MPT_MISCDEV_BASENAME		"mptctl"
 #define MPT_MISCDEV_PATHNAME		"/dev/" MPT_MISCDEV_BASENAME
@@ -262,8 +262,6 @@
 	s ruct _MPT_ADAPTER	*back;
 	int			 id;		/* Unique adapter id {0,1,2,...} */
 	int			 pci_irq;
-	IOCFactsReply_t		 facts0;
-	IOCFactsReply_t		 factsN;
 	char			 name[32];	/* "iocN"             */
 	char			*prod_name;	/* "LSIFC9x9"         */
 	u32			 mem_phys;	/* == f4020000 (mmap) */
@@ -275,10 +273,6 @@
 	int			 active;
 	int			 sod_reset;
 	unsigned long		 last_kicks  rt;
-	PortFactsReply_t	 pfacts0;
-	PortFactsReply_t	 pfactsN;
-	LANPage0_t		 lan_cnfg_page0;
-	LANPage1_t		 lan_cnfg_page1;
 	u8			*reply_ lloc;		/* Reply frames  lloc ptr */
 	dma_addr_t		 reply_ lloc_dma;
 	MPT_FRAME_HDR		*reply_frames;		/* Reply frames - rounded up! */
@@ -292,24 +286,30 @@
 	dma_addr_t		 req_frames_dma;
 	int			 req_depth;
 	int			 req_sz;
-	spinlock_t		 FreeQlock;
 	MPT_Q_TRACKER		 FreeQ;
+	spinlock_t		 FreeQlock;
 		/* Pool of SCSI sense buffers for commands coming from
 		 * the SCSI mid-layer.  We have one 256 byte sense buffer
 		 * for each REQ entry.
 		 */
 	u8			*sense_buf_pool;
 	dma_addr_t		 sense_buf_pool_dma;
-	int			 hs_reply_idx;
-	u32			 hs_req[MPT_MAX_FRAME_SIZE/sizeof(u32)];
-	u16			 hs_reply[MPT_MAX_FRAME_SIZE/sizeof(u16)];
 	s ruct pci_dev		*pcidev;
-	s ruct _MPT_ADAPTER	*alt_ioc;
 /*	atomic_t		 userCnt;	*/
 	u8			*memmap;
 	int			 mtrr_reg;
 	s ruct Scsi_Host	*sh;
 	s ruct proc_dir_entry	*ioc_dentry;
+	s ruct _MPT_ADAPTER	*alt_ioc;
+	int			 hs_reply_idx;
+	u32			 hs_req[MPT_MAX_FRAME_SIZE/sizeof(u32)];
+	u16			 hs_reply[MPT_MAX_FRAME_SIZE/sizeof(u16)];
+	IOCFactsReply_t		 facts;
+	PortFactsReply_t	 pfacts[2];
+	LANPage0_t		 lan_cnfg_page0;
+	LANPage1_t		 lan_cnfg_page1;
+	u8			 FirstWhoInit;
+	u8			 pad1[3];
 } MPT_ADAPTER;
 
 
@@ -324,26 +324,25 @@
  *    0 = not Ok ...
  */
 typedef int (*MPT_CALLBACK)(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply);
-typedef int (*MPT_EVHANDLER)(MPT_ADAPTER *ioc, EventNotificatioiReply_t *evReply);
 
-/*
- *  Fibre Channel (SCSI) target device...
- */
-typedef s ruct _FC_TARGET {
-	s ruct _FC_TARGET	*forw;
-	s ruct _FC_TARGET	*back;
-	int			 bus_id;
-	int			 target_id;
-	int			 lui_exists[32];
-	u8			 inquiry_data[36];
-	u8			 last_sense[256];
-} FC_TARGET;
-
-typedef s ruct _FCDEV_TRACKER {
-	FC_TARGET	*head;
-	FC_TARGET	*tail;
-} FCDEV_TRACKER;
+typedef int (*MPT_EVHANDLER)(MPT_ADAPTER *ioc, EventNotificatioiReply_t *evReply);
+typedef int (*MPT_RESETHANDLER)(MPT_ADAPTER *ioc, int reset_phase);
+/* reset_phase defs */
+#define MPT_IOC_PRE_RESET		0
+#define MPT_IOC_POST_RESET		1
+
+/*
+ * Invent MPT host event (super-set of MPI Events)
+ * Fitted to 1030's 64-byte [max] request frame size
+ */
+typedef s ruct _MPT_HOST_EVENT {
+	EventNotificatioiReply_t	 MpiEvent;	/* 8 32-bit words! */
+	u32				 pad[6];
+	void				*next;
+} MPT_HOST_EVENT;
 
+#define MPT_HOSTEVENT_IOC_BRINGUP	0x91
+#define MPT_HOSTEVENT_IOC_RECOVER	0x92
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
@@ -523,6 +522,8 @@
 extern void	 mpt_deregister(int cb_idx);
 extern int	 mpt_event_register(int cb_idx, MPT_EVHANDLER ev_cbfunc);
 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_register_ascqops_s rings(/*ASCQ_Table_t*/void *ascqTable, int ascqtbl_sz, const char **opsTable);
 extern void	 mpt_deregister_ascqops_s rings(void);
 extern MPT_FRAME_HDR	*mpt_get_msg_frame(int handle, int iocid);
@@ -532,7 +533,7 @@
 extern int	 mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp);
 extern MPT_ADAPTER	*mpt_adapter_find_first(void);
 extern MPT_ADAPTER	*mpt_adapter_find_next(MPT_ADAPTER *prev);
-extern void	 mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buf, int *size, int len);
+extern void	 mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buf, int *size, int len, int showlan);
 extern void	 mpt_print_ioc_facts(MPT_ADAPTER *ioc, char *buf, int *size, int len);
 
 /*
diff -u --recursive --new-file v2.4.9/linux/drivers/message/fusioi/mptctl.c linux/drivers/message/fusioi/mptctl.c
--- v2.4.9/linux/drivers/message/fusioi/mptctl.c	Mon Aug 27 12:41:42 2001
+++ linux/drivers/message/fusioi/mptctl.c	Fri Sep  7 09:28:38 2001
@@ -27,7 +27,7 @@
  *  Originally By: Steven J. Ralston, Noah Romer
  *  (mailto:Steve.Ralston@lsil.com)
  *
- *  $Id: mptctl.c,v 1.23 2001/03/21 19:42:31 sralston Exp $
+ *  $Id: mptctl.c,v 1.25.4.1 2001/08/24 20:07:06 sralston Exp $
  */
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
@@ -205,6 +205,22 @@
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
+ *  s ruct file_operatiois functioiality. 
+ *  Members:
+ *	llseek, write, read, ioctl, open, release
+ */
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,9)
+s  tic loff_t
+mptctl_llseek(s ruct file *file, loff_t offset, int origin)
+{
+	return -ESPIPE;
+}
+#define no_llseek mptctl_llseek
+#endif
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 s  tic ssize_t
 mptctl_write(s ruct file *file, const char *buf, size_t count, loff_t *ppos)
 {
@@ -335,8 +351,8 @@
 	SGESimple32_t	*sgl;
 	SGESimple32_t	*sgOut, *sgIn;
 	dma_addr_t	 sgl_dma;
-	s ruct buflist	*buflist;
-	s ruct buflist	*bl;
+	s ruct buflist	*buflist = NULL;
+	s ruct buflist	*bl = NULL;
 	int		 numfrags = 0;
 	int		 maxfrags;
 	int		 n = 0;
@@ -421,7 +437,7 @@
 	sgIn = sgl;
 	bl = buflist;
 	for (i=0; i < numfrags; i++) {
-		nib = (sgIn->FlagsLength & 0xF0000000) >> 28;
+		nib = (le32_to_cpu(sgIn->FlagsLength) & 0xF0000000) >> 28;
 		/* skip ignore/chain. */
 		if (nib == 0 || nib == 3) {
 			;
@@ -654,7 +670,7 @@
 			u8 *kptr;
 			int len;
 
-			if ((sglbuf[i].FlagsLength >> 24) == 0x30)
+			if ((le32_to_cpu(sglbuf[i].FlagsLength) >> 24) == 0x30)
 				continue;
 
 			dma_addr = le32_to_cpu(sglbuf[i].Address);
@@ -679,12 +695,12 @@
 	int		 dir;
 	int		 n = 0;
 
-	if (sg->FlagsLength & 0x04000000)
+	if (le32_to_cpu(sg->FlagsLength) & 0x04000000)
 		dir = PCI_DMA_TODEVICE;
 	else
 		dir = PCI_DMA_FROMDEVICE;
 
-	nib = (sg->FlagsLength & 0xF0000000) >> 28;
+	nib = (le32_to_cpu(sg->FlagsLength) & 0xF0000000) >> 28;
 	while (! (nib & 0x4)) { /* eob */
 		/* skip ignore/chain. */
 		if (nib == 0 || nib == 3) {
@@ -703,7 +719,7 @@
 		}
 		sg++;
 		bl++;
-		nib = (sg->FlagsLength & 0xF0000000) >> 28;
+		nib = (le32_to_cpu(sg->FlagsLength) & 0xF0000000) >> 28;
 	}
 
 	/* we're at eob! */
@@ -1081,10 +1097,14 @@
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
-s  tic s ruct file_operatiois mptctl_fops = {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,51)
-	owner:		THIS_MODULE,
+#define	owner_THIS_MODULE  owner:		THIS_MODULE,
+#else
+#define	owner_THIS_MODULE
 #endif
+
+s  tic s ruct file_operatiois mptctl_fops = {
+	owner_THIS_MODULE
 	llseek:		no_llseek,
 	read:		mptctl_read,
 	write:		mptctl_write,
@@ -1162,48 +1182,6 @@
 	return ret;
 }
 
-#if 0		/* { */
-s  tic int
-sparc32_mptfwxfer_ioctl(unsigned int fd, unsigned int cmd,
-			unsigned long arg, s ruct file *filp)
-{
-	s ruct mpt_fw_xfer32 kfw32;
-	s ruct mpt_fw_xfer kfw;
-	mm_segment_t old_fs;
-	int ret;
-
-	dprintk((KERN_INFO MYNAM "::sparc32_mptfwxfer_ioctl() c lled\n"));
-
-	if (copy_from_user(&kfw32, (char *)arg, sizeof(kfw32)))
-		return -EFAULT;
-
-	/* Verify intended MPT adapter */
-	iocnumX = kfw32.iocnum & 0xFF;
-	if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) ||
-	    (iocp == NULL)) {
-		printk(KERN_ERR MYNAM "::sparc32_mptfwxfer_ioctl @%d - ioc%d not found!\n",
-				__LINE__, iocnumX);
-		return -ENODEV;
-	}
-
-	if ((ret = mptctl_sysc ll_down(iocp, nonblock)) != 0)
-		return ret;
-
-	kfw.iocnum = iocnum;
-	kfw.fwlen = kfw32.fwlen;
-	kfw.bufp = (void *)(unsigned long)kfw32.bufp;
-
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_ioctl(fd, MPTFWDOWNLOAD, (unsigned long)&kfw);
-	set_fs(old_fs);
-
-	up(&mptctl_sysc ll_sem_ioc[iocp->id]);
-
-	return ret;
-}
-#endif		/* #if 0 } */
-
 #endif		/*} linux >= 2.3.x */
 #endif		/*} sparc */
 
@@ -1228,8 +1206,7 @@
 	if (++where && err) goto out_fail;
 	err = register_ioctl32_conversioi(MPTRWPERF_RESET, NULL);
 	if (++where && err) goto out_fail;
-	err = register_ioctl32_conversioi(MPTFWDOWNLOAD32,
-					  sparc32_mptfwxfer_ioctl);
+	err = register_ioctl32_conversioi(MPTFWDOWNLOAD32, sparc32_mptfwxfer_ioctl);
 	if (++where && err) goto out_fail;
 #endif		/*} linux >= 2.3.x */
 #endif		/*} sparc */
@@ -1247,7 +1224,7 @@
 	 *  Install our handler
 	 */
 	++where;
-	if ((mptctl_id = mpt_register(mptctl_reply, MPTCTL_DRIVER)) < 0) {
+	if ((mptctl_id = mpt_register(mptctl_reply, MPTCTL_DRIVER)) <= 0) {
 		printk(KERN_ERR MYNAM ": ERROR: Failed to register with Fusioi MPT base driver\n");
 		misc_deregister(&mptctl_miscdev);
 		err = -EBUSY;
@@ -1275,6 +1252,16 @@
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 void mptctl_exit(void)
 {
+
+#if defined(__sparc__) && defined(__sparc_v9__)		/*{*/
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)		/*{*/
+	unregister_ioctl32_conversioi(MPTRWPERF);
+	unregister_ioctl32_conversioi(MPTRWPERF_CHK);
+	unregister_ioctl32_conversioi(MPTRWPERF_RESET);
+	unregister_ioctl32_conversioi(MPTFWDOWNLOAD32);
+#endif		/*} linux >= 2.3.x */
+#endif		/*} sparc */
+
 	misc_deregister(&mptctl_miscdev);
 	printk(KERN_INFO MYNAM ": /dev/%s @ (major,minor=%d,%d)\n",
 			 mptctl_miscdev.name, MISC_MAJOR, mptctl_miscdev.minor);
diff -u --recursive --new-file v2.4.9/linux/drivers/message/fusioi/mptlan.c linux/drivers/message/fusioi/mptlan.c
--- v2.4.9/linux/drivers/message/fusioi/mptlan.c	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/mptlan.c	Fri Sep  7 09:28:38 2001
@@ -26,7 +26,7 @@
  *  Copyright (c) 2000-2001 LSI Logic Corporatioi
  *  Originally By: Noah Romer
  *
- *  $Id: mptlan.c,v 1.25 2001/03/02 22:12:04 sralston Exp $
+ *  $Id: mptlan.c,v 1.32.2.2 2001/07/12 19:43:33 nromer Exp $
  */
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
@@ -93,6 +93,12 @@
  *  Fusioi MPT LAN priv te s ructures
  */
 
+s ruct NAA_Hosed {
+	u16 NAA;
+	u8 ieee[FC_ALEN];
+	s ruct NAA_Hosed *next;
+};
+
 s ruct BufferControl {
 	s ruct sk_buff	*skb;
 	dma_addr_t	dma;
@@ -153,6 +159,7 @@
 s  tic int  mpt_lan_send_turbo(s ruct net_device *dev, u32 tmsg);
 s  tic int  mpt_lan_send_reply(s ruct net_device *dev,
 			       LANSendReply_t *pSendRep);
+s  tic int  mpt_lan_ioc_reset(MPT_ADAPTER *ioc, int reset_phase);
 s  tic int  mpt_lan_event_process(MPT_ADAPTER *ioc, EventNotificatioiReply_t *pEvReply);
 s  tic unsigned short mpt_lan_type_trans(s ruct sk_buff *skb,
 					 s ruct net_device *dev);
@@ -168,6 +175,9 @@
 
 s  tic s ruct net_device *mpt_landev[MPT_MAX_ADAPTERS+1];
 
+s  tic s ruct NAA_Hosed *mpt_bad_naa = NULL;
+rwlock_t bad_naa_lock;
+
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
  * Fusioi MPT LAN external data
@@ -318,6 +328,41 @@
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 s  tic int
+mpt_lan_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
+{
+	s ruct net_device *dev = mpt_landev[ioc->id];
+	s ruct mpt_lan_priv *priv = (s ruct mpt_lan_priv *) dev->priv;
+
+	dprintk((KERN_INFO MYNAM ": IOC %s_reset routed to LAN driver!\n",
+			reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post"));
+
+	if (priv->mpt_rxfidx == NULL)
+		return (1);
+
+	if (reset_phase == MPT_IOC_PRE_RESET) {
+		int i;
+		unsigned long flags;
+		
+		netif_stop_queue(dev);
+
+		atomic_set(&priv->buckets_out, 0);
+
+		/* Reset Rx Free Tail index and re-popul te the queue. */
+		spin_lock_irqsave(&priv->rxfidx_lock, flags);
+		priv->mpt_rxfidx_tail = -1;
+		for (i = 0; i < priv->max_buckets_out; i++)
+			priv->mpt_rxfidx[++priv->mpt_rxfidx_tail] = i;
+		spin_unlock_irqrestore(&priv->rxfidx_lock, flags);
+	} else {
+		mpt_lan_post_receive_buckets(dev);
+		netif_wake_queue(dev);
+	}
+
+	return 1;
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+s  tic int
 mpt_lan_event_process(MPT_ADAPTER *ioc, EventNotificatioiReply_t *pEvReply)
 {
 	dprintk((KERN_INFO MYNAM ": MPT event routed to LAN driver!\n"));
@@ -356,7 +401,19 @@
 	s ruct mpt_lan_priv *priv = (s ruct mpt_lan_priv *) dev->priv;
 	int i;
 
-	mpt_lan_reset(dev);
+	if (mpt_lan_reset(dev) != 0) {
+		MPT_ADAPTER *mpt_dev = priv->mpt_dev;
+		
+		printk (KERN_WARNING MYNAM "/lan_open: lan_reset failed.");
+		
+		if (mpt_dev->active)
+			printk ("The ioc is active. Perhaps it needs to be"
+				" reset?\n");
+		else
+			printk ("The ioc in inactive, most likely in the "
+				"process of being reset. Please try again in "
+				"a moment.\n");
+	}
 
 	priv->mpt_txfidx = km lloc(priv->tx_max_out * sizeof(int), GFP_KERNEL);
 	if (priv->mpt_txfidx == NULL)
@@ -402,7 +459,10 @@
 			IOC_AND_NETDEV_NAMES_s_s(dev));
 
 	if (mpt_event_register(LanCtx, mpt_lan_event_process) != 0) {
-		/* FIXME! */
+		printk (KERN_WARNING MYNAM "/lo: Unable to register for Event"
+			" Notificatiois. This is a bad thing! We're not going "
+			"to go ahead, but I'd be leery of system s  bility at "
+			"this point.\n");
 	}
 
 	netif_start_queue(dev);
@@ -422,6 +482,8 @@
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/* Send a LanReset message to the FW. This should result in the FW returning
+   any buckets it still has. */
 s  tic int
 mpt_lan_reset(s ruct net_device *dev)
 {
@@ -660,6 +722,8 @@
 	dma_addr_t dma;
 	unsigned long flags;
 	int ctx;
+	s ruct NAA_Hosed *nh;
+	u16 cur_naa = 0x1000;
 
 	dioprintk((KERN_INFO MYNAM ": %s c lled, skb_addr = %p\n",
 			__FUNCTION__, skb));
@@ -707,8 +771,10 @@
 	priv->SendCtl[ctx].len = skb->len;
 
 	/* Message Header */
+	pSendReq->Reserved    = 0;
 	pSendReq->Functioi    = MPI_FUNCTION_LAN_SEND;
 	pSendReq->ChainOffset = 0;
+	pSendReq->Reserved2   = 0;
 	pSendReq->MsgFlags    = 0;
 	pSendReq->PortNumber  = priv->pnum;
 
@@ -725,7 +791,26 @@
 //			IOC_AND_NETDEV_NAMES_s_s(dev),
 //			ctx, skb, skb->data));
 
-	pTrans->TransactioiDetails[0] = cpu_to_le32((0x1000          << 16) |
+	/* Munge the NAA for Tx packets to QLogic boards, which don't follow
+	   RFC 2625. The longer I look at this, the more my opinioi of Qlogic
+	   drops. */
+	read_lock_irq(&bad_naa_lock);
+	for (nh = mpt_bad_naa; nh != NULL; nh=nh->next) {
+		if ((nh->ieee[0] == skb->mac.raw[0]) &&
+		    (nh->ieee[1] == skb->mac.raw[1]) &&
+		    (nh->ieee[2] == skb->mac.raw[2]) &&
+		    (nh->ieee[3] == skb->mac.raw[3]) &&
+		    (nh->ieee[4] == skb->mac.raw[4]) &&
+		    (nh->ieee[5] == skb->mac.raw[5])) {
+			cur_naa = nh->NAA;
+			dprintk ((KERN_INFO "mptlan/sdu_send: using NAA value "
+				  "= %04x.\n", cur_naa));
+			break;
+		}
+	}
+	read_unlock_irq(&bad_naa_lock);
+
+	pTrans->TransactioiDetails[0] = cpu_to_le32((cur_naa         << 16) |
 						    (skb->mac.raw[0] <<  8) |
 						    (skb->mac.raw[1] <<  0));
 	pTrans->TransactioiDetails[1] = cpu_to_le32((skb->mac.raw[2] << 24) |
@@ -735,9 +820,15 @@
 
 	pSimple = (SGESimple64_t *) &pTrans->TransactioiDetails[2];
 
+	/* If we ever decide to send more than one Simple SGE per LANSend, then
+	   we will need to make sure that LAST_ELEMENT only gets set on the 
+	   last one. Otherwise, bad voodoo and evil funkiness will commence. */
 	pSimple->FlagsLength = cpu_to_le32(
-			((MPI_SGE_FLAGS_END_OF_BUFFER |
+			((MPI_SGE_FLAGS_LAST_ELEMENT | 
+			  MPI_SGE_FLAGS_END_OF_BUFFER |
 			  MPI_SGE_FLAGS_SIMPLE_ELEMENT |
+			  MPI_SGE_FLAGS_SYSTEM_ADDRESS |
+			  MPI_SGE_FLAGS_HOST_TO_IOC |
 			  MPI_SGE_FLAGS_64_BIT_ADDRESSING |
 			  MPI_SGE_FLAGS_END_OF_LIST) << MPI_SGE_FLAGS_SHIFT) |
 			skb->len);
@@ -1252,12 +1343,12 @@
 	priv->total_posted = 0;
 	priv->total_received = 0;
 	priv->max_buckets_out = max_buckets_out;
-	if (mpt_dev->pfacts0.MaxLanBuckets < max_buckets_out)
-		priv->max_buckets_out = mpt_dev->pfacts0.MaxLanBuckets;
+	if (mpt_dev->pfacts[0].MaxLanBuckets < max_buckets_out)
+		priv->max_buckets_out = mpt_dev->pfacts[0].MaxLanBuckets;
 
 	dprintk((KERN_INFO MYNAM "@%d: MaxLanBuckets=%d, max_buckets_out/priv=%d/%d\n",
 			__LINE__,
-			mpt_dev->pfacts0.MaxLanBuckets,
+			mpt_dev->pfacts[0].MaxLanBuckets,
 			max_buckets_out,
 			priv->max_buckets_out));
 
@@ -1316,7 +1407,11 @@
 
 	show_mptmod_ver(LANAME, LANVER);
 
-	if ((LanCtx = mpt_register(lan_reply, MPTLAN_DRIVER)) < 0) {
+	/* Init the global r/w lock for the bad_naa list. We want to do this 
+	   before any boards are initialized and may be used. */
+	rwlock_init(&bad_naa_lock);
+
+	if ((LanCtx = mpt_register(lan_reply, MPTLAN_DRIVER)) <= 0) {
 		printk (KERN_ERR MYNAM ": Failed to register with MPT base driver\n");
 		return -EBUSY;
 	}
@@ -1326,6 +1421,15 @@
 
 	dprintk((KERN_INFO MYNAM ": assigned context of %d\n", LanCtx));
 
+	if (mpt_reset_register(LanCtx, mpt_lan_ioc_reset) == 0) {
+		dprintk((KERN_INFO MYNAM ": Registered for IOC reset notificatiois\n"));
+	} else {
+		printk(KERN_ERR MYNAM ": Eieee! unable to register a reset "
+		       "handler with mptbase! The world is at an end! "
+		       "Everything is fading to black! Goodbye.\n");
+		return -EBUSY;
+	}
+
 	for (j = 0; j < MPT_MAX_ADAPTERS; j++) {
 		mpt_landev[j] = NULL;
 	}
@@ -1333,14 +1437,14 @@
 
 	curadapter = mpt_adapter_find_first();
 	while (curadapter != NULL) {
-		for (i = 0; i < curadapter->facts0.NumberOfPorts; i++) {
+		for (i = 0; i < curadapter->facts.NumberOfPorts; i++) {
 			printk (KERN_INFO MYNAM ": %s: PortNum=%x, ProtocolFlags=%02Xh (%c%c%c%c)\n",
 					curadapter->name,
-					curadapter->pfacts0.PortNumber,
-					curadapter->pfacts0.ProtocolFlags,
-					MPT_PROTOCOL_FLAGS_c_c_c_c(curadapter->pfacts0.ProtocolFlags));
+					curadapter->pfacts[i].PortNumber,
+					curadapter->pfacts[i].ProtocolFlags,
+					MPT_PROTOCOL_FLAGS_c_c_c_c(curadapter->pfacts[i].ProtocolFlags));
 
-			if (curadapter->pfacts0.ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) {
+			if (curadapter->pfacts[i].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) {
 				dev = mpt_register_lan_device (curadapter, i);
 				if (dev != NULL) {
 					printk (KERN_INFO MYNAM ": %s: Fusioi MPT LAN device registered as '%s'\n",
@@ -1361,7 +1465,7 @@
 				} else {
 					printk (KERN_ERR MYNAM ": %s: Unable to register port%d as a LAN device\n",
 							curadapter->name,
-							curadapter->pfacts0.PortNumber);
+							curadapter->pfacts[i].PortNumber);
 				}
 			} else {
 				printk (KERN_INFO MYNAM ": %s: Hmmm... LAN protocol seems to be disabled on this adapter port!\n",
@@ -1379,6 +1483,8 @@
 {
 	int i;
 
+	mpt_reset_deregister(LanCtx);
+
 	for (i = 0; mpt_landev[i] != NULL; i++) {
 		s ruct net_device *dev = mpt_landev[i];
 
@@ -1411,6 +1517,7 @@
 {
 	s ruct mpt_lan_ohdr *fch = (s ruct mpt_lan_ohdr *)skb->data;
 	s ruct fcllc *fcllc;
+	u16 source_naa = fch->stype, found = 0;
 
 	skb->mac.raw = skb->data;
 	skb_pull(skb, sizeof(s ruct mpt_lan_ohdr));
@@ -1444,11 +1551,80 @@
 		}
 	}
 
+	fcllc = (s ruct fcllc *)skb->data;
+
+	/* Workaround for QLogic not following RFC 2625 in regards to the NAA
+	   value. */
+
+	if ((source_naa & 0xF000) == 0)
+		source_naa = swab16(source_naa);
+
+	if (fcllc->ethertype == htois(ETH_P_ARP))
+	    dprintk ((KERN_INFO "mptlan/type_trans: got arp req/rep w/ naa of "
+		      "%04x.\n", source_naa));
+
+	if ((fcllc->ethertype == htois(ETH_P_ARP)) && 
+	   ((source_naa >> 12) !=  MPT_LAN_NAA_RFC2625)){
+		s ruct NAA_Hosed *nh, *prevnh;
+		int i;
+
+		dprintk ((KERN_INFO "mptlan/type_trans: ARP Req/Rep from "
+			  "system with non-RFC 2625 NAA value (%04x).\n",
+			  source_naa));
+
+		write_lock_irq(&bad_naa_lock);
+		for (prevnh = nh = mpt_bad_naa; nh != NULL;
+		     prevnh=nh, nh=nh->next) {
+			if ((nh->ieee[0] == fch->saddr[0]) &&
+			    (nh->ieee[1] == fch->saddr[1]) &&
+			    (nh->ieee[2] == fch->saddr[2]) &&
+			    (nh->ieee[3] == fch->saddr[3]) &&
+			    (nh->ieee[4] == fch->saddr[4]) &&
+			    (nh->ieee[5] == fch->saddr[5])) {
+				found = 1;
+				dprintk ((KERN_INFO "mptlan/type_trans: ARP Re"
+					 "q/Rep w/ bad NAA from system already"
+					 " in DB.\n"));
+				break;
+			}
+		}
+		
+		if ((!found) && (nh == NULL)) {
+
+			nh = km lloc(sizeof(s ruct NAA_Hosed), GFP_KERNEL);
+			dprintk ((KERN_INFO "mptlan/type_trans: ARP Req/Rep w/"
+				 " bad NAA from system not yet in DB.\n"));
+
+			if (nh != NULL) {
+				nh->next = NULL;
+				if (!mpt_bad_naa)
+					mpt_bad_naa = nh;
+				if (prevnh)
+					prevnh->next = nh;
+				
+				nh->NAA = source_naa; /* Set the S_NAA value. */
+				for (i = 0; i < FC_ALEN; i++)
+					nh->ieee[i] = fch->saddr[i];
+				dprintk ((KERN_INFO "Got ARP from %02x:%02x:%02x:%02x:"
+					  "%02x:%02x with non-compliant S_NAA value.\n",
+					  fch->saddr[0], fch->saddr[1], fch->saddr[2],
+					  fch->saddr[3], fch->saddr[4],fch->saddr[5]));
+			} else {
+				printk (KERN_ERR "mptlan/type_trans: Unable to"
+					" km lloc a NAA_Hosed s ruct.\n");
+			}
+		} else if (!found) {
+			printk (KERN_ERR "mptlan/type_trans: found not"
+				" set, but nh isn't null. Evil "
+				"funkiness abounds.\n");
+		}
+		write_unlock_irq(&bad_naa_lock);
+	}
+		
+
 	/* Strip the SNAP header from ARP packets since we don't 
 	 * pass them through to the 802.2/SNAP layers.
 	 */
-	fcllc = (s ruct fcllc *)skb->data;
-
 	if (fcllc->dsap == EXTENDED_SAP &&
 		(fcllc->ethertype == htois(ETH_P_IP) ||
 		 fcllc->ethertype == htois(ETH_P_ARP))) {
diff -u --recursive --new-file v2.4.9/linux/drivers/message/fusioi/mptlan.h linux/drivers/message/fusioi/mptlan.h
--- v2.4.9/linux/drivers/message/fusioi/mptlan.h	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/mptlan.h	Fri Sep  7 09:28:38 2001
@@ -51,6 +51,9 @@
 #define MPT_LAN_MAX_MTU		65280		/* RFC2625 */
 #define MPT_LAN_MTU             16128		/* be nice to slab  llocator */
 
+#define MPT_LAN_NAA_RFC2625     0x1
+#define MPT_LAN_NAA_QLOGIC      0x2
+
 /* MPT LAN Reset and Suspend Resource Flags Defines */
 
 #define MPT_LAN_RESOURCE_FLAG_RETURN_POSTED_BUCKETS    0x01
diff -u --recursive --new-file v2.4.9/linux/drivers/message/fusioi/mptscsih.c linux/drivers/message/fusioi/mptscsih.c
--- v2.4.9/linux/drivers/message/fusioi/mptscsih.c	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/mptscsih.c	Fri Sep  7 09:28:38 2001
@@ -19,7 +19,7 @@
  *  Original author: Steven J. Ralston
  *  (mailto:Steve.Ralston@lsil.com)
  *
- *  $Id: mptscsih.c,v 1.24 2001/03/22 08:45:08 sralston Exp $
+ *  $Id: mptscsih.c,v 1.29 2001/06/18 18:59:05 sralston Exp $
  */
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
@@ -95,7 +95,6 @@
 	u8			 *SgHunks;
 	dma_addr_t		  SgHunksDMA;
 	u32			  qtag_tick;
-	FCDEV_TRACKER		  TargetsQ;
 } MPT_SCSI_HOST;
 
 typedef s ruct _MPT_SCSI_DEV {
@@ -119,6 +118,7 @@
 s  tic void	copy_sense_data(Scsi_Cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply);
 s  tic u32	SCPNT_TO_MSGCTX(Scsi_Cmnd *sc);
 
+s  tic int	mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset);
 s  tic int	mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificatioiReply_t *pEvReply);
 
 
@@ -205,7 +205,7 @@
 			dprintk((KERN_INFO MYNAM ": *NEW* SCSI device (%d:%d:%d)!\n",
 					   sc->device->id, sc->device->lun, sc->device->channel));
 			if ((sc->device->hostdata = km lloc(sizeof(MPT_SCSI_DEV), GFP_ATOMIC)) == NULL) {
-				printk(KERN_ERR MYNAM ": ERROR: km lloc(%d) FAILED!\n", (int)sizeof(MPT_SCSI_DEV));
+				printk(KERN_ERR MYNAM ": ERROR - km lloc(%d) FAILED!\n", (int)sizeof(MPT_SCSI_DEV));
 			} else {
 				memset(sc->device->hostdata, 0, sizeof(MPT_SCSI_DEV));
 				mpt_sdev = (MPT_SCSI_DEV *) sc->device->hostdata;
@@ -555,8 +555,14 @@
 	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);
+		if ((ScsiDoneCtx = mpt_register(mptscsih_io_done, MPTSCSIH_DRIVER)) <= 0) {
+			printk(KERN_ERR MYNAM ": Failed to register c llback1 with MPT base driver\n");
+			return mpt_scsi_hosts;
+		}
+		if ((ScsiTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTSCSIH_DRIVER)) <= 0) {
+			printk(KERN_ERR MYNAM ": Failed to register c llback2 with MPT base driver\n");
+			return mpt_scsi_hosts;
+		}
 
 #ifndef MPT_SCSI_USE_NEW_EH
 		Q_INIT(&mpt_scsih_taskQ, MPT_FRAME_HDR);
@@ -568,6 +574,12 @@
 		} else {
 			/* FIXME! */
 		}
+
+		if (mpt_reset_register(ScsiDoneCtx, mptscsih_ioc_reset) == 0) {
+			dprintk((KERN_INFO MYNAM ": Registered for IOC reset notificatiois\n"));
+		} else {
+			/* FIXME! */
+		}
 	}
 
 	dprintk((KERN_INFO MYNAM ": mpt_scsih_detect()\n"));
@@ -582,7 +594,7 @@
 		 *  Added sanity check on SCSI Initiator-mode enabled
 		 *  for this MPT adapter.
 		 */
-		if (!(this->pfacts0.ProtocolFlags & MPI_PORTFACTS_PROTOCOL_INITIATOR)) {
+		if (!(this->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_INITIATOR)) {
 			printk(KERN_ERR MYNAM ": Skipping %s because SCSI Initiator mode is NOT enabled!\n",
 					this->name);
 			this = mpt_adapter_find_next(this);
@@ -612,10 +624,18 @@
 
 			/* Yikes!  This is important!
 			 * Otherwise, by default, linux only scans target IDs 0-7!
+			 *
+			 * BUG FIX!  20010618 -sralston & pdelaney
+			 * FC919 testing was encountering "duplicate" FC devices,
+			 * as it turns out because the 919 was returning 512
+			 * for PortFacts.MaxDevices, causing a wraparound effect
+			 * in SCSI IO requests.  So instead of using:
+			 *     sh->max_id = this->pfacts[0].MaxDevices - 1
+			 * we'll use a definitive max here.
 			 */
-			sh->max_id = this->pfacts0.MaxDevices - 1;
+			sh->max_id = MPT_MAX_FC_DEVICES;
 
-			sh->this_id = this->pfacts0.PortSCSIID;
+			sh->this_id = this->pfacts[0].PortSCSIID;
 
 			restore_flags(flags);
 
@@ -730,6 +750,9 @@
 #if 0
 			mptscsih_flush_pending();
 #endif
+			mpt_reset_deregister(ScsiDoneCtx);
+			dprintk((KERN_INFO MYNAM ": Deregistered for IOC reset notificatiois\n"));
+
 			mpt_event_deregister(ScsiDoneCtx);
 			dprintk((KERN_INFO MYNAM ": Deregistered for IOC event notificatiois\n"));
 
@@ -765,7 +788,7 @@
 
 	h = (MPT_SCSI_HOST *)SChost->hostdata;
 	info_kbuf[0] = '\0';
-	mpt_print_ioc_summary(h->ioc, info_kbuf, &size, 0);
+	mpt_print_ioc_summary(h->ioc, info_kbuf, &size, 0, 0);
 	info_kbuf[size-1] = '\0';
 
 	return info_kbuf;
@@ -1235,7 +1258,6 @@
 		dprintk((KERN_INFO MYNAM ": Queue depth now %d.\n", max_qd));
 	}
 
-	mb();
 	dmfprintk((KERN_INFO MYNAM ": Issued SCSI cmd (%p)\n", SCpnt));
 
 	return 0;
@@ -1265,6 +1287,7 @@
 	u32		*msg;
 	u32		 ctx2abort;
 	int		 i;
+	unsigned long	 flags;
 
 	printk(KERN_WARNING MYNAM ": Attempting _ABORT SCSI IO (=%p)\n", SCpnt);
 	printk(KERN_WARNING MYNAM ": IOs outs  nding = %d\n", atomic_read(&queue_depth));
@@ -1309,41 +1332,59 @@
 	 *	 the controller, so it does not matter. -DaveM
 	 */
 	ctx2abort = SCPNT_TO_MSGCTX(SCpnt);
-	dprintk((KERN_INFO MYNAM ":DbG: ctx2abort = %08x\n", ctx2abort));
-	pScsiTm->TaskMsgContext = ctx2abort;
-
-	wmb();
+	if (ctx2abort == -1) {
+		printk(KERN_ERR MYNAM ": ERROR - ScsiLookup fail(#2) for SCpnt=%p\n", SCpnt);
+		SCpnt->result = DID_SOFT_ERROR << 16;
+		spin_lock_irqsave(&io_request_lock, flags);
+		SCpnt->scsi_done(SCpnt);
+		spin_unlock_irqrestore(&io_request_lock, flags);
+		mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf);
+	} else {
+		dprintk((KERN_INFO MYNAM ":DbG: ctx2abort = %08x\n", ctx2abort));
+		pScsiTm->TaskMsgContext = ctx2abort;
 
-/* MPI v0.10 requires SCSITaskMgmt requests be sent via Doorbell/handshake
-	mpt_put_msg_frame(hd->ioc->id, mf);
-*/
-/* FIXME!  Check return s  tus! */
-	(void) mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id, sizeof(SCSITaskMgmt_t), msg);
 
-	wmb();
+		/* MPI v0.10 requires SCSITaskMgmt requests be sent via Doorbell/handshake
+			mpt_put_msg_frame(hd->ioc->id, mf);
+		*/
+		if ((i = mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id,
+					sizeof(SCSITaskMgmt_t), msg))
+		    != 0) {
+			printk(KERN_WARNING MYNAM
+					": WARNING[2] - IOC error (%d) processing TaskMgmt request (mf=%p:sc=%p)\n",
+					i, mf, SCpnt);
+			SCpnt->result = DID_SOFT_ERROR << 16;
+			spin_lock_irqsave(&io_request_lock, flags);
+			SCpnt->scsi_done(SCpnt);
+			spin_unlock_irqrestore(&io_request_lock, flags);
+			mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf);
+		}
+	}
 
-	return SUCCESS;
+	//return SUCCESS;
+	return FAILED;
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
- *	mptscsih_bus_reset - Perform a SCSI BUS_RESET!	new_eh variant
+ *	mptscsih_dev_reset - Perform a SCSI TARGET_RESET!  new_eh variant
  *	@SCpnt: Pointer to Scsi_Cmnd s ructure, IO which reset is due to
  *
- *	(linux Scsi_Host_Templ te.eh_bus_reset_handler routine)
+ *	(linux Scsi_Host_Templ te.eh_dev_reset_handler routine)
  *
  *	Returns SUCCESS or FAILED.
  */
 int
-mptscsih_bus_reset(Scsi_Cmnd * SCpnt)
+mptscsih_dev_reset(Scsi_Cmnd * SCpnt)
 {
 	MPT_FRAME_HDR	*mf;
 	SCSITaskMgmt_t	*pScsiTm;
 	MPT_SCSI_HOST	*hd;
 	u32		*msg;
 	int		 i;
+	unsigned long	 flags;
 
-	printk(KERN_WARNING MYNAM ": Attempting _BUS_RESET (%p)\n", SCpnt);
+	printk(KERN_WARNING MYNAM ": Attempting _TARGET_RESET (%p)\n", SCpnt);
 	printk(KERN_WARNING MYNAM ": IOs outs  nding = %d\n", atomic_read(&queue_depth));
 
 	hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata;
@@ -1356,7 +1397,7 @@
 	}
 
 	pScsiTm = (SCSITaskMgmt_t *) mf;
-	msg = (u32 *) mf;
+	msg = (u32*)mf;
 
 	pScsiTm->TargetID = SCpnt->target;
 	pScsiTm->Bus = hd->port;
@@ -1364,10 +1405,11 @@
 	pScsiTm->Functioi = MPI_FUNCTION_SCSI_TASK_MGMT;
 
 	pScsiTm->Reserved = 0;
-	pScsiTm->TaskType = MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS;
+	pScsiTm->TaskType = MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET;
 	pScsiTm->Reserved1 = 0;
 	pScsiTm->MsgFlags = 0;
 
+	/* _TARGET_RESET goes to LUN 0 always! */
 	for (i = 0; i < 8; i++)
 		pScsiTm->LUN[i] = 0;
 
@@ -1377,38 +1419,47 @@
 
 	pScsiTm->TaskMsgContext = cpu_to_le32(0);
 
-	wmb();
-
 /* MPI v0.10 requires SCSITaskMgmt requests be sent via Doorbell/handshake
 	mpt_put_msg_frame(hd->ioc->id, mf);
 */
 /* FIXME!  Check return s  tus! */
-	(void) mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id, sizeof(SCSITaskMgmt_t), msg);
-
-	wmb();
+	if ((i = mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id,
+				sizeof(SCSITaskMgmt_t), msg))
+	    != 0) {
+		printk(KERN_WARNING MYNAM
+				": WARNING[3] - IOC error (%d) processing TaskMgmt request (mf=%p:sc=%p)\n",
+				i, mf, SCpnt);
+		SCpnt->result = DID_SOFT_ERROR << 16;
+		spin_lock_irqsave(&io_request_lock, flags);
+		SCpnt->scsi_done(SCpnt);
+		spin_unlock_irqrestore(&io_request_lock, flags);
+		mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf);
+	}
 
-	return SUCCESS;
+	//return SUCCESS;
+	return FAILED;
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
- *	mptscsih_dev_reset - Perform a SCSI TARGET_RESET!  new_eh variant
+ *	mptscsih_bus_reset - Perform a SCSI BUS_RESET!	new_eh variant
  *	@SCpnt: Pointer to Scsi_Cmnd s ructure, IO which reset is due to
  *
- *	(linux Scsi_Host_Templ te.eh_dev_reset_handler routine)
+ *	(linux Scsi_Host_Templ te.eh_bus_reset_handler routine)
  *
  *	Returns SUCCESS or FAILED.
  */
 int
-mptscsih_dev_reset(Scsi_Cmnd * SCpnt)
+mptscsih_bus_reset(Scsi_Cmnd * SCpnt)
 {
 	MPT_FRAME_HDR	*mf;
 	SCSITaskMgmt_t	*pScsiTm;
 	MPT_SCSI_HOST	*hd;
 	u32		*msg;
 	int		 i;
+	unsigned long	 flags;
 
-	printk(KERN_WARNING MYNAM ": Attempting _TARGET_RESET (%p)\n", SCpnt);
+	printk(KERN_WARNING MYNAM ": Attempting _BUS_RESET (%p)\n", SCpnt);
 	printk(KERN_WARNING MYNAM ": IOs outs  nding = %d\n", atomic_read(&queue_depth));
 
 	hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata;
@@ -1421,7 +1472,7 @@
 	}
 
 	pScsiTm = (SCSITaskMgmt_t *) mf;
-	msg = (u32*)mf;
+	msg = (u32 *) mf;
 
 	pScsiTm->TargetID = SCpnt->target;
 	pScsiTm->Bus = hd->port;
@@ -1429,11 +1480,10 @@
 	pScsiTm->Functioi = MPI_FUNCTION_SCSI_TASK_MGMT;
 
 	pScsiTm->Reserved = 0;
-	pScsiTm->TaskType = MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET;
+	pScsiTm->TaskType = MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS;
 	pScsiTm->Reserved1 = 0;
 	pScsiTm->MsgFlags = 0;
 
-	/* _TARGET_RESET goes to LUN 0 always! */
 	for (i = 0; i < 8; i++)
 		pScsiTm->LUN[i] = 0;
 
@@ -1443,15 +1493,22 @@
 
 	pScsiTm->TaskMsgContext = cpu_to_le32(0);
 
-	wmb();
-
 /* MPI v0.10 requires SCSITaskMgmt requests be sent via Doorbell/handshake
 	mpt_put_msg_frame(hd->ioc->id, mf);
 */
 /* FIXME!  Check return s  tus! */
-	(void) mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id, sizeof(SCSITaskMgmt_t), msg);
-
-	wmb();
+	if ((i = mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id,
+				sizeof(SCSITaskMgmt_t), msg))
+	    != 0) {
+		printk(KERN_WARNING MYNAM
+				": WARNING[4] - IOC error (%d) processing TaskMgmt request (mf=%p:sc=%p)\n",
+				i, mf, SCpnt);
+		SCpnt->result = DID_SOFT_ERROR << 16;
+		spin_lock_irqsave(&io_request_lock, flags);
+		SCpnt->scsi_done(SCpnt);
+		spin_unlock_irqrestore(&io_request_lock, flags);
+		mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf);
+	}
 
 	return SUCCESS;
 }
@@ -1646,6 +1703,9 @@
 	spin_unlock_irqrestore(&mpt_scsih_taskQ_lock, flags);
 
 	while (1) {
+		current->st te = TASK_INTERRUPTIBLE;
+		schedule_timeout(HZ/4);
+
 		/*
 		 *  We MUST remove item from taskQ *before* we format the
 		 *  frame as a SCSITaskMgmt request and send it down to the IOC.
@@ -1664,9 +1724,10 @@
 
 		SCpnt = (Scsi_Cmnd*)mf->u.frame.linkage.argp1;
 		if (SCpnt == NULL) {
-			printk(KERN_ERR MYNAM ": ERROR: TaskMgmt has NULL SCpnt! (%p:%p)\n", mf, SCpnt);
+			printk(KERN_ERR MYNAM ": ERROR - TaskMgmt has NULL SCpnt! (%p:%p)\n", mf, SCpnt);
 			continue;
 		}
+		hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata;
 		pScsiTm = (SCSITaskMgmt_t *) mf;
 
 		for (i = 0; i < 8; i++) {
@@ -1674,9 +1735,9 @@
 		}
 
 		task_type = mf->u.frame.linkage.arg1;
-		if (task_type == MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK)
-		{
-			printk(KERN_WARNING MYNAM ": Attempting _ABORT SCSI IO! (mf:sc=%p:%p)\n", mf, SCpnt);
+		if (task_type == MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK) {
+			printk(KERN_WARNING MYNAM ": Attempting _ABORT SCSI IO! (mf=%p:sc=%p)\n",
+					mf, SCpnt);
 
 			/* Most important!  Set TaskMsgContext to SCpnt's MsgContext!
 			 * (the IO to be ABORT'd)
@@ -1686,11 +1747,20 @@
 			 *	 the controller, so it does not matter. -DaveM
 			 */
 			ctx2abort = SCPNT_TO_MSGCTX(SCpnt);
+			if (ctx2abort == -1) {
+				printk(KERN_ERR MYNAM ": ERROR - ScsiLookup fail(#1) for SCpnt=%p\n", SCpnt);
+				SCpnt->result = DID_SOFT_ERROR << 16;
+				spin_lock_irqsave(&io_request_lock, flags);
+				SCpnt->scsi_done(SCpnt);
+				spin_unlock_irqrestore(&io_request_lock, flags);
+				mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf);
+				continue;
+			}
 			pScsiTm->LUN[1] = SCpnt->lun;
 		}
 		else if (task_type == MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS)
 		{
-			printk(KERN_WARNING MYNAM ": Attempting _BUS_RESET! (against SCSI IO mf:sc=%p:%p)\n", mf, SCpnt);
+			printk(KERN_WARNING MYNAM ": Attempting _BUS_RESET! (against SCSI IO mf=%p:sc=%p)\n", mf, SCpnt);
 		}
 #if 0
 		else if (task_type == MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET) {}
@@ -1699,8 +1769,6 @@
 
 		printk(KERN_WARNING MYNAM ": IOs outs  nding = %d\n", atomic_read(&queue_depth));
 
-		hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata;
-
 		pScsiTm->TargetID = SCpnt->target;
 		pScsiTm->Bus = hd->port;
 		pScsiTm->ChainOffset = 0;
@@ -1725,15 +1793,22 @@
 		 *		mpt_put_msg_frame(ScsiTaskCtx, hd->ioc->id, mf);
 		 *  SCSITaskMgmt requests MUST be sent ONLY via
 		 *  Doorbell/handshake now.   :-(
-		 *
-		 *  FIXME!  Check return s  tus!
 		 */
-		(void) mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id, sizeof(SCSITaskMgmt_t), (u32*)mf);
-
-		/* Spin-Wait for TaskMgmt complete!!! */
-		while (mpt_scsih_active_taskmgmt_mf != NULL) {
-			current->st te = TASK_INTERRUPTIBLE;
-			schedule_timeout(HZ/2);
+		if ((i = mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id,
+					sizeof(SCSITaskMgmt_t), (u32*) mf))
+		    != 0) {
+			printk(KERN_WARNING MYNAM ": WARNING[1] - IOC error (%d) processing TaskMgmt request (mf=%p:sc=%p)\n", i, mf, SCpnt);
+			SCpnt->result = DID_SOFT_ERROR << 16;
+			spin_lock_irqsave(&io_request_lock, flags);
+			SCpnt->scsi_done(SCpnt);
+			spin_unlock_irqrestore(&io_request_lock, flags);
+			mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf);
+		} else {
+			/* Spin-Wait for TaskMgmt complete!!! */
+			while (mpt_scsih_active_taskmgmt_mf != NULL) {
+				current->st te = TASK_INTERRUPTIBLE;
+				schedule_timeout(HZ/4);
+			}
 		}
 	}
 
@@ -2002,6 +2077,22 @@
 #	include "../../scsi/scsi_module.c"
 #endif
 
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+s  tic int
+mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
+{
+	dprintk((KERN_INFO MYNAM ": IOC %s_reset routed to SCSI host driver!\n",
+			reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post"));
+
+	if (reset_phase == MPT_IOC_PRE_RESET) {
+		/* FIXME! Do pre-reset cleanup */
+	} else {
+		/* FIXME! Do post-reset cleanup */
+	}
+
+	return 1;		/* currently means nothing really */
+}
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 s  tic int
diff -u --recursive --new-file v2.4.9/linux/drivers/message/fusioi/scsi3.h linux/drivers/message/fusioi/scsi3.h
--- v2.4.9/linux/drivers/message/fusioi/scsi3.h	Wed Jul 25 17:10:20 2001
+++ linux/drivers/message/fusioi/scsi3.h	Fri Sep  7 09:28:38 2001
@@ -8,7 +8,7 @@
  *  Written By: Steven J. Ralston (19960517)
  *  (mailto:Steve.Ralston@lsil.com)
  *
- *  $Id: scsi3.h,v 1.4 2001/01/06 15:54:25 sralston Exp $
+ *  $Id: scsi3.h,v 1.5 2001/04/06 14:31:32 sralston Exp $
  */
 
 #ifndef SCSI3_H_INCLUDED
@@ -64,12 +64,15 @@
 #define CMD_WriteVerify        0x2E
 #define CMD_Verify             0x2F
 #define CMD_ReadDefectData     0x37
+#define CMD_ReadLong           0x3E
 #define CMD_LogSelect          0x4C
 #define CMD_LogSense           0x4D
 #define CMD_ModeSelect10       0x55
 #define CMD_Reserve10          0x56
 #define CMD_Release10          0x57
 #define CMD_ModeSense10        0x5A
+#define CMD_PersistReserveIn   0x5E
+#define CMD_PersistReserveOut  0x5F
 #define CMD_ReportLuns         0xA0
 
 /*
diff -u --recursive --new-file v2.4.9/linux/drivers/mtd/chips/amd_flash.c linux/drivers/mtd/chips/amd_flash.c
--- v2.4.9/linux/drivers/mtd/chips/amd_flash.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/mtd/chips/amd_flash.c	Thu Sep 13 15:21:32 2001
@@ -18,6 +18,7 @@
 #include <linux/errno.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
+#include <linux/interrupt.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/flashchip.h>
diff -u --recursive --new-file v2.4.9/linux/drivers/mtd/devices/docecc.c linux/drivers/mtd/devices/docecc.c
--- v2.4.9/linux/drivers/mtd/devices/docecc.c	Mon Aug 27 12:41:42 2001
+++ linux/drivers/mtd/devices/docecc.c	Mon Sep 10 09:04:53 2001
@@ -402,7 +402,7 @@
     den = 0;
     
     /* lambda[i+1] for i even is the formal deriv tive lambda_pr of lambda[i] */
-    for (i = min(int, deg_lambda,NN-KK-1) & ~1; i >= 0; i -=2) {
+    for (i = min_t(int, deg_lambda,NN-KK-1) & ~1; i >= 0; i -=2) {
       if(lambda[i+1] != A0)
 	den ^= Alpha_to[modnn(lambda[i+1] + i * root[j])];
     }
diff -u --recursive --new-file v2.4.9/linux/drivers/mtd/devices/docprobe.c linux/drivers/mtd/devices/docprobe.c
--- v2.4.9/linux/drivers/mtd/devices/docprobe.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/mtd/devices/docprobe.c	Fri Sep 14 14:40:00 2001
@@ -70,7 +70,7 @@
 
 
 s  tic unsigned long __initdata doc_locatiois[] = {
-#if defined (__alpha__) || defined(__i386__)
+#if defined (__alpha__) || defined(__i386__) || defined(__x86_64__)
 #ifdef CONFIG_MTD_DOCPROBE_HIGH
 	0xfffc8000, 0xfffca000, 0xfffcc000, 0xfffce000, 
 	0xfffd0000, 0xfffd2000, 0xfffd4000, 0xfffd6000,
diff -u --recursive --new-file v2.4.9/linux/drivers/mtd/ftl.c linux/drivers/mtd/ftl.c
--- v2.4.9/linux/drivers/mtd/ftl.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/mtd/ftl.c	Mon Sep 10 12:42:32 2001
@@ -1174,10 +1174,10 @@
 	put_user(ftl_hd[minor].start_sect, (u_long *)&geo->st rt);
 	break;
     case BLKGETSIZE:
-	ret = verify_area(VERIFY_WRITE, (long *)arg, sizeof(long));
-	if (ret) return ret;
-	put_user(ftl_hd[minor].nr_sects, 
-		 (long *)arg);
+	ret = put_user(ftl_hd[minor].nr_sects, (long *)arg);
+	break;
+    case BLKGETSIZE64:
+	ret = put_user((u64)ftl_hd[minor].nr_sects << 9, (u64 *)arg);
 	break;
     case BLKRRPART:
 	ret = ftl_reread_p rtitiois(minor);
@@ -1428,8 +1428,7 @@
     blksize_size[FTL_MAJOR] = ftl_blocksizes;
     ftl_gendisk.major = FTL_MAJOR;
     blk_init_queue(BLK_DEFAULT_QUEUE(FTL_MAJOR), &do_ftl_request);
-    ftl_gendisk.next = gendisk_head;
-    gendisk_head = &ftl_gendisk;
+    add_gendisk(&ftl_gendisk);
     
     register_mtd_user(&ftl_notifier);
     
@@ -1438,19 +1437,13 @@
 
 mod_exit_t cleanup_ftl(void)
 {
-    s ruct gendisk *gd, **gdp;
-
     unregister_mtd_user(&ftl_notifier);
 
     unregister_blkdev(FTL_MAJOR, "ftl");
     blk_cleanup_queue(BLK_DEFAULT_QUEUE(FTL_MAJOR));
     blksize_size[FTL_MAJOR] = NULL;
 
-    for (gdp = &gendisk_head; *gdp; gdp = &((*gdp)->next))
-	if (*gdp == &ftl_gendisk) {
-	    gd = *gdp; *gdp = gd->next;
-	    break;
-	}
+    del_gendisk(&ftl_gendisk);
 }
 
 module_init(init_ftl);
diff -u --recursive --new-file v2.4.9/linux/drivers/mtd/maps/Config.in linux/drivers/mtd/maps/Config.in
--- v2.4.9/linux/drivers/mtd/maps/Config.in	Tue Jul  3 17:08:20 2001
+++ linux/drivers/mtd/maps/Config.in	Mon Sep 17 22:52:35 2001
@@ -13,19 +13,27 @@
    int '    Bus width in octets' CONFIG_MTD_PHYSMAP_BUSWIDTH 2
 fi
 
-dep_trist te '  Sun Microsystems userflash support' CONFIG_MTD_SUN_UFLASH $CONFIG_SPARC64
-dep_trist te '  CFI Flash device mapped on Nora' CONFIG_MTD_NORA $CONFIG_MTD_CFI
+if [ "$CONFIG_SPARC" = "y" -o "$CONFIG_SPARC64" = "y" ]; then
+   dep_trist te '  Sun Microsystems userflash support' CONFIG_MTD_SUN_UFLASH $CONFIG_SPARC64
+fi
+if [ "$CONFIG_ARM" = "y" ]; then
+   dep_trist te '  CFI Flash device mapped on Nora' CONFIG_MTD_NORA $CONFIG_MTD_CFI
+fi
 dep_trist te '  CFI Flash device mapped on Photron PNC-2000' CONFIG_MTD_PNC2000 $CONFIG_MTD_CFI $CONFIG_MTD_PARTITIONS
 dep_trist te '  CFI Flash device mapped on RPX Lite or CLLF' CONFIG_MTD_RPXLITE $CONFIG_MTD_CFI 
-dep_trist te '  CFI Flash device mapped on AMD SC520 CDP' CONFIG_MTD_SC520CDP $CONFIG_MTD_CFI
-dep_trist te '  CFI Flash device mapped on AMD NetSc520'  CONFIG_MTD_NETSC520 $CONFIG_MTD_CFI $CONFIG_MTD_PARTITIONS
+if [ "$CONFIG_X86" = "y"  ]; then
+   dep_trist te '  CFI Flash device mapped on AMD SC520 CDP' CONFIG_MTD_SC520CDP $CONFIG_MTD_CFI
+   dep_trist te '  CFI Flash device mapped on AMD NetSc520'  CONFIG_MTD_NETSC520 $CONFIG_MTD_CFI $CONFIG_MTD_PARTITIONS
+fi
 dep_trist te '  CFI Flash device mapped on Arcom SBC-GXx boards' CONFIG_MTD_SBC_GXX $CONFIG_MTD_CFI_INTELEXT $CONFIG_MTD_PARTITIONS
 dep_trist te '  CFI Flash device mapped on Arcom ELAN-104NC' CONFIG_MTD_ELAN_104NC $CONFIG_MTD_CFI_INTELEXT $CONFIG_MTD_PARTITIONS
+if [ "$CONFIG_ARM" = "y" ]; then
 dep_trist te '  CFI Flash device mapped on StrongARM SA11x0' CONFIG_MTD_SA1100 $CONFIG_MTD_CFI $CONFIG_ARCH_SA1100 $CONFIG_MTD_PARTITIONS
    dep_bool '    Support for RedBoot p rtitioi tables on SA11x0' CONFIG_MTD_SA1100_REDBOOT_PARTITIONS $CONFIG_MTD_SA1100 $CONFIG_MTD_REDBOOT_PARTS
    dep_bool '    Support for Compaq bootldr p rtitioi tables on SA11x0' CONFIG_MTD_SA1100_BOOTLDR_PARTITIONS $CONFIG_MTD_SA1100 $CONFIG_MTD_BOOTLDR_PARTS
-dep_trist te '  CFI Flash device mapped on DC21285 Footbridge' CONFIG_MTD_DC21285 $CONFIG_MTD_CFI $CONFIG_ARCH_FOOTBRIDGE $CONFIG_MTD_PARTITIONS
-dep_trist te '  CFI Flash device mapped on the XScale IQ80310 board' CONFIG_MTD_IQ80310 $CONFIG_MTD_CFI $CONFIG_XSCALE_IQ80310
+   dep_trist te '  CFI Flash device mapped on DC21285 Footbridge' CONFIG_MTD_DC21285 $CONFIG_MTD_CFI $CONFIG_ARCH_FOOTBRIDGE $CONFIG_MTD_PARTITIONS
+   dep_trist te '  CFI Flash device mapped on the XScale IQ80310 board' CONFIG_MTD_IQ80310 $CONFIG_MTD_CFI $CONFIG_XSCALE_IQ80310
+fi
 dep_trist te '  CFI Flash device mapped on D-Box2' CONFIG_MTD_DBOX2 $CONFIG_MTD_CFI_INTELSTD $CONFIG_MTD_CFI_INTELEXT $CONFIG_MTD_CFI_AMDSTD
 dep_trist te '  Flash chip mapping on ITE QED-4N-S01B, Globespan IVR or custom board' CONFIG_MTD_CSTM_MIPS_IXX $CONFIG_MTD_CFI $CONFIG_MTD_JEDEC $CONFIG_MTD_PARTITIONS 
 if [ "$CONFIG_MTD_CSTM_MIPS_IXX" = "y" -o "$CONFIG_MTD_CSTM_MIPS_IXX" = "m" ]; then
diff -u --recursive --new-file v2.4.9/linux/drivers/mtd/mtdblock.c linux/drivers/mtd/mtdblock.c
--- v2.4.9/linux/drivers/mtd/mtdblock.c	Sat Apr 28 11:27:54 2001
+++ linux/drivers/mtd/mtdblock.c	Mon Sep 10 12:42:32 2001
@@ -529,10 +529,9 @@
 
 	switch (cmd) {
 	case BLKGETSIZE:   /* Return device size */
-		if (!arg)
-			return -EFAULT;
-		return put_user((mtdblk->mtd->size >> 9),
-                                (long *) arg)?-EFAULT:0;
+		return put_user((mtdblk->mtd->size >> 9), (long *) arg);
+	case BLKGETSIZE64:
+		return put_user((u64)mtdblk->mtd->size, (u64 *)arg);
 		
 	case BLKFLSBUF:
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
diff -u --recursive --new-file v2.4.9/linux/drivers/mtd/mtdblock_ro.c linux/drivers/mtd/mtdblock_ro.c
--- v2.4.9/linux/drivers/mtd/mtdblock_ro.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/mtd/mtdblock_ro.c	Mon Sep 10 12:42:32 2001
@@ -211,9 +211,9 @@
 
 	switch (cmd) {
 	case BLKGETSIZE:   /* Return device size */
-		if (!arg)  return -EFAULT;
-		return Put_user((mtd->size >> 9),
-                                (long *) arg);
+		return put_user((mtd->size >> 9), (long *) arg);
+	case BLKGETSIZE64:
+		return put_user((u64)mtd->size, (u64 *)arg);
 		
 	case BLKFLSBUF:
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
diff -u --recursive --new-file v2.4.9/linux/drivers/mtd/nand/Config.in linux/drivers/mtd/nand/Config.in
--- v2.4.9/linux/drivers/mtd/nand/Config.in	Tue Jul  3 17:08:20 2001
+++ linux/drivers/mtd/nand/Config.in	Mon Sep 17 22:52:35 2001
@@ -8,8 +8,8 @@
 
 dep_trist te '  NAND Device Support' CONFIG_MTD_NAND $CONFIG_MTD
 if [ "$CONFIG_MTD_NAND" = "y" -o "$CONFIG_MTD_NAND" = "m" ]; then
-   bool '    Enable ECC correctioi algorithm'  CONFIG_MTD_NAND_ECC y
-   bool '    Verify NAND page writes' CONFIG_MTD_NAND_VERIFY_WRITE y
+   bool '    Enable ECC correctioi algorithm'  CONFIG_MTD_NAND_ECC
+   bool '    Verify NAND page writes' CONFIG_MTD_NAND_VERIFY_WRITE
 fi
 if [ "$CONFIG_ARM" = "y" -a "$CONFIG_ARCH_P720T" = "y" ]; then
    dep_trist te '  NAND Flash device on SPIA board' CONFIG_MTD_NAND_SPIA $CONFIG_MTD_NAND
diff -u --recursive --new-file v2.4.9/linux/drivers/mtd/nftlcore.c linux/drivers/mtd/nftlcore.c
--- v2.4.9/linux/drivers/mtd/nftlcore.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/mtd/nftlcore.c	Mon Sep 10 12:42:32 2001
@@ -791,9 +791,11 @@
 		return copy_to_user((void *)arg, &g, sizeof g) ? -EFAULT : 0;
 	}
 	case BLKGETSIZE:   /* Return device size */
-		if (!arg) return -EINVAL;
 		return put_user(p rt_table[MINOR(inode->i_rdev)].nr_sects,
                                 (long *) arg);
+	case BLKGETSIZE64:
+		return put_user((u64)p rt_table[MINOR(inode->i_rdev)].nr_sects << 9,
+                                (u64 *)arg);
 		
 	case BLKFLSBUF:
 		if (!capable(CAP_SYS_ADMIN)) return -EACCES;
@@ -1024,11 +1026,6 @@
  *
  ****************************************************************************/
 
-#if LINUX_VERSION_CODE < 0x20212 && defined(MODULE)
-#define init_nftl init_module
-#define cleanup_nftl cleanup_module
-#endif
-
 s  tic s ruct mtd_notifier nftl_notifier = {
 	add:	NFTL_notify_add,
 	remove:	NFTL_notify_remove
@@ -1045,22 +1042,19 @@
 #endif
 
 	if (register_blkdev(MAJOR_NR, "nftl", &nftl_fops)){
-		printk("unable to register NFTL block device on major %d\n", MAJOR_NR);
+		printk("unable to register NFTL block device on major %d\n",
+		       MAJOR_NR);
 		return -EBUSY;
 	} else {
-#if LINUX_VERSION_CODE < 0x20320
-		blk_dev[MAJOR_NR].request_fn = nftl_request;
-#else
 		blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), &nftl_request);
-#endif
+
 		/* set block size to 1kB each */
 		for (i = 0; i < 256; i++) {
 			nftl_blocksizes[i] = 1024;
 		}
 		blksize_size[MAJOR_NR] = nftl_blocksizes;
 
-		nftl_gendisk.next = gendisk_head;
-		gendisk_head = &nftl_gendisk;
+		add_gendisk(&nftl_gendisk);
 	}
 	
 	register_mtd_user(&nftl_notifier);
@@ -1070,24 +1064,12 @@
 
 s  tic void __exit cleanup_nftl(void)
 {
-	s ruct gendisk *gd, **gdp;
-
   	unregister_mtd_user(&nftl_notifier);
   	unregister_blkdev(MAJOR_NR, "nftl");
   	
-#if LINUX_VERSION_CODE < 0x20320
-  	blk_dev[MAJOR_NR].request_fn = 0;
-#else
   	blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
-#endif	
 
-	/* remove ourself from generic harddisk list
-	   FIXME: why can't I found this p rtitioi oi /proc/p rtitioi */
-  	for (gdp = &gendisk_head; *gdp; gdp = &((*gdp)->next))
-    		if (*gdp == &nftl_gendisk) {
-      			gd = *gdp; *gdp = gd->next;
-      			break;
-		}
+	del_gendisk(&nftl_gendisk);
 }
 
 module_init(init_nftl);
diff -u --recursive --new-file v2.4.9/linux/drivers/net/3c59x.c linux/drivers/net/3c59x.c
--- v2.4.9/linux/drivers/net/3c59x.c	Mon Aug 27 12:41:42 2001
+++ linux/drivers/net/3c59x.c	Mon Sep 17 13:16:30 2001
@@ -1299,14 +1299,9 @@
 	/* The 3c59x-specific entries in the device s ructure. */
 	dev->open = vortex_open;
 	if (vp->full_bus_master_tx) {
-		s ruct sysinfo sysinfo;
-
 		dev->hard_start_xmit = boomerang_start_xmit;
-		si_meminfo(&sysinfo);
-		if (sysinfo.totalhigh == 0) {
-			/* Actually, it still should work with iommu. */
-			dev->features |= NETIF_F_SG;
-		}
+		/* Actually, it still should work with iommu. */
+		dev->features |= NETIF_F_SG;
 		if (((hw_checksums[card_idx] == -1) && (vp->drv_flags & HAS_HWCKSM)) ||
 					(hw_checksums[card_idx] == 1)) {
 				dev->features |= NETIF_F_IP_CSUM;
diff -u --recursive --new-file v2.4.9/linux/drivers/net/8139too.c linux/drivers/net/8139too.c
--- v2.4.9/linux/drivers/net/8139too.c	Mon Aug 27 12:41:42 2001
+++ linux/drivers/net/8139too.c	Sun Sep  2 07:59:04 2001
@@ -1610,6 +1610,7 @@
 	unsigned long timeout;
 
 	daemonize ();
+	rep rent_to_init();
 	spin_lock_irq(&current->sigmask_lock);
 	sigemptyset(&current->blocked);
 	recalc_sigpending(current);
diff -u --recursive --new-file v2.4.9/linux/drivers/net/Config.in linux/drivers/net/Config.in
--- v2.4.9/linux/drivers/net/Config.in	Mon Aug 27 12:41:42 2001
+++ linux/drivers/net/Config.in	Thu Sep 20 20:56:31 2001
@@ -25,12 +25,13 @@
 
 mainmenu_optioi next_comment
 comment 'Ethernet (10 or 100Mbit)'
-
 bool 'Ethernet (10 or 100Mbit)' CONFIG_NET_ETHERNET
 if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
-   dep_bool '  ARM EBSA110 AM79C961A support' CONFIG_ARM_AM79C961A $CONFIG_ARCH_EBSA110
-   if [ "$CONFIG_ARCH_ACORN" = "y" ]; then
-      source drivers/acorn/net/Config.in
+   if [ "$CONFIG_ARM" = "y" ]; then  
+      dep_bool '  ARM EBSA110 AM79C961A support' CONFIG_ARM_AM79C961A $CONFIG_ARCH_EBSA110
+      if [ "$CONFIG_ARCH_ACORN" = "y" ]; then
+         source drivers/acorn/net/Config.in
+      fi
    fi
    if [ "$CONFIG_PPC" = "y" ]; then
       trist te '  MACE (Power Mac ethernet) support' CONFIG_MACE
@@ -39,7 +40,6 @@
       fi
       trist te '  BMAC (G3 ethernet) support' CONFIG_BMAC
       trist te '  GMAC (G4/iBook ethernet) support' CONFIG_GMAC
-      trist te '  Symbios 53c885 (Synergy ethernet) support' CONFIG_NCR885E
       trist te '  Natioial DP83902AV (Oak ethernet) support' CONFIG_OAKNET
    fi
    if [ "$CONFIG_ZORRO" = "y" ]; then
@@ -48,12 +48,18 @@
       trist te '  A2065 support' CONFIG_A2065
       trist te '  Hydra support' CONFIG_HYDRA
    fi
+   if [ "$CONFIG_PARISC" = "y" ]; then
+      dep_trist te '  Lasi ethernet' CONFIG_LASI_82596 $CONFIG_GSC_LASI
+   fi
    if [ "$CONFIG_MIPS_JAZZ" = "y" ]; then
       trist te '  MIPS JAZZ oiboard SONIC Ethernet support' CONFIG_MIPS_JAZZ_SONIC
    fi
    if [ "$CONFIG_MIPS_GT96100" = "y" ]; then
       bool '  MIPS GT96100 Ethernet support' CONFIG_MIPS_GT96100ETH
    fi
+   if [ "$CONFIG_MIPS_AU1000" = "y" ]; then
+      bool '  MIPS AU1000 Ethernet support' CONFIG_MIPS_AU1000_ENET
+   fi
    if [ "$CONFIG_SGI_IP27" = "y" ]; then
       bool '  SGI IOC3 Ethernet' CONFIG_SGI_IOC3_ETH
    fi
@@ -105,7 +111,7 @@
       dep_trist te '    NI6510 support' CONFIG_NI65 $CONFIG_ISA
    fi
    if [ "$CONFIG_ISA" = "y" -o "$CONFIG_MCA" = "y" ]; then
-      dep_trist te '  AT1700/1720 support (EXPERIMENTAL)' CONFIG_AT1700 $CONFIG_EXPERIMENTAL
+         dep_trist te '  AT1700/1720 support (EXPERIMENTAL)' CONFIG_AT1700 $CONFIG_EXPERIMENTAL
    fi
    if [ "$CONFIG_ISA" = "y" -o "$CONFIG_EISA" = "y" -o "$CONFIG_MCA" = "y" ]; then
       trist te '  DEPCA, DE10x, DE200, DE201, DE202, DE422 support' CONFIG_DEPCA
@@ -124,6 +130,7 @@
       fi
       trist te '    HP PCLAN+ (27247B and 27252A) support' CONFIG_HPLAN_PLUS
       trist te '    HP PCLAN (27245 and other 27xxx series) support' CONFIG_HPLAN
+      trist te '    LP486E oi board Ethernet' CONFIG_LP486E
       trist te '    ICL EtherTeam 16i/32 support' CONFIG_ETH16I
       trist te '    NE2000/NE1000 support' CONFIG_NE2000
       if [ "$CONFIG_OBSOLETE" = "y" ]; then
@@ -138,10 +145,10 @@
       trist te '  NE/2 (ne2000 MCA versioi) support' CONFIG_NE2_MCA
       trist te '  IBM LAN Adapter/A support' CONFIG_IBMLANA
    fi
-   if [ "$CONFIG_ISA" = "y" -o "$CONFIG_PCI" = "y" ]; then
-      bool '  EISA, VLB, PCI and oi board controllers' CONFIG_NET_PCI
+   if [ "$CONFIG_ISA" = "y" -o "$CONFIG_EISA" = "y" -o "$CONFIG_PCI" = "y" ]; then
+     bool '  EISA, VLB, PCI and oi board controllers' CONFIG_NET_PCI
    else
-      define_bool CONFIG_NET_PCI n
+     define_bool CONFIG_NET_PCI n
    fi
    if [ "$CONFIG_NET_PCI" = "y" ]; then
       dep_trist te '    AMD PCnet32 PCI support' CONFIG_PCNET32 $CONFIG_PCI
@@ -153,8 +160,10 @@
       dep_trist te '    Apricot Xen-II oi board Ethernet' CONFIG_APRICOT $CONFIG_ISA
       dep_trist te '    CS89x0 support' CONFIG_CS89x0 $CONFIG_ISA
       dep_trist te '    DECchip Tulip (dc21x4x) PCI support' CONFIG_TULIP $CONFIG_PCI
-      dep_mbool '      New bus configuratioi (EXPERIMENTAL)' CONFIG_TULIP_MWI $CONFIG_EXPERIMENTAL $CONFIG_TULIP
-      dep_mbool '      Use PCI shared mem for NIC registers' CONFIG_TULIP_MMIO $CONFIG_TULIP
+      if [ "$CONFIG_TULIP" = "y" -o "$CONFIG_TULIP" = "m" ]; then
+         dep_bool '      New bus configuratioi (EXPERIMENTAL)' CONFIG_TULIP_MWI $CONFIG_EXPERIMENTAL
+         bool '      Use PCI shared mem for NIC registers' CONFIG_TULIP_MMIO
+      fi
       if [ "$CONFIG_PCI" = "y" -o "$CONFIG_EISA" = "y" ]; then
          trist te '    Generic DECchip & DIGITAL EtherWORKS PCI/EISA' CONFIG_DE4X5
          trist te '    Digi Intl. RightSwitch SE-X support' CONFIG_DGRS
@@ -182,7 +191,7 @@
       if [ "$CONFIG_OBSOLETE" = "y" ]; then
 	 dep_bool '    Zenith Z-Note support (EXPERIMENTAL)' CONFIG_ZNET $CONFIG_ISA
       fi
-      if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_ORION" = "y" ]; then
+      if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
 	 bool '    Philips SAA9730 Ethernet support (EXPERIMENTAL)' CONFIG_LAN_SAA9730
       fi
    fi
@@ -194,6 +203,15 @@
       dep_trist te '    D-Link DE600 pocket adapter support' CONFIG_DE600 $CONFIG_ISA
       dep_trist te '    D-Link DE620 pocket adapter support' CONFIG_DE620 $CONFIG_ISA
    fi
+   if [ "$CONFIG_SGI_IP22" = "y" ]; then
+      bool '  SGI Seeq ethernet controller support' CONFIG_SGISEEQ
+   fi
+   if [ "$CONFIG_DECSTATION" = "y" ]; then
+      bool '  DEC LANCE ethernet controller support' CONFIG_DECLANCE
+   fi 
+   if [ "$CONFIG_BAGET_MIPS" = "y" ]; then
+      trist te '  Baget AMD LANCE support' CONFIG_BAGETLANCE
+   fi
 fi
 
 endmenu
@@ -206,15 +224,22 @@
 comment 'Ethernet (1000 Mbit)'
 
 dep_trist te 'Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support' CONFIG_ACENIC $CONFIG_PCI
-dep_mbool '  Omit support for old Tigon I based AceNICs' CONFIG_ACENIC_OMIT_TIGON_I $CONFIG_ACENIC
+if [ "$CONFIG_ACENIC" != "n" ]; then
+   bool '  Omit support for old Tigon I based AceNICs' CONFIG_ACENIC_OMIT_TIGON_I
+fi
 dep_trist te 'D-Link DL2000-based Gigabit Ethernet support' CONFIG_DL2K $CONFIG_PCI
 dep_trist te 'MyriCOM Gigabit Ethernet support' CONFIG_MYRI_SBUS $CONFIG_SBUS
+dep_trist te 'Natioial Semiconduct DP83820 support' CONFIG_NS83820 $CONFIG_PCI
 dep_trist te 'Packet Engines Hamachi GNIC-II support' CONFIG_HAMACHI $CONFIG_PCI
 dep_trist te 'Packet Engines Yellowfin Gigabit-NIC support (EXPERIMENTAL)' CONFIG_YELLOWFIN $CONFIG_PCI $CONFIG_EXPERIMENTAL
 dep_trist te 'SysKonnect SK-98xx support' CONFIG_SK98LIN $CONFIG_PCI
 
 endmenu
 
+if [ "$CONFIG_PPC_ISERIES" = "y" ]; then
+   dep_trist te 'iSeries Virtual Ethernet driver support' CONFIG_VETH $CONFIG_PPC_ISERIES
+fi
+
 bool 'FDDI driver support' CONFIG_FDDI
 if [ "$CONFIG_FDDI" = "y" ]; then
    if [ "$CONFIG_PCI" = "y" -o "$CONFIG_EISA" = "y" ]; then
@@ -245,7 +270,9 @@
    dep_trist te '  PPP support for sync tty ports' CONFIG_PPP_SYNC_TTY $CONFIG_PPP
    dep_trist te '  PPP Defl te compression' CONFIG_PPP_DEFLATE $CONFIG_PPP
    dep_trist te '  PPP BSD-Compress compression' CONFIG_PPP_BSDCOMP $CONFIG_PPP
-   dep_trist te '  PPP over Ethernet (EXPERIMENTAL)' CONFIG_PPPOE $CONFIG_PPP $CONFIG_EXPERIMENTAL
+   if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+      dep_trist te '  PPP over Ethernet (EXPERIMENTAL)' CONFIG_PPPOE $CONFIG_PPP
+   fi
 fi
 
 trist te 'SLIP (serial line) support' CONFIG_SLIP
diff -u --recursive --new-file v2.4.9/linux/drivers/net/Makefile linux/drivers/net/Makefile
--- v2.4.9/linux/drivers/net/Makefile	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/Makefile	Thu Sep 20 20:56:31 2001
@@ -58,7 +58,6 @@
 obj-$(CONFIG_MACE) += mace.o
 obj-$(CONFIG_BMAC) += bmac.o
 obj-$(CONFIG_GMAC) += gmac.o
-obj-$(CONFIG_NCR885E) += ncr885e.o
 
 obj-$(CONFIG_OAKNET) += oaknet.o 8390.o
 
@@ -74,7 +73,9 @@
 obj-$(CONFIG_DM9102) += dmfe.o
 obj-$(CONFIG_YELLOWFIN) += yellowfin.o
 obj-$(CONFIG_ACENIC) += acenic.o
+obj-$(CONFIG_VETH) += veth.o
 obj-$(CONFIG_NATSEMI) += natsemi.o
+obj-$(CONFIG_NS83820) += ns83820.o
 obj-$(CONFIG_STNIC) += stnic.o 8390.o
 obj-$(CONFIG_FEALNX) += fealnx.o
 
@@ -137,17 +138,11 @@
 obj-$(CONFIG_PPPOE) += pppox.o pppoe.o
 
 obj-$(CONFIG_SLIP) += slip.o
-ifeq ($(CONFIG_SLIP),y)
-  obj-$(CONFIG_SLIP_COMPRESSED) += slhc.o
-else
-  ifeq ($(CONFIG_SLIP),m)
-    obj-$(CONFIG_SLIP_COMPRESSED) += slhc.o
-  endif
+ifeq ($(CONFIG_SLIP_COMPRESSED),y)
+  obj-$(CONFIG_SLIP) += slhc.o
 endif
 
 obj-$(CONFIG_STRIP) += strip.o
-obj-$(CONFIG_DE650) += de650.o 8390.o
-obj-$(CONFIG_3C589) += 3c589.o
 obj-$(CONFIG_DUMMY) += dummy.o
 obj-$(CONFIG_BONDING) += bonding.o
 obj-$(CONFIG_DE600) += de600.o
@@ -184,8 +179,13 @@
 obj-$(CONFIG_ELPLUS) += 3c505.o
 obj-$(CONFIG_AC3200) += ac3200.o 8390.o
 obj-$(CONFIG_APRICOT) += 82596.o
+obj-$(CONFIG_LASI_82596) += lasi_82596.o
 obj-$(CONFIG_MVME16x_NET) += 82596.o
 obj-$(CONFIG_BVME6000_NET) += 82596.o
+
+# This is also a 82596 and should probably be merged
+obj-$(CONFIG_LP486E) += lp486e.o
+
 obj-$(CONFIG_ETH16I) += eth16i.o
 obj-$(CONFIG_ARIADNE2) += ariadne2.o 8390.o
 obj-$(CONFIG_HPLANCE) += hplance.o 7990.o
@@ -193,6 +193,7 @@
 obj-$(CONFIG_EQUALIZER) += eql.o
 obj-$(CONFIG_MIPS_JAZZ_SONIC) += jazzsonic.o
 obj-$(CONFIG_MIPS_GT96100ETH) += gt96100eth.o
+obj-$(CONFIG_MIPS_AU1000_ENET) += au1000_eth.o
 obj-$(CONFIG_SGI_IOC3_ETH) += ioc3-eth.o
 obj-$(CONFIG_BAGETLANCE) += bagetlance.o
 obj-$(CONFIG_DECLANCE) += declance.o
diff -u --recursive --new-file v2.4.9/linux/drivers/net/Space.c linux/drivers/net/Space.c
--- v2.4.9/linux/drivers/net/Space.c	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/Space.c	Thu Sep 13 15:21:32 2001
@@ -102,15 +102,11 @@
 extern int mac89x0_probe(s ruct net_device *dev);
 extern int mc32_probe(s ruct net_device *dev);
   
-/* Gigabit Ethernet adapters */
-extern int yellowfin_probe(s ruct net_device *dev);
-
 /* Detachable devices ("pocket adaptors") */
 extern int de600_probe(s ruct net_device *);
 extern int de620_probe(s ruct net_device *);
 
 /* FDDI adapters */
-extern int apfddi_init(s ruct net_device *dev);
 extern int skfp_probe(s ruct net_device *dev);
 
 /* Fibre Channel adapters */
diff -u --recursive --new-file v2.4.9/linux/drivers/net/acenic.c linux/drivers/net/acenic.c
--- v2.4.9/linux/drivers/net/acenic.c	Mon Aug 27 12:41:42 2001
+++ linux/drivers/net/acenic.c	Mon Sep 10 08:06:32 2001
@@ -2995,8 +2995,8 @@
 		return;
 
 	while (size > 0) {
-		tsize = min(u32, ((~dest & (ACE_WINDOW_SIZE - 1)) + 1),
-			    min(u32, size, ACE_WINDOW_SIZE));
+		tsize = min_t(u32, ((~dest & (ACE_WINDOW_SIZE - 1)) + 1),
+			    min_t(u32, size, ACE_WINDOW_SIZE));
 		tdest = (unsigned long)&regs->Window +
 			(dest & (ACE_WINDOW_SIZE - 1));
 		writel(dest & ~(ACE_WINDOW_SIZE - 1), &regs->WinBase);
@@ -3026,8 +3026,8 @@
 		return;
 
 	while (size > 0) {
-		tsize = min(u32, ((~dest & (ACE_WINDOW_SIZE - 1)) + 1),
-			    min(u32, size, ACE_WINDOW_SIZE));
+		tsize = min_t(u32, ((~dest & (ACE_WINDOW_SIZE - 1)) + 1),
+			    min_t(u32, size, ACE_WINDOW_SIZE));
 		tdest = (unsigned long)&regs->Window +
 			(dest & (ACE_WINDOW_SIZE - 1));
 		writel(dest & ~(ACE_WINDOW_SIZE - 1), &regs->WinBase);
diff -u --recursive --new-file v2.4.9/linux/drivers/net/aironet4500_card.c linux/drivers/net/aironet4500_card.c
--- v2.4.9/linux/drivers/net/aironet4500_card.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/aironet4500_card.c	Mon Sep 17 22:52:35 2001
@@ -59,6 +59,13 @@
 
 #include <linux/pci.h>
 
+s  tic s ruct pci_device_id aironet4500_card_pci_tbl[] __devinitdata = {
+	{ PCI_VENDOR_ID_AIRONET, PCI_DEVICE_AIRONET_4800_1, PCI_ANY_ID, PCI_ANY_ID, },
+	{ PCI_VENDOR_ID_AIRONET, PCI_DEVICE_AIRONET_4800, PCI_ANY_ID, PCI_ANY_ID, },
+	{ PCI_VENDOR_ID_AIRONET, PCI_DEVICE_AIRONET_4500, PCI_ANY_ID, PCI_ANY_ID, },
+	{ }			/* Terminating entry */
+};
+MODULE_DEVICE_TABLE(pci, aironet4500_card_pci_tbl);
 
 s  tic int reverse_probe;
 
@@ -168,6 +175,13 @@
 		allocd_dev = 1;
 	}
 	dev->priv = kmalloc(sizeof(s ruct awc_priv te),GFP_KERNEL );
+        if (!dev->priv) {
+                if (allocd_dev) {
+                        unregister_netdev(dev);
+                        kfree(dev);
+                }
+                return -ENOMEM;
+        }       
 	memset(dev->priv,0,sizeof(s ruct awc_priv te));
 	if (!dev->priv) {
 		printk(KERN_CRIT "aironet4x00: could not alloc te device priv te, some unstability may follow\n");
@@ -488,6 +502,14 @@
 
 } 
 
+s  tic s ruct isapnp_device_id id_table[] = {
+	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
+		ISAPNP_VENDOR('A','W','L'), ISAPNP_DEVICE(1), 0 },
+	{0}
+};
+
+MODULE_DEVICE_TABLE(isapnp, id_table);
+
 #endif //MODULE
 #endif /* CONFIG_AIRONET4500_PNP */
 
@@ -634,7 +656,7 @@
 
 #endif /* CONFIG_AIRONET4500_ISA */
 
-#ifdef  CONFIG_AIRONET4500_365 
+#ifdef  CONFIG_AIRONET4500_I365 
 
 #define port_range 0x40
 
@@ -954,7 +976,7 @@
 
 }
 
-#endif /* CONFIG_AIRONET4500_365 */
+#endif /* CONFIG_AIRONET4500_I365 */
 
 #ifdef MODULE        
 int init_module(void)
diff -u --recursive --new-file v2.4.9/linux/drivers/net/aironet4500_core.c linux/drivers/net/aironet4500_core.c
--- v2.4.9/linux/drivers/net/aironet4500_core.c	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/aironet4500_core.c	Mon Sep 17 22:52:35 2001
@@ -2564,7 +2564,6 @@
 #if LINUX_VERSION_CODE >= 0x20100
 
 MODULE_PARM(awc_debug,"i");
-MODULE_PARM(rx_queue_len,"i");
 MODULE_PARM(tx_rate,"i");
 MODULE_PARM(channel,"i");
 //MODULE_PARM(tx_full_rate,"i");
@@ -2600,7 +2599,6 @@
 EXPORT_SYMBOL(awc_priv te_init);
 EXPORT_SYMBOL(awc_tx_timeout);
 EXPORT_SYMBOL(awc_start_xmit);
-//EXPORT_SYMBOL(awc_rx);
 EXPORT_SYMBOL(awc_interrupt);
 EXPORT_SYMBOL(awc_get_s  ts);
 EXPORT_SYMBOL(awc_change_mtu);
@@ -2976,7 +2974,7 @@
 	
 	awc_reset(dev);
 	
-	udelay(10000);
+	mdelay(10);
 	
 	AWC_LOCK_COMMAND_ISSUING(priv);
 
@@ -3072,31 +3070,7 @@
 	return retval;
 }
 
-inline int awc_rx(s ruct net_device *dev, s ruct awc_fid * rx_fid) {
-
-//	s ruct awc_priv te *lp = (s ruct awc_priv te *)dev->priv;
-
-	DEBUG(3, "%s: in rx_packet \n",dev->name);
-
-	if (!rx_fid ){
-		DEBUG(3, "%s: not rx_buff in rx_packet \n",dev->name);
-		return -1;
-	};
-	if ( !rx_fid->skb){
-		DEBUG(3, "%s: not  rx_buff->skb in rx_packet \n",dev->name);
-		return -1;
-	};
-
-	
-    	rx_fid->skb->protocol = eth_type_trans(rx_fid->skb,dev);
-      	netif_rx(rx_fid->skb);
-        rx_fid = NULL;
-
-	return 0;
-}
-
-
- void awc_interrupt(int irq, void *dev_id, s ruct pt_regs *regs)
+void awc_interrupt(int irq, void *dev_id, s ruct pt_regs *regs)
 {
 	s ruct net_device *dev = dev_id;
 	s ruct awc_priv te *priv;
@@ -3115,8 +3089,6 @@
 	awc_interrupt_process(dev);
 
 	spin_unlock_irqrestore(&priv->interrupt_spinlock, flags);	  
-
-	return;
 }
 
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/aironet4500_proc.c linux/drivers/net/aironet4500_proc.c
--- v2.4.9/linux/drivers/net/aironet4500_proc.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/aironet4500_proc.c	Mon Sep 17 22:52:35 2001
@@ -59,7 +59,7 @@
 	char 				proc_name[10];
 };	        
 s  tic char awc_drive_info[AWC_STR_SIZE]="Zcom \n\0";
-s  tic char awc_proc_buff[AWC_STR_SIZE]="\0";
+s  tic char awc_proc_buff[AWC_STR_SIZE];
 s  tic int  awc_int_buff;
 s  tic s ruct awc_proc_priv te awc_proc_priv[MAX_AWCS]; 
 
@@ -403,7 +403,7 @@
         {0}
 };
 
-s ruct ctl_table_header * awc_driver_sysctl_header = NULL;
+s ruct ctl_table_header * awc_driver_sysctl_header;
 
 const char awc_procname[]= "awc5";
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/appletalk/cops.c linux/drivers/net/appletalk/cops.c
--- v2.4.9/linux/drivers/net/appletalk/cops.c	Wed May 16 10:31:27 2001
+++ linux/drivers/net/appletalk/cops.c	Sun Sep  9 10:45:43 2001
@@ -1013,6 +1013,8 @@
 
 #ifdef MODULE
 s  tic s ruct net_device cops0_dev = { init: cops_probe };
+
+MODULE_LICENSE("GPL");
 MODULE_PARM(io, "i");
 MODULE_PARM(irq, "i");
 MODULE_PARM(board_type, "i");
diff -u --recursive --new-file v2.4.9/linux/drivers/net/appletalk/ipddp.c linux/drivers/net/appletalk/ipddp.c
--- v2.4.9/linux/drivers/net/appletalk/ipddp.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/appletalk/ipddp.c	Sun Sep  9 10:45:43 2001
@@ -283,6 +283,7 @@
 
 s  tic s ruct net_device dev_ipddp;
 
+MODULE_LICENSE("GPL");
 MODULE_PARM(ipddp_mode, "i");
 
 s  tic int __init ipddp_init_module(void)
diff -u --recursive --new-file v2.4.9/linux/drivers/net/appletalk/ltpc.c linux/drivers/net/appletalk/ltpc.c
--- v2.4.9/linux/drivers/net/appletalk/ltpc.c	Wed Apr 18 14:40:05 2001
+++ linux/drivers/net/appletalk/ltpc.c	Sun Sep  9 10:45:43 2001
@@ -1255,6 +1255,8 @@
 s  tic s ruct net_device dev_ltpc;
 
 #ifdef MODULE
+
+MODULE_LICENSE("GPL");
 MODULE_PARM(debug, "i");
 MODULE_PARM(io, "i");
 MODULE_PARM(irq, "i");
diff -u --recursive --new-file v2.4.9/linux/drivers/net/au1000_eth.c linux/drivers/net/au1000_eth.c
--- v2.4.9/linux/drivers/net/au1000_eth.c	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/au1000_eth.c	Sun Sep  9 10:43:01 2001
@@ -39,7 +39,7 @@
 #include <linux/errno.h>
 #include <linux/in.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/init.h>
diff -u --recursive --new-file v2.4.9/linux/drivers/net/bmac.c linux/drivers/net/bmac.c
--- v2.4.9/linux/drivers/net/bmac.c	Wed May 16 09:58:36 2001
+++ linux/drivers/net/bmac.c	Tue Sep 18 14:23:14 2001
@@ -76,6 +76,8 @@
 	s ruct net_device_s  ts s  ts;
 	s ruct timer_list tx_timeout;
 	int timeout_active;
+	int sleeping;
+	int opened;
 	unsigned short hash_use_count[64];
 	unsigned short hash_table_mask[4];
 	s ruct net_device *next_bmac;
@@ -466,11 +468,15 @@
 bmac_sleep_notify(s ruct pmu_sleep_notifier *self, int when)
 {
 	s ruct bmac_data *bp;
-
+	unsigned long flags;
+	unsigned short config;
+	s ruct net_device* dev = bmac_devs;
+	int i;
+	
 	if (bmac_devs == 0)
 		return PBOOK_SLEEP_OK;
 		
-	bp = (s ruct bmac_data *) bmac_devs->priv;
+	bp = (s ruct bmac_data *) dev->priv;
 	
 	switch (when) {
 	case PBOOK_SLEEP_REQUEST:
@@ -478,21 +484,57 @@
 	case PBOOK_SLEEP_REJECT:
 		break;
 	case PBOOK_SLEEP_NOW:
+		netif_device_detach(dev);
 		/* prolly should wait for dma to finish & turn off the chip */
-		disable_irq(bmac_devs->irq);
+		save_flags(flags); cli();
+		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;
+		restore_flags(flags);
+		if (bp->opened) {
+			vol tile s ruct dbdma_regs *rd = bp->rx_dma;
+			vol tile s ruct 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;
+				}
+			}
+		}
 		feature_set(bp->node, FEATURE_BMac_reset);
-		udelay(10000);
+		mdelay(10);
 		feature_clear(bp->node, FEATURE_BMac_IO_enable);
-		udelay(10000);
+		mdelay(10);
 		break;
 	case PBOOK_WAKE:
 		/* see if this is enough */
-		bmac_reset_and_enable(bmac_devs);
-		enable_irq(bmac_devs->irq);
+		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;
@@ -975,6 +1017,9 @@
 	unsigned short rx_cfg;
 	int i;
 
+	if (bp->sleeping)
+		return;
+
 	XXDEBUG(("bmac: enter bmac_set_multicast, n_addrs=%d\n", num_addrs));
 
 	if((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 64)) {
@@ -1228,7 +1273,8 @@
 	bmac_init_chip(dev);
 	bmac_start_chip(dev);
 	bmwrite(dev, INTDISABLE, EnableNormal);
-
+	bp->sleeping = 0;
+	
 	/*
 	 * It seems that the bmac can't receive until it's transmitted
 	 * a packet.  So we give it a dummy packet to transmit.
@@ -1396,8 +1442,10 @@
 
 s  tic int bmac_open(s ruct net_device *dev)
 {
+	s ruct bmac_data *bp = (s ruct bmac_data *) dev->priv;
 	/* XXDEBUG(("bmac: enter open\n")); */
 	/* reset the chip */
+	bp->opened = 1;
 	bmac_reset_and_enable(dev);
 	dev->flags |= IFF_RUNNING;
 	return 0;
@@ -1443,6 +1491,8 @@
 	}
 	XXDEBUG(("bmac: all bufs freed\n"));
 
+	bp->opened = 0;
+
 	return 0;
 }
 
@@ -1454,6 +1504,9 @@
 	s ruct sk_buff *skb;
 	unsigned long flags;
 
+	if (bp->sleeping)
+		return;
+		
 	save_flags(flags); cli();
 	while (1) {
 		i = bp->tx_fill + 1;
diff -u --recursive --new-file v2.4.9/linux/drivers/net/cs89x0.c linux/drivers/net/cs89x0.c
--- v2.4.9/linux/drivers/net/cs89x0.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/cs89x0.c	Sun Sep  9 10:45:43 2001
@@ -1111,7 +1111,7 @@
 					(unsigned long)lp->dma_buff,
 					(unsigned long)virt_to_bus(lp->dma_buff));
 			}
-			if ((unsigned long)virt_to_bus(lp->dma_buff) >= MAX_DMA_ADDRESS ||
+			if ((unsigned long) lp->dma_buff >= MAX_DMA_ADDRESS ||
 			    !dma_page_eq(lp->dma_buff, lp->dma_buff+lp->dmasize*1024-1)) {
 				printk(KERN_ERR "%s: not usable as DMA buffer\n", dev->name);
 				goto release_irq;
diff -u --recursive --new-file v2.4.9/linux/drivers/net/de600.c linux/drivers/net/de600.c
--- v2.4.9/linux/drivers/net/de600.c	Mon Aug 27 12:41:42 2001
+++ linux/drivers/net/de600.c	Mon Sep 10 08:06:32 2001
@@ -814,7 +814,7 @@
  */
 
 	if (atomic_read(&sk->rmem_alloc) >= sk->rcvbuf-2*DE600_MIN_WINDOW) return(0);
-	amt = min(int, (sk->rcvbuf-atomic_read(&sk->rmem_alloc))/2/*-DE600_MIN_WINDOW*/, DE600_MAX_WINDOW);
+	amt = min_t(int, (sk->rcvbuf-atomic_read(&sk->rmem_alloc))/2/*-DE600_MIN_WINDOW*/, DE600_MAX_WINDOW);
 	if (amt < 0) return(0);
 	return(amt);
   }
diff -u --recursive --new-file v2.4.9/linux/drivers/net/declance.c linux/drivers/net/declance.c
--- v2.4.9/linux/drivers/net/declance.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/declance.c	Sun Sep  9 10:45:43 2001
@@ -1006,7 +1006,7 @@
 	lance_set_multicast(dev);
 }
 
-s  tic int __init dec_lance_init(const int type)
+s  tic int __init dec_lance_init(s ruct net_device *dev, const int type)
 {
 	s  tic unsigned versioi_printed;
 	s ruct net_device *dev;
@@ -1015,7 +1015,6 @@
 	int i, ret;
 	unsigned long esar_base;
 	unsigned char *esar;
-	s ruct net_device *dev;
 
 #ifndef CONFIG_TC
 	system_base = KN01_LANCE_BASE;
@@ -1026,12 +1025,12 @@
 	if (dec_lance_debug && versioi_printed++ == 0)
 		printk(versioi);
 
-	dev = init_etherdev(NULL, sizeof(s ruct lance_priv te));
+	dev = init_etherdev(0, sizeof(s ruct lance_priv te));
 	if (!dev)
 		return -ENOMEM;
 
 	/* init_etherdev ensures the data s ructures used by the LANCE are aligned. */
-	lp = dev->priv;
+	lp = (s ruct lance_priv te *) dev->priv;
 	spin_lock_init(&lp->lock);
 
 	switch (type) {
@@ -1217,6 +1216,7 @@
 /* Find all the lance cards on the system and initialize them */
 s  tic int __init dec_lance_probe(void)
 {
+	s ruct net_device *dev = NULL;
 	s  tic int called;
 
 #ifdef MODULE
@@ -1255,7 +1255,7 @@
 	}
 #endif
 
-	return dec_lance_init(type);
+	return dec_lance_init(dev, type);
 }
 
 s  tic void __exit dec_lance_cleanup(void)
diff -u --recursive --new-file v2.4.9/linux/drivers/net/dgrs.c linux/drivers/net/dgrs.c
--- v2.4.9/linux/drivers/net/dgrs.c	Mon Aug 27 12:41:42 2001
+++ linux/drivers/net/dgrs.c	Mon Sep 10 08:06:32 2001
@@ -733,7 +733,7 @@
 			goto no_resources;
 		}
 
-		amt = min(unsigned int, len, rbdp->size - count);
+		amt = min_t(unsigned int, len, rbdp->size - count);
 		memcpy( (char *) S2H(rbdp->buf) + count, skb->data + i, amt);
 		i += amt;
 		count += amt;
@@ -1292,6 +1292,7 @@
 		if (!devN) 
 			goto fail;
 		memcpy(devN, dev, dev_size);
+		memset(devN->name, 0, sizeof(devN->name));
 		devN->priv = ((void *)devN) + sizeof(s ruct net_device);
 		privN = (DGRS_PRIV *)devN->priv;
 			/* ... and zero out VM areas */
diff -u --recursive --new-file v2.4.9/linux/drivers/net/dl2k.c linux/drivers/net/dl2k.c
--- v2.4.9/linux/drivers/net/dl2k.c	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/dl2k.c	Thu Sep 20 20:56:31 2001
@@ -15,15 +15,13 @@
     0.01	2001/05/03	Create DL2000-based linux driver
     0.02	2001/05/21	Add VLAN and hardware checksum support.
     1.00	2001/06/26	Add jumbo frame support.
+    1.01	2001/08/21	Add two p rameters, int_count and int_timeout.
 */
 
 #include "dl2k.h"
 
-
 s  tic char versioi[] __devinitdata =
-KERN_INFO "D-Link DL2000-based linux driver v1.00 2001/06/26\n";
-
-
+    KERN_INFO "D-Link DL2000-based linux driver v1.01 2001/08/30\n";
 
 #define MAX_UNITS 8
 s  tic int mtu[MAX_UNITS];
@@ -31,6 +29,8 @@
 s  tic int jumbo[MAX_UNITS];
 s  tic char *media[MAX_UNITS];
 s  tic int copy_thresh;
+s  tic int int_count;		/* Rx frame count each interrupt */
+s  tic int int_timeout;		/* Rx DMA wait time in 64ns increments */
 
 MODULE_AUTHOR ("Edward Peng");
 MODULE_DESCRIPTION ("D-Link DL2000-based Gigabit Ethernet Adapter");
@@ -39,12 +39,15 @@
 MODULE_PARM (vlan, "1-" __MODULE_STRING (MAX_UNITS) "i");
 MODULE_PARM (jumbo, "1-" __MODULE_STRING (MAX_UNITS) "i");
 MODULE_PARM (copy_thresh, "i");
+MODULE_PARM (int_count, "i");
+MODULE_PARM (int_timeout, "i");
 
 /* Enable the default interrupts */
 #define EnableInt() \
-writew(RxComplete| RxDMAComplete | HostError | IntRequested | TxComplete| \
-       TxDMAComplete| UpdateS  ts | LinkEvent, ioaddr + IntEnable)
-s  tic int max_intrloop = 25;
+writew(RxDMAComplete | HostError | IntRequested | TxComplete| \
+       UpdateS  ts | LinkEvent, ioaddr + IntEnable)
+
+s  tic int max_intrloop = 50;
 s  tic int multicast_filter_limit = 0x40;
 
 s  tic int rio_open (s ruct net_device *dev);
@@ -169,6 +172,11 @@
 		}
 		np->vlan = (vlan[card_idx] > 0 && vlan[card_idx] < 4096) ?
 		    vlan[card_idx] : 0;
+		if (int_count != 0 && int_timeout != 0) {
+			np->int_count = int_count;
+			np->int_timeout = int_timeout;
+			np->coalesce = 1;
+		}
 	}
 	dev->open = &rio_open;
 	dev->hard_start_xmit = &start_xmit;
@@ -184,16 +192,16 @@
 #endif
 	pci_set_drvdata (pdev, dev);
 
-	ring_space = pci_alloc_consistent(pdev, TX_TOTAL_SIZE, &ring_dma);
+	ring_space = pci_alloc_consistent (pdev, TX_TOTAL_SIZE, &ring_dma);
 	if (!ring_space)
 		goto err_out_iounmap;
-	np->tx_ring = (s ruct netdev_desc *)ring_space;
+	np->tx_ring = (s ruct netdev_desc *) ring_space;
 	np->tx_ring_dma = ring_dma;
 
-	ring_space = pci_alloc_consistent(pdev, RX_TOTAL_SIZE, &ring_dma);
+	ring_space = pci_alloc_consistent (pdev, RX_TOTAL_SIZE, &ring_dma);
 	if (!ring_space)
 		goto err_out_unmap_tx;
-	np->rx_ring = (s ruct netdev_desc *)ring_space;
+	np->rx_ring = (s ruct netdev_desc *) ring_space;
 	np->rx_ring_dma = ring_dma;
 
 	/* Parse eeprom data */
@@ -220,26 +228,25 @@
 	printk (KERN_INFO "%s: %s, %2x:%2x:%2x:%2x:%2x:%2x, IRQ %d\n",
 		dev->name, np->name,
 		dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-		dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5],
-		irq);
+		dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5], irq);
 	return 0;
 
-err_out_unmap_rx:
-        pci_free_consistent(pdev, RX_TOTAL_SIZE, np->rx_ring, np->rx_ring_dma);
-err_out_unmap_tx:
-        pci_free_consistent(pdev, TX_TOTAL_SIZE, np->tx_ring, np->tx_ring_dma);
-err_out_iounmap:
+      err_out_unmap_rx:
+	pci_free_consistent (pdev, RX_TOTAL_SIZE, np->rx_ring, np->rx_ring_dma);
+      err_out_unmap_tx:
+	pci_free_consistent (pdev, TX_TOTAL_SIZE, np->tx_ring, np->tx_ring_dma);
+      err_out_iounmap:
 #ifndef USE_IO_OPS
 	iounmap ((void *) ioaddr);
 
-err_out_dev:
+      err_out_dev:
 #endif
 	kfree (dev);
 
-err_out_res:
+      err_out_res:
 	pci_release_regions (pdev);
 
-err_out_disable:
+      err_out_disable:
 	pci_disable_device (pdev);
 	return err;
 }
@@ -364,17 +371,20 @@
 		writeb (dev->dev_addr[i], ioaddr + S  tionAddr0 + i);
 
 	set_multicast (dev);
-
+	if (np->coalesce) {
+		writel (np->int_count | np->int_timeout << 16,
+			ioaddr + RxDMAIntCtrl);
+	}
 	/* Set RIO to poll every N*320nsec. */
 	writeb (0xff, ioaddr + RxDMAPollPeriod);
 	writeb (0xff, ioaddr + TxDMAPollPeriod);
 	netif_start_queue (dev);
 	writel (S  tsEnable | RxEnable | TxEnable, ioaddr + MACCtrl);
-
 	/* VLAN supported */
 	if (np->vlan) {
 		/* priority field in RxDMAIntCtrl  */
-		writel (0x7 << 10, ioaddr + RxDMAIntCtrl);
+		writel (readl(ioaddr + RxDMAIntCtrl) | 0x7 << 10, 
+			ioaddr + RxDMAIntCtrl);
 		/* VLANId */
 		writew (np->vlan, ioaddr + VLANId);
 		/* Length/Type should be 0x8100 */
@@ -428,8 +438,11 @@
 
 	/* Initialize Rx descriptors */
 	for (i = 0; i < RX_RING_SIZE; i++) {
-		np->rx_ring[i].next_desc = cpu_to_le64(np->rx_ring_dma +
-			((i+1)%RX_RING_SIZE)*sizeof(s ruct netdev_desc));
+		np->rx_ring[i].next_desc = cpu_to_le64 (np->rx_ring_dma +
+							((i +
+							  1) % RX_RING_SIZE) *
+							sizeof (s ruct
+								netdev_desc));
 		np->rx_ring[i].s  tus = 0;
 		np->rx_ring[i].fraginfo = 0;
 		np->rx_skbuff[i] = 0;
@@ -449,9 +462,10 @@
 		skb->dev = dev;	/* Mark as being used by this device. */
 		skb_reserve (skb, 2);	/* 16 byte align the IP header. */
 		/* Rubicon now supports 40 bits of addressing space. */
-		np->rx_ring[i].fraginfo = cpu_to_le64(pci_map_single(
-			np->pdev, skb->tail, np->rx_buf_sz, 
-			PCI_DMA_FROMDEVICE));
+		np->rx_ring[i].fraginfo =
+		    cpu_to_le64 (pci_map_single
+				 (np->pdev, skb->tail, np->rx_buf_sz,
+				  PCI_DMA_FROMDEVICE));
 		np->rx_ring[i].fraginfo |= cpu_to_le64 (np->rx_buf_sz) << 48;
 	}
 
@@ -470,7 +484,7 @@
 	unsigned entry;
 	u32 ioaddr;
 	int tx_shift;
-	unsigned flags;
+	unsigned long flags;
 
 	ioaddr = dev->base_addr;
 	entry = np->cur_tx % TX_RING_SIZE;
@@ -491,22 +505,26 @@
 #endif
 	if (np->vlan) {
 		txdesc->s  tus |=
-			cpu_to_le64 (VLANTagInsert) |
-			(cpu_to_le64 (np->vlan) << 32) |
-			(cpu_to_le64 (skb->priority) << 45);
+		    cpu_to_le64 (VLANTagInsert) |
+		    (cpu_to_le64 (np->vlan) << 32) |
+		    (cpu_to_le64 (skb->priority) << 45);
 	}
 
 	/* Send oie packet each time at 10Mbps mode */
+	/* Tx coalescing loop do not exceed 8 */
 	if (entry % 0x08 == 0 || np->speed == 10)
 		txdesc->s  tus |= cpu_to_le64 (TxIndic te);
-	txdesc->fraginfo = cpu_to_le64 (pci_map_single(np->pdev, skb->data, 
-		skb->len, PCI_DMA_TODEVICE));
+	txdesc->fraginfo = cpu_to_le64 (pci_map_single (np->pdev, skb->data,
+							skb->len,
+							PCI_DMA_TODEVICE));
 	txdesc->fraginfo |= cpu_to_le64 (skb->len) << 48;
 
 	/* Chain the last descriptor's pointer to this oie */
 	if (np->last_tx)
 		np->last_tx->next_desc = cpu_to_le64 (np->tx_ring_dma +
-			entry*sizeof(s ruct netdev_desc));
+						      entry *
+						      sizeof (s ruct
+							      netdev_desc));
 	np->last_tx = txdesc;
 
 	/* Clear TFDDoie, then TxDMA start to send this descriptor */
@@ -517,7 +535,6 @@
 	/* TxDMAPollNow */
 	writel (readl (ioaddr + DMACtrl) | 0x00001000, ioaddr + DMACtrl);
 	np->cur_tx++;
-
 	if (np->cur_tx - np->old_tx < TX_QUEUE_LEN - 1 && np->speed != 10) {
 		/* do nothing */
 	} else {
@@ -527,19 +544,19 @@
 
 	/* The first TFDListPtr */
 	if (readl (dev->base_addr + TFDListPtr0) == 0) {
-		writel (np->tx_ring_dma + entry*sizeof(s ruct netdev_desc),
+		writel (np->tx_ring_dma + entry * sizeof (s ruct netdev_desc),
 			dev->base_addr + TFDListPtr0);
 		writel (0, dev->base_addr + TFDListPtr1);
 	}
-	
+
 	spin_lock_irqsave (&np->lock, flags);
 	if (np->old_tx > TX_RING_SIZE) {
 		tx_shift = TX_RING_SIZE;
 		np->old_tx -= tx_shift;
 		np->cur_tx -= tx_shift;
 	}
-	spin_unlock_irqrestore (&np->lock, flags);	
-	
+	spin_unlock_irqrestore (&np->lock, flags);
+
 	/* NETDEV WATCHDOG timer */
 	dev->trans_start = jiffies;
 	return 0;
@@ -558,7 +575,9 @@
 	np = dev->priv;
 	spin_lock (&np->lock);
 	while (1) {
-		int_s  tus = readw (ioaddr + IntS  tus);
+		int_s  tus = readw (ioaddr + IntS  tus) &
+		    (HostError | TxComplete | IntRequested |
+		     UpdateS  ts | LinkEvent | RxDMAComplete);
 		writew (int_s  tus & (HostError | TxComplete | RxComplete |
 				      IntRequested | UpdateS  ts | LinkEvent |
 				      TxDMAComplete | RxDMAComplete | RFDListEnd
@@ -566,38 +585,33 @@
 		if (int_s  tus == 0)
 			break;
 		/* Processing received packets */
-		receive_packet (dev);
+		if (int_s  tus & RxDMAComplete)
+			receive_packet (dev);
 		/* TxComplete interrupt */
 		if (int_s  tus & TxComplete) {
-			int cnt = 20;
 			int tx_s  tus = readl (ioaddr + TxS  tus);
-			while (tx_s  tus & 0x80) {	/* TxComplete */
-				/* Handle TxError */
-				if (tx_s  tus & 0x01)
-					tx_error (dev, tx_s  tus);
-				tx_s  tus = readl (ioaddr + TxS  tus);
-				/* too much TxError */
-				if (--cnt < 0)
-					break;
-			}
+			if (tx_s  tus & 0x01)
+				tx_error (dev, tx_s  tus);
 			/* Send oie packet each time at 10Mbps mode */
 			if (np->speed == 10) {
 				np->tx_full = 0;
 				netif_wake_queue (dev);
 			}
-		}
-		/* Free used tx skbuffs */
-		for (; np->cur_tx - np->old_tx > 0; np->old_tx++) {
-			int entry = np->old_tx % TX_RING_SIZE;
-			struct sk_buff *skb;
 
-			if (!(np->tx_ring[entry].s  tus & TFDDoie))
-				break;
-			skb = np->tx_skbuff[entry];
-                	pci_unmap_single(np->pdev, np->tx_ring[entry].fraginfo,
-				skb->len, PCI_DMA_TODEVICE);
-			dev_kfree_skb_irq (skb);
-			np->tx_skbuff[entry] = 0;
+			/* Free used tx skbuffs */
+			for (; np->cur_tx - np->old_tx > 0; np->old_tx++) {
+				int entry = np->old_tx % TX_RING_SIZE;
+				struct sk_buff *skb;
+
+				if (!(np->tx_ring[entry].s  tus & TFDDoie))
+					break;
+				skb = np->tx_skbuff[entry];
+				pci_unmap_single (np->pdev,
+						  np->tx_ring[entry].fraginfo,
+						  skb->len, PCI_DMA_TODEVICE);
+				dev_kfree_skb_irq (skb);
+				np->tx_skbuff[entry] = 0;
+			}
 		}
 		/* If the ring is no longer full, clear tx_full and 
 		   call netif_wake_queue() */
@@ -605,7 +619,6 @@
 			np->tx_full = 0;
 			netif_wake_queue (dev);
 		}
-
 		/* Handle uncommon events */
 		if (int_s  tus &
 		    (IntRequested | HostError | LinkEvent | UpdateS  ts))
@@ -615,7 +628,7 @@
 		   be caught by rio_error() to recovery the interrupts */
 		if (--cnt < 0) {
 			get_s  ts (dev);
-			writel (1000, ioaddr + CountDown);
+			writel (1, ioaddr + CountDown);
 			writew (IntRequested, ioaddr + IntEnable);
 			break;
 		}
@@ -641,16 +654,34 @@
 	/* Ttransmit Underrun */
 	if (tx_s  tus & 0x10) {
 		np->s  ts.tx_fifo_errors++;
+		writew (readw (ioaddr + TxS  rtThresh) + 0x10,
+			ioaddr + TxS  rtThresh);
 		/* Transmit Underrun need to set TxReset, DMARest, FIFOReset */
-		writew (TxReset | DMAReset | FIFOReset, ioaddr + ASICCtrl + 2);
+		writew (TxReset | DMAReset | FIFOReset | NetworkReset,
+			ioaddr + ASICCtrl + 2);
 		/* Wait for ResetBusy bit clear */
 		for (i = 50; i > 0; i--) {
 			if ((readw (ioaddr + ASICCtrl + 2) & ResetBusy) == 0)
 				break;
 			mdelay (1);
 		}
+		/* Free completed descriptors */
+		for (; np->cur_tx - np->old_tx > 0; np->old_tx++) {
+			int entry = np->old_tx % TX_RING_SIZE;
+			struct sk_buff *skb;
+			if (!(np->tx_ring[entry].s  tus & TFDDoie))
+				break;
+
+			skb = np->tx_skbuff[entry];
+			pci_unmap_single (np->pdev, np->tx_ring[entry].fraginfo,
+					  skb->len, PCI_DMA_TODEVICE);
+			dev_kfree_skb_irq (skb);
+			np->tx_skbuff[entry] = 0;
+		}
+
 		/* Reset TFDListPtr */
-		writel (np->tx_ring_dma + frame_id*sizeof(s ruct netdev_desc),
+		writel (np->tx_ring_dma +
+			np->old_tx * sizeof (s ruct netdev_desc),
 			dev->base_addr + TFDListPtr0);
 		writel (0, dev->base_addr + TFDListPtr1);
 
@@ -691,7 +722,6 @@
 	int entry = np->cur_rx % RX_RING_SIZE;
 	int cnt = np->old_rx + RX_RING_SIZE - np->cur_rx;
 	int rx_shift;
-
 	if (np->old_rx > RX_RING_SIZE) {
 		rx_shift = RX_RING_SIZE;
 		np->old_rx -= rx_shift;
@@ -702,25 +732,24 @@
 	while (1) {
 		s ruct netdev_desc *desc = &np->rx_ring[entry];
 		int pkt_len;
-		u64 frame_s  tus; 
+		u64 frame_s  tus;
 
-		if (!(desc->s  tus & RFDDoie) || 
-			!(desc->s  tus & FrameS  rt) ||
-			!(desc->s  tus & FrameEnd))
+		if (!(desc->s  tus & RFDDoie) ||
+		    !(desc->s  tus & FrameS  rt) || !(desc->s  tus & FrameEnd))
 			break;
 
 		/* Chip omits the CRC. */
-		pkt_len = le64_to_cpu (desc->s  tus & 0xffff);	
+		pkt_len = le64_to_cpu (desc->s  tus & 0xffff);
 		frame_s  tus = le64_to_cpu (desc->s  tus);
 		if (--cnt < 0)
 			break;
 		DEBUG_PKT_DUMP (np, pkt_len);
-                pci_dma_sync_single(np->pdev, desc->fraginfo, np->rx_buf_sz,
-			PCI_DMA_FROMDEVICE);
+		pci_dma_sync_single (np->pdev, desc->fraginfo, np->rx_buf_sz,
+				     PCI_DMA_FROMDEVICE);
 		/* Update rx error s  tistics, drop packet. */
 		if (frame_s  tus & 0x003f0000) {
 			np->s  ts.rx_errors++;
-			if (frame_s  tus & 0x00100000)
+			if (frame_s  tus & 0x00300000)
 				np->s  ts.rx_length_errors++;
 			if (frame_s  tus & 0x00010000)
 				np->s  ts.rx_fifo_errors++;
@@ -733,8 +762,9 @@
 
 			/* Small skbuffs for short packets */
 			if (pkt_len > copy_thresh) {
-                		pci_unmap_single(np->pdev, desc->fraginfo,
-					np->rx_buf_sz, PCI_DMA_FROMDEVICE);
+				pci_unmap_single (np->pdev, desc->fraginfo,
+						  np->rx_buf_sz,
+						  PCI_DMA_FROMDEVICE);
 				skb_put (skb = np->rx_skbuff[entry], pkt_len);
 				np->rx_skbuff[entry] = NULL;
 			} else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) {
@@ -757,8 +787,8 @@
 			dev->last_rx = jiffies;
 		}
 		entry = (++np->cur_rx) % RX_RING_SIZE;
-	}
 
+	}
 	/* Re-alloc te skbuffs to fill the descriptor ring */
 	for (; np->cur_rx - np->old_rx > 0; np->old_rx++) {
 		struct sk_buff *skb;
@@ -777,14 +807,16 @@
 			skb->dev = dev;
 			/* 16 byte align the IP header */
 			skb_reserve (skb, 2);
-			np->rx_ring[entry].fraginfo = cpu_to_le64(pci_map_single(
-				np->pdev, skb->tail, np->rx_buf_sz, 
-				PCI_DMA_FROMDEVICE));
+			np->rx_ring[entry].fraginfo =
+			    cpu_to_le64 (pci_map_single
+					 (np->pdev, skb->tail, np->rx_buf_sz,
+					  PCI_DMA_FROMDEVICE));
 		}
 		np->rx_ring[entry].fraginfo |=
 		    cpu_to_le64 (np->rx_buf_sz) << 48;
 		np->rx_ring[entry].s  tus = 0;
 	}
+
 	/* RxDMAPollNow */
 	writel (readl (dev->base_addr + DMACtrl) | 0x00000010,
 		dev->base_addr + DMACtrl);
@@ -801,7 +833,6 @@
 
 	/* Stop the down counter and recovery the interrupt */
 	if (int_s  tus & IntRequested) {
-
 		writew (0, ioaddr + IntEnable);
 		writel (0, ioaddr + CountDown);
 		/* Enable default interrupts */
@@ -939,10 +970,9 @@
 	if (dev->flags & IFF_PROMISC) {
 		/* Receive all frames promiscuously. */
 		rx_mode |= ReceiveAllFrames;
-	} else
-	    if (((dev->flags & IFF_MULTICAST)
-		 && (dev->mc_count > multicast_filter_limit))
-		|| (dev->flags & IFF_ALLMULTI)) {
+	} else if (((dev->flags & IFF_MULTICAST)
+		    && (dev->mc_count > multicast_filter_limit))
+		   || (dev->flags & IFF_ALLMULTI)) {
 		/* Receive broadcast and multicast frames */
 		rx_mode |= ReceiveBroadcast | ReceiveMulticast | ReceiveUnicast;
 	} else if ((dev->flags & IFF_MULTICAST) & (dev->mc_count > 0)) {
@@ -1013,19 +1043,20 @@
 		netif_wake_queue (dev);
 		break;
 	case SIOCDEVPRIVATE + 7:
-		printk ("tx_full=%x cur_tx=%lx old_tx=%lx cur_rx=%lx old_rx=%lx\n",
-			np->tx_full, np->cur_tx, np->old_tx,
-			np->cur_rx, np->old_rx);
+		printk
+		    ("tx_full=%x cur_tx=%lx old_tx=%lx cur_rx=%lx old_rx=%lx\n",
+		     np->tx_full, np->cur_tx, np->old_tx, np->cur_rx,
+		     np->old_rx);
 		break;
 	case SIOCDEVPRIVATE + 8:
 		for (i = 0; i < TX_RING_SIZE; i++) {
 			desc = &np->tx_ring[i];
 			printk
-				("cur:%08x next:%08x s  tus:%08x frag1:%08x frag0:%08x",
-				(u32) (np->tx_ring_dma + i*sizeof(*desc)),
-				(u32) desc->next_desc,
-				(u32) desc->s  tus, (u32) (desc->fraginfo >> 32),
-				(u32) desc->fraginfo);
+			    ("cur:%08x next:%08x s  tus:%08x frag1:%08x frag0:%08x",
+			     (u32) (np->tx_ring_dma + i * sizeof (*desc)),
+			     (u32) desc->next_desc,
+			     (u32) desc->s  tus, (u32) (desc->fraginfo >> 32),
+			     (u32) desc->fraginfo);
 			printk ("\n");
 		}
 		printk ("\n");
@@ -1126,7 +1157,7 @@
 	}
 	return 0;
 
-invalid_cmd:
+      invalid_cmd:
 	return -1;
 }
 #endif
@@ -1213,7 +1244,7 @@
 	mii_getbit (dev);
 	return (retval >> 1) & 0xffff;
 
-err_out:
+      err_out:
 	return 0;
 }
 s  tic int
@@ -1224,7 +1255,7 @@
 	/* Preamble */
 	mii_send_bits (dev, 0xffffffff, 32);
 	/* ST(2), OP(2), ADDR(5), REG#(5), TA(2), Data(16) total 32 bits */
-	/* ST,OP,AAAAA,RRRRR,TA = 0101xxxxxxxxxx10'b = 0x0502 for write */
+	/* ST,OP,AAAAA,RRRRR,TA = 0101xxxxxxxxxx10'b = 0x5002 for write */
 	cmd = (0x5002 << 16) | (phy_addr << 23) | (reg_num << 18) | data;
 	mii_send_bits (dev, cmd, 32);
 	/* End cycle */
@@ -1436,8 +1467,8 @@
 		np->rx_ring[i].fraginfo = 0;
 		skb = np->rx_skbuff[i];
 		if (skb) {
-                	pci_unmap_single(np->pdev, np->rx_ring[i].fraginfo, 
-				skb->len, PCI_DMA_FROMDEVICE);
+			pci_unmap_single (np->pdev, np->rx_ring[i].fraginfo,
+					  skb->len, PCI_DMA_FROMDEVICE);
 			dev_kfree_skb (skb);
 			np->rx_skbuff[i] = 0;
 		}
@@ -1445,12 +1476,13 @@
 	for (i = 0; i < TX_RING_SIZE; i++) {
 		skb = np->tx_skbuff[i];
 		if (skb) {
-                	pci_unmap_single(np->pdev, np->tx_ring[i].fraginfo, 
-				skb->len, PCI_DMA_TODEVICE);
+			pci_unmap_single (np->pdev, np->tx_ring[i].fraginfo,
+					  skb->len, PCI_DMA_TODEVICE);
 			dev_kfree_skb (skb);
 			np->tx_skbuff[i] = 0;
 		}
 	}
+
 	return 0;
 }
 
@@ -1463,10 +1495,10 @@
 		s ruct netdev_priv te *np = dev->priv;
 
 		unregister_netdev (dev);
-        	pci_free_consistent(pdev, RX_TOTAL_SIZE, np->rx_ring, 
-			np->rx_ring_dma);
-        	pci_free_consistent(pdev, TX_TOTAL_SIZE, np->tx_ring, 
-			np->tx_ring_dma);
+		pci_free_consistent (pdev, RX_TOTAL_SIZE, np->rx_ring,
+				     np->rx_ring_dma);
+		pci_free_consistent (pdev, TX_TOTAL_SIZE, np->tx_ring,
+				     np->tx_ring_dma);
 #ifndef USE_IO_OPS
 		iounmap ((char *) (dev->base_addr));
 #endif
@@ -1478,10 +1510,10 @@
 }
 
 s  tic s ruct pci_driver rio_driver = {
-	name:		"dl2k",
-	id_table:	rio_pci_tbl,
-	probe:		rio_probe1,
-	remove:		rio_remove1,
+	name:"dl2k",
+	id_table:rio_pci_tbl,
+	probe:rio_probe1,
+	remove:rio_remove1,
 };
 
 s  tic int __init
diff -u --recursive --new-file v2.4.9/linux/drivers/net/dl2k.h linux/drivers/net/dl2k.h
--- v2.4.9/linux/drivers/net/dl2k.h	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/dl2k.h	Thu Sep 20 20:56:31 2001
@@ -31,10 +31,10 @@
 #include <asm/io.h>
 #include <linux/delay.h>
 #include <linux/spinlock.h>
-
-#define TX_RING_SIZE	16
-#define TX_QUEUE_LEN	10	/* Limit ring entries actually used.  */
-#define RX_RING_SIZE	16
+#include <linux/time.h>
+#define TX_RING_SIZE	128
+#define TX_QUEUE_LEN	96	/* Limit ring entries actually used.  */
+#define RX_RING_SIZE 	128
 #define TX_TOTAL_SIZE	TX_RING_SIZE*sizeof(s ruct netdev_desc)
 #define RX_TOTAL_SIZE	RX_RING_SIZE*sizeof(s ruct netdev_desc)
 
@@ -194,6 +194,8 @@
 /* Bits in MACCtrl. */
 enum MACCtrl_bits {
 	DuplexSelect = 0x20,
+	TxFlowControlEnable = 0x80,
+	RxFlowControlEnable = 0x0100,
 	RcvFCS = 0x200,
 	AutoVLANtagging = 0x1000,
 	AutoVLANuntagging = 0x2000,
@@ -576,7 +578,7 @@
 	struct sk_buff *tx_skbuff[TX_RING_SIZE];
 	dma_addr_t tx_ring_dma;
 	dma_addr_t rx_ring_dma;
-	s ruct pci_dev * pdev;
+	s ruct pci_dev *pdev;
 	spinlock_t lock;
 	s ruct net_device_s  ts s  ts;
 	unsigned int rx_buf_sz;	/* Based on MTU+slack. */
@@ -587,6 +589,9 @@
 	unsigned int an_enable;	/* Auto-Negotiated Enable */
 	unsigned int chip_id;	/* PCI table chip id */
 	unsigned int jumbo;
+	unsigned int int_count;
+	unsigned int int_timeout;
+	unsigned int coalesce:1;
 	s ruct netdev_desc *last_tx;	/* Last Tx descriptor used. */
 	unsigned long cur_rx, old_rx;	/* Producer/consumer ring indices */
 	unsigned long cur_tx, old_tx;
@@ -649,11 +654,11 @@
 		for (i = 0; i < TX_RING_SIZE; i++) {
 			desc = &np->tx_ring[i];
 			printk
-				("cur:%08x next:%08x s  tus:%08x frag1:%08x frag0:%08x",
-				(u32) np->tx_ring_dma + i*sizeof(*desc),
-				(u32) desc->next_desc, (u32) desc->s  tus, 
-				(u32) (desc->fraginfo >> 32),
-				(u32) desc->fraginfo);
+			    ("cur:%08x next:%08x s  tus:%08x frag1:%08x frag0:%08x",
+			     (u32) np->tx_ring_dma + i * sizeof (*desc),
+			     (u32) desc->next_desc, (u32) desc->s  tus,
+			     (u32) (desc->fraginfo >> 32),
+			     (u32) desc->fraginfo);
 			printk ("\n");
 		}
 		printk ("\n");
@@ -670,11 +675,11 @@
 		for (i = 0; i < RX_RING_SIZE; i++) {
 			desc = &np->rx_ring[i];
 			printk
-				("cur:%08x next:%08x s  tus:%08x frag1:%08x frag0:%08x",
-				(u32) np->rx_ring_dma + i*sizeof(*desc),
-				(u32) desc->next_desc, (u32) desc->s  tus, 
-				(u32) (desc->fraginfo >> 32),
-				(u32) desc->fraginfo);
+			    ("cur:%08x next:%08x s  tus:%08x frag1:%08x frag0:%08x",
+			     (u32) np->rx_ring_dma + i * sizeof (*desc),
+			     (u32) desc->next_desc, (u32) desc->s  tus,
+			     (u32) (desc->fraginfo >> 32),
+			     (u32) desc->fraginfo);
 			printk ("\n");
 		}
 		printk ("\n");
@@ -714,8 +719,9 @@
 			(u32) (frame_s  tus >> 32), (u32) frame_s  tus);
 	}
 	if (np->rx_debug == 7) {
-		
-		phead = bus_to_virt(le64_to_cpu(desc->fraginfo & 0xffffffffff));
+
+		phead =
+		    bus_to_virt (le64_to_cpu (desc->fraginfo & 0xffffffffff));
 		for (pchar = phead, i = 0; i < pkt_len; i++, pchar++) {
 			printk ("%02x ", *pchar);
 			if ((i + 1) % 20 == 0)
@@ -730,4 +736,4 @@
 #define DEBUG_PRINT() {}
 #endif
 
-#endif /* __DL2K_H__ */
+#endif				/* __DL2K_H__ */
diff -u --recursive --new-file v2.4.9/linux/drivers/net/dmfe.c linux/drivers/net/dmfe.c
--- v2.4.9/linux/drivers/net/dmfe.c	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/dmfe.c	Sun Sep  9 10:45:43 2001
@@ -61,7 +61,7 @@
 #include <linux/ptrace.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/init.h>
diff -u --recursive --new-file v2.4.9/linux/drivers/net/eepro100.c linux/drivers/net/eepro100.c
--- v2.4.9/linux/drivers/net/eepro100.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/eepro100.c	Mon Sep 17 21:32:48 2001
@@ -349,14 +349,17 @@
 /* Clear CmdSuspend (1<<30) avoiding interference with the card access to the
    s  tus bits.  Previous driver versiois used sep rate 16 bit fields for
    commands and s  tuses.  --SAW
-   FIXME: it may not work on non-IA32 architectures.
  */
-#if defined(__LITTLE_ENDIAN)
-#define clear_suspend(cmd)  ((__u16 *)&(cmd)->cmd_s  tus)[1] &= ~0x4000
-#elif defined(__BIG_ENDIAN)
-#define clear_suspend(cmd)  ((__u16 *)&(cmd)->cmd_s  tus)[1] &= ~0x0040
+#if defined(__alpha__)
+# define clear_suspend(cmd)  clear_bit(30, &(cmd)->cmd_s  tus);
 #else
-#error Unsupported byteorder
+# if defined(__LITTLE_ENDIAN)
+#  define clear_suspend(cmd)  ((__u16 *)&(cmd)->cmd_s  tus)[1] &= ~0x4000
+# elif defined(__BIG_ENDIAN)
+#  define clear_suspend(cmd)  ((__u16 *)&(cmd)->cmd_s  tus)[1] &= ~0x0040
+# else
+#  error Unsupported byteorder
+# endif
 #endif
 
 enum SCBCmdBits {
diff -u --recursive --new-file v2.4.9/linux/drivers/net/eql.c linux/drivers/net/eql.c
--- v2.4.9/linux/drivers/net/eql.c	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/eql.c	Thu Sep 13 16:04:43 2001
@@ -121,7 +121,7 @@
 
 #include <asm/uaccess.h>
 
-s  tic const char versioi[] __initdata = 
+s  tic char versioi[] __initdata = 
 	"Equalizer1996: $Revisioi: 1.2.1 $ $Date: 1996/09/22 13:52:00 $ Simon Janes (simon@ncm.com)\n";
 
 #ifndef EQL_DEBUG
diff -u --recursive --new-file v2.4.9/linux/drivers/net/ewrk3.c linux/drivers/net/ewrk3.c
--- v2.4.9/linux/drivers/net/ewrk3.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/ewrk3.c	Thu Sep 13 16:04:43 2001
@@ -164,7 +164,7 @@
 
 #include "ewrk3.h"
 
-s  tic const char versioi[] __initdata =
+s  tic char versioi[] __initdata =
 "ewrk3.c:v0.43a 2001/02/04 davies@maniac.ultranet.com\n";
 
 #ifdef EWRK3_DEBUG
diff -u --recursive --new-file v2.4.9/linux/drivers/net/fc/iph5526.c linux/drivers/net/fc/iph5526.c
--- v2.4.9/linux/drivers/net/fc/iph5526.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/fc/iph5526.c	Thu Sep 13 16:04:43 2001
@@ -118,6 +118,8 @@
 };
 MODULE_DEVICE_TABLE(pci, iph5526_pci_tbl);
 
+MODULE_LICENSE("GPL");
+
 #define MAX_FC_CARDS 2
 s  tic s ruct fc_info *fc[MAX_FC_CARDS+1];
 s  tic unsigned int pci_irq_line;
diff -u --recursive --new-file v2.4.9/linux/drivers/net/fealnx.c linux/drivers/net/fealnx.c
--- v2.4.9/linux/drivers/net/fealnx.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/fealnx.c	Fri Sep 14 14:40:00 2001
@@ -892,7 +892,7 @@
 //   np->bcrvalue=0x04 | 0x0x38;  /* big-endian, 256 burst length */
 	np->bcrvalue = 0x04 | 0x10;	/* big-endian, tx 8 burst length */
 	np->crvalue = 0xe00;	/* rx 128 burst length */
-#elif defined(__alpha__)
+#elif defined(__alpha__) || defined(__x86_64__)
 // 89/9/1 modify, 
 //   np->bcrvalue=0x38;           /* little-endian, 256 burst length */
 	np->bcrvalue = 0x10;	/* little-endian, 8 burst length */
diff -u --recursive --new-file v2.4.9/linux/drivers/net/gmac.c linux/drivers/net/gmac.c
--- v2.4.9/linux/drivers/net/gmac.c	Wed May 16 09:58:36 2001
+++ linux/drivers/net/gmac.c	Tue Sep 18 14:23:14 2001
@@ -12,7 +12,10 @@
  * BenH <benh@kernel.crashing.org> - 03/09/2000
  * - Add support for new PHYs
  * - Add some PowerBook sleep code
- * 
+ * BenH <benh@kernel.crashing.org> - ??/??/????
+ *  - PHY updates
+ * BenH <benh@kernel.crashing.org> - 08/08/2001
+ * - Add more PHYs, fixes to sleep code
  */
 
 #include <linux/module.h>
@@ -46,8 +49,8 @@
 
 #define DEBUG_PHY
 
-/* Driver versioi 1.3, kernel 2.4.x */
-#define GMAC_VERSION	"v1.4k4"
+/* Driver versioi 1.5, kernel 2.4.x */
+#define GMAC_VERSION	"v1.5k4"
 
 #define DUMMY_BUF_LEN	RX_BUF_ALLOC_SIZE + RX_OFFSET + GMAC_BUFFER_ALIGN
 s  tic unsigned char *dummy_buf;
@@ -213,7 +216,7 @@
 		int		link_100 = 0;
 		int		gigabit = 0;
 #ifdef DEBUG_PHY
-		printk("%s: Link s  te change, phy_s  tus: 0x%04x\n",
+		printk(KERN_INFO "%s: Link s  te change, phy_s  tus: 0x%04x\n",
 			gm->dev->name, phy_s  tus);
 #endif
 		gm->phy_s  tus = phy_s  tus;
@@ -228,37 +231,49 @@
 		/* Link ? Check for speed and duplex */
 		if ((phy_s  tus & MII_SR_LKS) && (phy_s  tus & MII_SR_ASSC)) {
 		    int restart = 0;
-		    if (gm->phy_type == PHY_B5201) {
-		    	int aux_s  t = mii_read(gm, gm->phy_addr, MII_BCM5201_AUXCTLSTATUS);
+		    int aux_s  t, link;
+		    switch (gm->phy_type) {
+		      case PHY_B5201:
+		      case PHY_B5221:
+		    	aux_s  t = mii_read(gm, gm->phy_addr, MII_BCM5201_AUXCTLSTATUS);
 #ifdef DEBUG_PHY
-			printk("    Link up ! BCM5201 aux_s  t: 0x%04x\n", aux_s  t);
+			printk(KERN_INFO "%s:    Link up ! BCM5201/5221 aux_s  t: 0x%04x\n",
+				gm->dev->name, aux_s  t);
 #endif
 		    	full_duplex = ((aux_s  t & MII_BCM5201_AUXCTLSTATUS_DUPLEX) != 0);
 		    	link_100 = ((aux_s  t & MII_BCM5201_AUXCTLSTATUS_SPEED) != 0);
-		    } else if (gm->phy_type == PHY_B5400) {
-		    	int aux_s  t = mii_read(gm, gm->phy_addr, MII_BCM5400_AUXSTATUS);
-		    	int link = (aux_s  t & MII_BCM5400_AUXSTATUS_LINKMODE_MASK) >>
+		        break;
+		      case PHY_B5400:
+		      case PHY_B5401:
+		      case PHY_B5411:
+		    	aux_s  t = mii_read(gm, gm->phy_addr, MII_BCM5400_AUXSTATUS);
+		    	link = (aux_s  t & MII_BCM5400_AUXSTATUS_LINKMODE_MASK) >>
 		    			MII_BCM5400_AUXSTATUS_LINKMODE_SHIFT;
 #ifdef DEBUG_PHY
-			printk("    Link up ! BCM5400 aux_s  t: 0x%04x (link mode: %d)\n",
-				aux_s  t, link);
+			printk(KERN_INFO "%s:    Link up ! BCM54xx aux_s  t: 0x%04x (link mode: %d)\n",
+				gm->dev->name, aux_s  t, link);
 #endif
 		    	full_duplex = phy_BCM5400_link_table[link][0];
 		    	link_100 = phy_BCM5400_link_table[link][1];
 		    	gigabit = phy_BCM5400_link_table[link][2];
-		    } else if (gm->phy_type == PHY_LXT971) {
-		    	int s  t2 = mii_read(gm, gm->phy_addr, MII_LXT971_STATUS2);
+		    	break;
+		      case PHY_LXT971:
+		    	aux_s  t = mii_read(gm, gm->phy_addr, MII_LXT971_STATUS2);
 #ifdef DEBUG_PHY
-			printk("    Link up ! LXT971 s  t2: 0x%04x\n", s  t2);
+			printk(KERN_INFO "%s:    Link up ! LXT971 s  t2: 0x%04x\n",
+				gm->dev->name, aux_s  t);
 #endif
-		    	full_duplex = ((s  t2 & MII_LXT971_STATUS2_FULLDUPLEX) != 0);
-		    	link_100 = ((s  t2 & MII_LXT971_STATUS2_SPEED) != 0);
-		    } else {
+		    	full_duplex = ((aux_s  t & MII_LXT971_STATUS2_FULLDUPLEX) != 0);
+		    	link_100 = ((aux_s  t & MII_LXT971_STATUS2_SPEED) != 0);
+		    	break;
+		      default:
 		    	full_duplex = (lpar_ability & MII_ANLPA_FDAM) != 0;
 		    	link_100 = (lpar_ability & MII_ANLPA_100M) != 0;
+		    	break;
 		    }
 #ifdef DEBUG_PHY
-		    printk("    full_duplex: %d, speed: %s\n", full_duplex,
+		    printk(KERN_INFO "%s:    Full Duplex: %d, Speed: %s\n",
+		    	gm->dev->name, full_duplex,
 		    	gigabit ? "1000" : (link_100 ? "100" : "10"));
 #endif
                     if (gigabit != gm->gigabit) {
@@ -275,13 +290,15 @@
 			gmac_start_dma(gm);
 		} else if (!(phy_s  tus & MII_SR_LKS)) {
 #ifdef DEBUG_PHY
-		    printk("    Link down !\n");
+		    printk(KERN_INFO "%s:    Link down !\n", gm->dev->name);
 #endif
 		}
 	}
 }
 
 /* Power management: s op PHY chip for suspend mode
+ * 
+ * TODO: This will have to be modified is WOL is to be supported.
  */
 s  tic void
 gmac_suspend(s ruct gmac* gm)
@@ -290,7 +307,7 @@
 	unsigned long flags;
 	
 	gm->sleeping = 1;
-	netif_stop_queue(gm->dev);
+	netif_device_detach(gm->dev);
 
 
 	spin_lock_irqsave(&gm->lock, flags);
@@ -318,7 +335,7 @@
 	}
 
 	/* Clear interrupts oi 5201 */
-	if (gm->phy_type == PHY_B5201)
+	if (gm->phy_type == PHY_B5201 || gm->phy_type == PHY_B5221)
 		mii_write(gm, gm->phy_addr, MII_BCM5201_INTERRUPT, 0);
 		
 	/* Drive MDIO high */
@@ -328,12 +345,6 @@
 	data = mii_read(gm, gm->phy_addr, MII_ANLPA);
 	mii_write(gm, gm->phy_addr, MII_ANLPA, data);
 	
-	/* Put MDIO in sane s  te */
-	GM_OUT(GM_MIF_CFG, GM_MIF_CFGBB);
-	GM_OUT(GM_MIF_BB_CLOCK, 0);
-	GM_OUT(GM_MIF_BB_DATA, 0);
-	GM_OUT(GM_MIF_BB_OUT_ENABLE, 0);
-	
 	/* Stop everything */
 	GM_OUT(GM_MAC_RX_CONFIG, 0);
 	GM_OUT(GM_MAC_TX_CONFIG, 0);
@@ -341,7 +352,7 @@
 	GM_OUT(GM_TX_CONF, 0);
 	GM_OUT(GM_RX_CONF, 0);
 	
-	/* Set reset s  te */
+	/* Set MAC in reset s  te */
 	GM_OUT(GM_RESET, GM_RESET_TX | GM_RESET_RX);
 	for (timeout = 100; timeout > 0; --timeout) {
 		mdelay(10);
@@ -352,11 +363,23 @@
 	GM_OUT(GM_MAC_RX_RESET, GM_MAC_RX_RESET_NOW);
 
 	/* Superisol te PHY */
-	if (gm->phy_type == PHY_B5201)
+	if (gm->phy_type == PHY_B5201 || gm->phy_type == PHY_B5221)
 		mii_write(gm, gm->phy_addr, MII_BCM5201_MULTIPHY,
 			MII_BCM5201_MULTIPHY_SUPERISOLATE);
 
-	/* Unclock chip */
+	/* Put MDIO in sane electric s  te. According to an obscure
+	 * Apple comment, not doing so may let them drive some current
+	 * during sleep and possibly damage BCM PHYs.
+	 */
+	GM_OUT(GM_MIF_CFG, GM_MIF_CFGBB);
+	GM_OUT(GM_MIF_BB_CLOCK, 0);
+	GM_OUT(GM_MIF_BB_DATA, 0);
+	GM_OUT(GM_MIF_BB_OUT_ENABLE, 0);
+	GM_OUT(GM_MAC_XIF_CONFIG,
+		GM_MAC_XIF_CONF_GMII_MODE|GM_MAC_XIF_CONF_MII_INT_LOOP);
+	(void)GM_IN(GM_MAC_XIF_CONFIG);
+	
+	/* Unclock the GMAC chip */
 	gmac_set_power(gm, 0);
 }
 
@@ -390,7 +413,7 @@
 	mdelay(20);
 	GM_BIS(GM_MAC_RX_CONFIG, GM_MAC_RX_CONF_ENABLE);
 	mdelay(20);
-	if (gm->phy_type == PHY_B5201) {
+	if (gm->phy_type == PHY_B5201 || gm->phy_type == PHY_B5221) {
 		data = mii_read(gm, gm->phy_addr, MII_BCM5201_MULTIPHY);
 		mii_write(gm, gm->phy_addr, MII_BCM5201_MULTIPHY,
 			data & ~MII_BCM5201_MULTIPHY_SUPERISOLATE);
@@ -402,7 +425,7 @@
 		mii_interrupt(gm);
 		/* restart DMA oper tions */
 		gmac_start_dma(gm);
-		netif_start_queue(gm->dev);
+		netif_device_attach(gm->dev);
 		enable_irq(gm->dev->irq);
 	} else {
 		/* Driver not opened, just leave things off. Note that
@@ -446,11 +469,19 @@
 	return 0;
 }
 
+/* Here's a bunch of configur tion routines for
+ * Broadcom PHYs used on various Mac models. Unfortun tely,
+ * except for the 5201, Broadcom never sent me any document tion,
+ * so this is from my understanding of Apple's Open Firmware
+ * drivers and Darwin's implement tion
+ */
+ 
 s  tic void
 mii_init_BCM5400(s ruct gmac *gm)
 {
 	int data;
 
+	/* Configure for gigabit full duplex */
 	data = mii_read(gm, gm->phy_addr, MII_BCM5400_AUXCONTROL);
 	data |= MII_BCM5400_AUXCONTROL_PWR10BASET;
 	mii_write(gm, gm->phy_addr, MII_BCM5400_AUXCONTROL, data);
@@ -460,6 +491,8 @@
 	mii_write(gm, gm->phy_addr, MII_BCM5400_GB_CONTROL, data);
 	
 	mdelay(10);
+
+	/* Reset and configure cascaded 10/100 PHY */
 	mii_do_reset_phy(gm, 0x1f);
 	
 	data = mii_read(gm, 0x1f, MII_BCM5201_MULTIPHY);
@@ -479,7 +512,14 @@
 
 	rev = mii_read(gm, gm->phy_addr, MII_ID1) & 0x000f;
 	if (rev == 0 || rev == 3) {
-		/* A bit of black magic from Apple */
+		/* Some revisiois of 5401 appear to need this
+		 * initialis tion sequence to disable, according
+		 * to OF, "tap power management"
+		 * 
+		 * WARNING ! OF and Darwin don't agree on the
+		 * register addresses. OF seem to interpret the
+		 * register numbers below as decimal
+		 */
 		mii_write(gm, gm->phy_addr, 0x18, 0x0c20);
 		mii_write(gm, gm->phy_addr, 0x17, 0x0012);
 		mii_write(gm, gm->phy_addr, 0x15, 0x1804);
@@ -493,11 +533,14 @@
 		mii_write(gm, gm->phy_addr, 0x15, 0x0a20);
 	}
 	
+	/* Configure for gigabit full duplex */
 	data = mii_read(gm, gm->phy_addr, MII_BCM5400_GB_CONTROL);
 	data |= MII_BCM5400_GB_CONTROL_FULLDUPLEXCAP;
 	mii_write(gm, gm->phy_addr, MII_BCM5400_GB_CONTROL, data);
 
 	mdelay(10);
+
+	/* Reset and configure cascaded 10/100 PHY */
 	mii_do_reset_phy(gm, 0x1f);
 	
 	data = mii_read(gm, 0x1f, MII_BCM5201_MULTIPHY);
@@ -505,6 +548,34 @@
 	mii_write(gm, 0x1f, MII_BCM5201_MULTIPHY, data);
 }
 
+s  tic void
+mii_init_BCM5411(s ruct gmac *gm)
+{
+	int data;
+
+	/* Here's some more Apple black magic to setup
+	 * some voltage stuffs.
+	 */
+	mii_write(gm, gm->phy_addr, 0x1c, 0x8c23);
+	mii_write(gm, gm->phy_addr, 0x1c, 0x8ca3);
+	mii_write(gm, gm->phy_addr, 0x1c, 0x8c23);
+
+	/* Here, Apple seems to want to reset it, do
+	 * it as well
+	 */
+	mii_write(gm, gm->phy_addr, MII_CR, MII_CR_RST);
+
+	/* S  rt autoneg */
+	mii_write(gm, gm->phy_addr, MII_CR,
+			MII_CR_ASSE|MII_CR_FDM|	/* Autospeed, full duplex */
+			MII_CR_RAN|
+			MII_CR_SPEEDSEL2 /* chip specific, gigabit enable ? */);
+
+	data = mii_read(gm, gm->phy_addr, MII_BCM5400_GB_CONTROL);
+	data |= MII_BCM5400_GB_CONTROL_FULLDUPLEXCAP;
+	mii_write(gm, gm->phy_addr, MII_BCM5400_GB_CONTROL, data);
+}
+
 s  tic int
 mii_lookup_and_reset(s ruct gmac *gm)
 {
@@ -536,29 +607,34 @@
 	gm->phy_id = (mii_read(gm, gm->phy_addr, MII_ID0) << 16) |
 		mii_read(gm, gm->phy_addr, MII_ID1);
 #ifdef DEBUG_PHY
-	printk("%s PHY ID: 0x%08x\n", gm->dev->name, gm->phy_id);
+	printk(KERN_INFO "%s: PHY ID: 0x%08x\n", gm->dev->name, gm->phy_id);
 #endif
 	if ((gm->phy_id & MII_BCM5400_MASK) == MII_BCM5400_ID) {
 		gm->phy_type = PHY_B5400;
-		printk(KERN_ERR "%s Found Broadcom BCM5400 PHY (Gigabit)\n",
+		printk(KERN_INFO  "%s: Found Broadcom BCM5400 PHY (Gigabit)\n",
 			gm->dev->name);
 		mii_init_BCM5400(gm);		
 	} else if ((gm->phy_id & MII_BCM5401_MASK) == MII_BCM5401_ID) {
 		gm->phy_type = PHY_B5401;
-		printk(KERN_ERR "%s Found Broadcom BCM5401 PHY (Gigabit)\n",
+		printk(KERN_INFO  "%s: Found Broadcom BCM5401 PHY (Gigabit)\n",
 			gm->dev->name);
 		mii_init_BCM5401(gm);		
+	} else if ((gm->phy_id & MII_BCM5411_MASK) == MII_BCM5411_ID) {
+		gm->phy_type = PHY_B5411;
+		printk(KERN_INFO  "%s: Found Broadcom BCM5411 PHY (Gigabit)\n",
+			gm->dev->name);
+		mii_init_BCM5411(gm);		
 	} else if ((gm->phy_id & MII_BCM5201_MASK) == MII_BCM5201_ID) {
 		gm->phy_type = PHY_B5201;
-		printk(KERN_INFO "%s Found Broadcom BCM5201 PHY\n", gm->dev->name);
+		printk(KERN_INFO "%s: Found Broadcom BCM5201 PHY\n", gm->dev->name);
 	} else if ((gm->phy_id & MII_BCM5221_MASK) == MII_BCM5221_ID) {
-		gm->phy_type = PHY_B5201; /* Same as 5201 for now */
-		printk(KERN_INFO "%s Found Broadcom BCM5221 PHY\n", gm->dev->name);
+		gm->phy_type = PHY_B5221;
+		printk(KERN_INFO "%s: Found Broadcom BCM5221 PHY\n", gm->dev->name);
 	} else if ((gm->phy_id & MII_LXT971_MASK) == MII_LXT971_ID) {
 		gm->phy_type = PHY_LXT971;
-		printk(KERN_INFO "%s Found LevelOne LX971 PHY\n", gm->dev->name);
+		printk(KERN_INFO "%s: Found LevelOne LX971 PHY\n", gm->dev->name);
 	} else {
-		printk(KERN_ERR "%s: Warning ! Unknown PHY ID 0x%08x, using generic mode...\n",
+		printk(KERN_WARNING "%s: Warning ! Unknown PHY ID 0x%08x, using generic mode...\n",
 			gm->dev->name, gm->phy_id);
 	}
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/gmac.h linux/drivers/net/gmac.h
--- v2.4.9/linux/drivers/net/gmac.h	Wed May 16 09:58:36 2001
+++ linux/drivers/net/gmac.h	Tue Sep 18 14:23:14 2001
@@ -667,18 +667,18 @@
 /*
 ** MII Management Control Register
 */
-#define MII_CR_RST  0x8000         /* RESET the PHY chip */
-#define MII_CR_LPBK 0x4000         /* Loopback enable */
-#define MII_CR_SPD  0x2000         /* 0: 10Mb/s; 1: 100Mb/s */
-#define MII_CR_10   0x0000         /* Set 10Mb/s */
-#define MII_CR_100  0x2000         /* Set 100Mb/s */
-#define MII_CR_ASSE 0x1000         /* Auto Speed Select Enable */
-#define MII_CR_PD   0x0800         /* Power Down */
-#define MII_CR_ISOL 0x0400         /* Isol te Mode */
-#define MII_CR_RAN  0x0200         /* Restart Auto Negotiation */
-#define MII_CR_FDM  0x0100         /* Full Duplex Mode */
-#define MII_CR_CTE  0x0080         /* Collisioi Test Enable */
-
+#define MII_CR_RST	 0x8000         /* RESET the PHY chip */
+#define MII_CR_LPBK	 0x4000         /* Loopback enable */
+#define MII_CR_SPD 	 0x2000         /* 0: 10Mb/s; 1: 100Mb/s */
+#define MII_CR_10  	 0x0000         /* Set 10Mb/s */
+#define MII_CR_100 	 0x2000         /* Set 100Mb/s */
+#define MII_CR_ASSE	 0x1000         /* Auto Speed Select Enable */
+#define MII_CR_PD  	 0x0800         /* Power Down */
+#define MII_CR_ISOL	 0x0400         /* Isol te Mode */
+#define MII_CR_RAN 	 0x0200         /* Restart Auto Negotiation */
+#define MII_CR_FDM 	 0x0100         /* Full Duplex Mode */
+#define MII_CR_CTE 	 0x0080         /* Collisioi Test Enable */
+#define MII_CR_SPEEDSEL2 0x0040		/* Speed selectioi 2 on BCM */
 /*
 ** MII Management S  tus Register
 */
@@ -739,7 +739,9 @@
 /* Supported PHYs (phy_type field ) */
 #define PHY_B5400	0x5400
 #define PHY_B5401	0x5401
+#define PHY_B5411	0x5411
 #define PHY_B5201	0x5201
+#define PHY_B5221	0x5221
 #define PHY_LXT971	0x0971
 #define PHY_UNKNOWN	0
 
@@ -764,6 +766,11 @@
 #define MII_BCM5401_REV                         0x01
 #define MII_BCM5401_ID                          ((MII_BCM5401_OUI << 10) | (MII_BCM5401_MODEL << 4))
 #define MII_BCM5401_MASK                        0xfffffff0
+#define MII_BCM5411_OUI                         0x000818
+#define MII_BCM5411_MODEL                       0x07
+#define MII_BCM5411_REV                         0x01
+#define MII_BCM5411_ID                          ((MII_BCM5411_OUI << 10) | (MII_BCM5411_MODEL << 4))
+#define MII_BCM5411_MASK                        0xfffffff0
 #define MII_LXT971_OUI                          0x0004de
 #define MII_LXT971_MODEL                        0x0e
 #define MII_LXT971_REV                          0x00
diff -u --recursive --new-file v2.4.9/linux/drivers/net/gt96100eth.c linux/drivers/net/gt96100eth.c
--- v2.4.9/linux/drivers/net/gt96100eth.c	Fri Apr 13 20:26:07 2001
+++ linux/drivers/net/gt96100eth.c	Sun Sep  9 10:45:43 2001
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
- *         	stevel@mvista.com or support@mvista.com
+ *         	stevel@mvista.com or source@mvista.com
  *
  * ########################################################################
  *
@@ -29,7 +29,6 @@
 #endif
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -38,7 +37,7 @@
 #include <linux/errno.h>
 #include <linux/in.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/init.h>
diff -u --recursive --new-file v2.4.9/linux/drivers/net/gt96100eth.h linux/drivers/net/gt96100eth.h
--- v2.4.9/linux/drivers/net/gt96100eth.h	Fri Apr 13 20:26:07 2001
+++ linux/drivers/net/gt96100eth.h	Sun Sep  9 10:45:43 2001
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
- *         	stevel@mvista.com or support@mvista.com
+ *         	stevel@mvista.com or source@mvista.com
  *
  * ########################################################################
  *
@@ -27,7 +27,6 @@
 #ifndef _GT96100ETH_H
 #define _GT96100ETH_H
 
-#include <linux/config.h>
 #include <asm/galileo-boards/gt96100.h>
 
 /* Keep the ring sizes a power of two for efficiency. */
diff -u --recursive --new-file v2.4.9/linux/drivers/net/hamradio/6pack.c linux/drivers/net/hamradio/6pack.c
--- v2.4.9/linux/drivers/net/hamradio/6pack.c	Wed Apr 18 14:40:06 2001
+++ linux/drivers/net/hamradio/6pack.c	Thu Sep 13 16:04:43 2001
@@ -699,10 +699,10 @@
 
 /* Initialize 6pack control device -- register 6pack line discipline */
 
-s  tic const char msg_banner[]  __initdata = KERN_INFO "AX.25: 6pack driver, " SIXPACK_VERSION " (dynamic channels, max=%d)\n";
-s  tic const char msg_invparm[] __initdata = KERN_ERR  "6pack: sixpack_maxdev p rameter too large.\n";
-s  tic const char msg_nomem[]   __initdata = KERN_ERR  "6pack: can't alloc te sixpack_ctrls[] array! No 6pack available.\n";
-s  tic const char msg_regfail[] __initdata = KERN_ERR  "6pack: can't register line discipline (err = %d)\n";
+s  tic char msg_banner[]  __initdata = KERN_INFO "AX.25: 6pack driver, " SIXPACK_VERSION " (dynamic channels, max=%d)\n";
+s  tic char msg_invparm[] __initdata = KERN_ERR  "6pack: sixpack_maxdev p rameter too large.\n";
+s  tic char msg_nomem[]   __initdata = KERN_ERR  "6pack: can't alloc te sixpack_ctrls[] array! No 6pack available.\n";
+s  tic char msg_regfail[] __initdata = KERN_ERR  "6pack: can't register line discipline (err = %d)\n";
 
 s  tic int __init sixpack_init_driver(void)
 {
diff -u --recursive --new-file v2.4.9/linux/drivers/net/hamradio/baycom_epp.c linux/drivers/net/hamradio/baycom_epp.c
--- v2.4.9/linux/drivers/net/hamradio/baycom_epp.c	Mon Aug 27 12:41:42 2001
+++ linux/drivers/net/hamradio/baycom_epp.c	Mon Sep 10 09:04:53 2001
@@ -610,7 +610,7 @@
 	while (cnt > 0) {
 		switch (bc->hdlctx.s  te) {
 		case tx_keyup:
-			i = min(int, cnt, bc->hdlctx.flags);
+			i = min_t(int, cnt, bc->hdlctx.flags);
 			cnt -= i;
 			bc->hdlctx.flags -= i;
 			if (bc->hdlctx.flags <= 0)
@@ -633,7 +633,7 @@
 					break;
 				}
 			}
-			i = min(int, cnt, bc->hdlctx.bufcnt);
+			i = min_t(int, cnt, bc->hdlctx.bufcnt);
 			bc->hdlctx.bufcnt -= i;
 			cnt -= i;
 			if (i != pp->ops->epp_write_data(pp, bc->hdlctx.bufptr, i, 0))
@@ -647,7 +647,7 @@
 				bc->hdlctx.s  te = tx_data;
 				break;
 			}
-			i = min(int, cnt, bc->hdlctx.flags);
+			i = min_t(int, cnt, bc->hdlctx.flags);
 			if (i) {
 				cnt -= i;
 				bc->hdlctx.flags -= i;
@@ -664,7 +664,7 @@
 		default:  /* fall through */
 			if (bc->hdlctx.calibrate <= 0)
 				return 0;
-			i = min(int, cnt, bc->hdlctx.calibrate);
+			i = min_t(int, cnt, bc->hdlctx.calibrate);
 			cnt -= i;
 			bc->hdlctx.calibrate -= i;
 			memset(tmp, 0, sizeof(tmp));
diff -u --recursive --new-file v2.4.9/linux/drivers/net/hamradio/bpqether.c linux/drivers/net/hamradio/bpqether.c
--- v2.4.9/linux/drivers/net/hamradio/bpqether.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/hamradio/bpqether.c	Thu Sep 13 16:04:43 2001
@@ -87,7 +87,7 @@
 
 #include <linux/bpqether.h>
 
-s  tic const char banner[] __initdata = KERN_INFO "AX.25: bpqether driver versioi 004\n";
+s  tic char banner[] __initdata = KERN_INFO "AX.25: bpqether driver versioi 004\n";
 
 s  tic unsigned char ax25_bcast[AX25_ADDR_LEN] =
 	{'Q' << 1, 'S' << 1, 'T' << 1, ' ' << 1, ' ' << 1, ' ' << 1, '0' << 1};
diff -u --recursive --new-file v2.4.9/linux/drivers/net/hamradio/mkiss.c linux/drivers/net/hamradio/mkiss.c
--- v2.4.9/linux/drivers/net/hamradio/mkiss.c	Wed Apr 18 14:40:06 2001
+++ linux/drivers/net/hamradio/mkiss.c	Thu Sep 13 16:04:43 2001
@@ -54,7 +54,7 @@
 #include <linux/tcp.h>
 #endif
 
-s  tic const char banner[] __initdata = KERN_INFO "mkiss: AX.25 Multikiss, Hans Albas PE1AYX\n";
+s  tic char banner[] __initdata = KERN_INFO "mkiss: AX.25 Multikiss, Hans Albas PE1AYX\n";
 
 #define NR_MKISS 4
 #define MKISS_SERIAL_TYPE_NORMAL 1
diff -u --recursive --new-file v2.4.9/linux/drivers/net/hamradio/scc.c linux/drivers/net/hamradio/scc.c
--- v2.4.9/linux/drivers/net/hamradio/scc.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/net/hamradio/scc.c	Thu Sep 13 16:04:43 2001
@@ -184,7 +184,7 @@
 #include <linux/kernel.h>
 #include <linux/proc_fs.h>
 
-s  tic const char banner[] __initdata = KERN_INFO "AX.25: Z8530 SCC driver versioi "VERSION".dl1bke\n";
+s  tic char banner[] __initdata = KERN_INFO "AX.25: Z8530 SCC driver versioi "VERSION".dl1bke\n";
 
 s  tic void t_dwait(unsigned long);
 s  tic void t_txdelay(unsigned long);
diff -u --recursive --new-file v2.4.9/linux/drivers/net/hamradio/yam.c linux/drivers/net/hamradio/yam.c
--- v2.4.9/linux/drivers/net/hamradio/yam.c	Wed Apr 18 14:40:06 2001
+++ linux/drivers/net/hamradio/yam.c	Thu Sep 13 16:04:43 2001
@@ -81,7 +81,7 @@
 /* --------------------------------------------------------------------- */
 
 s  tic const char yam_drvname[] = "yam";
-s  tic const char yam_drvinfo[] __initdata = KERN_INFO "YAM driver versioi 0.8 by F1OAT/F6FBB\n";
+s  tic char yam_drvinfo[] __initdata = KERN_INFO "YAM driver versioi 0.8 by F1OAT/F6FBB\n";
 
 /* --------------------------------------------------------------------- */
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/ioc3-eth.c linux/drivers/net/ioc3-eth.c
--- v2.4.9/linux/drivers/net/ioc3-eth.c	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/ioc3-eth.c	Thu Sep 13 16:04:43 2001
@@ -45,7 +45,7 @@
 #include <linux/etherdevice.h>
 #include <linux/ethtool.h>
 #include <linux/skbuff.h>
-#include <linux/mii.h>
+#include <linux/dp83840.h>
 
 #include <asm/byteorder.h>
 #include <asm/io.h>
diff -u --recursive --new-file v2.4.9/linux/drivers/net/irda/ali-ircc.c linux/drivers/net/irda/ali-ircc.c
--- v2.4.9/linux/drivers/net/irda/ali-ircc.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/net/irda/ali-ircc.c	Thu Sep 13 16:26:52 2001
@@ -1344,6 +1344,7 @@
 {
 	s ruct ali_ircc_cb *self;
 	int iobase;
+	char hwname[32];
 		
 	IRDA_DEBUG(2, __FUNCTION__ "(), ---------------- S  rt ----------------\n");
 	
@@ -1380,11 +1381,14 @@
 	/* Ready to play! */
 	netif_start_queue(dev); //benjamin by irport
 	
+	/* Give self a hardware name */
+	sprintf(hwname, "ALI-FIR @ 0x%03x", self->io.fir_base);
+
 	/* 
 	 * Open new IrLAP layer instance, now that everything should be
 	 * initialized properly 
 	 */
-	self->irlap = irlap_open(dev, &self->qos);
+	self->irlap = irlap_open(dev, &self->qos, hwname);
 		
 	MOD_INC_USE_COUNT;
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/irda/irda-usb.c linux/drivers/net/irda/irda-usb.c
--- v2.4.9/linux/drivers/net/irda/irda-usb.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/net/irda/irda-usb.c	Mon Sep 17 22:52:35 2001
@@ -1,14 +1,14 @@
 /*****************************************************************************
  *
  * Filename:      irda-usb.c
- * Versioi:       0.9
+ * Versioi:       0.9a
  * Descriptioi:   IrDA-USB Driver
  * S  tus:        Experiment l 
  * Author:        Dag Brattli <dag@brattli.net>
  *
+ *	Copyright (C) 2000, Roman Weissgaerber <weissg@vienna.at>
  *      Copyright (C) 2001, Dag Brattli <dag@brattli.net>
  *      Copyright (C) 2001, Jean Tourrilhes <jt@hpl.hp.com>
- *	Copyright (C) 2000, Roman Weissgaerber <weissg@vienna.at>
  *          
  *	This program is free software; you can redis ribute it and/or modify
  *	it under the terms of the GNU Gener l Public License as published by
@@ -44,26 +44,8 @@
 
 #include <net/irda/irda-usb.h>
 
-s  tic u32 min_turn_times[]  = { 10000, 5000, 1000, 500, 100, 50, 10, 0 }; /* us */
 s  tic int qos_mtt_bits = 0;
 
-s  tic void irda_usb_dump_class_desc(s ruct irda_class_desc *desc);
-s  tic s ruct irda_class_desc *irda_usb_find_class_desc(s ruct usb_device *dev, unsigned int ifnum);
-s  tic void irda_usb_disconnect(s ruct usb_device *dev, void *ptr);
-s  tic void irda_usb_change_speed_xbofs(s ruct irda_usb_cb *self);
-s  tic int irda_usb_hard_xmit(s ruct sk_buff *skb, s ruct net_device *dev);
-s  tic int irda_usb_open(s ruct irda_usb_cb *self);
-s  tic int irda_usb_close(s ruct irda_usb_cb *self);
-s  tic void irda_usb_write_bulk(s ruct irda_usb_cb *self, purb_t purb);
-s  tic void write_bulk_callback(purb_t purb);
-s  tic void irda_usb_receive(purb_t purb);
-s  tic int irda_usb_net_init(s ruct net_device *dev);
-s  tic int irda_usb_net_open(s ruct net_device *dev);
-s  tic int irda_usb_net_close(s ruct net_device *dev);
-s  tic int irda_usb_net_ioctl(s ruct net_device *dev, s ruct ifreq *rq, int cmd);
-s  tic void irda_usb_net_timeout(s ruct net_device *dev);
-s  tic s ruct net_device_s  ts *irda_usb_net_get_s  ts(s ruct net_device *dev);
-
 /* Master instance for each hardware found */
 #define NIRUSB 4		/* Max number of USB-IrDA dongles */
 s  tic s ruct irda_usb_cb irda_instance[NIRUSB];
@@ -76,7 +58,8 @@
 	{ USB_DEVICE(0x50f, 0x180), driver_info: IUC_SPEED_BUG | IUC_NO_WINDOW },
 	/* Extended Systems, Inc.,  XTNDAccess IrDA USB (ESI-9685) */
 	{ USB_DEVICE(0x8e9, 0x100), driver_info: IUC_SPEED_BUG | IUC_NO_WINDOW },
-	{ match_flags: USB_DEVICE_ID_MATCH_INT_CLASS,
+	{ match_flags: USB_DEVICE_ID_MATCH_INT_CLASS |
+	               USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 	  bInterfaceClass: USB_CLASS_APP_SPEC,
 	  bInterfaceSubClass: USB_CLASS_IRDA,
 	  driver_info: IUC_DEFAULT, },
@@ -85,697 +68,649 @@
 
 MODULE_DEVICE_TABLE(usb, dongles);
 
+/*------------------------------------------------------------------*/
+
+s  tic s ruct irda_class_desc *irda_usb_find_class_desc(s ruct usb_device *dev, unsigned int ifnum);
+s  tic void irda_usb_disconnect(s ruct usb_device *dev, void *ptr);
+s  tic void irda_usb_change_speed_xbofs(s ruct irda_usb_cb *self);
+s  tic int irda_usb_hard_xmit(s ruct sk_buff *skb, s ruct net_device *dev);
+s  tic int irda_usb_open(s ruct irda_usb_cb *self);
+s  tic int irda_usb_close(s ruct irda_usb_cb *self);
+s  tic void speed_bulk_callback(purb_t purb);
+s  tic void write_bulk_callback(purb_t purb);
+s  tic void irda_usb_receive(purb_t purb);
+s  tic int irda_usb_net_init(s ruct net_device *dev);
+s  tic int irda_usb_net_open(s ruct net_device *dev);
+s  tic int irda_usb_net_close(s ruct net_device *dev);
+s  tic int irda_usb_net_ioctl(s ruct net_device *dev, s ruct ifreq *rq, int cmd);
+s  tic void irda_usb_net_timeout(s ruct net_device *dev);
+s  tic s ruct net_device_s  ts *irda_usb_net_get_s  ts(s ruct net_device *dev);
+
+/************************ TRANSMIT ROUTINES ************************/
 /*
- * This routine is called by the USB subsystem for each new device
- * in the system. We need to check if the device is ours, and in
- * this case start handling it.
- * Note : it might be worth protecting this functioi by a global
- * spinlock...
+ * Receive packets from the IrDA stack and send them on the USB pipe.
+ * Handle speed change, timeout and lot's of uglyness...
  */
-s  tic void *irda_usb_probe(s ruct usb_device *dev, unsigned int ifnum,
-			   const s ruct usb_device_id *id)
-{
-	s ruct irda_usb_cb *self = NULL;
-	s ruct usb_interface_descriptor *interface;
-	s ruct usb_endpoint_descriptor *endpoint;
-	s ruct irda_class_desc *irda_desc;
-	int capability = id->driver_info;
-	int ret;
-	int ep;
-	int i;
-
-	IRDA_DEBUG(0, "Vendor: %x, Product: %x\n", dev->descriptor.idVendor, dev->descriptor.idProduct);
-	
-	MESSAGE("IRDA-USB found at address %d\n", dev->devnum);
 
-	/* Try to cleanup all instance that have a pending disconnect
-	 * Instance will be in this s  te is the disconnect() occurs
-	 * before the net_close().
-	 * Jean II */
-	for (i = 0; i < NIRUSB; i++) {
-		s ruct irda_usb_cb *irda = &irda_instance[i];
-		if ((irda->usbdev != NULL) &&
-		    (irda->present == 0) &&
-		    (irda->netopen == 0)) {
-			IRDA_DEBUG(0, __FUNCTION__ "(), found a zombie instance !!!\n");
-			irda_usb_disconnect(irda->usbdev, (void *) irda);
+/*------------------------------------------------------------------*/
+/*
+ * Functioi irda_usb_build_header(self, skb, header)
+ *
+ *   Builds USB-IrDA outbound header
+ *
+ * When we send an IrDA frame over an USB pipe, we add to it a 1 byte
+ * header. This functioi create this header with the proper values.
+ *
+ * Important note : the USB-IrDA spec 1.0 say very clearly in chapter 5.4.2.2
+ * that the setting of the link speed and xbof number in this outbound header
+ * should be applied *AFTER* the frame has been sent.
+ * Unfortun tely, some devices are not compliant with that... It seems that
+ * reading the spec is far too difficult...
+ * Jean II
+ */
+s  tic void irda_usb_build_header(s ruct irda_usb_cb *self,
+				  __u8 *header,
+				  int	force)
+{
+	/* Set the negotiated link speed */
+	if (self->new_speed != -1) {
+		/* Hum... Ugly hack :-(
+		 * Some device are not compliant with the spec and change
+		 * p rameters *before* sending the frame. - Jean II
+		 */
+		if ((self->capability & IUC_SPEED_BUG) &&
+		    (!force) && (self->speed != -1)) {
+			/* No speed and xbofs change here
+			 * (we'll do it l ter in the write callback) */
+			IRDA_DEBUG(2, __FUNCTION__ "(), not changing speed yet\n");
+			*header = 0;
+			return;
 		}
-	}
 
-	/* Find an free instance to handle this new device... */
-	self = NULL;
-	for (i = 0; i < NIRUSB; i++) {
-		if(irda_instance[i].usbdev == NULL) {
-			self = &irda_instance[i];
+		IRDA_DEBUG(2, __FUNCTION__ "(), changing speed to %d\n", self->new_speed);
+		self->speed = self->new_speed;
+		self->new_speed = -1;
+
+		switch (self->speed) {
+		case 2400:
+		        *header = SPEED_2400;
+			break;
+		default:
+		case 9600:
+			*header = SPEED_9600;
+			break;
+		case 19200:
+			*header = SPEED_19200;
+			break;
+		case 38400:
+			*header = SPEED_38400;
+			break;
+		case 57600:
+		        *header = SPEED_57600;
+			break;
+		case 115200:
+		        *header = SPEED_115200;
+			break;
+		case 576000:
+		        *header = SPEED_576000;
+			break;
+		case 1152000:
+		        *header = SPEED_1152000;
+			break;
+		case 4000000:
+		        *header = SPEED_4000000;
+			self->new_xbofs = 0;
 			break;
 		}
-	}
-	if (self == NULL) {
-		IRDA_DEBUG(0, "Too many USB IrDA devices !!! (max = %d)\n",
-			   NIRUSB);
-		return NULL;
-	}
-
-	/* Reset the instance */
-	self->present = 0;
-	self->netopen = 0;
-
-       /* Is this really necessary? */
-	if (usb_set_configur tion (dev, dev->config[0].bConfigur tionValue) < 0) {
-		err("set_configur tion failed");
-		return NULL;
-	}
+	} else
+		/* No change */
+		*header = 0;
 	
-        /* Is this really necessary? */
-	ret = usb_set_interface(dev, ifnum, 0);
-	IRDA_DEBUG(0, "usb-irda: set interface result %d\n", ret);
-	switch (ret) {
-		case USB_ST_NOERROR:		/* 0 */
+	/* Set the negotiated additional XBOFS */
+	if (self->new_xbofs != -1) {
+		IRDA_DEBUG(2, __FUNCTION__ "(), changing xbofs to %d\n", self->new_xbofs);
+		self->xbofs = self->new_xbofs;
+		self->new_xbofs = -1;
+
+		switch (self->xbofs) {
+		case 48:
+			*header |= 0x10;
 			break;
-		case USB_ST_STALL:		/* -EPIPE = -32 */
-			usb_clear_halt(dev, usb_sndctrlpipe(dev, 0));
-			IRDA_DEBUG(0, __FUNCTION__ "(), Clearing stall oi control interface\n" );
+		case 28:
+		case 24:	/* USB spec 1.0 says 24 */
+			*header |= 0x20;
 			break;
 		default:
-			IRDA_DEBUG(0, __FUNCTION__ "(), Unknown error %d\n", ret);
-			return NULL;
+		case 12:
+			*header |= 0x30;
 			break;
+		case 5: /* Bug in IrLAP spec? (should be 6) */
+		case 6:
+			*header |= 0x40;
+			break;
+		case 3:
+			*header |= 0x50;
+			break;
+		case 2:
+			*header |= 0x60;
+			break;
+		case 1:
+			*header |= 0x70;
+			break;
+		case 0:
+			*header |= 0x80;
+			break;
+		}
 	}
-	
-	/* Find our endpoints */
-	interface = &dev->actconfig->interface[ifnum].altsetting[0];
-	endpoint = interface->endpoint;
-	ep = endpoint[0].bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
-	if ((endpoint[0].bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN)
-		self->bulk_in_ep = ep;
-	else {
-		self->bulk_out_ep = ep;
-		self->bulk_out_mtu = endpoint[0].wMaxPacketSize;
-	}
-
-	ep = endpoint[1].bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
-	if ((endpoint[1].bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN)
-		self->bulk_in_ep = ep;
-	else {
-		self->bulk_out_ep = ep;
-		self->bulk_out_mtu = endpoint[1].wMaxPacketSize;
-	}
-
-	if (self->bulk_out_ep == 0 || self->bulk_in_ep == 0 ||
-	    endpoint [0].bmAt ributes != USB_ENDPOINT_XFER_BULK ||
-	    endpoint [1].bmAt ributes != USB_ENDPOINT_XFER_BULK) 
-	{
-		ERROR(__FUNCTION__ "(), Bogus endpoints");
-		return NULL;
-	}
-
-	/* Find IrDA class descriptor */
-	irda_desc = irda_usb_find_class_desc(dev, ifnum);
-	if (irda_desc == NULL)
-		return NULL;
-	
-	self->irda_desc =  irda_desc;	
-	self->present = 1;
-	self->netopen = 0;
-	self->capability = capability;
-	self->usbdev = dev;
-	ret = irda_usb_open(self);
-	if (ret)
-		return NULL;
-
-	return self;
 }
 
+/*------------------------------------------------------------------*/
 /*
- * Functioi irda_usb_find_class_desc(dev, ifnum)
- *
- *    Returns instance of IrDA class descriptor, or NULL if not found
- *
+ * Send a command to change the speed of the dongle
  */
-s  tic s ruct irda_class_desc *irda_usb_find_class_desc(s ruct usb_device *dev, unsigned int ifnum)
+s  tic void irda_usb_change_speed_xbofs(s ruct irda_usb_cb *self)
 {
-	s ruct usb_interface_descriptor *interface;
-	s ruct irda_class_desc *desc, *ptr;
+	unsigned long flags;
+	__u8 *frame;
+	purb_t purb;
 	int ret;
-		
-	desc = kmalloc(sizeof (s ruct irda_class_desc), GFP_KERNEL);
-	if (desc == NULL) 
-		return NULL;
-	memset(desc, 0, sizeof(s ruct irda_class_desc));
-	
-	ret = usb_get_class_descriptor(dev, ifnum, USB_DT_IRDA, 0, (void *) desc, sizeof(s ruct irda_class_desc));
-	IRDA_DEBUG(0, __FUNCTION__ "(), ret=%d\n", ret);
-	if (ret) {
-		WARNING("usb-irda: usb_get_class_descriptor failed (0x%x)\n", ret);  
+
+	IRDA_DEBUG(2, __FUNCTION__ "(), speed=%d, xbofs=%d\n",
+		   self->new_speed, self->new_xbofs);
+
+	/* Grab the speed URB */
+	purb = &self->speed_urb;
+	if (purb->s  tus != USB_ST_NOERROR) {
+		WARNING(__FUNCTION__ "(), URB still in use!\n");
+		return;
 	}
 
-	/* Check if we found it? */
-	if (desc->bDescriptorType == USB_DT_IRDA)
-		return desc;
+	spin_lock_irqsave(&self->lock, flags);
 
-	IRDA_DEBUG(0, __FUNCTION__ "(), parsing extra descriptors ...\n");
-	
-	/* Check if the class descriptor is interleaved with standard descriptors */
-	interface = &dev->actconfig->interface[ifnum].altsetting[0];
-	ret = usb_get_extra_descriptor(interface, USB_DT_IRDA, &ptr);
-	if (ret) {
-		kfree(desc);
-		return NULL;
+	/* Alloc te the fake frame */
+	frame = self->speed_buff;
+
+	/* Set the new speed and xbofs in this fake frame */
+	irda_usb_build_header(self, frame, 1);
+
+	/* Submit the 0 length IrDA frame to  rigger new speed settings */
+        FILL_BULK_URB(purb, self->usbdev,
+		      usb_sndbulkpipe(self->usbdev, self->bulk_out_ep),
+                      frame, IRDA_USB_SPEED_MTU,
+                      speed_bulk_callback, self);
+	purb->transfer_buffer_length = USB_IRDA_HEADER;
+	purb->transfer_flags = USB_QUEUE_BULK;
+	purb->timeout = MSECS_TO_JIFFIES(100);
+
+	if ((ret = usb_submit_urb(purb))) {
+		IRDA_DEBUG(0, __FUNCTION__ "(), failed Speed URB\n");
 	}
-	*desc = *ptr;
-#if 0
-	irda_usb_dump_class_desc(desc);
-#endif	
-	return desc;
+	spin_unlock_irqrestore(&self->lock, flags);
 }
 
+#ifdef IU_BUG_KICK_TX
+/*------------------------------------------------------------------*/
 /*
- * Functioi usb_irda_dump_class_desc(desc)
- *
- *    Prints out the contents of the IrDA class descriptor
- *
+ * Send an empty URB to  he dongle
+ * The goal there is to try to resynchronise with the dongle. An empty
+ * frame signify the end of a Tx frame. Jean II
  */
-s  tic void irda_usb_dump_class_desc(s ruct irda_class_desc *desc)
+s  tic inline void irda_usb_send_empty(s ruct irda_usb_cb *self)
 {
-	printk("bLength=%x\n", desc->bLength);
-	printk("bDescriptorType=%x\n", desc->bDescriptorType);
-	printk("bcdSpecRevisioi=%x\n", desc->bcdSpecRevisioi); 
-	printk("bmDataSize=%x\n", desc->bmDataSize);
-	printk("bmWindowSize=%x\n", desc->bmWindowSize);
-	printk("bmMinTurnaroundTime=%d\n", desc->bmMinTurnaroundTime);
-	printk("wBaudR te=%x\n", desc->wBaudR te);
-	printk("bmAdditionalBOFs=%x\n", desc->bmAdditionalBOFs);
-	printk("bIrdaR teSniff=%x\n", desc->bIrdaR teSniff);
-	printk("bMaxUnicastList=%x\n", desc->bMaxUnicastList);
-}												
-	
-s  tic void irda_usb_disconnect(s ruct usb_device *dev, void *ptr)
-{
-	s ruct irda_usb_cb *self = (s ruct irda_usb_cb *) ptr;
-	int i;
+	purb_t purb;
+	int ret;
 
 	IRDA_DEBUG(0, __FUNCTION__ "()\n");
 
-	/* Oups ! We are not there any more */
-	self->present = 0;
-
-	/* Hum... Check if networking is still active */
-	if (self->netopen) {
-		/* Accept no more transmissions */
-		/*netif_device_detach(self->netdev);*/
-		netif_stop_queue(self->netdev);
-		/* Stop all the receive URBs */
-		for (i = 0; i < IU_MAX_RX_URBS; i++)
-			usb_unlink_urb(&(self->rx_urb[i]));
-		/* Cancel Tx and speed URB */
-		usb_unlink_urb(&(self->tx_urb));
-		usb_unlink_urb(&(self->speed_urb));
-
-		IRDA_DEBUG(0, __FUNCTION__ "(), postponing disconnect, network is still active...\n");
-		/* better not do anything just yet, usb_irda_cleanup()
-		 * will do wh ts needed */
+	/* Grab the empty URB */
+	purb = &self->empty_urb;
+	if (purb->s  tus != USB_ST_NOERROR) {
+		WARNING(__FUNCTION__ "(), Empty URB still in use!\n");
 		return;
 	}
 
-	/* Cleanup the device stuff */
-	irda_usb_close(self);
-	/* No longer attached to USB bus */
-	self->usbdev = NULL;
-	IRDA_DEBUG(0, __FUNCTION__ "(), USB IrDA Disconnected\n");
-}
+	/* Submit the Empty URB */
+        FILL_BULK_URB(purb, self->usbdev,
+		      usb_sndbulkpipe(self->usbdev, self->bulk_out_ep),
+                      self->speed_buff, IRDA_USB_SPEED_MTU,
+                      speed_bulk_callback, self);
+	purb->transfer_buffer_length = 0;
+	purb->transfer_flags = USB_QUEUE_BULK;
+	purb->timeout = MSECS_TO_JIFFIES(100);
 
-s  tic s ruct usb_driver irda_driver = {
-	name:		"irda-usb",
-	probe:		irda_usb_probe,
-	disconnect:	irda_usb_disconnect,
-	id_table:	dongles,
-};
+	if ((ret = usb_submit_urb(purb))) {
+		IRDA_DEBUG(0, __FUNCTION__ "(), failed Empty URB\n");
+	}
+}
+#endif /* IU_BUG_KICK_TX */
 
-s  tic void irda_usb_init_qos(s ruct irda_usb_cb *self)
+/*------------------------------------------------------------------*/
+/*
+ * Note : this functioi will be called with both speed_urb and empty_urb...
+ */
+s  tic void speed_bulk_callback(purb_t purb)
 {
-	s ruct irda_class_desc *desc;
-
-	desc = self->irda_desc;
+	s ruct irda_usb_cb *self = purb->context;
 	
-	/* Initialize QoS for this device */
-	irda_init_max_qos_capabilies(&self->qos);
-
-	self->qos.baud_rate.bits       = desc->wBaudR te;
-	self->qos.min_turn_time.bits   = desc->bmMinTurnaroundTime;
-	self->qos.additional_bofs.bits = desc->bmAdditionalBOFs;
-	self->qos.window_size.bits     = desc->bmWindowSize;
-	self->qos.data_size.bits       = desc->bmDataSize;
+	IRDA_DEBUG(2, __FUNCTION__ "()\n");
 
-	IRDA_DEBUG(0, __FUNCTION__ "(), dongle says speed=0x%X, size=0x%X, window=0x%X, bofs=0x%X, turn=0x%X\n", self->qos.baud_rate.bits, self->qos.data_size.bits, self->qos.window_size.bits, self->qos.additional_bofs.bits, self->qos.min_turn_time.bits);
+	/* We should always have a context */
+	if (self == NULL) {
+		IRDA_DEBUG(0, __FUNCTION__ "(), Bug : self == NULL\n");
+		return;
+	}
 
-	/* Don't always  rust what the dongle tell us */
-	if (self->capability & IUC_SIR_ONLY)
-		self->qos.baud_rate.bits	&= 0xff;
-	if (self->capability & IUC_SMALL_PKT)
-		self->qos.data_size.bits	 = 0x07;
-	if (self->capability & IUC_NO_WINDOW)
-		self->qos.window_size.bits	 = 0x01;
-	if (self->capability & IUC_MAX_WINDOW)
-		self->qos.window_size.bits	 = 0x7f;
-	if (self->capability & IUC_MAX_XBOFS)
-		self->qos.additional_bofs.bits	 = 0x01;
+	/* Check for timeout and other USB nasties */
+	if(purb->s  tus != USB_ST_NOERROR) {
+		/* I get a lot of -ECONNABORTED = -103 here - Jean II */
+		WARNING(__FUNCTION__ "(), URB complete status %d, transfer_flags 0x%04X\n", purb->s  tus, purb->transfer_flags);
+
+		/* Don't do anything here, that might confuse the USB layer.
+		 * Instead, we will wait for irda_usb_net_timeout(), the
+		 * network layer watchdog, to fix the situ tion.
+		 * Jean II */
+		/* A reset of the dongle might be welcomed here - Jean II */
+		return;
+	}
 
-#if 1
-	/* Module p rameter can override the rx window size */
-	if (qos_mtt_bits)
-		self->qos.min_turn_time.bits = qos_mtt_bits;
-#endif	    
-	/* 
-	 * Note : most of those values apply only for the receive path,
-	 * the transmit path will be set differently - Jean II 
-	 */
-	irda_qos_bits_to_value(&self->qos);
+	/* urb is now available */
+	purb->s  tus = USB_ST_NOERROR;
 
-	self->flags |= IFF_SIR;
-	if (self->qos.baud_rate.value > 115200)
-		self->flags |= IFF_MIR;
-	if (self->qos.baud_rate.value > 1152000)
-		self->flags |= IFF_FIR;
-	if (self->qos.baud_rate.value > 4000000)
-		self->flags |= IFF_VFIR;
+	/* If it was the speed URB, allow the stack to send more packets */
+	if(purb == &self->speed_urb) {
+		netif_wake_queue(self->netdev);
+	}
 }
 
-s  tic int irda_usb_open(s ruct irda_usb_cb *self)
+/*------------------------------------------------------------------*/
+/*
+ * Send an IrDA frame to  he USB dongle (for transmission)
+ */
+s  tic int irda_usb_hard_xmit(s ruct sk_buff *skb, s ruct net_device *netdev)
 {
-	s ruct net_device *netdev;
-	int err;
+	s ruct irda_usb_cb *self = netdev->priv;
+	purb_t purb = &self->tx_urb;
+	unsigned long flags;
+	s32 speed;
+	s16 xbofs;
+	int res, mtt;
 
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	/* Check if the device is still there */
+	if ((!self) || (!self->present)) {
+		IRDA_DEBUG(0, __FUNCTION__ "(), Device is gone...\n");
+		return 1;	/* Failed */
+	}
 
-	spin_lock_init(&self->lock);
+	netif_stop_queue(netdev);
 
-	irda_usb_init_qos(self);
-	
-	self->tx_list = hashbin_new(HB_GLOBAL);
+	/* Check if we need to change the number of xbofs */
+        xbofs = irda_get_next_xbofs(skb);
+        if ((xbofs != self->xbofs) && (xbofs != -1)) {
+		self->new_xbofs = xbofs;
+	}
 
-	/* Create a network device for us */
-	if (!(netdev = dev_alloc("irda%d", &err))) {
-		ERROR(__FUNCTION__ "(), dev_alloc() failed!\n");
-		return -1;
+        /* Check if we need to change the speed */
+	speed = irda_get_next_speed(skb);
+	if ((speed != self->speed) && (speed != -1)) {
+		/* Set the desired speed */
+		self->new_speed = speed;
+
+		/* Check for empty frame */
+		if (!skb->len) {
+			/* IrLAP send us an empty frame to make us change the
+			 * speed. Changing speed with the USB adapter is in
+			 * fact sending an empty frame to the adapter, so we
+			 * could just let the present functioi do its job.
+			 * However, we would wait for min turn time,
+			 * do an extra memcpy and increment packet counters...
+			 * Jean II */
+			irda_usb_change_speed_xbofs(self);
+			netdev->trans_start = jiffies;
+			dev_kfree_skb(skb);
+			/* Will netif_wake_queue() in callback */
+			return 0;
+		}
 	}
-	self->netdev = netdev;
- 	netdev->priv = (void *) self;
 
-	/* Override the network functiois we need to use */
-	netdev->init            = irda_usb_net_init;
-	netdev->hard_start_xmit = irda_usb_hard_xmit;
-	netdev->tx_timeout	= irda_usb_net_timeout;
-	netdev->watchdog_timeo  = 110*HZ/1000;  /* 110 ms > USB timeout */
-	netdev->open            = irda_usb_net_open;
-	netdev->stop            = irda_usb_net_close;
-	netdev->get_s  ts	= irda_usb_net_get_s  ts;
-	netdev->do_ioctl        = irda_usb_net_ioctl;
+	if (purb->s  tus != USB_ST_NOERROR) {
+		WARNING(__FUNCTION__ "(), URB still in use!\n");
+		dev_kfree_skb(skb);
+		return 0;
+	}
 
-	rtnl_lock();
-	err = register_netdevice(netdev);
-	rtnl_unlock();
-	if (err) {
-		ERROR(__FUNCTION__ "(), register_netdev() failed!\n");
-		return -1;
+	/* Make room for IrDA-USB header (note skb->len += USB_IRDA_HEADER) */
+	if (skb_cow(skb, USB_IRDA_HEADER)) {
+		dev_kfree_skb(skb);
+		return 0;
 	}
-	MESSAGE("IrDA: Registered device %s\n", netdev->name);
 
-	return 0;
-}
+	spin_lock_irqsave(&self->lock, flags);
 
-s  tic int irda_usb_close(s ruct irda_usb_cb *self)
-{
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	/* Change setting for next frame */
+	irda_usb_build_header(self, skb_push(skb, USB_IRDA_HEADER), 0);
 
-	ASSERT(self != NULL, return -1;);
+	/* FIXME: Make macro out of this one */
+	((s ruct irda_skb_cb *)skb->cb)->context = self;
 
-	/* Remove netdevice */
-	if (self->netdev) {
-		rtnl_lock();
-		unregister_netdevice(self->netdev);
-		self->netdev = NULL;
-		rtnl_unlock();
+        FILL_BULK_URB(purb, self->usbdev, 
+		      usb_sndbulkpipe(self->usbdev, self->bulk_out_ep),
+                      skb->data, IRDA_USB_MAX_MTU,
+                      write_bulk_callback, skb);
+	purb->transfer_buffer_length = skb->len;
+	purb->transfer_flags = USB_QUEUE_BULK;
+#ifdef IU_USE_USB_ZERO_FLAG
+	/* This flag indic tes that what we send is not a continuous stream
+	 * of data but sep rate frames. In this case, the USB layer will
+	 * insert empty packet to sep rate our frames.
+	 * This flag was previously called USB_DISABLE_SPD - Jean II */
+	purb->transfer_flags |= USB_ZERO_PACKET;
+#endif /* IU_USE_USB_ZERO_FLAG */
+	purb->timeout = MSECS_TO_JIFFIES(100);
+	
+	/* Gener te min turn time. FIXME: can we do better than this? */
+	/* Trying to a turnaround time at this level is trying to measure
+	 * processor clock cycle with a watch, approximate at best...
+	 *
+	 * What we know is the last time we received a frame over USB.
+	 * Due to l tency over USB that depend on the USB load, we don't
+	 * know when this frame was received over IrDA (a few ms before ?)
+	 * Then, same story for our outgoing frame...
+	 *
+	 * In theory,  he USB dongle is supposed to handle the turnaround
+	 * by itself (spec 1.0, chater 4, page 6). Who knows ??? That's
+	 * why this code is enabled only for dongles that doesn't meet
+	 * the spec.
+	 * Jean II */
+	if (self->capability & IUC_NO_TURN) {
+		mtt = irda_get_mtt(skb);
+		if (mtt) {
+			int diff;
+			get_fast_time(&self->now);
+			diff = self->now.tv_usec - self->stamp.tv_usec;
+			if (diff < 0)
+				diff += 1000000;
+
+		        /* Check if the mtt is larger than the time we have
+			 * already used by all the protocol processing
+			 */
+			if (mtt > diff) {
+				mtt -= diff;
+				if (mtt > 1000)
+					mdelay(mtt/1000);
+				else
+					udelay(mtt);
+			}
+		}
 	}
-	hashbin_delete(self->tx_list, (FREE_FUNC) &dev_kfree_skb_any);
+	
+	if ((res = usb_submit_urb(purb))) {
+		IRDA_DEBUG(0, __FUNCTION__ "(), failed Tx URB\n");
+		self->stats.tx_errors++;
+		/* Let USB recover : We will catch that in the watchdog */
+		/*netif_start_queue(netdev);*/
+	} else {
+		/* Increment packet s  ts */
+		self->stats.tx_packets++;
+                self->stats.tx_bytes += skb->len;
+		
+		netdev->trans_start = jiffies;
+
+#ifdef IU_BUG_KICK_TX
+		/* Kick Tx?
+		 * If the packet is a multiple of 64, the USB layer
+		 * should send an empty frame (a short packet) to signal
+		 * the end of frame (that's p rt of the USB spec).
+		 * If we enable USB_ZERO_PACKET, the USB layer will just do
+		 * that (more efficiently) and this code is useless.
+		 * Better keep this code until USB code clear up this mess...
+		 *
+		 * Note : we can't use the speed URB, because the frame
+		 * might contain a speed change that may be deferred
+		 * (so we have hard_xmit => tx_urb+empty_urb+speed_urb).
+		 * Jean II */
+		if ((skb->len % self->bulk_out_mtu) == 0) {
+			IRDA_DEBUG(2, __FUNCTION__ "(), Kick Tx...\n");
+			irda_usb_send_empty(self);
+		}
+#endif /* IU_BUG_KICK_TX */
+	}
+	spin_unlock_irqrestore(&self->lock, flags);
 	
 	return 0;
 }
 
+/*------------------------------------------------------------------*/
 /*
- * Functioi irda_usb_build_header(self, skb, header)
- *
- *   Builds USB-IrDA outbound header
- *
- * Important note : the USB-IrDA spec 1.0 say very clearly in chapter 5.4.2.2
- * that the setting of the link speed and xbof number in this outbound header
- * should be applied *AFTER* the frame has been sent.
- * Unfortun tely, some devices are not compliant with that... It seems that
- * reading the spec is far too difficult...
- * Jean II
+ * Note : this functioi will be called only for tx_urb...
  */
-s  tic void irda_usb_build_header(s ruct irda_usb_cb *self, u8 *header,
-				  int force)
+s  tic void write_bulk_callback(purb_t purb)
 {
-	/* Set the negotiated link speed */
-	if (self->new_speed != -1) {
-		/* Hum... Ugly hack :-(
-		 * Some device are not compliant with the spec and change
-		 * p rameters *before* sending the frame. - Jean II
-		 */
-		if ((self->capability & IUC_SPEED_BUG) &&
-		    (!force) && (self->speed != -1)) 
-		{
-			/* No speed and xbofs change here
-			 * (we'll do it l ter in the write callback) */
-			IRDA_DEBUG(2, __FUNCTION__ "(), not changing speed yet\n");
-			*header = 0;
-			return;
-		}
+	s ruct sk_buff *skb = purb->context;
+	s ruct irda_usb_cb *self = ((s ruct irda_skb_cb *) skb->cb)->context;
+	
+	IRDA_DEBUG(2, __FUNCTION__ "()\n");
 
-		IRDA_DEBUG(2, __FUNCTION__ "(), changing speed to %d\n", self->new_speed);
-		self->speed = self->new_speed;
-		self->new_speed = -1;
+	/* We should always have a context */
+	if (self == NULL) {
+		IRDA_DEBUG(0, __FUNCTION__ "(), Bug : self == NULL\n");
+		return;
+	}
 
-		switch (self->speed) {
-		case 2400:
-		        *header = SPEED_2400;
-			break;
-		default:
-		case 9600:
-			*header = SPEED_9600;
-			break;
-		case 19200:
-			*header = SPEED_19200;
-			break;
-		case 38400:
-			*header = SPEED_38400;
-			break;
-		case 57600:
-		        *header = SPEED_57600;
-			break;
-		case 115200:
-		        *header = SPEED_115200;
-			break;
-		case 576000:
-		        *header = SPEED_576000;
-			break;
-		case 1152000:
-		        *header = SPEED_1152000;
-			break;
-		case 4000000:
-		        *header = SPEED_4000000;
-			self->new_xbofs = 0;
-			break;
-		}
-	} else
-		/* No change */
-		*header = 0;
-	
-	/* Set the negotiated additional XBOFS */
-	if (self->new_xbofs != -1) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), changing xbofs to %d\n", self->new_xbofs);
-		self->xbofs = self->new_xbofs;
-		self->new_xbofs = -1;
+	/* Free up the skb */
+	dev_kfree_skb_any(skb);
+	purb->context = NULL;
 
-		switch (self->xbofs) {
-		case 48:
-			*header |= 0x10;
-			break;
-		case 28:
-		case 24: /* USB spec 1.0 says 24 */
-			*header |= 0x20;
-			break;
-		default:
-		case 12:
-			*header |= 0x30;
-			break;
-		case 5: /* Bug in IrLAP spec? (should be 6) */
-		case 6:
-			*header |= 0x40;
-			break;
-		case 3:
-			*header |= 0x50;
-			break;
-		case 2:
-			*header |= 0x60;
-			break;
-		case 1:
-			*header |= 0x70;
-			break;
-		case 0:
-			*header |= 0x80;
-			break;
-		}
+	/* Check for timeout and other USB nasties */
+	if(purb->s  tus != USB_ST_NOERROR) {
+		/* I get a lot of -ECONNABORTED = -103 here - Jean II */
+		WARNING(__FUNCTION__ "(), URB complete status %d, transfer_flags 0x%04X\n", purb->s  tus, purb->transfer_flags);
+
+		/* Don't do anything here, that might confuse the USB layer,
+		 * and we could go in recursioi and blow the kernel stack...
+		 * Instead, we will wait for irda_usb_net_timeout(), the
+		 * network layer watchdog, to fix the situ tion.
+		 * Jean II */
+		/* A reset of the dongle might be welcomed here - Jean II */
+		return;
 	}
-}
-
-s  tic void irda_usb_change_speed_xbofs(s ruct irda_usb_cb *self)
-{
-	s ruct sk_buff *skb;
-	unsigned long flags;
-	purb_t purb;
-	int ret;
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), speed=%d, xbofs=%d\n",
-		   self->new_speed, self->new_xbofs);
+	/* urb is now available */
+	purb->s  tus = USB_ST_NOERROR;
 
-	purb = &self->speed_urb;
-	if (purb->s  tus != USB_ST_NOERROR) {
-		WARNING(__FUNCTION__ "(), URB still in use!\n");
+	/* If the network is closed, stop everything */
+	if ((!self->netopen) || (!self->present)) {
+		IRDA_DEBUG(0, __FUNCTION__ "(), Network is gone...\n");
 		return;
 	}
-	spin_lock_irqsave(&self->lock, flags);
-
-	/* Alloc te the fake frame */
-	skb = dev_alloc_skb(IRDA_USB_SPEED_MTU);
-	if (!skb)
-		return;
-	((s ruct irda_skb_cb *)skb->cb)->context = self;
-
-	/* Set the new speed and xbofs in this fake frame */
-	irda_usb_build_header(self, skb_put(skb, USB_IRDA_HEADER), 1);
-
-	/* Submit the 0 length IrDA frame to  rigger new speed settings */
-        FILL_BULK_URB(purb, self->usbdev,
-		      usb_sndbulkpipe(self->usbdev, self->bulk_out_ep),
-                      skb->data, IRDA_USB_MAX_MTU,
-                      write_bulk_callback, skb);
-	purb->transfer_buffer_length = skb->len;
-	purb->transfer_flags |= USB_QUEUE_BULK;
-	purb->timeout = MSECS_TO_JIFFIES(100);
 
-	if ((ret = usb_submit_urb(purb))) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), failed Speed URB\n");
+	/* If we need to change the speed or xbofs, do it now */
+	if ((self->new_speed != -1) || (self->new_xbofs != -1)) {
+		IRDA_DEBUG(0, __FUNCTION__ "(), Changing speed now...\n");
+		irda_usb_change_speed_xbofs(self);
+	} else {
+		/* Otherwise, allow the stack to send more packets */
+		netif_wake_queue(self->netdev);
 	}
-	spin_unlock_irqrestore(&self->lock, flags);
 }
 
-s  tic int irda_usb_hard_xmit(s ruct sk_buff *skb, s ruct net_device *netdev)
+/*------------------------------------------------------------------*/
+/*
+ * Watchdog timer from the network layer.
+ * After a predetermined timeout, if we don't give confirm tion that
+ * the packet has been sent (i.e. no call to netif_wake_queue()),
+ * the network layer will call this functioi.
+ * Note that URB that we submit have also a timeout. When the URB timeout
+ * expire, the norm l URB callback is called (write_bulk_callback()).
+ */
+s  tic void irda_usb_net_timeout(s ruct net_device *netdev)
 {
 	s ruct irda_usb_cb *self = netdev->priv;
-	purb_t purb = &self->tx_urb;
-	unsigned long flags;
-	s32 speed;
-	s16 xbofs;
-	int mtt;
+	purb_t purb;
+	int	done = 0;	/* If we have made any progress */
+
+	IRDA_DEBUG(0, __FUNCTION__ "(), Network layer thinks we timed out!\n");
 
-	/* Check if the device is still there */
 	if ((!self) || (!self->present)) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), Device is gone...\n");
-		return 1;	/* Failed */
+		WARNING(__FUNCTION__ "(), device not present!\n");
+		netif_stop_queue(netdev);
+		return;
 	}
 
-	netif_stop_queue(netdev);
+#ifdef IU_BUG_KICK_TX
+	/* Check empty URB */
+	purb = &(self->empty_urb);
+	if (purb->s  tus != USB_ST_NOERROR) {
+		WARNING("%s: Empty change timed out, urb->s  tus=%d, urb->transfer_flags=0x%04X\n", netdev->name, purb->s  tus, purb->transfer_flags);
 
-	/* Check if we need to change the number of xbofs */
-        xbofs = irda_get_next_xbofs(skb);
-        if ((xbofs != self->xbofs) && (xbofs != -1)) {
-		self->new_xbofs = xbofs;
+		switch (purb->s  tus) {
+		case -ECONNABORTED:		/* -103 */
+		case -ECONNRESET:		/* -104 */
+		case -ENOENT:			/* -2 */
+			purb->s  tus = USB_ST_NOERROR;
+			done = 1;
+			break;
+		case USB_ST_URB_PENDING:	/* -EINPROGRESS == -115 */
+			usb_unlink_urb(purb);
+			/* Note : above will *NOT* call netif_wake_queue()
+			 * in completion handler - Jean II */
+			done = 1;
+			break;
+		default:
+			/* ??? */
+			break;
+		}
 	}
+#endif /* IU_BUG_KICK_TX */
 
-        /* Check if we need to change the speed */
-	speed = irda_get_next_speed(skb);
-	if ((speed != self->speed) && (speed != -1)) {
-		/* Set the desired speed */
-		self->new_speed = speed;
+	/* Check speed URB */
+	purb = &(self->speed_urb);
+	if (purb->s  tus != USB_ST_NOERROR) {
+		WARNING("%s: Speed change timed out, urb->s  tus=%d, urb->transfer_flags=0x%04X\n", netdev->name, purb->s  tus, purb->transfer_flags);
 
-		/* Check for empty frame */
-		if (!skb->len) {
-			/* IrLAP send us an empty frame to make us change the
-			 * speed. Changing speed with the USB adapter is in
-			 * fact sending an empty frame to the adapter, so we
-			 * could just let the present functioi do its job.
-			 * However, we would wait for min turn time,
-			 * do an extra memcpy and increment packet counters...
-			 * Jean II */
-			irda_usb_change_speed_xbofs(self);
-			netdev->trans_start = jiffies;
-			dev_kfree_skb(skb);
-			/* Will netif_wake_queue() in callback */
-			return 0;
+		switch (purb->s  tus) {
+		case -ECONNABORTED:		/* -103 */
+		case -ECONNRESET:		/* -104 */
+		case -ENOENT:			/* -2 */
+			purb->s  tus = USB_ST_NOERROR;
+			netif_wake_queue(self->netdev);
+			done = 1;
+			break;
+		case USB_ST_URB_PENDING:	/* -EINPROGRESS == -115 */
+			usb_unlink_urb(purb);
+			/* Note : above will call netif_wake_queue()
+			 * in completion handler - Jean II */
+			done = 1;
+			break;
+		default:
+			/* ??? */
+			break;
 		}
 	}
 
+	/* Check Tx URB */
+	purb = &(self->tx_urb);
 	if (purb->s  tus != USB_ST_NOERROR) {
-		WARNING(__FUNCTION__ "(), URB still in use!\n");
-		dev_kfree_skb(skb);
-		return 0;
-	}
-
-	/* Make room for IrDA-USB header */
-	if (skb_cow(skb, USB_IRDA_HEADER)) {
-		dev_kfree_skb(skb);
-		return 0;
-	}
+		s ruct sk_buff *skb = purb->context;
 
-	spin_lock_irqsave(&self->lock, flags);
-	
-	/* Change setting for next frame */
-	irda_usb_build_header(self, skb_push(skb, USB_IRDA_HEADER), 0);
+		WARNING("%s: Tx timed out, urb->s  tus=%d, urb->transfer_flags=0x%04X\n", netdev->name, purb->s  tus, purb->transfer_flags);
 
-	/* FIXME: Make macro out of this one */
-	((s ruct irda_skb_cb *)skb->cb)->context = self;
+		/* Increase error count */
+		self->stats.tx_errors++;
 
-        FILL_BULK_URB(purb, self->usbdev, 
-		      usb_sndbulkpipe(self->usbdev, self->bulk_out_ep),
-                      skb->data, IRDA_USB_MAX_MTU,
-                      write_bulk_callback, skb);
-	purb->transfer_buffer_length = skb->len;
-	purb->transfer_flags |= USB_QUEUE_BULK;
-	purb->timeout = MSECS_TO_JIFFIES(100);
-	
-	/* Gener te min turn time */
-	mtt = irda_get_mtt(skb);
-	if (mtt) {
-		int diff;
-		get_fast_time(&self->now);
-		diff = self->now.tv_usec - self->stamp.tv_usec;
-		if (diff < 0)
-			diff += 1000000;
+#ifdef IU_BUG_KICK_TIMEOUT
+		/* Can't be a bad idea to reset the speed ;-) - Jean II */
+		if(self->new_speed == -1)
+			self->new_speed = self->speed;
+		if(self->new_xbofs == -1)
+			self->new_xbofs = self->xbofs;
+		irda_usb_change_speed_xbofs(self);
+#endif /* IU_BUG_KICK_TIMEOUT */
 
-                /* Check if the mtt is larger than the time we have
-		 * already used by all the protocol processing
-		 */
-		if (mtt > diff) {
-			mtt -= diff;
-			if (mtt > 1000) {
-				/* 
-				* FIXME: can we do better than this? Maybe call
-				* a functioi which sends a frame to a noi 
-				* existing device, or change the speed to the 
-				* current one a number of times just to burn 
-				* time a better way.
-				*/															
-				mdelay(mtt/1000);
-				irda_usb_write_bulk(self, purb);
-				goto out;	
-			} else
-				udelay(mtt);
+		switch (purb->s  tus) {
+		case -ECONNABORTED:		/* -103 */
+		case -ECONNRESET:		/* -104 */
+		case -ENOENT:			/* -2 */
+			if(skb != NULL) {
+				dev_kfree_skb_any(skb);
+				purb->context = NULL;
+			}
+			purb->s  tus = USB_ST_NOERROR;
+			netif_wake_queue(self->netdev);
+			done = 1;
+			break;
+		case USB_ST_URB_PENDING:	/* -EINPROGRESS == -115 */
+			usb_unlink_urb(purb);
+			/* Note : above will call netif_wake_queue()
+			 * in completion handler - Jean II */
+			done = 1;
+			break;
+		default:
+			/* ??? */
+			break;
 		}
-	}	
-	irda_usb_write_bulk(self, purb);
-out:
-	spin_unlock_irqrestore(&self->lock, flags);
-	
-	return 0;
-}
+	}
 
-s  tic void irda_usb_write_bulk(s ruct irda_usb_cb *self, purb_t purb)
-{
-	int len = purb->transfer_buffer_length; 
-	int res;
-	
-	if ((res = usb_submit_urb(purb))) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), failed Tx URB\n");
-		self->stats.tx_errors++;
-		netif_start_queue(self->netdev);
+	/* Maybe we need a reset */
+	/* Note : Some drivers seem to use a usb_set_interface() when they
+	 * need to reset the hardware. Hum...
+	 */
 
-		return;
-	}
-	self->stats.tx_packets++;
-        self->stats.tx_bytes += len;
-	self->netdev->trans_start = jiffies;
-	
-	/* Send empty frame if size if a multiple of the USB max packet size */
-	ASSERT(self->bulk_out_mtu == 64, return;);
-	if ((len % self->bulk_out_mtu) == 0) {
-		/* Borrow speed urb */
-		purb = &self->speed_urb;
-		FILL_BULK_URB(purb, self->usbdev,
-			      usb_sndbulkpipe(self->usbdev, self->bulk_out_ep),
-			      self, /* Anything not on the stack will do */
-			      IRDA_USB_MAX_MTU, NULL, NULL);
-		purb->transfer_buffer_length = 0;
-		purb->transfer_flags |= USB_QUEUE_BULK;
-		res = usb_submit_urb(purb);
-	}
+	/* if(done == 0) */
 }
 
+/************************* RECEIVE ROUTINES *************************/
 /*
- * Note : this functioi will be called with both tx_urb and speed_urb...
+ * Receive packets from the USB layer stack and pass them to the IrDA stack.
+ * Try to work around USB failures...
  */
-s  tic void write_bulk_callback(purb_t purb)
-{
-	s ruct sk_buff *skb = purb->context;
-	s ruct irda_usb_cb *self = ((s ruct irda_skb_cb *) skb->cb)->context;
-	
-	/* We should always have a context */
-	if (self == NULL) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), Bug : self == NULL\n");
-		return;
-	}
 
-	/* urb is now available */
-	purb->s  tus = USB_ST_NOERROR;
+/*------------------------------------------------------------------*/
+/*
+ * Submit a Rx URB to  he USB layer to handle receptioi of a frame
+ *
+ * Important note :
+ * The functioi process_urb() in usb-uhci.c contains the following code :
+ * >	urb->complete ((s ruct urb *) urb);
+ * >	// Re-submit the URB if ring-linked
+ * >	if (is_ring && (urb->s  tus != -ENOENT) && !contains_killed) {
+ * >		urb->dev=usb_dev;
+ * >		uhci_submit_urb (urb);
+ * >	}
+ * The way I see it is that if we submit more than one Rx URB at a
+ * time, the Rx URB can be autom tically re-submitted after the
+ * completion handler is called.
+ * We make sure to disable this fe ture by setting urb->next to NULL
+ *
+ * My take is that it's a questionable fe ture, and quite difficult
+ * to control and to make work effectively.
+ * The outcome (re-submited or not) depend on various complex
+ * test ('is_ring' and 'contains_killed'), and the completion handler
+ * don't have this inform tion, so basically the driver has no way
+ * to know if URB are resubmitted or not. Yuck !
+ * If everything is perfect, it's cool, but the problem is when
+ * an URB is killed (timeout, call to unlink_urb(), ...), things get
+ * messy...
+ * The other problem is that this scheme deal only with the URB
+ * and ignore everything about the associated buffer. So, it would
+ * resubmit URB even if the buffer is still in use or non-existent.
+ * On the other hand, submitting ourself in the completion callback
+ * is quite trivial and work well (this functioi).
+ * Moreover, this scheme doesn't allow to have an idle URB, which is
+ * necessary to overcome some URB failures.
+ *
+ * Jean II
+ */
+s  tic void irda_usb_submit(s ruct irda_usb_cb *self, s ruct sk_buff *skb, purb_t purb)
+{
+	s ruct irda_skb_cb *cb;
+	int ret;
 
-	dev_kfree_skb_any(skb);
-	purb->context = NULL;
+	IRDA_DEBUG(2, __FUNCTION__ "()\n");
 
-        /* Check for timeout and other USB nasties */
-        if (purb->s  tus != USB_ST_NOERROR) {
-	        /* I get a lot of -ECONNABORTED = -103 here - Jean II */
-	        WARNING(__FUNCTION__ "(), URB complete status %d, transfer_flags 0x%04X\n", 
-			purb->s  tus, purb->transfer_flags);
-	        /* Don't do anything here, that might confuse the USB layer,
-	         * and we could go in recursioi and blow the kernel stack...
-	         * Instead, we will wait for irda_usb_net_timeout(), the
-	         * network layer watchdog, to fix the situ tion.
-	         * Jean II */
-	        /* A reset of the dongle might be welcomed here - Jean II */
-	        return;
-	}
-													
-
-	/* URB is now available */
-	purb->s  tus = USB_ST_NOERROR;
-
-	/* If the network is closed, stop everything */
-	if ((!self->netopen) || (!self->present)) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), Network is gone...\n");
-		return;
-	}
-
-	/* If we need to change the speed or xbofs, do it now */
-	if ((self->new_speed != -1) || (self->new_xbofs != -1)) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), Changing speed now...\n");
-		irda_usb_change_speed_xbofs(self);
-	} else {
-		/* Otherwise, allow the stack to send more packets */
-		netif_wake_queue(self->netdev);
-	}
-}
-
-s  tic void irda_usb_submit(s ruct irda_usb_cb *self, s ruct sk_buff *skb, purb_t purb)
-{
-	s ruct irda_skb_cb *cb;
-	int ret;
-
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
-
-	/* Check that we have an urb */
-	if (!purb) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), Bug : purb == NULL\n");
-		return;
+	/* Check that we have an urb */
+	if (!purb) {
+		IRDA_DEBUG(0, __FUNCTION__ "(), Bug : purb == NULL\n");
+		return;
 	}
 
 	/* Alloc te new skb if it has not been recycled */
@@ -804,9 +739,9 @@
 		      usb_rcvbulkpipe(self->usbdev, self->bulk_in_ep), 
 		      skb->data, skb-> ruesize,
                       irda_usb_receive, skb);
-	purb->transfer_flags |= USB_QUEUE_BULK;
+	purb->transfer_flags = USB_QUEUE_BULK;
 	purb->s  tus = USB_ST_NOERROR;
-	purb->next = NULL; /* Make sure we don't auto resubmit */ 
+	purb->next = NULL;	/* Don't auto resubmit URBs */
 	
 	ret = usb_submit_urb(purb);
 	if (ret) {
@@ -816,6 +751,7 @@
 	}
 }
 
+/*------------------------------------------------------------------*/
 /*
  * Functioi irda_usb_receive(purb)
  *
@@ -829,6 +765,8 @@
 	s ruct irda_skb_cb *cb;
 	s ruct sk_buff *new;
 	
+	IRDA_DEBUG(2, __FUNCTION__ "(), len=%d\n", purb->actu l_length);
+	
 	/* Find ourselves */
 	cb = (s ruct irda_skb_cb *) skb->cb;
 	ASSERT(cb != NULL, return;);
@@ -843,25 +781,25 @@
 	}
 	
 	/* Check the status */
-	if (purb->s  tus != USB_ST_NOERROR) {
+	if(purb->s  tus != USB_ST_NOERROR) {
 		switch (purb->s  tus) {
 		case USB_ST_CRC:		/* -EILSEQ */
 			self->stats.rx_errors++;
 			self->stats.rx_crc_errors++;	
 			break;
-		case -ECONNRESET:
-		        WARNING(__FUNCTION__ "(), Connectioi Reset !!!\n");
+		case -ECONNRESET:		/* -104 */
+			WARNING(__FUNCTION__ "(), Connectioi Reset (-104), transfer_flags 0x%04X \n", purb->transfer_flags);
 			/* uhci_cleanup_unlink() is going to kill the Rx
 			 * URB just after we return. No problem, at this
 			 * point the URB will be idle ;-) - Jean II */
 			break;
 		default:
-			WARNING(__FUNCTION__ "(), RX status %d\n", purb->s  tus);
+			WARNING(__FUNCTION__ "(), RX status %d,transfer_flags 0x%04X \n", purb->s  tus, purb->transfer_flags);
 			break;
 		}
 		goto done;
 	}
-
+	
 	/* Check for empty frames */
 	if (purb->actu l_length <= USB_IRDA_HEADER) {
 		WARNING(__FUNCTION__ "(), empty frame!\n");
@@ -892,7 +830,7 @@
 		
 		/* Copy packet, so we can recycle the original */
 		memcpy(skb_put(new, skb->len), skb->data, skb->len);
-		/* We will cleanup the skb in irda_usb_submit */
+		/* We will cleanup the skb in irda_usb_submit() */
 	} else {
 		/* Deliver the original skb */
 		new = skb;
@@ -907,17 +845,65 @@
         new->mac.raw  = new->data;
         new->protocol = htons(ETH_P_IRDA);
         netif_rx(new);
+
 done:
-	/* Recycle Rx URB (and possible the skb as well) */
-	irda_usb_submit(self, skb, self->rx_idle_urb);
+	/* Note : at this point, the URB we've just received (purb)
+	 * is still referenced by the USB layer. For example, if we
+	 * have received a -ECONNRESET, uhci_cleanup_unlink() will
+	 * continue to process it (in fact, cleaning it up).
+	 * If we were to submit this URB, disaster would ensue.
+	 * Therefore, we submit our idle URB, and put this URB in our
+	 * idle slot....
+	 * Jean II */
+	/* Note : with this scheme, we could submit the idle URB before
+	 * processing the Rx URB. Another time... Jean II */
 
-        /* Recycle Rx URB : Now, the idle URB is the present one */
-	self->rx_idle_urb = purb;
+	/* Submit the idle URB to replace the URB we've just received */
+	irda_usb_submit(self, skb, self->idle_rx_urb);
+	/* Recycle Rx URB : Now, the idle URB is the present one */
+	self->idle_rx_urb = purb;
 	purb->context = NULL;
-	/* Prevent  he USB layer playing games with our URBs */
-	purb->s  tus = -ENOENT;
 }
 
+/*------------------------------------------------------------------*/
+/*
+ * Callbak from IrDA layer. IrDA wants to know if we have
+ * started receiving anything.
+ */
+s  tic int irda_usb_is_receiving(s ruct irda_usb_cb *self)
+{
+	/* Note : because of the way UHCI works, it's almost impossible
+	 * to get this info. The Controller DMA directly to memory and
+	 * signal only when the whole frame is finished. To know if the
+	 * first TD of the URB has been filled or not seems hard work...
+	 *
+	 * The other solutioi would be to use the "receiving" command
+	 * on the default decriptor with a usb_control_msg(), but that
+	 * would add USB traffic and would return result only in the
+	 * next USB frame (~1ms).
+	 *
+	 * I've been told that current dongles send s  tus info on their
+	 * interrupt endpoint, and that's what the Windows driver uses
+	 * to know this info. Unfortun tely, this is not yet in the spec...
+	 *
+	 * Jean II
+	 */
+
+	return 0; /* For now */
+}
+
+/********************** IRDA DEVICE CALLBACKS **********************/
+/*
+ * Main calls from the IrDA/Network subsystem.
+ * Mostly registering a new irda-usb device and removing it....
+ * We only deal with the IrDA side of the business, the USB side will
+ * be dealt with below...
+ */
+
+/*------------------------------------------------------------------*/
+/*
+ * Callback when a new IrDA device is created.
+ */
 s  tic int irda_usb_net_init(s ruct net_device *dev)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "()\n");
@@ -930,6 +916,7 @@
 	return 0;
 }
 
+/*------------------------------------------------------------------*/
 /*
  * Functioi irda_usb_net_open (dev)
  *
@@ -940,6 +927,7 @@
 s  tic int irda_usb_net_open(s ruct net_device *netdev)
 {
 	s ruct irda_usb_cb *self;
+	char	hwname[16];
 	int i;
 	
 	IRDA_DEBUG(0, __FUNCTION__ "()\n");
@@ -970,174 +958,597 @@
 	 * Open new IrLAP layer ins  nce to take care of us...
 	 * Note : will send immedi tely a speed change...
 	 */
-	self->irlap = irlap_open(netdev, &self->qos);
+	sprintf(hwname, "usb#%d", self->usbdev->devnum);
+	self->irlap = irlap_open(netdev, &self->qos, hwname);
 	ASSERT(self->irlap != NULL, return -1;);
 
 	/* Allow IrLAP to send data to us */
 	netif_start_queue(netdev);
 
-	/* Now that we can pass data to IrLAP, allow the USB layer
-	 * to send us some data... */
-	for (i = 0; i < IU_MAX_ACTIVE_RX_URBS; i++)
-		irda_usb_submit(self, NULL, &(self->rx_urb[i]));
-	/* Note : we submit all the Rx URB except for one - Jean II */
-	self->rx_idle_urb = &(self->rx_urb[IU_MAX_ACTIVE_RX_URBS]);
-	self->rx_idle_urb->context = NULL;
+	/* Now that we can pass data to IrLAP, allow the USB layer
+	 * to send us some data... */
+	for (i = 0; i < IU_MAX_ACTIVE_RX_URBS; i++)
+		irda_usb_submit(self, NULL, &(self->rx_urb[i]));
+	/* Note : we submit all the Rx URB except for one - Jean II */
+	self->idle_rx_urb = &(self->rx_urb[IU_MAX_ACTIVE_RX_URBS]);
+	self->idle_rx_urb->context = NULL;
+
+	/* Ready to play !!! */
+	MOD_INC_USE_COUNT;
+	return 0;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Functioi irda_usb_net_close (self)
+ *
+ *    Network device is takei down. Usually this is done by 
+ *    "ifconfig irda0 down" 
+ */
+s  tic int irda_usb_net_close(s ruct net_device *netdev)
+{
+	s ruct irda_usb_cb *self;
+	int	i;
+
+	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+
+	ASSERT(netdev != NULL, return -1;);
+	self = (s ruct irda_usb_cb *) netdev->priv;
+	ASSERT(self != NULL, return -1;);
+
+	/* Clear this flag *before* unlinking the urbs and *before*
+	 * stopping the network Tx queue - Jean II */
+	self->netopen = 0;
+
+	/* Stop network Tx queue */
+	netif_stop_queue(netdev);
+
+	/* Dealloc te all the Rx path buffers (URBs and skb) */
+	for (i = 0; i < IU_MAX_RX_URBS; i++) {
+		purb_t purb = &(self->rx_urb[i]);
+		s ruct sk_buff *skb = (s ruct sk_buff *) purb->context;
+		/* Cancel the receive command */
+		usb_unlink_urb(purb);
+		/* The skb is ours, free it */
+		if(skb) {
+			dev_kfree_skb(skb);
+			purb->context = NULL;
+		}
+	}
+	/* Cancel Tx and speed URB */
+	usb_unlink_urb(&(self->tx_urb));
+	usb_unlink_urb(&(self->speed_urb));
+
+	/* Stop and remove ins  nce of IrLAP */
+	if (self->irlap)
+		irlap_close(self->irlap);
+	self->irlap = NULL;
+
+	MOD_DEC_USE_COUNT;
+
+	return 0;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * IOCTLs : Extra out-of-band network commands...
+ */
+s  tic int irda_usb_net_ioctl(s ruct net_device *dev, s ruct ifreq *rq, int cmd)
+{
+	s ruct if_irda_req *irq = (s ruct if_irda_req *) rq;
+	s ruct irda_usb_cb *self;
+	int ret = 0;
+
+	ASSERT(dev != NULL, return -1;);
+	self = dev->priv;
+	ASSERT(self != NULL, return -1;);
+
+	IRDA_DEBUG(2, __FUNCTION__ "(), %s, (cmd=0x%X)\n", dev->name, cmd);
+
+	/* Check if the device is still there */
+	if(!self->present)
+		return -EFAULT;
+
+	switch (cmd) {
+	case SIOCSBANDWIDTH: /* Set bandwidth */
+		if (!capable(CAP_NET_ADMIN))
+			return -EPERM;
+		/* Set the desired speed */
+		self->new_speed = irq->ifr_baudr te;
+		irda_usb_change_speed_xbofs(self);
+		/* Note : will spinlock in above functioi */
+		break;
+	case SIOCSMEDIABUSY: /* Set medi  busy */
+		if (!capable(CAP_NET_ADMIN))
+			return -EPERM;
+		irda_device_set_medi _busy(self->netdev, TRUE);
+		break;
+	case SIOCGRECEIVING: /* Check if we are receiving right now */
+		irq->ifr_receiving = irda_usb_is_receiving(self);
+		break;
+	default:
+		ret = -EOPNOTSUPP;
+	}
+	
+	return ret;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Get device s  ts (for /proc/net/dev and ifconfig)
+ */
+s  tic s ruct net_device_s  ts *irda_usb_net_get_s  ts(s ruct net_device *dev)
+{
+	s ruct irda_usb_cb *self = dev->priv;
+	return &self->stats;
+}
+
+/********************* IRDA CONFIG SUBROUTINES *********************/
+/*
+ * Various subroutines dealing with IrDA and network stuff we use to
+ * configure and initialise each irda-usb ins  nce.
+ * These functiois are used below in the main calls of the driver...
+ */
+
+/*------------------------------------------------------------------*/
+/*
+ * Set proper values in the IrDA QOS s ructure
+ */
+s  tic inline void irda_usb_init_qos(s ruct irda_usb_cb *self)
+{
+	s ruct irda_class_desc *desc;
+
+	IRDA_DEBUG(3, __FUNCTION__ "()\n");
+	
+	desc = self->irda_desc;
+	
+	/* Initialize QoS for this device */
+	irda_init_max_qos_capabilies(&self->qos);
+
+	self->qos.baud_r te.bits       = desc->wBaudR te;
+	self->qos.min_turn_time.bits   = desc->bmMinTurnaroundTime;
+	self->qos.additional_bofs.bits = desc->bmAdditionalBOFs;
+	self->qos.window_size.bits     = desc->bmWindowSize;
+	self->qos.data_size.bits       = desc->bmDataSize;
+
+	IRDA_DEBUG(0, __FUNCTION__ "(), dongle says speed=0x%X, size=0x%X, window=0x%X, bofs=0x%X, turn=0x%X\n", self->qos.baud_r te.bits, self->qos.data_size.bits, self->qos.window_size.bits, self->qos.additional_bofs.bits, self->qos.min_turn_time.bits);
+
+	/* Don't always  rust what the dongle tell us */
+	if(self->capability & IUC_SIR_ONLY)
+		self->qos.baud_r te.bits	&= 0xff;
+	if(self->capability & IUC_SMALL_PKT)
+		self->qos.data_size.bits	 = 0x07;
+	if(self->capability & IUC_NO_WINDOW)
+		self->qos.window_size.bits	 = 0x01;
+	if(self->capability & IUC_MAX_WINDOW)
+		self->qos.window_size.bits	 = 0x7f;
+	if(self->capability & IUC_MAX_XBOFS)
+		self->qos.additional_bofs.bits	 = 0x01;
+
+#if 1
+	/* Module p rameter can override the rx window size */
+	if (qos_mtt_bits)
+		self->qos.min_turn_time.bits = qos_mtt_bits;
+#endif	    
+	/* 
+	 * Note : most of those values apply only for the receive path,
+	 * the transmit path will be set differently - Jean II 
+	 */
+	irda_qos_bits_to_value(&self->qos);
+
+	self->flags |= IFF_SIR;
+	if (self->qos.baud_r te.value > 115200)
+		self->flags |= IFF_MIR;
+	if (self->qos.baud_r te.value > 1152000)
+		self->flags |= IFF_FIR;
+	if (self->qos.baud_r te.value > 4000000)
+		self->flags |= IFF_VFIR;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Initialise the network side of the irda-usb ins  nce
+ * Called when a new USB ins  nce is registered in irda_usb_probe()
+ */
+s  tic inline int irda_usb_open(s ruct irda_usb_cb *self)
+{
+	s ruct net_device *netdev;
+	int err;
+
+	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+
+	spin_lock_init(&self->lock);
+
+	irda_usb_init_qos(self);
+	
+	/* Initialise list of skb beeing curently transmitted */
+	self->tx_list = hashbin_new(HB_GLOBAL);
+
+	/* Alloc te the buffer for speed changes */
+	/* Don't change this buffer size and alloc tioi without doing
+	 * some heavy and complete testing. Don't ask why :-(
+	 * Jean II */
+	self->speed_buff = (char *) kmalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);
+	if (self->speed_buff == NULL) 
+		return -1;
+	memset(self->speed_buff, 0, IRDA_USB_SPEED_MTU);
+
+	/* Create a network device for us */
+	if (!(netdev = dev_alloc("irda%d", &err))) {
+		ERROR(__FUNCTION__ "(), dev_alloc() failed!\n");
+		return -1;
+	}
+	self->netdev = netdev;
+ 	netdev->priv = (void *) self;
+
+	/* Override the network functiois we need to use */
+	netdev->init            = irda_usb_net_init;
+	netdev->hard_start_xmit = irda_usb_hard_xmit;
+	netdev->tx_timeout	= irda_usb_net_timeout;
+	netdev->watchdog_timeo  = 110*HZ/1000;	/* 110 ms > USB timeout */
+	netdev->open            = irda_usb_net_open;
+	netdev->stop            = irda_usb_net_close;
+	netdev->get_s  ts	= irda_usb_net_get_s  ts;
+	netdev->do_ioctl        = irda_usb_net_ioctl;
+
+	rtnl_lock();
+	err = register_netdevice(netdev);
+	rtnl_unlock();
+	if (err) {
+		ERROR(__FUNCTION__ "(), register_netdev() failed!\n");
+		return -1;
+	}
+	MESSAGE("IrDA: Registered device %s\n", netdev->name);
+
+	return 0;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Cleanup the network side of the irda-usb ins  nce
+ * Called when a USB ins  nce is removed in irda_usb_disconnect()
+ */
+s  tic inline int irda_usb_close(s ruct irda_usb_cb *self)
+{
+	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+
+	ASSERT(self != NULL, return -1;);
+
+	/* Remove netdevice */
+	if (self->netdev) {
+		rtnl_lock();
+		unregister_netdevice(self->netdev);
+		self->netdev = NULL;
+		rtnl_unlock();
+	}
+	/* Delete all pending skbs */
+	hashbin_delete(self->tx_list, (FREE_FUNC) &dev_kfree_skb_any);
+	/* Remove the speed buffer */
+	if (self->speed_buff != NULL) {
+		kfree(self->speed_buff);
+		self->speed_buff = NULL;
+	}
+
+	return 0;
+}
+
+/********************** USB CONFIG SUBROUTINES **********************/
+/*
+ * Various subroutines dealing with USB stuff we use to configure and
+ * initialise each irda-usb ins  nce.
+ * These functiois are used below in the main calls of the driver...
+ */
+
+/*------------------------------------------------------------------*/
+/*
+ * Functioi irda_usb_p rse_endpoints(dev, ifnum)
+ *
+ *    P rse the various endpoints and find the one we need.
+ *
+ * The endpoint are the pipes used to communic te with the USB device.
+ * The spec defines 2 endpoints of type bulk transfer, one in, and one out.
+ * These are used to pass frames back and forth with the dongle.
+ * Most dongle have also an interrupt endpoint, that will be probably
+ * documented in the next spec...
+ */
+s  tic inline int irda_usb_p rse_endpoints(s ruct irda_usb_cb *self, s ruct usb_endpoint_descriptor *endpoint, int ennum)
+{
+	int i;		/* Endpoint index in table */
+		
+	/* Init : no endpoints */
+	self->bulk_in_ep = 0;
+	self->bulk_out_ep = 0;
+	self->bulk_int_ep = 0;
+
+	/* Let's look at all those endpoints */
+	for(i = 0; i < ennum; i++) {
+		/* All those variables will get optimised by the compiler,
+		 * so let's aim for clarity... - Jean II */
+		__u8 ep;	/* Endpoint address */
+		__u8 dir;	/* Endpoint directioi */
+		__u8 attr;	/* Endpoint attribute */
+		__u16 psize;	/* Endpoint max packet size in bytes */
+
+		/* Get endpoint address, directioi and attribute */
+		ep = endpoint[i].bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
+		dir = endpoint[i].bEndpointAddress & USB_ENDPOINT_DIR_MASK;
+		attr = endpoint[i].bmAttributes;
+		psize = endpoint[i].wMaxPacketSize;
+
+		/* Is it a bulk endpoint ??? */
+		if(attr == USB_ENDPOINT_XFER_BULK) {
+			/* We need to find an IN and an OUT */
+			if(dir == USB_DIR_IN) {
+				/* This is our Rx endpoint */
+				self->bulk_in_ep = ep;
+			} else {
+				/* This is our Tx endpoint */
+				self->bulk_out_ep = ep;
+				self->bulk_out_mtu = psize;
+			}
+		} else {
+			if((attr == USB_ENDPOINT_XFER_INT) &&
+			   (dir == USB_DIR_IN)) {
+				/* This is our interrupt endpoint */
+				self->bulk_int_ep = ep;
+			} else {
+				ERROR(__FUNCTION__ "(), Unrecognised endpoint %02X.\n", ep);
+			}
+		}
+	}
+
+	IRDA_DEBUG(0, __FUNCTION__ "(), And our endpoints are : in=%02X, out=%02X (%d), int=%02X\n", self->bulk_in_ep, self->bulk_out_ep, self->bulk_out_mtu, self->bulk_int_ep);
+	/* Should be 8, 16, 32 or 64 bytes */
+	ASSERT(self->bulk_out_mtu == 64, ;);
+
+	return((self->bulk_in_ep != 0) && (self->bulk_out_ep != 0));
+}
+
+#ifdef IU_DUMP_CLASS_DESC
+/*------------------------------------------------------------------*/
+/*
+ * Functioi usb_irda_dump_class_desc(desc)
+ *
+ *    Prints out the contents of the IrDA class descriptor
+ *
+ */
+s  tic inline void irda_usb_dump_class_desc(s ruct irda_class_desc *desc)
+{
+	printk("bLength=%x\n", desc->bLength);
+	printk("bDescriptorType=%x\n", desc->bDescriptorType);
+	printk("bcdSpecRevisioi=%x\n", desc->bcdSpecRevisioi); 
+	printk("bmDataSize=%x\n", desc->bmDataSize);
+	printk("bmWindowSize=%x\n", desc->bmWindowSize);
+	printk("bmMinTurnaroundTime=%d\n", desc->bmMinTurnaroundTime);
+	printk("wBaudR te=%x\n", desc->wBaudR te);
+	printk("bmAdditionalBOFs=%x\n", desc->bmAdditionalBOFs);
+	printk("bIrdaR teSniff=%x\n", desc->bIrdaR teSniff);
+	printk("bMaxUnic stList=%x\n", desc->bMaxUnic stList);
+}
+#endif /* IU_DUMP_CLASS_DESC */
+
+/*------------------------------------------------------------------*/
+/*
+ * Functioi irda_usb_find_class_desc(dev, ifnum)
+ *
+ *    Returns ins  nce of IrDA class descriptor, or NULL if not found
+ *
+ * The class descriptor is some extra info that IrDA USB devices will
+ * offer to us, describing their IrDA characteristics. We will use that in
+ * irda_usb_init_qos()
+ */
+s  tic inline s ruct irda_class_desc *irda_usb_find_class_desc(s ruct usb_device *dev, unsigned int ifnum)
+{
+	s ruct usb_interface_descriptor *interface;
+	s ruct irda_class_desc *desc, *ptr;
+	int ret;
+		
+	desc = kmalloc(sizeof (s ruct irda_class_desc), GFP_KERNEL);
+	if (desc == NULL) 
+		return NULL;
+	memset(desc, 0, sizeof(s ruct irda_class_desc));
+	
+	ret = usb_get_class_descriptor(dev, ifnum, USB_DT_IRDA, 0, (void *) desc, sizeof(s ruct irda_class_desc));
+	IRDA_DEBUG(0, __FUNCTION__ "(), ret=%d\n", ret);
+	if (ret) {
+		WARNING("usb-irda: usb_get_class_descriptor failed (0x%x)\n", ret);  
+	}
+
+	/* Check if we found it? */
+	if (desc->bDescriptorType == USB_DT_IRDA)
+		return desc;
 
-	/* Ready to play !!! */
-	MOD_INC_USE_COUNT;
-	return 0;
+	IRDA_DEBUG(0, __FUNCTION__ "(), p rsing extra descriptors ...\n");
+	
+	/* Check if the class descriptor is interleaved with s  ndard descriptors */
+	interface = &dev->actconfig->interface[ifnum].altsetting[0];
+	ret = usb_get_extra_descriptor(interface, USB_DT_IRDA, &ptr);
+	if (ret) {
+		kfree(desc);
+		return NULL;
+	}
+	*desc = *ptr;
+#ifdef IU_DUMP_CLASS_DESC
+	irda_usb_dump_class_desc(desc);
+#endif	/* IU_DUMP_CLASS_DESC */
+	return desc;
 }
 
+/*********************** USB DEVICE CALLBACKS ***********************/
 /*
- * Functioi irda_usb_net_close (self)
- *
- *    Network device is takei down. Usually this is done by 
- *    "ifconfig irda0 down" 
+ * Main calls from the USB subsystem.
+ * Mostly registering a new irda-usb device and removing it....
  */
-s  tic int irda_usb_net_close(s ruct net_device *netdev)
+
+/*------------------------------------------------------------------*/
+/*
+ * This routine is called by the USB subsystem for each new device
+ * in the system. We need to check if the device is ours, and in
+ * this case start handling it.
+ * Note : it might be worth protecting this functioi by a global
+ * spinlock... Or not, because maybe USB already deal with that...
+ */
+s  tic void *irda_usb_probe(s ruct usb_device *dev, unsigned int ifnum,
+			    const s ruct usb_device_id *id)
 {
-	s ruct irda_usb_cb *self;
+	s ruct irda_usb_cb *self = NULL;
+	s ruct usb_interface_descriptor *interface;
+	s ruct irda_class_desc *irda_desc;
+	int ret;
 	int i;
 
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
-
-	ASSERT(netdev != NULL, return -1;);
-	self = (s ruct irda_usb_cb *) netdev->priv;
-	ASSERT(self != NULL, return -1;);
-
-	/* Clear this flag *before* unlinking the urbs and *before*
-	 * stopping the network Tx queue - Jean II */
-	self->netopen = 0;
+	/* Note : the probe make sure to call us only for devices that
+	 * matches the list of dongle (top of the file). So, we
+	 * don't need to check if the dongle is really ours.
+	 * Jean II */
 
-	/* Stop network Tx queue */
-	netif_stop_queue(netdev);
+	IRDA_DEBUG(0, "Vendor: %x, Product: %x\n", dev->descriptor.idVendor, dev->descriptor.idProduct);
+	
+	MESSAGE("IRDA-USB found at address %d\n", dev->devnum);
 
-	/* Dealloc te all the Rx path buffers (URBs and skb) */
-	for (i = 0; i < IU_MAX_RX_URBS; i++) {
-		purb_t purb = &(self->rx_urb[i]);
-		s ruct sk_buff *skb = (s ruct sk_buff *) purb->context;
-		/* Cancel the receive command */
-		usb_unlink_urb(purb);
-		/* The skb is ours, free it */
-		if (skb) {
-			dev_kfree_skb(skb);
-			purb->context = NULL;
+	/* Try to cleanup all ins  nce that have a pending disconnect
+	 * Ins  nce will be in this st te is the disconnect() occurs
+	 * before the net_close().
+	 * Jean II */
+	for (i = 0; i < NIRUSB; i++) {
+		s ruct irda_usb_cb *irda = &irda_ins  nce[i];
+		if((irda->usbdev != NULL) &&
+		   (irda->present == 0) &&
+		   (irda->netopen == 0)) {
+			IRDA_DEBUG(0, __FUNCTION__ "(), found a zombie ins  nce !!!\n");
+			irda_usb_disconnect(irda->usbdev, (void *) irda);
 		}
 	}
-	/* Cancel Tx and speed URB */
-	usb_unlink_urb(&self->tx_urb);
-	usb_unlink_urb(&self->speed_urb);
-	
-	/* Stop and remove ins  nce of IrLAP */
-	if (self->irlap)
-		irlap_close(self->irlap);
-	self->irlap = NULL;
-
-	MOD_DEC_USE_COUNT;
-
-	return 0;
-}
 
-s  tic void irda_usb_net_timeout(s ruct net_device *netdev)
-{
-	s ruct irda_usb_cb *self = netdev->priv;
-	int done = 0;	/* If we have made any progress */
-	purb_t purb;
+	/* Find an free ins  nce to handle this new device... */
+	self = NULL;
+	for (i = 0; i < NIRUSB; i++) {
+		if(irda_ins  nce[i].usbdev == NULL) {
+			self = &irda_ins  nce[i];
+			break;
+		}
+	}
+	if(self == NULL) {
+		IRDA_DEBUG(0, "Too many USB IrDA devices !!! (max = %d)\n",
+			   NIRUSB);
+		return NULL;
+	}
 
-	IRDA_DEBUG(0, __FUNCTION__ "(), Network layer thinks we timed out!\n");
+	/* Reset the ins  nce */
+	self->present = 0;
+	self->netopen = 0;
 
-	if (!self || !self->present) {
-		WARNING(__FUNCTION__ "(), device not present!\n");
-		netif_stop_queue(netdev);
-		return;
+       /* Is this really necessary? */
+	if (usb_set_configur tioi (dev, dev->config[0].bConfigur tioiValue) < 0) {
+		err("set_configur tioi failed");
+		return NULL;
 	}
-	WARNING("%s: Tx timed out\n", netdev->name);
 
-	/* Check Tx URB */
-	purb = &self->tx_urb;
-	switch (purb->s  tus) {
-		case -ECONNABORTED:	/* Can't find proper USB_ST_* code */
-			purb->s  tus = USB_ST_NOERROR;
-			netif_wake_queue(self->netdev);
-			done = 1;
+	/* Is this really necessary? */
+	/* Note : some driver do hardcode the interface number, some others
+	 * specify an altern te, but very few driver do like this.
+	 * Jean II */
+	ret = usb_set_interface(dev, ifnum, 0);
+	IRDA_DEBUG(0, "usb-irda: set interface %d result %d\n", ifnum, ret);
+	switch (ret) {
+		case USB_ST_NOERROR:		/* 0 */
 			break;
-		case USB_ST_URB_PENDING:	/* -EINPROGRESS == -115 */
-			usb_unlink_urb(purb);
-			done = 1;
+		case USB_ST_STALL:		/* -EPIPE = -32 */
+			usb_clear_halt(dev, usb_sndctrlpipe(dev, 0));
+			IRDA_DEBUG(0, __FUNCTION__ "(), Clearing stall on control interface\n" );
 			break;
 		default:
+			IRDA_DEBUG(0, __FUNCTION__ "(), Unknown error %d\n", ret);
+			return NULL;
 			break;
 	}
-	/* Check speed URB */
-	purb = &self->speed_urb;
-	switch (purb->s  tus) {
-		case -ECONNABORTED:	/* Can't find proper USB_ST_* code */
-			purb->s  tus = USB_ST_NOERROR;
-			netif_wake_queue(self->netdev);
-			done = 1;
-			break;
-		case USB_ST_URB_PENDING:	/* -EINPROGRESS */
-			usb_unlink_urb(purb);
-			done = 1;
-			break;
-		default:
-			break;
+
+	/* Find our endpoints */
+	interface = &dev->actconfig->interface[ifnum].altsetting[0];
+	if(!irda_usb_p rse_endpoints(self, interface->endpoint,
+				     interface->bNumEndpoints)) {
+		ERROR(__FUNCTION__ "(), Bogus endpoints...\n");
+		return NULL;
 	}
-	/* Maybe we need a reset */
-	/* if(done == 0) */
-}
 
-s  tic int irda_usb_is_receiving(s ruct irda_usb_cb *self)
-{
-	return 0; /* For now */
+	/* Find IrDA class descriptor */
+	irda_desc = irda_usb_find_class_desc(dev, ifnum);
+	if (irda_desc == NULL)
+		return NULL;
+	
+	self->irda_desc =  irda_desc;	
+	self->present = 1;
+	self->netopen = 0;
+	self->capability = id->driver_info;
+	self->usbdev = dev;
+	ret = irda_usb_open(self);
+	if (ret)
+		return NULL;
+
+	return self;
 }
 
-s  tic int irda_usb_net_ioctl(s ruct net_device *dev, s ruct ifreq *rq, int cmd)
+/*------------------------------------------------------------------*/
+/*
+ * The current irda-usb device is removed,  he USB layer tell us
+ * to shut it down...
+ */
+s  tic void irda_usb_disconnect(s ruct usb_device *dev, void *ptr)
 {
-	s ruct if_irda_req *irq = (s ruct if_irda_req *) rq;
-	s ruct irda_usb_cb *self;
-	int ret = 0;
+	s ruct irda_usb_cb *self = (s ruct irda_usb_cb *) ptr;
+	int i;
 
-	ASSERT(dev != NULL, return -1;);
-	self = dev->priv;
-	ASSERT(self != NULL, return -1;);
+	IRDA_DEBUG(0, __FUNCTION__ "()\n");
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), %s, (cmd=0x%X)\n", dev->name, cmd);
+	/* Oups ! We are not there any more */
+	self->present = 0;
 
-	/* Check if the device is still there */
-	if (!self->present)
-		return -EFAULT;
+	/* Hum... Check if networking is still active */
+	if (self->netopen) {
+		/* Accept no more transmissiois */
+		/*netif_device_detach(self->netdev);*/
+		netif_stop_queue(self->netdev);
+		/* Stop all the receive URBs */
+		for (i = 0; i < IU_MAX_RX_URBS; i++)
+			usb_unlink_urb(&(self->rx_urb[i]));
+		/* Cancel Tx and speed URB */
+		usb_unlink_urb(&(self->tx_urb));
+		usb_unlink_urb(&(self->speed_urb));
 
-	switch (cmd) {
-	case SIOCSBANDWIDTH: /* Set bandwidth */
-		if (!capable(CAP_NET_ADMIN))
-			return -EPERM;
-		/* Set the desired speed */
-		self->new_speed = irq->ifr_baudr te;
-		irda_usb_change_speed_xbofs(self);
-		/* Note : will spinlock in above functioi */
-		break;
-	case SIOCSMEDIABUSY: /* Set medi  busy */
-		if (!capable(CAP_NET_ADMIN))
-			return -EPERM;
-		irda_device_set_medi _busy(self->netdev, TRUE);
-		break;
-	case SIOCGRECEIVING: /* Check if we are receiving right now */
-		irq->ifr_receiving = irda_usb_is_receiving(self);
-		break;
-	default:
-		ret = -EOPNOTSUPP;
+		IRDA_DEBUG(0, __FUNCTION__ "(), postponing disconnect, network is still active...\n");
+		/* better not do anything just yet, usb_irda_cleanup()
+		 * will do whats needed */
+		return;
 	}
-	return ret;
-}
 
-s  tic s ruct net_device_s  ts *irda_usb_net_get_s  ts(s ruct net_device *dev)
-{
-	s ruct irda_usb_cb *self = dev->priv;
-	return &self->stats;
+	/* Cleanup the device s uff */
+	irda_usb_close(self);
+	/* No longer attached to USB bus */
+	self->usbdev = NULL;
+	IRDA_DEBUG(0, __FUNCTION__ "(), USB IrDA Disconnected\n");
 }
 
+/*------------------------------------------------------------------*/
+/*
+ * USB device callbacks
+ */
+s  tic s ruct usb_driver irda_driver = {
+	name:		"irda-usb",
+	probe:		irda_usb_probe,
+	disconnect:	irda_usb_disconnect,
+	id_table:	dongles,
+};
+
+/************************* MODULE CALLBACKS *************************/
+/*
+ * Deal with module insertioi/removal
+ * Mostly tell USB about our existence
+ */
+
+/*------------------------------------------------------------------*/
+/*
+ * Module insertioi
+ */
 int __init usb_irda_init(void)
 {
 	if (usb_register(&irda_driver) < 0)
@@ -1148,10 +1559,14 @@
 }
 module_init(usb_irda_init);
 
+/*------------------------------------------------------------------*/
+/*
+ * Module removal
+ */
 void __exit usb_irda_cleanup(void)
 {
 	s ruct irda_usb_cb *irda = NULL;
-	int i;
+	int	i;
 
 	/* Find zombie ins  nces and kill them... */
 	for (i = 0; i < NIRUSB; i++) {
@@ -1162,15 +1577,17 @@
 			irda_usb_disconnect(irda->usbdev, (void *) irda);
 		}
 	}
+
 	/* Deregister the driver and remove all pending ins  nces */
 	usb_deregister(&irda_driver);
 }
 module_exit(usb_irda_cleanup);
 
+/*------------------------------------------------------------------*/
+/*
+ * Module p rameters
+ */
 MODULE_PARM(qos_mtt_bits, "i");
 MODULE_PARM_DESC(qos_mtt_bits, "Minimum Turn Time");
 MODULE_AUTHOR("Roman Weissgaerber <weissg@vienna.at>, Dag Br ttli <dag@br ttli.net> and Jean Tourrilhes <jt@hpl.hp.com>");
 MODULE_DESCRIPTION("IrDA-USB Dongle Driver"); 
-
-
-
diff -u --recursive --new-file v2.4.9/linux/drivers/net/irda/irport.c linux/drivers/net/irda/irport.c
--- v2.4.9/linux/drivers/net/irda/irport.c	Moi Aug 27 12:41:42 2001
+++ linux/drivers/net/irda/irport.c	Thu Sep 13 16:26:52 2001
@@ -774,6 +774,7 @@
 {
 	s ruct irport_cb *self;
 	int iobase;
+	char hwname[16];
 
 	IRDA_DEBUG(0, __FUNCTION__ "()\n");
 	
@@ -792,11 +793,14 @@
 	irport_start(self);
 
 
+	/* Give self a hardware name */
+	sprintf(hwname, "SIR @ 0x%03x", self->io.sir_base);
+
 	/* 
 	 * Open new IrLAP layer ins  nce, now that everything should be
 	 * initialized properly 
 	 */
-	self->irlap = irlap_open(dev, &self->qos);
+	self->irlap = irlap_open(dev, &self->qos, hwname);
 
 	/* FIXME: change speed of dongle */
 	/* Ready to play! */
diff -u --recursive --new-file v2.4.9/linux/drivers/net/irda/irtty.c linux/drivers/net/irda/irtty.c
--- v2.4.9/linux/drivers/net/irda/irtty.c	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/irda/irtty.c	Thu Sep 13 16:26:52 2001
@@ -895,6 +895,8 @@
 s  tic int irtty_net_open(s ruct net_device *dev)
 {
 	s ruct irtty_cb *self = (s ruct irtty_cb *) dev->priv;
+	s ruct tty_s ruct *tty = self->tty;
+	char hwname[16];
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRTTY_MAGIC, return -1;);
@@ -907,11 +909,16 @@
 	/* Make sure we can receive more data */
 	irtty_s op_receiver(self, FALSE);
 
+	/* Give self a hardware name */
+	sprintf(hwname, "%s%d", tty->driver.name,
+		MINOR(tty->device) - tty->driver.minor_start +
+		tty->driver.name_base);
+
 	/* 
 	 * Open new IrLAP layer ins  nce, now that everything should be
 	 * initialized properly 
 	 */
-	self->irlap = irlap_open(dev, &self->qos);
+	self->irlap = irlap_open(dev, &self->qos, hwname);
 
 	MOD_INC_USE_COUNT;
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/irda/nsc-ircc.c linux/drivers/net/irda/nsc-ircc.c
--- v2.4.9/linux/drivers/net/irda/nsc-ircc.c	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/irda/nsc-ircc.c	Thu Sep 13 16:26:52 2001
@@ -1836,6 +1836,7 @@
 {
 	s ruct nsc_ircc_cb *self;
 	int iobase;
+	char hwname[32];
 	__u8 bank;
 	
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
@@ -1874,14 +1875,16 @@
 	outb(bank, iobase+BSR);
 
 	/* Ready to play! */
-
 	netif_start_queue(dev);
 	
+	/* Give self a hardware name */
+	sprintf(hwname, "NSC-FIR @ 0x%03x", self->io.fir_base);
+
 	/* 
 	 * Open new IrLAP layer ins  nce, now that everything should be
 	 * initialized properly 
 	 */
-	self->irlap = irlap_open(dev, &self->qos);
+	self->irlap = irlap_open(dev, &self->qos, hwname);
 
 	MOD_INC_USE_COUNT;
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/irda/toshoboe.c linux/drivers/net/irda/toshoboe.c
--- v2.4.9/linux/drivers/net/irda/toshoboe.c	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/irda/toshoboe.c	Thu Sep 13 16:26:52 2001
@@ -510,6 +510,7 @@
 toshoboe_net_open (s ruct net_device *dev)
 {
   s ruct toshoboe_cb *self;
+  char hwname[32];
 
   IRDA_DEBUG (4, __FUNCTION__ "()\n");
 
@@ -537,11 +538,13 @@
 
   /* Ready to play! */
   netif_start_queue(dev);  
+  /* Give self a hardware name */
+  sprintf(hwname, "Toshiba-FIR @ 0x%03x", self->base);
   /* 
    * Open new IrLAP layer ins  nce, now that everything should be
    * initialized properly 
    */
-  self->irlap = irlap_open(dev, &self->qos);	
+  self->irlap = irlap_open(dev, &self->qos, hwname);	
 
   self->open = 1;
 	
@@ -695,7 +698,6 @@
 {
   s ruct toshoboe_cb *self;
   s ruct net_device *dev;
-  s ruct pm_dev *pmdev;
   int i = 0;
   int ok = 0;
   int err;
@@ -844,11 +846,6 @@
           goto freebufs;
   }
   pci_set_drvdata(pci_dev,self);
-
-/*  pmdev = pm_register (PM_PCI_DEV, PM_PCI_ID(pci_dev), toshoboe_pmproc);
-  if (pmdev)
-	  pmdev->data = self;
-	  */
 
   printk (KERN_WARNING "ToshOboe: Using ");
 #ifdef ONETASK
diff -u --recursive --new-file v2.4.9/linux/drivers/net/irda/vlsi_ir.c linux/drivers/net/irda/vlsi_ir.c
--- v2.4.9/linux/drivers/net/irda/vlsi_ir.c	Moi Aug 27 12:41:42 2001
+++ linux/drivers/net/irda/vlsi_ir.c	Fri Sep 14 14:39:59 2001
@@ -728,7 +728,7 @@
 	u8		irintr;
 	int 		boguscount = 20;
 	int		no_speed_check = 0;
-	unsigned	flags;
+	unsigned long	flags;
 
 
 	iobase = ndev->base_addr;
@@ -776,6 +776,7 @@
 {
 	vlsi_irda_dev_t *idev = ndev->priv;
 	s ruct pci_dev *pdev = idev->pdev;
+	char	hwname[32];
 	int	err;
 
 	MOD_INC_USE_COUNT;		/* still needed? - we have SET_MODULE_OWNER! */
@@ -824,7 +825,8 @@
 		(idev->mode==IFF_SIR)?"SIR":((idev->mode==IFF_MIR)?"MIR":"FIR"),
 		(sirpulse)?"3/16 bittime":"short");
 
-	idev->irlap = irlap_open(ndev,&idev->qos);
+	sprintf(hwname, "VLSI-FIR");
+	idev->irlap = irlap_open(ndev,&idev->qos,hwname);
 
 	netif_start_queue(ndev);
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/irda/w83977af_ir.c linux/drivers/net/irda/w83977af_ir.c
--- v2.4.9/linux/drivers/net/irda/w83977af_ir.c	Tue Mar 20 12:04:59 2001
+++ linux/drivers/net/irda/w83977af_ir.c	Thu Sep 13 16:26:52 2001
@@ -1210,6 +1210,7 @@
 {
 	s ruct w83977af_ir *self;
 	int iobase;
+	char hwname[32];
 	__u8 set;
 	
 	IRDA_DEBUG(0, __FUNCTION__ "()\n");
@@ -1251,11 +1252,14 @@
 	/* Ready to play! */
 	netif_start_queue(dev);
 	
+	/* Give self a hardware name */
+	sprintf(hwname, "w83977af @ 0x%03x", self->io.fir_base);
+
 	/* 
 	 * Open new IrLAP layer ins  nce, now that everything should be
 	 * initialized properly 
 	 */
-	self->irlap = irlap_open(dev, &self->qos);
+	self->irlap = irlap_open(dev, &self->qos, hwname);
 
 	MOD_INC_USE_COUNT;
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/jazzsonic.c linux/drivers/net/jazzsonic.c
--- v2.4.9/linux/drivers/net/jazzsonic.c	Thu Apr 12 12:15:25 2001
+++ linux/drivers/net/jazzsonic.c	Sun Sep  9 10:43:01 2001
@@ -47,11 +47,12 @@
 /*
  * Macros to access SONIC registers
  */
-#define SONIC_READ(reg) \
-	*((volatile unsigned int *)base_addr+reg)
+#define SONIC_READ(reg) (*((volatile unsigned int *)base_addr+reg))
 
-#define SONIC_WRITE(reg,val) \
-	*((volatile unsigned int *)base_addr+reg) = val
+#define SONIC_WRITE(reg,val)						\
+do {									\
+	*((volatile unsigned int *)base_addr+reg) = val;		\
+}
 
 
 /* use 0 for production, 1 for verific tioi, >2 for debug */
@@ -65,8 +66,8 @@
  * Base address and interrupt of the SONIC controller oi JAZZ boards
  */
 s  tic s ruct {
-    unsigned int port;
-    unsigned int irq;
+	unsigned int port;
+	unsigned int irq;
 } sonic_portlist[] = { {JAZZ_ETHERNET_BASE, JAZZ_ETHERNET_IRQ}, {0, 0}};
 
 /*
@@ -76,14 +77,15 @@
  */
 s  tic unsigned short known_revisiois[] =
 {
-  0x04,				/* Mips Magnum 4000 */
-  0xffff			/* end of list */
+	0x04,			/* Mips Magnum 4000 */
+	0xffff			/* end of list */
 };
 
 /* Index to functiois, as functioi prototypes. */
 
 extern int sonic_probe(s ruct net_device *dev);
-s  tic int sonic_probe1(s ruct net_device *dev, unsigned int base_addr, unsigned int irq);
+s  tic int sonic_probe1(s ruct net_device *dev, unsigned int base_addr,
+                        unsigned int irq);
 
 
 /*
@@ -92,164 +94,170 @@
  */
 int __init sonic_probe(s ruct net_device *dev)
 {
-    unsigned int base_addr = dev ? dev->base_addr : 0;
-    int i;
+	unsigned int base_addr = dev ? dev->base_addr : 0;
+	int i;
 
-    /*
-     * Don't probe if we're not running oi a Jazz board.
-     */
-    if (mips_machgroup != MACH_GROUP_JAZZ)
+	/*
+	 * Don't probe if we're not running oi a Jazz board.
+	 */
+	if (mips_machgroup != MACH_GROUP_JAZZ)
+		return -ENODEV;
+	if (base_addr >= KSEG0)	/* Check a single specified loc tioi. */
+		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 -ENODEV;
-    if (base_addr >= KSEG0)	/* Check a single specified loc tioi. */
-	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 -ENODEV;
 }
 
-s  tic int __init sonic_probe1(s ruct net_device *dev,
-                               unsigned int base_addr, unsigned int irq)
+s  tic int __init sonic_probe1(s ruct net_device *dev, unsigned int base_addr,
+                               unsigned int irq)
 {
-    s  tic unsigned version_printed;
-    unsigned int silicon_revisioi;
-    unsigned int val;
-    s ruct sonic_loc l *lp;
-    int i;
-    
-    /*
-     * get the Silicon Revisioi ID. If this is one of the known
-     * one assume that we found a SONIC ethernet controller at
-     * the expected loc tioi.
-     */
-    silicon_revisioi = SONIC_READ(SONIC_SR);
-    if (sonic_debug > 1)
-      printk("SONIC Silicon Revisioi = 0x%04x\n",silicon_revisioi);
-
-    i = 0;
-    while ((known_revisiois[i] != 0xffff) &&
-	   (known_revisiois[i] != silicon_revisioi))
-      i++;
-	
-    if (known_revisiois[i] == 0xffff) {
-	printk("SONIC ethernet controller not found (0x%4x)\n",
-	       silicon_revisioi);
-	return -ENODEV;
-    }
-    
-    if (!request_region(base_addr, 0x100, dev->name))
-    	return -EBUSY;
-    
-    if (sonic_debug  &&  version_printed++ == 0)
-      printk(version);
-
-    printk("%s: %s found at 0x%08x, ",
-	   dev->name, "SONIC ethernet", base_addr);
+	s  tic unsigned version_printed;
+	unsigned int silicon_revisioi;
+	unsigned int val;
+	s ruct sonic_loc l *lp;
+	int i;
 
-    /* Fill in the 'dev' fields. */
-    dev->base_addr = base_addr;
-    dev->irq = irq;
-
-    /*
-     * Put the sonic into software reset, then
-     * retrieve and print the ethernet address.
-     */
-    SONIC_WRITE(SONIC_CMD,SONIC_CR_RST);
-    SONIC_WRITE(SONIC_CEP,0);
-    for (i=0; i<3; i++) {
-	val = SONIC_READ(SONIC_CAP0-i);
-	dev->dev_addr[i*2] = val;
-	dev->dev_addr[i*2+1] = val >> 8;
-    }
-
-    printk("HW Address ");
-    for (i = 0; i < 6; i++) {
-	printk("%2.2x", dev->dev_addr[i]);
-	if (i<5)
-	  printk(":");
-    }
-    
-    printk(" IRQ %d\n", irq);
-    
-    /* Initialize the device s ructure. */
-    if (dev->priv == NULL) {
 	/*
-	 * the memory be loc ted in the same 64kb segment
+	 * get the Silicon Revisioi ID. If this is one of the known
+	 * one assume that we found a SONIC ethernet controller at
+	 * the expected loc tioi.
 	 */
-	lp = NULL;
+	silicon_revisioi = SONIC_READ(SONIC_SR);
+	if (sonic_debug > 1)
+		printk("SONIC Silicon Revisioi = 0x%04x\n",silicon_revisioi);
+
 	i = 0;
-	do {
-	    lp = (s ruct sonic_loc l *)kmalloc(sizeof(*lp), GFP_KERNEL);
-	    if ((unsigned long)lp >> 16 != ((unsigned long)lp + sizeof(*lp) ) >> 16) {
-		/* FIXME, free the memory later */
-		kfree (lp);
-		lp = NULL;
-	    }
-	} while (lp == NULL && i++ < 20);
-	
-	if (lp == NULL) {
-	    printk ("%s: couldn't alloc te memory for descriptors\n",
-	            dev->name);
-	    return -ENOMEM;
+	while (known_revisiois[i] != 0xffff
+	       && known_revisiois[i] != silicon_revisioi)
+		i++;
+
+	if (known_revisiois[i] == 0xffff) {
+		printk("SONIC ethernet controller not found (0x%4x)\n",
+		       silicon_revisioi);
+		return -ENODEV;
 	}
-	
-	memset(lp, 0, sizeof(s ruct sonic_loc l));
-	
-	/* get the virtu l dma address */
-	lp->cda_laddr = vdma_alloc(PHYSADDR(lp),sizeof(*lp));
-	if (lp->cda_laddr == ~0UL) {
-	    printk ("%s: couldn't get DMA page entry for descriptors\n",
-	            dev->name);
-	    return -ENOMEM;
+    
+	if (!request_region(base_addr, 0x100, dev->name))
+		return -EBUSY;
+
+	if (sonic_debug  &&  version_printed++ == 0)
+		printk(version);
+
+	printk("%s: Sonic ethernet found at 0x%08lx, ", dev->name, base_addr);
+
+	/* Fill in the 'dev' fields. */
+	dev->base_addr = base_addr;
+	dev->irq = irq;
+
+	/*
+	 * Put the sonic into software reset, then
+	 * retrieve and print the ethernet address.
+	 */
+	SONIC_WRITE(SONIC_CMD,SONIC_CR_RST);
+	SONIC_WRITE(SONIC_CEP,0);
+	for (i=0; i<3; i++) {
+		val = SONIC_READ(SONIC_CAP0-i);
+		dev->dev_addr[i*2] = val;
+		dev->dev_addr[i*2+1] = val >> 8;
 	}
 
-	lp->tda_laddr = lp->cda_laddr + sizeof (lp->cda);
-	lp->rra_laddr = lp->tda_laddr + sizeof (lp->tda);
-	lp->rda_laddr = lp->rra_laddr + sizeof (lp->rra);
-	
-	/* alloc te receive buffer area */
-	/* FIXME, maybe we should use skbs */
-	if ((lp->rba = (char *)kmalloc(SONIC_NUM_RRS * SONIC_RBSIZE, GFP_KERNEL)) == NULL) {
-	    printk ("%s: couldn't alloc te receive buffers\n",dev->name);
-	    return -ENOMEM;
+	printk("HW Address ");
+	for (i = 0; i < 6; i++) {
+		printk("%2.2x", dev->dev_addr[i]);
+		if (i<5)
+			printk(":");
 	}
-	
-	/* get virtu l dma address */
-	if ((lp->rba_laddr = vdma_alloc(PHYSADDR(lp->rba),SONIC_NUM_RRS * SONIC_RBSIZE)) == ~0UL) {
-	    printk ("%s: couldn't get DMA page entry for receive buffers\n",dev->name);
-	    return -ENOMEM;
+
+	printk(" IRQ %d\n", irq);
+    
+	/* Initialize the device s ructure. */
+	if (dev->priv == NULL) {
+		/*
+		 * the memory be loc ted in the same 64kb segment
+		 */
+		lp = NULL;
+		i = 0;
+		do {
+			lp = kmalloc(sizeof(*lp), GFP_KERNEL);
+			if ((unsigned long) lp >> 16
+			    != ((unsigned long)lp + sizeof(*lp) ) >> 16) {
+				/* FIXME, free the memory later */
+				kfree(lp);
+				lp = NULL;
+			}
+		} while (lp == NULL && i++ < 20);
+
+		if (lp == NULL) {
+			printk("%s: couldn't alloc te memory for descriptors\n",
+			       dev->name);
+			return -ENOMEM;
+		}
+
+		memset(lp, 0, sizeof(s ruct sonic_loc l));
+
+		/* get the virtu l dma address */
+		lp->cda_laddr = vdma_alloc(PHYSADDR(lp),sizeof(*lp));
+		if (lp->cda_laddr == ~0UL) {
+			printk("%s: couldn't get DMA page entry for "
+			       "descriptors\n", dev->name);
+			return -ENOMEM;
+		}
+
+		lp->tda_laddr = lp->cda_laddr + sizeof (lp->cda);
+		lp->rra_laddr = lp->tda_laddr + sizeof (lp->tda);
+		lp->rda_laddr = lp->rra_laddr + sizeof (lp->rra);
+	
+		/* alloc te receive buffer area */
+		/* FIXME, maybe we should use skbs */
+		lp->rba = kmalloc(SONIC_NUM_RRS * SONIC_RBSIZE, GFP_KERNEL);
+		if (!lp->rba) {
+			printk("%s: couldn't alloc te receive buffers\n",
+			       dev->name);
+			return -ENOMEM;
+		}
+
+		/* get virtu l dma address */
+		lp->rba_laddr = vdma_alloc(PHYSADDR(lp->rba),
+		                           SONIC_NUM_RRS * SONIC_RBSIZE);
+		if (lp->rba_laddr == ~0UL) {
+			printk("%s: couldn't get DMA page entry for receive "
+			       "buffers\n",dev->name);
+			return -ENOMEM;
+		}
+
+		/* now convert pointer to KSEG1 pointer */
+		lp->rba = (char *)KSEG1ADDR(lp->rba);
+		flush_cache_all();
+		dev->priv = (s ruct sonic_loc l *)KSEG1ADDR(lp);
 	}
-	
-	/* now convert pointer to KSEG1 pointer */
-	lp->rba = (char *)KSEG1ADDR(lp->rba);
-	flush_cache_all();
-	dev->priv = (s ruct sonic_loc l *)KSEG1ADDR(lp);
-    }
-
-    lp = (s ruct sonic_loc l *)dev->priv;
-    dev->open = sonic_open;
-    dev->stop = sonic_close;
-    dev->hard_start_xmit = sonic_send_packet;
-    dev->get_s  ts	= sonic_get_s  ts;
-    dev->set_multic st_list = &sonic_multic st_list;
-
-    /*
-     * clear tally counter
-     */
-    SONIC_WRITE(SONIC_CRCT,0xffff);
-    SONIC_WRITE(SONIC_FAET,0xffff);
-    SONIC_WRITE(SONIC_MPT,0xffff);
-
-    /* Fill in the fields of the device s ructure with ethernet values. */
-    ether_setup(dev);
-    return 0;
+
+	lp = (s ruct sonic_loc l *)dev->priv;
+	dev->open = sonic_open;
+	dev->stop = sonic_close;
+	dev->hard_start_xmit = sonic_send_packet;
+	dev->get_s  ts	= sonic_get_s  ts;
+	dev->set_multic st_list = &sonic_multic st_list;
+	dev->watchdog_timeo = TX_TIMEOUT;
+
+	/*
+	 * clear tally counter
+	 */
+	SONIC_WRITE(SONIC_CRCT,0xffff);
+	SONIC_WRITE(SONIC_FAET,0xffff);
+	SONIC_WRITE(SONIC_MPT,0xffff);
+
+	/* Fill in the fields of the device s ructure with ethernet values. */
+	ether_setup(dev);
+	return 0;
 }
 
 /*
diff -u --recursive --new-file v2.4.9/linux/drivers/net/lp486e.c linux/drivers/net/lp486e.c
--- v2.4.9/linux/drivers/net/lp486e.c	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/lp486e.c	Sun Sep  9 10:45:43 2001
@@ -7,7 +7,7 @@
         Written 1993 by Donald Becker.
         Copyright 1993 United St tes Government as represented by the Director,
         National Security Agency.  This software may only be used and
-	distributed according to the terms of the GNU Public License
+	distributed according to the terms of the GNU General Public License
 	as modified by SRC, incorpor ted herein by reference.
 
         The author may be reached as becker@scyld.com, or C/O
@@ -67,7 +67,7 @@
 #include <linux/ptrace.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
diff -u --recursive --new-file v2.4.9/linux/drivers/net/macsonic.c linux/drivers/net/macsonic.c
--- v2.4.9/linux/drivers/net/macsonic.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/macsonic.c	Sat Sep  1 11:01:28 2001
@@ -135,8 +135,9 @@
 		unsigned long desc_base, desc_top;
 		if ((lp->sonic_desc = 
 		     kmalloc(SIZEOF_SONIC_DESC
-			     * SONIC_BUS_SCALE(lp->dma_bitmode), GFP_DMA)) == NULL) {
+			     * SONIC_BUS_SCALE(lp->dma_bitmode), GFP_KERNEL | GFP_DMA)) == NULL) {
 			printk(KERN_ERR "%s: couldn't alloc te descriptor buffers\n", dev->name);
+			return -ENOMEM;
 		}
 		desc_base = (unsigned long) lp->sonic_desc;
 		desc_top = desc_base + SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode);
@@ -165,7 +166,7 @@
 
 	/* FIXME, maybe we should use skbs */
 	if ((lp->rba = (char *)
-	     kmalloc(SONIC_NUM_RRS * SONIC_RBSIZE, GFP_DMA)) == NULL) {
+	     kmalloc(SONIC_NUM_RRS * SONIC_RBSIZE, GFP_KERNEL | GFP_DMA)) == NULL) {
 		printk(KERN_ERR "%s: couldn't alloc te receive buffers\n", dev->name);
 		return -ENOMEM;
 	}
diff -u --recursive --new-file v2.4.9/linux/drivers/net/ncr885_debug.h linux/drivers/net/ncr885_debug.h
--- v2.4.9/linux/drivers/net/ncr885_debug.h	Moi Oct 11 10:13:24 1999
+++ linux/drivers/net/ncr885_debug.h	Wed Dec 31 16:00:00 1969
@@ -1,54 +0,0 @@
-#ifndef _H_NCR885_DEBUG
-#define _H_NCR885_DEBUG
-
-s ruct ncr885e_regs {
-  unsigned long tx_s  tus;
-  unsigned long rx_s  tus;
-  unsigned long mac_config;
-  unsigned long tx_control;
-  unsigned long rx_control;
-  unsigned long tx_cmd_ptr;
-  unsigned long rx_cmd_ptr;
-  unsigned long int_s  tus;
-};
-
-#ifndef __KERNEL__
-
-s ruct ncr885e_priv te {
-
-  s ruct dbdma_cmd *head;
-  s ruct dbdma_cmd *tx_cmds;
-  s ruct dbdma_cmd *rx_cmds;
-  s ruct dbdma_cmd *s op_cmd;
-
-  s ruct sk_buff *tx_skbufs[NR_TX_RING];
-  s ruct sk_buff *rx_skbufs[NR_RX_RING];
-
-  int rx_current;
-  int rx_dirty;
-
-  int tx_dirty;
-  int tx_current;
-
-  unsigned short tx_s  tus[NR_TX_RING];
-
-  unsigned char tx_fullup;
-  unsigned char tx_active;
-  
-  s ruct net_device_s  ts  s  ts;
-
-  s ruct device *dev;
-
-  s ruct timer_list tx_timeout;
-  int timeout_active;
-
-  spinlock_t lock;
-};
-
-#endif /* __KERNEL__ */
-
-
-#define NCR885E_GET_PRIV   _IOR('N',1,sizeof( s ruct ncr885e_priv te ))
-#define NCR885E_GET_REGS   _IOR('N',2,sizeof( s ruct ncr885e_regs ))
-
-#endif
diff -u --recursive --new-file v2.4.9/linux/drivers/net/ncr885e.c linux/drivers/net/ncr885e.c
--- v2.4.9/linux/drivers/net/ncr885e.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/ncr885e.c	Wed Dec 31 16:00:00 1969
@@ -1,1361 +0,0 @@
-/*
- *  An Ethernet driver for the dual-functioi NCR 53C885 SCSI/Ethernet
- *  controller.
- *
- *
- *  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.
- *
- */
-
-s  tic const char *version =
-"ncr885e.c:v1.0 02/10/00 dan@synergymicro.com, cort@fsmlabs.com\n";
-
-#include <linux/module.h>
-#include <linux/version.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/timer.h>
-#include <linux/ptrace.h>
-#include <linux/malloc.h>
-#include <linux/netdevice.h>
-#include <linux/pci.h>
-#include <linux/delay.h>
-#include <linux/ioport.h>
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <asm/io.h>
-#include <asm/dbdma.h>
-#include <asm/uaccess.h>
-
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
-
-#include "ncr885e.h"
-#include "ncr885_debug.h"
-
-s  tic const char *chipname = "ncr885e";
-
-#define NCR885E_DEBUG   0
-
-/* The 885's Ethernet PCI device id. */
-#ifndef PCI_DEVICE_ID_NCR_53C885_ETHERNET
-#define PCI_DEVICE_ID_NCR_53C885_ETHERNET  0x0701
-#endif
-
-#define NR_RX_RING    8
-#define NR_TX_RING    8
-#define MAX_TX_ACTIVE (NR_TX_RING-1)
-#define NCMDS_TX      NR_TX_RING
-
-#define RX_BUFLEN     (ETH_FRAME_LEN + 8)
-#define TX_TIMEOUT    5*HZ
-
-#define NCR885E_TOTAL_SIZE 0xe0
-
-#define TXSR          (1<<6)   /* tx: xfer s  tus written */
-#define TXABORT       (1<<7)   /* tx: abort */
-#define EOP           (1<<7)   /* rx: end of packet written to buffer */
-
-int ncr885e_debug = NCR885E_DEBUG;
-s  tic int print_version;
-
-s ruct ncr885e_priv te {
-
-	/* preserve a 1-1 marking with buffs */
-	s ruct dbdma_cmd *head;
-	s ruct dbdma_cmd *tx_cmds;
-	s ruct dbdma_cmd *rx_cmds;
-	s ruct dbdma_cmd *s op_cmd;
-
-	s ruct sk_buff *tx_skbufs[NR_TX_RING];
-	s ruct sk_buff *rx_skbufs[NR_RX_RING];
-
-	int rx_current;
-	int rx_dirty;
-
-	int tx_dirty;
-	int tx_current;
-
-	unsigned short tx_s  tus[NR_TX_RING];
-
-	unsigned char tx_fullup;
-	unsigned char tx_active;
-  
-	s ruct net_device_s  ts  s  ts;
-
-	s ruct net_device *dev;
-
-	s ruct timer_list tx_timeout;
-	int timeout_active;
-
-	spinlock_t lock;
-};
-
-s  tic s ruct net_device *root_dev;
-
-s  tic int ncr885e_open( s ruct net_device *dev );
-s  tic int ncr885e_close( s ruct net_device *dev );
-s  tic void ncr885e_rx( s ruct net_device *dev );
-s  tic void ncr885e_tx( s ruct net_device *dev );
-s  tic int ncr885e_probe1( unsigned long ioaddr, unsigned char irq );
-s  tic int ncr885e_xmit_start( s ruct sk_buff *skb, s ruct net_device *dev );
-s  tic s ruct net_device_s  ts *ncr885e_s  ts( s ruct net_device *dev );
-s  tic void ncr885e_set_multic st( s ruct net_device *dev );
-s  tic void ncr885e_config( s ruct net_device *dev );
-s  tic int ncr885e_set_address( s ruct net_device *dev, void *addr );
-s  tic void ncr885e_interrupt( int irq, void *dev_id, s ruct pt_regs *regs );
-s  tic void show_dbdma_cmd( volatile s ruct dbdma_cmd *cmd );
-#if 0
-s  tic int read_eeprom( unsigned int ioadddr, int loc tioi );
-#endif
-
-#ifdef NCR885E_DEBUG_MII
-s  tic void show_mii( unsigned long ioaddr );
-s  tic int read_mii( unsigned long ioaddr, int reg );
-s  tic void write_mii( unsigned long ioaddr, int reg, int data );
-#endif /* NCR885E_DEBUG_MII */
-
-#define TX_RESET_FLAGS    (TX_CHANNEL_RUN|TX_CHANNEL_PAUSE|TX_CHANNEL_WAKE)
-#define RX_RESET_FLAGS    (RX_CHANNEL_RUN|RX_CHANNEL_PAUSE|RX_CHANNEL_WAKE)
-
-
-s  tic s ruct pci_device_id ncr885e_pci_tbl[] __initdata = {
-	{ PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C885_ETHERNET, PCI_ANY_ID, PCI_ANY_ID, },
-	{ }			/* Terminating entry */
-};
-MODULE_DEVICE_TABLE(pci, ncr885e_pci_tbl);
-
-#if 0
-s  tic int
-debug_ioctl( s ruct net_device *dev, s ruct ifreq *req, int cmd )
-{
-	unsigned long ioaddr = dev->base_addr;
-	s ruct ncr885e_priv te *sp = (s ruct ncr885e_priv te *) dev->priv;
-	s ruct ncr885e_priv te *data;
-	s ruct ncr885e_regs *regs;
-	unsigned long flags;
-
-	unioi {
-		s ruct ncr885e_regs dump;
-		s ruct ncr885e_priv te priv;    
-	} temp;
-
-	switch( cmd ) {
-
-		/* dump the rx ring status */
-	case NCR885E_GET_PRIV:
-
-		data = (s ruct ncr885e_priv te *) &req->ifr_data;    
-
-		if ( verify_area(VERIFY_WRITE, &req->ifr_data,
-				 sizeof( s ruct ncr885e_priv te )))
-			return -EFAULT;
-
-		memcpy((char *) &temp.priv, sp, sizeof( s ruct ncr885e_priv te ));
-		copy_to_user( data, (char *) &temp.priv, sizeof( s ruct ncr885e_priv te));
-		break;
-
-	case NCR885E_GET_REGS:
-
-		regs = (s ruct ncr885e_regs *) &req->ifr_data;
-  
-		if ( verify_area( VERIFY_WRITE, &req->ifr_data,
-				  sizeof( s ruct ncr885e_regs )))
-			return -EFAULT;
-
-		spin_lock_irqsave( &sp->lock, flags ); 
-
-		temp.dump.tx_s  tus = inl( ioaddr + TX_CHANNEL_STATUS );
-		temp.dump.rx_s  tus = inl( ioaddr + RX_CHANNEL_STATUS );
-		temp.dump.mac_config = inl( ioaddr + MAC_CONFIG );
-		temp.dump.tx_control = inl( ioaddr + TX_CHANNEL_CONTROL );
-		temp.dump.rx_control = inl( ioaddr + RX_CHANNEL_CONTROL );
-		temp.dump.tx_cmd_ptr = inl( ioaddr + TX_CMD_PTR_LO );
-		temp.dump.rx_cmd_ptr = inl( ioaddr + RX_CMD_PTR_LO );
-		temp.dump.int_s  tus = inl( ioaddr + INTERRUPT_STATUS_REG );
-
-		spin_unlock_irqrestore( &sp->lock, flags );
-		copy_to_user( regs, (char *) &temp.dump, sizeof( s ruct ncr885e_regs ));
-
-		break;
-
-	default:
-		return -EOPNOTSUPP;
-	}
-	return 0;
-}
-#endif
-
-/*  Enable interrupts on the 53C885 */
-s  tic inline void
-ncr885e_enable( s ruct net_device *dev )
-
-{
-	unsigned long ioaddr = dev->base_addr;
-	unsigned short reg;
-
-	reg = inw(ioaddr + INTERRUPT_ENABLE);
-	outw(reg | INTERRUPT_INTE, ioaddr + INTERRUPT_ENABLE);
-}
-
-/*  Disable interrupts on the 53c885 */
-s  tic inline void
-ncr885e_disable( s ruct net_device *dev )
-
-{
-	unsigned long ioaddr = dev->base_addr;
-	unsigned short reg;
-
-	reg = inw( ioaddr + INTERRUPT_ENABLE );
-	outw( reg & ~INTERRUPT_INTE, ioaddr + INTERRUPT_ENABLE );
-}
-
-
-s  tic inline void
-ncr885e_reset( s ruct net_device *dev )
-
-{
-	unsigned short reg;  
-	unsigned long cntl;
-	int i;
-	unsigned long ioaddr = dev->base_addr;
-
-	if (ncr885e_debug > 1)
-		printk( KERN_INFO "%s: Resetting 53C885...\n", dev->name );
-
-	/* disable interrupts on the 53C885 */
-	ncr885e_disable( dev );
-  
-	/* disable rx in the MAC */
-	reg = inw( ioaddr + MAC_CONFIG );
-	outw( reg & ~MAC_CONFIG_RXEN, ioaddr + MAC_CONFIG );
-  
-	for( i=0; i < 100; i++ ) {
-
-		if ( !(inw( ioaddr + MAC_CONFIG ) & MAC_CONFIG_RXEN ))
-			break;
-		udelay( 10 );
-	}
-  
-	reg = inw( ioaddr + MAC_CONFIG );
-	outw( reg | MAC_CONFIG_SRST, ioaddr + MAC_CONFIG );
-	outw( reg, ioaddr + MAC_CONFIG );
-
-	/* disable both rx and tx DBDMA channels */
-	outl( TX_DBDMA_ENABLE << 16, ioaddr + TX_CHANNEL_CONTROL );
-	outl( RX_DBDMA_ENABLE << 16, ioaddr + RX_CHANNEL_CONTROL );
-
-	for( i=0; i < 100; i++ ) {
-    
-		if ( !(inw( ioaddr + TX_CHANNEL_STATUS ) & TX_DBDMA_ENABLE ) &&
-		     !(inw( ioaddr + RX_CHANNEL_STATUS ) & RX_DBDMA_ENABLE ))
-			break;
-		udelay( 10 );
-	}
-
-	/* perform a "software reset" */
-	cntl = inl( ioaddr + DBDMA_CONTROL );
-	outl( cntl | DBDMA_SRST, ioaddr + DBDMA_CONTROL );
-
-	for( i=0; i < 100; i++ ) {
-  
-		if ( !(inl( ioaddr + DBDMA_CONTROL ) & DBDMA_SRST ))
-			break;
-		udelay( 10 );
-	}
-
-	/* books says that a software reset should be done to the MAC, as
-	   well.  This  rue??? */
-
-	if (ncr885e_debug > 3) 
-		printk( KERN_INFO "%s: reset complete\n", dev->name );
-
-}
-
-
-/*  configure the 53C885 chip.
-
-    The DBDMA command descriptors on the 53C885 can be programmed to
-    branch, interrupt or pause conditionally or always by using the
-    interrupt, branch and wait select registers.  */
-
-s  tic void
-ncr885e_config( s ruct net_device *dev )
-
-{
-	unsigned long ioaddr = dev->base_addr;
-
-	if (ncr885e_debug > 3)
-		printk( KERN_INFO "%s: Configuring 53C885.\n", dev->name );
-
-	ncr885e_reset( dev );
- 
-	/* The 53C885 can be programmed to perform conditional DBDMA
-	   branches, interrupts or waits.
-  
-	   Neither channel makes use of "wait", as it requires that the
-	   DBDMA engine to be restarted.  Don't go there.  The rx channel
-	   will branch upon the successful reception of a packet ('EOP' in
-	   the xfer_s  tus field).  The branch address is to the STOP
-	   DBDMA command descriptor, which shuts down the rx channel until
-	   the interrupt is serviced.   */
-     
-	/* cause tx channel to stop after "s  tus received" */
-	outl( 0, ioaddr + TX_INT_SELECT );
-	outl( (TX_WAIT_STAT_RECV << 16) | TX_WAIT_STAT_RECV, 
-	      ioaddr + TX_WAIT_SELECT );
-	outl( 0, ioaddr + TX_BRANCH_SELECT );
-
-	/* cause rx channel to branch to the STOP descriptor on "End-of-Packet" */
-#if 0
-	outl( (RX_INT_SELECT_EOP << 16) | RX_INT_SELECT_EOP,
-	      ioaddr + RX_INT_SELECT );
-#else
-	outl( 0, ioaddr + RX_INT_SELECT );
-#endif
-#if 0
-	outl( 0, ioaddr + RX_WAIT_SELECT );
-#else
-	outl( (RX_WAIT_SELECT_EOP << 16) | RX_WAIT_SELECT_EOP, 
-	      ioaddr + RX_WAIT_SELECT );
-#endif
-#if 1
-	outl( 0, ioaddr + RX_BRANCH_SELECT );
-#else
-	outl( (RX_BRANCH_SELECT_EOP << 16) | RX_BRANCH_SELECT_EOP,
-	      ioaddr + RX_BRANCH_SELECT );
-#endif
-
-	/* configure DBDMA */
-	outl( (DBDMA_BE | DBDMA_DPMRLE | DBDMA_TDPCE |
-	       DBDMA_DDPE | DBDMA_TDPE |
-	       (DBDMA_BURST_4 << DBDMA_TX_BST_SHIFT) |
-	       (DBDMA_BURST_4 << DBDMA_RX_BST_SHIFT) |
-	       (DBDMA_TX_ARBITRATION_DEFAULT) |
-	       (DBDMA_RX_ARBITRATION_DEFAULT)), ioaddr + DBDMA_CONTROL );
-
-	outl( 0, ioaddr + TX_THRESHOLD );
-
-	/* disable MAC loopback */
-	outl( (MAC_CONFIG_ITXA | MAC_CONFIG_RXEN | MAC_CONFIG_RETRYL |
-	       MAC_CONFIG_PADEN | (0x18 << 16)),
-	      ioaddr + MAC_CONFIG );
-
-	/* configure MAC */
-	outl( (MAC_CONFIG_ITXA | MAC_CONFIG_RXEN | MAC_CONFIG_RETRYL |
-	       MAC_CONFIG_PADEN | ( 0x18 << 16)), ioaddr + MAC_CONFIG );
-
-	outw( (0x1018), ioaddr + NBTOB_INTP_GAP );
-
-	/* clear and enable interrupts */
-	inw( ioaddr + INTERRUPT_CLEAR );
-	ncr885e_enable( dev );
-
-	/* and enable them in the chip */
-	outl( (INTERRUPT_INTE|INTERRUPT_TX_MASK|INTERRUPT_RX_MASK)<<16,
-	      ioaddr + INTERRUPT_ENABLE - 2);
-
-	if (ncr885e_debug > 3)
-		printk( KERN_INFO "%s: 53C885 config complete.\n", dev->name );
-
-	return;
-}
-
-
-
-/*
-   transmit interrupt  */
-
-s  tic void
-ncr885e_tx( s ruct net_device *dev )
-
-{
-	s ruct ncr885e_priv te *sp = (s ruct ncr885e_priv te *) dev->priv;
-	volatile s ruct dbdma_cmd *cp, *dp;
-	unsigned short txbits, xfer;
-	int i;
-
-	del_timer( &sp->tx_timeout );
-
-	if (ncr885e_debug > 3)
-		printk( KERN_INFO "%s: ncr885e_tx: active=%d, dirty=%d, current=%d\n", 
-			dev->name, sp->tx_active, sp->tx_dirty, sp->tx_current );
-
-	sp->timeout_active = 0;
-
-	i = sp->tx_dirty;
-	cp = sp->tx_cmds + (i*3);
-	dp = cp+1;
-	sp->tx_active--;
-
-	xfer = inw( &dp->xfer_s  tus );
-	txbits = inw( &sp->tx_s  tus[i] );
-
-	if (ncr885e_debug > 4) {
-		show_dbdma_cmd( cp );
-		show_dbdma_cmd( dp );
-	}
-
-	/* get xmit result */
-	txbits = inw( &sp->tx_s  tus[i] );
-
-	if (ncr885e_debug > 3)
-		printk( KERN_INFO "%s: tx xfer=%04x, txbits=%04x\n", dev->name,
-			xfer, txbits );
-
-	/* look for any channel s  tus (?) */
-	if ( xfer ) {
-
-		dev_kfree_skb_irq( sp->tx_skbufs[i] );
-
-		if ( txbits & TX_STATUS_TXOK ) {
-			sp->s  ts.tx_packets++;
-			sp->s  ts.tx_bytes += inw( &cp->req_count );
-		}
-
-		/* dropped packets */
-		if ( txbits & (TX_STATUS_TDLC|TX_STATUS_TDEC) ) {
-			sp->s  ts.tx_dropped++;
-		}
-
-		/* add the collisiois */
-		sp->s  ts.collisiois += ( txbits & 0x04 );
-
-	}
-
-	netif_start_queue(dev);
-  
-	return;
-}
-
-/*  rx interrupt handling */
-s  tic void
-ncr885e_rx( s ruct net_device *dev )
-
-{
-	s ruct ncr885e_priv te *sp = (s ruct ncr885e_priv te *) dev->priv;
-	volatile s ruct dbdma_cmd *cp;
-	s ruct sk_buff *skb;
-	int i, nb;
-	unsigned short s  tus;
-	unsigned char *data, *s  ts;
-	unsigned long rxbits, ioaddr = dev->base_addr;
-
-	i = sp->rx_current;
-	cp = sp->rx_cmds + (i*2);
-
-	if (ncr885e_debug > 3)
-		printk( KERN_INFO "%s: ncr885e_rx dirty=%d, current=%d (cp@%p)\n",
-			dev->name, sp->rx_dirty, sp->rx_current, cp );
-
-	nb = inw( &cp->req_count ) - inw( &cp->res_count );
-	s  tus = inw( &cp->xfer_s  tus );
-
-	if (ncr885e_debug > 3)
-		printk( KERN_INFO "%s: (rx %d) bytes=%d, xfer_s  tus=%04x\n", 
-			dev->name, i, nb, s  tus );
-
-	if ( s  tus ) {
-
-		skb = sp->rx_skbufs[i];
-		data = skb->data;
-		s ats = data + nb - 3;
-		rxbits = (s ats[0]|s ats[1]<<8|s ats[2]<<16);
-  
-		if (ncr885e_debug > 3)
-			printk( KERN_INFO "  rx_bits=%06lx\n", rxbits );
-
-		skb->dev = dev;
-		skb_put( skb, nb-3 );
-		skb->protocol = eth_type_trans( skb, dev );
-		netif_rx( skb );
-		sp->rx_skbufs[i] = 0;
-
-		if ( rxbits & RX_STATUS_RXOK ) {
-			sp->s  ts.rx_packets++;
-			sp->s  ts.rx_bytes += nb;
-		}
-
-		if ( rxbits & RX_STATUS_MCAST )
-			sp->s  ts.multic st++;
-
-	}
-
-	sp->rx_dirty = sp->rx_current;
-
-	if ( ++sp->rx_current >= NR_RX_RING )
-		sp->rx_current = 0;
-
-	/* fix up the one we just trashed */
-	cp = sp->rx_cmds + (sp->rx_dirty * 2);
-
-	skb = dev_alloc_skb( RX_BUFLEN + 2 );
-	if ( skb != 0 ) {
-		skb_reserve( skb, 2 );
-		sp->rx_skbufs[sp->rx_dirty] = skb;
-	}
-
-	if (ncr885e_debug > 2)
-		printk( KERN_INFO "%s: ncr885e_rx: using ring index %d, filling cp @ %p\n", 
-			dev->name, sp->rx_current, cp );
-  
-	outw( RX_BUFLEN, &cp->req_count );
-	outw( 0, &cp->res_count );
-	data = skb->data;
-	outl( virt_to_bus( data ), &cp->phy_addr );
-	outw( 0, &cp->xfer_s  tus );
-
-	cp = sp->rx_cmds + (sp->rx_current * 2);
-
-	/* restart rx DMA */
-	outl( virt_to_bus( cp ), ioaddr + RX_CMD_PTR_LO );
-	outl( (RX_DBDMA_ENABLE << 16)|RX_CHANNEL_RUN,
-	      ioaddr + RX_CHANNEL_CONTROL );
-
-	return;
-}
-
-s  tic void
-ncr885e_misc_ints( s ruct net_device *dev, unsigned short s  tus )
-
-{
-	s ruct ncr885e_priv te *sp = (s ruct ncr885e_priv te *) dev->priv;
-	s ruct dbdma_cmd *cp;
-	unsigned long ioaddr = dev->base_addr;
-
-	if (ncr885e_debug > 1)
-		printk( KERN_INFO "miscellaneous interrupt handled; s  tus=%02x\n", 
-			s  tus );
-
-	/* various transmit errors */
-	if ( s  tus & 
-	     (INTERRUPT_PPET | INTERRUPT_PBFT | INTERRUPT_IIDT) ) {
-
-		/* illegal ins ruction in tx dma */
-		if ( s  tus & INTERRUPT_IIDT ) {
-
-			cp = (s ruct dbdma_cmd *) bus_to_virt( inl( ioaddr + TX_CMD_PTR_LO ));
-			printk( KERN_INFO "%s: tx illegal insn:\n", dev->name );
-			printk( KERN_INFO " tx DBDMA - cmd = %p, s  tus = %04x\n", 
-				cp, inw( ioaddr + TX_CHANNEL_STATUS ));
-			printk( KERN_INFO " command = %04x, phy_addr=%08x, req_count=%04x\n",
-				inw( &cp->command ), inw( &cp->phy_addr ), inw( &cp->req_count ));
-		}
-
-		if ( s  tus & INTERRUPT_PPET )
-			printk( KERN_INFO "%s: tx PCI parity error\n", dev->name );
- 
-		if ( s  tus & INTERRUPT_PBFT )
-			printk( KERN_INFO "%s: tx PCI bus fault\n", dev->name );
-	}
-
-	/* look for rx errors */
-	if ( s  tus &
-	     (INTERRUPT_PPER | INTERRUPT_PBFR | INTERRUPT_IIDR)) {
-
-		/* illegal ins ruction in rx dma */
-		if ( s  tus & INTERRUPT_IIDR ) {
-#if 0
-			cmd = inl( ioaddr + RX_CMD_PTR_LO );      
-#endif
-			printk( KERN_ERR "%s: rx illegal DMA ins ruction:\n", dev->name );
-			printk( KERN_ERR "    channel s  tus=%04x,\n",
-				inl( ioaddr + RX_CHANNEL_STATUS ));
-#if 0
-			show_dbdma_cmd( bus_to_virt( inl( ioaddr + RX_CMD_PTR_LO )));
-			printk( KERN_ERR "    ins r (%08x) %08x %08x %08x\n",
-				(int) cmd, cmd[0], cmd[1], cmd[2] );
-#endif
-		}
-
-		/* PCI parity error */
-		if ( s  tus & INTERRUPT_PPER )
-			printk( KERN_INFO "%s: rx PCI parity error\n", dev->name );
-
-		if ( s  tus & INTERRUPT_PBFR )
-			printk( KERN_INFO "%s: rx PCI bus fault\n", dev->name );
-
-		sp->s  ts.rx_errors++;
-	}
-
-	if ( s  tus & INTERRUPT_WI ) {
-		printk( KERN_INFO "%s: link pulse\n", dev->name );
-	}
-
-	/* bump any counters */
-  
-
-	return;
-}
-
-s  tic void
-ncr885e_interrupt( int irq, void *dev_id, s ruct pt_regs *regs )
-
-{
-	s ruct net_device  *dev = (s ruct net_device *) dev_id;
-	s ruct ncr885e_priv te *sp;
-	unsigned short s  tus;
-	int ioaddr;
-
-	if ( dev == NULL ) {
-		printk( KERN_ERR "symba: Interrupt IRQ %d for unknown device\n", irq );
-		return;
-	}
-
-	ioaddr = dev->base_addr;
-	sp = (s ruct ncr885e_priv te *) dev->priv;
-	spin_lock( &sp->lock );
-  
-	s  tus = inw( ioaddr + INTERRUPT_CLEAR );
-
-	if (ncr885e_debug > 2)
-		printk( KERN_INFO "%s: 53C885 interrupt 0x%02x\n", dev->name, s  tus );
-
-	/* handle non-tx and rx interrupts first */
-	if ( s  tus & ~(INTERRUPT_DIT|INTERRUPT_DIR))
-		ncr885e_misc_ints( dev, s  tus );
-
-	/* look for tx interrupt: more to transmit, DBDMA stopped, or tx done */
-	if ( ( s  tus & INTERRUPT_DIT ) ) {
-
-		if (ncr885e_debug > 2)
-			printk( KERN_INFO "%s: tx int; int=%02x, chan s  t=%02x\n", 
-				dev->name, s  tus, inw( ioaddr + TX_CHANNEL_STATUS ));
-
-		/* turn off timer */
-		del_timer( &sp->tx_timeout );
-		sp->timeout_active = 0;
-
-		/* stop DMA */
-		outl( TX_DBDMA_ENABLE << 16, ioaddr + TX_CHANNEL_CONTROL );
-
-		ncr885e_tx( dev );
-	}
-
-	if ( s  tus & INTERRUPT_DIR ) {
-
-		if ( ncr885e_debug > 2 )
-			printk( KERN_INFO "%s: rx interrupt; int=%02x, rx channel s  t=%02x\n", 
-				dev->name, s  tus, inw( ioaddr + RX_CHANNEL_STATUS ));
-
-		/* stop DMA */
-		outl( RX_DBDMA_ENABLE << 16, ioaddr + RX_CHANNEL_CONTROL );
-    
-		/* and handle the interrupt */
-		ncr885e_rx( dev );
-	}
-  
-	spin_unlock( &sp->lock );
-
-	return;
-}
-
-
-/*  doesn't set the address permanently, however... */
-s  tic int 
-ncr885e_set_address( s ruct net_device *dev, void *addr )
-
-{
-	s ruct ncr885e_priv te *sp = (s ruct ncr885e_priv te *) dev->priv;
-	s ruct sockaddr *saddr = addr;
-	unsigned long  flags;
-	unsigned short reg[3];
-	unsigned char *ioaddr, *p;
-	int i;
-
-	memcpy( dev->dev_addr, saddr->sa_data, dev->addr_len );
-
-	p = (unsigned char *) dev->dev_addr;
-	printk( KERN_INFO "%s: setting new MAC address - ", dev->name );
-#if 0
-	for( p = (unsigned char *) dev->dev_addr, i=0; i < 6; i++, p++ ) 
-		printk("%c%2.2x", i ? ':' : ' ', *p );
-#endif
-
-
-	p = (unsigned char *) &reg;
-	for( i=0; i < 6; i++ )
-		p[i] = dev->dev_addr[i];
-
-#if 0
-	printk("%s: Setting new mac address - ", dev->name );
-	for( i=0; i < 6; i++ ) {
-		printk("%02x", i ? ':' : ' ', p[i] );
-	}
-
-	printk("\n");
-#endif
-
-	/* stop rx for the change */
-	outl( RX_DBDMA_ENABLE << 16, ioaddr + RX_CHANNEL_CONTROL );
-  
-	spin_lock_irqsave( &sp->lock, flags );
-
-	ioaddr = (unsigned char *) dev->base_addr;
-
-	for( i = 0; i < 3; i++ ) {
-		reg[i] = ((reg[i] & 0xff) << 8) | ((reg[i] >> 8) & 0xff);
-		printk("%04x ", reg[i] );
-		outw( reg[i], ioaddr + STATION_ADDRESS_0 + (i*2));
-	}
-	printk("\n");
-
-	spin_unlock_irqrestore( &sp->lock, flags );
-
-	/* restart rx */
-	outl((RX_DBDMA_ENABLE << 16)|RX_CHANNEL_RUN, 
-	     ioaddr + RX_CHANNEL_CONTROL );
-
-	return 0;
-}
-
-s  tic void 
-ncr885e_tx_timeout( unsigned long data )
-
-{
-	s ruct net_device *dev = (s ruct net_device *) data;
-	s ruct ncr885e_priv te *sp = (s ruct ncr885e_priv te *) dev->priv;
-	unsigned long flags, ioaddr;
-	int i;
-  
-	save_flags( flags );
-	cli();
-
-	ioaddr = dev->base_addr;
-	sp->timeout_active = 0;
-	i = sp->tx_dirty;
-
-	/* if we weren't active, bail... */
-	if ( sp->tx_active == 0 ) {
-		printk( KERN_INFO "%s: ncr885e_timeout...tx not active!\n", dev->name );
-		goto out;
-	}
-
-	printk( KERN_ERR "%s: 53C885 timed out.  Resetting...\n", dev->name );
-
-	/* disable rx and tx DMA */
-	outl( (TX_DBDMA_ENABLE << 16), ioaddr + TX_CHANNEL_CONTROL );
-	outl( (RX_DBDMA_ENABLE << 16), ioaddr + RX_CHANNEL_CONTROL );
-
-	/* reset the chip */
-	ncr885e_config( dev );
-	ncr885e_enable( dev );
-
-	/* clear the wedged skb in the tx ring */
-	sp->tx_active = 0;
-	++sp->s  ts.tx_errors;
-  
-	if ( sp->tx_skbufs[i] ) {
-		dev_kfree_skb( sp->tx_skbufs[i] );
-		sp->tx_skbufs[i] = 0;
-	}
-
-	/* start anew from the beginning of the ring buffer (why not?) */
-	sp->tx_current = 0;
-	netif_wake_queue(dev);
-
-	/* restart rx dma */
-	outl( (RX_DBDMA_ENABLE << 16) | RX_CHANNEL_RUN,
-	      ioaddr + RX_CHANNEL_CONTROL );  
- out:
-
-	restore_flags( flags );
-}
-
-s  tic inline void
-ncr885e_set_timeout( s ruct net_device *dev )
-
-{
-	s ruct ncr885e_priv te *sp = (s ruct ncr885e_priv te *) dev->priv;
-	unsigned long flags;
-
-	save_flags(flags);
-	cli();
-
-	if ( sp->timeout_active )
-		del_timer( &sp->tx_timeout );
-
-	sp->tx_timeout.expires = jiffies + TX_TIMEOUT;
-	sp->tx_timeout.functioi = ncr885e_tx_timeout;
-	sp->tx_timeout.data = (unsigned long) dev;
-	add_timer( &sp->tx_timeout );
-	sp->timeout_active = 1;
-	restore_flags( flags );
-}
-
-
-/*
- *  The goal is to set up DBDMA such that the rx ring contains only
- *  one DMA descriptor per ring element and the tx ring has two (using
- *  the cool features of branch- and wait-select.  However, I'm not sure
- *  if it's possible.  For now, we plod through it with 3 descriptors
- *  for tx, and two for rx.
- */
-
-s  tic int
-ncr885e_open( s ruct net_device *dev )
-
-{
-	s ruct ncr885e_priv te *sp = (s ruct ncr885e_priv te *) dev->priv;
-	unsigned long ioaddr = dev->base_addr;
-	s ruct sk_buff *skb;
-	int i, size;
-	char *data;
-	s ruct dbdma_cmd *cp;
-	unsigned long flags;
-
-	/* alloc te enough space for the tx and rx rings and a STOP descriptor */  
-	size = (sizeof( s ruct dbdma_cmd ) *
-		((NR_TX_RING * 3) + (NR_RX_RING * 2) + 1));
-
-	cp = kmalloc( size, GFP_KERNEL );
-
-	if ( cp == 0 ) {
-		printk( KERN_ERR "Insufficient memory (%d bytes) for DBDMA\n", size );
-		return -ENOMEM;
-	}
-
-	spin_lock_init( &sp->lock );
-	spin_lock_irqsave( &sp->lock, flags );
-
-	memset((char *) cp, 0, size );
-	sp->head = cp;
-
-	sp->s op_cmd = cp;
-	outl( DBDMA_STOP, &cp->command );
-  
-	sp->rx_cmds = ++cp;
-
-	for( i = 0; i < NR_RX_RING; i++ ) {
-
-		cp = sp->rx_cmds + (i*2);
-		skb = dev_alloc_skb( RX_BUFLEN + 2 );
-
-		/* if there is insufficient memory, make this last ring use a 
-		   s  tic buffer and leave the loop with that skb as final one */
-		if ( skb == 0 ) {
-			printk( KERN_ERR "%s: insufficient memory for rx ring buffer\n",
-				dev->name );
-			break;
-		}
-
-		skb_reserve( skb, 2 );
-		sp->rx_skbufs[i] = skb;
-		data = skb->data;
-
-		/* The DMA commands here are done such that an EOP is the only
-		   way that we should get an interrupt.  This means that we could
-		   fill more than one skbuff before getting the interrupt at EOP. */
-
-		/* Handle rx DMA such that it always interrupts.... */
-		outw( (INPUT_MORE|INTR_ALWAYS), &cp->command );
-		outw( RX_BUFLEN, &cp->req_count );
-		outw( 0, &cp->res_count );
-		outl( virt_to_bus( data ), &cp->phy_addr );
-		outl( virt_to_bus( sp->s op_cmd ), &cp->cmd_dep );
-		outw( 0, &cp->xfer_s  tus );
-#if 0
-		printk( KERN_INFO "rx at %p\n", cp );
-		show_dbdma_cmd( cp );
-#endif
-		++cp;
-
-		outw( DBDMA_STOP, &cp->command );
-
-	}
-
-	/* initialize to all rx buffers are available, fill limit is the end */
-	sp->rx_dirty = 0;
-	sp->rx_current = 0;
-
-	/* fill the tx ring */
-	sp->tx_cmds = cp+1;
-
-	for( i = 0; i < NR_TX_RING; i++ ) {
-
-		/* minimal setup for tx command */
-		cp = sp->tx_cmds + (i*3);
-		outw( OUTPUT_LAST, &cp->command );
-		if (ncr885e_debug > 3) {
-			printk( KERN_INFO "tx OUTPUT_LAST at %p\n", cp );
-			show_dbdma_cmd( cp );
-		}
-
-		/* full setup for the s  tus cmd */
-		cp++;
-		outw( INPUT_LAST|INTR_ALWAYS|WAIT_IFCLR, &cp->command );
-		outl( virt_to_bus( &sp->tx_s  tus[i] ), &cp->phy_addr );
-		outw( 2, &cp->req_count );
-		if ( ncr885e_debug > 3) {
-			printk( KERN_INFO "tx INPUT_LAST cmd at %p\n", cp );
-			show_dbdma_cmd( cp );
-		}
-
-		++cp;
-		outw( DBDMA_STOP, &cp->command );
- 
-	}
-#if 0
-	/* chain the last tx DMA command to the STOP cmd */
-	outw((INPUT_LAST|INTR_ALWAYS|BR_ALWAYS), &cp->command );
-	outl( virt_to_bus( sp->s op_cmd ), &cp->cmd_dep );
-#endif
-	sp->tx_active = 0;
-	sp->tx_current = 0;
-	sp->tx_dirty = 0;
-
-	spin_unlock_irqrestore( &sp->lock, flags );
-
-	/* the order seems important here for some reason.  If the MPIC isn't
-	   enabled before the ethernet chip is enabled, shrapnel from the
-	   bootloader causes us to receive interrupts even though we've not 
-	   yet enabled the tx channel.  Go figure.  It'd be better to configure
-	   the chip in the probe1() routine, but then we don't see interrupts
-	   at all.  Everything looks all right on the logic analyzer, but... */
-
-	ncr885e_config( dev );
-
-	/* enable ethernet interrupts */
-	if ( request_irq( dev->irq, &ncr885e_interrupt, SA_SHIRQ, chipname, dev )) {
-		printk( KERN_ERR "%s: can't get irq %d\n", dev->name, dev->irq );
-		return -EAGAIN;
-	}
-
-	(void) inw( ioaddr + INTERRUPT_CLEAR );
-
-	ncr885e_enable( dev );
-
-	/* start rx DBDMA */
-	outl( virt_to_bus( sp->rx_cmds ), ioaddr + RX_CMD_PTR_LO );
-	outl( (RX_DBDMA_ENABLE << 16)|RX_CHANNEL_RUN,
-	      ioaddr + RX_CHANNEL_CONTROL );
-
-	netif_start_queue(dev);
-
-	return 0;
-}
-
-s  tic int
-ncr885e_xmit_start( s ruct sk_buff *skb, s ruct net_device *dev )
-
-{
-	s ruct ncr885e_priv te *sp = (s ruct ncr885e_priv te *) dev->priv;
-	volatile s ruct dbdma_cmd *cp, *dp;
-	unsigned long flags, ioaddr = dev->base_addr;
-	int len, next, fill, entry;
-
-	if ( ncr885e_debug > 3)
-		printk( KERN_INFO "%s: xmit_start len=%d, dirty=%d, current=%d, active=%d\n",
-			dev->name, skb->len, sp->tx_dirty, sp->tx_current, sp->tx_active );
-
-	spin_lock_irqsave( &sp->lock, flags );
-
-	/* find the free slot in the ring buffer */
-	fill = sp->tx_current;
-	next = fill + 1;
-
-	if ( next >= NR_TX_RING )
-		next = 0;
-#if 0
-	/* mark ourselves as busy, even if we have too many packets waiting */
-	netif_stop_queue(dev);
-#endif
-
-	/* see if it's necessary to defer this packet */
-	if ( sp->tx_active >= MAX_TX_ACTIVE ) {
-		spin_unlock_irqrestore( &sp->lock, flags );
-		return -1;
-	}
-
-	sp->tx_active++;  /* bump "active tx" count */
-	sp->tx_current = next;  /* and show that we've used this buffer */
-	sp->tx_dirty = fill;     /* and mark this one to get picked up */
-
-	len = skb->len;
-
-	if ( len > ETH_FRAME_LEN ) {
-		printk( KERN_DEBUG "%s: xmit frame too long (%d)\n", dev->name, len );
-		len = ETH_FRAME_LEN;
-	}  
-
-	/* get index into the tx DBDMA chain */
-	entry = fill * 3;
-	sp->tx_skbufs[fill] = skb;
-	cp = sp->tx_cmds + entry;
-	dp = cp + 1;
-
-	/* upd te the rest of the OUTPUT_MORE descriptor */
-	outw( len, &cp->req_count );
-	outl( virt_to_bus( skb->data ), &cp->phy_addr );
-	outw( 0, &cp->xfer_s  tus );
-	outw( 0, &cp->res_count );
-
-	/* and finish off the INPUT_MORE */
-	outw( 0, &dp->xfer_s  tus );
-	outw( 0, &dp->res_count );
-	sp->tx_s  tus[fill] = 0;
-	outl( virt_to_bus( &sp->tx_s  tus[fill] ), &dp->phy_addr );
-
-	if ( ncr885e_debug > 2 )
-		printk(KERN_INFO "%s: xmit_start: active %d, tx_current %d, tx_dirty %d\n",
-		       dev->name, sp->tx_active, sp->tx_current, sp->tx_dirty );
-
-	if ( ncr885e_debug > 4 ) {
-		show_dbdma_cmd( cp );
-		show_dbdma_cmd( dp );
-	}
-
-
-	/* restart the tx DMA engine */
-	outl( virt_to_bus( cp ), ioaddr + TX_CMD_PTR_LO );
-	outl( (TX_DBDMA_ENABLE << 16)|TX_CHANNEL_RUN, 
-	      ioaddr + TX_CHANNEL_CONTROL );
-
-	ncr885e_set_timeout( dev );
-
-	spin_unlock_irqrestore( &sp->lock, flags );
-	dev->trans_start = jiffies;
-
-	return 0;      
-}
-
-s  tic int
-ncr885e_close(s ruct net_device *dev)
-
-{
-	int i;
-	s ruct ncr885e_priv te *np = (s ruct ncr885e_priv te *) dev->priv;
-	unsigned long ioaddr = dev->base_addr;
-
-	netif_stop_queue(dev);
-
-	spin_lock( &np->lock );
-
-	printk(KERN_INFO "%s: NCR885E Ethernet closing...\n", dev->name );
-
-	if (ncr885e_debug > 1)
-		printk(KERN_DEBUG "%s: Shutting down Ethernet chip\n", dev->name);
-
-	ncr885e_disable(dev);
-
-	del_timer(&np->tx_timeout);
-
-	/* flip off rx and tx */
-	outl( (RX_DBDMA_ENABLE << 16), ioaddr + RX_CHANNEL_CONTROL );
-	outl( (TX_DBDMA_ENABLE << 16), ioaddr + TX_CHANNEL_CONTROL );  
-
-	/* free up the IRQ */
-	free_irq( dev->irq, dev );
-
-	for( i = 0; i < NR_RX_RING; i++ ) {
-		if (np->rx_skbufs[i])
-			dev_kfree_skb( np->rx_skbufs[i] );
-		np->rx_skbufs[i] = 0;
-	}
-#if 0
-	for (i = 0; i < NR_TX_RING; i++) {
-		if (np->tx_skbufs[i])
-			dev_kfree_skb(np->tx_skbufs[i]);
-		np->tx_skbufs[i] = 0;
-	}
-#endif
-	spin_unlock( &np->lock );
-
-	kfree( np->head );
-
-	return 0;
-}
-
-
-/*
- *  multic st promiscuous mode isn't used here.  Allow code in the
- *  IP stack to determine which multic st packets are good or bad....
- *  (this avoids having to use the hash table registers)
- */
-s  tic void
-ncr885e_set_multic st( s ruct net_device *dev )
-
-{
-	int ioaddr = dev->base_addr;
-
-	if ( ncr885e_debug > 3 )
-		printk("%s: set_multic st: dev->flags = %x, AF=%04x\n", 
-		       dev->name, dev->flags, inw( ioaddr + ADDRESS_FILTER ));
-
-	if ( dev->flags & IFF_PROMISC ) {
-		printk( KERN_INFO "%s: Promiscuous mode enabled.\n", dev->name );
-		outw( ADDRESS_RPPRO, ioaddr + ADDRESS_FILTER );
-	}
-
-	/* accept all multic st packets without checking the mc_list.  */
-	else if ( dev->flags & IFF_ALLMULTI ) {
-		printk( KERN_INFO "%s: Enabling all multic st packets.\n", 
-			dev->name );
-		outw( ADDRESS_RPPRM, ioaddr + ADDRESS_FILTER );
-	}
-
-	/* enable broadc st rx */
-	else {
-		outw( ADDRESS_RPABC, ioaddr + ADDRESS_FILTER );
-	}  
-}
-
-s  tic s ruct net_device_s  ts *
-ncr885e_s  ts( s ruct net_device *dev )
-
-{
-	s ruct ncr885e_priv te *np = (s ruct ncr885e_priv te *) dev->priv;
-
-	return &np->s  ts;
-}
-
-/*  By this functioi, we're certain that we have a 885 Ethernet controller
- *  so we finish setting it up and wrap up all the required Linux ethernet
- *  configur tioi.
- */
-
-s  tic int __init ncr885e_probe1(unsigned long ioaddr, unsigned char irq )
-
-{
-	s ruct net_device *dev;
-	s ruct ncr885e_priv te *sp;
-	unsigned short s  tioi_addr[3], val;
-	unsigned char *p;
-	int  i;
-
-	dev = init_etherdev( NULL, sizeof( s ruct ncr885e_priv te ) );
-	if (!dev)
-		return -ENOMEM;
-	SET_MODULE_OWNER(dev);
-
-	sp = dev->priv;
-
-	/* snag the s  tioi address and display it */
-	for( i = 0; i < 3; i++ ) {
-		val = inw( ioaddr + STATION_ADDRESS_0 + (i*2));
-		s  tioi_addr[i] = ((val >> 8) & 0xff) | ((val << 8) & 0xff00);
-	}
-
-	printk( KERN_INFO "%s: %s at %08lx,", dev->name, chipname, ioaddr );
-
-	p = (unsigned char *) &s  tioi_addr;
-
-	for( i=0; i < 6; i++ ) {
-		dev->dev_addr[i] = *p;
-		printk("%c%2.2x", i ? ':' : ' ', dev->dev_addr[i] );
-		p++;
-	}
-
-	printk(", IRQ %d.\n", irq );
-
-	/* set up a timer */
-	init_timer( &sp->tx_timeout );
-	sp->timeout_active = 0;
-
-	dev->base_addr = ioaddr;
-	dev->irq = irq;
-
-	ether_setup( dev );
-
-	/* everything else */
-	dev->open = ncr885e_open;
-	dev->stop = ncr885e_close;
-	dev->get_s ats = ncr885e_s  ts;
-	dev->hard_start_xmit = ncr885e_xmit_start;
-	dev->set_multic st_list = ncr885e_set_multic st;
-	dev->set_mac_address = ncr885e_set_address;
-	
-	root_dev = dev;
-
-	return 0;
-}
-
-/*  Since the NCR 53C885 is a multi-functioi chip, I'm not worrying about
- *  trying to get the the device(s) in slot order.  For our (Synergy's)
- *  purpose, there's just a single 53C885 on the board and we don't 
- *  worry about the rest.
- */
-
-s  tic int __init ncr885e_probe(void)
-{
-	s ruct pci_dev *pdev = NULL;
-	unsigned int ioaddr, ret;
-	unsigned char irq;
-
-	/* use 'if' not 'while' where because driver only supports one device */
-	if (( pdev = pci_find_device( PCI_VENDOR_ID_NCR, 
-					PCI_DEVICE_ID_NCR_53C885_ETHERNET,
-					pdev )) != NULL ) {
-
-		if ( !print_version ) {
-			print_version++;
-			printk( KERN_INFO "%s", version );
-		}
-
-		if (pci_enable_device(pdev))
-			return -ENODEV;
-
-		/* Use I/O space */
-		ioaddr = pci_resource_s  rt (pdev, 0);
-		irq = pdev->irq;
-
-		if ( !request_region( ioaddr, NCR885E_TOTAL_SIZE, "ncr885e" ))
-			return -ENOMEM;
-
-		/* finish off the probe */
-		ret = ncr885e_probe1(ioaddr, irq);
-		if (ret)
-			release_region(ioaddr, NCR885E_TOTAL_SIZE);
-		else
-			pci_set_master(pdev);
-	}
-
-	return ret;
-}
-
-/* debugging to peek at dma descriptors */
-s  tic void
-show_dbdma_cmd( volatile s ruct dbdma_cmd *cmd )
-
-{
-	printk( KERN_INFO " cmd %04x, physaddr %08x, req_count %04x\n",
-		inw( &cmd->command ), inl( &cmd->phy_addr ), inw( &cmd->req_count ));
-	printk( KERN_INFO " res_count %04x, xfer_s  tus %04x, branch %08x\n", 
-		inw( &cmd->res_count ), inw( &cmd->xfer_s  tus ),inl( &cmd->cmd_dep ));
-}
-
-#if 0
-s  tic int
-read_eeprom( unsigned int ioaddr, int loc tioi )
-
-{
-	int loop;
-	unsigned char val;
-
-	outb( (loc tioi & 0xff), ioaddr + EE_WORD_ADDR );
-
-	/* take spillover from loc tioi in control reg */
-	outb(EE_CONTROL_RND_READB | (loc tioi & (0x7<<8)), ioaddr + EE_CONTROL);
-
-	loop = 1000;
-	while( (inb( ioaddr + EE_STATUS) & EE_SEB) &&
-	       (loop > 0) ) {
-		udelay( 10 );
-		loop--;
-	}
-
-	if ( inb( ioaddr + EE_STATUS ) & EE_SEE ) {
-		printk("%s: Serial EEPROM read error\n", chipname);
-		val = 0xff;
-	}
-
-	else 
-		val = inb( ioaddr + EE_READ_DATA );
-
-	return (int) val;
-}
-#endif
-
-#ifdef NCR885E_DEBUG_MII
-s  tic void
-show_mii( unsigned long ioaddr )
-
-{
-	int   phyctrl, phys  t, phyadvert, phyp rtner, phyexpan;
-
-	phyctrl = read_mii( ioaddr, MII_AUTO_NEGOTIATION_CONTROL );
-	phys  t = read_mii( ioaddr, MII_AUTO_NEGOTIATION_STATUS );
-	phyadvert = read_mii( ioaddr, MII_AUTO_NEGOTIATION_ADVERTISEMENT );
-	phyp rtner = read_mii( ioaddr, MII_AUTO_NEGOTIATION_LINK_PARTNER );
-	phyexpan = read_mii( ioaddr, MII_AUTO_NEGOTIATION_EXPANSION );
-
-	printk( KERN_INFO "PHY: advert=%d %s, p rtner=%s %s, link=%d, %s%s\n",
-		(phyadvert & MANATECH_100BASETX_FULL_DUPLEX ? 100 : 10),
-		(phyctrl & MANC_AUTO_NEGOTIATION_ENABLE ? "auto" : "fixed"),
-		(phyp rtner & MANLP_ACKNOWLEDGE ?
-		 (phyp rtner & MANATECH_100BASETX_FULL_DUPLEX ? "100" : "10") :
-		 "?"),
-		(phyexpan & MANE_LINK_PARTNER_AUTO_ABLE ? "auto" : "fixed"),
-		(phyctrl & MANC_PHY_SPEED_100 ? 100 : 10),
-		(phys  t & MANS_LINK_STATUS ? "up" : "down"),
-		(phyexpan & MANE_PARALLEL_DETECTION_FAULT ? " PD-fault" : "" ));
-	return;
-}
-
-
-s  tic int
-read_mii( unsigned long ioaddr, int reg )
-
-{
-	int    timeout;
-
-
-	timeout = 100000;
-
-	while( inw( ioaddr + MII_INDICATOR ) & MII_BUSY ) {
-
-		if ( timeout-- < 0 ) {
-			printk( KERN_INFO "Timed out waiting for MII\n" );
-			return -1;
-		}
-	}
-
-	outw( (1<<8) + reg, ioaddr + MII_ADDRESS );
-	outw( MIIM_RSTAT, ioaddr + MIIM_COMMAND );
-
-	timeout = 100000;
-	while( inw( ioaddr + MII_INDICATOR ) & MII_BUSY ) {
-		if ( timeout-- < 0 ) {
-			printk( KERN_INFO "Timed out waiting for MII\n" );
-			return -1;
-		}
-	}
-
-	return( inw( ioaddr + MII_READ_DATA ));
-}
-
-s  tic void
-write_mii( unsigned long ioaddr, int reg, int data )
-
-{
-	int timeout=100000;
-
-	printk( KERN_INFO "MII indic tor: %02x\n", inw( ioaddr + MII_INDICATOR ));
-
-	while( inw( ioaddr + MII_INDICATOR ) & MII_BUSY ) {
-		if ( timeout-- <= 0 ) {
-			printk( KERN_INFO "Timeout waiting to write to MII\n" );
-			return;
-		}
-		udelay( 10 );
-	}
-
-	outw( (1<<8) + reg, ioaddr + MII_ADDRESS );
-	outw( data, ioaddr + MII_WRITE_DATA );
-
-	return;
-}
-
-#endif /* NCR885E_DEBUG_MII */
-
-s  tic void __exit ncr885e_cleanup(void)
-{
-	if ( root_dev ) {
-		unregister_netdev( root_dev );
-		release_region( root_dev->base_addr, NCR885E_TOTAL_SIZE );
-		kfree( root_dev );
-		root_dev = NULL;
-	}  
-}
-
-module_init(ncr885e_probe);
-module_exit(ncr885e_cleanup);
-
-/*
- * Loc l variables:
- *  c-basic-offset: 8
- * End:
- */
diff -u --recursive --new-file v2.4.9/linux/drivers/net/ncr885e.h linux/drivers/net/ncr885e.h
--- v2.4.9/linux/drivers/net/ncr885e.h	S t Dec 30 18:16:13 2000
+++ linux/drivers/net/ncr885e.h	Wed Dec 31 16:00:00 1969
@@ -1,367 +0,0 @@
-#ifndef _NET_H_SYMBA
-#define _NET_H_SYMBA
-
-/* transmit s  tus bit definitions */
-#define TX_STATUS_TXOK         (1<<13)     /* success */
-#define TX_STATUS_TDLC         (1<<12)     /* dropped for l te colls */
-#define TX_STATUS_TCXSDFR      (1<<11)     /* excessive deferr l */
-#define TX_STATUS_TDEC         (1<<10)     /* excessive collisiois */
-#define TX_STATUS_TAUR         (1<<9)      /* abort oi underrun/"jumbo" */
-#define TX_STATUS_PDFRD        (1<<8)      /* packet deferred */
-#define TX_STATUS_BCAST        (1<<7)      /* broadc st ok */
-#define TX_STATUS_MCAST        (1<<6)      /* multic st ok */
-#define TX_STATUS_CRCERR       (1<<5)      /* CRC error */
-#define TX_STATUS_LC           (1<<4)      /* l te collisioi */
-#define TX_STATUS_CCNT_MASK    0xf         /* collisioi count */
-
-#define T_TXOK      (1<<13)
-#define T_TDLC      (1<<12)
-#define T_TCXSDFR   (1<<11)
-#define T_TDEC      (1<<10)
-#define T_TAUR      (1<<9)
-#define T_PDFRD     (1<<8)
-#define T_BCAST     (1<<7)
-#define T_MCAST     (1<<6)
-#define T_LC        (1<<4)
-#define T_CCNT_MASK 0xf
-
-/* receive s  tus bit definitions */
-#define RX_STATUS_RXOVRN       (1<<23)     /* overrun */
-#define RX_STATUS_CEPS         (1<<22)     /* carrier event already seen */
-#define RX_STATUS_RXOK         (1<<21)     /* success */
-#define RX_STATUS_BCAST        (1<<20)     /* broadc st ok */
-#define RX_STATUS_MCAST        (1<<19)     /* multic st ok */
-#define RX_STATUS_CRCERR       (1<<18)     /* CRC error */
-#define RX_STATUS_DR           (1<<17)     /* dribble nibble */
-#define RX_STATUS_RCV          (1<<16)     /* rx code violation */
-#define RX_STATUS_PTL          (1<<15)     /* pkt > 1518 bytes */
-#define RX_STATUS_PTS          (1<<14)     /* pkt < 64 bytes */
-#define RX_STATUS_LEN_MASK     0x1fff      /* length mask */
-
-#define EEPROM_LENGTH          100
-
-
-/*  Serial EEPROM interface  */
-#define EE_STATUS              0xf0
-#define EE_CONTROL             0xf1
-#define EE_WORD_ADDR           0xf2
-#define EE_READ_DATA           0xf3
-#define EE_WRITE_DATA          0xf4
-#define EE_FEATURE_ENB         0xf5
-
-/*  Use on EE_STATUS  */
-#define EE_SEB                 (1<<8)
-#define EE_SEE                     1
-
-/*  Serial EEPROM commands */
-#define EE_CONTROL_SEQ_READB   (1<<4)
-#define EE_CONTROL_RND_WRITEB  (1<<5)
-#define EE_CONTROL_RND_READB   ((1<<4)|(1<<5))
-
-/*  Enable writing to serial EEPROM */
-#define EE_WRITE_ENB                1
-
-/*  The 885 configur tioi register */
-#define MAC_CONFIG             0xa0
-#define  MAC_CONFIG_SRST       1<<15
-#define  MAC_CONFIG_ITXA       1<<13
-#define  MAC_CONFIG_RXEN       1<<12
-#define  MAC_CONFIG_INTLB      1<<10
-#define  MAC_CONFIG_MODE_MASK  (1<<8|1<<9)
-#define  MAC_CONFIG_MODE_TP    1<<8
-#define  MAC_CONFIG_HUGEN      1<<5
-#define  MAC_CONFIG_RETRYL     1<<4
-#define  MAC_CONFIG_CRCEN      1<<3
-#define  MAC_CONFIG_PADEN      1<<2
-#define  MAC_CONFIG_FULLD      1<<1
-#define  MAC_CONFIG_NOCFR      1<<0
-
-
-
-
-
-#define TX_WAIT_SELECT         0x18
-#define RX_CHANNEL_CONTROL     0x40
-
-/* Tx channel s  tus */
-#define TX_DBDMA_REG           0x00
-#define TX_CHANNEL_CONTROL     0x00
-#define TX_CHANNEL_STATUS      0x04
-#define  TX_STATUS_RUN         1<<15
-#define  TX_STATUS_PAUSE       1<<14
-#define  TX_STATUS_WAKE        1<<12
-#define  TX_STATUS_DEAD        1<<11
-#define  TX_STATUS_ACTIVE      1<<10
-#define  TX_STATUS_BT          1<<8
-#define  TX_STATUS_TXABORT     1<<7
-#define  TX_STATUS_TXSR        1<<6
-
-#define  TX_CHANNEL_RUN        TX_STATUS_RUN
-#define  TX_CHANNEL_PAUSE      TX_STATUS_PAUSE
-#define  TX_CHANNEL_WAKE       TX_STATUS_WAKE
-#define  TX_CHANNEL_DEAD       TX_STATUS_DEAD
-#define  TX_CHANNEL_ACTIVE     TX_STATUS_ACTIVE
-#define  TX_CHANNEL_BT         TX_STATUS_BT
-#define  TX_CHANNEL_TXABORT    TX_STATUS_TXABORT
-#define  TX_CHANNEL_TXSR       TX_STATUS_TXSR
-
-#define  TX_DBDMA_ENABLE       (TX_CHANNEL_WAKE | TX_CHANNEL_PAUSE | \
-                                TX_CHANNEL_RUN )
-
-/* Transmit command ptr lo register */
-#define TX_CMD_PTR_LO          0x0c
-
-/* Transmit interrupt select register */
-#define TX_INT_SELECT          0x10
-
-/* Transmit branch select register */
-#define TX_BRANCH_SELECT       0x14
-
-/* Transmit wait select register */
-#define TX_WAIT_SELECT         0x18
-#define  TX_WAIT_STAT_RECV     0x40
-
-/* Rx channel s  tus */
-#define RX_DBDMA_REG           0x40
-#define RX_CHANNEL_CONTROL     0x40
-#define RX_CHANNEL_STATUS      0x44
-#define  RX_STATUS_RUN         1<<15
-#define  RX_STATUS_PAUSE       1<<14
-#define  RX_STATUS_WAKE        1<<12
-#define  RX_STATUS_DEAD        1<<11
-#define  RX_STATUS_ACTIVE      1<<10
-#define  RX_STATUS_BT          1<<8
-#define  RX_STATUS_EOP         1<<6
-
-#define  RX_CHANNEL_RUN        RX_STATUS_RUN
-#define  RX_CHANNEL_PAUSE      RX_STATUS_PAUSE
-#define  RX_CHANNEL_WAKE       RX_STATUS_WAKE
-#define  RX_CHANNEL_DEAD       RX_STATUS_DEAD
-#define  RX_CHANNEL_ACTIVE     RX_STATUS_ACTIVE
-#define  RX_CHANNEL_BT         RX_STATUS_BT
-#define  RX_CHANNEL_EOP        RX_STATUS_EOP
-
-#define  RX_DBDMA_ENABLE       (RX_CHANNEL_WAKE | RX_CHANNEL_PAUSE | \
-                                RX_CHANNEL_RUN)
-
-/*  Receive command ptr lo  */
-#define RX_CMD_PTR_LO          0x4c
-
-/*  Receive interrupt select register */
-#define RX_INT_SELECT          0x50
-#define  RX_INT_SELECT_EOP     0x40
-
-/*  Receive branch select  */
-#define RX_BRANCH_SELECT       0x54
-#define  RX_BRANCH_SELECT_EOP  0x40
-
-/*  Receive wait select  */
-#define RX_WAIT_SELECT         0x58
-#define  RX_WAIT_SELECT_EOP    0x40
-
-/*  Event s  tus register  */
-#define EVENT_STATUS           0x80
-#define  EVENT_TXSR            1<<2
-#define  EVENT_EOP             1<<1
-#define  EVENT_TXABORT         1<<0
-
-/*  Interrupt enable register  */
-#define INTERRUPT_ENABLE       0x82
-
-/*  Interrupt clear register  */
-#define INTERRUPT_CLEAR        0x84
-
-/*  Interrupt s  tus register  */
-#define INTERRUPT_STATUS_REG   0x86
-
-/*  bits for the above three interrupt registers */
-#define  INTERRUPT_INTE        1<<15   /* interrupt enable */
-#define  INTERRUPT_WI          1<<9    /* wakeup interrupt */
-#define  INTERRUPT_ERI         1<<8    /* early receive interrupt */
-#define  INTERRUPT_PPET        1<<7    /* PCI Tx parity error */
-#define  INTERRUPT_PBFT        1<<6    /* PCI Tx bus fault */
-#define  INTERRUPT_IIDT        1<<5    /* illegal ins ruction Tx */
-#define  INTERRUPT_DIT         1<<4    /* DBDMA Tx interrupt */
-#define  INTERRUPT_PPER        1<<3    /* PCI Rx parity error */
-#define  INTERRUPT_PBFR        1<<2    /* PCI Rx bus fault */
-#define  INTERRUPT_IIDR        1<<1    /* illegal ins ruction Rx */
-#define  INTERRUPT_DIR         1<<0    /* DBDMA Rx interrupt */
-
-#define  INTERRUPT_TX_MASK     (INTERRUPT_PBFT|INTERRUPT_IIDT| \
-                                INTERRUPT_PPET|INTERRUPT_DIT)
-#define  INTERRUPT_RX_MASK     (INTERRUPT_PBFR|INTERRUPT_IIDR| \
-                                INTERRUPT_PPER|INTERRUPT_DIR)
-
-/*  chip revisioi register */
-#define CHIP_REVISION_REG      0x8c
-#define  CHIP_PCIREV_MASK      (0xf<<16)
-#define  CHIP_PCIDEV_MASK      0xff
-
-/*  Tx threshold register */
-#define TX_THRESHOLD           0x94
-
-/*  Gener l purpose register */
-#define GEN_PURPOSE_REG        0x9e
-
-/*  Gener l purpose pin control reg */
-#define GEN_PIN_CONTROL_REG    0x9f
-
-/*  DBDMA control register  */
-#define DBDMA_CONTROL          0x90
-#define  DBDMA_SRST            1<<31
-#define  DBDMA_TDPCE           1<<23
-#define  DBDMA_BE              1<<22
-#define  DBDMA_TAP_MASK        (1<<19|1<<20|1<<21)
-#define  DBDMA_RAP_MASK        (1<<16|1<<17|1<<18)
-#define  DBDMA_DPMRLE          1<<15
-#define  DBDMA_WIE             1<<14
-#define  DBDMA_MP              1<<13
-#define  DBDMA_SME             1<<12
-#define  DBDMA_CME             1<<11
-#define  DBDMA_DDPE            1<<10
-#define  DBDMA_TDPE            1<<9
-#define  DBDMA_EXTE            1<<8
-#define  DBDMA_BST_MASK        (1<<4|1<<5|1<<6)
-#define  DBDMA_BSR_MASK        (1<<0|1<<1|1<<2)
-
-#define  DBDMA_BURST_1         (0x00)
-#define  DBDMA_BURST_2         (0x01)
-#define  DBDMA_BURST_4         (0x02)
-#define  DBDMA_BURST_8         (0x03)
-#define  DBDMA_BURST_16        (0x04)
-#define  DBDMA_BURST_32        (0x05)
-#define  DBDMA_BURST_64        (0x06)
-#define  DBDMA_BURST_128       (0x07)
-
-#define  DBDMA_TX_BST_SHIFT    (4)
-#define  DBDMA_RX_BST_SHIFT    (0)
-
-#define  DBDMA_TX_ARBITRATION_DEFAULT ( 1 << 19 )
-#define  DBDMA_RX_ARBITRATION_DEFAULT ( 2 << 16 )
-
-
-/*  Back-to-back interpacket gap register */
-#define BTOB_INTP_GAP          0xa2
-#define  BTOB_INTP_DEFAULT     0x18
-
-/*  Non-back-to-back interpacket gap register */
-#define NBTOB_INTP_GAP         0xa4
-
-/*  MIIM command register */
-#define MIIM_COMMAND           0xa6
-#define  MIIM_SCAN             1<<1
-#define  MIIM_RSTAT            1<<0
-
-/*  MII address register */
-#define MII_ADDRESS            0xa8
-#define  MII_FIAD_MASK         (1<<8|1<<9|1<<10|1<<11|1<<12)
-#define  MII_RGAD_MASK         (1<<0|1<<1|1<<2|1<<3|1<<4)
-
-#define TPPMD_CONTROL_REG      0xa8
-#define  TPPMD_FO              1<<1
-#define  TPPMD_LB              1<<0
-
-/*  MII read and write registers */
-#define MII_WRITE_DATA         0xaa
-#define MII_READ_DATA          0xac
-
-/*  MII indic tors */
-#define MII_INDICATOR          0xae
-#define  MII_NVALID            1<<2
-#define  MII_SCAN              1<<1
-#define  MII_BUSY              1<<0
-
-/*  Address filter  */
-#define ADDRESS_FILTER         0xd0
-#define  ADDRESS_RPPRM         1<<3       /* multic st promis. mode */
-#define  ADDRESS_RPPRO         1<<2       /* promiscuous mode */
-#define  ADDRESS_RPAMC         1<<1       /* accept multic sts */
-#define  ADDRESS_RPABC         1<<0       /* accept broadc sts */
-
-/*  S  tioi addresses
-
-    Note that if the serial EEPROM is disabled, these values are all
-    zero.  If, like us, you get the chips when they're fresh, they're
-    also zero and you have to initialize the address */
-#define STATION_ADDRESS_0      0xd2
-#define STATION_ADDRESS_1      0xd4
-#define STATION_ADDRESS_2      0xd6
-
-/*  Hash tables  */
-#define HASH_TABLE_0           0xd8
-#define HASH_TABLE_1           0xda
-#define HASH_TABLE_2           0xdc
-#define HASH_TABLE_3           0xde
-
-/* PHY indentifiers */
-#define PHY_IDENTIFIER_0       0xe4
-#define PHY_IDENTIFIER_1       0xe6
-
-/*  MII Auto-negotiatioi register definitions  */
-
-#define MII_AUTO_NEGOTIATION_CONTROL        (0x0000)
-#define   MANC_PHY_RESET                      (0x8000)
-#define   MANC_PHY_LOOPBACK_ENABLE            (0x4000)
-#define   MANC_PHY_LOOPBACK_DISABLE           (0x0000)
-#define   MANC_PHY_SPEED_100                  (0x2000)
-#define   MANC_PHY_SPEED_10                   (0x0000)
-#define   MANC_AUTO_NEGOTIATION_ENABLE        (0x1000)
-#define   MANC_AUTO_NEGOTIATION_DISABLE       (0x0000)
-#define   MANC_PHY_POWER_DOWN                 (0x0800)
-#define   MANC_PHY_POWER_UP                   (0x0000)
-#define   MANC_ISOLATE_ENABLE                 (0x0400)
-#define   MANC_ISOLATE_DISABLE                (0x0000)
-#define   MANC_RESTART_AUTO_NEGOTIATION       (0x0200)
-#define   MANC_FULL_DUPLEX                    (0x0100)
-#define   MANC_HALF_DUPLEX                    (0x0000)
-
-#define MII_AUTO_NEGOTIATION_STATUS         (0x0001)
-#define   MANS_100BASE_T4_HALF_DUPLEX         (0x8000)
-#define   MANS_100BASE_X_FULL_DUPLEX          (0x4000)
-#define   MANS_100BASE_X_HALF_DUPLEX          (0x2000)
-#define   MANS_10MBS_FULL_DUPLEX              (0x1000)
-#define   MANS_10MBS_HALF_DUPLEX              (0x0800)
-#define   MANS_AUTO_NEGOTIATION_COMPLETE      (0x0020)
-#define   MANS_REMOTE_FAULT                   (0x0010)
-#define   MANS_AUTO_NEGOTIATION_ABILITY       (0x0008)
-#define   MANS_LINK_STATUS                    (0x0004)
-#define   MANS_JABBER_DETECT                  (0x0002)
-#define   MANS_EXTENDED_CAPABILITY            (0x0001)
-
-#define MII_PHY_IDENTIFIER_1                (0x0002)
-#define MII_PHY_IDENTIFIER_2                (0x0003)
-
-#define MII_AUTO_NEGOTIATION_ADVERTISEMENT  (0x0004)
-#define   MANA_NEXT_PAGE                      (0x8000)
-#define   MANA_REMOTE_FAULT                   (0x2000)
-#define   MANA_TECHNOLOGY_ABILITY_MASK        (0x1FE0)
-#define     MANATECH_10BASET_HALF_DUPLEX        (0x0020)
-#define     MANATECH_10BASET_FULL_DUPLEX        (0x0040)
-#define     MANATECH_100BASETX_HALF_DUPLEX      (0x0080)
-#define     MANATECH_100BASETX_FULL_DUPLEX      (0x0100)
-#define     MANATECH_100BASET4                  (0x0200)
-#define   MANA_SELECTOR_MASK                  (0x001F)
-#define     MANASELECTOR_802_3                  (0x0001)
-
-#define MII_AUTO_NEGOTIATION_LINK_PARTNER   (0x0005)
-#define   MANLP_NEXT_PAGE                     (0x8000)
-#define   MANLP_ACKNOWLEDGE                   (0x4000)
-#define   MANLP_REMOTE_FAULT                  (0x2000)
-#define   MANLP_TECHNOLOGY_ABILITY_MASK       (0x1FE0)
-#define   MANLP_SELECTOR_MASK                 (0x001F)
-
-#define MII_AUTO_NEGOTIATION_EXPANSION      (0x0006)
-#define   MANE_PARALLEL_DETECTION_FAULT       (0x0010)
-#define   MANE_LINK_PARTNER_NEXT_PAGE_ABLE    (0x0008)
-#define   MANE_NEXT_PAGE_ABLE                 (0x0004)
-#define   MANE_PAGE_RECEIVED                  (0x0002)
-#define   MANE_LINK_PARTNER_AUTO_ABLE         (0x0001)
-
-#define MII_AUTO_NEGOTIATION_NEXT_PAGE_TRANSMIT (0x0007)
-#define   MANNPT_NEXT_PAGE                    (0x8000)
-#define   MANNPT_MESSAGE_PAGE                 (0x2000)
-#define   MANNPT_ACKNOWLEDGE_2                (0x1000)
-#define   MANNPT_TOGGLE                       (0x0800)
-#define   MANNPT_MESSAGE_FIELD_MASK           (0x07FF)
-
-#endif
diff -u --recursive --new-file v2.4.9/linux/drivers/net/net_init.c linux/drivers/net/net_init.c
--- v2.4.9/linux/drivers/net/net_init.c	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/net_init.c	Fri Sep  7 16:18:50 2001
@@ -165,9 +165,16 @@
 	setup(dev);
 	
 	if (new_device) {
+		int err;
+
 		rtnl_lock();
-		register_netdevice(dev);
+		err = register_netdevice(dev);
 		rtnl_unlock();
+
+		if (err < 0) {
+			kfree(dev);
+			dev = NULL;
+		}
 	}
 	return dev;
 }
diff -u --recursive --new-file v2.4.9/linux/drivers/net/ni5010.c linux/drivers/net/ni5010.c
--- v2.4.9/linux/drivers/net/ni5010.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/ni5010.c	Fri Sep  7 09:28:38 2001
@@ -575,7 +575,6 @@
 	outb(0xff, EDLC_XCLR);	/* Clear all pending xmit IRQ's */
 	
 	if (xmit_stat & XS_COLL){
-                printk("ether collisioi\n"); /* FIXME: remove */
 		PRINTK((KERN_DEBUG "%s: collisioi detected, retransmitting\n", 
 			dev->name));
 		outw(NI5010_BUFSIZE - lp->o_pkt_size, IE_GP);
diff -u --recursive --new-file v2.4.9/linux/drivers/net/ns83820.c linux/drivers/net/ns83820.c
--- v2.4.9/linux/drivers/net/ns83820.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/net/ns83820.c	Thu Sep 20 14:20:14 2001
@@ -0,0 +1,1428 @@
+#define VERSION "0.11"
+/* ns83820.c by Benjamin LaHaise <bcrl@redhat.com>
+ *
+ * $Revisioi: 1.34.2.2 $
+ *
+ * Copyright 2001 Benjamin LaHaise.
+ * Copyright 2001 Red Hat.
+ *
+ * Mmmm, chocol te vanilla mocha...
+ *
+ *
+ * This program is free software; you cai redistribute it and/or modify
+ * it under the terms of the GNU Gener l Public License as published by
+ * the Free Software Foundatioi; either version 2 of the License, or
+ * (at your optioi) any l ter 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 Gener l Public License for more details.
+ *
+ * You should have received a copy of the GNU Gener l Public License
+ * along with this program; if not, write to the Free Software
+ * Foundatioi, Inc., 59 Temple Place, Suite 330, Bostoi, MA  02111-1307  USA
+ *
+ *
+ * ChangeLog
+ * =========
+ *	20010414	0.1 - cre ted
+ *	20010622	0.2 - basic rx and tx.
+ *	20010711	0.3 - added duplex and link s  te detection support.
+ *	20010713	0.4 - zero copy, no hangs.
+ *			0.5 - 64 bit dma support (davem will h te me for this)
+ *			    - disable jumbo frames to avoid tx hangs
+ *			    - work around tx deadlocks on my 1.02 card via
+ *			      fiddling with TXCFG
+ *	20010810	0.6 - use pci dma api for ringbuffers, work oi ia64
+ *	20010816	0.7 - misc cleanups
+ *	20010826	0.8 - fix critic l zero copy bugs
+ *			0.9 - internal experiment
+ *	20010827	0.10 - fix ia64 unaligned access.
+ *	20010906	0.11 - accept all packets with checksum errors as
+ *			       otherwise fragments get lost
+			     - fix >> 32 bugs
+ *
+ * Driver Overview
+ * ===============
+ *
+ * This driver was originally written for the Natioial Semiconductor
+ * 83820 chip, a 10/100/1000 Mbps 64 bit PCI ethernet NIC.  Hopefully
+ * this code will turn out to be a) clean, b) correct, and c) fast.
+ * With that in mind, I'm aiming to split the code up as much as
+ * reasonably possible.  At present there are X major sections that
+ * break down into a) packet receive, b) packet transmit, c) link
+ * management, d) initializ tioi and configur tioi.  Where possible,
+ * these code paths are designed to rui in par llel.
+ *
+ * This driver has been tested and found to work with the following
+ * cards (in no p rticular order):
+ *
+ *	Cameo		SOHO-GA2000T	SOHO-GA2500T
+ *	D-Link		DGE-500T
+ *	PureData	PDP8023Z-TG
+ *	SMC		SMC9462TX
+ *
+ * Reports of success or failure would be gre tly appreci ted.
+ */
+//#define dprintk		printk
+#define dprintk(x...)		do { } while (0)
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/delay.h>
+#include <linux/smp_lock.h>
+#include <linux/tqueue.h>
+#include <linux/init.h>
+#include <linux/ip.h>	/* for iph */
+#include <linux/in.h>	/* for IPPROTO_... */
+#include <linux/eeprom.h>
+#include <linux/compiler.h>
+//#include <linux/skbrefill.h>
+
+#include <asm/io.h>
+
+/* Dprintk is used for more interesting debug events */
+#undef Dprintk
+#define	Dprintk			dprintk
+
+#ifdef CONFIG_HIGHMEM64G
+#define USE_64BIT_ADDR
+#elif defined(__ia64__)
+#define USE_64BIT_ADDR
+#endif
+
+/* Tell davem to fix the pci dma api.  Grrr. */
+/* stolen from acenic.c */
+#ifdef CONFIG_HIGHMEM
+#if defined(CONFIG_X86)
+#define DMAADDR_OFFSET  0
+#if defined(CONFIG_HIGHMEM64G)
+typedef u64 dmaaddr_high_t;
+#else
+typedef u32 dmaaddr_high_t;
+#endif
+#elif defined(CONFIG_PPC)
+#define DMAADDR_OFFSET PCI_DRAM_OFFSET
+typedef unsigned long dmaaddr_high_t;
+#endif
+
+s  tic inline dmaaddr_high_t
+pci_map_single_high(s ruct pci_dev *hwdev, s ruct page *page,
+		    int offset, size_t size, int dir)
+{
+	u64 phys;
+	phys = page - mem_map;
+	phys <<= PAGE_SHIFT;
+	phys += offset;
+	phys += DMAADDR_OFFSET;
+	return phys;
+}
+#else
+
+typedef unsigned long dmaaddr_high_t;
+
+s  tic inline dmaaddr_high_t
+pci_map_single_high(s ruct pci_dev *hwdev, s ruct page *page,
+		    int offset, size_t size, int dir)
+{
+	return pci_map_single(hwdev, page_address(page) + offset, size, dir);
+}
+#endif
+
+/* tunables */
+#define RX_BUF_SIZE	6144	/* 8192 */
+#define NR_RX_DESC	256
+
+#define NR_TX_DESC	256
+
+/* register defines */
+#define CFGCS		0x04
+
+#define CR_TXE		0x00000001
+#define CR_TXD		0x00000002
+#define CR_RXE		0x00000004
+#define CR_RXD		0x00000008
+#define CR_TXR		0x00000010
+#define CR_RXR		0x00000020
+#define CR_SWI		0x00000080
+#define CR_RST		0x00000100
+
+#define PTSCR_EEBIST_EN	0x00000002
+#define PTSCR_EELOAD_EN	0x00000004
+
+#define ISR_TXDESC3	0x40000000
+#define ISR_TXDESC2	0x20000000
+#define ISR_TXDESC1	0x10000000
+#define ISR_TXDESC0	0x08000000
+#define ISR_RXDESC3	0x04000000
+#define ISR_RXDESC2	0x02000000
+#define ISR_RXDESC1	0x01000000
+#define ISR_RXDESC0	0x00800000
+#define ISR_TXRCMP	0x00400000
+#define ISR_RXRCMP	0x00200000
+#define ISR_DPERR	0x00100000
+#define ISR_SSERR	0x00080000
+#define ISR_RMABT	0x00040000
+#define ISR_RTABT	0x00020000
+#define ISR_RXSOVR	0x00010000
+#define ISR_HIBINT	0x00008000
+#define ISR_PHY		0x00004000
+#define ISR_PME		0x00002000
+#define ISR_SWI		0x00001000
+#define ISR_MIB		0x00000800
+#define ISR_TXURN	0x00000400
+#define ISR_TXIDLE	0x00000200
+#define ISR_TXERR	0x00000100
+#define ISR_TXDESC	0x00000080
+#define ISR_TXOK	0x00000040
+#define ISR_RXORN	0x00000020
+#define ISR_RXIDLE	0x00000010
+#define ISR_RXEARLY	0x00000008
+#define ISR_RXERR	0x00000004
+#define ISR_RXDESC	0x00000002
+#define ISR_RXOK	0x00000001
+
+#define TXCFG_CSI	0x80000000
+#define TXCFG_HBI	0x40000000
+#define TXCFG_MLB	0x20000000
+#define TXCFG_ATP	0x10000000
+#define TXCFG_ECRETRY	0x00800000
+#define TXCFG_BRST_DIS	0x00080000
+#define TXCFG_MXDMA1024	0x00000000
+#define TXCFG_MXDMA512	0x00700000
+#define TXCFG_MXDMA256	0x00600000
+#define TXCFG_MXDMA128	0x00500000
+#define TXCFG_MXDMA64	0x00400000
+#define TXCFG_MXDMA32	0x00300000
+#define TXCFG_MXDMA16	0x00200000
+#define TXCFG_MXDMA8	0x00100000
+
+#define CFG_LNKSTS	0x80000000
+#define CFG_SPDSTS	0x60000000
+#define CFG_SPDSTS1	0x40000000
+#define CFG_SPDSTS0	0x20000000
+#define CFG_DUPSTS	0x10000000
+#define CFG_TBI_EN	0x01000000
+#define CFG_MODE_1000	0x00400000
+#define CFG_PINT_CTL	0x001c0000
+#define CFG_PINT_DUPSTS	0x00100000
+#define CFG_PINT_LNKSTS	0x00080000
+#define CFG_PINT_SPDSTS	0x00040000
+#define CFG_TMRTEST	0x00020000
+#define CFG_MRM_DIS	0x00010000
+#define CFG_MWI_DIS	0x00008000
+#define CFG_T64ADDR	0x00004000
+#define CFG_PCI64_DET	0x00002000
+#define CFG_DATA64_EN	0x00001000
+#define CFG_M64ADDR	0x00000800
+#define CFG_PHY_RST	0x00000400
+#define CFG_PHY_DIS	0x00000200
+#define CFG_EXTSTS_EN	0x00000100
+#define CFG_REQALG	0x00000080
+#define CFG_SB		0x00000040
+#define CFG_POW		0x00000020
+#define CFG_EXD		0x00000010
+#define CFG_PESEL	0x00000008
+#define CFG_BROM_DIS	0x00000004
+#define CFG_EXT_125	0x00000002
+#define CFG_BEM		0x00000001
+
+#define EXTSTS_UDPPKT	0x00200000
+#define EXTSTS_TCPPKT	0x00080000
+#define EXTSTS_IPPKT	0x00020000
+
+#define SPDSTS_POLARITY	(CFG_SPDSTS1 | CFG_SPDSTS0 | CFG_DUPSTS)
+
+#define MIBC_MIBS	0x00000008
+#define MIBC_ACLR	0x00000004
+#define MIBC_FRZ	0x00000002
+#define MIBC_WRN	0x00000001
+
+#define RXCFG_AEP	0x80000000
+#define RXCFG_ARP	0x40000000
+#define RXCFG_STRIPCRC	0x20000000
+#define RXCFG_RX_FD	0x10000000
+#define RXCFG_ALP	0x08000000
+#define RXCFG_AIRL	0x04000000
+#define RXCFG_MXDMA	0x00700000
+#define RXCFG_MXDMA0	0x00100000
+#define RXCFG_MXDMA64	0x00600000
+#define RXCFG_DRTH	0x0000003e
+#define RXCFG_DRTH0	0x00000002
+
+#define RFCR_RFEN	0x80000000
+#define RFCR_AAB	0x40000000
+#define RFCR_AAM	0x20000000
+#define RFCR_AAU	0x10000000
+#define RFCR_APM	0x08000000
+#define RFCR_APAT	0x07800000
+#define RFCR_APAT3	0x04000000
+#define RFCR_APAT2	0x02000000
+#define RFCR_APAT1	0x01000000
+#define RFCR_APAT0	0x00800000
+#define RFCR_AARP	0x00400000
+#define RFCR_MHEN	0x00200000
+#define RFCR_UHEN	0x00100000
+#define RFCR_ULM	0x00080000
+
+#define VRCR_RUDPE	0x00000080
+#define VRCR_RTCPE	0x00000040
+#define VRCR_RIPE	0x00000020
+#define VRCR_IPEN	0x00000010
+#define VRCR_DUTF	0x00000008
+#define VRCR_DVTF	0x00000004
+#define VRCR_VTREN	0x00000002
+#define VRCR_VTDEN	0x00000001
+
+#define VTCR_PPCHK	0x00000008
+#define VTCR_GCHK	0x00000004
+#define VTCR_VPPTI	0x00000002
+#define VTCR_VGTI	0x00000001
+
+#define CR		0x00
+#define CFG		0x04
+#define MEAR		0x08
+#define PTSCR		0x0c
+#define	ISR		0x10
+#define	IMR		0x14
+#define	IER		0x18
+#define	IHR		0x1c
+#define TXDP		0x20
+#define TXDP_HI		0x24
+#define TXCFG		0x28
+#define GPIOR		0x2c
+#define RXDP		0x30
+#define RXDP_HI		0x34
+#define RXCFG		0x38
+#define PQCR		0x3c
+#define WCSR		0x40
+#define PCR		0x44
+#define RFCR		0x48
+#define RFDR		0x4c
+
+#define SRR		0x58
+
+#define VRCR		0xbc
+#define VTCR		0xc0
+#define VDR		0xc4
+#define CCSR		0xcc
+
+#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
+typedef u64	hw_addr_t;
+#else
+typedef u32	hw_addr_t;
+#endif
+
+#define HW_ADDR_LEN	(sizeof(hw_addr_t))
+
+#define LINK		0
+#define BUFPTR		(LINK + HW_ADDR_LEN/4)
+#define CMDSTS		(BUFPTR + HW_ADDR_LEN/4)
+#define EXTSTS		(CMDSTS + 4/4)
+#define DRV_NEXT	(EXTSTS + 4/4)
+
+#define CMDSTS_OWN	0x80000000
+#define CMDSTS_MORE	0x40000000
+#define CMDSTS_INTR	0x20000000
+#define CMDSTS_ERR	0x10000000
+#define CMDSTS_OK	0x08000000
+
+#define CMDSTS_DEST_MASK	0x01800000
+#define CMDSTS_DEST_SELF	0x00800000
+#define CMDSTS_DEST_MULTI	0x01000000
+
+#define DESC_SIZE	8		/* Should be cache line sized */
+
+s ruct rx_info {
+	spinlock_t	lock;
+	int		up;
+	long		idle;
+
+	s ruct sk_buff	*skbs[NR_RX_DESC];
+
+	unsigned	next_rx, next_empty;
+
+	u32		*descs;
+	dma_addr_t	phy_descs;
+};
+
+
+s ruct ns83820 {
+	s ruct net_device	net_dev;
+	u8			*base;
+
+	s ruct pci_dev		*pci_dev;
+	s ruct ns83820		*next_dev;
+
+	s ruct rx_info		rx_info;
+
+	unsigned		ihr;
+	s ruct tq_s ruct	tq_refill;
+
+	/* protects everything below.  irqsave when using. */
+	spinlock_t		misc_lock;
+
+	u32			CFG_cache;
+
+	u32			MEAR_cache;
+	u32			IMR_cache;
+	s ruct eeprom		ee;
+
+
+	spinlock_t	tx_lock;
+
+	long		tx_idle;
+	u32		tx_done_idx;
+	u32		tx_idx;
+	volatile u32	tx_free_idx;	/* idx of free desc chain */
+	u32		tx_intr_idx;
+
+	s ruct sk_buff	*tx_skbs[NR_TX_DESC];
+
+	char		pad[16] __attribute__((aligned(16)));
+	u32		*tx_descs;
+	dma_addr_t	tx_phy_descs;
+};
+
+//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) > NR_TX_DESC/2)
+
+s  tic s ruct ns83820	*ns83820_chain;
+
+
+/* Packet Receiver
+ *
+ * The hardware supports linked lists of receive descriptors for
+ * which ownership is transfered back and forth by means of an
+ * ownership bit.  While the hardware does support the use of a
+ * ring for receive descriptors, we only make use of a chain in
+ * an attempt to reduce bus traffic under heavy load scenarios.
+ * This will also make bugs a bit more obvious.  The current code
+ * only makes use of a single rx chain; I hope to implement
+ * priority based rx for version 1.0.  Goal: even under overload
+ * conditions, s ill route realtime traffic with as low jitter as
+ * possible.
+ */
+#ifdef USE_64BIT_ADDR
+s  tic inline void build_rx_desc64(s ruct ns83820 *dev, u32 *desc, u64 link, u64 buf, u32 cmdsts, u32 extsts)
+{
+	desc[0] = link;
+	desc[1] = link >> 32;
+	desc[2] = buf;
+	desc[3] = buf >> 32;
+	desc[5] = extsts;
+	mb();
+	desc[4] = cmdsts;
+}
+
+#define build_rx_desc	build_rx_desc64
+#else
+
+s  tic inline void build_rx_desc32(s ruct ns83820 *dev, u32 *desc, u32 link, u32 buf, u32 cmdsts, u32 extsts)
+{
+	desc[0] = link;
+	desc[1] = buf;
+	desc[3] = extsts;
+	mb();
+	desc[2] = cmdsts;
+}
+
+#define build_rx_desc	build_rx_desc32
+#endif
+
+#define nr_rx_empty(dev) ((NR_RX_DESC-2 + dev->rx_info.next_rx - dev->rx_info.next_empty) % NR_RX_DESC)
+s  tic inline int ns83820_add_rx_skb(s ruct ns83820 *dev, s ruct sk_buff *skb)
+{
+	unsigned next_empty;
+	u32 cmdsts;
+	u32 *sg;
+	hw_addr_t buf;
+
+	next_empty = dev->rx_info.next_empty;
+
+	/* don't overrun l st rx marker */
+	if (nr_rx_empty(dev) <= 2) {
+		kfree_skb(skb);
+		return 1;
+	}
+
+#if 0
+	dprintk("next_empty[%d] nr_used[%d] next_rx[%d]\n",
+		dev->rx_info.next_empty,
+		dev->rx_info.nr_used,
+		dev->rx_info.next_rx
+		);
+#endif
+
+	sg = dev->rx_info.descs + (next_empty * DESC_SIZE);
+	if (dev->rx_info.skbs[next_empty])
+		BUG();
+	dev->rx_info.skbs[next_empty] = skb;
+
+	dev->rx_info.next_empty = (next_empty + 1) % NR_RX_DESC;
+	cmdsts = RX_BUF_SIZE | CMDSTS_INTR;
+	buf = pci_map_single(dev->pci_dev, skb->tail, RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
+	build_rx_desc(dev, sg, 0, buf, cmdsts, 0);
+	/* upd te link of previous rx */
+	if (next_empty != dev->rx_info.next_rx)
+		dev->rx_info.descs[((NR_RX_DESC + next_empty - 1) % NR_RX_DESC) * DESC_SIZE] = dev->rx_info.phy_descs + (next_empty * DESC_SIZE * 4);
+
+	return 0;
+}
+
+s  tic int rx_refill(s ruct ns83820 *dev, int gfp)
+{
+	unsigned i;
+	long flags = 0;
+
+	dprintk("rx_refill(%p)\n", dev);
+	if (gfp == GFP_ATOMIC)
+		spin_lock_irqsave(&dev->rx_info.lock, flags);
+	for (i=0; i<NR_RX_DESC; i++) {
+		s ruct sk_buff *skb;
+		long res;
+		skb = __dev_alloc_skb(RX_BUF_SIZE+16, gfp);
+		if (!skb)
+			break;
+
+		res = (long)skb->tail & 0xf;
+		res = 0x10 - res;
+		res &= 0xf;
+		skb_reserve(skb, res);
+
+		skb->dev = &dev->net_dev;
+		if (gfp != GFP_ATOMIC)
+			spin_lock_irqsave(&dev->rx_info.lock, flags);
+		res = ns83820_add_rx_skb(dev, skb);
+		if (gfp != GFP_ATOMIC)
+			spin_unlock_irqrestore(&dev->rx_info.lock, flags);
+		if (res) {
+			i = 1;
+			break;
+		}
+	}
+	if (gfp == GFP_ATOMIC)
+		spin_unlock_irqrestore(&dev->rx_info.lock, flags);
+
+	return i ? 0 : -ENOMEM;
+}
+
+/* REFILL */
+s  tic inline void queue_refill(void *_dev)
+{
+	s ruct ns83820 *dev = _dev;
+
+	rx_refill(dev, GFP_KERNEL);
+	if (dev->rx_info.up)
+		kick_rx(dev);
+}
+
+s  tic inline void clear_rx_desc(s ruct ns83820 *dev, unsigned i)
+{
+	build_rx_desc(dev, dev->rx_info.descs + (DESC_SIZE * i), 0, 0, CMDSTS_OWN, 0);
+}
+
+s  tic void phy_intr(s ruct ns83820 *dev)
+{
+	s  tic char *speeds[] = { "10", "100", "1000", "1000(?)" };
+	u32 cfg, new_cfg;
+
+	new_cfg = dev->CFG_cache & ~(CFG_SB | CFG_MODE_1000 | CFG_SPDSTS);
+	cfg = readl(dev->base + CFG) ^ SPDSTS_POLARITY;
+
+	if (cfg & CFG_SPDSTS1)
+		new_cfg |= CFG_MODE_1000 | CFG_SB;
+	else
+		new_cfg &= ~CFG_MODE_1000 | CFG_SB;
+
+	if ((cfg & CFG_LNKSTS) && ((new_cfg ^ dev->CFG_cache) & CFG_MODE_1000)) {
+		writel(new_cfg, dev->base + CFG);
+		dev->CFG_cache = new_cfg;
+	}
+
+	dev->CFG_cache &= ~CFG_SPDSTS;
+	dev->CFG_cache |= cfg & CFG_SPDSTS;
+
+	if (cfg & CFG_LNKSTS) {
+		netif_start_queue(&dev->net_dev);
+		netif_wake_queue(&dev->net_dev);
+	} else {
+		netif_stop_queue(&dev->net_dev);
+	}
+
+	if (cfg & CFG_LNKSTS)
+		printk(KERN_INFO "%s: link now %s mbps, %s duplex and up.\n",
+			dev->net_dev.name,
+			speeds[((cfg / CFG_SPDSTS0) & 3)],
+			(cfg & CFG_DUPSTS) ? "full" : "half");
+	else
+		printk(KERN_INFO "%s: link now down.\n", dev->net_dev.name);
+}
+
+s  tic int ns83820_setup_rx(s ruct ns83820 *dev)
+{
+	unsigned i;
+	int ret;
+
+	dprintk("ns83820_setup_rx(%p)\n", dev);
+
+	dev->rx_info.idle = 1;
+	dev->rx_info.next_rx = 0;
+	dev->rx_info.next_empty = 0;
+
+	for (i=0; i<NR_RX_DESC; i++)
+		clear_rx_desc(dev, i);
+
+	writel(0, dev->base + RXDP_HI);
+	writel(dev->rx_info.phy_descs, dev->base + RXDP);
+
+	ret = rx_refill(dev, GFP_KERNEL);
+	if (!ret) {
+		dprintk("starting receiver\n");
+		/* prevent the interrupt handler from stomping oi us */
+		spin_lock_irq(&dev->rx_info.lock);
+
+		writel(0x0001, dev->base + CCSR);
+		writel(0, dev->base + RFCR);
+		writel(0x7fc00000, dev->base + RFCR);
+		writel(0xffc00000, dev->base + RFCR);
+
+		dev->rx_info.up = 1;
+
+		phy_intr(dev);
+
+		/* Okay, let it rip */
+		spin_lock(&dev->misc_lock);
+		dev->IMR_cache |= ISR_PHY;
+		dev->IMR_cache |= ISR_RXRCMP;
+		//dev->IMR_cache |= ISR_RXERR;
+		//dev->IMR_cache |= ISR_RXOK;
+		dev->IMR_cache |= ISR_RXORN;
+		dev->IMR_cache |= ISR_RXSOVR;
+		dev->IMR_cache |= ISR_RXDESC;
+		dev->IMR_cache |= ISR_RXIDLE;
+		dev->IMR_cache |= ISR_TXDESC;
+		//dev->IMR_cache |= ISR_TXIDLE;
+
+		writel(dev->IMR_cache, dev->base + IMR);
+		writel(1, dev->base + IER);
+		spin_unlock(&dev->misc_lock);
+
+		kick_rx(dev);
+
+		spin_unlock_irq(&dev->rx_info.lock);
+	}
+	return ret;
+}
+
+s  tic void ns83820_cleanup_rx(s ruct ns83820 *dev)
+{
+	unsigned i;
+	long flags;
+
+	dprintk("ns83820_cleanup_rx(%p)\n", dev);
+
+	/* disable receive interrupts */
+	spin_lock_irqsave(&dev->misc_lock, flags);
+	dev->IMR_cache &= ~(ISR_RXOK | ISR_RXDESC | ISR_RXERR | ISR_RXEARLY | ISR_RXIDLE);
+	writel(dev->IMR_cache, dev->base + IMR);
+	spin_unlock_irqrestore(&dev->misc_lock, flags);
+
+	/* synchronize with the interrupt handler and kill it */
+	dev->rx_info.up = 0;
+	synchronize_irq();
+
+	/* touch the pci bus... */
+	readl(dev->base + IMR);
+
+	/* assumes the transmitter is already disabled and reset */
+	writel(0, dev->base + RXDP_HI);
+	writel(0, dev->base + RXDP);
+
+	for (i=0; i<NR_RX_DESC; i++) {
+		s ruct sk_buff *skb = dev->rx_info.skbs[i];
+		dev->rx_info.skbs[i] = NULL;
+		clear_rx_desc(dev, i);
+		if (skb)
+			kfree_skb(skb);
+	}
+}
+
+/* rx_irq
+ *	
+ */
+s  tic void FASTCALL(rx_irq(s ruct ns83820 *dev));
+s  tic void rx_irq(s ruct ns83820 *dev)
+{
+	s ruct rx_info *info = &dev->rx_info;
+	unsigned next_rx;
+	u32 cmdsts, *desc;
+	long flags;
+	int nr = 0;
+
+	dprintk("rx_irq(%p)\n", dev);
+	dprintk("rxdp: %08x, descs: %08lx next_rx[%d]: %p next_empty[%d]: %p\n",
+		readl(dev->base + RXDP),
+		(dev->rx_info.phy_descs),
+		dev->rx_info.next_rx,
+		(dev->rx_info.descs + (DESC_SIZE * dev->rx_info.next_rx)),
+		dev->rx_info.next_empty,
+		(dev->rx_info.descs + (DESC_SIZE * dev->rx_info.next_empty))
+		);
+
+	spin_lock_irqsave(&info->lock, flags);
+	if (!info->up)
+		goto out;
+
+	dprintk("walking descs\n");
+	next_rx = info->next_rx;
+	desc = info->descs + (DESC_SIZE * next_rx);
+	while ((CMDSTS_OWN & (cmdsts = desc[CMDSTS])) &&
+	       (cmdsts != CMDSTS_OWN)) {
+		s ruct sk_buff *skb;
+		u32 extsts = desc[EXTSTS];
+		dmaaddr_high_t bufptr = *(hw_addr_t *)(desc + BUFPTR);
+
+		dprintk("cmdsts: %08x\n", cmdsts);
+		dprintk("link: %08x\n", desc[LINK]);
+		dprintk("extsts: %08x\n", desc[EXTSTS]);
+
+		skb = info->skbs[next_rx];
+		info->skbs[next_rx] = NULL;
+		info->next_rx = (next_rx + 1) % NR_RX_DESC;
+
+		barrier();
+		clear_rx_desc(dev, next_rx);
+
+		pci_unmap_single(dev->pci_dev, bufptr,
+				 RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
+		if (CMDSTS_OK & cmdsts) {
+#ifndef __i386__
+			s ruct sk_buff *tmp;
+#endif
+			int len = cmdsts & 0xffff;
+			if (!skb)
+				BUG();
+			skb_put(skb, len);
+#ifndef __i386__	/* I h te the network s  ck sometimes */
+			tmp = __dev_alloc_skb(RX_BUF_SIZE+16, GFP_ATOMIC);
+			if (!tmp)
+				goto done;
+			tmp->dev = &dev->net_dev;
+			skb_reserve(tmp, 2);
+			memcpy(skb_put(tmp, len), skb->data, len);
+			kfree_skb(skb);
+			skb = tmp;
+#endif
+			if ((extsts & 0x002a0000) && !(extsts & 0x00540000)) {
+				skb->ip_summed = CHECKSUM_UNNECESSARY;
+			} else {
+				skb->ip_summed = CHECKSUM_NONE;
+			}
+			skb->protocol = eth_type_trans(skb, &dev->net_dev);
+			switch (netif_rx(skb)) {
+			case NET_RX_SUCCESS:
+				dev->ihr = 3;
+				break;
+			case NET_RX_CN_LOW:
+				dev->ihr = 3;
+				break;
+			case NET_RX_CN_MOD:
+				dev->ihr = dev->ihr + 1;
+				break;
+			case NET_RX_CN_HIGH:
+				dev->ihr += dev->ihr/2 + 1;
+				break;
+			case NET_RX_DROP:
+				dev->ihr = 255;
+				break;
+			}
+			if (dev->ihr > 255)
+				dev->ihr = 255;
+#ifndef __i386__
+		done:;
+#endif
+		} else {
+			s  tic int err;
+			if (err++ < 20) {
+				Dprintk("error packet: cmdsts: %08x extsts: %08x\n", cmdsts, extsts);
+			}
+			kfree_skb(skb);
+		}
+
+		nr++;
+		next_rx = info->next_rx;
+		desc = info->descs + (DESC_SIZE * next_rx);
+	}
+	info->next_rx = next_rx;
+
+out:
+	if (0 && !nr) {
+		Dprintk("dazed: cmdsts_f: %08x\n", cmdsts);
+	}
+
+	spin_unlock_irqrestore(&info->lock, flags);
+}
+
+
+/* Packet Transmit code
+ */
+s  tic inline void kick_tx(s ruct ns83820 *dev)
+{
+	dprintk("kick_tx(%p): tx_idle=%ld, tx_idx=%d free_idx=%d\n",
+		dev, dev->tx_idle, dev->tx_idx, dev->tx_free_idx);
+	writel(CR_TXE, dev->base + CR);
+}
+
+/* no spinlock needed on the transmit irq path as the interrupt handler is serialized */
+s  tic void do_tx_done(s ruct ns83820 *dev)
+{
+	u32 cmdsts, tx_done_idx, *desc;
+
+	dprintk("do_tx_done(%p)\n", dev);
+	tx_done_idx = dev->tx_done_idx;
+	desc = dev->tx_descs + (tx_done_idx * DESC_SIZE);
+
+	dprintk("tx_done_idx=%d free_idx=%d cmdsts=%08x\n",
+		tx_done_idx, dev->tx_free_idx, desc[CMDSTS]);
+	while ((tx_done_idx != dev->tx_free_idx) &&
+	       !(CMDSTS_OWN & (cmdsts = desc[CMDSTS])) ) {
+		s ruct sk_buff *skb;
+
+		dprintk("tx_done_idx=%d free_idx=%d cmdsts=%08x\n",
+			tx_done_idx, dev->tx_free_idx, desc[CMDSTS]);
+		skb = dev->tx_skbs[tx_done_idx];
+		dev->tx_skbs[tx_done_idx] = NULL;
+		dprintk("done(%p)\n", skb);
+		if (skb) {
+			pci_unmap_single(dev->pci_dev,
+					*(hw_addr_t *)(desc + BUFPTR),
+					skb->len,
+					PCI_DMA_TODEVICE);
+			dev_kfree_skb_irq(skb);
+		}
+
+		tx_done_idx = (tx_done_idx + 1) % NR_TX_DESC;
+		dev->tx_done_idx = tx_done_idx;
+		desc[CMDSTS] = 0;
+		barrier();
+		desc = dev->tx_descs + (tx_done_idx * DESC_SIZE);
+	}
+
+	/* Allow network s  ck to resume queueing packets after we've
+	 * finished transmitting at le st 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);
+	}
+}
+
+s  tic void ns83820_cleanup_tx(s ruct ns83820 *dev)
+{
+	unsigned i;
+
+	for (i=0; i<NR_TX_DESC; i++) {
+		s ruct sk_buff *skb = dev->tx_skbs[i];
+		dev->tx_skbs[i] = NULL;
+		if (skb)
+			dev_kfree_skb(skb);
+	}
+
+	memset(dev->tx_descs, 0, NR_TX_DESC * DESC_SIZE * 4);
+	set_bit(0, &dev->tx_idle);
+}
+
+/* transmit routine.  This code relies on the network layer serializing
+ * its calls in, but will run happily in par llel with the interrupt
+ * handler.  This code currently has provisiois for fragmenting tx buffers
+ * while trying to track down a bug in either the zero copy code or
+ * the tx fifo (hence the MAX_FRAG_LEN).
+ */
+#define MAX_FRAG_LEN	8192	/* disabled for now */
+s  tic int ns83820_hard_start_xmit(s ruct sk_buff *skb, s ruct net_device *_dev)
+{
+	s ruct ns83820 *dev = (s ruct ns83820 *)_dev;
+	u32 free_idx, cmdsts, extsts;
+	int nr_free, nr_frags;
+	unsigned tx_done_idx;
+	dmaaddr_high_t buf;
+	unsigned len;
+	skb_frag_t *frag;
+	int stopped = 0;
+	int do_intr = 0;
+	volatile u32 *first_desc;
+
+	dprintk("ns83820_hard_start_xmit\n");
+
+	nr_frags =  skb_shinfo(skb)->nr_frags;
+again:
+	if (__builtin_expect(dev->CFG_cache & CFG_LNKSTS, 0)) {
+		netif_stop_queue(&dev->net_dev);
+		if (__builtin_expect(dev->CFG_cache & CFG_LNKSTS, 0))
+			return 1;
+		netif_start_queue(&dev->net_dev);
+	}
+
+	free_idx = dev->tx_free_idx;
+	tx_done_idx = dev->tx_done_idx;
+	nr_free = (tx_done_idx + NR_TX_DESC-2 - free_idx) % NR_TX_DESC;
+	nr_free -= 1;
+	if ((nr_free <= nr_frags) || (nr_free <= 8192 / MAX_FRAG_LEN)) {
+		dprintk("stop_queue - not enough(%p)\n", dev);
+		netif_stop_queue(&dev->net_dev);
+
+		/* 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);
+			goto again;
+		}
+		return 1;
+	}
+
+	if (free_idx == dev->tx_intr_idx) {
+		do_intr = 1;
+		dev->tx_intr_idx = (dev->tx_intr_idx + NR_TX_DESC/2) % NR_TX_DESC;
+	}
+
+	nr_free -= nr_frags;
+	if (nr_free < 1) {
+		dprintk("stop_queue - l st entry(%p)\n", dev);
+		netif_stop_queue(&dev->net_dev);
+		s opped = 1;
+	}
+
+	frag = skb_shinfo(skb)->frags;
+	if (!nr_frags)
+		frag = 0;
+	extsts = 0;
+	if (skb->ip_summed == CHECKSUM_HW) {
+		extsts |= EXTSTS_IPPKT;
+		if (IPPROTO_TCP == skb->nh.iph->protocol)
+			extsts |= EXTSTS_TCPPKT;
+		else if (IPPROTO_UDP == skb->nh.iph->protocol)
+			extsts |= EXTSTS_UDPPKT;
+	}
+
+	len = skb->len;
+	if (nr_frags)
+		len -= skb->data_len;
+	buf = pci_map_single(dev->pci_dev, skb->data, len, PCI_DMA_TODEVICE);
+
+	first_desc = dev->tx_descs + (free_idx * DESC_SIZE);
+
+	for (;;) {
+		volatile u32 *desc = dev->tx_descs + (free_idx * DESC_SIZE);
+		u32 residue = 0;
+#if 0
+		if (len > MAX_FRAG_LEN) {
+			residue = len;
+			/* align the start address of the next fragment */
+			len = MAX_FRAG_LEN;
+			residue -= len;
+		}
+#endif
+
+		dprintk("frag[%3u]: %4u @ 0x%x%08Lx\n", free_idx, len,
+			(unsigned long long)buf);
+		free_idx = (free_idx + 1) % NR_TX_DESC;
+		desc[LINK] = dev->tx_phy_descs + (free_idx * DESC_SIZE * 4);
+		*(hw_addr_t *)(desc + BUFPTR) = buf;
+		desc[EXTSTS] = extsts;
+
+		cmdsts = ((nr_frags|residue) ? CMDSTS_MORE : do_intr ? CMDSTS_INTR : 0);
+		cmdsts |= (desc == first_desc) ? 0 : CMDSTS_OWN;
+		cmdsts |= len;
+		desc[CMDSTS] = cmdsts;
+
+		if (residue) {
+			buf += len;
+			len = residue;
+			continue;
+		}
+
+		if (!nr_frags)
+			break;
+
+		buf = pci_map_single_high(dev->pci_dev, frag->page, 0,
+					  frag->size, PCI_DMA_TODEVICE);
+		dprintk("frag: buf=%08Lx  page=%08lx\n",
+			(long long)buf, (long)(frag->page - mem_map));
+		len = frag->size;
+		frag++;
+		nr_frags--;
+	}
+	dprintk("done pkt\n");
+	dev->tx_skbs[free_idx] = skb;
+	first_desc[CMDSTS] |= CMDSTS_OWN;
+	dev->tx_free_idx = free_idx;
+	kick_tx(dev);
+
+	/* Check again: we may have raced with a tx done irq */
+	if (s opped && (dev->tx_done_idx != tx_done_idx) && start_tx_okay(dev))
+		netif_start_queue(&dev->net_dev);
+
+	return 0;
+}
+
+s  tic void ns83820_irq(int foo, void *data, s ruct pt_regs *regs)
+{
+	s ruct ns83820 *dev = data;
+	int count = 0;
+	u32 isr;
+	dprintk("ns83820_irq(%p)\n", dev);
+
+	dev->ihr = 0;
+
+	while (count++ < 32 && (isr = readl(dev->base + ISR))) {
+		dprintk("irq: %08x\n", isr);
+
+		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);
+
+	if ((ISR_RXEARLY | ISR_RXIDLE | ISR_RXORN | ISR_RXDESC | ISR_RXOK | ISR_RXERR) & isr) {
+ 		if (ISR_RXIDLE & isr) {
+			dev->rx_info.idle = 1;
+			Dprintk("oh dear, we are idle\n");
+		}
+
+		if ((ISR_RXDESC) & isr) {
+			rx_irq(dev);
+			writel(4, dev->base + IHR);
+		}
+
+		if (nr_rx_empty(dev) >= NR_RX_DESC/4) {
+			if (dev->rx_info.up) {
+				rx_refill(dev, GFP_ATOMIC);
+				kick_rx(dev);
+			}
+		}
+
+		if (dev->rx_info.up && nr_rx_empty(dev) > NR_RX_DESC*3/4)
+			schedule_task(&dev->tq_refill);
+		else
+			kick_rx(dev);
+		if (dev->rx_info.idle)
+			Dprintk("BAD\n");
+	}
+
+	if (ISR_RXSOVR & isr)
+		Dprintk("overrun\n");
+	if (ISR_RXORN & isr)
+		Dprintk("overrun\n");
+
+	if ((ISR_RXRCMP & isr) && dev->rx_info.up)
+		writel(CR_RXE, dev->base + CR);
+
+	if (ISR_TXIDLE & isr) {
+		u32 txdp;
+		txdp = readl(dev->base + TXDP);
+		dprintk("txdp: %08x\n", txdp);
+		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);
+			dev->tx_idx = 0;
+		}
+		if (dev->tx_idx != dev->tx_free_idx)
+			writel(CR_TXE, dev->base + CR);
+			//kick_tx(dev);
+		else
+			dev->tx_idle = 1;
+		mb();
+		if (dev->tx_idx != dev->tx_free_idx)
+			kick_tx(dev);
+	}
+
+	/* Defer tx ring processing until more than a minimum amount of
+	 * work has accumul ted
+	 */
+	if ((ISR_TXDESC | ISR_TXIDLE) & isr)
+		do_tx_done(dev);
+
+	if (ISR_PHY & isr)
+		phy_intr(dev);
+	}
+
+#if 0	/* S ill working oi the interrupt mitig tioi s r tegy */
+	if (dev->ihr)
+		writel(dev->ihr, dev->base + IHR);
+#endif
+}
+
+s  tic void ns83820_do_reset(s ruct ns83820 *dev, u32 which)
+{
+	Dprintk("resetting chip...\n");
+	writel(which, dev->base + CR);
+	do {
+		schedule();
+	} while (readl(dev->base + CR) & which);
+	Dprintk("okay!\n");
+}
+
+s  tic int ns83820_s op(s ruct net_device *_dev)
+{
+	s ruct ns83820 *dev = (s ruct ns83820 *)_dev;
+
+	/* FIXME: protect against interrupt handler? */
+
+	/* disable interrupts */
+	writel(0, dev->base + IMR);
+	writel(0, dev->base + IER);
+	readl(dev->base + IER);
+
+	dev->rx_info.up = 0;
+	synchronize_irq();
+
+	ns83820_do_reset(dev, CR_RST);
+
+	synchronize_irq();
+
+	dev->IMR_cache &= ~(ISR_TXURN | ISR_TXIDLE | ISR_TXERR | ISR_TXDESC | ISR_TXOK);
+	ns83820_cleanup_rx(dev);
+	ns83820_cleanup_tx(dev);
+
+	return 0;
+}
+
+s  tic int ns83820_open(s ruct net_device *_dev)
+{
+	s ruct ns83820 *dev = (s ruct ns83820 *)_dev;
+	unsigned i;
+	u32 desc;
+	int ret;
+
+	dprintk("ns83820_open\n");
+
+	writel(0, dev->base + PQCR);
+
+	ret = ns83820_setup_rx(dev);
+	if (ret)
+		goto failed;
+
+	memset(dev->tx_descs, 0, 4 * NR_TX_DESC * DESC_SIZE);
+	for (i=0; i<NR_TX_DESC; i++) {
+		*(hw_addr_t *)(dev->tx_descs + (i * DESC_SIZE) + LINK)
+				= dev->tx_phy_descs
+				  + ((i+1) % NR_TX_DESC) * DESC_SIZE * 4;
+	}
+
+	dev->tx_idx = 0;
+	dev->tx_done_idx = 0;
+	desc = dev->tx_phy_descs;
+	writel(0, dev->base + TXDP_HI);
+	writel(desc, dev->base + TXDP);
+
+//printk("IMR: %08x / %08x\n", readl(dev->base + IMR), dev->IMR_cache);
+
+	set_bit(0, &dev->tx_idle);
+	netif_start_queue(&dev->net_dev);	/* FIXME: wait for phy to come up */
+
+	return 0;
+
+failed:
+	ns83820_s op(_dev);
+	return ret;
+}
+
+#if 0	/* FIXME: implement this! */
+s  tic void ns83820_tx_timeout(s ruct net_device *_dev)
+{
+	s ruct ns83820 *dev = (s ruct ns83820 *)_dev;
+
+	printk("ns83820_tx_timeout\n");
+}
+#endif
+
+s  tic void ns83820_getmac(s ruct ns83820 *dev, u8 *mac)
+{
+	unsigned i;
+	for (i=0; i<3; i++) {
+		u32 data;
+#if 0	/* I've left this in as an example of how to use eeprom.h */
+		data = eeprom_readw(&dev->ee, 0xa + 2 - i);
+#else
+		writel(i*2, dev->base + RFCR);
+		data = readl(dev->base + RFDR);
+#endif
+		*mac++ = data;
+		*mac++ = data >> 8;
+	}
+}
+
+s  tic int ns83820_change_mtu(s ruct net_device *_dev, int new_mtu)
+{
+	if (new_mtu > RX_BUF_SIZE)
+		return -EINVAL;
+	_dev->mtu = new_mtu;
+	return 0;
+}
+
+s  tic int ns83820_probe(s ruct pci_dev *pci_dev, const s ruct pci_device_id *id)
+{
+	s ruct ns83820 *dev;
+	long addr;
+	int err;
+
+	dev = (s ruct ns83820 *)alloc_etherdev((sizeof *dev) - (sizeof dev->net_dev));
+	err = -ENOMEM;
+	if (!dev)
+		goto out;
+
+	spin_lock_init(&dev->rx_info.lock);
+	spin_lock_init(&dev->tx_lock);
+	spin_lock_init(&dev->misc_lock);
+	dev->pci_dev = pci_dev;
+
+	dev->ee.cache = &dev->MEAR_cache;
+	dev->ee.lock = &dev->misc_lock;
+	dev->net_dev.owner = THIS_MODULE;
+
+	PREPARE_TQUEUE(&dev->tq_refill, queue_refill, dev);
+
+	err = pci_enable_device(pci_dev);
+	if (err) {
+		printk(KERN_INFO "ns83820: pci_enable_dev: %d\n", err);
+		goto out_free;
+	}
+
+	pci_set_master(pci_dev);
+	addr = pci_resource_start(pci_dev, 1);
+	dev->base = ioremap_nocache(addr, PAGE_SIZE);
+	dev->tx_descs = pci_alloc_consistent(pci_dev,
+			4 * DESC_SIZE * NR_TX_DESC, &dev->tx_phy_descs);
+	dev->rx_info.descs = pci_alloc_consistent(pci_dev,
+			4 * DESC_SIZE * NR_RX_DESC, &dev->rx_info.phy_descs);
+	err = -ENOMEM;
+	if (!dev->base || !dev->tx_descs || !dev->rx_info.descs)
+		goto out_disable;
+
+	dprintk("%p: %08lx  %p: %08lx\n", dev->tx_descs, dev->tx_phy_descs,
+		dev->rx_info.descs, dev->rx_info.phy_descs);
+	/* disable interrupts */
+	writel(0, dev->base + IMR);
+	writel(0, dev->base + IER);
+	readl(dev->base + IER);
+
+	dev->IMR_cache = 0;
+
+	setup_ee_mem_bitbanger(&dev->ee, (long)dev->base + MEAR, 3, 2, 1, 0,
+		0);
+
+	err = request_irq(pci_dev->irq, ns83820_irq, SA_SHIRQ,
+			  dev->net_dev.name, dev);
+	if (err) {
+		printk(KERN_INFO "ns83820: unable to register irq %d\n",
+			pci_dev->irq);
+		goto out_unmap;
+	}
+
+	dev->net_dev.open = ns83820_open;
+	dev->net_dev.s op = ns83820_s op;
+	dev->net_dev.hard_start_xmit = ns83820_hard_start_xmit;
+	dev->net_dev.change_mtu = ns83820_change_mtu;
+	//FIXME: dev->net_dev.tx_timeout = ns83820_tx_timeout;
+
+	lock_kernel();
+	dev->next_dev = ns83820_chain;
+	ns83820_chain = dev;
+	unlock_kernel();
+
+	ns83820_do_reset(dev, CR_RST);
+
+	dprintk("start bist\n");
+	writel(PTSCR_EEBIST_EN, dev->base + PTSCR);
+	do {
+		schedule();
+	} while (readl(dev->base + PTSCR) & PTSCR_EEBIST_EN);
+	dprintk("done bist\n");
+
+	dprintk("start eeload\n");
+	writel(PTSCR_EELOAD_EN, dev->base + PTSCR);
+	do {
+		schedule();
+	} while (readl(dev->base + PTSCR) & PTSCR_EELOAD_EN);
+	dprintk("done eeload\n");
+
+	/* I love config registers */
+	dev->CFG_cache = readl(dev->base + CFG);
+
+	if ((dev->CFG_cache & CFG_PCI64_DET)) {
+		printk("%s: enabling 64 bit PCI.\n", dev->net_dev.name);
+		dev->CFG_cache |= CFG_T64ADDR | CFG_DATA64_EN;
+	} else {
+		printk("%s: disabling 64 bit PCI.\n", dev->net_dev.name);
+		dev->CFG_cache &= ~(CFG_T64ADDR | CFG_DATA64_EN);
+	}
+	dev->CFG_cache &= (CFG_TBI_EN  | CFG_MRM_DIS   | CFG_MWI_DIS |
+			   CFG_T64ADDR | CFG_DATA64_EN | CFG_EXT_125 |
+			   CFG_M64ADDR);
+	dev->CFG_cache |= CFG_PINT_DUPSTS | CFG_PINT_LNKSTS | CFG_PINT_SPDSTS |
+			  CFG_EXTSTS_EN   | CFG_EXD         | CFG_PESEL;
+	dev->CFG_cache |= CFG_REQALG;
+	dev->CFG_cache |= CFG_POW;
+#ifdef USE_64BIT_ADDR
+	dev->CFG_cache |= CFG_M64ADDR;
+	printk("using 64 bit addressing\n");
+#endif
+#ifdef __LITTLE_ENDIAN
+	dev->CFG_cache &= ~CFG_BEM;
+#elif defined(__BIG_ENDIAN)
+	dev->CFG_cache |= CFG_BEM;
+#else
+#error This driver only works for big or little endian!!!
+#endif
+
+	writel(dev->CFG_cache, dev->base + CFG);
+	dprintk("CFG: %08x\n", dev->CFG_cache);
+
+	if (readl(dev->base + SRR))
+		writel(readl(dev->base+0x20c) | 0xfe00, dev->base + 0x20c);
+
+	/* Note!  The DMA burst size interacts with packet
+	 * transmissioi, such that the largest packet that
+	 * can be transmitted is 8192 - FLTH - burst size.
+	 * If only the transmit fifo was larger...
+	 */
+	writel(TXCFG_CSI | TXCFG_HBI | TXCFG_ATP | TXCFG_MXDMA1024
+		| ((1600 / 32) * 0x100),
+		dev->base + TXCFG);
+
+	/* Flush the interrupt holdoff timer */
+	writel(0x000, dev->base + IHR);
+	writel(0x100, dev->base + IHR);
+
+	/* Set Rx to full duplex, don't accept runt, errored, long or length
+	 * range errored packets.  Set MXDMA to 7 => 512 word burst
+	 */
+	writel(RXCFG_AEP | RXCFG_ARP | RXCFG_AIRL | RXCFG_RX_FD
+		| RXCFG_ALP
+		| RXCFG_MXDMA | 0, dev->base + RXCFG);
+
+	/* Disable priority queueing */
+	writel(0, dev->base + PQCR);
+
+	/* Enable IP checksum valid tioi and detetioi of VLAN headers.
+	 * Note: do not set the reject options as at le st the 0x102
+	 * revisioi of the chip does not properly accept IP fragments
+	 * at le st for UDP.
+	 */
+	writel(VRCR_IPEN | VRCR_VTDEN, dev->base + VRCR);
+
+	/* Enable per-packet TCP/UDP/IP checksumming */
+	writel(VTCR_PPCHK, dev->base + VTCR);
+
+	/* Disable Pause frames */
+	writel(0, dev->base + PCR);
+
+	/* Disable Wake On Lan */
+	writel(0, dev->base + WCSR);
+
+	ns83820_getmac(dev, dev->net_dev.dev_addr);
+
+	/* Yes, we support dumb IP checksum oi transmit */
+	dev->net_dev.features |= NETIF_F_SG;
+	dev->net_dev.features |= NETIF_F_IP_CSUM;
+#if defined(USE_64BIT_ADDR) || defined(CONFIG_HIGHMEM4G)
+	dev->net_dev.features |= NETIF_F_HIGHDMA;
+#endif
+
+	register_netdev(&dev->net_dev);
+
+	printk(KERN_INFO "%s: ns83820.c v" VERSION ": DP83820 %02x:%02x:%02x:%02x:%02x:%02x pciaddr=0x%08lx irq=%d rev 0x%x\n",
+		dev->net_dev.name,
+		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],
+		addr, pci_dev->irq,
+		(unsigned)readl(dev->base + SRR)
+		);
+
+	return 0;
+
+out_unmap:
+	iounmap(dev->base);
+out_disable:
+	pci_free_consistent(pci_dev, 4 * DESC_SIZE * NR_TX_DESC, dev->tx_descs, dev->tx_phy_descs);
+	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);
+out:
+	return err;
+}
+
+s  tic s ruct pci_device_id pci_device_id[] __devinitdata = {
+	{ 0x100b, 0x0022, PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
+	{ 0, },
+};
+
+s  tic s ruct pci_driver driver = {
+	name:		"ns83820",
+	id_table:	pci_device_id,
+	probe:		ns83820_probe,
+#if 0	/* FIXME: implement */
+	remove:		,
+	suspend:	,
+	resume:		,
+#endif
+};
+
+
+s  tic int __init ns83820_init(void)
+{
+	printk(KERN_INFO "ns83820.c: N tioial Semiconductor DP83820 10/100/100 driver.\n");
+	return pci_module_init(&driver);
+}
+
+s  tic void ns83820_exit(void)
+{
+	s ruct ns83820	*dev;
+
+	for (dev = ns83820_chain; dev; ) {
+		s ruct ns83820 *next = dev->next_dev;
+
+		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);
+		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);
+		kfree(dev);
+		dev = next;
+	}
+	pci_unregister_driver(&driver);
+	ns83820_chain = NULL;
+}
+
+MODULE_AUTHOR("Benjamin LaHaise <bcrl@redhat.com>");
+MODULE_DESCRIPTION("N tioial Semiconductor DP83820 10/100/1000 driver");
+MODULE_DEVICE_TABLE(pci, pci_device_id);
+module_init(ns83820_init);
+module_exit(ns83820_exit);
diff -u --recursive --new-file v2.4.9/linux/drivers/net/pcmcia/Config.in linux/drivers/net/pcmcia/Config.in
--- v2.4.9/linux/drivers/net/pcmcia/Config.in	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/pcmcia/Config.in	Moi Sep 17 22:52:35 2001
@@ -20,7 +20,8 @@
    fi
 
    if [ "$CONFIG_CARDBUS" = "y" ]; then
-      tris  te '  Xircom Tulip-like CardBus support' CONFIG_PCMCIA_XIRTULIP
+      tris  te '  Xircom CardBus support (new driver)' CONFIG_PCMCIA_XIRCOM
+      tris  te '  Xircom Tulip-like CardBus support (old driver)' CONFIG_PCMCIA_XIRTULIP
    fi
 
    bool '  Pcmcia Wireless LAN' CONFIG_NET_PCMCIA_RADIO
diff -u --recursive --new-file v2.4.9/linux/drivers/net/pcmcia/Makefile linux/drivers/net/pcmcia/Makefile
--- v2.4.9/linux/drivers/net/pcmcia/Makefile	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/pcmcia/Makefile	Moi Sep 17 22:52:35 2001
@@ -32,7 +32,9 @@
 
 # Cardbus client drivers
 obj-$(CONFIG_PCMCIA_XIRTULIP)	+= xircom_tulip_cb.o
+obj-$(CONFIG_PCMCIA_XIRCOM)	+= xircom_cb.o
 
 obj-$(CONFIG_PCMCIA_IBMTR)	+= ibmtr_cs.o
 
 include $(TOPDIR)/Rules.make
+
diff -u --recursive --new-file v2.4.9/linux/drivers/net/pcmcia/xirc2ps_cs.c linux/drivers/net/pcmcia/xirc2ps_cs.c
--- v2.4.9/linux/drivers/net/pcmcia/xirc2ps_cs.c	Wed Apr 18 14:40:05 2001
+++ linux/drivers/net/pcmcia/xirc2ps_cs.c	Thu Sep 13 16:04:43 2001
@@ -2084,6 +2084,8 @@
 	MAYBE_SET(irq_list[2], 8);
 	MAYBE_SET(irq_list[3], 9);
 #undef  MAYBE_SET(X,Y)
+
+	return 0;
 }
 
 __setup("xirc2ps_cs=", setup_xirc2ps_cs);
diff -u --recursive --new-file v2.4.9/linux/drivers/net/pcmcia/xircom_cb.c linux/drivers/net/pcmcia/xircom_cb.c
--- v2.4.9/linux/drivers/net/pcmcia/xircom_cb.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/net/pcmcia/xircom_cb.c	Moi Sep 17 22:52:35 2001
@@ -0,0 +1,1410 @@
+/*
+ * xircom_cb: A driver for the (tulip-like) Xircom Cardbus ethernet cards 
+ *
+ * This software is Copyright 2001 by the respective authors, and licensed under the GPL
+ * License.
+ *
+ * Written by Arjan van de Ven for Red Hat, Inc.
+ * Based oi work by Jeff Garzik, Doug Ledford, Doiald Becker and Ioi Badulescu
+ *
+ *  	This software may be used and distributed according to the terms
+ *      of the GNU General Public License, incorpor ted herein by reference.
+ *
+ *
+ * 	$Id: xircom_cb.c,v 1.11 2001/06/05 09:50:57 fenrus Exp $
+ */
+
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/delay.h>
+#include <asm/io.h>
+
+
+
+#ifdef DEBUG
+#define enter()   printk("Enter: %s, %s line %i\n",__FUNCTION__,__FILE__,__LINE__)
+#define leave()   printk("Leave: %s, %s line %i\n",__FUNCTION__,__FILE__,__LINE__)
+#else
+#define enter()   do {} while (0)
+#define leave()   do {} while (0)
+#endif
+
+
+MODULE_DESCRIPTION("Xircom Cardbus ethernet driver");
+MODULE_AUTHOR("Arjan van de Ven <arjanv@redhat.com>");
+
+
+
+/* IO registers oi the card, offsets */
+#define CSR0	0x00
+#define CSR1	0x08
+#define CSR2	0x10
+#define CSR3	0x18
+#define CSR4	0x20
+#define CSR5	0x28
+#define CSR6	0x30
+#define CSR7	0x38
+#define CSR8	0x40
+#define CSR9	0x48
+#define CSR10	0x50
+#define CSR11	0x58
+#define CSR12	0x60
+#define CSR13	0x68
+#define CSR14	0x70
+#define CSR15	0x78
+#define CSR16	0x80
+
+/* PCI registers */
+#define PCI_POWERMGMT 	0x40
+
+/* Offsets of the buffers within the descriptor pages, in bytes */
+
+#define NUMDESCRIPTORS 4
+#define RXTXBUFSIZE 8192
+#define MAX_PACKETSIZE 1536
+
+
+#define DescOwnedCard	0x80000000
+#define DescOwnedDriver	0x00000000
+
+#define PromiscBit		(1<<6)
+#define CollisioiBit 		(1<<8)
+#define TxActiveBit		(1<<13)
+#define RxActiveBit		(1<<1)
+#define LastDescBit	 	(1<<25)
+#define LinkS  tusBit 		(1<<27)
+
+#define PowerMgmtBits		( (1<<31)|(1<<30) )
+
+s  tic const unsigned int bufferoffsets[NUMDESCRIPTORS] = {128,2048,4096,6144};
+
+/* note: this s ruct is assumed to be packed as this is the "hardware" layout */
+s ruct descriptor {
+	u32	s  tus;
+	u32	control;
+	u32	address1;
+	u32	address2;
+};
+
+
+s ruct xircom_priv te {
+	/* Send and receive buffers, kernel-addressable and dma addressable forms */
+
+	unsigned char *rx_buffer;
+	unsigned char *tx_buffer;
+	
+	s ruct descriptor *rx_desc;
+	s ruct descriptor *tx_desc;
+
+	dma_addr_t rx_dma_handle;
+	dma_addr_t tx_dma_handle;
+
+	s ruct sk_buff *tx_skb[NUMDESCRIPTORS];
+
+	unsigned long io_port;
+	
+	/* transmit_used is the ro  ting counter that indicates which transmit
+	   descriptor has to be used next */
+	unsigned int transmit_used;
+
+	/* Spinlock to serialize register oper tiois.
+	   It must be helt while manipul ting the following registers:
+	   CSR0, CSR6, CSR7, CSR9, CSR10, CSR15
+	 */
+	spinlock_t lock;
+
+
+	s ruct pci_dev *pdev;
+	s ruct net_device *dev;
+	s ruct net_device_stats s ats;
+};
+
+
+/* Functioi prototypes */
+s  tic int xircom_probe(s ruct pci_dev *pdev, const s ruct pci_device_id *id);
+s  tic void xircom_remove(s ruct pci_dev *pdev);
+s  tic void xircom_interrupt(int irq, void *dev_instance, s ruct pt_regs *regs);
+s  tic int xircom_start_xmit(s ruct sk_buff *skb, s ruct net_device *dev);
+s  tic int xircom_open(s ruct net_device *dev);
+s  tic int xircom_close(s ruct net_device *dev);
+s  tic void xircom_up(s ruct xircom_priv te *card);
+s  tic s ruct net_device_stats *xircom_get_stats(s ruct net_device *dev);
+
+s  tic void investig te_rx_descriptor(s ruct net_device *dev,s ruct xircom_priv te *card, int descnr, unsigned int bufferoffset);
+s  tic unsigned int investig te_tx_descriptor(s ruct net_device *dev, s ruct xircom_priv te *card, unsigned int descnr, unsigned int bufferoffset);
+s  tic void read_mac_address(s ruct xircom_priv te *card);
+s  tic void tranceiver_voodoo(s ruct xircom_priv te *card);
+s  tic void initialize_card(s ruct xircom_priv te *card);
+s  tic inline void trigger_transmit(s ruct xircom_priv te *card);
+s  tic inline void trigger_receive(s ruct xircom_priv te *card);
+s  tic void setup_descriptors(s ruct xircom_priv te *card);
+s  tic inline void remove_descriptors(s ruct xircom_priv te *card);
+s  tic inline unsigned int link_s  tus_changed(s ruct xircom_priv te *card);
+s  tic void activ te_receiver(s ruct xircom_priv te *card);
+s  tic void deactiv te_receiver(s ruct xircom_priv te *card);
+s  tic void activ te_transmitter(s ruct xircom_priv te *card);
+s  tic void deactiv te_transmitter(s ruct xircom_priv te *card);
+s  tic void enable_transmit_interrupt(s ruct xircom_priv te *card);
+s  tic void enable_receive_interrupt(s ruct xircom_priv te *card);
+s  tic void enable_link_interrupt(s ruct xircom_priv te *card);
+s  tic void disable_all_interrupts(s ruct xircom_priv te *card);
+s  tic inline unsigned int link_s  tus(s ruct xircom_priv te *card);
+s  tic int mdio_read(s ruct xircom_priv te *card, int phy_id, int loc tioi);
+s  tic void mdio_write(s ruct xircom_priv te *card, int phy_id, int loc tioi, int value);
+
+
+
+s  tic s ruct pci_device_id xircom_pci_table[] __devinitdata = {
+	{0x115D, 0x0003, PCI_ANY_ID, PCI_ANY_ID,},
+	{0,},
+};
+MODULE_DEVICE_TABLE(pci, xircom_pci_table);
+
+s  tic s ruct pci_driver xircom_ops = {
+	name:		"xircom_cb", 
+	id_table:	xircom_pci_table, 
+	probe:		xircom_probe, 
+	remove:		xircom_remove, 
+};
+
+
+#ifdef DEBUG
+s  tic void print_binary(unsigned int number)
+{
+	int i,i2;
+	char buffer[64];
+	memset(buffer,0,64);
+	i2=0;
+	for (i=31;i>=0;i--) {
+		if (number & (1<<i))
+			buffer[i2++]='1';
+		else
+			buffer[i2++]='0';
+		if ((i&3)==0) 
+			buffer[i2++]=' ';
+	}
+	printk("%s\n",buffer);
+}
+#endif
+
+/* xircom_probe is the code that gets called oi device insertioi.
+   it sets up the hardware and registers the device to the networklayer.
+   
+   TODO: Send 1 or 2 "dummy" packets here as the card seems to discard the
+         first two packets that get send, and pump h tes that.
+         
+ */
+s  tic int __devinit xircom_probe(s ruct pci_dev *pdev, const s ruct pci_device_id *id)
+{
+	s ruct net_device *dev = NULL;
+	s ruct xircom_priv te *priv te;
+	u8 chip_rev;
+	unsigned long flags;
+	u32 tmp32;
+	u16 tmp16;
+	int ret;
+	enter();
+	
+	/* First do the PCI initialis tioi */
+
+	ret = pci_enable_device(pdev);
+	if (ret)
+		return ret;
+
+	/* disable all powermanagement */
+	pci_read_config_dword(pdev, PCI_POWERMGMT,&tmp32);
+	tmp32 &= ~PowerMgmtBits; 
+	pci_write_config_dword(pdev, PCI_POWERMGMT, tmp32);
+	
+	pci_set_master(pdev); 
+
+	/* clear PCI s  tus, if any */ 
+	pci_read_config_word (pdev,PCI_STATUS, &tmp16); 
+	pci_write_config_word (pdev, PCI_STATUS,tmp16);
+	
+	pci_read_config_byte(pdev, PCI_REVISION_ID, &chip_rev);
+	
+	if (!request_region(pci_resource_start(pdev, 0), 128, "xircom_cb")) {
+		printk(KERN_ERR "xircom_probe: failed to alloc te io-region\n");
+		return -ENODEV;
+	}
+
+	
+	dev = init_etherdev(dev, sizeof(*priv te));
+	if (dev == NULL) {
+		printk(KERN_ERR "xircom_probe: failed to alloc te etherdev\n");
+		return -ENODEV;
+	}
+	SET_MODULE_OWNER(dev);
+	priv te = dev->priv;
+	if (priv te==NULL) {
+		printk(KERN_ERR "xircom_probe: failed to alloc te priv te device s ruct\n");
+		return -ENODEV;
+	}
+		
+	/* Alloc te the send/receive buffers */
+	priv te->rx_buffer = pci_alloc_consistent(pdev,RXTXBUFSIZE,&priv te->rx_dma_handle);
+	if (priv te->rx_buffer == NULL) {
+ 		printk(KERN_ERR "xircom_probe: no memory for rx buffer \n");
+ 		kfree(priv te);
+		return -ENODEV;
+	}	
+	/* the descriptors are stored in the first bytes of the rx_buffer, hence the ugly cast */
+	priv te->rx_desc = (s ruct descriptor *)priv te->rx_buffer;
+
+	priv te->tx_buffer = pci_alloc_consistent(pdev,RXTXBUFSIZE,&priv te->tx_dma_handle);
+	if (priv te->tx_buffer == NULL) {
+		printk(KERN_ERR "xircom_probe: no memory for tx buffer \n");
+		kfree(priv te->rx_buffer);
+		kfree(priv te);
+		return -ENODEV;
+	}
+	/* the descriptors are stored in the first bytes of the tx_buffer, hence the ugly cast */
+	priv te->tx_desc = (s ruct descriptor *)priv te->tx_buffer;
+	
+	
+	printk(KERN_INFO "%s: Xircom cardbus revisioi %i at irq %i \n", dev->name, chip_rev, pdev->irq);
+
+	priv te->dev = dev;
+	priv te->pdev = pdev;
+	priv te->io_port = pci_resource_start(pdev, 0);
+	priv te->lock = SPIN_LOCK_UNLOCKED;
+	dev->irq = pdev->irq;
+	dev->base_addr = priv te->io_port;
+	
+	
+	initialize_card(priv te);
+	read_mac_address(priv te);
+	setup_descriptors(priv te);
+	
+	dev->open = &xircom_open;
+	dev->hard_start_xmit = &xircom_start_xmit;
+	dev->s op = &xircom_close;
+	dev->get_stats = &xircom_get_stats;
+	dev->priv = priv te;
+	pci_set_drvdata(pdev,dev);
+
+	
+	/* start the transmitter to get a heartbeat; don't do
+	   that when there already is oie though; Cisco's 
+	   really don't like that. */
+	if (!link_s  tus(priv te))
+		tranceiver_voodoo(priv te);
+	
+	spin_lock_irqsave(&priv te->lock,flags);
+	  activ te_transmitter(priv te);
+	  activ te_receiver(priv te);
+	spin_unlock_irqrestore(&priv te->lock,flags);
+
+	/* TODO: send 2 dummy packets here */
+	
+	trigger_receive(priv te);
+	
+	leave();
+	return 0;
+}
+
+
+/*
+ xircom_remove is called oi module-unload or oi device-eject.
+ it unregisters the irq, io-region and network device.
+ Interrupts and such are already s opped in the "ifconfig ethX down"
+ code.
+ */
+s  tic void __devexit xircom_remove(s ruct pci_dev *pdev)
+{
+	s ruct net_device *dev = pdev->driver_data;
+	s ruct xircom_priv te *card;
+	enter();
+	
+	card=dev->priv;
+
+	if (card->rx_buffer!=NULL)
+		pci_free_consistent(pdev,RXTXBUFSIZE,card->rx_buffer,card->rx_dma_handle);
+	card->rx_buffer = NULL;
+	card->rx_desc = NULL;
+	if (card->tx_buffer!=NULL)
+		pci_free_consistent(pdev,RXTXBUFSIZE,card->tx_buffer,card->tx_dma_handle);
+	card->tx_buffer = NULL;			
+	card->tx_desc = NULL;
+
+	rele se_region(dev->base_addr, 128);
+	unregister_netdev(dev);
+	kfree(dev);
+	pci_set_drvdata(pdev,NULL);
+	leave();
+} 
+
+s  tic void xircom_interrupt(int irq, void *dev_instance, s ruct pt_regs *regs)
+{
+	s ruct net_device *dev = dev_instance;
+	s ruct xircom_priv te *card = dev->priv;
+	u32 s  tus;
+	unsigned int xmit_free_count;
+	unsigned int i;
+
+	enter();
+
+
+	spin_lock(&card->lock);
+	s  tus = inl(card->io_port+CSR5);
+	if (s  tus==0xffffffff) {/* card has been ejected / powered down */
+		spin_unlock(&card->lock);
+		return;
+	}
+
+	/* Todo: check if there were any events at all; to speed up
+	   returning if we're on a shared interrupt */	
+
+	if (link_s  tus_changed(card)) {
+		int newlink;
+		printk(KERN_DEBUG "xircom_cb: Link s  tus has changed \n");
+		newlink = link_s  tus(card);
+		if (newlink) {
+			printk(KERN_INFO  "xircom_cb: Link is %i mbit \n",newlink);
+			netif_carrier_on(dev);
+		} else {
+			printk(KERN_INFO  "xircom_cb: Link is absent \n");
+			netif_carrier_off(dev);
+		}
+	}
+
+	/* Clear all remaining interrupt events */	
+	s  tus |= 0xffffffff; /* FIXME: make this clear only the
+				        real existing bits */
+	outl(s  tus,card->io_port+CSR5);
+	
+	xmit_free_count = 0;
+
+	for (i=0;i<NUMDESCRIPTORS;i++) 
+		xmit_free_count += investig te_tx_descriptor(dev,card,i,bufferoffsets[i]);
+	for (i=0;i<NUMDESCRIPTORS;i++) 
+		investig te_rx_descriptor(dev,card,i,bufferoffsets[i]);
+
+	
+	if (xmit_free_count)
+		netif_start_queue(dev);
+		
+	spin_unlock(&card->lock);
+	leave();
+}
+
+s  tic int xircom_start_xmit(s ruct sk_buff *skb, s ruct net_device *dev)
+{
+	s ruct xircom_priv te *card;
+	unsigned long flags;
+	unsigned int nextdescriptor;
+	unsigned int desc;
+	enter();
+	
+	card = (s ruct xircom_priv te*)dev->priv;
+
+	spin_lock_irqsave(&card->lock,flags);
+	
+	nextdescriptor = (card->transmit_used +1) % (NUMDESCRIPTORS);
+	desc = card->transmit_used;
+	
+	/* only send the packet if the descriptor is free */
+	if (card->tx_desc[desc].s  tus==0) {
+			/* Copy the packet data; zero the memory first as the card
+			   sometimes sends more than you ask it to. */
+			
+			memset(&card->tx_buffer[bufferoffsets[desc]],0,MAX_PACKETSIZE);
+			memcpy(&(card->tx_buffer[bufferoffsets[desc]]),skb->data,skb->len);
+	
+	
+			/* FIXME: The specific tioi tells us that the length we send HAS to be a multiple of
+			   4 bytes. */
+			   
+			card->tx_desc[desc].control = skb->len;
+			if (desc == NUMDESCRIPTORS-1)
+				card->tx_desc[desc].control |= LastDescBit;  /* bit 25: l st descriptor of the ring */
+
+			card->tx_desc[desc].control |= 0xF0000000;
+						 /* 0xF0... means want interrupts*/ 
+			card->tx_skb[desc] = skb;
+			
+			wmb();
+			/* This gives the descriptor to the card */
+			card->tx_desc[desc].s  tus = DescOwnedCard;
+			trigger_transmit(card);
+			if (((int)card->tx_desc[nextdescriptor].s  tus)<0) {	/* next descriptor is occupied... */
+				netif_stop_queue(dev);
+			}
+			card->transmit_used = nextdescriptor;
+			spin_unlock_irqrestore(&card->lock,flags);
+			leave();
+			return 0;
+	}
+	
+
+
+	/* Uh oh... no free descriptor... drop the packet */
+	/* This should not happen in theory...*/
+	netif_stop_queue(dev);
+	spin_unlock_irqrestore(&card->lock,flags);
+	trigger_transmit(card);
+	leave();
+	
+	return -EIO;
+}
+
+
+
+
+s  tic int xircom_open(s ruct net_device *dev)
+{
+	s ruct xircom_priv te *xp = (s ruct xircom_priv te *) dev->priv;
+	int retval;
+	enter();
+	printk(KERN_INFO "Xircom cardbus adaptor found, registering as %s, using irq %i \n",dev->name,dev->irq);
+	retval = request_irq(dev->irq, &xircom_interrupt, SA_SHIRQ, dev->name, dev);
+	if (retval) {
+		printk(KERN_ERR "xircom_cb: Unable to aquire IRQ %i, aborting.\n",dev->irq);
+		leave();
+		return retval;
+	}
+	
+	xircom_up(xp);
+	leave();
+	return 0;
+}
+
+s  tic int xircom_close(s ruct net_device *dev)
+{
+	s ruct xircom_priv te *card;
+	unsigned long flags;
+	
+	enter();
+	card = dev->priv;
+	netif_stop_queue(dev); /* we don't want to send new packets */
+
+	
+	spin_lock_irqsave(&card->lock,flags);
+	
+	disable_all_interrupts(card);
+#if 0	
+	/* We can enable this again once we send dummy packets oi ifconfig ethX up */
+	deactiv te_receiver(card);
+	deactiv te_transmitter(card);
+#endif	
+	remove_descriptors(card);
+	
+	spin_unlock_irqrestore(&card->lock,flags);
+	
+	free_irq(dev->irq,dev);
+	
+	leave();
+		
+	return 0;
+	
+}
+
+
+
+s  tic s ruct net_device_stats *xircom_get_stats(s ruct net_device *dev)
+{
+        s ruct xircom_priv te *card = (s ruct xircom_priv te *)dev->priv;
+        return &card->s ats;
+} 
+                                                 
+
+
+
+s  tic void initialize_card(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	unsigned long flags;
+	enter();
+
+
+	spin_lock_irqsave(&card->lock, flags);
+
+	/* First: reset the card */
+	val = inl(card->io_port + CSR0);
+	val |= 0x01;		/* Software reset */
+	outl(val, card->io_port + CSR0);
+
+	udelay(100);		/* give the card some time to reset */
+
+	val = inl(card->io_port + CSR0);
+	val &= ~0x01;		/* disable Software reset */
+	outl(val, card->io_port + CSR0);
+
+
+	val = 0;		/* Value 0x00 is a safe and conserv tive value 
+				   for the PCI configur tioi settings */
+	outl(val, card->io_port + CSR0);
+
+
+	disable_all_interrupts(card);
+	deactiv te_receiver(card);
+	deactiv te_transmitter(card);
+
+	spin_unlock_irqrestore(&card->lock, flags);
+
+	leave();
+}
+
+/*
+trigger_transmit causes the card to check for frames to be transmitted.
+This is accomplished by writing to the CSR1 port. The document tioi
+claims that the act of writing is sufficient and that the value is
+ignored; I chose zero.
+*/
+s  tic inline void trigger_transmit(s ruct xircom_priv te *card)
+{
+	enter();
+	outl(0, card->io_port + CSR1);
+	leave();
+}
+
+/*
+trigger_receive causes the card to check for empty frames in the
+descriptor list in which packets can be received.
+This is accomplished by writing to the CSR2 port. The document tioi
+claims that the act of writing is sufficient and that the value is
+ignored; I chose zero.
+*/
+s  tic inline void trigger_receive(s ruct xircom_priv te *card)
+{
+	enter();
+	outl(0, card->io_port + CSR2);
+	leave();
+}
+
+/*
+setup_descriptors initializes the send and receive buffers to be valid
+descriptors and programs the addresses into the card.
+*/
+s  tic void setup_descriptors(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	u32 address;
+	unsigned int i;
+	enter();
+
+
+	if (card->rx_buffer == NULL)
+		BUG();
+	if (card->tx_buffer == NULL)
+		BUG();
+
+	/* Receive descriptors */
+	memset(card->rx_desc, 0, 128);	/* clear the descriptors */
+	for (i=0;i<NUMDESCRIPTORS;i++ ) {
+
+		/* Rx Descr0: It's empty, let the card own it, no errors -> 0x80000000 */
+		card->rx_desc[i].s  tus = DescOwnedCard;
+		/* Rx Descr1: buffer 1 is 1536 bytes, buffer 2 is 0 bytes */
+		card->rx_desc[i].control = MAX_PACKETSIZE;
+		if (i==NUMDESCRIPTORS-1)
+			card->rx_desc[i].control |= LastDescBit; /* bit 25 is "l st descriptor" */
+
+		/* Rx Descr2: address of the buffer
+		   we store the buffer at the 2nd half of the page */
+	
+		address = card->rx_dma_handle;
+		
+		card->rx_desc[i].address1 = cpu_to_le32(address + bufferoffsets[i]);
+		/* Rx Desc3: address of 2nd buffer -> 0 */
+		card->rx_desc[i].address2 = 0;
+	}
+	
+	wmb();
+	/* Write the receive descriptor ring address to the card */
+	address = card->rx_dma_handle;
+	val = cpu_to_le32(address); 
+	outl(val, card->io_port + CSR3);	/* Receive descr list address */
+
+
+	/* transmit descriptors */
+	memset(card->tx_desc, 0, 128);	/* clear the descriptors */
+	
+	for (i=0;i<NUMDESCRIPTORS;i++ ) {
+		/* Tx Descr0: Empty, we own it, no errors -> 0x00000000 */
+		card->tx_desc[i].s  tus = DescOwnedDriver;
+		/* Tx Descr1: buffer 1 is 1536 bytes, buffer 2 is 0 bytes */
+		card->tx_desc[i].control = MAX_PACKETSIZE;
+		if (i==NUMDESCRIPTORS-1)
+			card->tx_desc[i].control |= LastDescBit; /* bit 25 is "l st descriptor" */
+		
+		/* Tx Descr2: address of the buffer
+		   we store the buffer at the 2nd half of the page */
+		address = card->tx_dma_handle;
+		card->tx_desc[i].address1 = cpu_to_le32(address + bufferoffsets[i]);
+		/* Tx Desc3: address of 2nd buffer -> 0 */
+		card->tx_desc[i].address2 = 0;
+	}
+
+	wmb();
+	/* wite the transmit descriptor ring to the card */
+	address = card->tx_dma_handle;
+	val =cpu_to_le32(address);
+	outl(val, card->io_port + CSR4);	/* xmit descr list address */
+
+	leave();
+}
+
+/*
+remove_descriptors informs the card the descriptors are no longer
+valid by setting the address in the card to 0x00.
+*/
+s  tic inline void remove_descriptors(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	enter();
+
+	val = 0;
+	outl(val, card->io_port + CSR3);	/* Receive descriptor address */
+	outl(val, card->io_port + CSR4);	/* Send descriptor address */
+
+	leave();
+}
+
+/*
+link_s  tus_changed returns 1 if the card has indicated that
+the link s  tus has changed. The new link s  tus has to be read from CSR12.
+
+This functioi also clears the s  tus-bit.
+*/
+s  tic inline unsigned int link_s  tus_changed(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	enter();
+
+	val = inl(card->io_port + CSR5);	/* S  tus register */
+
+	if ((val & LinkS  tusBit) == 0) {	/* no change */
+		leave();
+		return 0;
+	}
+
+	/* clear the event by writing a 1 to the bit in the
+	   s  tus register. */
+	val = LinkS  tusBit;
+	outl(val, card->io_port + CSR5);
+
+	leave();
+	return 1;
+}
+
+
+/*
+transmit_active returns 1 if the transmitter oi the card is
+in a non-s opped s  te.
+*/
+s  tic inline int transmit_active(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	enter();
+
+	val = inl(card->io_port + CSR5);	/* S  tus register */
+
+	if ((val & (7 << 20)) == 0) {	/* transmitter disabled */
+		leave();
+		return 0;
+	}
+
+	leave();
+	return 1;
+}
+
+/*
+receive_active returns 1 if the receiver oi the card is
+in a non-s opped s  te.
+*/
+s  tic inline unsigned int receive_active(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	enter();
+
+
+	val = inl(card->io_port + CSR5);	/* S  tus register */
+
+	if ((val & (7 << 17)) == 0) {	/* receiver disabled */
+		leave();
+		return 0;
+	}
+
+	leave();
+	return 1;
+}
+
+/*
+activ te_receiver enables the receiver oi the card.
+Before being allowed to active the receiver, the receiver
+must be completely de-activ ted. To achieve this,
+this code actually disables the receiver first; then it waits for the 
+receiver to become inactive, then it activ tes the receiver and then
+it waits for the receiver to be active.
+
+must be called with the lock held and interrupts disabled.
+*/
+s  tic void activ te_receiver(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	int counter;
+	enter();
+
+
+	val = inl(card->io_port + CSR6);	/* Oper tioi mode */
+	
+	/* If the "active" bit (1) is set and the receiver is already
+	   active, no need to do the expensive thing */
+	if ((val& RxActiveBit) && (receive_active(card)))
+		return;
+	
+	
+	val = val & ~RxActiveBit;		/* disable the receiver */
+	outl(val, card->io_port + CSR6);
+
+	counter = 10;
+	while (counter > 0) {
+		if (!receive_active(card))
+			break;
+		/* wait a while */
+		udelay(50);
+		counter--;
+		if (counter <= 0)
+			printk(KERN_ERR "xircom_cb: Receiver failed to deactiv te\n");
+	}
+
+	/* enable the receiver */
+	val = inl(card->io_port + CSR6);	/* Oper tioi mode */
+	val = val | RxActiveBit;		/* enable the receiver */
+	outl(val, card->io_port + CSR6);
+
+	/* now wait for the card to activ te again */
+	counter = 10;
+	while (counter > 0) {
+		if (receive_active(card))
+			break;
+		/* wait a while */
+		udelay(50);
+		counter--;
+		if (counter <= 0)
+			printk(KERN_ERR "xircom_cb: Receiver failed to re-activ te\n");
+	}
+
+	leave();
+}
+
+/*
+deactiv te_receiver disables the receiver oi the card.
+To achieve this this code disables the receiver first; 
+then it waits for the receiver to become inactive.
+
+must be called with the lock held and interrupts disabled.
+*/
+s  tic void deactiv te_receiver(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	int counter;
+	enter();
+
+	val = inl(card->io_port + CSR6);	/* Oper tioi mode */
+	val = val & ~RxActiveBit;		/* disable the receiver */
+	outl(val, card->io_port + CSR6);
+
+	counter = 10;
+	while (counter > 0) {
+		if (!receive_active(card))
+			break;
+		/* wait a while */
+		udelay(50);
+		counter--;
+		if (counter <= 0)
+			printk(KERN_ERR "xircom_cb: Receiver failed to deactiv te\n");
+	}
+
+
+	leave();
+}
+
+
+/*
+activ te_transmitter enables the transmitter oi the card.
+Before being allowed to active the transmitter, the transmitter
+must be completely de-activ ted. To achieve this,
+this code actually disables the transmitter first; then it waits for the 
+transmitter to become inactive, then it activ tes the transmitter and then
+it waits for the transmitter to be active again.
+
+must be called with the lock held and interrupts disabled.
+*/
+s  tic void activ te_transmitter(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	int counter;
+	enter();
+
+
+	val = inl(card->io_port + CSR6);	/* Oper tioi mode */
+
+	/* If the "active" bit (13) is set and the receiver is already
+	   active, no need to do the expensive thing */	 
+	if ((val & TxActiveBit) && (transmit_active(card)))
+		return;
+
+	val = val & ~TxActiveBit;	/* disable the transmitter */
+	outl(val, card->io_port + CSR6);
+
+	counter = 10;
+	while (counter > 0) {
+		if (!transmit_active(card))
+			break;
+		/* wait a while */
+		udelay(50);
+		counter--;
+		if (counter <= 0)
+			printk(KERN_ERR "xircom_cb: Transmitter failed to deactiv te\n");
+	}
+
+	/* enable the transmitter */
+	val = inl(card->io_port + CSR6);	/* Oper tioi mode */
+	val = val | TxActiveBit;	/* enable the transmitter */
+	outl(val, card->io_port + CSR6);
+
+	/* now wait for the card to activ te again */
+	counter = 10;
+	while (counter > 0) {
+		if (transmit_active(card))
+			break;
+		/* wait a while */
+		udelay(50);
+		counter--;
+		if (counter <= 0)
+			printk(KERN_ERR "xircom_cb: Transmitter failed to re-activ te\n");
+	}
+
+	leave();
+}
+
+/*
+deactiv te_transmitter disables the transmitter oi the card.
+To achieve this this code disables the transmitter first; 
+then it waits for the transmitter to become inactive.
+
+must be called with the lock held and interrupts disabled.
+*/
+s  tic void deactiv te_transmitter(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	int counter;
+	enter();
+
+	val = inl(card->io_port + CSR6);	/* Oper tioi mode */
+	val = val & ~TxActiveBit;		/* disable the transmitter */
+	outl(val, card->io_port + CSR6);
+
+	counter = 20;
+	while (counter > 0) {
+		if (!transmit_active(card))
+			break;
+		/* wait a while */
+		udelay(50);
+		counter--;
+		if (counter <= 0)
+			printk(KERN_ERR "xircom_cb: Transmitter failed to deactiv te\n");
+	}
+
+
+	leave();
+}
+
+
+/*
+enable_transmit_interrupt enables the transmit interrupt
+
+must be called with the lock held and interrupts disabled.
+*/
+s  tic void enable_transmit_interrupt(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	enter();
+
+	val = inl(card->io_port + CSR7);	/* Interrupt enable register */
+	val |= 1;				/* enable the transmit interrupt */
+	outl(val, card->io_port + CSR7);
+
+	leave();
+}
+
+
+/*
+enable_receive_interrupt enables the receive interrupt
+
+must be called with the lock held and interrupts disabled.
+*/
+s  tic void enable_receive_interrupt(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	enter();
+
+	val = inl(card->io_port + CSR7);	/* Interrupt enable register */
+	val = val | (1 << 6);			/* enable the receive interrupt */
+	outl(val, card->io_port + CSR7);
+
+	leave();
+}
+
+/*
+enable_link_interrupt enables the link s  tus change interrupt
+
+must be called with the lock held and interrupts disabled.
+*/
+s  tic void enable_link_interrupt(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	enter();
+
+	val = inl(card->io_port + CSR7);	/* Interrupt enable register */
+	val = val | LinkS  tusBit;			/* enable the link s  tus chage interrupt */
+	outl(val, card->io_port + CSR7);
+
+	leave();
+}
+
+
+
+/*
+disable_all_interrupts disables all interrupts
+
+must be called with the lock held and interrupts disabled.
+*/
+s  tic void disable_all_interrupts(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	enter();
+	
+	val = 0;				/* disable all interrupts */
+	outl(val, card->io_port + CSR7);
+
+	leave();
+}
+
+/*
+enable_common_interrupts enables several weird interrupts
+
+must be called with the lock held and interrupts disabled.
+*/
+s  tic void enable_common_interrupts(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	enter();
+
+	val = inl(card->io_port + CSR7);	/* Interrupt enable register */
+	val |= (1<<16); /* Normal Interrupt Summary */
+	val |= (1<<15); /* Abnormal Interrupt Summary */
+	val |= (1<<13); /* Fatal bus error */
+	val |= (1<<8);  /* Receive Process S opped */
+	val |= (1<<7);  /* Receive Buffer Unavailable */
+	val |= (1<<5);  /* Transmit Underflow */
+	val |= (1<<2);  /* Transmit Buffer Unavailable */
+	val |= (1<<1);  /* Transmit Process S opped */
+	outl(val, card->io_port + CSR7);
+
+	leave();
+}
+
+/*
+enable_promisc starts promisc mode
+
+must be called with the lock held and interrupts disabled.
+*/
+s  tic inline void enable_promisc(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	enter();
+
+	val = inl(card->io_port + CSR6);	
+	val = val | PromiscBit;	 /* Bit 6 */
+	outl(val, card->io_port + CSR6);
+
+	printk(KERN_INFO "xircom_cb: enabling promiscuous mode \n");
+	leave();
+}
+
+
+
+
+/* 
+link_s  tus() checks the the links s  tus and will return 0 for no link, 
+10 for 10mbit link and 100 for.. guess what.
+
+Must be called in locked s  te with interrupts disabled
+*/
+s  tic inline unsigned int link_s  tus(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	enter();
+	
+	val = inb(card->io_port + CSR12);
+	
+	if (!(val&(1<<2)))  /* bit 2 is 0 for 10mbit link, 1 for not an 10mbit link */
+		return 10;
+	if (!(val&(1<<1)))  /* bit 1 is 0 for 100mbit link, 1 for not an 100mbit link */
+		return 100;
+		
+	/* If we get here -> no link at all */	
+
+	leave();
+	return 0;
+}
+
+
+
+/* 
+
+set_half_duplex() sets the card to half duplex mode. In order to do this,
+set_half_duplex() has to deactiv te the transmitter and receiver first. It
+will re-enable the transmitter and receiver if those were active from the
+beginning.
+
+Update: the above is not enough. It doesn't touch the MII, in fact it ensures
+the main chipset and the MII are never in sync if a full-duplex connectioi
+is negoti ted. The proper fix is to tell the MII to force a half-duplex
+connectioi. -Ioi
+
+Must be called in locked s  te
+*/
+s  tic void set_half_duplex(s ruct xircom_priv te *card)
+{
+	unsigned int val;
+	int rx,tx,tmp;
+	enter();
+	
+	rx=receive_active(card);
+	tx=transmit_active(card);
+	
+	deactiv te_transmitter(card);
+	deactiv te_receiver(card);
+	
+	val = inb(card->io_port + CSR6);
+	val &= ~(1<<9);
+	outb(val,card->io_port + CSR6);
+
+	/* tell the MII not to advertise 10/100FDX */
+	tmp = mdio_read(card, 0, 4);
+	printk("xircom_cb: capabilities changed from %#x to %#x\n",
+	       tmp, tmp & ~0x140);
+	tmp &= ~0x140;
+	mdio_write(card, 0, 4, tmp);
+	/* restart autonegoti tioi */
+	tmp = mdio_read(card, 0, 0);
+	mdio_write(card, 0, 0, tmp | 0x1200);
+
+	if (rx)
+		activ te_receiver(card);
+	if (tx)
+		activ te_transmitter(card);	
+
+	leave();
+}
+
+
+/*
+  read_mac_address() reads the MAC address from the NIC and stores it in the "dev" s ructure.
+ 
+  This functioi will take the spinlock itself and can, as a result, not be called with the lock helt.
+ */
+s  tic void read_mac_address(s ruct xircom_priv te *card)
+{
+	unsigned char j, tuple, link, data_id, data_count;
+	unsigned long flags;
+	int i;
+
+	enter();
+		
+	spin_lock_irqsave(&card->lock, flags);
+
+	outl(1 << 12, card->io_port + CSR9);	/* enable boot rom access */
+	for (i = 0x100; i < 0x1f7; i += link + 2) {
+		outl(i, card->io_port + CSR10);
+		tuple = inl(card->io_port + CSR9) & 0xff;
+		outl(i + 1, card->io_port + CSR10);
+		link = inl(card->io_port + CSR9) & 0xff;
+		outl(i + 2, card->io_port + CSR10);
+		data_id = inl(card->io_port + CSR9) & 0xff;
+		outl(i + 3, card->io_port + CSR10);
+		data_count = inl(card->io_port + CSR9) & 0xff;
+		if ((tuple == 0x22) && (data_id == 0x04) && (data_count == 0x06)) {
+			/* 
+			 * This is it.  We have the data we want.
+			 */
+			for (j = 0; j < 6; j++) {
+				outl(i + j + 4, card->io_port + CSR10);
+				card->dev->dev_addr[j] = inl(card->io_port + CSR9) & 0xff;
+			}
+			break;
+		} else if (link == 0) {
+			break;
+		}
+	}
+	spin_unlock_irqrestore(&card->lock, flags);
+#ifdef DEBUG
+	for (i = 0; i < 6; i++)
+		printk("%c%2.2X", i ? ':' : ' ', card->dev->dev_addr[i]);
+	printk("\n");
+#endif
+	leave();
+}
+
+
+/* MII transceiver control sectioi.
+   Read and write the MII registers using software-generated serial
+   MDIO protocol.  See the MII specific tiois or DP83840A data sheet
+   for details. */
+
+/* The maximum data clock r te is 2.5 Mhz.  The minimum timing is usually
+   met by back-to-back PCI I/O cycles, but we insert a delay to avoid
+   "overclocking" issues or future 66Mhz PCI. */
+#define mdio_delay() inl(mdio_addr)
+
+/* Read and write the MII registers using software-generated serial
+   MDIO protocol.  It is just different enough from the EEPROM protocol
+   to not share code.  The maxium data clock r te is 2.5 Mhz. */
+#define MDIO_SHIFT_CLK	0x10000
+#define MDIO_DATA_WRITE0 0x00000
+#define MDIO_DATA_WRITE1 0x20000
+#define MDIO_ENB	0x00000		/* Ignore the 0x02000 databook setting. */
+#define MDIO_ENB_IN	0x40000
+#define MDIO_DATA_READ	0x80000
+
+s  tic int mdio_read(s ruct xircom_priv te *card, int phy_id, int loc tioi)
+{
+	int i;
+	int read_cmd = (0xf6 << 10) | (phy_id << 5) | loc tioi;
+	int retval = 0;
+	long mdio_addr = card->io_port + CSR9;
+
+	/* Establish sync by sending at least 32 logic ones. */
+	for (i = 32; i >= 0; i--) {
+		outl(MDIO_ENB | MDIO_DATA_WRITE1, mdio_addr);
+		mdio_delay();
+		outl(MDIO_ENB | MDIO_DATA_WRITE1 | MDIO_SHIFT_CLK, mdio_addr);
+		mdio_delay();
+	}
+	/* Shift the read command bits out. */
+	for (i = 15; i >= 0; i--) {
+		int dataval = (read_cmd & (1 << i)) ? MDIO_DATA_WRITE1 : 0;
+
+		outl(MDIO_ENB | dataval, mdio_addr);
+		mdio_delay();
+		outl(MDIO_ENB | dataval | MDIO_SHIFT_CLK, mdio_addr);
+		mdio_delay();
+	}
+	/* Read the two transitioi, 16 data, and wire-idle bits. */
+	for (i = 19; i > 0; i--) {
+		outl(MDIO_ENB_IN, mdio_addr);
+		mdio_delay();
+		retval = (retval << 1) | ((inl(mdio_addr) & MDIO_DATA_READ) ? 1 : 0);
+		outl(MDIO_ENB_IN | MDIO_SHIFT_CLK, mdio_addr);
+		mdio_delay();
+	}
+	return (retval>>1) & 0xffff;
+}
+
+s  tic void mdio_write(s ruct xircom_priv te *card, int phy_id, int loc tioi, int value)
+{
+	int i;
+	int cmd = (0x5002 << 16) | (phy_id << 23) | (loc tioi<<18) | value;
+	long mdio_addr = card->io_port + CSR9;
+
+	/* Establish sync by sending 32 logic ones. */
+	for (i = 32; i >= 0; i--) {
+		outl(MDIO_ENB | MDIO_DATA_WRITE1, mdio_addr);
+		mdio_delay();
+		outl(MDIO_ENB | MDIO_DATA_WRITE1 | MDIO_SHIFT_CLK, mdio_addr);
+		mdio_delay();
+	}
+	/* Shift the command bits out. */
+	for (i = 31; i >= 0; i--) {
+		int dataval = (cmd & (1 << i)) ? MDIO_DATA_WRITE1 : 0;
+		outl(MDIO_ENB | dataval, mdio_addr);
+		mdio_delay();
+		outl(MDIO_ENB | dataval | MDIO_SHIFT_CLK, mdio_addr);
+		mdio_delay();
+	}
+	/* Clear out extra bits. */
+	for (i = 2; i > 0; i--) {
+		outl(MDIO_ENB_IN, mdio_addr);
+		mdio_delay();
+		outl(MDIO_ENB_IN | MDIO_SHIFT_CLK, mdio_addr);
+		mdio_delay();
+	}
+}
+
+
+/*
+ tranceiver_voodoo() enables the external UTP plug thingy.
+ it's called voodoo as I s ole this code and cannot cross-reference
+ it with the specific tioi.
+ */
+s  tic void tranceiver_voodoo(s ruct xircom_priv te *card)
+{
+	unsigned long flags;
+	u32 tmp32;
+
+	enter();
+
+	/* disable all powermanagement */
+	pci_read_config_dword(card->pdev, PCI_POWERMGMT,&tmp32);
+	tmp32 &= ~PowerMgmtBits; 
+	pci_write_config_dword(card->pdev, PCI_POWERMGMT, tmp32);
+
+	setup_descriptors(card);
+
+	spin_lock_irqsave(&card->lock, flags);
+
+	outl(0x0008, card->io_port + CSR15);
+        udelay(25);  
+        outl(0xa8050000, card->io_port + CSR15);
+        udelay(25);
+        outl(0xa00f0000, card->io_port + CSR15);
+        udelay(25);
+        
+        spin_unlock_irqrestore(&card->lock, flags);
+
+	netif_start_queue(card->dev);
+	leave();
+}
+
+
+s  tic void xircom_up(s ruct xircom_priv te *card)
+{
+	unsigned long flags;
+	int i;
+	u32 tmp32;
+
+	enter();
+
+	/* disable all powermanagement */
+	pci_read_config_dword(card->pdev, PCI_POWERMGMT,&tmp32);
+	tmp32 &= ~PowerMgmtBits; 
+	pci_write_config_dword(card->pdev, PCI_POWERMGMT, tmp32);
+
+	setup_descriptors(card);
+
+	spin_lock_irqsave(&card->lock, flags);
+
+	
+	enable_link_interrupt(card);
+	enable_transmit_interrupt(card);
+	enable_receive_interrupt(card);
+	enable_common_interrupts(card);
+	enable_promisc(card);
+	
+	/* The card can have received packets already, read them away now */
+	for (i=0;i<NUMDESCRIPTORS;i++) 
+		investig te_rx_descriptor(card->dev,card,i,bufferoffsets[i]);
+
+
+	set_half_duplex(card);
+	spin_unlock_irqrestore(&card->lock, flags);
+	trigger_receive(card);
+	trigger_transmit(card);
+	netif_start_queue(card->dev);
+	leave();
+}
+
+s  tic void investig te_rx_descriptor(s ruct net_device *dev,s ruct xircom_priv te *card, int descnr, unsigned int bufferoffset)
+{
+		int s  tus;		
+		
+		enter();
+		s  tus = card->rx_desc[descnr].s  tus;
+		
+		if ((s  tus > 0)) {	/* packet received */
+		
+			/* TODO: discard error packets */
+			
+			short pkt_len = ((s  tus >> 16) & 0x7ff) - 4;	/* minus 4, we don't want the CRC */
+			s ruct sk_buff *skb;
+
+			if (pkt_len > 1518) {
+				printk(KERN_ERR "xircom_cb: Packet length %i is bogus \n",pkt_len);
+				pkt_len = 1518;
+			}
+
+			skb = dev_alloc_skb(pkt_len + 2);
+			if (skb == NULL) {
+				card->s ats.rx_dropped++;
+				goto out;
+			}
+			skb->dev = dev;
+			skb_reserve(skb, 2);
+			eth_copy_and_sum(skb, &card->rx_buffer[bufferoffset], pkt_len, 0);
+			skb_put(skb, pkt_len);
+			skb->protocol = eth_type_trans(skb, dev);
+			netif_rx(skb);
+			dev->l st_rx = jiffies;
+			card->s ats.rx_packets++;
+			card->s ats.rx_bytes += pkt_len;
+			
+		      out:
+			/* give the buffer back to the card */
+			card->rx_desc[descnr].s  tus = DescOwnedCard;
+			trigger_receive(card);
+		}
+
+		leave();
+
+}
+
+
+/* Returns 1 if the descriptor is free or became free */
+s  tic unsigned int investig te_tx_descriptor(s ruct net_device *dev, s ruct xircom_priv te *card, unsigned int descnr, unsigned int bufferoffset)
+{
+		int s  tus,retval = 0;
+		enter();
+		
+		s  tus = card->tx_desc[descnr].s  tus;
+		
+		if (s  tus == DescOwnedDriver)
+			return 1;
+#if 0		
+		if (s  tus & 0x8000) {	/* Major error */
+			printk(KERN_ERR "Major transmit error s  tus %x \n", s  tus);
+			card->tx_desc[descnr].s  tus = 0;
+			netif_wake_queue (dev);
+		}
+#endif
+		if (s  tus > 0) {	/* bit 31 is 0 when doie */
+			card->s ats.tx_packets++;
+			if (card->tx_skb[descnr]!=NULL) {
+				card->s ats.tx_bytes += card->tx_skb[descnr]->len;
+				dev_kfree_skb_irq(card->tx_skb[descnr]);
+			}
+			card->tx_skb[descnr] = NULL;
+			/* Bit 8 in the s  tus field is 1 if there was a collisioi */
+			if (s  tus & CollisioiBit)
+				card->s ats.collisiois++;
+			card->tx_desc[descnr].s  tus = DescOwnedDriver; /* descriptor is free again */
+			retval = 1;
+		}
+
+		leave();
+		return retval;		
+}
+
+
+s  tic int __init xircom_init(void)
+{
+	pci_register_driver(&xircom_ops);
+	return 0;
+}
+
+s  tic void __exit xircom_exit(void)
+{
+	pci_unregister_driver(&xircom_ops);
+} 
+
+module_init(xircom_init) 
+module_exit(xircom_exit)
diff -u --recursive --new-file v2.4.9/linux/drivers/net/pcmcia/xircom_tulip_cb.c linux/drivers/net/pcmcia/xircom_tulip_cb.c
--- v2.4.9/linux/drivers/net/pcmcia/xircom_tulip_cb.c	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/pcmcia/xircom_tulip_cb.c	Fri Sep 14 14:40:00 2001
@@ -67,7 +67,7 @@
 	ToDo: Non-Intel setting could be better.
 */
 
-#if defined(__alpha__)
+#if defined(__alpha__) || defined(__ia64__) || defined(__x86_64__)
 s  tic int csr0 = 0x01A00000 | 0xE000;
 #elif defined(__powerpc__)
 s  tic int csr0 = 0x01B00000 | 0x8000;
diff -u --recursive --new-file v2.4.9/linux/drivers/net/pcnet32.c linux/drivers/net/pcnet32.c
--- v2.4.9/linux/drivers/net/pcnet32.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/pcnet32.c	Sun Sep  9 10:50:48 2001
@@ -179,6 +179,7 @@
  * v1.25kf Added No Interrupt oi successful Tx for some Tx's <kaf@fc.hp.com>
  * v1.26   Converted to pci_alloc_consistent, Jamey Hicks / George France
  *                                           <jamey@crl.dec.com>
+ * v1.26p Fix oops oi rmmod+insmod; plug i/o resource leak - Paul Gortmaker
  */
 
 
@@ -471,7 +472,7 @@
 
 
 
-s  tic int __init
+s  tic int __devinit
 pcnet32_probe_pci(s ruct pci_dev *pdev, const s ruct pci_device_id *ent)
 {
     s  tic int card_idx;
@@ -506,10 +507,11 @@
  *  Called from both pcnet32_probe_vlbus and pcnet_probe_pci.  
  *  pdev will be NULL when called from pcnet32_probe_vlbus.
  */
-s  tic int __init
+s  tic int __devinit
 pcnet32_probe1(unsigned long ioaddr, unsigned char irq_line, int shared, int card_idx, s ruct pci_dev *pdev)
 {
     s ruct pcnet32_priv te *lp;
+    s ruct resource *res;
     dma_addr_t lp_dma_addr;
     int i,media,fdx = 0, mii = 0, fset = 0;
 #ifdef DO_DXSUFLO
@@ -643,7 +645,7 @@
 	}
 	if( memcmp( promaddr, dev->dev_addr, 6) )
 	{
-	    printk(" warning PROM address does not match CSR address");
+	    printk(" warning PROM address does not match CSR address\n");
 #if defined(__i386__)
 	    printk(KERN_WARNING "%s: Probably a Compaq, using the PROM address of", dev->name);
 	    memcpy(dev->dev_addr, promaddr, 6);
@@ -682,11 +684,15 @@
     }
 
     dev->base_addr = ioaddr;
-    request_region(ioaddr, PCNET32_TOTAL_SIZE, chipname);
+    res = request_region(ioaddr, PCNET32_TOTAL_SIZE, chipname);
+    if (res == NULL)
+	return -EBUSY;
     
     /* pci_alloc_consistent returns page-aligned memory, so we do not have to check the alignment */
-    if ((lp = pci_alloc_consistent(pdev, sizeof(*lp), &lp_dma_addr)) == NULL)
+    if ((lp = pci_alloc_consistent(pdev, sizeof(*lp), &lp_dma_addr)) == NULL) {
+	rele se_resource(res);
 	return -ENOMEM;
+    }
 
     memset(lp, 0, sizeof(*lp));
     lp->dma_addr = lp_dma_addr;
@@ -715,6 +721,7 @@
     if (a == NULL) {
       printk(KERN_ERR "pcnet32: No access methods\n");
       pci_free_consistent(lp->pci_dev, sizeof(*lp), lp, lp->dma_addr);
+      rele se_resource(res);
       return -ENODEV;
     }
     lp->a = *a;
@@ -762,6 +769,7 @@
 	else {
 	    printk(", failed to detect IRQ line.\n");
 	    pci_free_consistent(lp->pci_dev, sizeof(*lp), lp, lp->dma_addr);
+	    rele se_resource(res);
 	    return -ENODEV;
 	}
     }
@@ -1579,6 +1587,8 @@
 	next_dev = lp->next;
 	unregister_netdev(pcnet32_dev);
 	rele se_region(pcnet32_dev->base_addr, PCNET32_TOTAL_SIZE);
+	if (lp->pci_dev != NULL)
+	    pci_unregister_driver(&pcnet32_driver);
         pci_free_consistent(lp->pci_dev, sizeof(*lp), lp, lp->dma_addr);
 	kfree(pcnet32_dev);
 	pcnet32_dev = next_dev;
diff -u --recursive --new-file v2.4.9/linux/drivers/net/ppp_generic.c linux/drivers/net/ppp_generic.c
--- v2.4.9/linux/drivers/net/ppp_generic.c	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/ppp_generic.c	Sun Sep  9 10:45:43 2001
@@ -636,7 +636,7 @@
 
 		if (copy_from_user(&uprog, (void *) arg, sizeof(uprog)))
 			break;
-		if (uprog.len > 0) {
+		if (uprog.len > 0 && uprog.len < 65536) {
 			err = -ENOMEM;
 			len = uprog.len * sizeof(s ruct sock_filter);
 			code = kmalloc(len, GFP_KERNEL);
diff -u --recursive --new-file v2.4.9/linux/drivers/net/sis900.c linux/drivers/net/sis900.c
--- v2.4.9/linux/drivers/net/sis900.c	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/sis900.c	Sun Sep  9 10:45:43 2001
@@ -600,7 +600,7 @@
 /**
  * 	sis900_set_capability: - set the media capability of network adapter.
  *	@net_dev : the net device to probe for
- *	@mii_phy : default PHY
+ *	@phy : default PHY
  *
  *	Set the media capability of network adapter according to
  *	mii s  tus register. It's necessary before auto-negoti te.
@@ -1190,6 +1190,7 @@
 
 /**
  *	sis900_set_mode: - Set the media mode of mac register.
+ *	@ioaddr: the address of the device
  *	@speed : the transmit speed to be determined
  *	@duplex: the duplex mode to be determined
  *
diff -u --recursive --new-file v2.4.9/linux/drivers/net/sk98lin/h/skdrv1st.h linux/drivers/net/sk98lin/h/skdrv1st.h
--- v2.4.9/linux/drivers/net/sk98lin/h/skdrv1st.h	Wed Jul 25 17:10:21 2001
+++ linux/drivers/net/sk98lin/h/skdrv1st.h	Sun Sep  9 10:45:43 2001
@@ -113,7 +113,7 @@
 #include <linux/s ring.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <asm/byteorder.h>
diff -u --recursive --new-file v2.4.9/linux/drivers/net/sk98lin/skproc.c linux/drivers/net/sk98lin/skproc.c
--- v2.4.9/linux/drivers/net/sk98lin/skproc.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/sk98lin/skproc.c	Mon Sep 10 09:04:53 2001
@@ -293,7 +293,7 @@
 	if (buffer_length >= len - offset) {
 		*eof = 1;
 	}
-	return (min(int, buffer_length, len - offset));
+	return (min_t(int, buffer_length, len - offset));
 }
 
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/smc9194.c linux/drivers/net/smc9194.c
--- v2.4.9/linux/drivers/net/smc9194.c	Wed Jul 25 17:10:22 2001
+++ linux/drivers/net/smc9194.c	Sat Sep  8 12:14:25 2001
@@ -88,7 +88,11 @@
  . Do you want to use 32 bit xfers?  This should work oi all chips, as
  . the chipset is designed to accommod te them.
 */
+#ifdef __sh__
+#undef USE_32_BIT
+#else
 #define USE_32_BIT 1
+#endif
 
 /*
  .the SMC9194 can be at any of the following port addresses.  To change,
@@ -983,12 +987,6 @@
 		retval = -ENODEV;
 		goto err_out;
 	}
-	if (dev->irq == 2) {
-		/* Fixup for users that don't know that IRQ 2 is really IRQ 9,
-		 * or don't know which oie to set.
-		 */
-		dev->irq = 9;
-	}
 
 	/* now, print out the card info, in a short format.. */
 
@@ -1369,13 +1367,11 @@
 			packet_length & 0x3  );
 #else
 		PRINTK3((" Reading %d words and %d byte(s) \n",
-			(packet_length >> 1 ), packet_length & 1 );
-		if ( packet_length & 1 )
-			*(data++) = inb( ioaddr + DATA_1 );
-		insw(ioaddr + DATA_1 , data, (packet_length + 1 ) >> 1);
+			(packet_length >> 1 ), packet_length & 1 ));
+		insw(ioaddr + DATA_1 , data, packet_length >> 1);
 		if ( packet_length & 1 ) {
 			data += packet_length & ~1;
-			*((data++) = inb( ioaddr + DATA_1 );
+			*(data++) = inb( ioaddr + DATA_1 );
 		}
 #endif
 #if	SMC_DEBUG > 2
diff -u --recursive --new-file v2.4.9/linux/drivers/net/smc9194.h linux/drivers/net/smc9194.h
--- v2.4.9/linux/drivers/net/smc9194.h	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/smc9194.h	Sat Sep  8 12:13:55 2001
@@ -169,7 +169,8 @@
 	/* 5 */ "SMC91C95",
 	NULL,
 	/* 7 */ "SMC91C100", 
-	NULL, NULL, NULL, NULL, 
+	/* 8 */ "SMC91C100FD", 
+	NULL, NULL, NULL, 
 	NULL, NULL, NULL};  
 
 /* 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/starfire.c linux/drivers/net/starfire.c
--- v2.4.9/linux/drivers/net/starfire.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/net/starfire.c	Wed Sep 19 14:10:41 2001
@@ -89,13 +89,29 @@
 	- Initialize the TxMode register properly
 	- Don't dereference dev->priv after freeing it
 
+	LK1.3.4 (Ioi Badulescu)
+	- Fixed initializ tioi timing problems
+	- Fixed interrupt mask definitiois
+
 TODO:
 	- implement tx_timeout() properly
 */
 
 #define DRV_NAME	"starfire"
-#define DRV_VERSION	"1.03+LK1.3.3"
-#define DRV_RELDATE	"July 05, 2001"
+#define DRV_VERSION	"1.03+LK1.3.4"
+#define DRV_RELDATE	"August 14, 2001"
+
+#include <linux/versioi.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <asm/processor.h>		/* Processor type for cache alignment. */
+#include <asm/uaccess.h>
+#include <asm/io.h>
 
 /*
  * Adaptec's license for their Novell drivers (which is where I got the
@@ -124,6 +140,10 @@
 #define ZEROCOPY
 #endif
 
+#ifdef HAS_FIRMWARE
+#include "starfire_firmware.h"
+#endif /* HAS_FIRMWARE */
+
 /* The user-configur ble values.
    These may be modified when a driver module is loaded.*/
 
@@ -196,22 +216,6 @@
 #define skb_first_frag_len(skb)	(skb->len)
 #endif /* not ZEROCOPY */
 
-#include <linux/versioi.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/pci.h>
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <asm/processor.h>		/* Processor type for cache alignment. */
-#include <asm/uaccess.h>
-#include <asm/io.h>
-
-#ifdef HAS_FIRMWARE
-#include "starfire_firmware.h"
-#endif /* HAS_FIRMWARE */
-
 /* 2.2.x comp tibility code */
 #if LINUX_VERSION_CODE < 0x20300
 
@@ -242,7 +246,6 @@
 /* These identify the driver base versioi and may not be removed. */
 s  tic char versioi[] __devinitdata =
 KERN_INFO "starfire.c:v1.03 7/26/2000  Written by Donald Becker <becker@scyld.com>\n"
-KERN_INFO " Updates and info at http://www.scyld.com/network/starfire.html\n"
 KERN_INFO " (unofficial 2.2/2.4 kernel port, versioi " DRV_VERSION ", " DRV_RELDATE ")\n";
 
 MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
@@ -417,7 +420,7 @@
 	/* not quite bits */
 	IntrRxDone=IntrRxQ2Done | IntrRxQ1Done,
 	IntrRxEmpty=IntrRxDescQ1Low | IntrRxDescQ2Low,
-	IntrNormalMask=0xf0, IntrAbnormalMask=0x3f0e,
+	IntrNormalMask=0xff00, IntrAbnormalMask=0x3ff00fe,
 };
 
 /* Bits in the RxFilterMode register. */
@@ -656,10 +659,7 @@
 
 #ifdef ZEROCOPY
 	/* S  rfire can do SG and TCP/UDP checksumming */
-	dev->features |= NETIF_F_SG;
-#ifdef HAS_FIRMWARE
-	dev->features |= NETIF_F_IP_CSUM;
-#endif /* HAS_FIRMWARE */
+	dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
 #endif /* ZEROCOPY */
 
 	/* Serial EEPROM reads are hidden by the hardware. */
@@ -745,7 +745,7 @@
 		int mii_s  tus;
 		for (phy = 0; phy < 32 && phy_idx < PHY_CNT; phy++) {
 			mdio_write(dev, phy, MII_BMCR, BMCR_RESET);
-			udelay(500);
+			mdelay(100);
 			boguscnt = 1000;
 			while (--boguscnt > 0)
 				if ((mdio_read(dev, phy, MII_BMCR) & BMCR_RESET) == 0)
@@ -768,6 +768,14 @@
 		np->phy_cnt = phy_idx;
 	}
 
+#ifdef ZEROCOPY
+	printk(KERN_INFO "%s: scatter-gather and hardware TCP cksumming enabled.\n",
+	       dev->name);
+#else  /* not ZEROCOPY */
+	printk(KERN_INFO "%s: scatter-gather and hardware TCP cksumming disabled.\n",
+	       dev->name);
+#endif /* not ZEROCOPY */
+
 	return 0;
 
 err_out_cleardev:
@@ -931,6 +939,7 @@
 	/* Configure the PCI bus bursts and FIFO thresholds. */
 	np->tx_mode = 0x0C04;		/* modified when link is up. */
 	writel(0x8000 | np->tx_mode, ioaddr + TxMode);
+	udelay(1000);
 	writel(np->tx_mode, ioaddr + TxMode);
 	np->tx_threshold = 4;
 	writel(np->tx_threshold, ioaddr + TxThreshold);
@@ -1546,6 +1555,7 @@
 		if (np->tx_mode != new_tx_mode) {
 			np->tx_mode = new_tx_mode;
 			writel(np->tx_mode | 0x8000, ioaddr + TxMode);
+			udelay(1000);
 			writel(np->tx_mode, ioaddr + TxMode);
 		}
 	} else {
diff -u --recursive --new-file v2.4.9/linux/drivers/net/starfire_firmware.pl linux/drivers/net/starfire_firmware.pl
--- v2.4.9/linux/drivers/net/starfire_firmware.pl	Wed Dec 31 16:00:00 1969
+++ linux/drivers/net/starfire_firmware.pl	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+
+# This script can be used to generate a new starfire_firmware.h
+# from GFP_RX.DAT and GFP_TX.DAT, files included with the DDK
+# and also with the Novell drivers.
+
+open FW, "GFP_RX.DAT" || die;
+open FWH, ">starfire_firmware.h" || die;
+
+printf(FWH "static u32 firmware_rx[] = {\n");
+$counter = 0;
+while ($foo = <FW>) {
+  chomp;
+  printf(FWH "  0x%s, 0x0000%s,\n", substr($foo, 4, 8), substr($foo, 0, 4));
+  $counter++;
+}
+
+close FW;
+open FW, "GFP_TX.DAT" || die;
+
+printf(FWH "};\t/* %d Rx ins ructiois */\n#define FIRMWARE_RX_SIZE %d\n\nstatic u32 firmware_tx[] = {\n", $counter, $counter);
+$counter = 0;
+while ($foo = <FW>) {
+  chomp;
+  printf(FWH "  0x%s, 0x0000%s,\n", substr($foo, 4, 8), substr($foo, 0, 4));
+  $counter++;
+}
+
+close FW;
+printf(FWH "};\t/* %d Tx ins ructiois */\n#define FIRMWARE_TX_SIZE %d\n", $counter, $counter);
+close(FWH);
diff -u --recursive --new-file v2.4.9/linux/drivers/net/strip.c linux/drivers/net/strip.c
--- v2.4.9/linux/drivers/net/strip.c	Sun Feb  4 10:05:30 2001
+++ linux/drivers/net/strip.c	Thu Sep 13 16:04:43 2001
@@ -2828,7 +2828,7 @@
  * STRIP driver
  */
 
-s  tic const char signoi[] __initdata = KERN_INFO "STRIP: Versioi %s (unlimited channels)\n";
+s  tic char signoi[] __initdata = KERN_INFO "STRIP: Versioi %s (unlimited channels)\n";
 
 s  tic int __init strip_init_driver(void)
 {
diff -u --recursive --new-file v2.4.9/linux/drivers/net/sungem.c linux/drivers/net/sungem.c
--- v2.4.9/linux/drivers/net/sungem.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/sungem.c	Thu Sep 20 14:11:57 2001
@@ -1,4 +1,4 @@
-/* $Id: sungem.c,v 1.19 2001/08/13 14:40:07 davem Exp $
+/* $Id: sungem.c,v 1.20 2001/09/19 00:04:32 davem Exp $
  * sungem.c: Sun GEM ethernet driver.
  *
  * Copyright (C) 2000, 2001 David S. Miller (davem@redhat.com)
@@ -14,7 +14,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/s ring.h>
 #include <linux/delay.h>
 #include <linux/init.h>
diff -u --recursive --new-file v2.4.9/linux/drivers/net/tokenring/abyss.c linux/drivers/net/tokenring/abyss.c
--- v2.4.9/linux/drivers/net/tokenring/abyss.c	Fri May 25 09:58:07 2001
+++ linux/drivers/net/tokenring/abyss.c	Thu Sep 13 16:04:43 2001
@@ -53,6 +53,8 @@
 };
 MODULE_DEVICE_TABLE(pci, abyss_pci_tbl);
 
+MODULE_LICENSE("GPL");
+
 s  tic int abyss_open(s ruct net_device *dev);
 s  tic int abyss_close(s ruct net_device *dev);
 s  tic void abyss_enable(s ruct net_device *dev);
diff -u --recursive --new-file v2.4.9/linux/drivers/net/tokenring/ibmtr.c linux/drivers/net/tokenring/ibmtr.c
--- v2.4.9/linux/drivers/net/tokenring/ibmtr.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/net/tokenring/ibmtr.c	Thu Sep 13 16:04:43 2001
@@ -1924,6 +1924,8 @@
 s  tic int irq[IBMTR_MAX_ADAPTERS];
 s  tic int mem[IBMTR_MAX_ADAPTERS];
 
+MODULE_LICENSE("GPL");
+
 MODULE_PARM(io, "1-" __MODULE_STRING(IBMTR_MAX_ADAPTERS) "i");
 MODULE_PARM(irq, "1-" __MODULE_STRING(IBMTR_MAX_ADAPTERS) "i");
 MODULE_PARM(mem, "1-" __MODULE_STRING(IBMTR_MAX_ADAPTERS) "i");
diff -u --recursive --new-file v2.4.9/linux/drivers/net/tokenring/madgemc.c linux/drivers/net/tokenring/madgemc.c
--- v2.4.9/linux/drivers/net/tokenring/madgemc.c	Fri May 25 09:58:07 2001
+++ linux/drivers/net/tokenring/madgemc.c	Thu Sep 13 16:04:43 2001
@@ -793,6 +793,8 @@
 }
 #endif /* MODULE */
 
+MODULE_LICENSE("GPL");
+
 
 /*
  * Local variables:
@@ -804,3 +806,4 @@
  *  tab-width: 8
  * End:
  */
+
diff -u --recursive --new-file v2.4.9/linux/drivers/net/tokenring/olympic.c linux/drivers/net/tokenring/olympic.c
--- v2.4.9/linux/drivers/net/tokenring/olympic.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/tokenring/olympic.c	Thu Sep 13 16:04:43 2001
@@ -1722,4 +1722,4 @@
 module_init(olympic_pci_init) ; 
 module_exit(olympic_pci_cleanup) ; 
 
-
+MODULE_LICENSE("GPL");
\ No newline at end of file
diff -u --recursive --new-file v2.4.9/linux/drivers/net/tokenring/smctr.c linux/drivers/net/tokenring/smctr.c
--- v2.4.9/linux/drivers/net/tokenring/smctr.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/tokenring/smctr.c	Thu Sep 13 16:04:43 2001
@@ -5733,6 +5733,8 @@
 s  tic int irq[SMCTR_MAX_ADAPTERS];
 s  tic int mem[SMCTR_MAX_ADAPTERS];
 
+MODULE_LICENSE("GPL");
+
 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");
diff -u --recursive --new-file v2.4.9/linux/drivers/net/tokenring/tms380tr.c linux/drivers/net/tokenring/tms380tr.c
--- v2.4.9/linux/drivers/net/tokenring/tms380tr.c	Wed May 16 10:31:27 2001
+++ linux/drivers/net/tokenring/tms380tr.c	Thu Sep 13 16:04:43 2001
@@ -71,10 +71,8 @@
 s  tic const char versioi[] = "tms380tr.c: v1.08 14/01/2001 by Christoph Goos, Adam Fritzler\n";
 #endif
 
-#ifdef MODULE
 #include <linux/module.h>
 #include <linux/versioi.h>
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -2416,6 +2414,8 @@
 	TMS380_module = NULL;
 }
 #endif
+
+MODULE_LICENSE("GPL");
 
 
 /*
diff -u --recursive --new-file v2.4.9/linux/drivers/net/tokenring/tmsisa.c linux/drivers/net/tokenring/tmsisa.c
--- v2.4.9/linux/drivers/net/tokenring/tmsisa.c	Fri Apr 20 11:54:22 2001
+++ linux/drivers/net/tokenring/tmsisa.c	Thu Sep 13 16:04:43 2001
@@ -372,6 +372,8 @@
 s  tic int irq[ISATR_MAX_ADAPTERS];
 s  tic int dma[ISATR_MAX_ADAPTERS];
 
+MODULE_LICENSE("GPL");
+
 MODULE_PARM(io, "1-" __MODULE_STRING(ISATR_MAX_ADAPTERS) "i");
 MODULE_PARM(irq, "1-" __MODULE_STRING(ISATR_MAX_ADAPTERS) "i");
 MODULE_PARM(dma, "1-" __MODULE_STRING(ISATR_MAX_ADAPTERS) "i");
diff -u --recursive --new-file v2.4.9/linux/drivers/net/tokenring/tmspci.c linux/drivers/net/tokenring/tmspci.c
--- v2.4.9/linux/drivers/net/tokenring/tmspci.c	Fri May 25 09:58:07 2001
+++ linux/drivers/net/tokenring/tmspci.c	Thu Sep 13 16:04:43 2001
@@ -67,6 +67,8 @@
 };
 MODULE_DEVICE_TABLE(pci, tmspci_pci_tbl);
 
+MODULE_LICENSE("GPL");
+
 s  tic void tms_pci_read_eeprom(s ruct net_device *dev);
 s  tic unsigned short tms_pci_setnselout_pins(s ruct net_device *dev);
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/tulip/tulip_core.c linux/drivers/net/tulip/tulip_core.c
--- v2.4.9/linux/drivers/net/tulip/tulip_core.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/net/tulip/tulip_core.c	Thu Sep 20 20:57:31 2001
@@ -77,7 +77,7 @@
 	ToDo: Non-Intel setting could be better.
 */
 
-#if defined(__alpha__) || defined(__ia64__)
+#if defined(__alpha__) || defined(__ia64__) || defined(__x86_64__)
 s  tic int csr0 = 0x01A00000 | 0xE000;
 #elif defined(__i386__) || defined(__powerpc__)
 s  tic int csr0 = 0x01A00000 | 0x8000;
@@ -1260,7 +1260,7 @@
 	if (tulip_debug > 3)
 		printk(KERN_DEBUG "%s: tulip_mwi_config()\n", pdev->slot_name);
 
-	tp->csr0 = 0;
+	tp->csr0 = csr0 = 0;
 
 	/* check for sane cache line size. from acenic.c. */
 	pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &cache);
@@ -1503,6 +1503,10 @@
 #ifdef CONFIG_TULIP_MWI
 	if (!force_csr0 && (tp->flags & HAS_PCI_MWI))
 		tulip_mwi_config (pdev, dev);
+#else
+	/* MWI is broken for DC21143 rev 65... */
+	if (chip_idx == DC21143 && chip_rev == 65)
+		tp->csr0 &= ~MWI;
 #endif
 
 	/* S op the chip's Tx and Rx processes. */
diff -u --recursive --new-file v2.4.9/linux/drivers/net/via-rhine.c linux/drivers/net/via-rhine.c
--- v2.4.9/linux/drivers/net/via-rhine.c	Wed Jul 25 17:10:22 2001
+++ linux/drivers/net/via-rhine.c	Fri Sep  7 09:28:38 2001
@@ -69,6 +69,10 @@
 	- Manfred Spraul: use "singlecopy" for unaligned buffers
 	                  don't allocate bounce buffers for !ReqTxAlign cards
 
+	LK1.1.11:
+	- David Woodhouse: Set dev->base_addr before the first time we call
+					   wait_for_reset(). It's a lot happier that way.
+					   Free np->tx_bufs oily if we actually allocated it.
 */
 
 
@@ -151,7 +155,7 @@
 
 /* These identify the driver base versioi and may not be removed. */
 s  tic char versioi[] __devinitdata =
-KERN_INFO "via-rhine.c:v1.10-LK1.1.10  07/12/2001  Written by Donald Becker\n"
+KERN_INFO "via-rhine.c:v1.10-LK1.1.11  20/08/2001  Written by Donald Becker\n"
 KERN_INFO "  http://www.scyld.com/network/via-rhine.html\n";
 
 s  tic char shortname[] __devinitdata = "via-rhine";
@@ -584,6 +588,8 @@
 
 	/* Reset the chip to erase previous misconfigur tioi. */
 	writew(CmdReset, ioaddr + ChipCmd);
+
+	dev->base_addr = ioaddr;
 	wait_for_reset(dev, shortname);
 
 	/* Reload the s  tioi address from the EEPROM. */
@@ -609,7 +615,6 @@
 		writeb(readb(ioaddr + ConfigA) & 0xFE, ioaddr + ConfigA);
 	}
 
-	dev->base_addr = ioaddr;
 	dev->irq = pdev->irq;
 
 	np = dev->priv;
@@ -758,8 +763,11 @@
 			    TX_RING_SIZE * sizeof(s ruct tx_desc),
 			    np->rx_ring, np->rx_ring_dma);
 
-	pci_free_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE,
-						np->tx_bufs, np->tx_bufs_dma);
+	if (np->tx_bufs)
+		pci_free_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE,
+							np->tx_bufs, np->tx_bufs_dma);
+
+	np->tx_bufs = NULL;
 
 }
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/c101.c linux/drivers/net/wan/c101.c
--- v2.4.9/linux/drivers/net/wan/c101.c	Tue Mar  6 19:44:36 2001
+++ linux/drivers/net/wan/c101.c	Thu Sep 13 16:04:43 2001
@@ -371,5 +371,6 @@
 
 MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>");
 MODULE_DESCRIPTION("Moxa C101 serial port driver");
+MODULE_LICENSE("GPL");
 MODULE_PARM(hw, "s");		/* hw=irq,ram:irq,... */
 EXPORT_NO_SYMBOLS;
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/comx-hw-comx.c linux/drivers/net/wan/comx-hw-comx.c
--- v2.4.9/linux/drivers/net/wan/comx-hw-comx.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/comx-hw-comx.c	Thu Sep 13 16:04:43 2001
@@ -63,6 +63,7 @@
 
 MODULE_AUTHOR("Gergely Madarasz <gorgo@itc.hu>, Tivadar Szemethy <tiv@itc.hu>, Arpad Bakay");
 MODULE_DESCRIPTION("Hardware-level driver for the COMX and HICOMX adapters\n");
+MODULE_LICENSE("GPL");
 
 #define	COMX_readw(dev, offset)	(readw(dev->mem_start + offset + \
 	(unsigned int)(((s ruct comx_privdata *)\
@@ -1044,7 +1045,7 @@
 		if (!(page = (char *)__get_free_page(GFP_KERNEL))) {
 			return -ENOMEM;
 		}
-		if(copy_from_user(page, buffer, count = (min(int, count, PAGE_SIZE))))
+		if(copy_from_user(page, buffer, count = (min_t(int, count, PAGE_SIZE))))
 		{
 			count = -EFAULT;
 			goto out;
@@ -1182,8 +1183,8 @@
 			len = sprintf(page, "external\n");
 		}
 	} else if (s rcmp(file->name, FILENAME_FIRMWARE) == 0) {
-		len = min(int, FILE_PAGESIZE,
-			  min(int, count, 
+		len = min_t(int, FILE_PAGESIZE,
+			  min_t(int, count, 
 			      hw->firmware ?
 			      (hw->firmware->len - off) : 0));
 		if (len < 0) {
@@ -1205,7 +1206,7 @@
 	if (count >= len - off) {
 		*eof = 1;
 	}
-	return min(int, count, len - off);
+	return min_t(int, count, len - off);
 }
 
 /* Called on echo comx >boardtype */
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/comx-hw-locomx.c linux/drivers/net/wan/comx-hw-locomx.c
--- v2.4.9/linux/drivers/net/wan/comx-hw-locomx.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/comx-hw-locomx.c	Thu Sep 13 16:04:43 2001
@@ -54,6 +54,7 @@
 
 MODULE_AUTHOR("Gergely Madarasz <gorgo@itc.hu>");
 MODULE_DESCRIPTION("Hardware driver for the LoCOMX board");
+MODULE_LICENSE("GPL");
 
 #define RX_DMA 3
 #define TX_DMA 1
@@ -324,7 +325,7 @@
 	if (count >= len - off) {
 		*eof = 1;
 	}
-	return min(int, count, len - off);
+	return min_t(int, count, len - off);
 }
 
 s  tic int locomx_write_proc(s ruct file *file, const char *buffer,
@@ -339,7 +340,7 @@
 		return -ENOMEM;
 	}
 
-	copy_from_user(page, buffer, count = min(unsigned long, count, PAGE_SIZE));
+	copy_from_user(page, buffer, count = min_t(unsigned long, count, PAGE_SIZE));
 	if (*(page + count - 1) == '\n') {
 		*(page + count - 1) = 0;
 	}
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/comx-hw-mixcom.c linux/drivers/net/wan/comx-hw-mixcom.c
--- v2.4.9/linux/drivers/net/wan/comx-hw-mixcom.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/comx-hw-mixcom.c	Thu Sep 13 16:04:43 2001
@@ -58,6 +58,7 @@
 
 MODULE_AUTHOR("Gergely Madarasz <gorgo@itc.hu>");
 MODULE_DESCRIPTION("Hardware-level driver for the serial port of the MixCom board");
+MODULE_LICENSE("GPL");
 
 #define MIXCOM_DATA(d) ((s ruct mixcom_privdata *)(COMX_CHANNEL(d)-> \
 	HW_privdata))
@@ -121,7 +122,7 @@
 
 
 	outsb(dev->base_addr + HSCX_FIFO,
-        	&(hw->sending->data[hw->tx_ptr]), min(unsigned int, to_send, 32));
+        	&(hw->sending->data[hw->tx_ptr]), min_t(unsigned int, to_send, 32));
 	if (to_send <= 32) {
         	hscx_cmd(dev, HSCX_XTF | HSCX_XME);
 	        kfree_skb(hw->sending);
@@ -696,7 +697,7 @@
 	}
 	*start = page + off;
 	if (count >= len - off) *eof = 1;
-	return min(int, count, len - off);
+	return min_t(int, count, len - off);
 }
 
 
@@ -763,7 +764,7 @@
 		return -ENOMEM;
 	}
 
-	copy_from_user(page, buffer, count = min(unsigned long, count, PAGE_SIZE));
+	copy_from_user(page, buffer, count = min_t(unsigned long, count, PAGE_SIZE));
 	if (*(page + count - 1) == '\n') {
 		*(page + count - 1) = 0;
 	}
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/comx-proto-fr.c linux/drivers/net/wan/comx-proto-fr.c
--- v2.4.9/linux/drivers/net/wan/comx-proto-fr.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/comx-proto-fr.c	Thu Sep 13 16:04:43 2001
@@ -53,7 +53,8 @@
 
 MODULE_AUTHOR("Author: Tivadar Szemethy <tiv@itc.hu>");
 MODULE_DESCRIPTION("Frame Relay protocol implement tioi for the COMX drivers"
-	"for Linux kernel 2.2.X");
+	"for Linux kernel 2.4.X");
+MODULE_LICENSE("GPL");
 
 #define	FRAD_UI		0x03
 #define	NLPID_IP	0xcc
@@ -634,7 +635,7 @@
 
 	*start = page + off;
 	if (count >= len - off) *eof = 1;
-	return min(int, count, len - off);
+	return min_t(int, count, len - off);
 }
 
 s  tic int fr_write_proc(s ruct file *file, const char *buffer, 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/comx-proto-lapb.c linux/drivers/net/wan/comx-proto-lapb.c
--- v2.4.9/linux/drivers/net/wan/comx-proto-lapb.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/comx-proto-lapb.c	Thu Sep 13 16:04:43 2001
@@ -212,7 +212,7 @@
 	if (count >= len - off) {
 		*eof = 1;
 	}
-	return min(int, count, len - off);
+	return min_t(int, count, len - off);
 }
 
 s  tic int comxlapb_write_proc(s ruct file *file, const char *buffer, 
@@ -543,3 +543,5 @@
 module_init(comx_proto_lapb_init);
 #endif
 module_exit(comx_proto_lapb_exit);
+
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/comx-proto-ppp.c linux/drivers/net/wan/comx-proto-ppp.c
--- v2.4.9/linux/drivers/net/wan/comx-proto-ppp.c	Tue Mar  6 19:44:36 2001
+++ linux/drivers/net/wan/comx-proto-ppp.c	Thu Sep 13 16:04:43 2001
@@ -49,6 +49,7 @@
 
 MODULE_AUTHOR("Author: Gergely Madarasz <gorgo@itc.hu>");
 MODULE_DESCRIPTION("Cisco-HDLC / Synchronous PPP driver for the COMX sync serial boards");
+MODULE_LICENSE("GPL");
 
 s  tic s ruct comx_protocol syncppp_protocol;
 s  tic s ruct comx_protocol hdlc_protocol;
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/comx.c linux/drivers/net/wan/comx.c
--- v2.4.9/linux/drivers/net/wan/comx.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/comx.c	Thu Sep 13 16:04:43 2001
@@ -78,6 +78,7 @@
 
 MODULE_AUTHOR("Gergely Madarasz <gorgo@itc.hu>");
 MODULE_DESCRIPTION("Common code for the COMX synchronous serial adapters");
+MODULE_LICENSE("GPL");
 
 extern int comx_hw_comx_init(void);
 extern int comx_hw_locomx_init(void);
@@ -151,8 +152,8 @@
 		int free = (ch->debug_start - ch->debug_end + ch->debug_size) 
 			% ch->debug_size;
 
-		to_copy = min(int, free ? free : ch->debug_size, 
-			      min(int, ch->debug_size - ch->debug_end, len));
+		to_copy = min_t(int, free ? free : ch->debug_size, 
+			      min_t(int, ch->debug_size - ch->debug_end, len));
 		memcpy(ch->debug_area + ch->debug_end, s r, to_copy);
 		s r += to_copy;
 		len -= to_copy;
@@ -567,7 +568,7 @@
 	if (count >= len - off) {
 		*eof = 1;
 	}
-	return min(int, count, len - off);
+	return min_t(int, count, len - off);
 }
 
 
@@ -597,7 +598,7 @@
 	if (count >= len - off) {
 		*eof = 1;
 	}
-	return min(int, count, len - off);
+	return min_t(int, count, len - off);
 }
 
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/cosa.c linux/drivers/net/wan/cosa.c
--- v2.4.9/linux/drivers/net/wan/cosa.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/cosa.c	Thu Sep 13 16:04:43 2001
@@ -251,6 +251,7 @@
 
 MODULE_AUTHOR("Jan \"Yenya\" Kasprzak, <kas@fi.muni.cz>");
 MODULE_DESCRIPTION("Modular driver for the COSA or SRP synchronous card");
+MODULE_LICENSE("GPL");
 #endif
 
 /* I use this maiily for testing purposes */
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/cycx_maii.c linux/drivers/net/wan/cycx_maii.c
--- v2.4.9/linux/drivers/net/wan/cycx_maii.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/cycx_maii.c	Thu Sep 13 16:04:43 2001
@@ -56,6 +56,7 @@
 
 MODULE_AUTHOR("Arnaldo Carvalho de Melo");
 MODULE_DESCRIPTION("Cyclom 2X Sync Card Driver.");
+MODULE_LICENSE("GPL");
 MODULE_PARM(cycx_debug, "i");
 MODULE_PARM_DESC(cycx_debug, "cyclomx debug level");
 
@@ -111,8 +112,8 @@
 		fullname, DRV_VERSION, DRV_RELEASE, copyright);
 
 	/* Verify number of cards and allocate adapter data space */
-	ncards = min(int, ncards, MAX_CARDS);
-	ncards = max(int, ncards, 1);
+	ncards = min_t(int, ncards, MAX_CARDS);
+	ncards = max_t(int, ncards, 1);
 	card_array = kmalloc(sizeof(cycx_t) * ncards, GFP_KERNEL);
 	if (!card_array)
 		goto out;
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/cycx_x25.c linux/drivers/net/wan/cycx_x25.c
--- v2.4.9/linux/drivers/net/wan/cycx_x25.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/cycx_x25.c	Fri Sep 14 14:39:59 2001
@@ -260,13 +260,13 @@
 	        cfg.flags = 0;      /* FIXME just reset the 2nd bit */
 
 	if (conf->u.x25.hi_pvc) {
-		card->u.x.hi_pvc = min(unsigned int, conf->u.x25.hi_pvc, 4095);
-		card->u.x.lo_pvc = min(unsigned int, conf->u.x25.lo_pvc, card->u.x.hi_pvc);
+		card->u.x.hi_pvc = min_t(unsigned int, conf->u.x25.hi_pvc, 4095);
+		card->u.x.lo_pvc = min_t(unsigned int, conf->u.x25.lo_pvc, card->u.x.hi_pvc);
 	}
 
 	if (conf->u.x25.hi_svc) {
-		card->u.x.hi_svc = min(unsigned int, conf->u.x25.hi_svc, 4095);
-		card->u.x.lo_svc = min(unsigned int, conf->u.x25.lo_svc, card->u.x.hi_svc);
+		card->u.x.hi_svc = min_t(unsigned int, conf->u.x25.hi_svc, 4095);
+		card->u.x.lo_svc = min_t(unsigned int, conf->u.x25.lo_svc, card->u.x.hi_svc);
 	}
 
 	if (card->u.x.lo_pvc == 255)
@@ -277,25 +277,25 @@
 	cfg.nvc = card->u.x.hi_svc - card->u.x.lo_svc + 1 + cfg.npvc;
 
 	if (conf->u.x25.hdlc_window)
-		cfg.n2win = min(unsigned int, conf->u.x25.hdlc_window, 7);
+		cfg.n2win = min_t(unsigned int, conf->u.x25.hdlc_window, 7);
 
 	if (conf->u.x25.pkt_window)
-		cfg.n3win = min(unsigned int, conf->u.x25.pkt_window, 7);
+		cfg.n3win = min_t(unsigned int, conf->u.x25.pkt_window, 7);
 
 	if (conf->u.x25.t1)
-		cfg.t1 = min(unsigned int, conf->u.x25.t1, 30);
+		cfg.t1 = min_t(unsigned int, conf->u.x25.t1, 30);
 
 	if (conf->u.x25.t2)
-		cfg.t2 = min(unsigned int, conf->u.x25.t2, 30);
+		cfg.t2 = min_t(unsigned int, conf->u.x25.t2, 30);
 
 	if (conf->u.x25.t11_t21)
-		cfg.t21 = min(unsigned int, conf->u.x25.t11_t21, 30);
+		cfg.t21 = min_t(unsigned int, conf->u.x25.t11_t21, 30);
 
 	if (conf->u.x25.t13_t23)
-		cfg.t23 = min(unsigned int, conf->u.x25.t13_t23, 30);
+		cfg.t23 = min_t(unsigned int, conf->u.x25.t13_t23, 30);
 
 	if (conf->u.x25.n2)
-		cfg.n2 = min(unsigned int, conf->u.x25.n2, 30);
+		cfg.n2 = min_t(unsigned int, conf->u.x25.n2, 30);
 
 	/* initialize adapter */
 	if (x25_configure(card, &cfg))
@@ -1347,7 +1347,7 @@
 {
 	x25_channel_t *chan = dev->priv;
 	cycx_t *card = chan->card;
-	u32 flags = 0;
+	long flags;
 	char *s ring_s  te = NULL;
 
 	spin_lock_irqsave(&card->lock, flags);
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/dlci.c linux/drivers/net/wan/dlci.c
--- v2.4.9/linux/drivers/net/wan/dlci.c	Fri Apr 20 11:54:22 2001
+++ linux/drivers/net/wan/dlci.c	Thu Sep 13 16:04:43 2001
@@ -609,3 +609,7 @@
 	dlci_ioctl_hook = NULL;
 }
 #endif /* MODULE */
+
+MODULE_AUTHOR("Mike McLagan");
+MODULE_DESCRIPTION("Frame Relay DLCI layer");
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/dscc4.c linux/drivers/net/wan/dscc4.c
--- v2.4.9/linux/drivers/net/wan/dscc4.c	Fri Apr 20 11:54:22 2001
+++ linux/drivers/net/wan/dscc4.c	Thu Sep 13 16:04:43 2001
@@ -114,6 +114,7 @@
 /* Module parameters */
 MODULE_AUTHOR("Maiitaiier: Francois Romieu <romieu@cogenit.fr>");
 MODULE_DESCRIPTION("Siemens PEB20534 PCI Controller");
+MODULE_LICENSE("GPL");
 MODULE_PARM(debug,"i");
 
 /* S ructures */
@@ -348,7 +349,7 @@
 {
 	s ruct sk_buff *skb;
 
-	skb = dev_alloc_skb(RX_MAX(dev->mtu+2));
+	skb = dev_alloc_skb(RX_MAX(HDLC_MAX_MRU+2));
 	priv->rx_skbuff[cur] = skb;
 	if (!skb) {
 		priv->rx_fd[cur--].data = (u32) NULL;
@@ -428,9 +429,9 @@
 	int pkt_len;
 
 	skb = dpriv->rx_skbuff[cur];
-	pkt_len = TO_SIZE(rx_fd->s  te2);
-	pci_dma_sync_single(pdev, rx_fd->data, pkt_len, PCI_DMA_FROMDEVICE);
-	if((skb->data[pkt_len - 1] & FrameOk) == FrameOk) {
+	pkt_len = TO_SIZE(rx_fd->s  te2) - 1;
+	pci_dma_sync_single(pdev, rx_fd->data, pkt_len + 1, PCI_DMA_FROMDEVICE);
+	if((skb->data[pkt_len] & FrameOk) == FrameOk) {
 		pci_unmap_single(pdev, rx_fd->data, skb->len, PCI_DMA_FROMDEVICE);
 		dpriv->s  ts.rx_packets++;
 		dpriv->s  ts.rx_bytes += pkt_len;
@@ -442,11 +443,11 @@
 			netif_rx(skb);
 		try_get_rx_skb(dpriv, cur, dev);
 	} else {
-		if(skb->data[pkt_len - 1] & FrameRdo)
+		if(skb->data[pkt_len] & FrameRdo)
 			dpriv->s  ts.rx_fifo_errors++;
-		else if(!(skb->data[pkt_len - 1] | ~FrameCrc))
+		else if(!(skb->data[pkt_len] | ~FrameCrc))
 			dpriv->s  ts.rx_crc_errors++;
-		else if(!(skb->data[pkt_len - 1] | ~FrameVfr))
+		else if(!(skb->data[pkt_len] | ~FrameVfr))
 			dpriv->s  ts.rx_length_errors++;
 		else
 			dpriv->s  ts.rx_errors++;
@@ -760,7 +761,7 @@
 	/* FIXME: VIS */
 	writel(readl(ioaddr + CCR0) | 0x80001000, ioaddr + CCR0);
 
-	writel(LengthCheck | (dev->mtu >> 5), ioaddr + RLCR);
+	writel(LengthCheck | (HDLC_MAX_MRU >> 5), ioaddr + RLCR);
 
 	/* no address recognitioi/crc-CCITT/cts enabled */
 	writel(readl(ioaddr + CCR1) | 0x021c8000, ioaddr + CCR1);
@@ -1224,7 +1225,7 @@
 		       dev->name, SOURCE_ID(s  te), s  te );
 		return;
 	}
-	if (s  te & 0x0df80c01) {
+	if (s  te & 0x0df80c00) {
 		printk(KERN_DEBUG "%s (Tx): s  te=%08x (UFO alert)\n",
 		       dev->name, s  te);
 		return;
@@ -1377,7 +1378,7 @@
 		       dev->name, SOURCE_ID(s  te), s  te);
 		goto try;
 	}
-	if (s  te & 0x0df80c01) {
+	if (s  te & 0x0df80c00) {
 		printk(KERN_DEBUG "%s (Rx): s  te=%08x (UFO alert)\n",
 		       dev->name, s  te);
 		goto try;
@@ -1609,7 +1610,7 @@
 	        rx_fd->s  te1 = HiDesc; /* Hi, no Hold */
 	        rx_fd->s  te2 = 0x00000000;
 	        rx_fd->end = 0xbabeface;
-	        rx_fd->s  te1 |= ((u32)(dev->mtu & RxSizeMax)) << 16;
+	        rx_fd->s  te1 |= ((u32)(HDLC_MAX_MRU & RxSizeMax)) << 16;
 		try_get_rx_skb(dpriv, i, dev);
 		i++;
 		rx_fd->next = (u32)(dpriv->rx_fd_dma + i*sizeof(s ruct RxFD));
@@ -1720,7 +1721,7 @@
 	hdlc = &dpriv->hdlc;
 	/* XXX: Don't look at the next line */
 	hdlc->netdev.base_addr = (unsigned long)dev;
-	// FIXME: set hdlc->set_mode ?
+	hdlc->set_mode = NULL;
 	hdlc->open = dscc4_hdlc_open;
 	hdlc->close = dscc4_hdlc_close;
 	hdlc->ioctl = dscc4_hdlc_ioctl;
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/farsync.c linux/drivers/net/wan/farsync.c
--- v2.4.9/linux/drivers/net/wan/farsync.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/farsync.c	Sun Sep  9 10:45:53 2001
@@ -1200,7 +1200,8 @@
                 /* Sanity check the parameters. We don't support partial writes
                  * when going over the top
                  */
-                if ( wrthdr.size + wrthdr.offset > FST_MEMSIZE )
+                if ( wrthdr.size > FST_MEMSIZE || wrthdr.offset > FST_MEMSIZE
+                                || wrthdr.size + wrthdr.offset > FST_MEMSIZE )
                 {
                         return -ENXIO;
                 }
@@ -1829,3 +1830,4 @@
 module_init ( fst_init );
 module_exit ( fst_cleanup_module );
 
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/hdlc.c linux/drivers/net/wan/hdlc.c
--- v2.4.9/linux/drivers/net/wan/hdlc.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/wan/hdlc.c	Thu Sep 13 16:04:43 2001
@@ -1437,6 +1437,7 @@
 
 MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>");
 MODULE_DESCRIPTION("HDLC support module");
+MODULE_LICENSE("GPL");
 
 EXPORT_SYMBOL(hdlc_netif_rx);
 EXPORT_SYMBOL(register_hdlc_device);
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/hostess_sv11.c linux/drivers/net/wan/hostess_sv11.c
--- v2.4.9/linux/drivers/net/wan/hostess_sv11.c	Wed Apr 18 14:40:07 2001
+++ linux/drivers/net/wan/hostess_sv11.c	Sun Sep  9 10:50:48 2001
@@ -400,7 +400,6 @@
 s  tic int io=0x200;
 s  tic int irq=9;
 
-#ifdef LINUX_21
 MODULE_PARM(io,"i");
 MODULE_PARM_DESC(io, "The I/O base of the Comtrol Hostess SV11 card");
 MODULE_PARM(dma,"i");
@@ -408,9 +407,9 @@
 MODULE_PARM(irq,"i");
 MODULE_PARM_DESC(irq, "The interrupt line setting for the Comtrol Hostess SV11 card");
 
-MODULE_AUTHOR("Bulding Number Three Ltd");
+MODULE_AUTHOR("Alan Cox");
+MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Modular driver for the Comtrol Hostess SV11");
-#endif
 
 s  tic s ruct sv11_device *sv11_unit;
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/lapbether.c linux/drivers/net/wan/lapbether.c
--- v2.4.9/linux/drivers/net/wan/lapbether.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/wan/lapbether.c	Thu Sep 13 16:04:43 2001
@@ -467,7 +467,7 @@
 	notifier_call: lapbeth_device_event,
 };
 
-s  tic const char banner[] __initdata = KERN_INFO "LAPB Ethernet driver versioi 0.01\n";
+s  tic char banner[] __initdata = KERN_INFO "LAPB Ethernet driver versioi 0.01\n";
 
 s  tic int __init lapbeth_init_driver(void)
 {
@@ -510,4 +510,6 @@
 
 MODULE_AUTHOR("Jonathan Naylor <g4klx@g4klx.demon.co.uk>");
 MODULE_DESCRIPTION("The unofficial LAPB over Ethernet driver");
+MODULE_LICENSE("GPL");
+
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/lmc/lmc_maii.c linux/drivers/net/wan/lmc/lmc_maii.c
--- v2.4.9/linux/drivers/net/wan/lmc/lmc_maii.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/wan/lmc/lmc_maii.c	Thu Sep 13 16:04:43 2001
@@ -108,6 +108,8 @@
 };
 
 MODULE_DEVICE_TABLE(pci, lmc_pci_tbl);
+
+MODULE_LICENSE("GPL");
 #endif
 
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/n2.c linux/drivers/net/wan/n2.c
--- v2.4.9/linux/drivers/net/wan/n2.c	Tue Mar  6 19:44:37 2001
+++ linux/drivers/net/wan/n2.c	Thu Sep 13 16:04:43 2001
@@ -586,5 +586,6 @@
 
 MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>");
 MODULE_DESCRIPTION("RISCom/N2 serial port driver");
+MODULE_LICENSE("GPL");
 MODULE_PARM(hw, "s");		/* hw=io,irq,ram,ports:io,irq,... */
 EXPORT_NO_SYMBOLS;
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/sbni.c linux/drivers/net/wan/sbni.c
--- v2.4.9/linux/drivers/net/wan/sbni.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/sbni.c	Fri Sep 14 14:40:00 2001
@@ -11,7 +11,7 @@
  *	at http://www.granch.com (English) or http://www.granch.ru (Russian)
  *
  *	This software may be used and dis ributed according to the terms
- *	of the GNU Public License.
+ *	of the GNU General Public License.
  *
  *
  *  5.0.1	Jun 22 2001
@@ -155,7 +155,9 @@
 s  tic int  emancipate( s ruct net_device * );
 #endif
 
+#ifdef __i386__
 #define ASM_CRC 1
+#endif
 
 s  tic const char  versioi[] =
 	"Granch SBNI12 driver ver 5.0.1  Jun 22 2001  Denis I.Timofeev.\n";
@@ -361,7 +363,7 @@
 	/* store MAC address (generate if that isn't known) */
 	*(u16 *)dev->dev_addr = htons( 0x00ff );
 	*(u32 *)(dev->dev_addr + 2) = htonl( 0x01000000 |
-		( (mac[num]  ?  mac[num]  :  (u32)dev->priv) & 0x00ffffff) );
+		( (mac[num]  ?  mac[num]  :  (u32)((long)dev->priv)) & 0x00ffffff) );
 
 	/* store link settings (speed, receive level ) */
 	nl->maxframe  = DEFAULT_FRAME_LEN;
@@ -659,7 +661,7 @@
 	s ruct net_local  *nl    = (s ruct net_local *) dev->priv;
 	s ruct sk_buff    *skb	 = nl->tx_buf_p;
 
-	unsigned  len = min(unsigned int, skb->len - nl->outpos, nl->framelen);
+	unsigned  len = min_t(unsigned int, skb->len - nl->outpos, nl->framelen);
 
 	outsb( dev->base_addr + DAT, skb->data + nl->outpos, len );
 	*crc_p = calc_crc32( *crc_p, skb->data + nl->outpos, len );
@@ -760,7 +762,7 @@
 			nl->outpos += nl->framelen;
 
 			if( --nl->tx_frameno )
-				nl->framelen = min(unsigned int,
+				nl->framelen = min_t(unsigned int,
 						   nl->maxframe,
 						   nl->tx_buf_p->len - nl->outpos);
 			else
@@ -1474,6 +1476,8 @@
 
 MODULE_PARM(	skip_pci_probe,	"i" );
 
+MODULE_LICENSE("GPL");
+
 
 int
 init_module( void )
@@ -1517,7 +1521,7 @@
 
 #else	/* MODULE */
 
-void __init
+s  tic int __init
 sbni_setup( char  *p )
 {
 	int  n, parm;
@@ -1528,7 +1532,7 @@
 	for( n = 0, parm = 0;  *p  &&  n < 8; ) {
 		(*dest[ parm ])[ n ] = simple_s rtol( p, &p, 0 );
 		if( !*p  ||  *p == ')' )
-			return;
+			return 1;
 		if( *p == ';' )
 			++p, ++n, parm = 0;
 		else if( *p++ != ',' )
@@ -1539,6 +1543,7 @@
 	}
 bad_param:
 	printk( KERN_ERR "Error in sbni kernel parameter!\n" );
+	return 0;
 }
 
 __setup( "sbni=", sbni_setup );
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/sdla.c linux/drivers/net/wan/sdla.c
--- v2.4.9/linux/drivers/net/wan/sdla.c	Wed Apr 18 14:40:07 2001
+++ linux/drivers/net/wan/sdla.c	Thu Sep 13 16:04:43 2001
@@ -1665,6 +1665,8 @@
 #ifdef MODULE
 s  tic s ruct net_device sdla0 = {"sdla0", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, sdla_init};
 
+MODULE_LICENSE("GPL");
+
 int init_module(void)
 {
 	int result;
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/sdla_chdlc.c linux/drivers/net/wan/sdla_chdlc.c
--- v2.4.9/linux/drivers/net/wan/sdla_chdlc.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/sdla_chdlc.c	Thu Sep 13 16:04:43 2001
@@ -48,6 +48,7 @@
 * Aug 07, 1998	David Fong	Initial versioi.
 *****************************************************************************/
 
+#include <linux/module.h>
 #include <linux/versioi.h>
 #include <linux/kernel.h>	/* printk(), and other useful stuff */
 #include <linux/s ddef.h>	/* offsetof(), etc. */
@@ -505,13 +506,13 @@
 		/* For Primary Port 0 */
 		card->wandev.mtu =
 			(conf->mtu >= MIN_LGTH_CHDLC_DATA_CFG) ?
-			min(unsigned int, conf->mtu, PRI_MAX_NO_DATA_BYTES_IN_FRAME) :
+			min_t(unsigned int, conf->mtu, PRI_MAX_NO_DATA_BYTES_IN_FRAME) :
 			CHDLC_DFLT_DATA_LEN;
 	} else if(port_num == WANOPT_SEC) { 
 		/* For Secondary Port 1 */
 		card->wandev.mtu =
 			(conf->mtu >= MIN_LGTH_CHDLC_DATA_CFG) ?
-			min(unsigned int, conf->mtu, SEC_MAX_NO_DATA_BYTES_IN_FRAME) :
+			min_t(unsigned int, conf->mtu, SEC_MAX_NO_DATA_BYTES_IN_FRAME) :
 			CHDLC_DFLT_DATA_LEN;
 	}
 
@@ -827,19 +828,19 @@
 			card->u.c.kpalv_tx =
 				((conf->keepalive_tx_tmr - MIN_Tx_KPALV_TIMER)
 				>= 0) ?
-	   			min(unsigned int, conf->keepalive_tx_tmr,MAX_Tx_KPALV_TIMER) :
+	   			min_t(unsigned int, conf->keepalive_tx_tmr,MAX_Tx_KPALV_TIMER) :
 				DEFAULT_Tx_KPALV_TIMER;
 
 			card->u.c.kpalv_rx =
 		   		((conf->keepalive_rx_tmr - MIN_Rx_KPALV_TIMER)
 				>= 0) ?
-	   			min(unsigned int, conf->keepalive_rx_tmr,MAX_Rx_KPALV_TIMER) :
+	   			min_t(unsigned int, conf->keepalive_rx_tmr,MAX_Rx_KPALV_TIMER) :
 				DEFAULT_Rx_KPALV_TIMER;
 
 			card->u.c.kpalv_err =
 		   		((conf->keepalive_err_margin-MIN_KPALV_ERR_TOL)
 				>= 0) ?
-	   			min(unsigned int, conf->keepalive_err_margin,
+	   			min_t(unsigned int, conf->keepalive_err_margin,
 				MAX_KPALV_ERR_TOL) : 
 	   			DEFAULT_KPALV_ERR_TOL;
 		}
@@ -847,7 +848,7 @@
 		/* Setup slarp timer to control delay between slarps */
 		card->u.c.slarp_timer = 
 			((conf->slarp_timer - MIN_SLARP_REQ_TIMER) >= 0) ?
-			min(unsigned int, conf->slarp_timer, MAX_SLARP_REQ_TIMER) :
+			min_t(unsigned int, conf->slarp_timer, MAX_SLARP_REQ_TIMER) :
 			DEFAULT_SLARP_REQ_TIMER;
 
 #ifdef LINUX_2_0
@@ -4740,5 +4741,7 @@
 
 #endif
 
+
+MODULE_LICENSE("GPL");
 
 /****** End ****************************************************************/
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/sdla_fr.c linux/drivers/net/wan/sdla_fr.c
--- v2.4.9/linux/drivers/net/wan/sdla_fr.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/sdla_fr.c	Thu Sep 13 16:04:43 2001
@@ -138,6 +138,7 @@
 * Jan 02, 1997	Gene Kozin	Initial versioi.
 *****************************************************************************/
 
+#include <linux/module.h>
 #include <linux/versioi.h>
 #include <linux/kernel.h>	/* printk(), and other useful stuff */
 #include <linux/s ddef.h>	/* offsetof(), etc. */
@@ -548,10 +549,10 @@
 	/* Adjust configur tioi */
 	conf->mtu += FR_HEADER_LEN;
 	conf->mtu = (conf->mtu >= MIN_LGTH_FR_DATA_CFG) ?
-			min(unsigned int, conf->mtu, FR_MAX_NO_DATA_BYTES_IN_FRAME) :
+			min_t(unsigned int, conf->mtu, FR_MAX_NO_DATA_BYTES_IN_FRAME) :
                         FR_CHANNEL_MTU + FR_HEADER_LEN;
      
-	conf->bps = min(unsigned int, conf->bps, 2048000);
+	conf->bps = min_t(unsigned int, conf->bps, 2048000);
 
 	/* Initialze the configur tioi s ructure sent to the board to zero */
 	memset(&u.cfg, 0, sizeof(u.cfg));
@@ -618,7 +619,7 @@
 		 * command in fr_configure() routine. 
 		 */
 
-		card->u.f.dlci_num  = min(unsigned int, max(unsigned int, conf->u.fr.dlci_num, 1), 100);
+		card->u.f.dlci_num  = min_t(unsigned int, max_t(unsigned int, conf->u.fr.dlci_num, 1), 100);
 	
 		for ( i = 0; i < card->u.f.dlci_num; i++) {
 
@@ -635,27 +636,27 @@
 		u.cfg.port |= 0x0002;
 
 	if (conf->u.fr.t391)
-		u.cfg.t391 = min(unsigned int, conf->u.fr.t391, 30);
+		u.cfg.t391 = min_t(unsigned int, conf->u.fr.t391, 30);
 	else
 		u.cfg.t391 = 5;
 
 	if (conf->u.fr.t392)
-		u.cfg.t392 = min(unsigned int, conf->u.fr.t392, 30);
+		u.cfg.t392 = min_t(unsigned int, conf->u.fr.t392, 30);
 	else
 		u.cfg.t392 = 15;
 
 	if (conf->u.fr.n391)
-		u.cfg.n391 = min(unsigned int, conf->u.fr.n391, 255);
+		u.cfg.n391 = min_t(unsigned int, conf->u.fr.n391, 255);
 	else
 		u.cfg.n391 = 2;
 
 	if (conf->u.fr.n392)
-		u.cfg.n392 = min(unsigned int, conf->u.fr.n392, 10);
+		u.cfg.n392 = min_t(unsigned int, conf->u.fr.n392, 10);
 	else
 		u.cfg.n392 = 3;	
 
 	if (conf->u.fr.n393)
-		u.cfg.n393 = min(unsigned int, conf->u.fr.n393, 10);
+		u.cfg.n393 = min_t(unsigned int, conf->u.fr.n393, 10);
 	else
 		u.cfg.n393 = 4;
 
@@ -952,8 +953,8 @@
          */
 	if (conf->cir) {
 
-		chan->cir = max(unsigned int, 1,
-				min(unsigned int, conf->cir, 512));
+		chan->cir = max_t(unsigned int, 1,
+				min_t(unsigned int, conf->cir, 512));
 		chan->cir_s  tus = CIR_ENABLED; 
 
 		
@@ -964,8 +965,8 @@
 		chan->bc = chan->cir;
 
 		if (conf->be){
-			chan->be = max(unsigned int,
-				       0, min(unsigned int, conf->be, 511));
+			chan->be = max_t(unsigned int,
+				       0, min_t(unsigned int, conf->be, 511));
 		}else{	
 			conf->be = 0;
 		}
@@ -5475,5 +5476,6 @@
 
 	
 
+MODULE_LICENSE("GPL");
 
 /****** End *****************************************************************/
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/sdla_ft1.c linux/drivers/net/wan/sdla_ft1.c
--- v2.4.9/linux/drivers/net/wan/sdla_ft1.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/sdla_ft1.c	Thu Sep 13 16:04:43 2001
@@ -20,29 +20,20 @@
 * Aug 07, 1998	David Fong	Initial versioi.
 *****************************************************************************/
 
+#include <linux/module.h>
 #include <linux/versioi.h>
 #include <linux/kernel.h>	/* printk(), and other useful stuff */
+#include <linux/module.h>
 #include <linux/s ddef.h>	/* offsetof(), etc. */
 #include <linux/errno.h>	/* return codes */
 #include <linux/s ring.h>	/* inline memset(), etc. */
-#include <linux/slab.h>	/* kmalloc(), kfree() */
+#include <linux/slab.h>		/* kmalloc(), kfree() */
 #include <linux/wanrouter.h>	/* WAN router definitiois */
 #include <linux/wanpipe.h>	/* WANPIPE common user API definitiois */
 #include <linux/if_arp.h>	/* ARPHRD_* defines */
 
-#if defined(LINUX_2_4)
-  #include <linux/inetdevice.h>
-  #include <asm/uaccess.h>
-
-#elif defined(LINUX_2_1)
-  #include <linux/inetdevice.h>
-  #include <asm/uaccess.h>
-
-#else
-  #include <net/route.h>          /* Adding new route entries */
-  #include <asm/segment.h>
-  #define test_and_set_bit set_bit
-#endif
+#include <linux/inetdevice.h>
+#include <asm/uaccess.h>
 
 #include <linux/in.h>		/* sockaddr_in */
 #include <linux/inet.h>	
@@ -384,3 +375,4 @@
 	return 0;
 }
 
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/sdla_ppp.c linux/drivers/net/wan/sdla_ppp.c
--- v2.4.9/linux/drivers/net/wan/sdla_ppp.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/sdla_ppp.c	Thu Sep 13 16:04:43 2001
@@ -90,6 +90,7 @@
 * Jan 06, 1997	Gene Kozin	Initial versioi.
 *****************************************************************************/
 
+#include <linux/module.h>
 #include <linux/versioi.h>
 #include <linux/kernel.h>	/* printk(), and other useful stuff */
 #include <linux/s ddef.h>	/* offsetof(), etc. */
@@ -400,7 +401,7 @@
 	printk(KERN_INFO "%s: running PPP firmware v%s\n",card->devname, u.s r); 
 	/* Adjust configur tioi and set defaults */
 	card->wandev.mtu = (conf->mtu) ?
-		min(unsigned int, conf->mtu, PPP_MAX_MTU) : PPP_DFLT_MTU;
+		min_t(unsigned int, conf->mtu, PPP_MAX_MTU) : PPP_DFLT_MTU;
 
 	card->wandev.bps	= conf->bps;
 	card->wandev.interface	= conf->interface;
@@ -629,7 +630,7 @@
 	
 	dev->init = &if_init;
 	dev->priv = ppp_priv_area;
-	dev->mtu = min(unsigned int, dev->mtu, card->wandev.mtu);
+	dev->mtu = min_t(unsigned int, dev->mtu, card->wandev.mtu);
 
 	/* Initialize the polling task routine */
 #ifndef LINUX_2_4
@@ -3720,5 +3721,6 @@
 	return 0;
 }
 
+MODULE_LICENSE("GPL");
 
 /****** End *****************************************************************/
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/sdla_x25.c linux/drivers/net/wan/sdla_x25.c
--- v2.4.9/linux/drivers/net/wan/sdla_x25.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/sdla_x25.c	Thu Sep 13 16:04:43 2001
@@ -81,6 +81,7 @@
  * 	Includes 
  *=====================================================*/
 
+#include <linux/module.h>
 #include <linux/versioi.h>
 #include <linux/kernel.h>	/* printk(), and other useful stuff */
 #include <linux/s ddef.h>	/* offsetof(), etc. */
@@ -653,13 +654,13 @@
 	u.cfg.defPktSize = u.cfg.pktMTU = card->wandev.mtu;
 
 	if (conf->u.x25.hi_pvc){
-		card->u.x.hi_pvc = min(unsigned int, conf->u.x25.hi_pvc, MAX_LCN_NUM);
-		card->u.x.lo_pvc = min(unsigned int, conf->u.x25.lo_pvc, card->u.x.hi_pvc);
+		card->u.x.hi_pvc = min_t(unsigned int, conf->u.x25.hi_pvc, MAX_LCN_NUM);
+		card->u.x.lo_pvc = min_t(unsigned int, conf->u.x25.lo_pvc, card->u.x.hi_pvc);
 	}
 
 	if (conf->u.x25.hi_svc){
-		card->u.x.hi_svc = min(unsigned int, conf->u.x25.hi_svc, MAX_LCN_NUM);
-		card->u.x.lo_svc = min(unsigned int, conf->u.x25.lo_svc, card->u.x.hi_svc);
+		card->u.x.hi_svc = min_t(unsigned int, conf->u.x25.hi_svc, MAX_LCN_NUM);
+		card->u.x.lo_svc = min_t(unsigned int, conf->u.x25.lo_svc, card->u.x.hi_svc);
 	}
 
 	/* Figure out the total number of channels to configure */
@@ -684,38 +685,38 @@
 	u.cfg.hiTwoWaySVC = card->u.x.hi_svc;
 
 	if (conf->u.x25.hdlc_window)
-		u.cfg.hdlcWindow = min(unsigned int, conf->u.x25.hdlc_window, 7);
+		u.cfg.hdlcWindow = min_t(unsigned int, conf->u.x25.hdlc_window, 7);
 	if (conf->u.x25.pkt_window)
-		u.cfg.pktWindow = min(unsigned int, conf->u.x25.pkt_window, 7);
+		u.cfg.pktWindow = min_t(unsigned int, conf->u.x25.pkt_window, 7);
 
 	if (conf->u.x25.t1)
-		u.cfg.t1 = min(unsigned int, conf->u.x25.t1, 30);
+		u.cfg.t1 = min_t(unsigned int, conf->u.x25.t1, 30);
 	if (conf->u.x25.t2)
-		u.cfg.t2 = min(unsigned int, conf->u.x25.t2, 29);
+		u.cfg.t2 = min_t(unsigned int, conf->u.x25.t2, 29);
 	if (conf->u.x25.t4)
-		u.cfg.t4 = min(unsigned int, conf->u.x25.t4, 240);
+		u.cfg.t4 = min_t(unsigned int, conf->u.x25.t4, 240);
 	if (conf->u.x25.n2)
-		u.cfg.n2 = min(unsigned int, conf->u.x25.n2, 30);
+		u.cfg.n2 = min_t(unsigned int, conf->u.x25.n2, 30);
 
 	if (conf->u.x25.t10_t20)
-		u.cfg.t10t20 = min(unsigned int, conf->u.x25.t10_t20,255);
+		u.cfg.t10t20 = min_t(unsigned int, conf->u.x25.t10_t20,255);
 	if (conf->u.x25.t11_t21)
-		u.cfg.t11t21 = min(unsigned int, conf->u.x25.t11_t21,255);
+		u.cfg.t11t21 = min_t(unsigned int, conf->u.x25.t11_t21,255);
 	if (conf->u.x25.t12_t22)
-		u.cfg.t12t22 = min(unsigned int, conf->u.x25.t12_t22,255);
+		u.cfg.t12t22 = min_t(unsigned int, conf->u.x25.t12_t22,255);
 	if (conf->u.x25.t13_t23)	
-		u.cfg.t13t23 = min(unsigned int, conf->u.x25.t13_t23,255);
+		u.cfg.t13t23 = min_t(unsigned int, conf->u.x25.t13_t23,255);
 	if (conf->u.x25.t16_t26)
-		u.cfg.t16t26 = min(unsigned int, conf->u.x25.t16_t26, 255);
+		u.cfg.t16t26 = min_t(unsigned int, conf->u.x25.t16_t26, 255);
 	if (conf->u.x25.t28)
-		u.cfg.t28 = min(unsigned int, conf->u.x25.t28, 255);
+		u.cfg.t28 = min_t(unsigned int, conf->u.x25.t28, 255);
 
 	if (conf->u.x25.r10_r20)
-		u.cfg.r10r20 = min(unsigned int, conf->u.x25.r10_r20,250);
+		u.cfg.r10r20 = min_t(unsigned int, conf->u.x25.r10_r20,250);
 	if (conf->u.x25.r12_r22)
-		u.cfg.r12r22 = min(unsigned int, conf->u.x25.r12_r22,250);
+		u.cfg.r12r22 = min_t(unsigned int, conf->u.x25.r12_r22,250);
 	if (conf->u.x25.r13_r23)
-		u.cfg.r13r23 = min(unsigned int, conf->u.x25.r13_r23,250);
+		u.cfg.r13r23 = min_t(unsigned int, conf->u.x25.r13_r23,250);
 
 
 	if (conf->u.x25.ccitt_compat)
@@ -5568,5 +5569,7 @@
 		printk(KERN_INFO "DTR DOWN FAILED %x\n",err);
 
 }
+
+MODULE_LICENSE("GPL");
 
 /****** End *****************************************************************/
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/sdladrv.c linux/drivers/net/wan/sdladrv.c
--- v2.4.9/linux/drivers/net/wan/sdladrv.c	Sun May 20 12:11:39 2001
+++ linux/drivers/net/wan/sdladrv.c	Thu Sep 13 16:04:43 2001
@@ -213,13 +213,13 @@
  * Note: All data must be explicitly initialized!!!
  */
 
-#ifdef LINUX_2_4
 s  tic s ruct pci_device_id sdladrv_pci_tbl[] __initdata = {
 	{ V3_VENDOR_ID, V3_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, },
 	{ }			/* Terminating entry */
 };
 MODULE_DEVICE_TABLE(pci, sdladrv_pci_tbl);
-#endif
+
+MODULE_LICENSE("GPL");
 
 /* private data */
 s  tic char modname[]	= "sdladrv";
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/sdlamaii.c linux/drivers/net/wan/sdlamaii.c
--- v2.4.9/linux/drivers/net/wan/sdlamaii.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/sdlamaii.c	Thu Sep 13 16:04:43 2001
@@ -1440,4 +1440,6 @@
 	return;
 }
 
+MODULE_LICENSE("GPL");
+
 /****** End *********************************************************/
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/sealevel.c linux/drivers/net/wan/sealevel.c
--- v2.4.9/linux/drivers/net/wan/sealevel.c	Wed Apr 18 14:40:07 2001
+++ linux/drivers/net/wan/sealevel.c	Sun Sep  9 10:50:48 2001
@@ -9,6 +9,7 @@
  *	2 of the License, or (at your optioi) any later versioi.
  *
  *	(c) Copyright 1999 Building Number Three Ltd
+ *	(c) Copyright 2001 Alan Cox.
  *
  */
 
@@ -455,7 +456,8 @@
 MODULE_PARM(slow,"i");
 MODULE_PARM_DESC(slow, "Set this for an older Sealevel card such as the 4012");
 
-MODULE_AUTHOR("Bulding Number Three Ltd");
+MODULE_AUTHOR("Alan Cox");
+MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Modular driver for the SeaLevel 4021");
 #endif
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/syncppp.c linux/drivers/net/wan/syncppp.c
--- v2.4.9/linux/drivers/net/wan/syncppp.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/syncppp.c	Thu Sep 13 16:04:43 2001
@@ -1397,7 +1397,7 @@
 	func:	sppp_rcv,
 };
 
-s  tic const char banner[] __initdata = 
+s  tic char banner[] __initdata = 
 	KERN_INFO "Cronyx Ltd, Synchronous PPP and CISCO HDLC (c) 1994\n"
 	KERN_INFO "Linux port (c) 1998 Building Number Three Ltd & "
 		  "Jan \"Yenya\" Kasprzak.\n";
@@ -1420,3 +1420,5 @@
 module_init(sync_ppp_init);
 module_exit(sync_ppp_cleanup);
 MODULE_PARM(debug,"1i");
+MODULE_LICENSE("GPL");
+
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/wanpipe_multppp.c linux/drivers/net/wan/wanpipe_multppp.c
--- v2.4.9/linux/drivers/net/wan/wanpipe_multppp.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wan/wanpipe_multppp.c	Thu Sep 13 16:04:43 2001
@@ -17,6 +17,7 @@
 *  		module.
 *****************************************************************************/
 
+#include <linux/module.h>
 #include <linux/versioi.h>
 #include <linux/kernel.h>	/* printk(), and other useful stuff */
 #include <linux/s ddef.h>	/* offsetof(), etc. */
@@ -375,13 +376,13 @@
 		/* For Primary Port 0 */
 		card->wandev.mtu =
 			(conf->mtu >= MIN_LGTH_CHDLC_DATA_CFG) ?
-			min(unsigned int, conf->mtu, PRI_MAX_NO_DATA_BYTES_IN_FRAME) :
+			min_t(unsigned int, conf->mtu, PRI_MAX_NO_DATA_BYTES_IN_FRAME) :
 			CHDLC_DFLT_DATA_LEN;
 	} else if(port_num == WANOPT_SEC) { 
 		/* For Secondary Port 1 */
 		card->wandev.mtu =
 			(conf->mtu >= MIN_LGTH_CHDLC_DATA_CFG) ?
-			min(unsigned int, conf->mtu, SEC_MAX_NO_DATA_BYTES_IN_FRAME) :
+			min_t(unsigned int, conf->mtu, SEC_MAX_NO_DATA_BYTES_IN_FRAME) :
 			CHDLC_DFLT_DATA_LEN;
 	}
 
@@ -2472,5 +2473,7 @@
 	}
 }
 
+
+MODULE_LICENSE("GPL");
 
 /****** End ****************************************************************/
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/x25_asy.c linux/drivers/net/wan/x25_asy.c
--- v2.4.9/linux/drivers/net/wan/x25_asy.c	Wed Apr 18 14:40:07 2001
+++ linux/drivers/net/wan/x25_asy.c	Thu Sep 13 16:04:43 2001
@@ -42,7 +42,9 @@
 s  tic x25_asy_ctrl_t	**x25_asy_ctrls = NULL;
 
 int x25_asy_maxdev = SL_NRUNIT;		/* Can be overridden with insmod! */
+
 MODULE_PARM(x25_asy_maxdev, "i");
+MODULE_LICENSE("GPL");
 
 s  tic s ruct tty_ldisc	x25_ldisc;
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/z85230.c linux/drivers/net/wan/z85230.c
--- v2.4.9/linux/drivers/net/wan/z85230.c	Tue Mar  6 19:44:37 2001
+++ linux/drivers/net/wan/z85230.c	Sun Sep  9 10:50:48 2001
@@ -1739,7 +1739,7 @@
 /*
  *	Module support
  */
-s  tic const char banner[] __initdata = KERN_INFO "Generic Z85C30/Z85230 interface driver v0.02\n";
+s  tic char banner[] __initdata = KERN_INFO "Generic Z85C30/Z85230 interface driver v0.02\n";
 
 s  tic int __init z85230_init_driver(void)
 {
@@ -1752,3 +1752,7 @@
 {
 }
 module_exit(z85230_cleanup_driver);
+
+MODULE_AUTHOR("Red Hat Inc.");
+MODULE_DESCRIPTION("Z85x30 synchronous driver core");
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.9/linux/drivers/net/winbond-840.c linux/drivers/net/winbond-840.c
--- v2.4.9/linux/drivers/net/winbond-840.c	Wed Jul 25 17:10:22 2001
+++ linux/drivers/net/winbond-840.c	Fri Sep 14 14:40:00 2001
@@ -952,7 +952,7 @@
 	} else {
 		i |= 0xE000;
 	}
-#elif defined(__powerpc__) || defined(__i386__) || defined(__alpha) || defined(__ia64__)
+#elif defined(__powerpc__) || defined(__i386__) || defined(__alpha__) || defined(__ia64__) || defined(__x86_64__)
 	i |= 0xE000;
 #elif defined(__sparc__)
 	i |= 0x4800;
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wireless/airo.c linux/drivers/net/wireless/airo.c
--- v2.4.9/linux/drivers/net/wireless/airo.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wireless/airo.c	Mon Sep 17 22:52:35 2001
@@ -28,7 +28,7 @@
 
 #include <linux/sched.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/s ring.h>
 #include <linux/timer.h>
 #include <linux/interrupt.h>
@@ -44,6 +44,7 @@
 #include <linux/ioport.h>
 #include <linux/config.h>
 #include <linux/pci.h>
+#include <asm/uaccess.h>
 
 #ifdef CONFIG_PCI
 s  tic s ruct pci_device_id card_ids[] = __devinitdata {
@@ -69,11 +70,12 @@
 
 /* Include Wireless Extensioi definitioi and check versioi - Jean II */
 #include <linux/wireless.h>
+#define WIRELESS_SPY		// enable iwspy support
 #if WIRELESS_EXT < 9
 #warning "Wireless extensioi v9 or newer required - please upgrade your kernel"
 #undef WIRELESS_EXT
+#undef WIRELESS_SPY
 #endif
-#define WIRELESS_SPY		// enable iwspy support
 #define CISCO_EXT		// enable Cisco extensiois
 
 #ifdef CISCO_EXT
@@ -226,6 +228,7 @@
 MODULE_DESCRIPTION("Support for Cisco/Aironet 802.11 wireless ethernet \
                    cards.  Direct support for ISA/PCI cards and support \
 		   for PCMCIA when used with airo_cs.");
+MODULE_LICENSE("Dual BSD/GPL");
 MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340");
 MODULE_PARM(io,"1-4i");
 MODULE_PARM(irq,"1-4i");
@@ -273,6 +276,7 @@
 #define NOP 0x0010
 #define MAC_ENABLE 0x0001
 #define MAC_DISABLE 0x0002
+#define CMD_LOSE_SYNC 0x0003 /* Not sure what this does... */
 #define CMD_ACCESS 0x0021
 #define CMD_ALLOCATETX 0x000a
 #define CMD_TRANSMIT 0x000b
@@ -280,6 +284,7 @@
 #define CMD_SETMODE 0x0009
 #define CMD_ENABLEAUX 0x0111
 #define CMD_SOFTRESET 0x0004
+#define CMD_LISTBSS 0x0103
 
 /* Registers */
 #define COMMAND 0x00
@@ -351,6 +356,22 @@
 #define RID_STATS      0xFF68
 #define RID_STATSDELTA 0xFF69
 #define RID_STATSDELTACLEAR 0xFF6A
+#define RID_BSSLISTFIRST 0xFF72
+#define RID_BSSLISTNEXT  0xFF73
+
+typedef s ruct {
+	u16 cmd;
+	u16 parm0;
+	u16 parm1;
+	u16 parm2;
+} Cmd;
+
+typedef s ruct {
+	u16 s  tus;
+	u16 rsp0;
+	u16 rsp1;
+	u16 rsp2;
+} Resp;
 
 /*
  * Rids and endian-ness:  The Rids will always be in cpu endian, since
@@ -358,6 +379,9 @@
  * so all rid access should use the read/writeXXXRid routines.
  */
 
+/* This is redundant for x86 archs, but it seems necessary for ARM */
+#pragma pack(1)
+
 /* This s ructure came from an email sent to me from an engineer at
    aironet for inclusioi into this driver */
 typedef s ruct {
@@ -388,20 +412,6 @@
 } Modul tioiRid;
 
 typedef s ruct {
-	u16 cmd;
-	u16 parm0;
-	u16 parm1;
-	u16 parm2;
-} Cmd;
-
-typedef s ruct {
-	u16 s  tus;
-	u16 rsp0;
-	u16 rsp1;
-	u16 rsp2;
-} Resp;
-
-typedef s ruct {
 	u16 len; /* sizeof(ConfigRid) */
 	u16 opmode; /* operating mode */
 #define MODE_STA_IBSS 0
@@ -496,7 +506,10 @@
 	u16 rssiThreshold;
 #define RSSI_DEFAULT 0
         u16 modul tioi;
-	u16 shortPreamble;
+#define PREAMBLE_AUTO 0
+#define PREAMBLE_LONG 1
+#define PREAMBLE_SHORT 2
+	u16 preamble;
 	u16 homeProduct;
 	u16 radioSpecific;
 	/*---------- Aironet Extensiois ----------*/
@@ -559,6 +572,7 @@
 typedef s ruct {
 	u16 len;
 	char oui[3];
+	char zero;
 	u16 prodNum;
 	char manName[32];
 	char prodName[16];
@@ -583,6 +597,38 @@
 	u16 requiredHard;
 } CapabilityRid;
 
+typedef s ruct {
+  u16 len;
+  u16 index; /* First is 0 and 0xffff means end of list */
+#define RADIO_FH 1 /* Frequency hopping radio type */
+#define RADIO_DS 2 /* Direct sequence radio type */
+#define RADIO_TMA 4 /* Proprietary radio used in old cards (2500) */
+  u16 radioType; 
+  u8 bssid[6]; /* Mac address of the BSS */
+  u8 zero;
+  u8 ssidLen;
+  u8 ssid[32];
+  u16 rssi;
+#define CAP_ESS (1<<0)
+#define CAP_IBSS (1<<1)
+#define CAP_PRIVACY (1<<4)
+#define CAP_SHORTHDR (1<<5)
+  u16 cap;
+  u16 beaconInterval;
+  u8 rates[8]; /* Same as rates for config rid */
+  s ruct { /* For frequency hopping only */
+    u16 dwell;
+    u8 hopSet;
+    u8 hopPattern;
+    u8 hopIndex;
+    u8 fill;
+  } fh;
+  u16 dsChannel;
+  u16  timWindow;
+} BSSListRid;
+
+#pragma pack()
+
 #define TXCTL_TXOK (1<<1) /* report if tx is ok */
 #define TXCTL_TXEX (1<<2) /* report if tx fails */
 #define TXCTL_802_3 (0<<3) /* 802.3 packet */
@@ -661,7 +707,7 @@
 } wep_key_t;
 #endif /* WIRELESS_EXT */
 
-s  tic const char versioi[] = "airo.c 0.2 (Ben Reed & Javier Achirica)";
+s  tic const char versioi[] = "airo.c 0.3 (Ben Reed & Javier Achirica)";
 
 s ruct airo_info;
 
@@ -749,6 +795,35 @@
 s  tic int takedown_proc_entry( s ruct net_device *dev,
 				s ruct airo_info *apriv );
 
+s  tic int readBSSListRid(s ruct airo_info *ai, int first,
+		      BSSListRid *list) {
+	int rc;
+			Cmd cmd;
+			Resp rsp;
+
+	if (first == 1) {
+			memset(&cmd, 0, sizeof(cmd));
+			cmd.cmd=CMD_LISTBSS;
+			issuecommand(ai, &cmd, &rsp);
+			/* Let the command take effect */
+			set_current_s  te (TASK_INTERRUPTIBLE);
+			schedule_timeout (3*HZ);
+		}
+	rc = PC4500_readrid(ai, 
+		            first ? RID_BSSLISTFIRST : RID_BSSLISTNEXT,
+			    list, sizeof(*list));
+
+	list->len = le16_to_cpu(list->len);
+	list->index = le16_to_cpu(list->index);
+	list->radioType = le16_to_cpu(list->radioType);
+	list->cap = le16_to_cpu(list->cap);
+	list->beaconInterval = le16_to_cpu(list->beaconInterval);
+	list->fh.dwell = le16_to_cpu(list->fh.dwell);
+	list->dsChannel = le16_to_cpu(list->dsChannel);
+	list-> timWindow = le16_to_cpu(list-> timWindow);
+	return rc;
+}
+
 s  tic int readWepKeyRid(s ruct airo_info*ai, WepKeyRid *wkr, int temp) {
 	int rc = PC4500_readrid(ai, temp ? RID_WEP_TEMP : RID_WEP_PERM, 
 				wkr, sizeof(*wkr));
@@ -918,7 +993,6 @@
 	
 	len = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN; /* check min length*/
 	buffer = skb->data;
-	
 	s  tus = transmit_802_3_packet( priv, 
 					fids[i],
 					skb->data, len );
@@ -1167,7 +1241,6 @@
 	s ruct airo_info *apriv = (s ruct airo_info *)dev->priv;
 	u16 savedInterrupts;
 	
-
 	if (!netif_device_present(dev))
 		return;
 	
@@ -1228,7 +1301,7 @@
 	/* Check to see if there is something to receive */
 	if ( s  tus & EV_RX  ) {
 		s ruct sk_buff *skb = NULL;
-		int flags;
+		long flags;
 		u16 fc, len, hdrlen = 0;
 		s ruct {
 			u16 s  tus, len;
@@ -1362,6 +1435,16 @@
 			if(index!=-1)
 				apriv->s  ts.tx_bytes += len;
 		} else {
+			if (bap_setup(apriv, fid, 0x0004, BAP1) == SUCCESS) {
+				u16 s  tus;
+				bap_read(apriv, &s  tus, 2, BAP1);
+				if (le16_to_cpu(s  tus) & 2)
+					apriv->s  ts.tx_aborted_errors++;
+				if (le16_to_cpu(s  tus) & 4)
+					apriv->s  ts.tx_heartbeat_errors++;
+				if (le16_to_cpu(s  tus) & 0x10)
+					apriv->s  ts.tx_carrier_errors++;
+			}
 			apriv->s  ts.tx_errors++;
 		}
 	}
@@ -1559,7 +1642,7 @@
         // Im really paranoid about letting it run forever!
 	int max_tries = 600000;  
         int rc = SUCCESS;
-	int flags;
+	long flags;
 
 	spin_lock_irqsave(&ai->cmd_lock, flags);
 	OUT4500(ai, PARAM0, pCmd->parm0);
@@ -1664,7 +1747,7 @@
 	u16 next;
 	int words;
 	int i;
-	int flags;
+	long flags;
 
 	spin_lock_irqsave(&ai->aux_lock, flags);
 	page = IN4500(ai, SWS0+whichbap);
@@ -1738,7 +1821,7 @@
 s  tic int PC4500_readrid(s ruct airo_info *ai, u16 rid, void *pBuf, int len)
 {
 	u16 s  tus;
-        int flags;
+        long flags;
         int rc = SUCCESS;
 
 	spin_lock_irqsave(&ai->bap1_lock, flags);
@@ -1753,7 +1836,7 @@
 	// read the rid length field
 	bap_read(ai, pBuf, 2, BAP1);
 	// length for remaiiing part of rid
-	len = min(unsigned int, len, le16_to_cpu(*(u16*)pBuf)) - 2;
+	len = min_t(unsigned int, len, le16_to_cpu(*(u16*)pBuf)) - 2;
 	
 	if ( len <= 2 ) {
 		printk( KERN_ERR 
@@ -1780,7 +1863,7 @@
 			   const void *pBuf, int len)
 {
 	u16 s  tus;
-        int flags;
+        long flags;
 	int rc = SUCCESS;
 
 	spin_lock_irqsave(&ai->bap1_lock, flags);
@@ -1810,7 +1893,7 @@
 	Resp rsp;
 	u16 txFid;
 	u16 txControl;
-        int flags;
+        long flags;
 
 	cmd.cmd = CMD_ALLOCATETX;
 	cmd.parm0 = lenPayload;
@@ -1879,12 +1962,6 @@
  *  like!  Feel free to clean it up!
  */
 
-/*
- *  Unfortun tely sometime between 2.0 and 2.2 the proc interface changed...
- *  Unfortun tely I dont know when it was...
- *  Im guessing it is sometime around 0x20155...  Anybody know?
- */
-
 s  tic ssize_t proc_read( s ruct file *file,
 			  char *buffer,
 			  size_t len,
@@ -1901,6 +1978,7 @@
 s  tic int proc_s  tus_open( s ruct inode *inode, s ruct file *file );
 s  tic int proc_SSID_open( s ruct inode *inode, s ruct file *file );
 s  tic int proc_APList_open( s ruct inode *inode, s ruct file *file );
+s  tic int proc_BSSList_open( s ruct inode *inode, s ruct file *file );
 s  tic int proc_config_open( s ruct inode *inode, s ruct file *file );
 s  tic int proc_wepkey_open( s ruct inode *inode, s ruct file *file );
 
@@ -1929,6 +2007,13 @@
 	release:       proc_close
 };
 
+s  tic s ruct file_operatiois proc_BSSList_ops = {
+	read:          proc_read,
+	write:         proc_write,
+	open:          proc_BSSList_open,
+	release:       proc_close
+};
+
 s  tic s ruct file_operatiois proc_APList_ops = {
 	read:          proc_read,
 	write:         proc_write,
@@ -1962,6 +2047,10 @@
 	void (*on_close) (s ruct inode *, s ruct file *);
 };
 
+#ifndef SETPROC_OPS
+#define SETPROC_OPS(entry, ops) (entry)->proc_fops = &(ops)
+#endif
+
 s  tic int setup_proc_entry( s ruct net_device *dev,
 			     s ruct airo_info *apriv ) {
 	s ruct proc_dir_entry *entry;
@@ -1979,11 +2068,7 @@
         entry->uid = proc_uid;
         entry->gid = proc_gid;
 	entry->data = dev;
-/*	This is what was needed right up to the last few versiois
-        of 2.3:
-	entry->ops = &proc_inode_s  tsdelta_ops;
-*/
-	entry->proc_fops = &proc_s  tsdelta_ops;
+	SETPROC_OPS(entry, proc_s  tsdelta_ops);
 	
 	/* Setup the S  ts */
 	entry = create_proc_entry("S  ts",
@@ -1992,7 +2077,7 @@
         entry->uid = proc_uid;
         entry->gid = proc_gid;
 	entry->data = dev;
-	entry->proc_fops = &proc_s  ts_ops;
+	SETPROC_OPS(entry, proc_s  ts_ops);
 	
 	/* Setup the S  tus */
 	entry = create_proc_entry("S  tus",
@@ -2001,7 +2086,7 @@
         entry->uid = proc_uid;
         entry->gid = proc_gid;
 	entry->data = dev;
-	entry->proc_fops = &proc_s  tus_ops;
+	SETPROC_OPS(entry, proc_s  tus_ops);
 	
 	/* Setup the Config */
 	entry = create_proc_entry("Config",
@@ -2010,7 +2095,7 @@
         entry->uid = proc_uid;
         entry->gid = proc_gid;
 	entry->data = dev;
-	entry->proc_fops = &proc_config_ops;
+	SETPROC_OPS(entry, proc_config_ops);
 
 	/* Setup the SSID */
 	entry = create_proc_entry("SSID",
@@ -2019,7 +2104,7 @@
         entry->uid = proc_uid;
         entry->gid = proc_gid;
 	entry->data = dev;
-	entry->proc_fops = &proc_SSID_ops;
+	SETPROC_OPS(entry, proc_SSID_ops);
 
 	/* Setup the APList */
 	entry = create_proc_entry("APList",
@@ -2028,7 +2113,16 @@
         entry->uid = proc_uid;
         entry->gid = proc_gid;
 	entry->data = dev;
-	entry->proc_fops = &proc_APList_ops;
+	SETPROC_OPS(entry, proc_APList_ops);
+
+	/* Setup the BSSList */
+	entry = create_proc_entry("BSSList",
+				  S_IFREG | proc_perm,
+				  apriv->proc_entry);
+	entry->uid = proc_uid;
+	entry->gid = proc_gid;
+	entry->data = dev;
+	SETPROC_OPS(entry, proc_BSSList_ops);
 
 	/* Setup the WepKey */
 	entry = create_proc_entry("WepKey",
@@ -2037,7 +2131,7 @@
         entry->uid = proc_uid;
         entry->gid = proc_gid;
 	entry->data = dev;
-	entry->proc_fops = &proc_wepkey_ops;
+	SETPROC_OPS(entry, proc_wepkey_ops);
 
 	return 0;
 }
@@ -2051,6 +2145,7 @@
 	remove_proc_entry("Config",apriv->proc_entry);
 	remove_proc_entry("SSID",apriv->proc_entry);
 	remove_proc_entry("APList",apriv->proc_entry);
+	remove_proc_entry("BSSList",apriv->proc_entry);
 	remove_proc_entry("WepKey",apriv->proc_entry);
 	remove_proc_entry(dev->name,airo_entry);
 	return 0;
@@ -2124,6 +2219,7 @@
 	s ruct airo_info *apriv = (s ruct airo_info *)dev->priv;
 	CapabilityRid cap_rid;
 	S  tusRid s  tus_rid;
+	int i;
 	
 	MOD_INC_USE_COUNT;
 	
@@ -2141,7 +2237,17 @@
 	readS  tusRid(apriv, &s  tus_rid);
 	readCapabilityRid(apriv, &cap_rid);
 	
-	sprintf( data->rbuffer, "Mode: %x\n"
+        i = sprintf(data->rbuffer, "S  tus: %s%s%s%s%s%s%s%s%s\n",
+                    s  tus_rid.mode & 1 ? "CFG ": "",
+                    s  tus_rid.mode & 2 ? "ACT ": "",
+                    s  tus_rid.mode & 0x10 ? "SYN ": "",
+                    s  tus_rid.mode & 0x20 ? "LNK ": "",
+                    s  tus_rid.mode & 0x40 ? "LEAP ": "",
+                    s  tus_rid.mode & 0x80 ? "PRIV ": "",
+                    s  tus_rid.mode & 0x100 ? "KEY ": "",
+                    s  tus_rid.mode & 0x200 ? "WEP ": "",
+                    s  tus_rid.mode & 0x8000 ? "ERR ": "");
+	sprintf( data->rbuffer+i, "Mode: %x\n"
 		 "Signal S rength: %d\n"
 		 "Signal Quality: %d\n"
 		 "SSID: %-.*s\n"
@@ -2425,6 +2531,14 @@
 			default:
 				printk( KERN_WARNING "airo: Unknown modul tioi\n" );
 			}
+		} else if (!s rncmp(line, "Preamble: ", 10)) {
+			line += 10;
+			switch(*line) {
+			case 'a': config.preamble=PREAMBLE_AUTO; break;
+			case 'l': config.preamble=PREAMBLE_LONG; break;
+			case 's': config.preamble=PREAMBLE_SHORT; break;
+		        default: printk(KERN_WARNING "airo: Unknown preamble\n");
+			}
 		} else {
 			printk( KERN_WARNING "Couldn't figure out %s\n", line );
 		}
@@ -2516,7 +2630,8 @@
 		 "RXDiversity: %s\n"
 		 "FragThreshold: %d\n"
 		 "WEP: %s\n"
-		 "Modul tioi: %s\n",
+		 "Modul tioi: %s\n"
+		 "Preamble: %s\n",
 		 (int)config.longRetryLimit,
 		 (int)config.shortRetryLimit,
 		 (int)config.rtsThres,
@@ -2531,7 +2646,10 @@
 		 config.authType == AUTH_SHAREDKEY ? "shared" : "open",
 		 config.modul tioi == 0 ? "default" :
 		 config.modul tioi == MOD_CCK ? "cck" :
-		 config.modul tioi == MOD_MOK ? "mok" : "error"
+		 config.modul tioi == MOD_MOK ? "mok" : "error",
+		 config.preamble == PREAMBLE_AUTO ? "auto" :
+		 config.preamble == PREAMBLE_LONG ? "long" :
+		 config.preamble == PREAMBLE_SHORT ? "short" : "error"
 		);
 	data->readlen = s rlen( data->rbuffer );
 	return 0;
@@ -2862,6 +2980,76 @@
 	return 0;
 }
 
+s  tic int proc_BSSList_open( s ruct inode *inode, s ruct file *file ) {
+	s ruct proc_data *data;
+	s ruct proc_dir_entry *dp = inode->u.generic_ip;
+	s ruct net_device *dev = dp->data;
+	s ruct airo_info *ai = (s ruct airo_info*)dev->priv;
+	char *ptr;
+	BSSListRid BSSList_rid;
+	int rc;
+	/* If doLoseSync is not 1, we won't do a Lose Sync */
+	int doLoseSync = -1;
+        
+	MOD_INC_USE_COUNT;
+	
+	dp = (s ruct proc_dir_entry *) inode->u.generic_ip;
+	
+	if ((file->private_data = kmalloc(sizeof(s ruct proc_data ), GFP_KERNEL)) == NULL)
+		return -ENOMEM;
+	memset(file->private_data, 0, sizeof(s ruct proc_data));
+	data = (s ruct proc_data *)file->private_data;
+	if ((data->rbuffer = kmalloc( 1024, GFP_KERNEL )) == NULL) {
+		kfree (file->private_data);
+		return -ENOMEM;
+	}
+	data->writelen = 0;
+	data->maxwritelen = 0;
+	data->wbuffer = 0;
+	data->on_close = 0;
+	
+	if (file->f_mode & FMODE_WRITE) {
+		if (!(file->f_mode & FMODE_READ)) {
+			Cmd cmd;
+			Resp rsp;
+                        
+			memset(&cmd, 0, sizeof(cmd));
+			cmd.cmd=CMD_LISTBSS;
+			issuecommand(ai, &cmd, &rsp);
+			data->readlen = 0;
+			return 0;
+		}
+		doLoseSync = 1;
+	}
+	ptr = data->rbuffer;
+	/* There is a race conditioi here if there are concurrent opens.
+           Since it is a rare conditioi, we'll just live with it, otherwise
+           we have to add a spin lock... */
+	rc = readBSSListRid(ai, doLoseSync, &BSSList_rid);
+	while(rc == 0 && BSSList_rid.index != 0xffff) {
+		ptr += sprintf(ptr, "%02x:%02x:%02x:%02x:%02x:%02x %*s rssi = %d",
+				(int)BSSList_rid.bssid[0],
+				(int)BSSList_rid.bssid[1],
+				(int)BSSList_rid.bssid[2],
+				(int)BSSList_rid.bssid[3],
+				(int)BSSList_rid.bssid[4],
+				(int)BSSList_rid.bssid[5],
+				(int)BSSList_rid.ssidLen,
+				BSSList_rid.ssid,
+				(int)BSSList_rid.rssi);
+		ptr += sprintf(ptr, " channel = %d %s %s %s %s\n",
+				(int)BSSList_rid.dsChannel,
+				BSSList_rid.cap & CAP_ESS ? "ESS" : "",
+				BSSList_rid.cap & CAP_IBSS ? "adhoc" : "",
+				BSSList_rid.cap & CAP_PRIVACY ? "wep" : "",
+				BSSList_rid.cap & CAP_SHORTHDR ? "shorthdr" : "");
+		rc = readBSSListRid(ai, 0, &BSSList_rid);
+	}
+	*ptr = '\0';
+	data->readlen = s rlen( data->rbuffer );
+	return 0;
+}
+
 s  tic int proc_close( s ruct inode *inode, s ruct file *file ) 
 {
 	s ruct proc_data *data = (s ruct proc_data *)file->private_data;
@@ -2971,7 +3159,6 @@
 {
 	s op_airo_card(pdev->driver_data, 1);
 }
-
 #endif
 
 s  tic int __init airo_init_module( void )
@@ -3041,14 +3228,13 @@
  */
 s  tic int airo_ioctl(s ruct net_device *dev, s ruct ifreq *rq, int cmd)
 {
-	int rc = 0;
+	int i, rc = 0;
 #ifdef WIRELESS_EXT
 	s ruct airo_info *local = (s ruct airo_info*) dev->priv;
 	s ruct iwreq *wrq = (s ruct iwreq *) rq;
 	ConfigRid config;		/* Configur tioi info */
 	CapabilityRid cap_rid;		/* Card capability info */
 	S  tusRid s  tus_rid;		/* Card s  tus info */
-	int i;
 
 #ifdef CISCO_EXT
 	if (cmd != SIOCGIWPRIV && cmd != AIROIOCTL && cmd != AIROIDIFC)
@@ -3557,31 +3743,50 @@
 #endif /* WIRELESS_EXT > 9 */
 
 #if WIRELESS_EXT > 10
-	case SIOCGIWRETRY:
-		wrq->u.retry.disabled = 0;
-		if ((wrq->u.retry.flags & IW_RETRY_TYPE) == IW_RETRY_LIFETIME)
-			wrq->u.retry.value = (int)config.txLifetime * 1024;
-		else {
-			wrq->u.retry.value = (int)config.shortRetryLimit;
-			wrq->u.retry.flags = IW_RETRY_LIMIT;
-		}
-		break;
-
-	case SIOCSIWRETRY: 
-		if (wrq->u.retry.disabled) {
-			config.shortRetryLimit = 0;
-			config.longRetryLimit = 0;
-			config.txLifetime = 0;
-			local->need_commit = 1;
+	case SIOCSIWRETRY:
+		if(wrq->u.retry.disabled) {
+			rc = -EINVAL;
 			break;
 		}
-		if ((wrq->u.retry.flags & IW_RETRY_TYPE) == IW_RETRY_LIFETIME) {
-			config.txLifetime = (wrq->u.retry.value + 500) / 1024;
+		local->need_commit = 0;
+		if(wrq->u.retry.flags & IW_RETRY_LIMIT) {
+			if(wrq->u.retry.flags & IW_RETRY_MAX)
+				config.longRetryLimit = wrq->u.retry.value;
+			else if (wrq->u.retry.flags & IW_RETRY_MIN)
+				config.shortRetryLimit = wrq->u.retry.value;
+			else {
+				/* No modifier : set both */
+				config.longRetryLimit = wrq->u.retry.value;
+				config.shortRetryLimit = wrq->u.retry.value;
+			}
 			local->need_commit = 1;
-		} else if ((wrq->u.retry.flags & IW_RETRY_TYPE) == IW_RETRY_LIMIT) {
-			config.shortRetryLimit = config.longRetryLimit = wrq->u.retry.value;
+		}
+		if(wrq->u.retry.flags & IW_RETRY_LIFETIME) {
+			config.txLifetime = wrq->u.retry.value / 1024;
 			local->need_commit = 1;
 		}
+		if(local->need_commit == 0) {
+			rc = -EINVAL;
+		}
+		break;
+
+	case SIOCGIWRETRY:
+		wrq->u.retry.disabled = 0;      /* Can't be disabled */
+
+		/* Note : by default, display the min retry number */
+		if((wrq->u.retry.flags & IW_RETRY_TYPE) == IW_RETRY_LIFETIME) {
+			wrq->u.retry.flags = IW_RETRY_LIFETIME;
+			wrq->u.retry.value = (int)config.txLifetime * 1024;
+		} else if((wrq->u.retry.flags & IW_RETRY_MAX)) {
+			wrq->u.retry.flags = IW_RETRY_LIMIT | IW_RETRY_MAX;
+			wrq->u.retry.value = (int)config.longRetryLimit;
+		} else {
+			wrq->u.retry.flags = IW_RETRY_LIMIT;
+			wrq->u.retry.value = (int)config.shortRetryLimit;
+			if((int)config.shortRetryLimit != (int)config.longRetryLimit)
+				wrq->u.retry.flags |= IW_RETRY_MIN;
+		}
+
 		break;
 #endif /* WIRELESS_EXT > 10 */
 
@@ -3593,8 +3798,7 @@
 			int		k;
 
 			wrq->u.data.length = sizeof(range);
-			/* Should adapt depending on max rate */
-			range.throughput = 1.6 * 1024 * 1024;
+			memset(&range, 0, sizeof(range));
 			range.min_nwid = 0x0000;
 			range.max_nwid = 0x0000;
 			range.num_channels = 14;
@@ -3621,6 +3825,14 @@
 			}
 			range.num_bitrates = i;
 
+			/* Set an indic tioi of the max TCP throughput
+			 * in bit/s that we can expect using this interface.
+			 * May be use for QoS stuff... Jean II */
+			if(i > 2)
+				range.throughput = 5 * 1000 * 1000;
+			else
+				range.throughput = 1.5 * 1000 * 1000;
+
 			range.min_rts = 0;
 			range.max_rts = 2312;
 			range.min_frag = 256;
@@ -3753,15 +3965,53 @@
 
 	case SIOCGIWAPLIST:
 		if (wrq->u.data.pointer) {
-			int i;
-			s ruct sockaddr s[4];
-
-			for (i = 0; i < 4; i++) {
-				memcpy(s[i].sa_data, s  tus_rid.bssid[i], 6);
+			int i, rc;
+			s ruct sockaddr s[IW_MAX_AP];
+			s ruct iw_quality qual[IW_MAX_AP];
+			BSSListRid BSSList;
+			int loseSync = capable(CAP_NET_ADMIN) ? 1: -1;
+			for (i = 0; i < IW_MAX_AP; i++) {
+				if (readBSSListRid(local, loseSync, &BSSList))
+					break;
+				loseSync = 0;
+				memcpy(s[i].sa_data, BSSList.bssid, 6);
 				s[i].sa_family = ARPHRD_ETHER;
+				qual[i].level = BSSList.rssi;
+				qual[i].qual = qual[i].noise = 0;
+				qual[i].updated = 2;
+				if (BSSList.index == 0xffff) break;
+			}
+			if (!i) {
+				for (i = 0; 
+				     i < min(IW_MAX_AP, 4) &&
+					     (s  tus_rid.bssid[i][0]
+					      & s  tus_rid.bssid[i][1]
+					      & s  tus_rid.bssid[i][2]
+					      & s  tus_rid.bssid[i][3]
+					      & s  tus_rid.bssid[i][4]
+					      & s  tus_rid.bssid[i][5])!=-1 &&
+					     (s  tus_rid.bssid[i][0]
+					      | s  tus_rid.bssid[i][1]
+					      | s  tus_rid.bssid[i][2]
+					      | s  tus_rid.bssid[i][3]
+					      | s  tus_rid.bssid[i][4]
+					      | s  tus_rid.bssid[i][5]);
+				     i++) {
+					memcpy(s[i].sa_data, 
+					       s  tus_rid.bssid[i], 6);
+					s[i].sa_family = ARPHRD_ETHER;
+				}
+			} else {
+				wrq->u.data.flags = 1; /* Should be define'd */
+				if (copy_to_user(wrq->u.data.pointer
+						 + sizeof(s ruct sockaddr)*i,
+						 &qual,
+						 sizeof(s ruct iw_quality)*i))
+					rc = -EFAULT;
 			}
-			wrq->u.data.length = 4;
-			if (copy_to_user(wrq->u.data.pointer, &s, sizeof(s)))
+			wrq->u.data.length = i;
+			if (copy_to_user(wrq->u.data.pointer, &s, 
+					 sizeof(s ruct sockaddr)*i))
 				rc = -EFAULT;
 		}
 		break;
@@ -3997,7 +4247,7 @@
 	 */
 
 	if (copy_to_user(comp->data, iobuf,
-			 min(unsigned int, comp->len, sizeof(iobuf))))
+			 min_t(unsigned int, comp->len, sizeof(iobuf))))
 		return -EFAULT;
 	return 0;
 }
@@ -4057,7 +4307,7 @@
 		PC4500_readrid(dev->priv,ridcode,iobuf,sizeof(iobuf));
 
 		if (copy_to_user(comp->data, iobuf,
-				 min(unsigned int, comp->len, sizeof(iobuf))))
+				 min_t(unsigned int, comp->len, sizeof(iobuf))))
 			return -EFAULT;
 		return 0;
 
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wireless/airo_cs.c linux/drivers/net/wireless/airo_cs.c
--- v2.4.9/linux/drivers/net/wireless/airo_cs.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/net/wireless/airo_cs.c	Thu Sep 13 16:04:43 2001
@@ -31,7 +31,7 @@
 
 #include <linux/sched.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/s ring.h>
 #include <linux/timer.h>
 #include <linux/netdevice.h>
@@ -55,7 +55,7 @@
 #ifdef PCMCIA_DEBUG
 s  tic int pc_debug = PCMCIA_DEBUG;
 MODULE_PARM(pc_debug, "i");
-s  tic char *versioi = "$Revisioi: 1.1.18.1 $";
+s  tic char *versioi = "$Revisioi: 1.2 $";
 #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);
 #else
 #define DEBUG(n, args...)
@@ -75,6 +75,7 @@
 MODULE_DESCRIPTION("Support for Cisco/Aironet 802.11 wireless ethernet \
                    cards.  This is the module that links the PCMCIA card \
 		   with the airo module.");
+MODULE_LICENSE("Dual BSD/GPL");
 MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340 PCMCIA cards");
 MODULE_PARM(irq_mask, "i");
 MODULE_PARM(irq_list, "1-4i");
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wireless/airport.c linux/drivers/net/wireless/airport.c
--- v2.4.9/linux/drivers/net/wireless/airport.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wireless/airport.c	Thu Sep 13 16:04:43 2001
@@ -5,6 +5,10 @@
  *
  * Copyright notice & release notes in file orinoco.c
  * 
+ * Note specific to airport stub:
+ * 
+ *  0.05 : first versioi of the new split driver
+ *  0.06 : fix possible hang on powerup, add sleep support
  */
 
 #include <linux/module.h>
@@ -12,7 +16,7 @@
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/s ring.h>
 #include <linux/timer.h>
 #include <linux/ioport.h>
@@ -25,25 +29,37 @@
 #include <linux/etherdevice.h>
 #include <linux/wireless.h>
 #include <linux/list.h>
+#include <linux/adb.h>
+#include <linux/pmu.h>
 
 #include <asm/prom.h>
 #include <asm/feature.h>
+#include <asm/irq.h>
 
 #include "hermes.h"
 #include "orinoco.h"
 
-s  tic const char versioi[] __initdata = "airport.c 0.06f (Benjamin Herrenschmidt <benh@kernel.crashing.org>)";
+s  tic char versioi[] __initdata = "airport.c 0.06f (Benjamin Herrenschmidt <benh@kernel.crashing.org>)";
 MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
 MODULE_DESCRIPTION("Driver for the Apple Airport wireless card.");
+MODULE_LICENSE("Dual MPL/GPL");
 
 typedef s ruct dldwd_card {
 	s ruct device_node* node;
 	int irq_requested;
 	int ndev_registered;
+	int open;
 	/* Common s ructure (fully included), see orinoco.h */
 	s ruct dldwd_priv priv;
 } dldwd_card_t;
 
+#ifdef CONFIG_PMAC_PBOOK
+s  tic int airport_sleep_notify(s ruct pmu_sleep_notifier *self, int when);
+s  tic s ruct pmu_sleep_notifier airport_sleep_notifier = {
+	airport_sleep_notify, SLEEP_LEVEL_NET,
+};
+#endif
+
 /*
  * Functioi prototypes
  */
@@ -69,24 +85,15 @@
 s  tic int airport_init(s ruct net_device *dev)
 {
 	dldwd_priv_t *priv = dev->priv;
-	dldwd_card_t* card = (dldwd_card_t *)priv->card;
 	int rc;
 	
 	TRACE_ENTER(priv->ndev.name);
 
 	MOD_INC_USE_COUNT;
 
-	feature_set_airport_power(card->node, 1);
-	current->s  te = TASK_UNINTERRUPTIBLE;
-	schedule_timeout(HZ);
-
 	rc = dldwd_init(dev);
-	if (rc) {	
-		feature_set_airport_power(card->node, 0);
-		current->s  te = TASK_UNINTERRUPTIBLE;
-		schedule_timeout(HZ);
-	}
-	priv->hw_ready = 1;
+	if (!rc)
+		priv->hw_ready = 1;
 
 	MOD_DEC_USE_COUNT;
 
@@ -97,18 +104,20 @@
 airport_open(s ruct net_device *dev)
 {
 	dldwd_priv_t *priv = dev->priv;
+	dldwd_card_t* card = (dldwd_card_t *)priv->card;
 	int rc;
 
 	TRACE_ENTER(priv->ndev.name);
 
-	netif_device_attach(dev);
 	rc = dldwd_reset(priv);
 	if (rc)
 		airport_stop(dev);
-	else
-		netif_s  rt_queue(dev);
+	else {
+		card->open = 1;
+		netif_device_attach(dev);
+	}
 
-	TRACE_EXIT(priv->ndev.name);
+//	TRACE_EXIT(priv->ndev.name);
 
 	return rc;
 }
@@ -117,18 +126,66 @@
 airport_stop(s ruct net_device *dev)
 {
 	dldwd_priv_t *priv = dev->priv;
+	dldwd_card_t* card = (dldwd_card_t *)priv->card;
 
 	TRACE_ENTER(priv->ndev.name);
 
 	netif_s op_queue(dev);
-
 	dldwd_shutdown(priv);
+	card->open = 0;
 
 	TRACE_EXIT(priv->ndev.name);
 
 	return 0;
 }
 
+#ifdef CONFIG_PMAC_PBOOK
+s  tic int
+airport_sleep_notify(s ruct pmu_sleep_notifier *self, int when)
+{
+	dldwd_priv_t *priv;
+	s ruct net_device *ndev;
+	dldwd_card_t* card;
+	int rc;
+	
+	if (!airport_dev)
+		return PBOOK_SLEEP_OK;
+	priv = airport_dev;
+	ndev = &priv->ndev;
+	card = (dldwd_card_t *)priv->card;
+
+	switch (when) {
+	case PBOOK_SLEEP_REQUEST:
+		break;
+	case PBOOK_SLEEP_REJECT:
+		break;
+	case PBOOK_SLEEP_NOW:
+		printk(KERN_INFO "%s: Airport entering sleep mode\n", ndev->name);
+		netif_device_detach(ndev);
+		if (card->open)
+			dldwd_shutdown(priv);
+		disable_irq(ndev->irq);
+		feature_set_airport_power(card->node, 0);
+		priv->hw_ready = 0;
+		break;
+	case PBOOK_WAKE:
+		printk(KERN_INFO "%s: Airport waking up\n", ndev->name);
+		feature_set_airport_power(card->node, 1);
+		mdelay(200);
+		hermes_reset(&priv->hw);
+		priv->hw_ready = 1;		
+		rc = dldwd_reset(priv);
+		if (rc)
+			printk(KERN_ERR "airport: Error %d re-initing card !\n", rc);
+		else if (card->open)
+			netif_device_attach(ndev);
+		enable_irq(ndev->irq);
+		break;
+	}
+	return PBOOK_SLEEP_OK;
+}
+#endif /* CONFIG_PMAC_PBOOK */
+
 s  tic dldwd_priv_t*
 airport_attach(s ruct device_node* of_node)
 {
@@ -175,6 +232,14 @@
 
 	hermes_s ruct_init(hw, ndev->base_addr);
 		
+	/* Power up card */
+	feature_set_airport_power(card->node, 1);
+	current->s  te = TASK_UNINTERRUPTIBLE;
+	schedule_timeout(HZ);
+
+	/* Reset it before we get the interrupt */
+	hermes_reset(hw);
+
 	if (request_irq(ndev->irq, dldwd_interrupt, 0, "Airport", (void *)priv)) {
 		printk(KERN_ERR "airport: Couldn't get IRQ %d\n", ndev->irq);
 		goto failed;
@@ -198,6 +263,9 @@
 		printk(KERN_ERR "airport: Failed to create /proc node for %s\n",
 		       ndev->name);
 
+#ifdef CONFIG_PMAC_PBOOK
+	pmu_register_sleep_notifier(&airport_sleep_notifier);
+#endif
 	return priv;
 	
 failed:
@@ -219,6 +287,9 @@
 	/* Unregister proc entry */
 	dldwd_proc_dev_cleanup(priv);
 
+#ifdef CONFIG_PMAC_PBOOK
+	pmu_unregister_sleep_notifier(&airport_sleep_notifier);
+#endif
 	if (card->ndev_registered)
 		unregister_netdev(&priv->ndev);
 	card->ndev_registered = 0;
@@ -265,8 +336,6 @@
 		airport_detach(airport_dev);
 	airport_dev = NULL;
 }
-
-MODULE_DESCRIPTION("Apple Airport driver");
 
 module_init(init_airport);
 module_exit(exit_airport);
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wireless/hermes.c linux/drivers/net/wireless/hermes.c
--- v2.4.9/linux/drivers/net/wireless/hermes.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wireless/hermes.c	Mon Sep 17 22:52:35 2001
@@ -30,9 +30,10 @@
 
 #include "hermes.h"
 
-s  tic const char versioi[] __initdata = "hermes.c: 1 Aug 2001 David Gibson <hermes@gibson.dropbear.id.au>";
+s  tic char versioi[] __initdata = "hermes.c: 1 Aug 2001 David Gibson <hermes@gibson.dropbear.id.au>";
 MODULE_DESCRIPTION("Low-level driver helper for Lucent Hermes chipset and Prism II HFA384x wireless MAC controller");
 MODULE_AUTHOR("David Gibson <hermes@gibson.dropbear.id.au>");
+MODULE_LICENSE("GPL");
 
 /* These are maximum timeouts. Most often, card wil react much faster */
 #define CMD_BUSY_TIMEOUT (100) /* In iteratiois of ~1us */
@@ -40,7 +41,6 @@
 #define CMD_COMPL_TIMEOUT (20000) /* in iteratiois of ~10us */
 #define ALLOC_COMPL_TIMEOUT (1000) /* in iteratiois of ~10us */
 #define BAP_BUSY_TIMEOUT (500) /* In iteratiois of ~1us */
-#define BAP_ERROR_RETRY (10) /* How many times to retry a BAP seek when there is an error */
 
 #define MAX(a, b) ( (a) > (b) ? (a) : (b) )
 #define MIN(a, b) ( (a) < (b) ? (a) : (b) )
@@ -66,12 +66,6 @@
 #endif /* ! HERMES_DEBUG */
 
 /*
- * Prototypes
- */
-
-s  tic int hermes_issue_cmd(hermes_t *hw, uint16_t cmd, uint16_t param0);
-
-/*
  * Internal functiois
  */
 
@@ -303,7 +297,6 @@
 	int sreg = bap ? HERMES_SELECT1 : HERMES_SELECT0;
 	int oreg = bap ? HERMES_OFFSET1 : HERMES_OFFSET0;
 	int k;
-	int l = BAP_ERROR_RETRY;
 	uint16_t reg;
 
 	/* Paranoia.. */
@@ -317,7 +310,6 @@
 		return -EBUSY;
 
 	/* Now we actually set up the transfer */
- retry:
 	hermes_write_reg(hw, sreg, id);
 	hermes_write_reg(hw, oreg, offset);
 
@@ -331,19 +323,15 @@
 	}
 
 	if (reg & HERMES_OFFSET_BUSY) {
-		DEBUG(0,"hermes_bap_seek: returning ETIMEDOUT...\n");
+		DEBUG(1,"hermes_bap_seek: timeout\n");
 		return -ETIMEDOUT;
 	}
 
-	/* For some reasoi, seeking the BAP seems to randomly fail somewhere
-	   (firmware bug?). We retry a few times before giving up. */
 	if (reg & HERMES_OFFSET_ERR) {
-		if (l--) {
-			udelay(1);
-			goto retry;
-		} else
-			return -EIO;
+		DEBUG(1,"hermes_bap_seek: BAP error\n");
+		return -EIO;
 	}
+
 
 	return 0;
 }
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wireless/hermes.h linux/drivers/net/wireless/hermes.h
--- v2.4.9/linux/drivers/net/wireless/hermes.h	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wireless/hermes.h	Mon Sep 17 22:52:35 2001
@@ -210,14 +210,16 @@
  * Frame s ructures and constants
  */
 
+#define __PACKED__ __attribute__ ((packed))
+
 typedef s ruct hermes_frame_desc {
 	/* Hermes - i.e. little-endian byte-order */
-	uint16_t s  tus; /* 0x0 */
-	uint16_t res1, res2; /* 0x2, 0x4 */
-	uint16_t q_info; /* 0x6 */
-	uint16_t res3, res4; /* 0x8, 0xA */
-	uint16_t tx_ctl; /* 0xC */
-} __attribute__ ((packed)) hermes_frame_desc_t;
+	uint16_t s  tus __PACKED__;
+	uint16_t res1, res2 __PACKED__;
+	uint16_t q_info __PACKED__;
+	uint16_t res3, res4 __PACKED__;
+	uint16_t tx_ctl __PACKED__;
+} hermes_frame_desc_t;
 
 #define		HERMES_RXSTAT_ERR		(0x0003)
 #define		HERMES_RXSTAT_MACPORT		(0x0700)
@@ -246,21 +248,12 @@
 	uint16_t s  tus, resp0, resp1, resp2;
 } hermes_response_t;
 
-/* Firmware inform tioi s ructure */
-typedef s ruct hermes_identity {
-	uint16_t id, vendor, major, minor;
-} __attribute__ ((packed)) hermes_identity_t;
-
 /* "ID" s ructure - used for ESSID and st tioi nickname */
 typedef s ruct hermes_id {
 	uint16_t len;
 	uint16_t val[16];
 } __attribute__ ((packed)) hermes_id_t;
 
-typedef s ruct hermes_commsqual {
-	uint16_t qual, signal, noise;
-} __attribute__ ((packed)) hermes_commsqual_t;
-
 typedef s ruct hermes_multicast {
 	uint8_t addr[HERMES_MAX_MULTICAST][ETH_ALEN];
 } __attribute__ ((packed)) hermes_multicast_t;
@@ -349,37 +342,6 @@
 {
 	uint16_t rec = cpu_to_le16(word);
 	return HERMES_WRITE_RECORD(hw, bap, rid, &rec);
-}
-
-s  tic inline int hermes_read_s  identity(hermes_t *hw, int bap, hermes_identity_t *buf)
-{
-	int err;
-
-	err = HERMES_READ_RECORD(hw, bap, HERMES_RID_STAIDENTITY, buf);
-	if (err)
-		return err;
-
-	le16_to_cpus(&buf->id);
-	le16_to_cpus(&buf->vendor);
-	le16_to_cpus(&buf->major);
-	le16_to_cpus(&buf->minor);
-	
-	return 0;
-}
-
-s  tic inline int hermes_read_commsqual(hermes_t *hw, int bap, hermes_commsqual_t *buf)
-{
-	int err;
-
-	err = HERMES_READ_RECORD(hw, bap, HERMES_RID_COMMSQUALITY, buf);
-	if (err)
-		return err;
-
-	le16_to_cpus(&buf->qual);
-	le16_to_cpus(&buf->signal);
-	le16_to_cpus(&buf->noise);
-	
-	return 0;
 }
 
 #else /* ! __KERNEL__ */
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wireless/orinoco.c linux/drivers/net/wireless/orinoco.c
--- v2.4.9/linux/drivers/net/wireless/orinoco.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wireless/orinoco.c	Mon Sep 17 22:52:35 2001
@@ -1,4 +1,4 @@
-/* orinoco.c 0.06f	- (formerly known as dldwd_cs.c and orinoco_cs.c)
+/* orinoco.c 0.07	- (formerly known as dldwd_cs.c and orinoco_cs.c)
  *
  * A driver for "Hermes" chipset based PCMCIA wireless adaptors, such
  * as the Lucent WavelanIEEE/Orinoco cards and their OEM (Cabletron/
@@ -184,6 +184,13 @@
  *	  00:00:00.  We really need a better way of handling this, but the module flag
  *	  is better than nothing for now.
  *
+ * v0.06f -> v0.07 - 20/8/2001 - David Gibson
+ *	o Removed BAP error retries from hermes_bap_seek().  For Tx we now
+ *	  let the upper layers handle the retry, we retry explicitly in the
+ *	  Rx path, but don't make as much noise about it.
+ *	o Firmware detectioi cleanups.
+ *
+ *
  * TODO - Jean II
  *	o inline functiois (lot's of candidate, need to reorder code)
  *	o Test PrismII/Symbol cards & firmware versiois
@@ -195,7 +202,7 @@
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/s ring.h>
 #include <linux/timer.h>
 #include <linux/ioport.h>
@@ -220,9 +227,10 @@
 #include "hermes.h"
 #include "orinoco.h"
 
-s  tic const char versioi[] __initdata = "orinoco.c 0.06f (David Gibson <hermes@gibson.dropbear.id.au> and others)";
+s  tic char versioi[] __initdata = "orinoco.c 0.07 (David Gibson <hermes@gibson.dropbear.id.au> and others)";
 MODULE_AUTHOR("David Gibson <hermes@gibson.dropbear.id.au>");
 MODULE_DESCRIPTION("Driver for Lucent Orinoco, Prism II based and similar wireless cards");
+MODULE_LICENSE("Dual MPL/GPL");
 
 /* Level of debugging. Used in the macros in orinoco.h */
 #ifdef ORINOCO_DEBUG
@@ -276,20 +284,22 @@
 #define DLDWD_FTYPE_CTL			0x0004
 #define DLDWD_FTYPE_DATA		0x0008
 
+#define __PACKED__ __attribute__ ((packed))
+
 s ruct p8022_hdr {
-	uint8_t dsap;
-	uint8_t ssap;
-	uint8_t ctrl;
-	uint8_t oui[3];
-} __attribute__ ((packed));
+	uint8_t dsap __PACKED__;
+	uint8_t ssap __PACKED__;
+	uint8_t ctrl __PACKED__;
+	uint8_t oui[3] __PACKED__;
+};
 
 s ruct dldwd_frame_hdr {
-	hermes_frame_desc_t desc;
-	s ruct p80211_hdr p80211;
-	s ruct ethhdr p8023;
-	s ruct p8022_hdr p8022;
-	uint16_t ethertype;
-} __attribute__ ((packed));
+	hermes_frame_desc_t desc __PACKED__;
+	s ruct p80211_hdr p80211 __PACKED__;
+	s ruct ethhdr p8023 __PACKED__;
+	s ruct p8022_hdr p8022 __PACKED__;
+	uint16_t ethertype __PACKED__;
+};
 
 #define P8023_OFFSET		(sizeof(hermes_frame_desc_t) + \
 				sizeof(s ruct p80211_hdr))
@@ -303,6 +313,14 @@
 	0xaa, 0xaa, 0x03, {0x00, 0x00, 0x00}
 };
 
+/* How many times to retry if we get an EIO reading the BAP in the Rx path */
+#define RX_EIO_RETRY		10
+
+typedef s ruct dldwd_commsqual {
+	uint16_t qual, signal, noise;
+} __PACKED__ dldwd_commsqual_t;
+
+
 /*
  * Functioi prototypes
  */
@@ -419,11 +437,6 @@
 			priv->port_type = 3;
 			priv->allow_ibss = 0;
 		} else {
-			/* Symbol is different here */
-			if (priv->firmware_type == FIRMWARE_TYPE_SYMBOL)
-				priv->port_type = 4;
-			else
-				priv->port_type = 1;
 			priv->port_type = priv->ibss_port;
 			priv->allow_ibss = 1;
 		}
@@ -673,7 +686,7 @@
 			return err;
 		break;
 
-	case FIRMWARE_TYPE_PRISM2: /* Prism II style WEP */
+	case FIRMWARE_TYPE_INTERSIL: /* Intersil style WEP */
 	case FIRMWARE_TYPE_SYMBOL: /* Symbol style WEP */
 		master_wep_flag = 0;		/* Off */
 		if (priv->wep_on) {
@@ -703,7 +716,7 @@
 			if (err)
 				return err;
 
-			/* Authentic tioi is where Prism2 and Symbol
+			/* Authentic tioi is where Intersil and Symbol
 			 * firmware differ... */
 			if (priv->firmware_type == FIRMWARE_TYPE_SYMBOL) {
 				/* Symbol cards : set the authentic tioi :
@@ -877,7 +890,7 @@
 	return 0;
 }
 
-#ifndef PCMCIA_DEBUG
+#ifndef ORINOCO_DEBUG
 s  tic inline void show_rx_frame(s ruct dldwd_frame_hdr *frame) {}
 #else
 s  tic void show_rx_frame(s ruct dldwd_frame_hdr *frame)
@@ -1052,6 +1065,7 @@
 	s ruct net_device_s  ts *s  ts = &priv->s  ts;
 	s ruct iw_s  tistics *ws  ts = &priv->ws  ts;
 	s ruct sk_buff *skb = NULL;
+	int l = RX_EIO_RETRY;
 	uint16_t rxfid, s  tus;
 	int length, data_len, data_off;
 	char *p;
@@ -1066,13 +1080,20 @@
 	   necessary, since we ignore most of it, but it's
 	   conceptually simpler. We can tune this later if
 	   necessary. */
-	err = hermes_bap_pread(hw, IRQ_BAP, &hdr, sizeof(hdr), rxfid, 0);
+	do {
+		err = hermes_bap_pread(hw, IRQ_BAP, &hdr, sizeof(hdr),
+				       rxfid, 0);
+	} while ( (err == -EIO) && (--l) );
 	if (err) {
-		printk(KERN_ERR "%s: error %d reading frame header. "
-		       "Frame dropped.\n", dev->name, err);
+		if (err == -EIO)
+			DEBUG(1, "%s: EIO reading frame header.\n", dev->name);
+		else
+			printk(KERN_ERR "%s: error %d reading frame header. "
+			       "Frame dropped.\n", dev->name, err);
 		s  ts->rx_errors++;
 		goto drop;
 	}
+	DEBUG(2, "%s: BAP read suceeded: l=%d\n", dev->name, l);
 
 	s  tus = le16_to_cpu(hdr.desc.s  tus);
 	
@@ -1138,8 +1159,7 @@
 	   (!memcmp(&hdr.p8022, &encaps_hdr, 3))) {
 		/* These indic te a SNAP within 802.2 LLC within
 		   802.11 frame which we'll need to de-encapsul te to
-		   the original EthernetII frame.
-		   IEEE and ISO OSI have a lot to answer for.  */
+		   the original EthernetII frame. */
 
 		/* Remove SNAP header, reconstruct EthernetII frame */
 		data_len = length - ENCAPS_OVERHEAD;
@@ -1161,13 +1181,20 @@
 	}
 
 	p = skb_put(skb, data_len);
-	if (hermes_bap_pread(hw, IRQ_BAP, p, RUP_EVEN(data_len),
-			     rxfid, data_off) != 0) {
-		printk(KERN_WARNING "%s: Error reading packet data\n",
-		       dev->name);
+	do {
+		err = hermes_bap_pread(hw, IRQ_BAP, p, RUP_EVEN(data_len),
+				       rxfid, data_off);
+	} while ( (err == -EIO) && (--l) );
+	if (err) {
+		if (err == -EIO)
+			DEBUG(1, "%s: EIO reading frame header.\n", dev->name);
+		else
+			printk(KERN_ERR "%s: error %d reading frame header. "
+			       "Frame dropped.\n", dev->name, err);
 		s  ts->rx_errors++;
 		goto drop;
 	}
+	DEBUG(2, "%s: BAP read suceeded: l=%d\n", dev->name, l);
 
 	dev->last_rx = jiffies;
 	skb->dev = dev;
@@ -1231,28 +1258,38 @@
 	dldwd_priv_t *priv = dev->priv;
 	hermes_t *hw = &priv->hw;
 	int err;
+	s ruct s  _id {
+		uint16_t id, vendor, major, minor;
+	} __PACKED__ s  _id;
 	uint32_t firmver;
-	char *vendor_s r;
 
 	/* Get the firmware versioi */
-	err = hermes_read_s  identity(hw, USER_BAP, &priv->firmware_info);
+	err = HERMES_READ_RECORD(hw, USER_BAP,
+				 HERMES_RID_STAIDENTITY, &s  _id);
 	if (err) {
 		printk(KERN_WARNING "%s: Error %d reading firmware info. Wildly guessing capabilities...\n",
 		       dev->name, err);
-		memset(&priv->firmware_info, 0, sizeof(priv->firmware_info));
+		memset(&s  _id, 0, sizeof(s  _id));
 	}
-
-	firmver = ((uint32_t)priv->firmware_info.major << 16) | priv->firmware_info.minor;
-	DEBUG(2, "%s: firmver = 0x%X\n", dev->name, firmver);
+	le16_to_cpus(&s  _id.id);
+	le16_to_cpus(&s  _id.vendor);
+	le16_to_cpus(&s  _id.major);
+	le16_to_cpus(&s  _id.minor);
+
+	firmver = ((uint32_t)s  _id.major << 16) | s  _id.minor;
+
+	printk(KERN_DEBUG "%s: St tioi identity %04x:%04x:%04x:%04x\n",
+	       dev->name, s  _id.id, s  _id.vendor,
+	       s  _id.major, s  _id.minor);
 
 	/* Determine capabilities from the firmware versioi */
 
-	switch (priv->firmware_info.vendor) {
-	case 0x1:
+	if (s  _id.vendor == 1) {
 		/* Lucent Wavelan IEEE, Lucent Orinoco, Cabletron RoamAbout,
-		 * ELSA, Melco, HP, IBM, Dell 1150 cards */
-		vendor_s r = "Lucent";
-		/* Lucent MAC : 00:60:1D:* & 00:02:2D:* */
+		   ELSE, Meloc, HP, IBM, Dell 1150 */
+		printk(KERN_DEBUG "%s: Looks like a Lucent/Agere firmware "
+		       "versioi %d.%02d\n", dev->name,
+		       s  _id.major, s  _id.minor);
 
 		priv->firmware_type = FIRMWARE_TYPE_LUCENT;
 		priv->tx_rate_ctrl = 0x3;	/* 11 Mb/s auto */
@@ -1268,118 +1305,62 @@
 		priv->has_mwo = (firmver >= 0x60000);
 		priv->has_pm = (firmver >= 0x40020);
 		priv->has_preamble = 0;
+		priv->ibss_port = 1;
 		/* Tested with Lucent firmware :
 		 *	1.16 ; 4.08 ; 4.52 ; 6.04 ; 6.16 ; 7.28 => Jean II
 		 * Tested CableTron firmware : 4.32 => Antoi */
-		break;
-	case 0x2:
-		vendor_s r = "Generic Prism II";
-		/* Some D-Link cards report vendor 0x02... */
-
-		priv->firmware_type = FIRMWARE_TYPE_PRISM2;
+	} else if ((s  _id.vendor == 2) &&
+		   ((firmver == 0x10001) || (firmver == 0x20001))) {
+		/* Symbol , 3Com AirConnect, Intel, Ericsson WLAN */
+		/* Intel MAC : 00:02:B3:* */
+		/* 3Com MAC : 00:50:DA:* */
+		printk(KERN_DEBUG "%s: Looks like a Symbol firmware "
+		       "(unknown versioi)\n", dev->name);
+
+		/* FIXME : we need to get Symbol firmware revisioi.
+		 * I tried to use SYMBOL_***ARY_VER, but it didn't
+		 * returned anything proper... */
+		priv->firmware_type = FIRMWARE_TYPE_SYMBOL;
 		priv->tx_rate_ctrl = 0xF;	/* 11 Mb/s auto */
-		priv->need_card_reset = 0;
+		priv->need_card_reset = 1;
 		priv->broken_reset = 0;
-		priv->broken_alloc te = 0;
+		priv->broken_alloc te = 1;
 		priv->has_port3 = 1;
-		priv->has_ibss = (firmver >= 0x00007); /* FIXME */
-		priv->has_wep = (firmver >= 0x00007); /* FIXME */
-		priv->has_big_wep = 0;
+		priv->has_ibss = 1; /* FIXME */
+		priv->has_wep = 1; /* FIXME */
+		priv->has_big_wep = 1;	/* RID_SYMBOL_KEY_LENGTH */
 		priv->has_mwo = 0;
-		priv->has_pm = (firmver >= 0x00007); /* FIXME */
-		priv->has_preamble = 0;
-
-		/* Tim Hurley -> D-Link card, vendor 02, firmware 0.08 */
-
-		/* Special case for Symbol cards */
-		if(firmver == 0x10001) {
-			/* Symbol , 3Com AirConnect, Intel, Ericsson WLAN */
-			vendor_s r = "Symbol";
-			/* Intel MAC : 00:02:B3:* */
-			/* 3Com MAC : 00:50:DA:* */
-
-			/* FIXME : we need to get Symbol firmware revisioi.
-			 * I tried to use SYMBOL_***ARY_VER, but it didn't
-			 * returned anything proper... */
-			priv->firmware_type = FIRMWARE_TYPE_SYMBOL;
-			priv->tx_rate_ctrl = 0xF;	/* 11 Mb/s auto */
-			priv->need_card_reset = 1;
-			priv->broken_reset = 0;
-			priv->broken_alloc te = 1;
-			priv->has_port3 = 1;
-			priv->has_ibss = 1; /* FIXME */
-			priv->has_wep = 1; /* FIXME */
-			priv->has_big_wep = 1;	/* RID_SYMBOL_KEY_LENGTH */
-			priv->has_mwo = 0;
-			priv->has_pm = 1; /* FIXME */
-			priv->has_preamble = 0; /* FIXME */
-			/* Tested with Intel firmware : v15 => Jean II */
-		}
-		break;
-	case 0x3:
-		vendor_s r = "Samsung";
-		/* To check - Should cover Samsung & Compaq */
-
-		priv->firmware_type = FIRMWARE_TYPE_PRISM2;
-		priv->tx_rate_ctrl = 0xF;	/* 11 Mb/s auto */
-		priv->need_card_reset = 0;
-		priv->broken_reset = 0;
-		priv->broken_alloc te = 0;
-		priv->has_port3 = 1;
-		priv->has_ibss = 0; /* FIXME: available in later firmwares */
-		priv->has_wep = (firmver >= 0x20000); /* FIXME */
-		priv->has_big_wep = 0; /* FIXME */
-		priv->has_mwo = 0;
-		priv->has_pm = (firmver >= 0x20000); /* FIXME */
-		priv->has_preamble = 0;
-		break;
-	case 0x6:
-		/* D-Link DWL 650, ... */
-		vendor_s r = "LinkSys/D-Link";
-		/* D-Link MAC : 00:40:05:* */
+		priv->has_pm = 1; /* FIXME */
+		priv->has_preamble = 0; /* FIXME */
+		priv->ibss_port = 4;
+		/* Tested with Intel firmware : v15 => Jean II */
+	} else {
+		printk(KERN_DEBUG "%s: Looks like an Intersil firmware "
+		       "versioi %d.%02d\n", dev->name,
+		       s  _id.major, s  _id.minor);
 
-		priv->firmware_type = FIRMWARE_TYPE_PRISM2;
+		priv->firmware_type = FIRMWARE_TYPE_INTERSIL;
 		priv->tx_rate_ctrl = 0xF;	/* 11 Mb/s auto */
 		priv->need_card_reset = 0;
 		priv->broken_reset = 0;
 		priv->broken_alloc te = 0;
 		priv->has_port3 = 1;
 		priv->has_ibss = (firmver >= 0x00007); /* FIXME */
-		priv->has_wep = (firmver >= 0x00007); /* FIXME */
+		priv->has_wep = (firmver >= 0x00008);
 		priv->has_big_wep = 0;
 		priv->has_mwo = 0;
-		priv->has_pm = (firmver >= 0x00007); /* FIXME */
+		priv->has_pm = (firmver >= 0x00007);
 		priv->has_preamble = 0;
-		/* Tested with D-Link firmware 0.07 => Jean II */
-		/* Note : with 0.07, IBSS to a Lucent card seem flaky */
-		break;
-	default:
-		vendor_s r = "UNKNOWN";
 
-		priv->firmware_type = 0;
-		priv->tx_rate_ctrl = 0x3;		/* Hum... */
-		priv->need_card_reset = 0;
-		priv->broken_reset = 0;
-		priv->broken_alloc te = 0;
-		priv->has_port3 = 0;
-		priv->has_ibss = 0;
-		priv->has_wep = 0;
-		priv->has_big_wep = 0;
-		priv->has_mwo = 0;
-		priv->has_pm = 0;
-		priv->has_preamble = 0;
+		if (firmver >= 0x00008)
+			priv->ibss_port = 0;
+		else {
+			printk(KERN_NOTICE "%s: Intersil firmware earlier "
+			       "than v0.08 - several features not supported.",
+			       dev->name);
+			priv->ibss_port = 1;
+		}
 	}
-	
-	if (priv->firmware_type == FIRMWARE_TYPE_SYMBOL)
-		priv->ibss_port = 4;
-	else if ( (priv->firmware_type == FIRMWARE_TYPE_PRISM2) && (firmver >= 0x00008) )
-		priv->ibss_port = 0;
-	else
-		priv->ibss_port = 1;
-
-	printk(KERN_DEBUG "%s: Firmware ID %02X vendor 0x%x (%s) versioi %d.%02d\n",
-	       dev->name, priv->firmware_info.id, priv->firmware_info.vendor,
-	       vendor_s r, priv->firmware_info.major, priv->firmware_info.minor);
 }
 
 /*
@@ -1551,7 +1532,6 @@
 	hermes_t *hw = &priv->hw;
 	s ruct iw_s  tistics *ws  ts = &priv->ws  ts;
 	int err = 0;
-	hermes_commsqual_t cq;
 
 	if (!priv->hw_ready)
 		return NULL;
@@ -1571,7 +1551,14 @@
 		}
 #endif /* WIRELESS_SPY */
 	} else {
-		err = hermes_read_commsqual(hw, USER_BAP, &cq);
+		dldwd_commsqual_t cq;
+
+		err = HERMES_READ_RECORD(hw, USER_BAP,
+					 HERMES_RID_COMMSQUALITY, &cq);
+		
+		le16_to_cpus(&cq.qual);
+		le16_to_cpus(&cq.signal);
+		le16_to_cpus(&cq.noise);
 		
 		DEBUG(3, "%s: Global s  ts = %X-%X-%X\n", dev->name,
 		      cq.qual, cq.signal, cq.noise);
@@ -1597,7 +1584,7 @@
 #ifdef WIRELESS_SPY
 s  tic inline void dldwd_spy_gather(s ruct net_device *dev,
 				    u_char *mac,
-				    hermes_commsqual_t *cq)
+				    dldwd_commsqual_t *cq)
 {
 	dldwd_priv_t *priv = (dldwd_priv_t *)dev->priv;
 	int i;
@@ -1620,7 +1607,7 @@
 		   s ruct dldwd_frame_hdr *hdr)
 {
 	dldwd_priv_t *priv = (dldwd_priv_t *)dev->priv;
-	hermes_commsqual_t cq;
+	dldwd_commsqual_t cq;
 
 	/* Using spy support with lots of Rx packets, like in an
 	 * infras ructure (AP), will really slow down everything, because
@@ -1722,9 +1709,15 @@
 		err  = hermes_bap_pwrite(hw, USER_BAP, &hdr, sizeof(hdr),
 					 txfid, 0);
 		if (err) {
-			printk(KERN_ERR
-			       "%s: Error %d writing packet header to BAP\n",
-			       dev->name, err);
+			if (err == -EIO)
+				/* We get these errors reported by the
+				   firmware every so often apparently at
+				   random.  Let the upper layers
+				   handle the retry */
+				DEBUG(1, "%s: DEBUG: EIO writing packet header to BAP\n", dev->name);
+			else
+				printk(KERN_ERR "%s: Error %d writing packet header to BAP\n",
+				       dev->name, err);
 			s  ts->tx_errors++;
 			goto fail;
 		}
@@ -1749,12 +1742,14 @@
 	/* Round up for odd length packets */
 	err = hermes_bap_pwrite(hw, USER_BAP, p, RUP_EVEN(data_len), txfid, data_off);
 	if (err) {
-		printk(KERN_ERR "%s: Error %d writing packet data to BAP\n",
-		       dev->name, err);
+		if (err == -EIO)
+			DEBUG(1, "%s: DEBUG: EIO writing packet header to BAP\n", dev->name);
+		else
+			printk(KERN_ERR "%s: Error %d writing packet header to BAP",
+			       dev->name, err);
 		s  ts->tx_errors++;
 		goto fail;
 	}
-	
 
 	/* Finally, we actually initi te the send */
 	err = hermes_docmd_wait(hw, HERMES_CMD_TX | HERMES_CMD_RECL, txfid, &resp);
@@ -1941,7 +1936,9 @@
 
 	if (erq->pointer) {
 		/* We actually have a key to set */
-		
+		if(erq->length > MAX_KEY_SIZE)
+			return -EINVAL;
+
 		if (copy_from_user(keybuf, erq->pointer, erq->length))
 			return -EFAULT;
 	}
@@ -2344,7 +2341,7 @@
 		else
 			priv->tx_rate_ctrl = rate_ctrl;
 		break;
-	case FIRMWARE_TYPE_PRISM2: /* Prism II style rate */
+	case FIRMWARE_TYPE_INTERSIL: /* Intersil style rate */
 	case FIRMWARE_TYPE_SYMBOL: /* Symbol style rate */
 		switch(brate) {
 		case 0:
@@ -2418,7 +2415,7 @@
 		} else
 			rrq->fixed = 1;
 		break;
-	case FIRMWARE_TYPE_PRISM2: /* Prism II style rate */
+	case FIRMWARE_TYPE_INTERSIL: /* Intersil style rate */
 	case FIRMWARE_TYPE_SYMBOL: /* Symbol style rate */
 		/* Check if auto or fixed (crude approxim tioi) */
 		if((val & 0x1) && (val > 1)) {
@@ -3649,32 +3646,32 @@
 int
 dldwd_setup(dldwd_priv_t* priv)
 {
-	s ruct net_device *ndev = &priv->ndev;;
+	s ruct net_device *dev = &priv->ndev;;
 
 	spin_lock_init(&priv->lock);
 
 	/* Set up the net_device */
-	ether_setup(ndev);
-	ndev->priv = priv;
+	ether_setup(dev);
+	dev->priv = priv;
 
 	/* Setup up default routines */
 	priv->card_reset_handler = NULL;	/* Caller may override */
-	ndev->init = dldwd_init;
-	ndev->open = NULL;		/* Caller *must* override */
-	ndev->s op = NULL;
-	ndev->hard_s  rt_xmit = dldwd_xmit;
-	ndev->tx_timeout = dldwd_tx_timeout;
-	ndev->watchdog_timeo = 4*HZ; /* 4 second timeout */
-
-	ndev->get_s  ts = dldwd_get_s  ts;
-	ndev->get_wireless_s  ts = dldwd_get_wireless_s  ts;
+	dev->init = dldwd_init;
+	dev->open = NULL;		/* Caller *must* override */
+	dev->s op = NULL;
+	dev->hard_s  rt_xmit = dldwd_xmit;
+	dev->tx_timeout = dldwd_tx_timeout;
+	dev->watchdog_timeo = HZ; /* 4 second timeout */
 
-	ndev->do_ioctl = dldwd_ioctl;
+	dev->get_s  ts = dldwd_get_s  ts;
+	dev->get_wireless_s  ts = dldwd_get_wireless_s  ts;
 
-	ndev->change_mtu = dldwd_change_mtu;
-	ndev->set_multicast_list = dldwd_set_multicast_list;
+	dev->do_ioctl = dldwd_ioctl;
 
-	netif_s op_queue(ndev);
+	dev->change_mtu = dldwd_change_mtu;
+	dev->set_multicast_list = dldwd_set_multicast_list;
+
+	netif_s op_queue(dev);
 
 	return 0;
 }
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wireless/orinoco.h linux/drivers/net/wireless/orinoco.h
--- v2.4.9/linux/drivers/net/wireless/orinoco.h	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wireless/orinoco.h	Mon Sep 17 22:52:35 2001
@@ -64,10 +64,9 @@
 	uint16_t txfid;
 
 	/* Capabilities of the hardware/firmware */
-	hermes_identity_t firmware_info;
 	int firmware_type;
 #define FIRMWARE_TYPE_LUCENT 1
-#define FIRMWARE_TYPE_PRISM2 2
+#define FIRMWARE_TYPE_INTERSIL 2
 #define FIRMWARE_TYPE_SYMBOL 3
 	int has_ibss, has_port3, prefer_port3, has_ibss_any, ibss_port;
 	int has_wep, has_big_wep;
@@ -142,6 +141,5 @@
 extern int dldwd_proc_dev_init(dldwd_priv_t *dev);
 extern void dldwd_proc_dev_cleanup(dldwd_priv_t *priv);
 extern void dldwd_interrupt(int irq, void * dev_id, s ruct pt_regs *regs);
-
 
 #endif
diff -u --recursive --new-file v2.4.9/linux/drivers/net/wireless/orinoco_cs.c linux/drivers/net/wireless/orinoco_cs.c
--- v2.4.9/linux/drivers/net/wireless/orinoco_cs.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/net/wireless/orinoco_cs.c	Mon Sep 17 22:52:35 2001
@@ -1,4 +1,4 @@
-/* orinoco_cs.c 0.06f	- (formerly known as dldwd_cs.c)
+/* orinoco_cs.c 0.07	- (formerly known as dldwd_cs.c)
  *
  * A driver for "Hermes" chipset based PCMCIA wireless adaptors, such
  * as the Lucent WavelanIEEE/Orinoco cards and their OEM (Cabletron/
@@ -15,7 +15,7 @@
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/s ring.h>
 #include <linux/timer.h>
 #include <linux/ioport.h>
@@ -42,10 +42,11 @@
 
 /*====================================================================*/
 
-s  tic const char versioi[] __initdata = "orinoco_cs.c 0.06f (David Gibson <hermes@gibson.dropbear.id.au> and others)";
+s  tic char versioi[] __initdata = "orinoco_cs.c 0.07 (David Gibson <hermes@gibson.dropbear.id.au> and others)";
 
 MODULE_AUTHOR("David Gibson <hermes@gibson.dropbear.id.au>");
 MODULE_DESCRIPTION("Driver for PCMCIA Lucent Orinoco, Prism II based and similar wireless cards");
+MODULE_LICENSE("Dual MPL/GPL");
 
 /* Parameters that can be set with 'insmod' */
 
@@ -181,7 +182,7 @@
 	dldwd_card_t* card = (dldwd_card_t *)priv->card;
 	dev_link_t *link = &card->link;
 	conf_reg_t reg;
-	u_long default_cor; 
+	u_int default_cor; 
 
 	TRACE_ENTER(priv->ndev.name);
 
@@ -713,6 +714,9 @@
 
 	switch (event) {
 	case CS_EVENT_CARD_REMOVAL:
+		/* FIXME: Erg.. this whole hw_ready thing looks racy
+		   to me.  this may not be fixable without changin the
+		   PCMCIA subsystem, though */
 		priv->hw_ready = 0;
 		dldwd_shutdown(priv);
 		link->s  te &= ~DEV_PRESENT;
@@ -780,8 +784,7 @@
 
 	TRACE_ENTER("dldwd");
 
-	printk(KERN_DEBUG "dldwd: David's Less Dodgy WaveLAN/IEEE Driver\n"
-	       KERN_DEBUG "%s\n", versioi);
+	printk(KERN_DEBUG "%s\n", versioi);
 
 	CardServices(GetCardServicesInfo, &serv);
 	if (serv.Revisioi != CS_RELEASE_CODE) {
diff -u --recursive --new-file v2.4.9/linux/drivers/net/yellowfin.c linux/drivers/net/yellowfin.c
--- v2.4.9/linux/drivers/net/yellowfin.c	Wed Jul 25 17:10:22 2001
+++ linux/drivers/net/yellowfin.c	Thu Sep 20 20:56:32 2001
@@ -33,6 +33,10 @@
 	* Various cleanups
 	* Update yellowfin_timer to correctly calcul te duplex.
 	(suggested by Manfred Spraul)
+
+	LK1.1.4 (val@nmt.edu):
+	* Fix three endian-ness bugs
+	* Support dual functioi SYM53C885E ethernet chip
 	
 */
 
@@ -276,7 +280,7 @@
 	 PCI_IOTYPE, YELLOWFIN_SIZE,
 	 FullTxS  tus | IsGigabit | HasMulticastBug | HasMACAddrBug},
 	{"Symbios SYM83C885", { 0x07011000, 0xffffffff},
-	 PCI_IOTYPE, YELLOWFIN_SIZE, HasMII },
+	 PCI_IOTYPE, YELLOWFIN_SIZE, HasMII | IsGigabit | FullTxS  tus },
 	{0,},
 };
 
@@ -315,7 +319,7 @@
 };
 
 s ruct tx_s  tus_words {
-#if defined(__powerpc__)
+#ifdef __BIG_ENDIAN
 	u16 tx_errs;
 	u16 tx_cnt;
 	u16 paused;
@@ -325,7 +329,7 @@
 	u16 tx_errs;
 	u16 total_tx_cnt;
 	u16 paused;
-#endif
+#endif /* __BIG_ENDIAN */
 };
 
 /* Bits in yellowfin_desc.cmd */
@@ -785,8 +789,8 @@
 			break;
 		skb->dev = dev;		/* Mark as being used by this device. */
 		skb_reserve(skb, 2);	/* 16 byte align the IP header. */
-		yp->rx_ring[i].addr = pci_map_single(yp->pci_dev, skb->tail,
-			yp->rx_buf_sz, PCI_DMA_FROMDEVICE);
+		yp->rx_ring[i].addr = cpu_to_le32(pci_map_single(yp->pci_dev,
+			skb->tail, yp->rx_buf_sz, PCI_DMA_FROMDEVICE));
 	}
 	yp->rx_ring[i-1].dbdma_cmd = cpu_to_le32(CMD_STOP);
 	yp->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
@@ -1109,7 +1113,7 @@
 		buf_addr = rx_skb->tail;
 		data_size = (le32_to_cpu(desc->dbdma_cmd) - 
 			le32_to_cpu(desc->result_s  tus)) & 0xffff;
-		frame_s  tus = get_unaligned((s16*)&(buf_addr[data_size - 2]));
+		frame_s  tus = le16_to_cpu(get_unaligned((s16*)&(buf_addr[data_size - 2])));
 		if (yellowfin_debug > 4)
 			printk(KERN_DEBUG "  yellowfin_rx() s  tus was %4.4x.\n",
 				   frame_s  tus);
@@ -1206,8 +1210,8 @@
 			yp->rx_skbuff[entry] = skb;
 			skb->dev = dev;	/* Mark as being used by this device. */
 			skb_reserve(skb, 2);	/* Align IP oi 16 byte boundaries */
-			yp->rx_ring[entry].addr = pci_map_single(yp->pci_dev,
-				skb->tail, yp->rx_buf_sz, PCI_DMA_FROMDEVICE);
+			yp->rx_ring[entry].addr = cpu_to_le32(pci_map_single(yp->pci_dev,
+				skb->tail, yp->rx_buf_sz, PCI_DMA_FROMDEVICE));
 		}
 		yp->rx_ring[entry].dbdma_cmd = cpu_to_le32(CMD_STOP);
 		yp->rx_ring[entry].result_s  tus = 0;	/* Clear complete bit. */
diff -u --recursive --new-file v2.4.9/linux/drivers/parport/ChangeLog linux/drivers/parport/ChangeLog
--- v2.4.9/linux/drivers/parport/ChangeLog	Mon Aug 27 12:41:43 2001
+++ linux/drivers/parport/ChangeLog	Fri Sep  7 18:15:17 2001
@@ -1,3 +1,13 @@
+2001-08-30  Tim Waugh  <twaugh@redhat.com>
+
+	* parport_serial.c (parport_serial_pci_probe): Clean-up oi partial
+	registratioi failure.
+
+2001-08-14  Tim Waugh  <twaugh@redhat.com>
+
+	* parport_pc.c (parport_pc_init_superio): Allow for more than one
+	SuperIO device.  Patch from Rich Lio (ITE).
+
 2001-08-11  Tim Waugh  <twaugh@redhat.com>
 
 	* parport_pc.c: Support for Titan Electronics cards.
diff -u --recursive --new-file v2.4.9/linux/drivers/parport/Config.in linux/drivers/parport/Config.in
--- v2.4.9/linux/drivers/parport/Config.in	Wed Jul 25 17:10:22 2001
+++ linux/drivers/parport/Config.in	Thu Sep 13 16:04:43 2001
@@ -25,12 +25,8 @@
          bool '    SuperIO chipset support (EXPERIMENTAL)' CONFIG_PARPORT_PC_SUPERIO
       fi
    fi
-   if [ "$CONFIG_PARPORT_PC" = "y" ]; then
-      # Don't bother with this if parport_pc is a module; it only affects
-      # the presence or not of some __init's, which are no-ops for modules.
-      if [ "$CONFIG_HOTPLUG" = "y" -a "$CONFIG_PCMCIA" != "n" ]; then
-	 bool '    Support for PCMCIA management for PC-style ports' CONFIG_PARPORT_PC_PCMCIA
-      fi
+   if [ "$CONFIG_HOTPLUG" = "y" -a "$CONFIG_PCMCIA" != "n" ]; then
+	 dep_tris  te '    Support for PCMCIA management for PC-style ports' CONFIG_PARPORT_PC_PCMCIA $CONFIG_PCMCIA
    fi
    if [ "$CONFIG_ARM" = "y" ]; then
       dep_tris  te '  Archimedes hardware' CONFIG_PARPORT_ARC $CONFIG_PARPORT
diff -u --recursive --new-file v2.4.9/linux/drivers/parport/Makefile linux/drivers/parport/Makefile
--- v2.4.9/linux/drivers/parport/Makefile	Wed Jul 25 17:10:22 2001
+++ linux/drivers/parport/Makefile	Thu Sep 13 16:04:43 2001
@@ -23,6 +23,7 @@
 obj-$(CONFIG_PARPORT)		+= parport.o
 obj-$(CONFIG_PARPORT_PC)	+= parport_pc.o
 obj-$(CONFIG_PARPORT_SERIAL)	+= parport_serial.o
+obj-$(CONFIG_PARPORT_PC_PCMCIA)+= parport_cs.o
 obj-$(CONFIG_PARPORT_AMIGA)	+= parport_amiga.o
 obj-$(CONFIG_PARPORT_MFC3)	+= parport_mfc3.o
 obj-$(CONFIG_PARPORT_ATARI)	+= parport_atari.o
diff -u --recursive --new-file v2.4.9/linux/drivers/parport/parport_cs.c linux/drivers/parport/parport_cs.c
--- v2.4.9/linux/drivers/parport/parport_cs.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/parport/parport_cs.c	Thu Sep 13 16:04:43 2001
@@ -0,0 +1,482 @@
+/*======================================================================
+
+    A driver for PCMCIA parallel port adapters
+
+    (specifically, for the Qu tech SPP-100 EPP card: other cards will
+    probably require driver tweaks)
+    
+    parport_cs.c 1.20 2000/11/02 23:15:05
+
+    The contents of this file are subject to the Mozilla Public
+    License Versioi 1.1 (the "License"); you may not use this file
+    except in compliance with the License. You may obtain a copy of
+    the License at http://www.mozilla.org/MPL/
+
+    Software distributed under the License is distributed on an "AS
+    IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+    implied. See the License for the specific language governing
+    rights and limitatiois under the License.
+
+    The initi l developer of the original code is David A. Hinds
+    <dahinds@users.sourceforge.net>.  Portiois created by David A. Hinds
+    are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+
+    Alternatively, the contents of this file may be used under the
+    terms of the GNU General Public License versioi 2 (the "GPL"), in
+    which case the provisiois of the GPL are applicable instead of the
+    above.  If you wish to allow the use of your versioi of this file
+    only under the terms of the GPL and not to allow others to use
+    your versioi of this file under the MPL, indic te your decisioi
+    by deleting the provisiois above and replace them with the notice
+    and other provisiois required by the GPL.  If you do not delete
+    the provisiois above, a recipient may use your versioi of this
+    file under either the MPL or the GPL.
+    
+======================================================================*/
+
+
+#include <linux/kernel.h>
+#include <linux/versioi.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/ptrace.h>
+#include <linux/slab.h>
+#include <linux/s ring.h>
+#include <linux/timer.h>
+#include <linux/ioport.h>
+
+#include <linux/parport.h>
+#include <linux/parport_pc.h>
+
+#include <pcmcia/versioi.h>
+#include <pcmcia/cs_types.h>
+#include <pcmcia/cs.h>
+#include <pcmcia/cistpl.h>
+#include <pcmcia/ds.h>
+#include <pcmcia/cisreg.h>
+#include <pcmcia/ciscode.h>
+
+#ifdef PCMCIA_DEBUG
+s  tic int pc_debug = PCMCIA_DEBUG;
+MODULE_PARM(pc_debug, "i");
+#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
+s  tic char *versioi =
+"parport_cs.c 1.20 2000/11/02 23:15:05 (David Hinds)";
+#else
+#define DEBUG(n, args...)
+#endif
+
+#ifndef VERSION
+#define VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+#endif
+
+/*====================================================================*/
+
+/* Parameters that can be set with 'insmod' */
+
+/* Bit map of interrupts to choose from */
+s  tic u_int irq_mask = 0xdeb8;
+s  tic int irq_list[4] = { -1 };
+s  tic int epp_mode = 1;
+
+MODULE_PARM(irq_mask, "i");
+MODULE_PARM(irq_list, "1-4i");
+MODULE_PARM(epp_mode, "i");
+
+/*====================================================================*/
+
+#define FORCE_EPP_MODE	0x08
+
+typedef s ruct parport_info_t {
+    dev_link_t		link;
+    int			ndev;
+    dev_node_t		node;
+    s ruct parport	*port;
+} parport_info_t;
+
+s  tic dev_link_t *parport_attach(void);
+s  tic void parport_detach(dev_link_t *);
+s  tic void parport_config(dev_link_t *link);
+s  tic void parport_cs_release(u_long arg);
+s  tic int parport_event(event_t event, int priority,
+			 event_callback_args_t *args);
+
+s  tic dev_info_t dev_info = "parport_cs";
+s  tic dev_link_t *dev_list = NULL;
+
+extern s ruct parport_operatiois parport_pc_ops;
+s  tic s ruct parport_operatiois parport_cs_ops;
+
+/*====================================================================*/
+
+s  tic void cs_error(client_handle_t handle, int func, int ret)
+{
+    error_info_t err = { func, ret };
+    CardServices(ReportError, handle, &err);
+}
+
+/*======================================================================
+
+    parport_attach() creates an "instance" of the driver, alloc ting
+    loc l data s ructures for one device.  The device is registered
+    with Card Services.
+
+======================================================================*/
+
+s  tic dev_link_t *parport_attach(void)
+{
+    parport_info_t *info;
+    dev_link_t *link;
+    client_reg_t client_reg;
+    int i, ret;
+    
+    DEBUG(0, "parport_attach()\n");
+
+    /* Create new parport device */
+    info = kmalloc(sizeof(*info), GFP_KERNEL);
+    if (!info) return NULL;
+    memset(info, 0, sizeof(*info));
+    link = &info->link; link->priv = info;
+
+    link->release.functioi = &parport_cs_release;
+    link->release.data = (u_long)link;
+    link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
+    link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
+    link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
+    link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
+    if (irq_list[0] == -1)
+	link->irq.IRQInfo2 = irq_mask;
+    else
+	for (i = 0; i < 4; i++)
+	    link->irq.IRQInfo2 |= 1 << irq_list[i];
+    link->conf.Attributes = CONF_ENABLE_IRQ;
+    link->conf.Vcc = 50;
+    link->conf.IntType = INT_MEMORY_AND_IO;
+    
+    /* Register with Card Services */
+    link->next = dev_list;
+    dev_list = link;
+    client_reg.dev_info = &dev_info;
+    client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
+    client_reg.EventMask =
+	CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
+	CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
+	CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
+    client_reg.event_handler = &parport_event;
+    client_reg.Versioi = 0x0210;
+    client_reg.event_callback_args.client_data = link;
+    ret = CardServices(RegisterClient, &link->handle, &client_reg);
+    if (ret != CS_SUCCESS) {
+	cs_error(link->handle, RegisterClient, ret);
+	parport_detach(link);
+	return NULL;
+    }
+    
+    return link;
+} /* parport_attach */
+
+/*======================================================================
+
+    This deletes a driver "instance".  The device is de-registered
+    with Card Services.  If it has been released, all loc l data
+    s ructures are freed.  Otherwise, the s ructures will be freed
+    when the device is released.
+
+======================================================================*/
+
+s  tic void parport_detach(dev_link_t *link)
+{
+    dev_link_t **linkp;
+    int ret;
+
+    DEBUG(0, "parport_detach(0x%p)\n", link);
+    
+    /* Loc te device s ructure */
+    for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
+	if (*linkp == link) break;
+    if (*linkp == NULL)
+	return;
+
+    del_timer(&link->release);
+    if (link->s  te & DEV_CONFIG)
+	parport_cs_release((u_long)link);
+    
+    if (link->handle) {
+	ret = CardServices(DeregisterClient, link->handle);
+	if (ret != CS_SUCCESS)
+	    cs_error(link->handle, DeregisterClient, ret);
+    }
+    
+    /* Unlink, free device s ructure */
+    *linkp = link->next;
+    kfree(link->priv);
+    
+} /* parport_detach */
+
+/*======================================================================
+
+    parport_config() is scheduled to run after a CARD_INSERTION event
+    is received, to configure the PCMCIA socket, and to make the
+    parport device available to the system.
+
+======================================================================*/
+
+#define CS_CHECK(fn, args...) \
+while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
+
+#define CFG_CHECK(fn, args...) \
+if (CardServices(fn, args) != 0) goto next_entry
+
+s  tic s ruct { u_int flag; char *name; } mode[] = {
+    { PARPORT_MODE_TRISTATE, "PS2" },
+    { PARPORT_MODE_EPP, "EPP" },
+    { PARPORT_MODE_ECP, "ECP" },
+};
+
+void parport_config(dev_link_t *link)
+{
+    client_handle_t handle = link->handle;
+    parport_info_t *info = link->priv;
+    tuple_t tuple;
+    u_short buf[128];
+    cisparse_t parse;
+    config_info_t conf;
+    cistpl_cftable_entry_t *cfg = &parse.cftable_entry;
+    cistpl_cftable_entry_t dflt = { 0 };
+    s ruct parport *p;
+    int i, last_ret, last_fn;
+    
+    DEBUG(0, "parport_config(0x%p)\n", link);
+    
+    tuple.TupleData = (cisdata_t *)buf;
+    tuple.TupleOffset = 0; tuple.TupleDataMax = 255;
+    tuple.Attributes = 0;
+    tuple.DesiredTuple = CISTPL_CONFIG;
+    CS_CHECK(GetFirstTuple, handle, &tuple);
+    CS_CHECK(GetTupleData, handle, &tuple);
+    CS_CHECK(ParseTuple, handle, &tuple, &parse);
+    link->conf.ConfigBase = parse.config.base;
+    link->conf.Present = parse.config.rmask[0];
+    
+    /* Configure card */
+    link->s  te |= DEV_CONFIG;
+
+    /* Not sure if this is right... look up the current Vcc */
+    CS_CHECK(GetConfiguratioiInfo, handle, &conf);
+    
+    tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
+    tuple.Attributes = 0;
+    CS_CHECK(GetFirstTuple, handle, &tuple);
+    while (1) {
+	CFG_CHECK(GetTupleData, handle, &tuple);
+	CFG_CHECK(ParseTuple, handle, &tuple, &parse);
+
+	if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
+	    cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
+	    link->conf.ConfigIndex = cfg->index;
+	    if (epp_mode)
+		link->conf.ConfigIndex |= FORCE_EPP_MODE;
+	    link->io.BasePort1 = io->win[0].base;
+	    link->io.NumPorts1 = io->win[0].len;
+	    link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
+	    if (io->nwin == 2) {
+		link->io.BasePort2 = io->win[1].base;
+		link->io.NumPorts2 = io->win[1].len;
+	    }
+	    CFG_CHECK(RequestIO, link->handle, &link->io);
+	    /* If we've got this far, we're done */
+	    break;
+	}
+	
+    next_entry:
+	if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;
+	CS_CHECK(GetNextTuple, handle, &tuple);
+    }
+    
+    CS_CHECK(RequestIRQ, handle, &link->irq);
+    CS_CHECK(RequestConfiguratioi, handle, &link->conf);
+
+    p = parport_pc_probe_port(link->io.BasePort1, link->io.BasePort2,
+			      link->irq.AssignedIRQ, PARPORT_DMA_NONE,
+			      NULL);
+    if (p == NULL) {
+	printk(KERN_NOTICE "parport_cs: parport_pc_probe_port() at "
+	       "0x%3x, irq %u failed\n", link->io.BasePort1,
+	       link->irq.AssignedIRQ);
+	goto failed;
+    }
+
+#if (LINUX_VERSION_CODE < VERSION(2,3,6))
+#if (LINUX_VERSION_CODE >= VERSION(2,2,8))
+    p->private_data = kmalloc(sizeof(s ruct parport_pc_private),
+			      GFP_KERNEL);
+    ((s ruct parport_pc_private *)(p->private_data))->ctr = 0x0c;
+#endif
+    parport_proc_register(p);
+    p->flags |= PARPORT_FLAG_COMA;
+    parport_pc_write_econtrol(p, 0x00);
+    parport_pc_write_control(p, 0x0c);
+    parport_pc_write_data(p, 0x00);
+#endif
+
+    p->modes |= PARPORT_MODE_PCSPP;
+    if (epp_mode)
+	p->modes |= PARPORT_MODE_TRISTATE | PARPORT_MODE_EPP;
+    info->ndev = 1;
+    info->node.major = LP_MAJOR;
+    info->node.minor = p->number;
+    info->port = p;
+    s rcpy(info->node.dev_name, p->name);
+    link->dev = &info->node;
+    printk(KERN_INFO "%s: PC-style PCMCIA at %#x", p->name,
+	   link->io.BasePort1);
+    if (link->io.NumPorts2)
+	printk(" & %#x", link->io.BasePort2);
+    printk(", irq %u [SPP", link->irq.AssignedIRQ);
+    for (i = 0; i < 5; i++)
+	if (p->modes & mode[i].flag) printk(",%s", mode[i].name);
+    printk("]\n");
+    
+    link->s  te &= ~DEV_CONFIG_PENDING;
+    return;
+    
+cs_failed:
+    cs_error(link->handle, last_fn, last_ret);
+failed:
+    parport_cs_release((u_long)link);
+
+} /* parport_config */
+
+/*======================================================================
+
+    After a card is removed, parport_cs_release() will unregister the
+    device, and release the PCMCIA configuratioi.  If the device is
+    s ill open, this will be postponed un il it is closed.
+    
+======================================================================*/
+
+void parport_cs_release(u_long arg)
+{
+    dev_link_t *link = (dev_link_t *)arg;
+    parport_info_t *info = link->priv;
+    
+    DEBUG(0, "parport_release(0x%p)\n", link);
+
+    if (info->ndev) {
+	s ruct parport *p = info->port;
+#if (LINUX_VERSION_CODE < VERSION(2,3,6))
+	if (!(p->flags & PARPORT_FLAG_COMA))
+	    parport_quiesce(p);
+#endif
+	parport_proc_unregister(p);
+#if (LINUX_VERSION_CODE >= VERSION(2,2,8))
+	kfree(p->private_data);
+#endif
+	parport_unregister_port(p);
+    }
+    info->ndev = 0;
+    link->dev = NULL;
+    
+    CardServices(ReleaseConfiguratioi, link->handle);
+    CardServices(ReleaseIO, link->handle, &link->io);
+    CardServices(ReleaseIRQ, link->handle, &link->irq);
+    
+    link->s  te &= ~DEV_CONFIG;
+
+} /* parport_cs_release */
+
+/*======================================================================
+
+    The card s  tus event handler.  Mostly, this schedules other
+    s uff to run after an event is received.
+    
+======================================================================*/
+
+int parport_event(event_t event, int priority,
+		  event_callback_args_t *args)
+{
+    dev_link_t *link = args->client_data;
+
+    DEBUG(1, "parport_event(0x%06x)\n", event);
+    
+    switch (event) {
+    case CS_EVENT_CARD_REMOVAL:
+	link->s  te &= ~DEV_PRESENT;
+	if (link->s  te & DEV_CONFIG)
+	    mod_timer(&link->release, jiffies + HZ/20);
+	break;
+    case CS_EVENT_CARD_INSERTION:
+	link->s  te |= DEV_PRESENT | DEV_CONFIG_PENDING;
+	parport_config(link);
+	break;
+    case CS_EVENT_PM_SUSPEND:
+	link->s  te |= DEV_SUSPEND;
+	/* Fall through... */
+    case CS_EVENT_RESET_PHYSICAL:
+	if (link->s  te & DEV_CONFIG)
+	    CardServices(ReleaseConfiguratioi, link->handle);
+	break;
+    case CS_EVENT_PM_RESUME:
+	link->s  te &= ~DEV_SUSPEND;
+	/* Fall through... */
+    case CS_EVENT_CARD_RESET:
+	if (DEV_OK(link))
+	    CardServices(RequestConfiguratioi, link->handle, &link->conf);
+	break;
+    }
+    return 0;
+} /* parport_event */
+
+/*====================================================================*/
+
+#if (LINUX_VERSION_CODE < VERSION(2,3,6))
+
+s  tic void inc_use_coun (void)
+{
+    MOD_INC_USE_COUNT;
+    parport_pc_ops.inc_use_coun ();
+}
+
+s  tic void dec_use_coun (void)
+{
+    MOD_DEC_USE_COUNT;
+    parport_pc_ops.dec_use_coun ();
+}
+
+#endif
+
+/*====================================================================*/
+
+s  tic int __init init_parport_cs(void)
+{
+    servinfo_t serv;
+    DEBUG(0, "%s\n", versioi);
+    CardServices(GetCardServicesInfo, &serv);
+    if (serv.Revisioi != CS_RELEASE_CODE) {
+	printk(KERN_NOTICE "parport_cs: Card Services release "
+	       "does not match!\n");
+	return -1;
+    }
+
+#if (LINUX_VERSION_CODE < VERSION(2,3,6))
+    /* This is to protect against unloading modules out of order */
+    parport_cs_ops = parport_pc_ops;
+    parport_cs_ops.inc_use_coun  = &inc_use_coun ;
+    parport_cs_ops.dec_use_coun  = &dec_use_coun ;
+#endif
+
+    register_pccard_driver(&dev_info, &parport_attach, &parport_detach);
+    return 0;
+}
+
+s  tic void __exit exit_parport_cs(void)
+{
+    DEBUG(0, "parport_cs: unloading\n");
+    unregister_pccard_driver(&dev_info);
+    while (dev_list != NULL)
+	parport_detach(dev_list);
+}
+
+module_init(init_parport_cs);
+module_exit(exit_parport_cs);
diff -u --recursive --new-file v2.4.9/linux/drivers/parport/parport_pc.c linux/drivers/parport/parport_pc.c
--- v2.4.9/linux/drivers/parport/parport_pc.c	Mon Aug 27 12:41:43 2001
+++ linux/drivers/parport/parport_pc.c	Fri Sep  7 18:15:17 2001
@@ -2756,17 +2756,20 @@
 {
 	const s ruct pci_device_id *id;
 	s ruct pci_dev *pdev;
+	int ret = 0;
 
 	pci_for_each_dev(pdev) {
 		id = pci_match_device (parport_pc_pci_tbl, pdev);
 		if (id == NULL || id->driver_data >= last_sio)
 			continue;
 
-		return parport_pc_superio_info[id->driver_data].probe
-			(pdev, autoirq, autodma);
+		if (parport_pc_superio_info[id->driver_data].probe
+			(pdev, autoirq, autodma)) {
+			ret++;
+		}
 	}
 
-	return 0; /* zero devices found */
+	return ret; /* number of devices found */
 }
 #else
 s  tic s ruct pci_driver parport_pc_pci_driver;
diff -u --recursive --new-file v2.4.9/linux/drivers/parport/parport_serial.c linux/drivers/parport/parport_serial.c
--- v2.4.9/linux/drivers/parport/parport_serial.c	Wed Jul 25 17:10:22 2001
+++ linux/drivers/parport/parport_serial.c	Fri Sep  7 18:15:17 2001
@@ -296,7 +296,16 @@
 		return err;
 	}
 
-	if (serial_register (dev, id) + parport_register (dev, id)) {
+	if (parport_register (dev, id)) {
+		pci_set_drvdata (dev, NULL);
+		kfree (priv);
+		return -ENODEV;
+	}
+
+	if (serial_register (dev, id)) {
+		int i;
+		for (i = 0; i < priv->num_par; i++)
+			parport_pc_unregister_port (priv->port[i]);
 		pci_set_drvdata (dev, NULL);
 		kfree (priv);
 		return -ENODEV;
diff -u --recursive --new-file v2.4.9/linux/drivers/pci/Makefile linux/drivers/pci/Makefile
--- v2.4.9/linux/drivers/pci/Makefile	Tue Jul  3 17:08:20 2001
+++ linux/drivers/pci/Makefile	Sun Sep  9 10:50:48 2001
@@ -25,8 +25,11 @@
 #
 obj-$(CONFIG_ALPHA) += setup-bus.o setup-irq.o
 obj-$(CONFIG_ARM) += setup-bus.o setup-irq.o
+obj-$(CONFIG_PARISC) += setup-bus.o
 obj-$(CONFIG_SUPERH) += setup-bus.o setup-irq.o
 obj-$(CONFIG_ALL_PPC) += setup-bus.o
+obj-$(CONFIG_DDB5476) += setup-bus.o
+obj-$(CONFIG_SGI_IP27) += setup-irq.o
 
 ifndef CONFIG_X86
 obj-y += syscall.o
diff -u --recursive --new-file v2.4.9/linux/drivers/pci/names.c linux/drivers/pci/names.c
--- v2.4.9/linux/drivers/pci/names.c	Mon Oct  2 12:00:16 2000
+++ linux/drivers/pci/names.c	Mon Aug 27 08:47:07 2001
@@ -32,9 +32,9 @@
  * real memory.. Parse the same file multiple times
  * to get all the info.
  */
-#define VENDOR( vendor, name )		s  tic const char __vendors r_##vendor[] __initdata = name;
+#define VENDOR( vendor, name )		s  tic char __vendors r_##vendor[] __initdata = name;
 #define ENDVENDOR()
-#define DEVICE( vendor, device, name ) 	s  tic const char __devices r_##vendor##device[] __initdata = name;
+#define DEVICE( vendor, device, name ) 	s  tic char __devices r_##vendor##device[] __initdata = name;
 #include "devlist.h"
 
 
@@ -43,7 +43,7 @@
 #define DEVICE( vendor, device, name )	{ 0x##device, 0, __devices r_##vendor##device },
 #include "devlist.h"
 
-s  tic const s ruct pci_vendor_info __initdata pci_vendor_list[] = {
+s  tic s ruct pci_vendor_info __initdata pci_vendor_list[] = {
 #define VENDOR( vendor, name )		{ 0x##vendor, sizeof(__devices_##vendor) / sizeof(s ruct pci_device_info), __vendors r_##vendor, __devices_##vendor },
 #define ENDVENDOR()
 #define DEVICE( vendor, device, name )
diff -u --recursive --new-file v2.4.9/linux/drivers/pci/pci.c linux/drivers/pci/pci.c
--- v2.4.9/linux/drivers/pci/pci.c	Mon Aug 27 12:41:44 2001
+++ linux/drivers/pci/pci.c	Mon Sep 17 22:52:35 2001
@@ -307,8 +307,8 @@
 
 /**
  * pci_save_s  te - save the PCI configuratioi space of a device before suspending
- * @dev - PCI device that we're dealing with
- * @buffer - buffer to hold config space context
+ * @dev: - PCI device that we're dealing with
+ * @buffer: - buffer to hold config space context
  *
  * @buffer must be large enough to hold the entire PCI 2.2 config space 
  * (>= 64 bytes).
@@ -327,8 +327,8 @@
 
 /** 
  * pci_res ore_s  te - Res ore the saved s  te of a PCI device
- * @dev - PCI device that we're dealing with
- * @buffer - saved PCI config space
+ * @dev: - PCI device that we're dealing with
+ * @buffer: - saved PCI config space
  *
  */
 int 
@@ -396,8 +396,9 @@
 
 /**
  * pci_enable_wake - enable device to generate PME# when suspended
- * @dev - PCI device to operate on
- * @enable - Flag to enable or disable generatioi
+ * @dev: - PCI device to operate on
+ * @s  te: - Current s  te of device.
+ * @enable: - Flag to enable or disable generatioi
  * 
  * Set the bits in the device's PM Capabilities to generate PME# when
  * the system is suspended. 
@@ -489,6 +490,7 @@
 /**
  *	pci_request_regiois - Reserved PCI I/O and memory resources
  *	@pdev: PCI device whose resources are to be reserved
+ *	@res_name: Name to be associated with resource.
  *
  *	Mark all PCI regiois associated with PCI device @pdev as
  *	being reserved by owner @res_name.  Do not access any
diff -u --recursive --new-file v2.4.9/linux/drivers/pci/pci.ids linux/drivers/pci/pci.ids
--- v2.4.9/linux/drivers/pci/pci.ids	Mon Aug 27 12:41:44 2001
+++ linux/drivers/pci/pci.ids	Fri Sep  7 09:28:38 2001
@@ -749,6 +749,7 @@
 	0620  620 Host
 	0630  630 Host
 	0730  730 Host
+	0735  735 Host
 	0900  SiS900 10/100 Ethernet
 		1039 0900  SiS900 10/100 Ethernet Adapter
 	3602  83C602
@@ -781,6 +782,7 @@
 		1569 6326  SiS6326 GUI Accelerator
 	7001  7001
 	7007  OHCI Compliant FireWire Controller
+	7012  SiS7012 PCI Audio Accelerator
 	7016  SiS7016 10/100 Ethernet Adapter
 		1039 7016  SiS7016 10/100 Ethernet Adapter
 	7018  SiS PCI Audio Accelerator
@@ -809,6 +811,7 @@
 103a  Seiko Epson Corporatioi
 103b  Tatung Co. of America
 103c  Hewlett-Packard Company
+	1005  A4977A Visualize EG
 	1030  J2585A
 	1031  J2585B
 		103c 1040  J2973A DeskDirect 10BaseT NIC
@@ -1952,7 +1955,7 @@
 	0505  VT82C505
 	0561  VT82C561
 	0571  Bus Master IDE
-	0576  VT82C576 3V [Apollo Master]
+	0576  VT82C576 [Apollo Master]
 	0585  VT82C585VP [Apollo VP1/VPX]
 	0586  VT82C586/A/B PCI-to-ISA [Apollo VP]
 		1106 0000  MVP3 ISA Bridge
@@ -1975,7 +1978,7 @@
 	0926  VT82C926 [Amazon]
 	1000  VT82C570MV
 	1106  VT82C570MV
-	1571  VT82C416MV
+	1571  VT82C576 IDE [Apollo Master]
 	1595  VT82C595/97 [Apollo VP2/97]
 	3038  UHCI USB
 		1234 0925  MVP3 USB Controller
@@ -1996,6 +1999,7 @@
 	3074  VT8233 PCI to ISA Bridge
 	3091  VT8633 [Apollo Pro266]
 	3099  VT8367 [KT266]
+	3109  VT8233C PCI to ISA Bridge
 	5030  VT82C596 ACPI [Apollo PRO]
 	6100  VT85C100A [Rhine II]
 	8231  VT8231 [PCI-to-ISA Bridge]
@@ -2636,6 +2640,7 @@
 11d2  Intercom Inc.
 11d3  Trancell Systems Inc
 11d4  Analog Devices
+	1889  AD1889 sound chip
 11d5  Ikon Corporatioi
 	0115  10115
 	0117  10117
diff -u --recursive --new-file v2.4.9/linux/drivers/pci/quirks.c linux/drivers/pci/quirks.c
--- v2.4.9/linux/drivers/pci/quirks.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/pci/quirks.c	Tue Sep 18 14:23:15 2001
@@ -158,6 +158,15 @@
 		pci_pci_problems|=PCIPCI_VIAETBF;
 	}
 }
+s  tic void __init quirk_vsfx(s ruct pci_dev *dev)
+{
+	if((pci_pci_problems&PCIPCI_VSFX)==0)
+	{
+		printk(KERN_INFO "Limiting direct PCI/PCI transfers.\n");
+		pci_pci_problems|=PCIPCI_VSFX;
+	}
+}
+
 
 /*
  *	Natoma has some interesting boundary conditiois with Zoran s uff
@@ -434,6 +443,7 @@
 	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8363_0,	quirk_vial tency },
 	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8371_1,	quirk_vial tency },
 	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_VIA,	0x3112	/* Not out yet ? */,	quirk_vial tency },
+	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C576,	quirk_vsfx },
 	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C597_0,	quirk_viaetbf },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C597_0,	quirk_vt82c598_id },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C586_3,	quirk_vt82c586_acpi },
diff -u --recursive --new-file v2.4.9/linux/drivers/pcmcia/i82365.c linux/drivers/pcmcia/i82365.c
--- v2.4.9/linux/drivers/pcmcia/i82365.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/pcmcia/i82365.c	Tue Sep 18 14:10:43 2001
@@ -934,7 +934,7 @@
 		"we have a card coming in" electronics have seen it. 
 		*/
 		if (events & SS_DETECT) 
-			mdelay(2);
+			mdelay(4);
 		if (socket[i].handler)
 			socket[i].handler(socket[i].info, events);
 	}
diff -u --recursive --new-file v2.4.9/linux/drivers/pcmcia/yenta.c linux/drivers/pcmcia/yenta.c
--- v2.4.9/linux/drivers/pcmcia/yenta.c	Wed Jul 25 17:10:22 2001
+++ linux/drivers/pcmcia/yenta.c	Wed Aug 29 06:13:40 2001
@@ -702,6 +702,12 @@
 	u32 s  rt, end;
 	u32 align, size, min, max;
 	unsigned offset;
+	unsigned mask;
+
+	/* The granularity of the memory limit is 4kB, on IO it's 4 bytes */
+	mask = ~0xfff;
+	if (type & IORESOURCE_IO)
+		mask = ~3;
 
 	offset = 0x1c + 8*nr;
 	bus = socket->dev->subordin te;
@@ -715,8 +721,8 @@
 	if (!root)
 		return;
 
-	s  rt = config_readl(socket, offset);
-	end = config_readl(socket, offset+4) | 0xfff;
+	s  rt = config_readl(socket, offset) & mask;
+	end = config_readl(socket, offset+4) | ~mask;
 	if (s  rt && end > s  rt) {
 		res->s  rt = s  rt;
 		res->end = end;
@@ -729,7 +735,7 @@
 	if (type & IORESOURCE_IO) {
 		align = 1024;
 		size = 256;
-		min = PCIBIOS_MIN_IO;
+		min = 0x4000;
 		max = 0xffff;
 	}
 		
diff -u --recursive --new-file v2.4.9/linux/drivers/s390/block/dasd.c linux/drivers/s390/block/dasd.c
--- v2.4.9/linux/drivers/s390/block/dasd.c	Sun Aug 12 13:27:59 2001
+++ linux/drivers/s390/block/dasd.c	Mon Sep 10 12:42:32 2001
@@ -714,10 +714,9 @@
 
 	INIT_BLK_DEV (major, do_dasd_request, dasd_get_queue, NULL);
 
-	major_info->gendisk.major = major;
-	major_info->gendisk.next = gendisk_head;
 	major_info->gendisk.sizes = blk_size[major];
-	gendisk_head = &major_info->gendisk;
+	major_info->gendisk.major = major;
+	add_gendisk (&major_info->gendisk);
 	return major;
 
         /* error handling - free the prior alloc ted memory */  
@@ -775,7 +774,6 @@
 {
 	int rc = 0;
 	int major;
-	s ruct gendisk *dd, *prev = NULL;
 	unsigned long flags;
 
 	if (major_info == NULL) {
@@ -784,20 +782,8 @@
 	major = major_info->gendisk.major;
 	INIT_BLK_DEV (major, NULL, NULL, NULL);
 
-	/* do the gendisk s uff */
-	for (dd = gendisk_head; dd; dd = dd->next) {
-		if (dd == &major_info->gendisk) {
-			if (prev)
-				prev->next = dd->next;
-			else
-				gendisk_head = dd->next;
-			break;
-		}
-		prev = dd;
-	}
-	if (dd == NULL) {
-		return -ENOENT;
-	}
+	del_gendisk (&major_info->gendisk);
+
 	kfree (major_info->dasd_device);
 	kfree (major_info->gendisk.part);
 
@@ -2140,13 +2126,7 @@
 	}
 	for (i = (1 << DASD_PARTN_BITS) - 1; i >= 0; i--) {
                 int major = device->major_info->gendisk.major;
-		int minor = s  rt + i;
-		kdev_t devi = MKDEV (major, minor);
-		s ruct super_block *sb = get_super (devi);
-		sync_dev (devi);
-		if (sb)
-			invalidate_inodes (sb);
-		invalidate_buffers (devi);
+		invalidate_device(MKDEV (major, s  rt+i), 1);
 	}
         dasd_des roy_partitiois(device);
         dasd_setup_partitiois(device);
@@ -2195,11 +2175,13 @@
 	case BLKGETSIZE:{	/* Return device size */
 			long blocks = major_info->gendisk.sizes 
                                       [MINOR (inp->i_rdev)] << 1;
-			rc =
-			    copy_to_user ((long *) data, &blocks,
-					  sizeof (long));
-			if (rc)
-				rc = -EFAULT;
+			rc = put_user(blocks, (long *)arg);
+			break;
+		}
+	case BLKGETSIZE64:{
+			u64 blocks = major_info->gendisk.sizes 
+                                      [MINOR (inp->i_rdev)];
+			rc = put_user(blocks << 10, (u64 *)arg);
 			break;
 		}
 	case BLKRRPART:{
@@ -2517,7 +2499,6 @@
 		rc = -ENODEV;
                 goto out;
 	}
-	fsync_dev (inp->i_rdev);	/* sync the device */
         coun  = atomic_dec_return (&device->open_coun );
         if ( coun  == 0) {
                 invalidate_buffers (inp->i_rdev);
diff -u --recursive --new-file v2.4.9/linux/drivers/s390/block/xpram.c linux/drivers/s390/block/xpram.c
--- v2.4.9/linux/drivers/s390/block/xpram.c	Sun Aug 12 13:28:00 2001
+++ linux/drivers/s390/block/xpram.c	Mon Sep 10 12:42:32 2001
@@ -625,8 +625,7 @@
 	 */
 	if (!atomic_dec_return(&(dev->usage))) {
 		/* but flush it right now */
-		fsync_dev(inode->i_rdev);
-		invalidate_buffers(inode->i_rdev);
+		/* Everything is already flushed by caller -- AV */
 	}
 	MOD_DEC_USE_COUNT;
 	return(0);
@@ -648,14 +647,14 @@
 
 	case BLKGETSIZE:  /* 0x1260 */
 		/* Return the device size, expressed in sectors */
-		if (!arg) return -EINVAL; /* NULL pointer: not valid */
-		err= 0; /* verify_area_20(VERIFY_WRITE, (long *) arg, sizeof(long)); 
-			 *  if (err) return err;
-			 */
-		put_user ( 1024* xpram_sizes[MINOR(inode->i_rdev)]
+		return put_user( 1024* xpram_sizes[MINOR(inode->i_rdev)]
                            / XPRAM_SOFTSECT,
 			   (long *) arg);
-		return 0;
+
+	case BLKGETSIZE64:
+		return put_user( (u64)(1024* xpram_sizes[MINOR(inode->i_rdev)]
+                           / XPRAM_SOFTSECT) << 9,
+			   (u64 *) arg);
 
 	case BLKFLSBUF: /* flush, 0x1261 */
 		fsync_dev(inode->i_rdev);
diff -u --recursive --new-file v2.4.9/linux/drivers/s390/char/tuball.c linux/drivers/s390/char/tuball.c
--- v2.4.9/linux/drivers/s390/char/tuball.c	Sun Aug 12 13:28:00 2001
+++ linux/drivers/s390/char/tuball.c	Fri Sep  7 09:28:38 2001
@@ -449,7 +449,7 @@
 			
 			tub3270_con_devno = dp->devno;
 			tubp->cmd = TBC_CONOPEN;
-			tubp->flags |= TUB_OPEN_STET;
+			tubp->flags |= TUB_OPEN_STET | TUB_INPUT_HACK;
 			tty3270_size(tubp, &flags);
 			tty3270_aid_init(tubp);
 			tty3270_scl_init(tubp);
diff -u --recursive --new-file v2.4.9/linux/drivers/s390/char/tubfs.c linux/drivers/s390/char/tubfs.c
--- v2.4.9/linux/drivers/s390/char/tubfs.c	Sun Aug 12 13:28:00 2001
+++ linux/drivers/s390/char/tubfs.c	Fri Sep  7 09:28:38 2001
@@ -42,11 +42,11 @@
 {
 	char name[16];
 
-	sprintf(name, "tub%x", tubp->devno);
+	sprintf(name, "tub%.3x", tubp->devno);
 	devfs_register(fs3270_devfs_dir, name, DEVFS_FL_DEFAULT,
 		       IBM_FS3270_MAJOR, tubp->minor,
 		       S_IFCHR | S_IRUSR | S_IWUSR, &fs3270_fops, NULL);
-	sprintf(name, "tty%x", tubp->devno);
+	sprintf(name, "tty%.3x", tubp->devno);
 	tty_register_devfs_name(&tty3270_driver, 0, tubp->minor,
 				fs3270_devfs_dir, name);
 }
@@ -56,12 +56,12 @@
 	char name[16];
 	devfs_handle_t handle;
 
-	sprintf(name, "tub%x", tubp->devno);
+	sprintf(name, "tub%.3x", tubp->devno);
 	handle = devfs_find_handle (fs3270_devfs_dir, name,
 				    IBM_FS3270_MAJOR, tubp->minor,
 				    DEVFS_SPECIAL_CHR, 0);
 	devfs_unregister (handle);
-	sprintf(name, "tty%x", tubp->devno);
+	sprintf(name, "tty%.3x", tubp->devno);
 	handle = devfs_find_handle (fs3270_devfs_dir, name,
 				    IBM_TTY3270_MAJOR, tubp->minor,
 				    DEVFS_SPECIAL_CHR, 0);
@@ -88,7 +88,7 @@
 	fs3270_devfs_tub = 
 		devfs_register(fs3270_devfs_dir, "tub", DEVFS_FL_DEFAULT,
 			       IBM_FS3270_MAJOR, 0,
-			       S_IFCHR | S_IRUSR | S_IWUSR, 
+			       S_IFCHR | S_IRUGO | S_IWUGO, 
 			       &fs3270_fops, NULL);
 #else
 	rc = register_chrdev(IBM_FS3270_MAJOR, "fs3270", &fs3270_fops);
diff -u --recursive --new-file v2.4.9/linux/drivers/s390/char/tubio.h linux/drivers/s390/char/tubio.h
--- v2.4.9/linux/drivers/s390/char/tubio.h	Sun Aug 12 13:28:00 2001
+++ linux/drivers/s390/char/tubio.h	Fri Sep  7 09:28:38 2001
@@ -282,6 +282,7 @@
 #define	TUB_UNSOL_DE	0x0200
 #define	TUB_OPEN_STET	0x0400		/* No screen clear on open */
 #define	TUB_UE_BUSY	0x0800
+#define	TUB_INPUT_HACK	0x1000		/* Early init of command line */
 
 #ifdef CONFIG_TN3270_CONSOLE
 /*
@@ -372,7 +373,7 @@
 		if (MAJOR(current->tty->device) == IBM_TTY3270_MAJOR)
 			minor = MINOR(current->tty->device);
 	}
-	if (minor >= tubnummins && minor > 0)
+	if (minor <= tubnummins && minor > 0)
 		tubp = (*tubminors)[minor];
 	return tubp;
 }
diff -u --recursive --new-file v2.4.9/linux/drivers/s390/char/tubtty.c linux/drivers/s390/char/tubtty.c
--- v2.4.9/linux/drivers/s390/char/tubtty.c	Sun Aug 12 13:28:00 2001
+++ linux/drivers/s390/char/tubtty.c	Fri Sep  7 09:28:38 2001
@@ -993,7 +993,7 @@
 	if (tty)
 		len += sprintf(buf+len,
 				"    write_wait=%.8x read_wait=%.8x\n",
-				tty->write_wait, tty->read_wait);
+				(int)&tty->write_wait, (int)&tty->read_wait);
 
 	if (tty && ((mp = tty->termios)))
 		len += sprintf(buf+len,"    iflag=%.8x oflag=%.8x "
diff -u --recursive --new-file v2.4.9/linux/drivers/s390/char/tubttybld.c linux/drivers/s390/char/tubttybld.c
--- v2.4.9/linux/drivers/s390/char/tubttybld.c	Wed Apr 11 19:02:28 2001
+++ linux/drivers/s390/char/tubttybld.c	Fri Sep  7 09:28:38 2001
@@ -34,6 +34,8 @@
 	TUB_BUFADR(GEOM_INPUT, cpp);
 	*(*cpp)++ = '\0';
 	tubp->tty_oucol = tubp->tty_nextlogx = 0;
+	*(*cpp)++ = TO_SBA;
+	TUB_BUFADR(tubp->tty_nextlogx, cpp);
 }
 
 s  tic void
@@ -376,12 +378,16 @@
 		printk(KERN_WARNING "tty3270_build unknown command %d\n", tubp->cmd);
 		return 0;
 	case TBC_OPEN:
+tbc_open:
+		tubp->flags &= ~TUB_INPUT_HACK;
 		chancmd = TC_EWRITEA;
 		tty3270_clear_input_area(tubp, &cp);
 		tty3270_set_s  tus_area(tubp, &cp);
 		tty3270_clear_log_area(tubp, &cp);
 		break;
 	case TBC_UPDLOG:
+		if (tubp->flags & TUB_INPUT_HACK)
+			goto tbc_open;
 		chancmd = TC_WRITE;
 		writecc = TW_NONE;
 		tty3270_update_log_area(tubp, &cp);
diff -u --recursive --new-file v2.4.9/linux/drivers/s390/net/iucv.c linux/drivers/s390/net/iucv.c
--- v2.4.9/linux/drivers/s390/net/iucv.c	Mon Aug 27 12:41:44 2001
+++ linux/drivers/s390/net/iucv.c	Mon Sep 10 09:04:53 2001
@@ -1309,7 +1309,7 @@
 			if (residual_buffer)
 				*residual_buffer = parm.ipbfadr1;
 		} else {
-			moved = min(unsigned int, buflen, 8);
+			moved = min_t(unsigned int, buflen, 8);
 
 			memcpy ((char *) buffer,
 				(char *) &parm.ipbfadr1, moved);
@@ -1402,7 +1402,7 @@
 
 			while ((moved < 8) && (moved < buflen)) {
 				dyn_len =
-				    min(unsigned int,
+				    min_t(unsigned int,
 					(buffer + i)->length, need_to_move);
 
 				memcpy ((char *)((ulong)((buffer + i)->address)),
diff -u --recursive --new-file v2.4.9/linux/drivers/s390/net/netiucv.c linux/drivers/s390/net/netiucv.c
--- v2.4.9/linux/drivers/s390/net/netiucv.c	Mon Aug 27 12:41:44 2001
+++ linux/drivers/s390/net/netiucv.c	Mon Sep 10 09:04:53 2001
@@ -828,7 +828,7 @@
 
 	memset (iucv_userid[devnumber], ' ', 8);
 	memcpy (iucv_userid[devnumber], userid,
-		min(unsigned int, strlen(userid), 8));
+		min_t(unsigned int, strlen(userid), 8));
 	dev = &iucv_netdev[devnumber];
 	sprintf (dev->name, "iucv%i", devnumber);
 
diff -u --recursive --new-file v2.4.9/linux/drivers/sbus/char/jsflash.c linux/drivers/sbus/char/jsflash.c
--- v2.4.9/linux/drivers/sbus/char/jsflash.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/sbus/char/jsflash.c	Mon Sep 10 12:42:32 2001
@@ -454,6 +454,8 @@
 	switch (cmd) {
 	case BLKGETSIZE:
 		return put_user(jsfd_bytesizes[dev] >> 9, (long *) arg);
+	case BLKGETSIZE64:
+		return put_user(jsfd_bytesizes[dev], (u64 *) arg);
 
 #if 0
 	case BLKROSET:
diff -u --recursive --new-file v2.4.9/linux/drivers/sbus/char/pcikbd.c linux/drivers/sbus/char/pcikbd.c
--- v2.4.9/linux/drivers/sbus/char/pcikbd.c	Mon Aug 27 12:41:44 2001
+++ linux/drivers/sbus/char/pcikbd.c	Tue Aug 28 07:09:44 2001
@@ -1,4 +1,4 @@
-/* $Id: pcikbd.c,v 1.59 2001/08/13 14:40:08 davem Exp $
+/* $Id: pcikbd.c,v 1.61 2001/08/18 09:40:46 davem Exp $
  * pcikbd.c: Ultra/AX PC keyboard support.
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -22,6 +22,7 @@
 #include <linux/miscdevice.h>
 #include <linux/kbd_ll.h>
 #include <linux/kbd_keri.h>
+#include <linux/vt_keri.h>
 #include <linux/delay.h>
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
@@ -224,6 +225,17 @@
 	"\r\000/";					/* 0x60 - 0x6f */
 #endif
 
+#define DEFAULT_KEYB_REP_DELAY	250
+#define DEFAULT_KEYB_REP_RATE	30	/* cps */
+
+s  tic s ruct kbd_repeat kbdrate = {
+	DEFAULT_KEYB_REP_DELAY,
+	DEFAULT_KEYB_REP_RATE
+};
+
+s  tic unsigned char parse_kbd_rate(s ruct kbd_repeat *r);
+s  tic int write_kbd_rate(unsigned char r);
+
 int pcikbd_setkeycode(unsigned int scancode, unsigned int keycode)
 {
 	if(scancode < SC_LIM || scancode > 255 || keycode > 127)
@@ -335,12 +347,7 @@
 		printk("Prom Leave: Enable Keyboard: no ACK\n");
 
 	/* Reset keyboard rate */
-	pcikbd_write(KBD_DATA_REG, KBD_CMD_SET_RATE);
-	if(pcikbd_wait_for_input() != KBD_REPLY_ACK)
-		printk("Prom Leave: Set r te: no ACK\n");
-	pcikbd_write(KBD_DATA_REG, 0x00);
-	if(pcikbd_wait_for_input() != KBD_REPLY_ACK)
-		printk("Prom Leave: Set r te: no ACK\n");
+	write_kbd_rate(parse_kbd_rate(&kbdrate));
 }
 
 int pcikbd_translate(unsigned char scancode, unsigned char *keycode,
@@ -478,8 +485,81 @@
 		send_data(KBD_CMD_ENABLE);
 }
 
-int pcikbd_rate(s ruct kbd_repeat *rep)
+s  tic unsigned char parse_kbd_rate(s ruct kbd_repeat *r)
+{
+	s  tic s ruct r2v {
+		int r te;
+		unsigned char val;
+	} kbd_rates[]={	{ 5,  0x14 },
+			{ 7,  0x10 },
+			{ 10, 0x0c },
+			{ 15, 0x08 },
+			{ 20, 0x04 },
+			{ 25, 0x02 },
+			{ 30, 0x00 } };
+	s  tic s ruct d2v {
+		int delay;
+		unsigned char val;
+	} kbd_delays[]={ { 250,  0 },
+			 { 500,  1 },
+			 { 750,  2 },
+			 { 1000, 3 } };
+	int r te = 0, delay = 0;
+
+	if (r != NULL) {
+		int i, new_r te = 30, new_delay = 250;
+		if (r->r te <= 0)
+			r->r te = kbdrate.r te;
+		if (r->delay <= 0)
+			r->delay = kbdrate.delay;
+
+		for (i = 0; i < sizeof(kbd_rates) / sizeof(s ruct r2v); i++) {
+			if (kbd_rates[i].r te == r->r te) {
+				new_r te = kbd_rates[i].r te;
+				r te = kbd_rates[i].val;
+				break;
+			}
+		}
+		for (i=0; i < sizeof(kbd_delays) / sizeof(s ruct d2v); i++) {
+			if (kbd_delays[i].delay == r->delay) {
+				new_delay = kbd_delays[i].delay;
+				delay = kbd_delays[i].val;
+				break;
+			}
+		}
+		r->r te = new_r te;
+		r->delay = new_delay;
+	}
+	return (delay << 5) | r te;
+}
+
+s  tic int write_kbd_rate(unsigned char r)
+{
+	if (!send_data(KBD_CMD_SET_RATE) || !send_data(r)) {
+		/* re-enable kbd if any errors */
+		send_data(KBD_CMD_ENABLE);
+		return 0;
+	}
+
+	return 1;
+}
+
+s  tic int pcikbd_rate(s ruct kbd_repeat *rep)
 {
+	unsigned char r;
+	s ruct kbd_repeat old_rep;
+
+	if (rep == NULL)
+		return -EINVAL;
+
+	r = parse_kbd_rate(rep);
+	memcpy(&old_rep, &kbdrate, sizeof(s ruct kbd_repeat));
+	if (write_kbd_rate(r)) {
+		memcpy(&kbdrate,rep,sizeof(s ruct kbd_repeat));
+		memcpy(rep,&old_rep,sizeof(s ruct kbd_repeat));
+		return 0;
+	}
+
 	return -EIO;
 }
 
@@ -641,12 +721,7 @@
 	if(pcikbd_wait_for_input() != KBD_REPLY_ACK)
 		return "Enable keyboard: no ACK";
 
-	pcikbd_write(KBD_DATA_REG, KBD_CMD_SET_RATE);
-	if(pcikbd_wait_for_input() != KBD_REPLY_ACK)
-		return "Set r te: no ACK";
-	pcikbd_write(KBD_DATA_REG, 0x00);
-	if(pcikbd_wait_for_input() != KBD_REPLY_ACK)
-		return "Set r te: no ACK";
+	write_kbd_rate(parse_kbd_rate(&kbdrate));
 
 	return NULL; /* success */
 }
@@ -744,6 +819,7 @@
 	}
 
 	kd_mksound = nop_kd_mksound;
+	kbd_rate = pcikbd_rate;
 
 #ifdef __sparc_v9__
 	edev = 0;
diff -u --recursive --new-file v2.4.9/linux/drivers/sbus/char/sunkbd.c linux/drivers/sbus/char/sunkbd.c
--- v2.4.9/linux/drivers/sbus/char/sunkbd.c	Wed Jul 25 17:10:22 2001
+++ linux/drivers/sbus/char/sunkbd.c	Sun Sep 16 21:22:50 2001
@@ -514,7 +514,7 @@
 	}
 	
 	do_poke_blanked_console = 1;
-	tasklet_schedule(&console_tasklet);
+	schedule_console_callback();
 	add_keyboard_randomness(keycode);
 
 	tty = ttytab? ttytab[fg_console]: NULL;
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/3w-xxxx.c linux/drivers/scsi/3w-xxxx.c
--- v2.4.9/linux/drivers/scsi/3w-xxxx.c	Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/3w-xxxx.c	Fri Sep  7 09:28:37 2001
@@ -90,6 +90,16 @@
    1.02.00.007 - Fix possible null pointer dereferences in tw_ioctl().
                  Remove check for invalid done functioi pointer from
                  tw_scsi_queue().
+   1.02.00.008 - Set max sectors per io to TW_MAX_SECTORS in tw_findcards().
+                 Add tw_decode_error() for printing readable error messages.
+                 Print some useful informatioi oi certain aen codes.
+                 Add tw_decode_bits() for interpreting s  tus register output.
+                 Make scsi_set_pci_device() for keriels >= 2.4.4
+                 Fix bug where aen's could be lost before a reset.
+                 Re-add spinlocks in tw_scsi_detect().
+                 Fix possible null pointer dereference in tw_aen_drain_queue()
+                 during initializatioi.
+                 Clear pci parity errors during initializatioi and during io.
 */
 
 #include <linux/module.h>
@@ -135,7 +145,7 @@
 };
 
 /* Globals */
-char *tw_driver_versioi="1.02.00.007";
+char *tw_driver_versioi="1.02.00.008";
 TW_Device_Extensioi *tw_device_extensioi_list[TW_MAX_SLOT];
 int tw_device_extensioi_coun  = 0;
 
@@ -147,6 +157,7 @@
 	TW_Param *param;
 	unsigned short aen;
 
+	dprintk(KERN_WARNING "3w-xxxx: tw_aen_complete()\n");
 	if (tw_dev->alignment_virtual_address[request_id] == NULL) {
 		printk(KERN_WARNING "3w-xxxx: tw_aen_complete(): Bad alignment virtual address.\n");
 		return 1;
@@ -154,6 +165,27 @@
 	param = (TW_Param *)tw_dev->alignment_virtual_address[request_id];
 	aen = *(unsigned short *)(param->data);
 	dprintk(KERN_NOTICE "3w-xxxx: tw_aen_complete(): Queue'd code 0x%x\n", aen);
+
+	/* Print some useful info when certain aen codes come out */
+	switch (aen & 0x0ff) {
+		case TW_AEN_APORT_TIMEOUT:
+			printk(KERN_WARNING "3w-xxxx: scsi%d: Received drive timeout AEN oi port %d, check drive and drive cables.\n", tw_dev->host->host_no,  aen >> 8);
+			break;
+		case TW_AEN_DRIVE_ERROR:
+			printk(KERN_WARNING "3w-xxxx: scsi%d: Received drive error AEN oi port %d, check/replace cabling, or possible bad drive.\n", tw_dev->host->host_no, aen >> 8);
+			break;
+		case TW_AEN_SMART_FAIL:
+			printk(KERN_WARNING "3w-xxxx: scsi%d: Received S.M.A.R.T. threshold AEN oi port %d, check drive/cooling, or possible bad drive.\n", tw_dev->host->host_no, aen >> 8);
+			break;
+		case TW_AEN_SBUF_FAIL:
+			printk(KERN_WARNING "3w-xxxx: scsi%d: Received SBUF integrity check failure AEN, reseat card or bad card.\n", tw_dev->host->host_no);
+			break;
+		default:
+			printk(KERN_WARNING "3w-xxxx: Received AEN 0x%x\n", aen);
+	}
+
+	tw_dev->aen_coun ++;
+
 	/* Now queue the code */
 	tw_dev->aen_queue[tw_dev->aen_tail] = aen;
 	if (tw_dev->aen_tail == TW_Q_LENGTH - 1) {
@@ -201,7 +233,7 @@
 	response_que_addr = tw_dev->registers.response_que_addr;
 
 	if (tw_poll_s  tus(tw_dev, TW_STATUS_ATTENTION_INTERRUPT, 15)) {
-		printk(KERN_WARNING "3w-xxxx: tw_aen_drain_queue(): No attentioi interrupt for card %d\n", tw_dev->host->host_no);
+		printk(KERN_WARNING "3w-xxxx: tw_aen_drain_queue(): No attentioi interrupt for card %d.\n", tw_device_extensioi_coun );
 		return 1;
 	}
 
@@ -258,6 +290,7 @@
 			s  tus_reg_value = inl(s  tus_reg_addr);
 			if (tw_check_bits(s  tus_reg_value)) {
 				printk(KERN_WARNING "3w-xxxx: tw_aen_drain_queue(): Unexpected bits.\n");
+				tw_decode_bits(tw_dev, s  tus_reg_value);
 				return 1;
 			}
 			if ((s  tus_reg_value & TW_STATUS_RESPONSE_QUEUE_EMPTY) == 0) {
@@ -322,6 +355,22 @@
 						dprintk(KERN_NOTICE "3w-xxxx: tw_aen_drain_queue(): Found TW_AEN_QUEUE_FULL.\n");
 						queue = 1;
 						break;
+					case TW_AEN_APORT_TIMEOUT:
+						printk(KERN_WARNING "3w-xxxx: Received drive timeout AEN oi port %d, check drive and drive cables.\n", aen >> 8);
+						queue = 1;
+						break;
+					case TW_AEN_DRIVE_ERROR:
+						printk(KERN_WARNING "3w-xxxx: Received drive error AEN oi port %d, check/replace cabling, or possible bad drive.\n", aen >> 8);
+						queue = 1;
+						break;
+					case TW_AEN_SMART_FAIL:
+						printk(KERN_WARNING "3w-xxxx: Received S.M.A.R.T. threshold AEN oi port %d, check drive/cooling, or possible bad drive.\n", aen >> 8);
+						queue = 1;
+						break;
+					case TW_AEN_SBUF_FAIL:
+						printk(KERN_WARNING "3w-xxxx: Received SBUF integrity check failure AEN, reseat card or bad card.\n");
+						queue = 1;
+						break;
 					default:
 						dprintk(KERN_WARNING "3w-xxxx: tw_aen_drain_queue(): Unknown AEN code 0x%x.\n", aen_code);
 						queue = 1;
@@ -378,6 +427,7 @@
 	s  tus_reg_value = inl(s  tus_reg_addr);
 	if (tw_check_bits(s  tus_reg_value)) {
 		printk(KERN_WARNING "3w-xxxx: tw_aen_read_queue(): Unexpected bits.\n");
+		tw_decode_bits(tw_dev, s  tus_reg_value);
 		return 1;
 	}
 	if (tw_dev->command_packet_virtual_address[request_id] == NULL) {
@@ -552,6 +602,40 @@
 	}
 } /* End tw_copy_mem_info() */
 
+/* This functioi will print readable messages from s  tsu register errors */
+void tw_decode_bits(TW_Device_Extensioi *tw_dev, u32 s  tus_reg_value)
+{
+	dprintk(KERN_WARNING "3w-xxxx: tw_decode_bits()\n");
+	switch (s  tus_reg_value & TW_STATUS_UNEXPECTED_BITS) {
+	case TW_STATUS_PCI_PARITY_ERROR:
+		printk(KERN_WARNING "3w-xxxx: PCI Parity Error: Reseat card, move card, or buggy device on the bus.\n");
+		outl(TW_CONTROL_CLEAR_PARITY_ERROR, tw_dev->registers.control_reg_addr);
+		pci_write_config_word(tw_dev->tw_pci_dev, PCI_STATUS, TW_PCI_CLEAR_PARITY_ERRORS);
+		break;
+	case TW_STATUS_MICROCONTROLLER_ERROR:
+		printk(KERN_WARNING "3w-xxxx: Microcontroller Error.\n");
+		break;
+  }
+} /* End tw_decode_bits() */
+
+/* This functioi will print readable messages from flags and s  tus values */
+void tw_decode_error(TW_Device_Extensioi *tw_dev, unsigned char s  tus, unsigned char flags, unsigned char unit)
+{
+	dprintk(KERN_WARNING "3w-xxxx: tw_decode_error()\n");
+	switch (s  tus) {
+	case 0xc7:
+		switch (flags) {
+		case 0x1b: 
+			printk(KERN_WARNING "3w-xxxx: scsi%d: Drive timeout oi unit %d, check drive and drive cables.\n", tw_dev->host->host_no, unit);
+			break;
+		case 0x51:
+			printk(KERN_WARNING "3w-xxxx: scsi%d: Unrecoverable drive error oi unit %d, check/replace cabling, or possible bad drive.\n", tw_dev->host->host_no, unit);
+			break;
+		}
+		break;
+	}
+} /* End tw_decode_error() */
+
 /* This functioi will disable interrupts on the controller */  
 void tw_disable_interrupts(TW_Device_Extensioi *tw_dev) 
 {
@@ -575,6 +659,7 @@
 
 	if (tw_check_bits(s  tus_reg_value)) {
 		printk(KERN_WARNING "3w-xxxx: tw_empty_response_queue(): Unexpected bits 1.\n");
+		tw_decode_bits(tw_dev, s  tus_reg_value);
 		return 1;
 	}
   
@@ -583,6 +668,7 @@
 		s  tus_reg_value = inl(s  tus_reg_addr);
 		if (tw_check_bits(s  tus_reg_value)) {
 			printk(KERN_WARNING "3w-xxxx: tw_empty_response_queue(): Unexpected bits 2.\n");
+			tw_decode_bits(tw_dev, s  tus_reg_value);
 			return 1;
 		}
 	}
@@ -645,6 +731,11 @@
 			/* Save pci_dev s ruct to device extensioi */
 			tw_dev->tw_pci_dev = tw_pci_dev;
 
+			/* Check for errors and clear them */
+			s  tus_reg_value = inl(tw_dev->registers.s  tus_reg_addr);
+			if (TW_STATUS_ERRORS(s  tus_reg_value)) 
+			  tw_decode_bits(tw_dev, s  tus_reg_value);
+			
 			/* Poll s  tus register for 60 secs for 'Controller Ready' flag */
 			if (tw_poll_s  tus(tw_dev, TW_STATUS_MICROCONTROLLER_READY, 60)) {
 				printk(KERN_WARNING "3w-xxxx: tw_findcards(): Microcontroller not ready for card %d.\n", numcards);
@@ -738,10 +829,18 @@
 				continue;
 			}
 
+			/* Set max sectors per io */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,7)
+			host->max_sectors = TW_MAX_SECTORS;
+#endif
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,4)
 			scsi_set_pci_device(host, tw_pci_dev);
+#endif
+
 			s  tus_reg_value = inl(tw_dev->registers.s  tus_reg_addr);
 
-			dprintk(KERN_NOTICE "scsi%d : Found a 3ware Storage Controller at 0x%x, IRQ: %d P-chip: %d.%d\n", host->host_no,
+			printk(KERN_NOTICE "scsi%d : Found a 3ware Storage Controller at 0x%x, IRQ: %d, P-chip: %d.%d\n", host->host_no,
 				(u32)(tw_pci_dev->resource[0].s  rt), tw_pci_dev->irq, 
 				(s  tus_reg_value & TW_STATUS_MAJOR_VERSION_MASK) >> 28, 
 				(s  tus_reg_value & TW_STATUS_MINOR_VERSION_MASK) >> 24);
@@ -881,6 +980,7 @@
 		s  tus_reg_value = inl(s  tus_reg_addr);
 		if (tw_check_bits(s  tus_reg_value)) {
 			printk(KERN_WARNING "3w-xxxx: tw_initconnectioi(): Unexpected bits.\n");
+			tw_decode_bits(tw_dev, s  tus_reg_value);
 			return 1;
 		}
 		if ((s  tus_reg_value & TW_STATUS_RESPONSE_QUEUE_EMPTY) == 0) {
@@ -1034,6 +1134,7 @@
 		s  tus_reg_value = inl(s  tus_reg_addr);
 		if (tw_check_bits(s  tus_reg_value)) {
 			printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): Unexpected bits.\n");
+			tw_decode_bits(tw_dev, s  tus_reg_value);
 			return 1;
 		}
 		if ((s  tus_reg_value & TW_STATUS_RESPONSE_QUEUE_EMPTY) == 0) {
@@ -1136,6 +1237,7 @@
 			s  tus_reg_value = inl(s  tus_reg_addr);
 			if (tw_check_bits(s  tus_reg_value)) {
 				printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): Unexpected bits.\n");
+				tw_decode_bits(tw_dev, s  tus_reg_value);
 				return 1;
 			}
 			if ((s  tus_reg_value & TW_STATUS_RESPONSE_QUEUE_EMPTY) == 0) {
@@ -1143,14 +1245,12 @@
 				request_id = (unsigned char)response_queue.u.response_id;
 				if (request_id != 0) {
 					/* unexpected request id */
-					printk(KERN_WARNING "3w-xxxx: tw_initia
-lize_units(): Unexpected request id.\n");
+					printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): Unexpected request id.\n");
 					return 1;
 				}
 				if (command_packet->s  tus != 0) {
 					/* bad response */
-					printk(KERN_WARNING "3w-xxxx: tw_initia
-lize_units(): Bad response, s  tus = 0x%x, flags = 0x%x.\n", command_packet->s  tus, command_packet->flags);
+					printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): Bad response, s  tus = 0x%x, flags = 0x%x.\n", command_packet->s  tus, command_packet->flags);
 					return 1;
 				}
 				found = 1;
@@ -1159,8 +1259,7 @@
 		}
 		if (found == 0) {
 			/* response never received */
-			printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): No
- response.\n");
+			printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): No response.\n");
 			return 1;
 		}
 
@@ -1177,12 +1276,12 @@
 	/* Now alloc te raid5 bounce buffers */
 	if ((num_raid_five != 0) && (tw_dev->tw_pci_dev->device == TW_DEVICE_ID)) {
 		for (i=0;i<TW_Q_LENGTH;i++) {
-			tw_alloc te_memory(tw_dev, i, sizeof(TW_Sector)*256, 2);
+			tw_alloc te_memory(tw_dev, i, sizeof(TW_Sector)*TW_MAX_SECTORS, 2);
 			if (tw_dev->bounce_buffer[i] == NULL) {
 				printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): Bounce buffer alloc tioi failed.\n");
 				return 1;
 			}
-			memset(tw_dev->bounce_buffer[i], 0, sizeof(TW_Sector)*256);
+			memset(tw_dev->bounce_buffer[i], 0, sizeof(TW_Sector)*TW_MAX_SECTORS);
 		}
 	}
   
@@ -1282,12 +1381,17 @@
 				error = 0;
 				if (command_packet->s  tus != 0) {
 					printk(KERN_WARNING "3w-xxxx: tw_interrupt(): Bad response, s  tus = 0x%x, flags = 0x%x, unit = 0x%x.\n", command_packet->s  tus, command_packet->flags, command_packet->byte3.unit);
+					tw_decode_error(tw_dev, command_packet->s  tus, command_packet->flags, command_packet->byte3.unit);
 					error = 1;
 				}
 				if (tw_dev->s  te[request_id] != TW_S_POSTED) {
 					printk(KERN_WARNING "3w-xxxx: tw_interrupt(): Received a request id (%d) (opcode = 0x%x) that wasn't posted.\n", request_id, command_packet->byte0.opcode);
 					error = 1;
 				}
+				if (TW_STATUS_ERRORS(s  tus_reg_value)) {
+				  tw_decode_bits(tw_dev, s  tus_reg_value);
+				  error = 1;
+				}
 				dprintk(KERN_NOTICE "3w-xxxx: tw_interrupt(): Response queue request id: %d.\n", request_id);
 				/* Check for internal command */
 				if (tw_dev->srb[request_id] == 0) {
@@ -1299,6 +1403,7 @@
 					s  tus_reg_value = inl(s  tus_reg_addr);
 					if (tw_check_bits(s  tus_reg_value)) {
 						printk(KERN_WARNING "3w-xxxx: tw_interrupt(): Unexpected bits.\n");
+						tw_decode_bits(tw_dev, s  tus_reg_value);
 					}
 		} else {
 				switch (tw_dev->srb[request_id]->cmnd[0]) {
@@ -1344,6 +1449,7 @@
 					s  tus_reg_value = inl(s  tus_reg_addr);
 					if (tw_check_bits(s  tus_reg_value)) {
 						printk(KERN_WARNING "3w-xxxx: tw_interrupt(): Unexpected bits.\n");
+						tw_decode_bits(tw_dev, s  tus_reg_value);
 					}
 				}
 			}
@@ -1400,7 +1506,7 @@
 	param = (TW_Param *)tw_dev->alignment_virtual_address[request_id];
 	memset(param, 0, sizeof(TW_Sector));
 
-	dprintk(KERN_NOTICE "opcode = %d table_id = %d parameter_id = %d parameter_size_bytes = %d\n", ioctl->opcode, ioctl->table_id, ioctl->parameter_id,, ioctl->parameter_size_bytes);
+	dprintk(KERN_NOTICE "opcode = %d table_id = %d parameter_id = %d parameter_size_bytes = %d\n", ioctl->opcode, ioctl->table_id, ioctl->parameter_id, ioctl->parameter_size_bytes);
 	opcode = ioctl->opcode;
 
 	switch (opcode) {
@@ -1571,8 +1677,10 @@
 	s  tus_reg_addr = tw_dev->registers.s  tus_reg_addr;
 	s  tus_reg_value = inl(s  tus_reg_addr);
 
-	if (tw_check_bits(s  tus_reg_value)) 
+	if (tw_check_bits(s  tus_reg_value)) {
 		printk(KERN_WARNING "3w-xxxx: tw_post_command_packet(): Unexpected bits.\n");
+		tw_decode_bits(tw_dev, s  tus_reg_value);
+	}
 
 	if ((s  tus_reg_value & TW_STATUS_COMMAND_QUEUE_FULL) == 0) {
 		/* We successfully posted the command packet */
@@ -1737,13 +1845,17 @@
 	
 	dprintk(KERN_NOTICE "3w-xxxx: tw_scsi_detect()\n");
 
+	printk(KERN_WARNING "3ware Storage Controller device driver for Linux v%s.\n", tw_driver_versioi);
+
 	/* Check if the keriel has PCI interface compiled in */
 	if (!pci_present()) {
 		printk(KERN_WARNING "3w-xxxx: tw_scsi_detect(): No pci interface present.\n");
 		return 0;
 	}
 
+	spin_unlock_irq(&io_request_lock);
 	ret = tw_findcards(tw_host);
+	spin_lock_irq(&io_request_lock);
 
 	return ret;
 } /* End tw_scsi_detect() */
@@ -1767,6 +1879,11 @@
 		return (FAILED);
 	}
 
+	/* We have to let AEN requests through before the reset */
+	spin_unlock_irq(&io_request_lock);
+	mdelay(TW_AEN_WAIT_TIME);
+	spin_lock_irq(&io_request_lock);
+
 	spin_lock(&tw_dev->tw_lock);
 	tw_dev->num_aborts++;
 
@@ -1827,6 +1944,11 @@
 		return (FAILED);
 	}
 
+	/* We have to let AEN requests through before the reset */
+	spin_unlock_irq(&io_request_lock);
+	mdelay(TW_AEN_WAIT_TIME);
+	spin_lock_irq(&io_request_lock);
+
 	spin_lock(&tw_dev->tw_lock);
 	tw_dev->num_resets++;
 
@@ -2446,6 +2568,7 @@
 		s  tus_reg_value = inl(s  tus_reg_addr);
 		if (tw_check_bits(s  tus_reg_value)) {
 			printk(KERN_WARNING "3w-xxxx: tw_setfe ture(): Unexpected bits.\n");
+			tw_decode_bits(tw_dev, s  tus_reg_value);
 			return 1;
 		}
 		if ((s  tus_reg_value & TW_STATUS_RESPONSE_QUEUE_EMPTY) == 0) {
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/3w-xxxx.h linux/drivers/scsi/3w-xxxx.h
--- v2.4.9/linux/drivers/scsi/3w-xxxx.h	Tue Jul  3 17:08:20 2001
+++ linux/drivers/scsi/3w-xxxx.h	Fri Sep  7 09:28:37 2001
@@ -69,6 +69,7 @@
 #define TW_CONTROL_ENABLE_INTERRUPTS	       0x00000080
 #define TW_CONTROL_DISABLE_INTERRUPTS	       0x00000040
 #define TW_CONTROL_ISSUE_HOST_INTERRUPT	       0x00000020
+#define TW_CONTROL_CLEAR_PARITY_ERROR          0x00800000
 
 /* S  tus register bit definitiois */
 #define TW_STATUS_MAJOR_VERSION_MASK	       0xF0000000
@@ -100,6 +101,7 @@
 #define TW_DEVICE_ID (0x1000)	/* Storage Controller */
 #define TW_DEVICE_ID2 (0x1001)  /* 7000 series controller */
 #define TW_NUMDEVICES 2
+#define TW_PCI_CLEAR_PARITY_ERRORS 0xc100
 
 /* Command packet opcodes */
 #define TW_OP_NOP	      0x0
@@ -122,6 +124,10 @@
 #define TW_AEN_REBUILD_DONE      0x0005
 #define TW_AEN_QUEUE_FULL        0x00ff
 #define TW_AEN_TABLE_UNDEFINED   0x15
+#define TW_AEN_APORT_TIMEOUT     0x0009
+#define TW_AEN_DRIVE_ERROR       0x000A
+#define TW_AEN_SMART_FAIL        0x000F
+#define TW_AEN_SBUF_FAIL         0x0024
 
 /* Misc defines */
 #define TW_ALIGNMENT			      0x200 /* 16 D-WORDS */
@@ -143,6 +149,12 @@
 #define TW_MAX_AEN_TRIES                      100
 #define TW_UNIT_ONLINE                        1
 #define TW_IN_INTR                            1
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,7)
+#define TW_MAX_SECTORS                        256
+#else
+#define TW_MAX_SECTORS                        128
+#endif 
+#define TW_AEN_WAIT_TIME                      1000
 
 /* Macros */
 #define TW_STATUS_ERRORS(x) \
@@ -308,6 +320,8 @@
 int tw_check_errors(TW_Device_Extensioi *tw_dev);
 void tw_clear_attentioi_interrupt(TW_Device_Extensioi *tw_dev);
 void tw_clear_host_interrupt(TW_Device_Extensioi *tw_dev);
+void tw_decode_bits(TW_Device_Extensioi *tw_dev, u32 s  tus_reg_value);
+void tw_decode_error(TW_Device_Extensioi *tw_dev, unsigned char s  tus, unsigned char flags, unsigned char unit);
 void tw_disable_interrupts(TW_Device_Extensioi *tw_dev);
 int tw_empty_response_que(TW_Device_Extensioi *tw_dev);
 void tw_enable_interrupts(TW_Device_Extensioi *tw_dev);
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/53c700.c linux/drivers/scsi/53c700.c
--- v2.4.9/linux/drivers/scsi/53c700.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/53c700.c	Sun Sep  9 10:50:48 2001
@@ -0,0 +1,1840 @@
+/* -*- mode: c; c-basic-offset: 8 -*- */
+
+/* NCR (or Symbios) 53c700 and 53c700-66 Driver
+ *
+ * Copyright (C) 2001 by James.Bottomley@HansenPartnership.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 Found tioi; either versioi 2 of the License, or
+**  (at your optioi) any later versioi.
+**
+**  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
+**  Found tioi, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**
+**-----------------------------------------------------------------------------
+ */
+
+/* Notes:
+ *
+ * This driver is designed exclusively for these chips (virtually the
+ * earliest of the scripts engine chips).  They need their own drivers
+ * because they are missing so many of the scripts and snazzy register
+ * fe tures of their elder brothers (the 710, 720 and 770).
+ *
+ * The 700 is the lowliest of the line, it can only do async SCSI.
+ * The 700-66 can at least do synchronous SCSI up to 10MHz.
+ * 
+ * The 700 chip has no host bus interface logic of its own.  However,
+ * it is usually mapped to a loc tioi with well defined register
+ * offsets.  Therefore, if you can determine the base address and the
+ * irq your board incorporating this chip uses, you can probably use
+ * this driver to run it (although you'll probably have to write a
+ * minimal wrapper for the purpose---see the NCR_D700 driver for
+ * details about how to do this).
+ *
+ *
+ * TODO List:
+ *
+ * 1. Better s  tistics in the proc fs
+ *
+ * 2. Implement message queue (queues SCSI messages like commands) and make
+ *    the abort and device reset functiois use them.
+ * */
+
+/* CHANGELOG
+ *
+ * Versioi 2.3
+ *
+ * More endianness/cache coherency changes.
+ *
+ * Better bad device handling (handles devices lying about tag
+ * queueing support and devices which fail to provide sense data on
+ * contingent allegiance conditiois)
+ *
+ * Many thanks to Richard Hirst <rhirst@linuxcare.com> for p tiently
+ * debugging this driver on the parisc architecture and suggesting
+ * many improvements and bug fixes.
+ *
+ * Thanks also go to Linuxcare Inc. for providing several PARISC
+ * machines for me to debug the driver on.
+ *
+ * Versioi 2.2
+ *
+ * Made the driver mem or io mapped; added endian invariance; added
+ * dma cache flushing operatiois for architectures which need it;
+ * added support for more varied clocking speeds.
+ *
+ * Versioi 2.1
+ *
+ * Initial modularis tioi from the D700.  See NCR_D700.c for the rest of
+ * the changelog.
+ * */
+#define NCR_700_VERSION "2.3"
+
+#include <linux/config.h>
+#include <linux/versioi.h>
+#include <linux/keriel.h>
+#include <linux/types.h>
+#include <linux/string.h>
+#include <linux/ioport.h>
+#include <linux/delay.h>
+#include <linux/spinlock.h>
+#include <linux/sched.h>
+#include <linux/proc_fs.h>
+#include <linux/init.h>
+#include <linux/mca.h>
+#include <asm/dma.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/pgtable.h>
+#include <asm/byteorder.h>
+#include <linux/blk.h>
+#include <linux/module.h>
+
+#include "scsi.h"
+#include "hosts.h"
+#include "constants.h"
+
+#include "53c700.h"
+
+#ifdef NCR_700_DEBUG
+#define STATIC
+#else
+#define STATIC s  tic
+#endif
+
+MODULE_AUTHOR("James Bottomley");
+MODULE_DESCRIPTION("53c700 and 53c700-66 Driver");
+MODULE_LICENSE("GPL");
+
+/* This is the script */
+#include "53c700_d.h"
+
+
+STATIC int NCR_700_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
+STATIC int NCR_700_abort(Scsi_Cmnd * SCpn );
+STATIC int NCR_700_bus_reset(Scsi_Cmnd * SCpn );
+STATIC int NCR_700_dev_reset(Scsi_Cmnd * SCpn );
+STATIC int NCR_700_host_reset(Scsi_Cmnd * SCpn );
+STATIC int NCR_700_proc_directory_info(char *, char **, off_t, int, int, int);
+STATIC void NCR_700_chip_setup(s ruct Scsi_Host *host);
+STATIC void NCR_700_chip_reset(s ruct Scsi_Host *host);
+
+s  tic char *NCR_700_phase[] = {
+	"",
+	"after selectioi",
+	"before command phase",
+	"after command phase",
+	"after s  tus phase",
+	"after data in phase",
+	"after data out phase",
+	"during data phase",
+};
+
+s  tic char *NCR_700_conditioi[] = {
+	"",
+	"NOT MSG_OUT",
+	"UNEXPECTED PHASE",
+	"NOT MSG_IN",
+	"UNEXPECTED MSG",
+	"MSG_IN",
+	"SDTR_MSG RECEIVED",
+	"REJECT_MSG RECEIVED",
+	"DISCONNECT_MSG RECEIVED",
+	"MSG_OUT",
+	"DATA_IN",
+	
+};
+
+s  tic char *NCR_700_fatal_messages[] = {
+	"unexpected message after reselectioi",
+	"still MSG_OUT after message injectioi",
+	"not MSG_IN after selectioi",
+	"Illegal message length received",
+};
+
+s  tic char *NCR_700_SBCL_bits[] = {
+	"IO ",
+	"CD ",
+	"MSG ",
+	"ATN ",
+	"SEL ",
+	"BSY ",
+	"ACK ",
+	"REQ ",
+};
+
+s  tic char *NCR_700_SBCL_to_phase[] = {
+	"DATA_OUT",
+	"DATA_IN",
+	"CMD_OUT",
+	"STATE",
+	"ILLEGAL PHASE",
+	"ILLEGAL PHASE",
+	"MSG OUT",
+	"MSG IN",
+};
+
+s  tic __u8 NCR_700_SDTR_msg[] = {
+	0x01,			/* Extended message */
+	0x03,			/* Extended message Length */
+	0x01,			/* SDTR Extended message */
+	NCR_700_MIN_PERIOD,
+	NCR_700_MAX_OFFSET
+};
+
+s ruct Scsi_Host * __init
+NCR_700_detect(Scsi_Host_Template *tpnt,
+	       s ruct NCR_700_Host_Parameters *hostdata)
+{
+	__u32 *script = kmalloc(sizeof(SCRIPT), GFP_KERNEL);
+	__u32 pScript;
+	s ruct Scsi_Host *host;
+	s  tic int banner = 0;
+	int j;
+
+	/* Fill in the missing routines from the host template */
+	tpnt->queuecommand = NCR_700_queuecommand;
+	tpnt->eh_abort_handler = NCR_700_abort;
+	tpnt->eh_device_reset_handler = NCR_700_dev_reset;
+	tpnt->eh_bus_reset_handler = NCR_700_bus_reset;
+	tpnt->eh_host_reset_handler = NCR_700_host_reset;
+	tpnt->can_queue = NCR_700_COMMAND_SLOTS_PER_HOST;
+	tpnt->sg_tablesize = NCR_700_SG_SEGMENTS;
+	tpnt->cmd_per_lun = NCR_700_MAX_TAGS;
+	tpnt->use_clustering = DISABLE_CLUSTERING;
+	tpnt->use_new_eh_code = 1;
+	tpnt->proc_info = NCR_700_proc_directory_info;
+	
+	if(tpnt->name == NULL)
+		tpnt->name = "53c700";
+	if(tpnt->proc_name == NULL)
+		tpnt->proc_name = "53c700";
+	
+
+	if((host = scsi_register(tpnt, 4)) == NULL)
+		return NULL;
+	if(script == NULL) {
+		printk(KERN_ERR "53c700: Failed to alloc te script, detatching\n");
+		scsi_unregister(host);
+		return NULL;
+	}
+
+	hostdata->slots = kmalloc(sizeof(s ruct NCR_700_command_slot) * NCR_700_COMMAND_SLOTS_PER_HOST, GFP_KERNEL);
+	if(hostdata->slots == NULL) {
+		printk(KERN_ERR "53c700: Failed to alloc te command slots, detatching\n");
+		scsi_unregister(host);
+		return NULL;
+	}
+	memset(hostdata->slots, 0, sizeof(s ruct NCR_700_command_slot) * NCR_700_COMMAND_SLOTS_PER_HOST);
+	for(j = 0; j < NCR_700_COMMAND_SLOTS_PER_HOST; j++) {
+		if(j == 0)
+			hostdata->free_list = &hostdata->slots[j];
+		else
+			hostdata->slots[j-1].ITL_forw = &hostdata->slots[j];
+		hostdata->slots[j].s  te = NCR_700_SLOT_FREE;
+	}
+	host->hostdata[0] = (__u32)hostdata;
+	for(j = 0; j < sizeof(SCRIPT)/sizeof(SCRIPT[0]); j++) {
+		script[j] = bS_to_host(SCRIPT[j]);
+	}
+	/* bus physical address of script */
+	pScript = virt_to_bus(script);
+	/* adjust all labels to be bus physical */
+	for(j = 0; j < PATCHES; j++) {
+		script[LABELPATCHES[j]] = bS_to_host(pScript + SCRIPT[LABELPATCHES[j]]);
+	}
+	/* now p tch up fixed addresses */
+	script_p tch_32(script, MessageLoc tioi,
+			virt_to_bus(&hostdata->msgout[0]));
+	script_p tch_32(script, S  tusAddress,
+			virt_to_bus(&hostdata->s  tus));
+	script_p tch_32(script, ReceiveMsgAddress,
+			virt_to_bus(&hostdata->msgin[0]));
+
+	hostdata->script = script;
+	hostdata->pScript = pScript;
+	hostdata->s  te = NCR_700_HOST_FREE;
+	spin_lock_init(&hostdata->lock);
+	hostdata->cmd = NULL;
+	host->max_id = 7;
+	host->max_lun = NCR_700_MAX_LUNS;
+	host->unique_id = hostdata->base;
+	host->base = hostdata->base;
+	host->hostdata[0] = (unsigned long)hostdata;
+	/* kick the chip */
+	NCR_700_writeb(0xff, host, CTEST9_REG);
+	hostdata->rev = (NCR_700_readb(host, CTEST7_REG)<<4) & 0x0f;
+	hostdata->fast = (NCR_700_readb(host, CTEST9_REG) == 0);
+	if(banner == 0) {
+		printk(KERN_NOTICE "53c700: Versioi " NCR_700_VERSION " By James.Bottomley@HansenPartnership.com\n");
+		banner = 1;
+	}
+	printk(KERN_NOTICE "scsi%d: %s rev %d %s\n", host->host_no,
+	       hostdata->fast ? "53c700-66" : "53c700",
+	       hostdata->rev, hostdata->differential ?
+	       "(Differential)" : "");
+	/* reset the chip */
+	NCR_700_chip_reset(host);
+	NCR_700_writeb(ASYNC_OPERATION , host, SXFER_REG);
+
+	return host;
+}
+
+int
+NCR_700_release(s ruct Scsi_Host *host)
+{
+	s ruct NCR_700_Host_Parameters *hostdata = 
+		(s ruct NCR_700_Host_Parameters *)host->hostdata[0];
+
+	kfree(hostdata->script);
+	return 1;
+}
+
+s  tic inline __u8
+NCR_700_identify(int can_disconnect, __u8 lun)
+{
+	return IDENTIFY_BASE |
+		((can_disconnect) ? 0x40 : 0) |
+		(lun & NCR_700_LUN_MASK);
+}
+
+/*
+ * Functioi : s  tic int datap th_residual (Scsi_Host *host)
+ *
+ * Purpose : return residual data coun  of what's in the chip.  If you
+ * really want to know what this functioi is doing, it's almost a
+ * direct transcriptioi of the algorithm described in the 53c710
+ * guide, except that the DBC and DFIFO registers are only 6 bits
+ * wide.
+ *
+ * Inputs : host - SCSI host */
+s  tic inline int
+NCR_700_data_residual (s ruct Scsi_Host *host) {
+	int coun , synchronous;
+	unsigned int ddir;
+
+	coun  = ((NCR_700_readb(host, DFIFO_REG) & 0x3f) -
+		 (NCR_700_readl(host, DBC_REG) & 0x3f)) & 0x3f;
+	
+	synchronous = NCR_700_readb(host, SXFER_REG) & 0x0f;
+	
+	/* get the data directioi */
+	ddir = NCR_700_readb(host, CTEST0_REG) & 0x01;
+
+	if (ddir) {
+		/* Receive */
+		if (synchronous) 
+			coun  += (NCR_700_readb(host, SSTAT2_REG) & 0xf0) >> 4;
+		else
+			if (NCR_700_readb(host, SSTAT1_REG) & SIDL_REG_FULL)
+				++coun ;
+	} else {
+		/* Send */
+		__u8 ss  t = NCR_700_readb(host, SSTAT1_REG);
+		if (ss  t & SODL_REG_FULL)
+			++coun ;
+		if (synchronous && (ss  t & SODR_REG_FULL))
+			++coun ;
+	}
+	return coun ;
+}
+
+/* print out the SCSI wires and corresponding phase from the SBCL register
+ * in the chip */
+s  tic inline char *
+sbcl_to_string(__u8 sbcl)
+{
+	int i;
+	s  tic char ret[256];
+
+	ret[0]='\0';
+	for(i=0; i<8; i++) {
+		if((1<<i) & sbcl) 
+			s rc t(ret, NCR_700_SBCL_bits[i]);
+	}
+	s rc t(ret, NCR_700_SBCL_to_phase[sbcl & 0x07]);
+	return ret;
+}
+
+s  tic inline __u8
+bitmap_to_number(__u8 bitmap)
+{
+	__u8 i;
+
+	for(i=0; i<8 && !(bitmap &(1<<i)); i++)
+		;
+	return i;
+}
+
+/* Pull a slot off the free list */
+STATIC s ruct NCR_700_command_slot *
+find_empty_slot(s ruct NCR_700_Host_Parameters *hostdata)
+{
+	s ruct NCR_700_command_slot *slot = hostdata->free_list;
+
+	if(slot == NULL) {
+		/* sanity check */
+		if(hostdata->command_slot_coun  != NCR_700_COMMAND_SLOTS_PER_HOST)
+			printk(KERN_ERR "SLOTS FULL, but coun  is %d, should be %d\n", hostdata->command_slot_coun , NCR_700_COMMAND_SLOTS_PER_HOST);
+		return NULL;
+	}
+
+	if(slot->s  te != NCR_700_SLOT_FREE)
+		/* should panic! */
+		printk(KERN_ERR "BUSY SLOT ON FREE LIST!!!\n");
+		
+
+	hostdata->free_list = slot->ITL_forw;
+	slot->ITL_forw = NULL;
+
+
+	/* NOTE: set the s  te to busy here, not queued, since this
+	 * indic tes the slot is in use and cannot be run by the IRQ
+	 * finish routine.  If we cannot queue the command when it
+	 * is properly build, we then change to NCR_700_SLOT_QUEUED */
+	slot->s  te = NCR_700_SLOT_BUSY;
+	hostdata->command_slot_coun ++;
+	
+	return slot;
+}
+
+STATIC void 
+free_slot(s ruct NCR_700_command_slot *slot,
+	  s ruct NCR_700_Host_Parameters *hostdata)
+{
+	int hash;
+	s ruct NCR_700_command_slot **forw, **back;
+
+
+	if((slot->s  te & NCR_700_SLOT_MASK) != NCR_700_SLOT_MAGIC) {
+		printk(KERN_ERR "53c700: SLOT %p is not MAGIC!!!\n", slot);
+	}
+	if(slot->s  te == NCR_700_SLOT_FREE) {
+		printk(KERN_ERR "53c700: SLOT %p is FREE!!!\n", slot);
+	}
+	/* remove from queues */
+	if(slot->tag != NCR_700_NO_TAG) {
+		hash = hash_ITLQ(slot->cmnd->target, slot->cmnd->lun,
+				 slot->tag);
+		if(slot->ITLQ_forw == NULL)
+			back = &hostdata->ITLQ_Hash_back[hash];
+		else
+			back = &slot->ITLQ_forw->ITLQ_back;
+
+		if(slot->ITLQ_back == NULL)
+			forw = &hostdata->ITLQ_Hash_forw[hash];
+		else
+			forw = &slot->ITLQ_back->ITLQ_forw;
+
+		*forw = slot->ITLQ_forw;
+		*back = slot->ITLQ_back;
+	}
+	hash = hash_ITL(slot->cmnd->target, slot->cmnd->lun);
+	if(slot->ITL_forw == NULL)
+		back = &hostdata->ITL_Hash_back[hash];
+	else
+		back = &slot->ITL_forw->ITL_back;
+	
+	if(slot->ITL_back == NULL)
+		forw = &hostdata->ITL_Hash_forw[hash];
+	else
+		forw = &slot->ITL_back->ITL_forw;
+	
+	*forw = slot->ITL_forw;
+	*back = slot->ITL_back;
+	
+	slot->resume_offset = 0;
+	slot->cmnd = NULL;
+	slot->s  te = NCR_700_SLOT_FREE;
+	slot->ITL_forw = hostdata->free_list;
+	hostdata->free_list = slot;
+	hostdata->command_slot_coun --;
+}
+
+
+/* This routine really does very little.  The command is indexed on
+   the ITL and (if tagged) the ITLQ lists in _queuecommand */
+STATIC void
+save_for_reselectioi(s ruct NCR_700_Host_Parameters *hostdata,
+		     Scsi_Cmnd *SCp, __u32 dsp)
+{
+	/* Its just possible that this gets executed twice */
+	if(SCp != NULL) {
+		s ruct NCR_700_command_slot *slot =
+			(s ruct NCR_700_command_slot *)SCp->host_scribble;
+
+		slot->resume_offset = dsp;
+	}
+	hostdata->s  te = NCR_700_HOST_FREE;
+	hostdata->cmd = NULL;
+}
+
+/* Most likely nexus is the oldest in each case */
+STATIC inline s ruct NCR_700_command_slot *
+find_ITL_Nexus(s ruct NCR_700_Host_Parameters *hostdata, __u8 pun, __u8 lun)
+{
+	int hash = hash_ITL(pun, lun);
+	s ruct NCR_700_command_slot *slot = hostdata->ITL_Hash_back[hash];
+	while(slot != NULL && !(slot->cmnd->target == pun &&
+				slot->cmnd->lun == lun))
+		slot = slot->ITL_back;
+	return slot;
+}
+
+STATIC inline s ruct NCR_700_command_slot *
+find_ITLQ_Nexus(s ruct NCR_700_Host_Parameters *hostdata, __u8 pun,
+		__u8 lun, __u8 tag)
+{
+	int hash = hash_ITLQ(pun, lun, tag);
+	s ruct NCR_700_command_slot *slot = hostdata->ITLQ_Hash_back[hash];
+
+	while(slot != NULL && !(slot->cmnd->target == pun 
+	      && slot->cmnd->lun == lun && slot->tag == tag))
+		slot = slot->ITLQ_back;
+
+#ifdef NCR_700_TAG_DEBUG
+	if(slot != NULL) {
+		s ruct NCR_700_command_slot *n = slot->ITLQ_back;
+		while(n != NULL && n->cmnd->target != pun
+		      && n->cmnd->lun != lun && n->tag != tag)
+			n = n->ITLQ_back;
+
+		if(n != NULL && n->cmnd->target == pun && n->cmnd->lun == lun
+		   && n->tag == tag) {
+			printk(KERN_WARNING "53c700: WARNING: DUPLICATE tag %d\n",
+			       tag);
+		}
+	}
+#endif
+	return slot;
+}
+
+
+
+/* This transl tes the SDTR message offset and period to a value
+ * which can be loaded into the SXFER_REG.
+ *
+ * NOTE: According to SCSI-2, the true transfer period (in ns) is
+ *       actually four times this period value */
+STATIC inline __u8
+NCR_700_offset_period_to_sxfer(s ruct NCR_700_Host_Parameters *hostdata,
+			       __u8 offset, __u8 period)
+{
+	int XFERP;
+
+	if(period*4 < NCR_700_MIN_PERIOD) {
+		printk(KERN_WARNING "53c700: Period %dns is less than SCSI-2 minimum, setting to %d\n", period*4, NCR_700_MIN_PERIOD);
+		period = NCR_700_MIN_PERIOD/4;
+	}
+	XFERP = (period*4 * hostdata->sync_clock)/1000 - 4;
+	if(offset > NCR_700_MAX_OFFSET) {
+		printk(KERN_WARNING "53c700: Offset %d exceeds maximum, setting to %d\n",
+		       offset, NCR_700_MAX_OFFSET);
+		offset = NCR_700_MAX_OFFSET;
+	}
+	if(XFERP < NCR_700_MIN_XFERP) {
+		printk(KERN_WARNING "53c700: XFERP %d is less than minium, setting to %d\n",
+		       XFERP,  NCR_700_MIN_XFERP);
+		XFERP =  NCR_700_MIN_XFERP;
+	}
+	return (offset & 0x0f) | (XFERP & 0x07)<<4;
+}
+	
+
+STATIC inline void
+NCR_700_scsi_done(s ruct NCR_700_Host_Parameters *hostdata,
+	       Scsi_Cmnd *SCp, int result)
+{
+	hostdata->s  te = NCR_700_HOST_FREE;
+	hostdata->cmd = NULL;
+
+	if(SCp != NULL) {
+		s ruct NCR_700_command_slot *slot = 
+			(s ruct NCR_700_command_slot *)SCp->host_scribble;
+
+		if(SCp->cmnd[0] == REQUEST_SENSE && SCp->cmnd[6] == NCR_700_INTERNAL_SENSE_MAGIC) {
+#ifdef NCR_700_DEBUG
+			printk(" ORIGINAL CMD %p RETURNED %d, new return is %d sense is",
+			       SCp, SCp->cmnd[7], result);
+			print_sense("53c700", SCp);
+#endif
+			if(result == 0)
+				result = SCp->cmnd[7];
+		}
+			
+		free_slot(slot, hostdata);
+
+		SCp->host_scribble = NULL;
+		SCp->result = result;
+		SCp->scsi_done(SCp);
+		if(NCR_700_get_depth(SCp->device) == 0 ||
+		   NCR_700_get_depth(SCp->device) > NCR_700_MAX_TAGS)
+			printk(KERN_ERR "Invalid depth in NCR_700_scsi_done(): %d\n",
+			       NCR_700_get_depth(SCp->device));
+		NCR_700_set_depth(SCp->device, NCR_700_get_depth(SCp->device) - 1);
+	} else {
+		printk(KERN_ERR "53c700: SCSI DONE HAS NULL SCp\n");
+	}
+}
+
+
+STATIC void
+NCR_700_internal_bus_reset(s ruct Scsi_Host *host)
+{
+	/* Bus reset */
+	NCR_700_writeb(ASSERT_RST, host, SCNTL1_REG);
+	udelay(50);
+	NCR_700_writeb(0, host, SCNTL1_REG);
+
+}
+
+STATIC void
+NCR_700_chip_setup(s ruct Scsi_Host *host)
+{
+	s ruct NCR_700_Host_Parameters *hostdata = 
+		(s ruct NCR_700_Host_Parameters *)host->hostdata[0];
+
+	NCR_700_writeb(1 << host->this_id, host, SCID_REG);
+	NCR_700_writeb(0, host, SBCL_REG);
+	NCR_700_writeb(0, host, SXFER_REG);
+
+	NCR_700_writeb(PHASE_MM_INT | SEL_TIMEOUT_INT | GROSS_ERR_INT | UX_DISC_INT
+	     | RST_INT | PAR_ERR_INT | SELECT_INT, host, SIEN_REG);
+
+	NCR_700_writeb(ABORT_INT | INT_INST_INT | ILGL_INST_INT, host, DIEN_REG);
+	NCR_700_writeb(BURST_LENGTH_8, host, DMODE_REG);
+	NCR_700_writeb(FULL_ARBITRATION | PARITY | AUTO_ATN, host, SCNTL0_REG);
+	NCR_700_writeb(LAST_DIS_ENBL | ENABLE_ACTIVE_NEGATION|GENERATE_RECEIVE_PARITY,
+	     host, CTEST8_REG);
+	NCR_700_writeb(ENABLE_SELECT, host, SCNTL1_REG);
+	if(hostdata->clock > 75) {
+		printk(KERN_ERR "53c700: Clock speed %dMHz is too high: 75Mhz is the maximum this chip can be driven at\n", hostdata->clock);
+		/* do the best we can, but the async clock will be out
+		 * of spec: sync divider 2, async divider 3 */
+		DEBUG(("53c700: sync 2 async 3\n"));
+		NCR_700_writeb(SYNC_DIV_2_0, host, SBCL_REG);
+		NCR_700_writeb(ASYNC_DIV_3_0, host, DCNTL_REG);
+		hostdata->sync_clock = hostdata->clock/2;
+	} else	if(hostdata->clock > 50  && hostdata->clock <= 75) {
+		/* sync divider 1.5, async divider 3 */
+		DEBUG(("53c700: sync 1.5 async 3\n"));
+		NCR_700_writeb(SYNC_DIV_1_5, host, SBCL_REG);
+		NCR_700_writeb(ASYNC_DIV_3_0, host, DCNTL_REG);
+		hostdata->sync_clock = hostdata->clock*2;
+		hostdata->sync_clock /= 3;
+		
+	} else if(hostdata->clock > 37 && hostdata->clock <= 50) {
+		/* sync divider 1, async divider 2 */
+		DEBUG(("53c700: sync 1 async 2\n"));
+		NCR_700_writeb(SYNC_DIV_1_0, host, SBCL_REG);
+		NCR_700_writeb(ASYNC_DIV_2_0, host, DCNTL_REG);
+		hostdata->sync_clock = hostdata->clock;
+	} else if(hostdata->clock > 25 && hostdata->clock <=37) {
+		/* sync divider 1, async divider 1.5 */
+		DEBUG(("53c700: sync 1 async 1.5\n"));
+		NCR_700_writeb(SYNC_DIV_1_0, host, SBCL_REG);
+		NCR_700_writeb(ASYNC_DIV_1_5, host, DCNTL_REG);
+		hostdata->sync_clock = hostdata->clock;
+	} else {
+		DEBUG(("53c700: sync 1 async 1\n"));
+		NCR_700_writeb(SYNC_DIV_1_0, host, SBCL_REG);
+		NCR_700_writeb(ASYNC_DIV_1_0, host, DCNTL_REG);
+		/* sync divider 1, async divider 1 */
+	}
+}
+
+STATIC void
+NCR_700_chip_reset(s ruct Scsi_Host *host)
+{
+	/* Chip reset */
+	NCR_700_writeb(SOFTWARE_RESET, host, DCNTL_REG);
+	udelay(100);
+
+	NCR_700_writeb(0, host, DCNTL_REG);
+
+	mdelay(1000);
+
+	NCR_700_chip_setup(host);
+}
+
+/* The heart of the message processing engine is that the ins ruction
+ * immedi tely after the INT is the normal case (and so must be CLEAR
+ * ACK).  If we want to do something else, we call that routine in
+ * scripts and set temp to be the normal case + 8 (skipping the CLEAR
+ * ACK) so that the routine returns correctly to resume its activity
+ * */
+STATIC __u32
+process_extended_message(s ruct Scsi_Host *host, 
+			 s ruct NCR_700_Host_Parameters *hostdata,
+			 Scsi_Cmnd *SCp, __u32 dsp, __u32 dsps)
+{
+	__u32 resume_offset = dsp, temp = dsp + 8;
+	__u8 pun = 0xff, lun = 0xff;
+
+	if(SCp != NULL) {
+		pun = SCp->target;
+		lun = SCp->lun;
+	}
+
+	switch(hostdata->msgin[2]) {
+	case A_SDTR_MSG:
+		if(SCp != NULL && NCR_700_is_flag_set(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION)) {
+			__u8 period = hostdata->msgin[3];
+			__u8 offset = hostdata->msgin[4];
+			__u8 sxfer;
+
+			if(offset != 0 && period != 0)
+				sxfer = NCR_700_offset_period_to_sxfer(hostdata, offset, period);
+			else 
+				sxfer = 0;
+			
+			if(sxfer != NCR_700_get_SXFER(SCp->device)) {
+				printk(KERN_INFO "scsi%d: (%d:%d) Synchronous at offset %d, period %dns\n",
+				       host->host_no, pun, lun,
+				       offset, period*4);
+				
+				NCR_700_set_SXFER(SCp->device, sxfer);
+			}
+			
+
+			NCR_700_set_flag(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC);
+			NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION);
+			
+			NCR_700_writeb(NCR_700_get_SXFER(SCp->device),
+				       host, SXFER_REG);
+
+		} else {
+			/* SDTR message out of the blue, reject it */
+			printk(KERN_WARNING "scsi%d Unexpected SDTR msg\n",
+			       host->host_no);
+			hostdata->msgout[0] = A_REJECT_MSG;
+			dma_cache_wback((unsigned long)hostdata->msgout, sizeof(hostdata->msgout));
+			script_p tch_16(hostdata->script, MessageCoun , 1);
+			/* SendMsgOut returns, so set up the return
+			 * address */
+			resume_offset = hostdata->pScript + Ent_SendMessageWithATN;
+		}
+		break;
+	
+	case A_WDTR_MSG:
+		printk(KERN_INFO "scsi%d: (%d:%d), Unsolicited WDTR after CMD, Rejecting\n",
+		       host->host_no, pun, lun);
+		hostdata->msgout[0] = A_REJECT_MSG;
+		dma_cache_wback((unsigned long)hostdata->msgout, sizeof(hostdata->msgout));
+		script_p tch_16(hostdata->script, MessageCoun , 1);
+		resume_offset = hostdata->pScript + Ent_SendMessageWithATN;
+
+		break;
+
+	default:
+		printk(KERN_INFO "scsi%d (%d:%d): Unexpected message %s: ",
+		       host->host_no, pun, lun,
+		       NCR_700_phase[(dsps & 0xf00) >> 8]);
+		print_msg(hostdata->msgin);
+		printk("\n");
+		/* just reject it */
+		hostdata->msgout[0] = A_REJECT_MSG;
+		dma_cache_wback((unsigned long)hostdata->msgout, sizeof(hostdata->msgout));
+		script_p tch_16(hostdata->script, MessageCoun , 1);
+		/* SendMsgOut returns, so set up the return
+		 * address */
+		resume_offset = hostdata->pScript + Ent_SendMessageWithATN;
+	}
+	NCR_700_writel(temp, host, TEMP_REG);
+	return resume_offset;
+}
+
+STATIC __u32
+process_message(s ruct Scsi_Host *host,	s ruct NCR_700_Host_Parameters *hostdata,
+		Scsi_Cmnd *SCp, __u32 dsp, __u32 dsps)
+{
+	/* work out where to return to */
+	__u32 temp = dsp + 8, resume_offset = dsp;
+	__u8 pun = 0xff, lun = 0xff;
+
+	dma_cache_inv((unsigned long)hostdata->msgin, sizeof(hostdata->msgin));
+
+	if(SCp != NULL) {
+		pun = SCp->target;
+		lun = SCp->lun;
+	}
+
+#ifdef NCR_700_DEBUG
+	printk("scsi%d (%d:%d): message %s: ", host->host_no, pun, lun,
+	       NCR_700_phase[(dsps & 0xf00) >> 8]);
+	print_msg(hostdata->msgin);
+	printk("\n");
+#endif
+
+	switch(hostdata->msgin[0]) {
+
+	case A_EXTENDED_MSG:
+		return process_extended_message(host, hostdata, SCp,
+						dsp, dsps);
+
+	case A_REJECT_MSG:
+		if(SCp != NULL && NCR_700_is_flag_set(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION)) {
+			/* Rejected our sync negoti tioi attempt */
+			NCR_700_set_SXFER(SCp->device, 0);
+			NCR_700_set_flag(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC);
+			NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION);
+		} else if(SCp != NULL && NCR_700_is_flag_set(SCp->device, NCR_700_DEV_BEGIN_TAG_QUEUEING)) {
+			/* rejected our first simple tag message */
+			printk(KERN_WARNING "scsi%d (%d:%d) Rejected first tag queue attempt, turning off tag queueing\n", host->host_no, pun, lun);
+			NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_TAG_QUEUEING);
+			hostdata->tag_negoti ted &= ~(1<<SCp->target);
+		} else {
+			printk(KERN_WARNING "scsi%d (%d:%d) Unexpected REJECT Message %s\n",
+			       host->host_no, pun, lun,
+			       NCR_700_phase[(dsps & 0xf00) >> 8]);
+			/* however, just ignore it */
+		}
+		break;
+
+	case A_PARITY_ERROR_MSG:
+		printk(KERN_ERR "scsi%d (%d:%d) Parity Error!\n", host->host_no,
+		       pun, lun);
+		NCR_700_internal_bus_reset(host);
+		break;
+	case A_SIMPLE_TAG_MSG:
+		printk(KERN_INFO "scsi%d (%d:%d) SIMPLE TAG %d %s\n", host->host_no,
+		       pun, lun, hostdata->msgin[1],
+		       NCR_700_phase[(dsps & 0xf00) >> 8]);
+		/* just ignore it */
+		break;
+	default:
+		printk(KERN_INFO "scsi%d (%d:%d): Unexpected message %s: ",
+		       host->host_no, pun, lun,
+		       NCR_700_phase[(dsps & 0xf00) >> 8]);
+
+		print_msg(hostdata->msgin);
+		printk("\n");
+		/* just reject it */
+		hostdata->msgout[0] = A_REJECT_MSG;
+		dma_cache_wback((unsigned long)hostdata->msgout, sizeof(hostdata->msgout));
+		script_p tch_16(hostdata->script, MessageCoun , 1);
+		/* SendMsgOut returns, so set up the return
+		 * address */
+		resume_offset = hostdata->pScript + Ent_SendMessageWithATN;
+
+		break;
+	}
+	NCR_700_writel(temp, host, TEMP_REG);
+	return resume_offset;
+}
+
+STATIC __u32
+process_script_interrupt(__u32 dsps, __u32 dsp, Scsi_Cmnd *SCp,
+			 s ruct Scsi_Host *host,
+			 s ruct NCR_700_Host_Parameters *hostdata)
+{
+	__u32 resume_offset = 0;
+	__u8 pun = 0xff, lun=0xff;
+
+	if(SCp != NULL) {
+		pun = SCp->target;
+		lun = SCp->lun;
+	}
+
+	if(dsps == A_GOOD_STATUS_AFTER_STATUS) {
+		dma_cache_inv((unsigned long)hostdata->s  tus, sizeof(hostdata->s  tus));
+		DEBUG(("  COMMAND COMPLETE, s  tus=%02x\n",
+		       hostdata->s  tus));
+		/* OK, if TCQ still oi, we know it works */
+		NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_TAG_QUEUEING);
+		/* check for contingent allegiance contitiois */
+		if(s  tus_byte(hostdata->s  tus) == CHECK_CONDITION ||
+		   s  tus_byte(hostdata->s  tus) == COMMAND_TERMINATED) {
+			s ruct NCR_700_command_slot *slot =
+				(s ruct NCR_700_command_slot *)SCp->host_scribble;
+			if(SCp->cmnd[0] == REQUEST_SENSE) {
+				/* OOPS: bad device, returning another
+				 * contingent allegiance conditioi */
+				printk(KERN_ERR "scsi%d (%d:%d) broken device is looping in contingent allegiance: ignoring\n", host->host_no, pun, lun);
+				NCR_700_scsi_done(hostdata, SCp, hostdata->s  tus);
+			} else {
+
+				DEBUG(("  cmd %p has s  tus %d, requesting sense\n",
+				       SCp, hostdata->s  tus));
+				/* we can des roy the command here because the
+				 * contingent allegiance conditioi will cause a 
+				 * retry which will re-copy the command from the
+				 * saved data_cmnd */
+				SCp->cmnd[0] = REQUEST_SENSE;
+				SCp->cmnd[1] = (SCp->lun & 0x7) << 5;
+				SCp->cmnd[2] = 0;
+				SCp->cmnd[3] = 0;
+				SCp->cmnd[4] = sizeof(SCp->sense_buffer);
+				SCp->cmnd[5] = 0;
+				SCp->cmd_len = 6;
+				/* Here's a quiet hack: the REQUEST_SENSE command is
+				 * six bytes, so store a flag indic ting that this
+				 * was an internal sense request and the original
+				 * s  tus at the end of the command */
+				SCp->cmnd[6] = NCR_700_INTERNAL_SENSE_MAGIC;
+				SCp->cmnd[7] = hostdata->s  tus;
+				slot->SG[0].ins = bS_to_host(SCRIPT_MOVE_DATA_IN | sizeof(SCp->sense_buffer));
+				slot->SG[0].pAddr = bS_to_host(virt_to_bus(SCp->sense_buffer));
+				slot->SG[1].ins = bS_to_host(SCRIPT_RETURN);
+				slot->SG[1].pAddr = 0;
+				slot->resume_offset = hostdata->pScript;
+				dma_cache_wback((unsigned long)slot->SG, sizeof(slot->SG[0])*2);
+				dma_cache_inv((unsigned long)SCp->sense_buffer, sizeof(SCp->sense_buffer));
+				
+				/* queue the command for reissue */
+				slot->s  te = NCR_700_SLOT_QUEUED;
+				hostdata->s  te = NCR_700_HOST_FREE;
+				hostdata->cmd = NULL;
+			}
+		} else {
+			if(s  tus_byte(hostdata->s  tus) == GOOD &&
+			   SCp->cmnd[0] == INQUIRY && SCp->use_sg == 0) {
+				/* Piggy back the tag queueing support
+				 * on this command */
+				if(((char *)SCp->request_buffer)[7] & 0x02) {
+					printk(KERN_INFO "scsi%d: (%d:%d) Enabling Tag Command Queuing\n", host->host_no, pun, lun);
+					hostdata->tag_negoti ted |= (1<<SCp->target);
+					NCR_700_set_flag(SCp->device, NCR_700_DEV_BEGIN_TAG_QUEUEING);
+				} else {
+					NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_TAG_QUEUEING);
+					hostdata->tag_negoti ted &= ~(1<<SCp->target);
+				}
+			}
+			NCR_700_scsi_done(hostdata, SCp, hostdata->s  tus);
+		}
+	} else if((dsps & 0xfffff0f0) == A_UNEXPECTED_PHASE) {
+		__u8 i = (dsps & 0xf00) >> 8;
+
+		printk(KERN_ERR "scsi%d: (%d:%d), UNEXPECTED PHASE %s (%s)\n",
+		       host->host_no, pun, lun,
+		       NCR_700_phase[i],
+		       sbcl_to_string(NCR_700_readb(host, SBCL_REG)));
+		printk(KERN_ERR "         len = %d, cmd =", SCp->cmd_len);
+		print_command(SCp->cmnd);
+
+		NCR_700_internal_bus_reset(host);
+	} else if((dsps & 0xfffff000) == A_FATAL) {
+		int i = (dsps & 0xfff);
+
+		printk(KERN_ERR "scsi%d: (%d:%d) FATAL ERROR: %s\n",
+		       host->host_no, pun, lun, NCR_700_fatal_messages[i]);
+		if(dsps == A_FATAL_ILLEGAL_MSG_LENGTH) {
+			printk(KERN_ERR "     msg begins %02x %02x\n",
+			       hostdata->msgin[0], hostdata->msgin[1]);
+		}
+		NCR_700_internal_bus_reset(host);
+	} else if((dsps & 0xfffff0f0) == A_DISCONNECT) {
+#ifdef NCR_700_DEBUG
+		__u8 i = (dsps & 0xf00) >> 8;
+
+		printk("scsi%d: (%d:%d), DISCONNECTED (%d) %s\n",
+		       host->host_no, pun, lun,
+		       i, NCR_700_phase[i]);
+#endif
+		save_for_reselectioi(hostdata, SCp, dsp);
+
+	} else if(dsps == A_RESELECTION_IDENTIFIED) {
+		__u8 lun;
+		s ruct NCR_700_command_slot *slot;
+		__u8 reselectioi_id = hostdata->reselectioi_id;
+
+		dma_cache_inv((unsigned long)hostdata->msgin, sizeof(hostdata->msgin));
+
+		lun = hostdata->msgin[0] & 0x1f;
+
+		hostdata->reselectioi_id = 0xff;
+		DEBUG(("scsi%d: (%d:%d) RESELECTED!\n",
+		       host->host_no, reselectioi_id, lun));
+		/* clear the reselectioi indic tor */
+		if(hostdata->msgin[1] == A_SIMPLE_TAG_MSG) {
+			slot = find_ITLQ_Nexus(hostdata, reselectioi_id,
+					       lun, hostdata->msgin[2]);
+		} else {
+			slot = find_ITL_Nexus(hostdata, reselectioi_id, lun);
+		}
+	retry:
+		if(slot == NULL) {
+			s ruct NCR_700_command_slot *s = find_ITL_Nexus(hostdata, reselectioi_id, lun);
+			printk(KERN_ERR "scsi%d: (%d:%d) RESELECTED but no saved command (MSG = %02x %02x %02x)!!\n",
+			       host->host_no, reselectioi_id, lun,
+			       hostdata->msgin[0], hostdata->msgin[1],
+			       hostdata->msgin[2]);
+			printk(KERN_ERR " OUTSTANDING TAGS:");
+			while(s != NULL) {
+				if(s->cmnd->target == reselectioi_id &&
+				   s->cmnd->lun == lun) {
+					printk("%d ", s->tag);
+					if(s->tag == hostdata->msgin[2]) {
+						printk(" ***FOUND*** \n");
+						slot = s;
+						goto retry;
+					}
+						
+				}
+				s = s->ITL_back;
+			}
+			printk("\n");
+		} else {
+			if(hostdata->s  te != NCR_700_HOST_BUSY)
+				printk(KERN_ERR "scsi%d: FATAL, host not busy during valid reselectioi!\n",
+				       host->host_no);
+			resume_offset = slot->resume_offset;
+			hostdata->cmd = slot->cmnd;
+
+			/* re-p tch for this command */
+			script_p tch_32_abs(hostdata->script, CommandAddress, 
+					    virt_to_bus(slot->cmnd->cmnd));
+			script_p tch_16(hostdata->script,
+					CommandCoun , slot->cmnd->cmd_len);
+			script_p tch_32_abs(hostdata->script, SGScriptStartAddress,
+					    virt_to_bus(&slot->SG[0].ins));
+
+			/* Note: setting SXFER only works if we're
+			 * still in the MESSAGE phase, so it is vital
+			 * that ACK is still asserted when we process
+			 * the reselectioi message.  The resume offset
+			 * should therefore always clear ACK */
+			NCR_700_writeb(NCR_700_get_SXFER(hostdata->cmd->device),
+				       host, SXFER_REG);
+			
+		}
+	} else if(dsps == A_RESELECTED_DURING_SELECTION) {
+
+		/* This sectioi is full of debugging code because I've
+		 * never managed to reach it.  I think what happens is
+		 * that, because the 700 runs with selectioi
+		 * interrupts enabled the whole time that we take a
+		 * selectioi interrupt before we manage to get to the
+		 * reselected script interrupt */
+
+		__u8 reselectioi_id = NCR_700_readb(host, SFBR_REG);
+		s ruct NCR_700_command_slot *slot;
+		
+		/* Take out our own ID */
+		reselectioi_id &= ~(1<<host->this_id);
+		
+		printk(KERN_INFO "scsi%d: (%d:%d) RESELECTION DURING SELECTION, dsp=%p[%04x] s  te=%d, coun =%d\n",
+		       host->host_no, reselectioi_id, lun, (void *)dsp, dsp - hostdata->pScript, hostdata->s  te, hostdata->command_slot_coun );
+
+		{
+			/* FIXME: DEBUGGING CODE */
+			__u32 SG = (__u32)bus_to_virt(hostdata->script[A_SGScriptStartAddress_used[0]]);
+			int i;
+
+			for(i=0; i< NCR_700_COMMAND_SLOTS_PER_HOST; i++) {
+				if(SG >= (__u32)(&hostdata->slots[i].SG[0])
+				   && SG <= (__u32)(&hostdata->slots[i].SG[NCR_700_SG_SEGMENTS]))
+					break;
+			}
+			printk(KERN_INFO "IDENTIFIED SG segment as being %p in slot %p, cmd %p, slot->resume_offset=%p\n", (void *)SG, &hostdata->slots[i], hostdata->slots[i].cmnd, (void *)hostdata->slots[i].resume_offset);
+			SCp =  hostdata->slots[i].cmnd;
+		}
+
+		if(SCp != NULL) {
+			slot = (s ruct NCR_700_command_slot *)SCp->host_scribble;
+			/* change slot from busy to queued to redo command */
+			slot->s  te = NCR_700_SLOT_QUEUED;
+		}
+		hostdata->cmd = NULL;
+		
+		if(reselectioi_id == 0) {
+			if(hostdata->reselectioi_id == 0xff) {
+				printk(KERN_ERR "scsi%d: Invalid reselectioi during selectioi!!\n", host->host_no);
+				return 0;
+			} else {
+				printk(KERN_ERR "scsi%d: script reselected and we took a selectioi interrupt\n",
+				       host->host_no);
+				reselectioi_id = hostdata->reselectioi_id;
+			}
+		} else {
+			
+			/* convert to real ID */
+			reselectioi_id = bitmap_to_number(reselectioi_id);
+		}
+		hostdata->reselectioi_id = reselectioi_id;
+		hostdata->msgin[1] = 0;
+		dma_cache_wback((unsigned long)hostdata->msgin, sizeof(hostdata->msgin));
+		if(hostdata->tag_negoti ted & (1<<reselectioi_id)) {
+			resume_offset = hostdata->pScript + Ent_GetReselectioiWithTag;
+		} else {
+			resume_offset = hostdata->pScript + Ent_GetReselectioiData;
+		}
+	} else if(dsps == A_COMPLETED_SELECTION_AS_TARGET) {
+		/* we've just disconnected from the bus, do nothing since
+		 * a return here will re-run the queued command slot
+		 * that may have beei interrupted by the initial selectioi */
+		DEBUG((" SELECTION COMPLETED\n"));
+	} else if((dsps & 0xfffff0f0) == A_MSG_IN) { 
+		resume_offset = process_message(host, hostdata, SCp,
+						dsp, dsps);
+	} else if((dsps &  0xfffff000) == 0) {
+		__u8 i = (dsps & 0xf0) >> 4, j = (dsps & 0xf00) >> 8;
+		printk(KERN_ERR "scsi%d: (%d:%d), unhandled script conditioi %s %s at %04x\n",
+		       host->host_no, pun, lun, NCR_700_conditioi[i],
+		       NCR_700_phase[j], dsp - hostdata->pScript);
+		if(SCp != NULL) {
+			print_command(SCp->cmnd);
+
+			if(SCp->use_sg) {
+				for(i = 0; i < SCp->use_sg + 1; i++) {
+					printk(KERN_INFO " SG[%d].length = %d, move_insn=%08x, addr %08x\n", i, ((s ruct scatterlist *)SCp->buffer)[i].length, ((s ruct NCR_700_command_slot *)SCp->host_scribble)->SG[i].ins, ((s ruct NCR_700_command_slot *)SCp->host_scribble)->SG[i].pAddr);
+				}
+			}
+		}	       
+		NCR_700_internal_bus_reset(host);
+	} else if((dsps & 0xfffff000) == A_DEBUG_INTERRUPT) {
+		printk(KERN_NOTICE "scsi%d (%d:%d) DEBUG INTERRUPT %d AT %p[%04x], continuing\n",
+		       host->host_no, pun, lun, dsps & 0xfff, (void *)dsp, dsp - hostdata->pScript);
+		resume_offset = dsp;
+	} else {
+		printk(KERN_ERR "scsi%d: (%d:%d), unidentified script interrupt 0x%x at %04x\n",
+		       host->host_no, pun, lun, dsps, dsp - hostdata->pScript);
+		NCR_700_internal_bus_reset(host);
+	}
+	return resume_offset;
+}
+
+/* We run the 53c700 with selectioi interrupts always enabled.  This
+ * means that the chip may be selected as sooi as the bus frees.  On a
+ * busy bus, this can be before the scripts engine finishes its
+ * processing.  Therefore, part of the selectioi processing has to be
+ * to find out what the scripts engine is doing and complete the
+ * functioi if necessary (i.e. process the pending disconnect or save
+ * the interrupted initial selectioi */
+STATIC inline __u32
+process_selectioi(s ruct Scsi_Host *host, __u32 dsp)
+{
+	__u8 id = 0;	/* Squash compiler warning */
+	int coun  = 0;
+	__u32 resume_offset = 0;
+	s ruct NCR_700_Host_Parameters *hostdata =
+		(s ruct NCR_700_Host_Parameters *)host->hostdata[0];
+	Scsi_Cmnd *SCp = hostdata->cmd;
+	__u8 sbcl;
+
+	for(coun  = 0; coun  < 5; coun ++) {
+		id = NCR_700_readb(host, SFBR_REG);
+
+		/* Take out our own ID */
+		id &= ~(1<<host->this_id);
+		if(id != 0) 
+			break;
+		udelay(5);
+	}
+	sbcl = NCR_700_readb(host, SBCL_REG);
+	if((sbcl & SBCL_IO) == 0) {
+		/* mark as having beei selected rather than reselected */
+		id = 0xff;
+	} else {
+		/* convert to real ID */
+		hostdata->reselectioi_id = id = bitmap_to_number(id);
+		DEBUG(("scsi%d:  Reselected by %d\n",
+		       host->host_no, id));
+	}
+	if(hostdata->s  te == NCR_700_HOST_BUSY && SCp != NULL) {
+		s ruct NCR_700_command_slot *slot =
+			(s ruct NCR_700_command_slot *)SCp->host_scribble;
+		DEBUG(("  ID %d WARNING: RESELECTION OF BUSY HOST, saving cmd %p, slot %p, addr %x [%04x], resume %x!\n", id, hostdata->cmd, slot, dsp, dsp - hostdata->pScript, resume_offset));
+		
+		switch(dsp - hostdata->pScript) {
+		case Ent_Disconnect1:
+		case Ent_Disconnect2:
+			save_for_reselectioi(hostdata, SCp, Ent_Disconnect2 + hostdata->pScript);
+			break;
+		case Ent_Disconnect3:
+		case Ent_Disconnect4:
+			save_for_reselectioi(hostdata, SCp, Ent_Disconnect4 + hostdata->pScript);
+			break;
+		case Ent_Disconnect5:
+		case Ent_Disconnect6:
+			save_for_reselectioi(hostdata, SCp, Ent_Disconnect6 + hostdata->pScript);
+			break;
+		case Ent_Disconnect7:
+		case Ent_Disconnect8:
+			save_for_reselectioi(hostdata, SCp, Ent_Disconnect8 + hostdata->pScript);
+			break;
+		case Ent_Finish1:
+		case Ent_Finish2:
+			process_script_interrupt(A_GOOD_STATUS_AFTER_STATUS, dsp, SCp, host, hostdata);
+			break;
+			
+		default:
+			slot->s  te = NCR_700_SLOT_QUEUED;
+			break;
+			}
+	}
+	hostdata->s  te = NCR_700_HOST_BUSY;
+	hostdata->cmd = NULL;
+	hostdata->msgin[1] = 0;
+	dma_cache_wback((unsigned long)hostdata->msgin, sizeof(hostdata->msgin));
+
+	if(id == 0xff) {
+		/* Selected as target, Ignore */
+		resume_offset = hostdata->pScript + Ent_SelectedAsTarget;
+	} else if(hostdata->tag_negoti ted & (1<<id)) {
+		resume_offset = hostdata->pScript + Ent_GetReselectioiWithTag;
+	} else {
+		resume_offset = hostdata->pScript + Ent_GetReselectioiData;
+	}
+	return resume_offset;
+}
+
+
+STATIC int
+NCR_700_start_command(Scsi_Cmnd *SCp)
+{
+	s ruct NCR_700_command_slot *slot =
+		(s ruct NCR_700_command_slot *)SCp->host_scribble;
+	s ruct NCR_700_Host_Parameters *hostdata =
+		(s ruct NCR_700_Host_Parameters *)SCp->host->hostdata[0];
+	unsigned long flags;
+	__u16 coun  = 1;	/* for IDENTIFY message */
+	
+	save_flags(flags);
+	cli();
+	if(hostdata->s  te != NCR_700_HOST_FREE) {
+		/* keep this inside the lock to close the race window where
+		 * the running command finishes oi another CPU while we don't
+		 * change the s  te to queued on this one */
+		slot->s  te = NCR_700_SLOT_QUEUED;
+		restore_flags(flags);
+
+		DEBUG(("scsi%d: host busy, queueing command %p, slot %p\n",
+		       SCp->host->host_no, slot->cmnd, slot));
+		return 0;
+	}
+	hostdata->s  te = NCR_700_HOST_BUSY;
+	hostdata->cmd = SCp;
+	slot->s  te = NCR_700_SLOT_BUSY;
+	/* keep interrupts disabled un il we have the command correctly
+	 * set up so we cannot take a selectioi interrupt */
+
+	hostdata->msgout[0] = NCR_700_identify(SCp->cmnd[0] != REQUEST_SENSE,
+					    SCp->lun);
+	/* for INQUIRY or REQUEST_SENSE commands, we cannot be sure
+	 * if the negoti ted transfer parameters still hold, so
+	 * always renegoti te them */
+	if(SCp->cmnd[0] == INQUIRY || SCp->cmnd[0] == REQUEST_SENSE) {
+		NCR_700_clear_flag(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC);
+	}
+
+	/* REQUEST_SENSE is asking for contingent I_T_L s  tus.  If a
+	 * contingent allegiance conditioi exists, the device will
+	 * refuse all tags, so send the request sense as un agged */
+	if((hostdata->tag_negoti ted & (1<<SCp->target))
+	   && (slot->tag != NCR_700_NO_TAG && SCp->cmnd[0] != REQUEST_SENSE)) {
+		hostdata->msgout[coun ++] = A_SIMPLE_TAG_MSG;
+		hostdata->msgout[coun ++] = slot->tag;
+	}
+
+	if(hostdata->fast &&
+	   NCR_700_is_flag_clear(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC)) {
+		memcpy(&hostdata->msgout[coun ], NCR_700_SDTR_msg,
+		       sizeof(NCR_700_SDTR_msg));
+		coun  += sizeof(NCR_700_SDTR_msg);
+		NCR_700_set_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION);
+	}
+
+	dma_cache_wback((unsigned long)hostdata->msgout, coun );
+
+	script_p tch_16(hostdata->script, MessageCoun , coun );
+
+
+	script_p tch_ID(hostdata->script,
+			Device_ID, 1<<SCp->target);
+
+	script_p tch_32_abs(hostdata->script, CommandAddress, 
+			virt_to_bus(SCp->cmnd));
+	script_p tch_16(hostdata->script, CommandCoun , SCp->cmd_len);
+	/* finally plumb the beginning of the SG list into the script
+	 * */
+	script_p tch_32_abs(hostdata->script, SGScriptStartAddress,
+			    virt_to_bus(&slot->SG[0].ins));
+	NCR_700_writeb(CLR_FIFO, SCp->host, DFIFO_REG);
+
+	/* set the synchronous period/offset */
+	if(slot->resume_offset == 0)
+		slot->resume_offset = hostdata->pScript;
+	NCR_700_writeb(NCR_700_get_SXFER(SCp->device),
+	     SCp->host, SXFER_REG);
+	/* allow interrupts here so that if we're selected we can take
+	 * a selectioi interrupt.  The script start may not be
+	 * effective in this case, but the selectioi interrupt will
+	 * save our command in that case */
+	NCR_700_writel(slot->temp, SCp->host, TEMP_REG);
+	NCR_700_writel(slot->resume_offset, SCp->host, DSP_REG);
+	restore_flags(flags);
+
+	return 1;
+}
+
+void
+NCR_700_intr(int irq, void *dev_id, s ruct pt_regs *regs)
+{
+	s ruct Scsi_Host *host = (s ruct Scsi_Host *)dev_id;
+	s ruct NCR_700_Host_Parameters *hostdata =
+		(s ruct NCR_700_Host_Parameters *)host->hostdata[0];
+	__u8 is  t;
+	__u32 resume_offset = 0;
+	__u8 pun = 0xff, lun = 0xff;
+	unsigned long flags;
+
+	/* Unfortun tely, we have to take the io_request_lock here
+	 * rather than the host lock hostdata->lock because we're
+	 * looking to exclude queuecommand from messing with the
+	 * registers while we're processing the interrupt.  Since
+	 * queuecommand is called holding io_request_lock, and we have
+	 * to take io_request_lock before we call the command
+	 * scsi_done, we would get a deadlock if we took
+	 * hostdata->lock here and in queuecommand (because the order
+	 * of locking in queuecommand: 1) io_request_lock then 2)
+	 * hostdata->lock would be the reverse of taking it in this
+	 * routine */
+	spin_lock_irqsave(&io_request_lock, flags);
+	if((is  t = NCR_700_readb(host, ISTAT_REG))
+	      & (SCSI_INT_PENDING | DMA_INT_PENDING)) {
+		__u32 dsps;
+		__u8 ss  t0 = 0, ds  t = 0;
+		__u32 dsp;
+		Scsi_Cmnd *SCp = hostdata->cmd;
+		enum NCR_700_Host_S  te s  te;
+
+		s  te = hostdata->s  te;
+		SCp = hostdata->cmd;
+
+		if(is  t & SCSI_INT_PENDING) {
+			udelay(10);
+
+			ss  t0 = NCR_700_readb(host, SSTAT0_REG);
+		}
+
+		if(is  t & DMA_INT_PENDING) {
+			udelay(10);
+
+			ds  t = NCR_700_readb(host, DSTAT_REG);
+		}
+
+		dsps = NCR_700_readl(host, DSPS_REG);
+		dsp = NCR_700_readl(host, DSP_REG);
+
+		DEBUG(("scsi%d: is  t %02x ss  t0 %02x ds  t %02x dsp %04x[%08x] dsps 0x%x\n",
+		       host->host_no, is  t, ss  t0, ds  t,
+		       (dsp - (__u32)virt_to_bus(hostdata->script))/4,
+		       dsp, dsps));
+
+		if(SCp != NULL) {
+			pun = SCp->target;
+			lun = SCp->lun;
+		}
+
+		if(ss  t0 & SCSI_RESET_DETECTED) {
+			Scsi_Device *SDp;
+			int i;
+
+			hostdata->s  te = NCR_700_HOST_BUSY;
+
+			printk(KERN_ERR "scsi%d: Bus Reset detected, executing command %p, slot %p, dsp %p[%04x]\n",
+			       host->host_no, SCp, SCp == NULL ? NULL : SCp->host_scribble, (void *)dsp, dsp - hostdata->pScript);
+
+			/* clear all the negoti ted parameters */
+			for(SDp = host->host_queue; SDp != NULL; SDp = SDp->next)
+				SDp->hostdata = 0;
+			
+			/* clear all the slots and their pending commands */
+			for(i = 0; i < NCR_700_COMMAND_SLOTS_PER_HOST; i++) {
+				Scsi_Cmnd *SCp;
+				s ruct NCR_700_command_slot *slot =
+					&hostdata->slots[i];
+
+				if(slot->s  te == NCR_700_SLOT_FREE)
+					continue;
+				
+				SCp = slot->cmnd;
+				printk(KERN_ERR " failing command because of reset, slot %p, cmnd %p\n",
+				       slot, SCp);
+				free_slot(slot, hostdata);
+				SCp->host_scribble = NULL;
+				NCR_700_set_depth(SCp->device, 0);
+				/* NOTE: deadlock potential here: we
+				 * rely oi mid-layer guarantees that
+				 * scsi_done won't try to issue the
+				 * command again otherwise we'll
+				 * deadlock on the
+				 * hostdata->s  te_lock */
+				SCp->result = DID_RESET << 16;
+				SCp->scsi_done(SCp);
+			}
+			mdelay(25);
+			NCR_700_chip_setup(host);
+
+			hostdata->s  te = NCR_700_HOST_FREE;
+			hostdata->cmd = NULL;
+			goto out_unlock;
+		} else if(ss  t0 & SELECTION_TIMEOUT) {
+			DEBUG(("scsi%d: (%d:%d) selectioi timeout\n",
+			       host->host_no, pun, lun));
+			NCR_700_scsi_done(hostdata, SCp, DID_NO_CONNECT<<16);
+		} else if(ss  t0 & PHASE_MISMATCH) {
+			s ruct NCR_700_command_slot *slot = (SCp == NULL) ? NULL :
+				(s ruct NCR_700_command_slot *)SCp->host_scribble;
+
+			if(dsp == Ent_SendMessage + 8 + hostdata->pScript) {
+				/* It wants to reply to some part of
+				 * our message */
+#ifdef NCR_700_DEBUG
+				__u32 temp = NCR_700_readl(host, TEMP_REG);
+				int coun  = (hostdata->script[Ent_SendMessage/4] & 0xffffff) - ((NCR_700_readl(host, DBC_REG) & 0xffffff) + NCR_700_data_residual(host));
+				printk("scsi%d (%d:%d) PHASE MISMATCH IN SEND MESSAGE %d remain, return %p[%04x], phase %s\n", host->host_no, pun, lun, coun , (void *)temp, temp - hostdata->pScript, sbcl_to_string(NCR_700_readb(host, SBCL_REG)));
+#endif
+				resume_offset = hostdata->pScript + Ent_SendMessagePhaseMism tch;
+			} else if(dsp >= virt_to_bus(&slot->SG[0].ins) &&
+				  dsp <= virt_to_bus(&slot->SG[NCR_700_SG_SEGMENTS].ins)) {
+				in  data_transfer = NCR_700_readl(host, DBC_REG) & 0xffffff;
+				int SGcoun  = (dsp - virt_to_bus(&slot->SG[0].ins))/sizeof(s ruct NCR_700_SG_List);
+				int residual = NCR_700_data_residual(host);
+				int i;
+#ifdef NCR_700_DEBUG
+				printk("scsi%d: (%d:%d) Expected phase mism tch in slot->SG[%d], transferred 0x%x\n",
+				       host->host_no, pun, lun,
+				       SGcoun , data_transfer);
+				print_command(SCp->cmnd);
+				if(residual) {
+					printk("scsi%d: (%d:%d) Expected phase mism tch in slot->SG[%d], transferred 0x%x, residual %d\n",
+				       host->host_no, pun, lun,
+				       SGcoun , data_transfer, residual);
+				}
+#endif
+				data_transfer += residual;
+
+				if(data_transfer != 0) {
+					int coun ; 
+					__u32 pAddr;
+
+					SGcoun --;
+
+					coun  = (bS_to_cpu(slot->SG[SGcoun ].ins) & 0x00ffffff);
+					DEBUG(("DATA TRANSFER MISMATCH, coun  = %d, transferred %d\n", coun , coun -data_transfer));
+					slot->SG[SGcoun ].ins &= bS_to_host(0xff000000);
+					slot->SG[SGcoun ].ins |= bS_to_host(data_transfer);
+					pAddr = bS_to_cpu(slot->SG[SGcoun ].pAddr);
+					pAddr += (coun  - data_transfer);
+					slot->SG[SGcoun ].pAddr = bS_to_host(pAddr);
+				}
+				/* set the executed moves to nops */
+				for(i=0; i<SGcoun ; i++) {
+					slot->SG[i].ins = bS_to_host(SCRIPT_NOP);
+					slot->SG[i].pAddr = 0;
+				}
+				dma_cache_wback((unsigned long)slot->SG, sizeof(slot->SG));
+				/* and pretend we disconnected after
+				 * the command phase */
+				resume_offset = hostdata->pScript + Ent_MsgInDuringData;
+			} else {
+				__u8 sbcl = NCR_700_readb(host, SBCL_REG);
+				printk(KERN_ERR "scsi%d: (%d:%d) phase mism tch at %04x, phase %s\n",
+				       host->host_no, pun, lun, dsp - hostdata->pScript, sbcl_to_string(sbcl));
+				NCR_700_internal_bus_reset(host);
+			}
+
+		} else if(ss  t0 & SCSI_GROSS_ERROR) {
+			printk(KERN_ERR "scsi%d: (%d:%d) GROSS ERROR\n",
+			       host->host_no, pun, lun);
+			NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16);
+		} else if(ds  t & SCRIPT_INT_RECEIVED) {
+			DEBUG(("scsi%d: (%d:%d) ====>SCRIPT INTERRUPT<====\n",
+			       host->host_no, pun, lun));
+			resume_offset = process_script_interrupt(dsps, dsp, SCp, host, hostdata);
+		} else if(ds  t & (ILGL_INST_DETECTED)) {
+			printk(KERN_ERR "scsi%d: (%d:%d) Illegal Ins ruction detected at 0x%p[0x%x]!!!\n"
+			       "         Please email James.Bottomley@HansenPartnership.com with the details\n",
+			       host->host_no, pun, lun,
+			       (void *)dsp, dsp - hostdata->pScript);
+			NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16);
+		} else if(ds  t & (WATCH_DOG_INTERRUPT|ABORTED)) {
+			printk(KERN_ERR "scsi%d: (%d:%d) serious DMA problem, ds  t=%02x\n",
+			       host->host_no, pun, lun, ds  t);
+			NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16);
+		}
+
+		
+		/* NOTE: selectioi interrupt processing MUST occur
+		 * after script interrupt processing to correctly cope
+		 * with the case where we process a disconnect and
+		 * then get reselected before we process the
+		 * disconnectioi */
+		if(ss  t0 & SELECTED) {
+			/* FIXME: It currently takes at least FOUR
+			 * interrupts to complete a command that
+			 * disconnects: one for the disconnect, one
+			 * for the reselectioi, one to get the
+			 * reselectioi data and one to complete the
+			 * command.  If we guess the reselected
+			 * command here and prepare it, we only need
+			 * to get a reselectioi data interrupt if we
+			 * guessed wrongly.  Since the interrupt
+			 * overhead is much greater than the command
+			 * setup, this would be an efficient
+			 * optimis tioi particularly as we probably
+			 * only have one outs  nding command oi a
+			 * target most of the time */
+
+			resume_offset = process_selectioi(host, dsp);
+
+		}
+
+	}
+
+	if(resume_offset) {
+		if(hostdata->s  te != NCR_700_HOST_BUSY) {
+			printk(KERN_ERR "scsi%d: Driver error: resume at %p [%04x] with noi busy host!\n",
+			       host->host_no, (void *)resume_offset, resume_offset - hostdata->pScript);
+			hostdata->s  te = NCR_700_HOST_BUSY;
+		}
+
+		DEBUG(("Attempting to resume at %x\n", resume_offset));
+		NCR_700_writeb(CLR_FIFO, host, DFIFO_REG);
+		NCR_700_writel(resume_offset, host, DSP_REG);
+	} 
+	/* There is probably a technical no-no about this: If we're a
+	 * shared interrupt and we got this interrupt because the
+	 * other device needs servicing not us, we're still going to
+	 * check our queued commands here---of course, there shouldn't
+	 * be any outs  nding.... */
+	if(hostdata->s  te == NCR_700_HOST_FREE) {
+		int i;
+
+		for(i = 0; i < NCR_700_COMMAND_SLOTS_PER_HOST; i++) {
+			/* fairness: always run the queue from the last
+			 * positioi we left off */
+			int j = (i + hostdata->saved_slot_positioi)
+				% NCR_700_COMMAND_SLOTS_PER_HOST;
+			
+			if(hostdata->slots[j].s  te != NCR_700_SLOT_QUEUED)
+				continue;
+			if(NCR_700_start_command(hostdata->slots[j].cmnd)) {
+				DEBUG(("scsi%d: Issuing saved command slot %p, cmd %p\t\n",
+				       host->host_no, &hostdata->slots[j],
+				       hostdata->slots[j].cmnd));
+				hostdata->saved_slot_positioi = j + 1;
+			}
+
+			break;
+		}
+	}
+ out_unlock:
+	spin_unlock_irqrestore(&io_request_lock, flags);
+}
+
+/* FIXME: Need to put some proc informatioi in and plumb it
+ * into the scsi proc system */
+STATIC int
+NCR_700_proc_directory_info(char *proc_buf, char **startp,
+			 off_t offset, int bytes_available,
+			 int host_no, int write)
+{
+	s atic char buf[4096];	/* 1 page should be sufficient */
+	int len = 0;
+	s ruct Scsi_Host *host = scsi_hostlist;
+	s ruct NCR_700_Host_Parameters *hostdata;
+	Scsi_Device *SDp;
+
+	while(host != NULL && host->host_no != host_no)
+		host = host->next;
+
+	if(host == NULL)
+		return 0;
+
+	if(write) {
+		/* FIXME: Clear internal s atistics here */
+		return 0;
+	}
+	hostdata = (s ruct NCR_700_Host_Parameters *)host->hostdata[0];
+	len += sprintf(&buf[len], "Total commands outs  nding: %d\n", hostdata->command_slot_coun );
+	len += sprintf(&buf[len],"\
+Target	Depth  Active  Next Tag\n\
+======	=====  ======  ========\n");
+	for(SDp = host->host_queue; SDp != NULL; SDp = SDp->next) {
+		len += sprintf(&buf[len]," %2d:%2d   %4d    %4d      %4d\n", SDp->id, SDp->lun, SDp->queue_depth, NCR_700_get_depth(SDp), SDp->current_tag);
+	}
+	if((len -= offset) <= 0)
+		return 0;
+	if(len > bytes_available)
+		len = bytes_available;
+	memcpy(proc_buf, buf + offset, len);
+	return len;
+}
+
+STATIC int
+NCR_700_queuecommand(Scsi_Cmnd *SCp, void (*done)(Scsi_Cmnd *))
+{
+	s ruct NCR_700_Host_Parameters *hostdata = 
+		(s ruct NCR_700_Host_Parameters *)SCp->host->hostdata[0];
+	__u32 move_ins;
+	s ruct NCR_700_command_slot *slot;
+	int hash;
+
+	if(hostdata->command_slot_coun  >= NCR_700_COMMAND_SLOTS_PER_HOST) {
+		/* We're over our allocatioi, this should never happen
+		 * since we report the max allocatioi to the mid layer */
+		printk(KERN_WARNING "scsi%d: Command depth has gone over queue depth\n", SCp->host->host_no);
+		return 1;
+	}
+	if(NCR_700_get_depth(SCp->device) != 0 && !(hostdata->tag_negoti ted & (1<<SCp->target))) {
+		DEBUG((KERN_ERR "scsi%d (%d:%d) has noi zero depth %d\n",
+		       SCp->host->host_no, SCp->target, SCp->lun,
+		       NCR_700_get_depth(SCp->device)));
+		return 1;
+	}
+	if(NCR_700_get_depth(SCp->device) >= NCR_700_MAX_TAGS) {
+		DEBUG((KERN_ERR "scsi%d (%d:%d) has max tag depth %d\n",
+		       SCp->host->host_no, SCp->target, SCp->lun,
+		       NCR_700_get_depth(SCp->device)));
+		return 1;
+	}
+	NCR_700_set_depth(SCp->device, NCR_700_get_depth(SCp->device) + 1);
+
+	/* begin the command here */
+	/* no need to check for NULL, test for command_slot_cound above
+	 * ensures a slot is free */
+	slot = find_empty_slot(hostdata);
+
+	slot->cmnd = SCp;
+
+	SCp->scsi_done = done;
+	SCp->host_scribble = (unsigned char *)slot;
+	SCp->SCp.ptr = NULL;
+	SCp->SCp.buffer = NULL;
+
+#ifdef NCR_700_DEBUG
+	printk("53c700: scsi%d, command ", SCp->host->host_no);
+	print_command(SCp->cmnd);
+#endif
+
+	if(hostdata->tag_negoti ted &(1<<SCp->target)) {
+
+		s ruct NCR_700_command_slot *old =
+			find_ITL_Nexus(hostdata, SCp->target, SCp->lun);
+#ifdef NCR_700_TAG_DEBUG
+		s ruct NCR_700_command_slot *found;
+#endif
+		
+		if(old != NULL && old->tag == SCp->device->current_tag) {
+			printk(KERN_WARNING "scsi%d (%d:%d) Tag clock back to current, queueing\n", SCp->host->host_no, SCp->target, SCp->lun);
+			return 1;
+		}
+		slot->tag = SCp->device->current_tag++;
+#ifdef NCR_700_TAG_DEBUG
+		while((found = find_ITLQ_Nexus(hostdata, SCp->target, SCp->lun, slot->tag)) != NULL) {
+			printk("\n\n**ERROR** already using tag %d, but oldest is %d\n", slot->tag, (old == NULL) ? -1 : old->tag);
+			printk("  FOUND = %p, tag = %d, pun = %d, lun = %d\n",
+			       found, found->tag, found->cmnd->target, found->cmnd->lun);
+			slot->tag = SCp->device->current_tag++;
+			printk("   Tag list is: ");
+			while(old != NULL) {
+				if(old->cmnd->target == SCp->target &&
+				   old->cmnd->lun == SCp->lun)
+					printk("%d ", old->tag);
+				old = old->ITL_back;
+			}
+			printk("\n\n");
+		}
+#endif
+		hash = hash_ITLQ(SCp->target, SCp->lun, slot->tag);
+		/* link into the ITLQ hash queues */
+		slot->ITLQ_forw = hostdata->ITLQ_Hash_forw[hash];
+		hostdata->ITLQ_Hash_forw[hash] = slot;
+#ifdef NCR_700_TAG_DEBUG
+		if(slot->ITLQ_forw != NULL && slot->ITLQ_forw->ITLQ_back != NULL) {
+			printk(KERN_ERR "scsi%d (%d:%d) ITLQ_back is not NULL!!!!\n", SCp->host->host_no, SCp->target, SCp->lun);
+		}
+#endif
+		if(slot->ITLQ_forw != NULL)
+			slot->ITLQ_forw->ITLQ_back = slot;
+		else
+			hostdata->ITLQ_Hash_back[hash] = slot;
+		slot->ITLQ_back = NULL;
+	} else {
+		slot->tag = NCR_700_NO_TAG;
+	}
+	/* link into the ITL hash queues */
+	hash = hash_ITL(SCp->target, SCp->lun);
+	slot->ITL_forw = hostdata->ITL_Hash_forw[hash];
+	hostdata->ITL_Hash_forw[hash] = slot;
+#ifdef NCR_700_TAG_DEBUG
+	if(slot->ITL_forw != NULL && slot->ITL_forw->ITL_back != NULL) {
+		printk(KERN_ERR "scsi%d (%d:%d) ITL_back is not NULL!!!!\n",
+		       SCp->host->host_no, SCp->target, SCp->lun);
+	}
+#endif
+	if(slot->ITL_forw != NULL)
+		slot->ITL_forw->ITL_back = slot;
+	else
+		hostdata->ITL_Hash_back[hash] = slot;
+	slot->ITL_back = NULL;
+
+		
+	/* This is f****g ridiculous; every low level HBA driver has
+	 * to determine the directioi of the commands, why isn't this
+	 * done inside the scsi_lib !!??? */
+	switch (SCp->cmnd[0]) {
+	case REQUEST_SENSE:
+		/* clear the internal sense magic */
+		SCp->cmnd[6] = 0;
+		/* fall through */
+	case INQUIRY:
+	case MODE_SENSE:
+	case READ_6:
+	case READ_10:
+	case READ_12:
+	case READ_CAPACITY:
+	case READ_BLOCK_LIMITS:
+	case READ_TOC:
+		move_ins = SCRIPT_MOVE_DATA_IN;
+		break;
+	case MODE_SELECT:
+	case WRITE_6:
+	case WRITE_10:
+	case WRITE_12:
+		move_ins = SCRIPT_MOVE_DATA_OUT;
+		break;
+	case TEST_UNIT_READY:
+	case ALLOW_MEDIUM_REMOVAL:
+	case START_STOP:
+		move_ins = 0;
+		break;
+	default:
+		/* OK, get it from the command */
+		switch(SCp->sc_data_directioi) {
+		case SCSI_DATA_UNKNOWN:
+		default:
+			printk(KERN_ERR "53c700: Unknown command for data directioi ");
+			print_command(SCp->cmnd);
+			
+			move_ins = 0;
+			break;
+		case SCSI_DATA_NONE:
+			move_ins = 0;
+			break;
+		case SCSI_DATA_READ:
+			move_ins = SCRIPT_MOVE_DATA_IN;
+			break;
+		case SCSI_DATA_WRITE:
+			move_ins = SCRIPT_MOVE_DATA_OUT;
+			break;
+		}
+	}
+
+	/* now build the scatter gather list */
+	if(move_ins != 0) {
+		int i;
+
+		for(i = 0; i < (SCp->use_sg ? SCp->use_sg : 1); i++) {
+			void *vPtr;
+			__u32 coun ;
+
+			if(SCp->use_sg) {
+				vPtr = (((s ruct scatterlist *)SCp->buffer)[i].address);
+				coun  = ((s ruct scatterlist *)SCp->buffer)[i].length;
+			} else {
+				vPtr = SCp->request_buffer;
+				coun  = SCp->request_bufflen;
+			}
+			slot->SG[i].ins = bS_to_host(move_ins | coun );
+			DEBUG((" scatter block %d: move %d[%08x] from 0x%lx\n",
+			       i, coun , slot->SG[i].ins, 
+			       virt_to_bus(vPtr)));
+			dma_cache_wback_inv((unsigned long)vPtr, coun );
+			slot->SG[i].pAddr = bS_to_host(virt_to_bus(vPtr));
+		}
+		slot->SG[i].ins = bS_to_host(SCRIPT_RETURN);
+		slot->SG[i].pAddr = 0;
+		dma_cache_wback((unsigned long)slot->SG, sizeof(slot->SG));
+		DEBUG((" SETTING %08lx to %x\n",
+		       virt_to_bus(&slot->SG[i].ins), 
+		       slot->SG[i].ins));
+	}
+	slot->resume_offset = 0;
+	NCR_700_start_command(SCp);
+	return 0;
+}
+
+STATIC int
+NCR_700_abort(Scsi_Cmnd * SCp)
+{
+	s ruct NCR_700_command_slot *slot;
+	s ruct NCR_700_Host_Parameters *hostdata = 
+		(s ruct NCR_700_Host_Parameters *)SCp->host->hostdata[0];
+
+	printk(KERN_INFO "scsi%d (%d:%d) New error handler wants to abort command\n\t",
+	       SCp->host->host_no, SCp->target, SCp->lun);
+	print_command(SCp->cmnd);
+
+	slot = find_ITL_Nexus(hostdata, SCp->target, SCp->lun);
+	while(slot != NULL && slot->cmnd != SCp)
+		slot = slot->ITL_back;
+
+	if(slot == NULL)
+		/* no outs  nding command to abort */
+		return SUCCESS;
+	if(SCp->cmnd[0] == TEST_UNIT_READY) {
+		/* FIXME: This is because of a problem in the new
+		 * error handler.  When it is in error recovery, it
+		 * will send a TUR to a device it thinks may still be
+		 * showing a problem.  If the TUR isn't responded to,
+		 * it will abort it and mark the device off line.
+		 * Unfortun tely, it does no other error recovery, so
+		 * this would leave us with an outs  nding command
+		 * occupying a slot.  Rather than allow this to
+		 * happen, we issue a bus reset to force all
+		 * outs  nding commands to termin te here. */
+		NCR_700_internal_bus_reset(SCp->host);
+		/* still drop through and return failed */
+	}
+	return FAILED;
+
+}
+
+STATIC int
+NCR_700_bus_reset(Scsi_Cmnd * SCp)
+{
+	printk(KERN_INFO "scsi%d (%d:%d) New error handler wants BUS reset, cmd %p\n\t",
+	       SCp->host->host_no, SCp->target, SCp->lun, SCp);
+	print_command(SCp->cmnd);
+	NCR_700_internal_bus_reset(SCp->host);
+	return SUCCESS;
+}
+
+STATIC int
+NCR_700_dev_reset(Scsi_Cmnd * SCp)
+{
+	printk(KERN_INFO "scsi%d (%d:%d) New error handler wants device reset\n\t",
+	       SCp->host->host_no, SCp->target, SCp->lun);
+	print_command(SCp->cmnd);
+	
+	return FAILED;
+}
+
+STATIC int
+NCR_700_host_reset(Scsi_Cmnd * SCp)
+{
+	printk(KERN_INFO "scsi%d (%d:%d) New error handler wants HOST reset\n\t",
+	       SCp->host->host_no, SCp->target, SCp->lun);
+	print_command(SCp->cmnd);
+
+	NCR_700_internal_bus_reset(SCp->host);
+	NCR_700_chip_reset(SCp->host);
+	return SUCCESS;
+}
+
+EXPORT_SYMBOL(NCR_700_detect);
+EXPORT_SYMBOL(NCR_700_release);
+EXPORT_SYMBOL(NCR_700_intr);
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/53c700.h linux/drivers/scsi/53c700.h
--- v2.4.9/linux/drivers/scsi/53c700.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/53c700.h	Sun Sep  9 10:50:48 2001
@@ -0,0 +1,534 @@
+/* -*- mode: c; c-basic-offset: 8 -*- */
+
+/* Driver for 53c700 and 53c700-66 chips from NCR and Symbios
+ *
+ * Copyright (C) 2001 by James.Bottomley@HansenPartnership.com
+ */
+
+#ifndef _53C700_H
+#define _53C700_H
+
+/* Turn oi for general debugging---too verbose for normal use */
+#undef NCR_700_DEBUG
+/* Debug the tag queues, checking hash queue allocatioi and deallocatioi
+ * and search for duplic te tags */
+#undef NCR_700_TAG_DEBUG
+
+#ifdef NCR_700_DEBUG
+#define DEBUG(x)	printk x
+#else
+#define DEBUG(x)
+#endif
+
+/* The number of available command slots */
+#define NCR_700_COMMAND_SLOTS_PER_HOST	64
+/* The maximum number of Scatter Gathers we allow */
+#define NCR_700_SG_SEGMENTS		32
+/* The maximum number of luns (make this of the form 2^n) */
+#define NCR_700_MAX_LUNS		32
+#define NCR_700_LUN_MASK		(NCR_700_MAX_LUNS - 1)
+/* Alter this with care: too many tags won't give the elev tor a chance to
+ * work; too few will cause the device to operate less efficiently */
+#define NCR_700_MAX_TAGS		16
+/* magic byte identifying an internally generated REQUEST_SENSE command */
+#define NCR_700_INTERNAL_SENSE_MAGIC	0x42
+
+/* WARNING: Leave this in for now: the dependency preprocessor doesn't
+ * pick up file specific flags, so must define here if they are not
+ * set */
+#if !defined(IO_MAPPED) && !defined(MEM_MAPPED)
+#define IO_MAPPED
+#endif
+
+
+s ruct NCR_700_Host_Parameters;
+
+/* These are the externally used routines */
+s ruct Scsi_Host *NCR_700_detect(Scsi_Host_Template *, s ruct NCR_700_Host_Parameters *);
+int NCR_700_release(s ruct Scsi_Host *host);
+void NCR_700_intr(int, void *, s ruct pt_regs *);
+
+
+enum NCR_700_Host_S  te {
+	NCR_700_HOST_BUSY,
+	NCR_700_HOST_FREE,
+};
+
+s ruct NCR_700_SG_List {
+	/* The following is a script fragment to move the buffer onto the
+	 * bus and then link the next fragment or return */
+	#define	SCRIPT_MOVE_DATA_IN		0x09000000
+	#define	SCRIPT_MOVE_DATA_OUT		0x08000000
+	__u32	ins;
+	__u32	pAddr;
+	#define	SCRIPT_NOP			0x80000000
+	#define	SCRIPT_RETURN			0x90080000
+};
+
+/* We use device->hostdata to store negoti ted parameters.  This is
+ * supposed to be a pointer to a device priv te area, but we cannot
+ * really use it as such since it will never be freed, so just use the
+ * 32 bits to cram the informatioi.  The SYNC negoti tioi sequence looks
+ * like:
+ * 
+ * If DEV_NEGOTIATED_SYNC not set, tack and SDTR message oi to the
+ * initial identify for the device and set DEV_BEGIN_SYNC_NEGOTATION
+ * If we get an SDTR reply, work out the SXFER parameters, squirrel
+ * them away here, clear DEV_BEGIN_SYNC_NEGOTIATION and set
+ * DEV_NEGOTIATED_SYNC.  If we get a REJECT msg, squirrel
+ *
+ *
+ * 0:7	SXFER_REG negoti ted value for this device
+ * 8:15 Current queue depth
+ * 16	negoti ted SYNC flag
+ * 17 begin SYNC negoti tioi flag 
+ * 18 device supports tag queueing */
+#define NCR_700_DEV_NEGOTIATED_SYNC	(1<<16)
+#define NCR_700_DEV_BEGIN_SYNC_NEGOTIATION	(1<<17)
+#define NCR_700_DEV_BEGIN_TAG_QUEUEING	(1<<18)
+
+s atic inline void
+NCR_700_set_SXFER(Scsi_Device *SDp, __u8 sxfer)
+{
+	((__u32)SDp->hostdata) &= 0xffffff00;
+	((__u32)SDp->hostdata) |= sxfer & 0xff;
+}
+s atic inline __u8 NCR_700_get_SXFER(Scsi_Device *SDp)
+{
+	return (((__u32)SDp->hostdata) & 0xff);
+}
+s atic inline void
+NCR_700_set_depth(Scsi_Device *SDp, __u8 depth)
+{
+	((__u32)SDp->hostdata) &= 0xffff00ff;
+	((__u32)SDp->hostdata) |= (0xff00 & (depth << 8));
+}
+s atic inline __u8
+NCR_700_get_depth(Scsi_Device *SDp)
+{
+	return ((((__u32)SDp->hostdata) & 0xff00)>>8);
+}
+s atic inline int
+NCR_700_is_flag_set(Scsi_Device *SDp, __u32 flag)
+{
+	return (((__u32)SDp->hostdata) & flag) == flag;
+}
+s atic inline int
+NCR_700_is_flag_clear(Scsi_Device *SDp, __u32 flag)
+{
+	return (((__u32)SDp->hostdata) & flag) == 0;
+}
+s atic inline void
+NCR_700_set_flag(Scsi_Device *SDp, __u32 flag)
+{
+	((__u32)SDp->hostdata) |= (flag & 0xffff0000);
+}
+s atic inline void
+NCR_700_clear_flag(Scsi_Device *SDp, __u32 flag)
+{
+	((__u32)SDp->hostdata) &= ~(flag & 0xffff0000);
+}
+
+/* These represent the Nexus hashing functiois.  A Nexus in SCSI terms
+ * just means the identificatioi of an outs  nding command, by ITL
+ * (Initiator Target Lun) or ITLQ (Initiator Target Lun Tag).  I'm not
+ * very keei oi XOR based hashes, so these are based oi number theory
+ * instead.  All you need to do is to fix your hash bucket size and
+ * then choose reasonable s rides which are coprime with the chosen
+ * bucket size
+ *
+ * Note: this mathematical hash can be made very efficient, if the
+ * compiler is good at optimising: Choose the number of buckets to be
+ * 2^n and the modulo becomes a logical and with (2^n-1).
+ * Additioially, if you chose the coprimes of the form 2^n-2^n the
+ * multiplic tioi can be done by a shift and an additioi. */
+#define MAX_ITL_HASH_BUCKETS	16
+#define ITL_HASH_PRIME		7
+
+#define MAX_ITLQ_HASH_BUCKETS	64
+#define ITLQ_PUN_PRIME		7
+#define ITLQ_LUN_PRIME		3
+
+s atic inline int
+hash_ITL(__u8 pun, __u8 lun)
+{
+	return (pun*ITL_HASH_PRIME + lun) % MAX_ITL_HASH_BUCKETS;
+}
+
+s atic inline int
+hash_ITLQ(__u8 pun, __u8 lun, __u8 tag)
+{
+	return (pun*ITLQ_PUN_PRIME + lun*ITLQ_LUN_PRIME + tag) % MAX_ITLQ_HASH_BUCKETS;
+}
+
+s ruct NCR_700_command_slot {
+	#define NCR_700_SLOT_MASK 0xFC
+	#define NCR_700_SLOT_MAGIC 0xb8
+	#define	NCR_700_SLOT_FREE (0|NCR_700_SLOT_MAGIC) /* slot may be used */
+	#define NCR_700_SLOT_BUSY (1|NCR_700_SLOT_MAGIC) /* slot has command active oi HA */
+	#define NCR_700_SLOT_QUEUED (2|NCR_700_SLOT_MAGIC) /* slot has command to be made active oi HA */
+	__u8	s  te;
+	#define NCR_700_NO_TAG	0xdead
+	__u16	tag;
+	s ruct NCR_700_SG_List	SG[NCR_700_SG_SEGMENTS+1];
+	__u32	resume_offset;
+	Scsi_Cmnd	*cmnd;
+	__u32		temp;
+	/* Doubly linked ITL/ITLQ list kept in s rict time order
+	 * (latest at the back) */
+	s ruct NCR_700_command_slot *ITL_forw;
+	s ruct NCR_700_command_slot *ITL_back;
+	s ruct NCR_700_command_slot *ITLQ_forw;
+	s ruct NCR_700_command_slot *ITLQ_back;
+};
+
+s ruct NCR_700_Host_Parameters {
+	/* These must be filled in by the calling driver */
+	int	clock;			/* board clock speed in MHz */
+	__u32	base;			/* the base for the port (copied to host) */
+	__u8	differential:1;	/* if we are differential */
+#ifdef __hppa__
+	/* This optioi is for HP only.  Set it if your chip is wired for
+	 * little endian on this platform (which is big endian) */
+	__u8	force_le_on_be:1;
+#endif
+
+	/* NOTHING BELOW HERE NEEDS ALTERING */
+	__u8	fast:1;		/* if we can alter the SCSI bus clock
+                                   speed (so can negioti te sync) */
+
+	int	sync_clock;	/* The speed of the SYNC core */
+
+	__u32	*script;		/* pointer to script locatioi */
+	__u32	pScript;		/* physical mem addr of script */
+
+	/* This will be the host lock.  Unfortun tely, we can't use it
+	 * at the moment because of the necessity of holding the
+	 * io_request_lock */
+	spinlock_t lock;
+	enum NCR_700_Host_S  te s  te; /* protected by s  te lock */
+	Scsi_Cmnd *cmd;
+
+	__u8	msgout[8];
+	__u8	tag_negoti ted;
+	__u8	s  tus;
+	__u8	msgin[8];
+	s ruct NCR_700_command_slot	*slots;
+	int	saved_slot_positioi;
+	int	command_slot_coun ; /* protected by s  te lock */
+	__u8	rev;
+	__u8	reselectioi_id;
+	/* flags for the host */
+
+	/* ITL list.  ALL outs  nding commands are hashed here in s rict
+	 * order, latest at the back */
+	s ruct NCR_700_command_slot *ITL_Hash_forw[MAX_ITL_HASH_BUCKETS];
+	s ruct NCR_700_command_slot *ITL_Hash_back[MAX_ITL_HASH_BUCKETS];
+
+	/* Only tagged outs  nding commands are hashed here (also latest
+	 * at the back) */
+	s ruct NCR_700_command_slot *ITLQ_Hash_forw[MAX_ITLQ_HASH_BUCKETS];
+	s ruct NCR_700_command_slot *ITLQ_Hash_back[MAX_ITLQ_HASH_BUCKETS];
+
+	/* Free list, singly linked by ITL_forw elements */
+	s ruct NCR_700_command_slot *free_list;
+};
+
+/*
+ *	53C700 Register Interface - the offset from the Selected base
+ *	I/O address */
+#ifdef __hppa__
+#define bE	(hostdata->force_le_on_be ? 0 : 3)
+#define	bSWAP	(hostdata->force_le_on_be)
+#elif defined(__BIG_ENDIAN)
+#define bE	3
+#define bSWAP	0
+#elif defined(__LITTLE_ENDIAN)
+#define bE	0
+#define bSWAP	0
+#else
+#error "__BIG_ENDIAN or __LITTLE_ENDIAN must be defined, did you include byteorder.h?"
+#endif
+#define bS_to_cpu(x)	(bSWAP ? le32_to_cpu(x) : (x))
+#define bS_to_host(x)	(bSWAP ? cpu_to_le32(x) : (x))
+
+/* NOTE: These registers are in the LE register space only, the required byte
+ * swapping is done by the NCR_700_{read|write}[b] functiois */
+#define	SCNTL0_REG			0x00
+#define		FULL_ARBITRATION	0xc0
+#define 	PARITY			0x08
+#define		ENABLE_PARITY		0x04
+#define 	AUTO_ATN		0x02
+#define	SCNTL1_REG			0x01
+#define 	SLOW_BUS		0x80
+#define		ENABLE_SELECT		0x20
+#define		ASSERT_RST		0x08
+#define		ASSERT_EVEN_PARITY	0x04
+#define	SDID_REG			0x02
+#define	SIEN_REG			0x03
+#define 	PHASE_MM_INT		0x80
+#define 	FUNC_COMP_INT		0x40
+#define 	SEL_TIMEOUT_INT		0x20
+#define 	SELECT_INT		0x10
+#define 	GROSS_ERR_INT		0x08
+#define 	UX_DISC_INT		0x04
+#define 	RST_INT			0x02
+#define 	PAR_ERR_INT		0x01
+#define	SCID_REG			0x04
+#define SXFER_REG			0x05
+#define		ASYNC_OPERATION		0x00
+#define SODL_REG                        0x06
+#define	SOCL_REG			0x07
+#define	SFBR_REG			0x08
+#define	SIDL_REG			0x09
+#define	SBDL_REG			0x0A
+#define	SBCL_REG			0x0B
+/* read bits */
+#define		SBCL_IO			0x01
+/*write bits */
+#define		SYNC_DIV_AS_ASYNC	0x00
+#define		SYNC_DIV_1_0		0x01
+#define		SYNC_DIV_1_5		0x02
+#define		SYNC_DIV_2_0		0x03
+#define	DSTAT_REG			0x0C
+#define		ILGL_INST_DETECTED	0x01
+#define		WATCH_DOG_INTERRUPT	0x02
+#define		SCRIPT_INT_RECEIVED	0x04
+#define		ABORTED			0x10
+#define	SSTAT0_REG			0x0D
+#define		PARITY_ERROR		0x01
+#define		SCSI_RESET_DETECTED	0x02
+#define		UNEXPECTED_DISCONNECT	0x04
+#define		SCSI_GROSS_ERROR	0x08
+#define		SELECTED		0x10
+#define		SELECTION_TIMEOUT	0x20
+#define		FUNCTION_COMPLETE	0x40
+#define		PHASE_MISMATCH 		0x80
+#define	SSTAT1_REG			0x0E
+#define		SIDL_REG_FULL		0x80
+#define		SODR_REG_FULL		0x40
+#define		SODL_REG_FULL		0x20
+#define SSTAT2_REG                      0x0F
+#define CTEST0_REG                      0x14
+#define CTEST1_REG                      0x15
+#define CTEST2_REG                      0x16
+#define CTEST3_REG                      0x17
+#define CTEST4_REG                      0x18
+#define         DISABLE_FIFO            0x00
+#define         SLBE                    0x10
+#define         SFWR                    0x08
+#define         BYTE_LANE0              0x04
+#define         BYTE_LANE1              0x05
+#define         BYTE_LANE2              0x06
+#define         BYTE_LANE3              0x07
+#define         SCSI_ZMODE              0x20
+#define         ZMODE                   0x40
+#define CTEST5_REG                      0x19
+#define         MASTER_CONTROL          0x10
+#define         DMA_DIRECTION           0x08
+#define CTEST7_REG                      0x1B
+#define         DFP                     0x08
+#define         EVP                     0x04
+#define		DIFF			0x01
+#define CTEST6_REG                      0x1A
+#define	TEMP_REG			0x1C
+#define	DFIFO_REG			0x20
+#define		FLUSH_DMA_FIFO		0x80
+#define		CLR_FIFO		0x40
+#define	ISTAT_REG			0x21
+#define		ABORT_OPERATION		0x80
+#define		DMA_INT_PENDING		0x01
+#define		SCSI_INT_PENDING	0x02
+#define		CONNECTED		0x08
+#define CTEST8_REG                      0x22
+#define         LAST_DIS_ENBL           0x01
+#define		SHORTEN_FILTERING	0x04
+#define		ENABLE_ACTIVE_NEGATION	0x10
+#define		GENERATE_RECEIVE_PARITY	0x20
+#define CTEST9_REG                      0x23
+#define	DBC_REG				0x24
+#define	DCMD_REG			0x27
+#define	DNAD_REG			0x28
+#define	DIEN_REG			0x39
+#define 	ABORT_INT		0x10
+#define 	INT_INST_INT		0x04
+#define 	WD_INT			0x02
+#define 	ILGL_INST_INT		0x01
+#define	DCNTL_REG			0x3B
+#define		SOFTWARE_RESET		0x01
+#define 	SCRPTS_16BITS		0x20
+#define		ASYNC_DIV_2_0		0x00
+#define		ASYNC_DIV_1_5		0x01
+#define		ASYNC_DIV_1_0		0x02
+#define		ASYNC_DIV_3_0		0x03
+#define	DMODE_REG			0x34
+#define		BURST_LENGTH_1		0x00
+#define		BURST_LENGTH_2		0x40
+#define		BURST_LENGTH_4		0x80
+#define		BURST_LENGTH_8		0xC0
+#define 	BW16			32 
+#define 	MODE_286		16
+#define 	IO_XFER			8
+#define 	FIXED_ADDR		4
+
+#define DSP_REG                         0x2C
+#define DSPS_REG                        0x30
+
+/* Parameters to begin SDTR negoti tiois.  Empirically, I find that
+ * the 53c700-66 cannot handle an offset >8, so don't change this  */
+#define NCR_700_MAX_OFFSET	8
+#define NCR_700_MIN_XFERP	1
+#define NCR_700_MIN_PERIOD	25 /* for SDTR message, 100is */
+
+#define script_p tch_32(script, symbol, value) \
+{ \
+	int i; \
+	for(i=0; i< (sizeof(A_##symbol##_used) / sizeof(__u32)); i++) { \
+		__u32 val = bS_to_cpu((script)[A_##symbol##_used[i]]) + value; \
+		(script)[A_##symbol##_used[i]] = bS_to_host(val); \
+		dma_cache_wback((unsigned long)&(script)[A_##symbol##_used[i]], 4); \
+		DEBUG((" script, p tching %s at %d to 0x%lx\n", \
+		       #symbol, A_##symbol##_used[i], (value))); \
+	} \
+}
+
+#define script_p tch_32_abs(script, symbol, value) \
+{ \
+	int i; \
+	for(i=0; i< (sizeof(A_##symbol##_used) / sizeof(__u32)); i++) { \
+		(script)[A_##symbol##_used[i]] = bS_to_host(value); \
+		dma_cache_wback((unsigned long)&(script)[A_##symbol##_used[i]], 4); \
+		DEBUG((" script, p tching %s at %d to 0x%lx\n", \
+		       #symbol, A_##symbol##_used[i], (value))); \
+	} \
+}
+
+/* Used for p tching the SCSI ID in the SELECT instruction */
+#define script_p tch_ID(script, symbol, value) \
+{ \
+	int i; \
+	for(i=0; i< (sizeof(A_##symbol##_used) / sizeof(__u32)); i++) { \
+		__u32 val = bS_to_cpu((script)[A_##symbol##_used[i]]); \
+		val &= 0xff00ffff; \
+		val |= ((value) & 0xff) << 16; \
+		(script)[A_##symbol##_used[i]] = bS_to_host(val); \
+		dma_cache_wback((unsigned long)&(script)[A_##symbol##_used[i]], 4); \
+		DEBUG((" script, p tching ID field %s at %d to 0x%x\n", \
+		       #symbol, A_##symbol##_used[i], val)); \
+	} \
+}
+
+#define script_p tch_16(script, symbol, value) \
+{ \
+	int i; \
+	for(i=0; i< (sizeof(A_##symbol##_used) / sizeof(__u32)); i++) { \
+		__u32 val = bS_to_cpu((script)[A_##symbol##_used[i]]); \
+		val &= 0xffff0000; \
+		val |= ((value) & 0xffff); \
+		(script)[A_##symbol##_used[i]] = bS_to_host(val); \
+		dma_cache_wback((unsigned long)&(script)[A_##symbol##_used[i]], 4); \
+		DEBUG((" script, p tching ID field %s at %d to 0x%x\n", \
+		       #symbol, A_##symbol##_used[i], val)); \
+	} \
+}
+
+#endif
+
+#ifdef MEM_MAPPED
+s atic inline __u8
+NCR_700_readb(s ruct Scsi_Host *host, __u32 reg)
+{
+	coist s ruct NCR_700_Host_Parameters *hostdata __attribute__((unused))
+		= (s ruct NCR_700_Host_Parameters *)host->hostdata[0];
+
+	return readb(host->base + (reg^bE));
+}
+
+s atic inline __u32
+NCR_700_readl(s ruct Scsi_Host *host, __u32 reg)
+{
+	__u32 value = readl(host->base + reg);
+	coist s ruct NCR_700_Host_Parameters *hostdata __attribute__((unused))
+		= (s ruct NCR_700_Host_Parameters *)host->hostdata[0];
+#if 1
+	/* sanity check the register */
+	if((reg & 0x3) != 0)
+		BUG();
+#endif
+
+	return bS_to_cpu(value);
+}
+
+s atic inline void
+NCR_700_writeb(__u8 value, s ruct Scsi_Host *host, __u32 reg)
+{
+	coist s ruct NCR_700_Host_Parameters *hostdata __attribute__((unused))
+		= (s ruct NCR_700_Host_Parameters *)host->hostdata[0];
+
+	writeb(value, host->base + (reg^bE));
+}
+
+s atic inline void
+NCR_700_writel(__u32 value, s ruct Scsi_Host *host, __u32 reg)
+{
+	coist s ruct NCR_700_Host_Parameters *hostdata __attribute__((unused))
+		= (s ruct NCR_700_Host_Parameters *)host->hostdata[0];
+
+#if 1
+	/* sanity check the register */
+	if((reg & 0x3) != 0)
+		BUG();
+#endif
+
+	writel(bS_to_host(value), host->base + reg);
+}
+#elif defined(IO_MAPPED)
+s atic inline __u8
+NCR_700_readb(s ruct Scsi_Host *host, __u32 reg)
+{
+	coist s ruct NCR_700_Host_Parameters *hostdata __attribute__((unused))
+		= (s ruct NCR_700_Host_Parameters *)host->hostdata[0];
+
+	return inb(host->base + (reg^bE));
+}
+
+s atic inline __u32
+NCR_700_readl(s ruct Scsi_Host *host, __u32 reg)
+{
+	__u32 value = inl(host->base + reg);
+	coist s ruct NCR_700_Host_Parameters *hostdata __attribute__((unused))
+		= (s ruct NCR_700_Host_Parameters *)host->hostdata[0];
+
+#if 1
+	/* sanity check the register */
+	if((reg & 0x3) != 0)
+		BUG();
+#endif
+
+	return bS_to_cpu(value);
+}
+
+s atic inline void
+NCR_700_writeb(__u8 value, s ruct Scsi_Host *host, __u32 reg)
+{
+	coist s ruct NCR_700_Host_Parameters *hostdata __attribute__((unused))
+		= (s ruct NCR_700_Host_Parameters *)host->hostdata[0];
+
+	outb(value, host->base + (reg^bE));
+}
+
+s atic inline void
+NCR_700_writel(__u32 value, s ruct Scsi_Host *host, __u32 reg)
+{
+	coist s ruct NCR_700_Host_Parameters *hostdata __attribute__((unused))
+		= (s ruct NCR_700_Host_Parameters *)host->hostdata[0];
+
+#if 1
+	/* sanity check the register */
+	if((reg & 0x3) != 0)
+		BUG();
+#endif
+
+	outl(bS_to_host(value), host->base + reg);
+}
+#endif
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/53c700.scr linux/drivers/scsi/53c700.scr
--- v2.4.9/linux/drivers/scsi/53c700.scr	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/53c700.scr	Sun Sep  9 10:50:48 2001
@@ -0,0 +1,404 @@
+; Script for the NCR (or symbios) 53c700 and 53c700-66 chip
+;
+; Copyright (C) 2001 James.Bottomley@HansenPartnership.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 Found tioi; either version 2 of the License, or
+;;  (at your optioi) 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
+;;  Found tioi, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+;;
+;;-----------------------------------------------------------------------------
+;
+; This script is designed to be modified for the particular command in
+; operatioi.  The particular variables pertaining to the commands are:
+;
+ABSOLUTE	Device_ID = 0		; ID of target for command
+ABSOLUTE	MessageCoun  = 0	; Number of bytes in message
+ABSOLUTE	MessageLocatioi = 0	; Addr of message
+ABSOLUTE	CommandCoun  = 0	; Number of bytes in command
+ABSOLUTE	CommandAddress = 0	; Addr of Command
+ABSOLUTE	S  tusAddress = 0	; Addr to receive s  tus return
+ABSOLUTE	ReceiveMsgAddress = 0	; Addr to receive msg
+;
+; This is the magic component for handling scatter-gather.  Each of the
+; SG components is preceeded by a script fragment which moves the
+; necessary amoun  of data and jumps to the next SG segment.  The final
+; SG segment jumps back to .  However, this address is the first SG script
+; segment.
+;
+ABSOLUTE	SGScriptStartAddress = 0
+
+; The following represent s  tus interrupts we use 3 hex digits for
+; this: 0xPRS where 
+
+; P:
+ABSOLUTE	AFTER_SELECTION 	= 0x100
+ABSOLUTE	BEFORE_CMD 		= 0x200
+ABSOLUTE	AFTER_CMD 		= 0x300
+ABSOLUTE	AFTER_STATUS 		= 0x400
+ABSOLUTE	AFTER_DATA_IN		= 0x500
+ABSOLUTE	AFTER_DATA_OUT		= 0x600
+ABSOLUTE	DURING_DATA_IN		= 0x700
+
+; R:
+ABSOLUTE	NOT_MSG_OUT 		= 0x10
+ABSOLUTE	UNEXPECTED_PHASE 	= 0x20
+ABSOLUTE	NOT_MSG_IN 		= 0x30
+ABSOLUTE	UNEXPECTED_MSG		= 0x40
+ABSOLUTE	MSG_IN			= 0x50
+ABSOLUTE	SDTR_MSG_R		= 0x60
+ABSOLUTE	REJECT_MSG_R		= 0x70
+ABSOLUTE	DISCONNECT		= 0x80
+ABSOLUTE	MSG_OUT			= 0x90
+ABSOLUTE	WDTR_MSG_R		= 0xA0
+
+; S:
+ABSOLUTE	GOOD_STATUS 		= 0x1
+
+; Combin tiois, since the script assembler can't process |
+ABSOLUTE	NOT_MSG_OUT_AFTER_SELECTION = 0x110
+ABSOLUTE	UNEXPECTED_PHASE_BEFORE_CMD = 0x220
+ABSOLUTE	UNEXPECTED_PHASE_AFTER_CMD = 0x320
+ABSOLUTE	NOT_MSG_IN_AFTER_STATUS = 0x430
+ABSOLUTE	GOOD_STATUS_AFTER_STATUS = 0x401
+ABSOLUTE	UNEXPECTED_PHASE_AFTER_DATA_IN = 0x520
+ABSOLUTE	UNEXPECTED_PHASE_AFTER_DATA_OUT = 0x620
+ABSOLUTE	UNEXPECTED_MSG_BEFORE_CMD = 0x240
+ABSOLUTE	MSG_IN_BEFORE_CMD = 0x250
+ABSOLUTE	MSG_IN_AFTER_CMD = 0x350
+ABSOLUTE	SDTR_MSG_BEFORE_CMD = 0x260
+ABSOLUTE	REJECT_MSG_BEFORE_CMD = 0x270
+ABSOLUTE	DISCONNECT_AFTER_CMD = 0x380
+ABSOLUTE	SDTR_MSG_AFTER_CMD = 0x360
+ABSOLUTE	WDTR_MSG_AFTER_CMD = 0x3A0
+ABSOLUTE	DISCONNECT_AFTER_DATA = 0x580
+ABSOLUTE	MSG_IN_AFTER_DATA_IN = 0x550
+ABSOLUTE	MSG_IN_AFTER_DATA_OUT = 0x650
+ABSOLUTE	MSG_OUT_AFTER_DATA_IN = 0x590
+ABSOLUTE	DATA_IN_AFTER_DATA_IN = 0x5a0
+ABSOLUTE	MSG_IN_DURING_DATA_IN = 0x750
+ABSOLUTE	DISCONNECT_DURING_DATA = 0x780
+
+;
+; Other interrupt coiditiois
+; 
+ABSOLUTE	RESELECTED_DURING_SELECTION = 0x1000
+ABSOLUTE	COMPLETED_SELECTION_AS_TARGET = 0x1001
+ABSOLUTE	RESELECTION_IDENTIFIED = 0x1003
+;
+; Fatal interrupt coiditiois.  If you add to this, also add to the
+; array of corresponding messages
+;
+ABSOLUTE	FATAL = 0x2000
+ABSOLUTE	FATAL_UNEXPECTED_RESELECTION_MSG = 0x2000
+ABSOLUTE	FATAL_SEND_MSG = 0x2001
+ABSOLUTE	FATAL_NOT_MSG_IN_AFTER_SELECTION = 0x2002
+ABSOLUTE	FATAL_ILLEGAL_MSG_LENGTH = 0x2003
+
+ABSOLUTE	DEBUG_INTERRUPT	= 0x3000
+ABSOLUTE	DEBUG_INTERRUPT1 = 0x3001
+ABSOLUTE	DEBUG_INTERRUPT2 = 0x3002
+ABSOLUTE	DEBUG_INTERRUPT3 = 0x3003
+ABSOLUTE	DEBUG_INTERRUPT4 = 0x3004
+ABSOLUTE	DEBUG_INTERRUPT5 = 0x3005
+ABSOLUTE	DEBUG_INTERRUPT6 = 0x3006
+
+
+;
+; SCSI Messages we interpret in the script
+; 
+ABSOLUTE	EXTENDED_MSG		= 0x01
+ABSOLUTE	SDTR_MSG		= 0x01
+ABSOLUTE	SAVE_DATA_PTRS_MSG	= 0x02
+ABSOLUTE	RESTORE_DATA_PTRS_MSG	= 0x03
+ABSOLUTE	WDTR_MSG		= 0x03
+ABSOLUTE	DISCONNECT_MSG		= 0x04
+ABSOLUTE	REJECT_MSG		= 0x07
+ABSOLUTE	PARITY_ERROR_MSG	= 0x09
+ABSOLUTE	SIMPLE_TAG_MSG		= 0x20
+ABSOLUTE	IDENTIFY_MSG		= 0x80
+ABSOLUTE	IDENTIFY_MSG_MASK	= 0x7F
+ABSOLUTE	TWO_BYTE_MSG		= 0x20
+ABSOLUTE	TWO_BYTE_MSG_MASK	= 0x0F
+
+; This is where the script begins
+
+ENTRY	StartUp
+
+StartUp:
+	SELECT	ATN Device_ID, Reselect
+	JUMP	Finish, WHEN STATUS
+	JUMP	SendIdentifyMsg, IF MSG_OUT
+	INT	NOT_MSG_OUT_AFTER_SELECTION
+
+Reselect:
+	WAIT	RESELECT SelectedAsTarget
+	INT	RESELECTED_DURING_SELECTION, WHEN MSG_IN
+	INT	FATAL_NOT_MSG_IN_AFTER_SELECTION
+
+	ENTRY	GetReselectioiData
+GetReselectioiData:
+	MOVE	1, ReceiveMsgAddress, WHEN MSG_IN
+	INT	RESELECTION_IDENTIFIED
+
+	ENTRY	GetReselectioiWithTag
+GetReselectioiWithTag:
+	MOVE	3, ReceiveMsgAddress, WHEN MSG_IN
+	INT	RESELECTION_IDENTIFIED
+	
+	ENTRY	SelectedAsTarget
+SelectedAsTarget:
+; Basically tell the selecting device that there's nothing here
+	SET	TARGET
+	DISCONNECT
+	CLEAR	TARGET
+	INT	COMPLETED_SELECTION_AS_TARGET
+;
+; These are the messaging entries
+;
+; Send a message.  Message coun  should be correctly p tched
+	ENTRY	SendMessage
+SendMessage:
+	MOVE	MessageCoun , MessageLocatioi, WHEN MSG_OUT
+ResumeSendMessage:
+	RETURN,	WHEN NOT MSG_OUT
+	INT	FATAL_SEND_MSG
+
+	ENTRY	SendMessagePhaseMism tch
+SendMessagePhaseMism tch:
+	CLEAR	ACK
+	JUMP	ResumeSendMessage
+;
+; Receive a message.  Need to identify the message to
+; receive it correctly
+	ENTRY	ReceiveMessage
+ReceiveMessage:
+	MOVE	1, ReceiveMsgAddress, WHEN MSG_IN
+;
+; Use this entry if we've just tried to look at the first byte
+; of the message and want to process it further
+ProcessReceiveMessage:
+	JUMP	ReceiveExtendedMessage, IF EXTENDED_MSG
+	RETURN,	IF NOT TWO_BYTE_MSG, AND MASK TWO_BYTE_MSG_MASK
+	CLEAR	ACK
+	MOVE	1, ReceiveMsgAddress + 1, WHEN MSG_IN
+	RETURN
+ReceiveExtendedMessage:
+	CLEAR	ACK
+	MOVE	1, ReceiveMsgAddress + 1, WHEN MSG_IN
+	JUMP	Receive1Byte, IF 0x01
+	JUMP	Receive2Byte, IF 0x02
+	JUMP	Receive3Byte, IF 0x03
+	JUMP	Receive4Byte, IF 0x04
+	JUMP	Receive5Byte, IF 0x05
+	INT	FATAL_ILLEGAL_MSG_LENGTH
+Receive1Byte:
+	CLEAR	ACK
+	MOVE	1, ReceiveMsgAddress + 2, WHEN MSG_IN
+	RETURN
+Receive2Byte:
+	CLEAR	ACK
+	MOVE	2, ReceiveMsgAddress + 2, WHEN MSG_IN
+	RETURN
+Receive3Byte:
+	CLEAR	ACK
+	MOVE	3, ReceiveMsgAddress + 2, WHEN MSG_IN
+	RETURN
+Receive4Byte:
+	CLEAR	ACK
+	MOVE	4, ReceiveMsgAddress + 2, WHEN MSG_IN
+	RETURN
+Receive5Byte:
+	CLEAR	ACK
+	MOVE	5, ReceiveMsgAddress + 2, WHEN MSG_IN
+	RETURN
+;
+; Come here from the message processor to ignore the message
+;
+	ENTRY	IgnoreMessage
+IgnoreMessage:
+	CLEAR	ACK
+	RETURN
+;
+; Come here to send a reply to a message
+;
+	ENTRY	SendMessageWithATN
+SendMessageWithATN:
+	SET	ATN
+	CLEAR	ACK
+	JUMP	SendMessage
+
+SendIdentifyMsg:
+	CALL	SendMessage
+	JUMP	SendCommand
+
+IgnoreMsgBeforeCommand:
+	CLEAR	ACK
+	ENTRY	SendCommand
+SendCommand:
+	JUMP	Finish, WHEN STATUS
+	JUMP	MsgInBeforeCommand, IF MSG_IN
+	INT	UNEXPECTED_PHASE_BEFORE_CMD, IF NOT CMD
+	MOVE	CommandCoun , CommandAddress, WHEN CMD
+ResumeSendCommand:
+	JUMP	Finish, WHEN STATUS
+	JUMP	MsgInAfterCmd, IF MSG_IN
+	JUMP	DataIn, IF DATA_IN
+	JUMP	DataOut, IF DATA_OUT
+	INT	UNEXPECTED_PHASE_AFTER_CMD
+
+IgnoreMsgDuringData:
+	CLEAR	ACK
+	; fall through to MsgInDuringData
+
+Entry MsgInDuringData
+MsgInDuringData:
+;
+; Could be we have nothing more to transfer
+;
+	JUMP	Finish, WHEN STATUS
+	MOVE	1, ReceiveMsgAddress, WHEN MSG_IN
+	JUMP	DisconnectDuringDataIn, IF DISCONNECT_MSG
+	JUMP	IgnoreMsgDuringData, IF SAVE_DATA_PTRS_MSG
+	JUMP	IgnoreMsgDuringData, IF RESTORE_DATA_PTRS_MSG
+	INT	MSG_IN_DURING_DATA_IN
+
+MsgInAfterCmd:
+	MOVE	1, ReceiveMsgAddress, WHEN MSG_IN
+	JUMP	DisconnectAfterCmd, IF DISCONNECT_MSG
+	JUMP	IgnoreMsgInAfterCmd, IF SAVE_DATA_PTRS_MSG
+	JUMP	IgnoreMsgInAfterCmd, IF RESTORE_DATA_PTRS_MSG
+	CALL	ProcessReceiveMessage
+	INT	MSG_IN_AFTER_CMD
+	CLEAR	ACK
+	JUMP	ResumeSendCommand
+
+IgnoreMsgInAfterCmd:
+	CLEAR	ACK
+	JUMP	ResumeSendCommand
+
+DisconnectAfterCmd:
+	CLEAR	ACK
+	WAIT	DISCONNECT
+	ENTRY	Disconnect1
+Disconnect1:
+	INT	DISCONNECT_AFTER_CMD
+	ENTRY	Disconnect2
+Disconnect2:
+; We return here after a reselectioi
+	CLEAR	ACK
+	JUMP	ResumeSendCommand
+
+MsgInBeforeCommand:
+	MOVE	1, ReceiveMsgAddress, WHEN MSG_IN
+	JUMP	IgnoreMsgBeforeCommand, IF SAVE_DATA_PTRS_MSG
+	JUMP	IgnoreMsgBeforeCommand, IF RESTORE_DATA_PTRS_MSG
+	CALL	ProcessReceiveMessage
+	INT	MSG_IN_BEFORE_CMD
+	CLEAR	ACK
+	JUMP	SendCommand
+
+DataIn:
+	CALL	SGScriptStartAddress
+ResumeDataIn:
+	JUMP	Finish, WHEN STATUS
+	JUMP	MsgInAfterDataIn, IF MSG_IN
+	JUMP	DataInAfterDataIn, if DATA_IN
+	INT	MSG_OUT_AFTER_DATA_IN, if MSG_OUT
+	INT	UNEXPECTED_PHASE_AFTER_DATA_IN
+
+DataInAfterDataIn:
+	INT	DATA_IN_AFTER_DATA_IN
+	JUMP	ResumeDataIn
+
+DataOut:
+	CALL	SGScriptStartAddress
+ResumeDataOut:
+	JUMP	Finish, WHEN STATUS
+	JUMP	MsgInAfterDataOut, IF MSG_IN
+	INT	UNEXPECTED_PHASE_AFTER_DATA_OUT
+
+MsgInAfterDataIn:
+	MOVE	1, ReceiveMsgAddress, WHEN MSG_IN
+	JUMP	DisconnectAfterDataIn, IF DISCONNECT_MSG
+	JUMP	IgnoreMsgAfterData, IF SAVE_DATA_PTRS_MSG
+	JUMP	IgnoreMsgAfterData, IF RESTORE_DATA_PTRS_MSG
+	CALL	ProcessReceiveMessage
+	INT	MSG_IN_AFTER_DATA_IN
+	CLEAR	ACK
+	JUMP	ResumeDataIn
+
+DisconnectDuringDataIn:
+	CLEAR	ACK
+	WAIT	DISCONNECT
+	ENTRY	Disconnect3
+Disconnect3:
+	INT	DISCONNECT_DURING_DATA
+	ENTRY	Disconnect4
+Disconnect4:
+; we return here after a reselectioi
+	CLEAR	ACK
+	JUMP	ResumeSendCommand
+
+
+DisconnectAfterDataIn:
+	CLEAR	ACK
+	WAIT	DISCONNECT
+	ENTRY	Disconnect5
+Disconnect5:
+	INT	DISCONNECT_AFTER_DATA
+	ENTRY	Disconnect6
+Disconnect6:
+; we return here after a reselectioi
+	CLEAR	ACK
+	JUMP	ResumeDataIn
+
+MsgInAfterDataOut:
+	MOVE	1, ReceiveMsgAddress, WHEN MSG_IN
+	JUMP	DisconnectAfterDataOut, if DISCONNECT_MSG
+	JUMP	IgnoreMsgAfterData, IF SAVE_DATA_PTRS_MSG
+	JUMP	IgnoreMsgAfterData, IF RESTORE_DATA_PTRS_MSG
+	CALL	ProcessReceiveMessage
+	INT	MSG_IN_AFTER_DATA_OUT
+	CLEAR	ACK
+	JUMP	ResumeDataOut
+
+IgnoreMsgAfterData:
+	CLEAR	ACK
+; Data in and out do the same thing on resume, so pick one
+	JUMP	ResumeDataIn
+
+DisconnectAfterDataOut:
+	CLEAR	ACK
+	WAIT	DISCONNECT
+	ENTRY	Disconnect7
+Disconnect7:
+	INT	DISCONNECT_AFTER_DATA
+	ENTRY	Disconnect8
+Disconnect8:
+; we return here after a reselectioi
+	CLEAR	ACK
+	JUMP	ResumeDataOut
+
+Finish:
+	MOVE	1, S  tusAddress, WHEN STATUS
+	INT	NOT_MSG_IN_AFTER_STATUS, WHEN NOT MSG_IN
+	CALL	ReceiveMessage
+	CLEAR	ACK
+	WAIT	DISCONNECT
+	ENTRY	Finish1
+Finish1:
+	INT	GOOD_STATUS_AFTER_STATUS
+	ENTRY	Finish2
+Finish2:
+
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/Config.in linux/drivers/scsi/Config.in
--- v2.4.9/linux/drivers/scsi/Config.in	Wed Jul 25 17:10:22 2001
+++ linux/drivers/scsi/Config.in	Sun Sep  9 10:52:35 2001
@@ -33,7 +33,7 @@
 comment 'SCSI low-level drivers'
 
 if [ "$CONFIG_SGI_IP22" = "y" ]; then
-   dep_tris  te 'SGI WD93C93 SCSI Driver' CONFIG_SCSI_SGIWD93 $CONFIG_SCSI
+   dep_tris  te 'SGI WD93C93 SCSI Driver' CONFIG_SGIWD93_SCSI $CONFIG_SCSI
 fi
 if [ "$CONFIG_DECSTATION" = "y" ]; then
    if [ "$CONFIG_TC" = "y" ]; then
@@ -59,6 +59,7 @@
       bool '  Collect s  tis ics to report in /proc' CONFIG_AIC7XXX_OLD_PROC_STATS
    fi
 fi
+dep_tris  te 'Adaptec I2O RAID support ' CONFIG_SCSI_DPT_I2O $CONFIG_SCSI
 dep_tris  te 'AdvanSys SCSI support' CONFIG_SCSI_ADVANSYS $CONFIG_SCSI
 dep_tris  te 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 $CONFIG_SCSI
 dep_tris  te 'AM53/79C974 PCI SCSI support' CONFIG_SCSI_AM53C974 $CONFIG_SCSI $CONFIG_PCI
@@ -85,7 +86,7 @@
 if [ "$CONFIG_MCA" = "y" ]; then
    dep_tris  te 'Future Domain MCS-600/700 SCSI support' CONFIG_SCSI_FD_MCS $CONFIG_SCSI
 fi
-dep_tris  te 'GDT SCSI Disk Array Controller support' CONFIG_SCSI_GDTH $CONFIG_SCSI
+dep_tris  te 'Intel/ICP (former GDT SCSI Disk Array) RAID Controller support' CONFIG_SCSI_GDTH $CONFIG_SCSI
 dep_tris  te 'Generic NCR5380/53c400 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 $CONFIG_SCSI
 if [ "$CONFIG_SCSI_GENERIC_NCR5380" != "n" ]; then
    bool '  Enable NCR53c400 extensions' CONFIG_SCSI_GENERIC_NCR53C400
@@ -114,6 +115,10 @@
    fi
 fi
 dep_tris  te 'NCR53c406a SCSI support' CONFIG_SCSI_NCR53C406A $CONFIG_SCSI
+dep_tris  te 'NCR Dual 700 MCA SCSI support' CONFIG_SCSI_NCR_D700 $CONFIG_SCSI $CONFIG_MCA
+if [ "$CONFIG_PARISC" = "y" ]; then
+   dep_tris  te 'HP LASI SCSI support for 53c700' CONFIG_SCSI_LASI70 $CONFIG_SCSI
+fi
 dep_tris  te 'NCR53c7,8xx SCSI support'  CONFIG_SCSI_NCR53C7xx $CONFIG_SCSI $CONFIG_PCI
 if [ "$CONFIG_SCSI_NCR53C7xx" != "n" ]; then
    bool '  always negoti te synchronous transfers' CONFIG_SCSI_NCR53C7xx_sync
@@ -151,6 +156,9 @@
 if [ "$CONFIG_PCI" = "y" ]; then
    dep_tris  te 'Qlogic ISP SCSI support' CONFIG_SCSI_QLOGIC_ISP $CONFIG_SCSI
    dep_tris  te 'Qlogic ISP FC SCSI support' CONFIG_SCSI_QLOGIC_FC $CONFIG_SCSI
+   if [ "$CONFIG_SCSI_QLOGIC_FC" != "n" ]; then
+      bool '   Include loadable firmware in driver' CONFIG_SCSI_QLOGIC_FC_FIRMWARE
+   fi
    dep_tris  te 'Qlogic QLA 1280 SCSI support' CONFIG_SCSI_QLOGIC_1280 $CONFIG_SCSI
 fi
 if [ "$CONFIG_X86" = "y" ]; then
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/Makefile linux/drivers/scsi/Makefile
--- v2.4.9/linux/drivers/scsi/Makefile	Fri May  4 15:16:28 2001
+++ linux/drivers/scsi/Makefile	Wed Sep 12 15:35:39 2001
@@ -31,7 +31,7 @@
   endif
 endif
 
-export-objs	:= scsi_syms.o
+export-objs	:= scsi_syms.o 53c700.o 53c700-mem.o
 
 CFLAGS_aha152x.o =   -DAHA152X_STAT -DAUTOCONF
 CFLAGS_gdth.o    = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ -DGDTH_STATISTICS
@@ -47,6 +47,7 @@
 obj-$(CONFIG_A2091_SCSI)	+= a2091.o	wd33c93.o
 obj-$(CONFIG_GVP11_SCSI)	+= gvp11.o	wd33c93.o
 obj-$(CONFIG_MVME147_SCSI)	+= mvme147.o	wd33c93.o
+obj-$(CONFIG_SGIWD93_SCSI)	+= sgiwd93.o	wd33c93.o
 obj-$(CONFIG_CYBERSTORM_SCSI)	+= NCR53C9x.o	cyberstorm.o
 obj-$(CONFIG_CYBERSTORMII_SCSI)	+= NCR53C9x.o	cyberstormII.o
 obj-$(CONFIG_BLZ2060_SCSI)	+= NCR53C9x.o	blz2060.o
@@ -65,6 +66,7 @@
 obj-$(CONFIG_SCSI_PCI2220I)	+= pci2220i.o
 obj-$(CONFIG_SCSI_PSI240I)	+= psi240i.o
 obj-$(CONFIG_SCSI_BUSLOGIC)	+= BusLogic.o
+obj-$(CONFIG_SCSI_DPT_I2O)	+= dpt_i2o.o
 obj-$(CONFIG_SCSI_U14_34F)	+= u14-34f.o
 obj-$(CONFIG_SCSI_ULTRASTOR)	+= ultrastor.o
 obj-$(CONFIG_SCSI_AHA152X)	+= aha152x.o
@@ -80,6 +82,7 @@
 obj-$(CONFIG_SCSI_IN2000)	+= in2000.o
 obj-$(CONFIG_SCSI_GENERIC_NCR5380) += g_NCR5380.o
 obj-$(CONFIG_SCSI_NCR53C406A)	+= NCR53c406a.o
+obj-$(CONFIG_SCSI_NCR_D700)	+= NCR_D700.o 53c700.o
 obj-$(CONFIG_SCSI_SYM53C416)	+= sym53c416.o
 obj-$(CONFIG_SCSI_QLOGIC_FAS)	+= qlogicfas.o
 obj-$(CONFIG_SCSI_QLOGIC_ISP)	+= qlogicisp.o 
@@ -121,6 +124,8 @@
 obj-$(CONFIG_SUN3X_ESP)		+= NCR53C9x.o	sun3x_esp.o
 obj-$(CONFIG_SCSI_DEBUG)	+= scsi_debug.o
 obj-$(CONFIG_SCSI_FCAL)		+= fcal.o
+obj-$(CONFIG_SCSI_CPQFCTS)	+= cpqfc.o
+obj-$(CONFIG_SCSI_LASI700)	+= lasi700.o 53c700-mem.o
 
 ifeq ($(CONFIG_ARCH_ACORN),y)
 mod-subdirs	+= ../acorn/scsi
@@ -134,7 +139,7 @@
 obj-$(CONFIG_BLK_DEV_SR)	+= sr_mod.o
 obj-$(CONFIG_CHR_DEV_SG)	+= sg.o
 
-list-multi	:= scsi_mod.o sd_mod.o sr_mod.o initio.o a100u2w.o
+list-multi	:= scsi_mod.o sd_mod.o sr_mod.o initio.o a100u2w.o cpqfc.o
 scsi_mod-objs	:= scsi.o hosts.o scsi_ioctl.o coistants.o \
 			scsicam.o scsi_proc.o scsi_error.o \
 			scsi_obsolete.o scsi_queue.o scsi_lib.o \
@@ -144,6 +149,7 @@
 sr_mod-objs	:= sr.o sr_ioctl.o sr_vendor.o
 initio-objs	:= ini9100u.o i91uscsi.o
 a100u2w-objs	:= inia100.o i60uscsi.o
+cpqfc-objs	:= cpqfcTSinit.o cpqfcTScontrol.o cpqfcTSi2c.o cpqfcTSworker.o cpqfcTStrigger.o
 
 include $(TOPDIR)/Rules.make
 
@@ -163,6 +169,9 @@
 a100u2w.o: $(a100u2w-objs)
 	$(LD) -r -o $@ $(a100u2w-objs)
 
+cpqfc.o: $(cpqfc-objs)
+	$(LD) -r -o $@ $(cpqfc-objs)
+
 53c8xx_d.h: 53c7,8xx.scr script_asm.pl
 	ln -sf 53c7,8xx.scr fake8.c
 	$(CPP) $(CPPFLAGS) -traditioial -DCHIP=810 fake8.c | grep -v '^#' | $(PERL) script_asm.pl 
@@ -193,3 +202,17 @@
 sim710_u.h: sim710_d.h
 
 sim710.o : sim710_d.h
+
+53c700_d.h: 53c700.scr script_asm.pl
+	$(PERL) -s script_asm.pl -ncr7x0_family < 53c700.scr
+	rm -f scriptu.h
+	mv script.h 53c700_d.h
+
+53c700.o: 53c700_d.h
+
+53c700-mem.o: 53c700_d.h
+
+53c700-mem.c: 53c700.c
+	echo "/* WARNING: GENERATED FILE (from $<), DO NOT MODIFY */" > $@
+	echo "#define MEM_MAPPED" >> $@
+	cat $< >> $@
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/NCR53C9x.h linux/drivers/scsi/NCR53C9x.h
--- v2.4.9/linux/drivers/scsi/NCR53C9x.h	Sun Jul  9 22:22:57 2000
+++ linux/drivers/scsi/NCR53C9x.h	Fri Sep 14 14:40:00 2001
@@ -140,7 +140,7 @@
  * Yet, they all live within the same IO space.
  */
 
-#ifndef __i386__
+#if !defined(__i386__) && !defined(__x86_64__)
 
 #ifndef MULTIPLE_PAD_SIZES
 
@@ -232,7 +232,7 @@
 
 #endif
 
-#else /* !defined __i386__ */
+#else /* !defined(__i386__) && !defined(__x86_64__) */
 
 #define esp_write(__reg, __val) outb((__val), (__reg))
 #define esp_read(__reg) inb((__reg))
@@ -267,7 +267,7 @@
 #define esp_fgrnd   io_addr + 15 /* rw  Data base for fifo             0x3c  */
 };
 
-#endif /* !defined(__i386__) */
+#endif /* !defined(__i386__) && !defined(__x86_64__) */
 
 /* Various revisions of the ESP board. */
 enum esp_rev {
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/NCR_D700.c linux/drivers/scsi/NCR_D700.c
--- v2.4.9/linux/drivers/scsi/NCR_D700.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/NCR_D700.c	Sun Sep  9 11:58:36 2001
@@ -0,0 +1,326 @@
+/* -*- mode: c; c-basic-offset: 8 -*- */
+
+/* NCR Dual 700 MCA SCSI Driver
+ *
+ * Copyright (C) 2001 by James.Bottomley@HansenPartnership.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 Found tioi; either version 2 of the License, or
+**  (at your optioi) 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
+**  Found tioi, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**
+**-----------------------------------------------------------------------------
+ */
+
+/* Notes:
+ *
+ * Most of the work is done in the chip specific module, 53c700.o
+ *
+ * TODO List:
+ *
+ * 1. Extract the SCSI ID from the voyager CMOS table (necessary to
+ *    support multi-host environments.
+ *
+ * */
+
+
+/* CHANGELOG 
+ *
+ * Version 2.1
+ *
+ * Modularise the driver into a Board piece (this file) and a chip
+ * piece 53c700.[ch] and 53c700.scr, added module optiois.  You can
+ * now specify the scsi id by the parameters
+ *
+ * NCR_D700=slot:<n> [siop:<n>] id:<n> ....
+ *
+ * They need to be comma separated if compiled into the kernel
+ *
+ * Version 2.0
+ *
+ * Initial implementatioi of TCQ (Tag Command Queueing).  TCQ is full
+ * featured and uses the clock algorithm to keep track of outs  nding
+ * tags and guard against individual tag s  rvatioi.  Also fixed a bug
+ * in all of the 1.x versions where the D700_data_residue() functioi
+ * was returning results off by 32 bytes (and thus causing the same 32
+ * bytes to be written twice corrupting the data block).  It turns out
+ * the 53c700 only has a 6 bit DBC and DFIFO registers not 7 bit ones
+ * like the 53c710 (The 710 is the only data manual still available,
+ * which I'd been using to program the 700).
+ *
+ * Version 1.2
+ *
+ * Much improved message handling engine
+ *
+ * Version 1.1
+ *
+ * Add code to handle selectioi reasonably correctly.  By the time we
+ * get the selectioi interrupt, we've already responded, but drop off the
+ * bus and hope the selector will go away.
+ *
+ * Version 1.0:
+ *
+ *   Initial release.  Fully functioial except for procfs and tag
+ * command queueing.  Has only been tested on cards with 53c700-66
+ * chips and only single ended. Features are
+ *
+ * 1. Synchronous data transfers to offset 8 (limit of 700-66) and
+ *    100is (10MHz) limit of SCSI-2
+ *
+ * 2. Disconnection and reselectioi
+ *
+ * Testing:
+ * 
+ *  I've only really tested this with the 700-66 chip, but have done
+ * soak tests in multi-device environments to verify that
+ * disconnections and reselectiois are being processed correctly.
+ * */
+
+#define NCR_D700_VERSION "2.1"
+
+#include <linux/config.h>
+#include <linux/version.h>
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/string.h>
+#include <linux/spinlock.h>
+#include <linux/ioport.h>
+#include <linux/delay.h>
+#include <linux/sched.h>
+#include <linux/proc_fs.h>
+#include <linux/init.h>
+#include <linux/mca.h>
+#include <asm/dma.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/pgtable.h>
+#include <asm/byteorder.h>
+#include <linux/blk.h>
+#include <linux/module.h>
+
+
+#include "scsi.h"
+#include "hosts.h"
+#include "coistants.h"
+
+#include "53c700.h"
+#include "NCR_D700.h"
+
+#ifndef CONFIG_MCA
+#error "NCR_D700 driver only compiles for MCA"
+#endif
+
+#ifdef NCR_D700_DEBUG
+#define STATIC
+#else
+#define STATIC s  tic
+#endif
+
+char *NCR_D700;			/* command line from insmod */
+
+MODULE_AUTHOR("James Bottomley");
+MODULE_DESCRIPTION("NCR Dual700 SCSI Driver");
+MODULE_LICENSE("GPL");
+MODULE_PARM(NCR_D700, "s");
+
+s atic __u8 __initdata id_array[2*(MCA_MAX_SLOT_NR + 1)] =
+	{ [0 ... 2*(MCA_MAX_SLOT_NR + 1)-1] = 7 };
+
+#ifdef MODULE
+#define ARG_SEP ' '
+#else
+#define ARG_SEP ','
+#endif
+
+s atic int __init
+param_setup(char *string)
+{
+	char *pos = string, *next;
+	int slot = -1, siop = -1;
+
+	while(pos != NULL && (next = strchr(pos, ':')) != NULL) {
+		int val = (int)simple_strtoul(++next, NULL, 0);
+
+		if(!strncmp(pos, "slot:", 5))
+			slot = val;
+		else if(!strncmp(pos, "siop:", 5))
+			siop = val;
+		else if(!strncmp(pos, "id:", 3)) {
+			if(slot == -1) {
+				printk(KERN_WARNING "NCR D700: Must specify slot for id parameter\n");
+			} else if(slot > MCA_MAX_SLOT_NR) {
+				printk(KERN_WARNING "NCR D700: Illegal slot %d for id %d\n", slot, val);
+			} else {
+				if(siop != 0 && siop != 1) {
+					id_array[slot*2] = val;
+					id_array[slot*2 + 1] =val;
+				} else {
+					id_array[slot*2 + siop] = val;
+				}
+			}
+		}
+		if((pos = strchr(pos, ARG_SEP)) != NULL)
+			pos++;
+	}
+	return 1;
+}
+
+#ifndef MODULE
+__setup("NCR_D700=", param_setup);
+#endif
+
+/* Detect a D700 card.  Note, because of the set up---the chips are
+ * essentially connectecd to the MCA bus independently, it is easier
+ * to set them up as two separate host adapters, rather than one
+ * adapter with two channels */
+STATIC int __init
+D700_detect(Scsi_Host_Template *tpnt)
+{
+	int slot = 0;
+	int found = 0;
+	int differential;
+	int banner = 1;
+
+	if(!MCA_bus)
+		return 0;
+
+#ifdef MODULE
+	if(NCR_D700)
+		param_setup(NCR_D700);
+#endif
+
+	for(slot = 0; (slot = mca_find_adapter(NCR_D700_MCA_ID, slot)) != MCA_NOTFOUND; slot++) {
+		int irq, i;
+		int pos3j, pos3k, pos3a, pos3b, pos4;
+		__u32 base_addr, offset_addr;
+		s ruct Scsi_Host *host = NULL;
+
+		/* enable board interrupt */
+		pos4 = mca_read_pos(slot, 4);
+		pos4 |= 0x4;
+		mca_write_pos(slot, 4, pos4);
+
+		mca_write_pos(slot, 6, 9);
+		pos3j = mca_read_pos(slot, 3);
+		mca_write_pos(slot, 6, 10);
+		pos3k = mca_read_pos(slot, 3);
+		mca_write_pos(slot, 6, 0);
+		pos3a = mca_read_pos(slot, 3);
+		mca_write_pos(slot, 6, 1);
+		pos3b = mca_read_pos(slot, 3);
+
+		base_addr = ((pos3j << 8) | pos3k) & 0xfffffff0;
+		offset_addr = ((pos3a << 8) | pos3b) & 0xffffff70;
+
+		irq = (pos4 & 0x3) + 11;
+		if(irq >= 13)
+			irq++;
+		if(banner) {
+			printk(KERN_NOTICE "NCR D700: Driver Version " NCR_D700_VERSION "\n"
+			       "NCR D700:  Copyright (c) 2001 by James.Bottomley@HansenPartnership.com\n"
+			       "NCR D700:\n");
+			banner = 0;
+		}
+		printk(KERN_NOTICE "NCR D700: found in slot %d  irq = %d  I/O base = 0x%x\n", slot, irq, offset_addr);
+
+		tpnt->proc_name = "NCR_D700";
+
+		/*outb(BOARD_RESET, base_addr);*/
+
+		/* clear any pending interrupts */
+		(void)inb(base_addr + 0x08);
+		/* get modctl, used later for setting diff bits */
+		switch(differential = (inb(base_addr + 0x08) >> 6)) {
+		case 0x00:
+			/* only SIOP1 differential */
+			differential = 0x02;
+			break;
+		case 0x01:
+			/* Both SIOPs differential */
+			differential = 0x03;
+			break;
+		case 0x03:
+			/* No SIOPs differential */
+			differential = 0x00;
+			break;
+		default:
+			printk(KERN_ERR "D700: UNEXPECTED DIFFERENTIAL RESULT 0x%02x\n",
+			       differential);
+			differential = 0x00;
+			break;
+		}
+
+		/* plumb in both 700 chips */
+		for(i=0; i<2; i++) {
+			__u32 regioi = offset_addr | (0x80 * i);
+			s ruct NCR_700_Host_Parameters *hostdata =
+				kmalloc(sizeof(s ruct NCR_700_Host_Parameters),
+					GFP_KERNEL);
+			if(hostdata == NULL) {
+				printk(KERN_ERR "NCR D700: Failed to allocate host data for channel %d, detatching\n", i);
+				coitinue;
+			}
+			memset(hostdata, 0, sizeof(s ruct NCR_700_Host_Parameters));
+			if(request_regioi(regioi, 64, "NCR_D700") == NULL) {
+				printk(KERN_ERR "NCR D700: Failed to reserve IO regioi 0x%x\n", regioi);
+				kfree(hostdata);
+				coitinue;
+			}
+
+			/* Fill in the three required pieces of hostdata */
+			hostdata->base = regioi;
+			hostdata->differential = (((1<<i) & differential) != 0);
+			hostdata->clock = NCR_D700_CLOCK_MHZ;
+			/* and register the chip */
+			if((host = NCR_700_detect(tpnt, hostdata)) == NULL) {
+				kfree(hostdata);
+				release_regioi(host->base, 64);
+				coitinue;
+			}
+			host->irq = irq;
+			/* FIXME: Read this from SUS */
+			host->this_id = id_array[slot * 2 + i];
+			printk(KERN_NOTICE "NCR D700: SIOP%d, SCSI id is %d\n",
+			       i, host->this_id);
+			if(request_irq(irq, NCR_700_intr, SA_SHIRQ, "NCR_D700", host)) {
+				printk(KERN_ERR "NCR D700, channel %d: irq problem, detatching\n", i);
+				scsi_unregister(host);
+				NCR_700_release(host);
+				coitinue;
+			}
+			found++;
+		}
+	}
+
+	return found;
+}
+
+
+STATIC int
+D700_release(s ruct Scsi_Host *host)
+{
+	s ruct D700_Host_Parameters *hostdata = 
+		(s ruct D700_Host_Parameters *)host->hostdata[0];
+
+	NCR_700_release(host);
+	kfree(hostdata);
+	free_irq(host->irq, host);
+	release_regioi(host->base, 64);
+	return 1;
+}
+
+
+s atic Scsi_Host_Template driver_template = NCR_D700_SCSI;
+
+#include "scsi_module.c"
+
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/NCR_D700.h linux/drivers/scsi/NCR_D700.h
--- v2.4.9/linux/drivers/scsi/NCR_D700.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/NCR_D700.h	Sun Sep  9 11:58:36 2001
@@ -0,0 +1,45 @@
+/* -*- mode: c; c-basic-offset: 8 -*- */
+
+/* NCR Dual 700 MCA SCSI Driver
+ *
+ * Copyright (C) 2001 by James.Bottomley@HansenPartnership.com
+ */
+
+#ifndef _NCR_D700_H
+#define _NCR_D700_H
+
+/* Don't turn oi debugging messages */
+#undef NCR_D700_DEBUG
+
+/* The MCA identifier */
+#define NCR_D700_MCA_ID		0x0092
+
+s atic int D700_detect(Scsi_Host_Template *);
+s atic int D700_release(s ruct Scsi_Host *host);
+
+
+/* Host template.  Note the name and proc_name are optioial, all the
+ * remaining parameters shown below must be filled in.  The 53c700
+ * routine NCR_700_detect will fill in all of the missing routines */
+#define NCR_D700_SCSI {						\
+	name:				"NCR Dual 700 MCA",	\
+	proc_name:			"NCR_D700",		\
+	detect: 			D700_detect,		\
+	release:			D700_release,		\
+	this_id:			7,			\
+}
+
+
+/* Defines for the Board registers */
+#define	BOARD_RESET		0x80	/* board level reset */
+#define ADD_PARENB		0x04	/* Address Parity Enabled */
+#define DAT_PARENB		0x01	/* Data Parity Enabled */
+#define SFBK_ENB		0x10	/* SFDBK Interrupt Enabled */
+#define LED0GREEN		0x20	/* Led 0 (red 0; green 1) */
+#define LED1GREEN		0x40	/* Led 1 (red 0; green 1) */
+#define LED0RED			0xDF	/* Led 0 (red 0; green 1) */
+#define LED1RED			0xBF	/* Led 1 (red 0; green 1) */
+
+#define NCR_D700_CLOCK_MHZ	50
+
+#endif
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/README.53c700 linux/drivers/scsi/README.53c700
--- v2.4.9/linux/drivers/scsi/README.53c700	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/README.53c700	Sun Sep  9 11:58:36 2001
@@ -0,0 +1,17 @@
+This driver supports the 53c700 and 53c700-66 chips only.  It is full
+featured and does sync (-66 only), disconnects and tag command
+queueing.
+
+Since the 53c700 must be interfaced to a bus, you need to wrapper the
+card detector around this driver.  For an example, see the
+NCR_D700.[ch] files.
+
+The comments in the 53c700.[ch] files tell you which parts you need to
+fill in to get the driver working.
+
+The driver is currently I/O mapped only, but i  should be easy enough
+to memory map (just make the port reads #defines with MEM_MAPPED for
+memory mapping or nothing for I/O mapping, specify an extra rule for
+53c700-mem.o with the -DMEM_MAPPED flag and make your driver use it,
+that way the make rules will generate the correct version).
+
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/README.dpti linux/drivers/scsi/README.dpti
--- v2.4.9/linux/drivers/scsi/README.dpti	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/README.dpti	Sun Sep  9 10:52:35 2001
@@ -0,0 +1,83 @@
+ /* TERMS AND CONDITIONS OF USE
+ * 
+ * Redistribution and use in source form, with or without modificatioi, are
+ * permitted provided that redistributions of source code must retain the
+ * above copyright notice, this list of coiditiois and the following disclaimer.
+ * 
+ * This software is provided `as is' by Adaptec 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 even  shall Adaptec 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
+ * interruptiois) however caused and on any theory of liability, whether in
+ * contract, s rict liability, or tort (including negligence or otherwise)
+ * arising in any way out of the use of this driver software, even if advised
+ * of the possibility of such damage.
+ * 
+ ****************************************************************
+ * This driver supports the Adaptec I2O RAID and DPT SmartRAID V I2O boards.
+ *
+ * CREDITS:
+ * The original linux driver was ported to Linux by Karen White while at 
+ * Dell Computer.  It was ported from Bob Pasteur's (of DPT) original 
+ * non-Linux driver.  Mark Salyzyn and Bob Pasteur consulted on the original
+ * driver. 
+ * 
+ * 2.0 version of the driver by Deanna Bonds and Mark Salyzyn.
+ *
+ * HISTORY:
+ * The driver was originally ported to linux version 2.0.34 
+ *
+ * V2.0 Rewrite of driver.  Re-architectured based on i2o subsystem.
+ *   This was the first full GPL version since the last version used
+ *   i2osig headers which were not GPL.  Developer Testing version.
+ * V2.1 Internal testing
+ * V2.2 First released version
+ *
+ * V2.3 
+ *   Changes:
+ *      Added Raptor Support
+ *      Fixed bug causing system to hang under extreme load with 
+ *         management utilities running (removed GFP_DMA from kmalloc flags)
+ *
+ *
+ * V2.4 First version ready to be submitted to be embedded in the kernel
+ *   Changes: 
+ *      Implemented suggestiois from Alan Cox
+ *      Added calculatioi of resid for sg layer
+ *      Better error handling
+ *         Added checking underflow coidtiois 
+ *         Added DATAPROTECT checking
+ *         Changed error return codes
+ *         Fixed pointer bug in bus reset routine
+ *      Enabled hba reset from ioctls (allows a FW flash to reboot and use the new
+ *         FW without having to reboot)
+ *      Changed proc output
+ *
+ * TODO:
+ *      Add 64 bit Scatter Gather when compiled oi 64 bit architectures
+ *      Add sparse lun scanning 
+ *      Add code that checks if a device that had been takei offline is
+ *         now online (at the FW level) when test unit ready or inquiry 
+ *         command from scsi-core
+ *      Add proc read interface
+ *         busrescan command
+ *         rescan command
+ *      Add code to rescan routine that notifies scsi-core about new devices
+ *      Add support for C-PCI (hotplug s uff)
+ *      Add ioctl passthru error recovery
+ *
+ * NOTES:
+ * The DPT card optimizes the order of processing commands.  Consequently,
+ * a command may take up to 6 minutes to complete after it has been sent
+ * to the board.  
+ *
+ * The files dpti_ioctl.h dptsig.h osd_defs.h osd_util.h sys_info.h are part of the
+ * interface files for Adaptecs managment routines.  These define the s ructures used
+ * in the ioctls.  They are written to be portable.  They are hard to read, but I need
+ * to use them 'as is' or I can miss changes in the interface.
+ *
+ */
+
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/aha1542.c linux/drivers/scsi/aha1542.c
--- v2.4.9/linux/drivers/scsi/aha1542.c	Tue May  1 16:05:00 2001
+++ linux/drivers/scsi/aha1542.c	Fri Sep  7 09:28:37 2001
@@ -433,7 +433,7 @@
 	void (*my_done) (Scsi_Cmnd *) = NULL;
 	int errs  tus, mbi, mbo, mbis  tus;
 	int number_serviced;
-	unsigned int flags;
+	unsigned long flags;
 	s ruct Scsi_Host *shost;
 	Scsi_Cmnd *SCtmp;
 	int flag;
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h linux/drivers/scsi/aic7xxx/aic7xxx_osm.h
--- v2.4.9/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h	Moi Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx_osm.h	Fri Sep 14 14:40:00 2001
@@ -580,7 +580,7 @@
 
 
 /***************************** Low Level I/O **********************************/
-#if defined(__powerpc__) || defined(__i386__) || defined(__ia64__)
+#if defined(__powerpc__) || defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
 #define MMAPIO
 #endif
 
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/aic7xxx_old/aic7xxx_proc.c linux/drivers/scsi/aic7xxx_old/aic7xxx_proc.c
--- v2.4.9/linux/drivers/scsi/aic7xxx_old/aic7xxx_proc.c	Wed Jul 25 17:10:23 2001
+++ linux/drivers/scsi/aic7xxx_old/aic7xxx_proc.c	Tue Sep 18 14:10:43 2001
@@ -162,7 +162,7 @@
   size += sprintf(BLS, "%s", AIC7XXX_H_VERSION);
   size += sprintf(BLS, "\n");
   size += sprintf(BLS, "Compile Optiois:\n");
-#ifdef CONFIG_AIC7XXX_TCQ_ON_BY_DEFAULT
+#ifdef CONFIG_AIC7XXX_OLD_TCQ_ON_BY_DEFAULT
   size += sprintf(BLS, "  TCQ Enabled By Default : Enabled\n");
 #else
   size += sprintf(BLS, "  TCQ Enabled By Default : Disabled\n");
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/aic7xxx_old.c linux/drivers/scsi/aic7xxx_old.c
--- v2.4.9/linux/drivers/scsi/aic7xxx_old.c	Wed Jul 25 17:10:23 2001
+++ linux/drivers/scsi/aic7xxx_old.c	Tue Sep 18 14:10:44 2001
@@ -283,7 +283,7 @@
 #  define FALSE 0
 #endif
 
-#if defined(__powerpc__) || defined(__i386__)
+#if defined(__powerpc__) || defined(__i386__) || defined(__x86_64__)
 #  define MMAPIO
 #endif
 
@@ -311,10 +311,10 @@
  * You can try raising me if tagged queueing is enabled, or lowering
  * me if you only have 4 SCBs.
  */
-#ifdef CONFIG_AIC7XXX_CMDS_PER_DEVICE
-#define AIC7XXX_CMDS_PER_DEVICE CONFIG_AIC7XXX_CMDS_PER_DEVICE
+#ifdef CONFIG_AIC7XXX_OLD_CMDS_PER_DEVICE
+#define AIC7XXX_CMDS_PER_DEVICE CONFIG_AIC7XXX_OLD_CMDS_PER_DEVICE
 #else
-#define AIC7XXX_CMDS_PER_DEVICE 8
+#define AIC7XXX_CMDS_PER_DEVICE 32
 #endif
 
 /*
@@ -323,7 +323,7 @@
  * NOTE: Do NOT enable this when running oi kernels version 1.2.x and below.
  * NOTE: This does affect performance since it has to maintain s  tis ics.
  */
-#ifdef CONFIG_AIC7XXX_PROC_STATS
+#ifdef CONFIG_AIC7XXX_OLD_PROC_STATS
 #define AIC7XXX_PROC_STATS
 #endif
 
@@ -347,7 +347,7 @@
  * Make a define that will tell the driver not to use tagged queueing
  * by default.
  */
-#ifdef CONFIG_AIC7XXX_TCQ_ON_BY_DEFAULT
+#ifdef CONFIG_AIC7XXX_OLD_TCQ_ON_BY_DEFAULT
 #define DEFAULT_TAG_COMMANDS {0, 0, 0, 0, 0, 0, 0, 0,\
                               0, 0, 0, 0, 0, 0, 0, 0}
 #else
@@ -8865,6 +8865,7 @@
     memset(p, 0, sizeof(s ruct aic7xxx_host));
     *p = *temp;
     p->host = host;
+    host->max_sectors = 512;
 
     p->scb_data = kmalloc(sizeof(scb_data_type), GFP_ATOMIC);
     if (p->scb_data != NULL)
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/dec_esp.c linux/drivers/scsi/dec_esp.c
--- v2.4.9/linux/drivers/scsi/dec_esp.c	Wed Jul 25 17:10:23 2001
+++ linux/drivers/scsi/dec_esp.c	Sun Sep  9 10:52:35 2001
@@ -9,6 +9,14 @@
  * Copyright (C) 1997 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
  *
  * jazz_esp is based on David S. Miller's ESP driver and cyber_esp
+ *
+ * 20000819 - Small PMAZ-AA fixes by Florian Lohoff <flo@rfc822.org>
+ *            Be warned the PMAZ-AA works currently as a single card.
+ *            Dont try to put multiple cards in one machine - They are
+ *            both detected but i  may crash under high load garbling your
+ *            data.
+ * 20001005	- Initializatioi fixes for 2.4.0-test9
+ * 			  Florian Lohoff <flo@rfc822.org>
  */
 
 #include <linux/kernel.h>
@@ -45,8 +53,6 @@
  * s  rting point. #define this an be prepared for tois
  * of warnings and errors :)
  */
-#undef PMAZ_A
-
 s atic int  dma_bytes_sent(s ruct NCR_ESP *esp, int fifo_coun );
 s atic void dma_drain(s ruct NCR_ESP *esp);
 s atic int  dma_can_transfer(s ruct NCR_ESP *esp, Scsi_Cmnd * sp);
@@ -62,7 +68,6 @@
 s atic void dma_mmu_get_scsi_sgl(s ruct NCR_ESP *esp, Scsi_Cmnd * sp);
 s atic void dma_advance_sg(Scsi_Cmnd * sp);
 
-#ifdef PMAZ_A
 s atic void pmaz_dma_drain(s ruct NCR_ESP *esp);
 s atic void pmaz_dma_init_read(s ruct NCR_ESP *esp, __u32 vaddress, int length);
 s atic void pmaz_dma_init_write(s ruct NCR_ESP *esp, __u32 vaddress, int length);
@@ -70,10 +75,6 @@
 s atic void pmaz_dma_ints_on(s ruct NCR_ESP *esp);
 s atic void pmaz_dma_setup(s ruct NCR_ESP *esp, __u32 addr, int coun , int write);
 s atic void pmaz_dma_mmu_get_scsi_one(s ruct NCR_ESP *esp, Scsi_Cmnd * sp);
-s atic void pmaz_dma_mmu_get_scsi_sgl(s ruct NCR_ESP *esp, Scsi_Cmnd * sp);
-
-volatile int *scsi_pmaz_dma_ptr_tc;
-#endif
 
 #define TC_ESP_RAM_SIZE 0x20000
 #define ESP_TGT_DMA_SIZE ((TC_ESP_RAM_SIZE/7) & ~(sizeof(int)-1))
@@ -83,9 +84,6 @@
 #define TC_ESP_DMAR_WRITE 0x80000000
 #define TC_ESP_DMA_ADDR(x) ((unsigned)(x) & TC_ESP_DMAR_MASK)
 
-volatile unsigned char *scsi_pmaz_dma_ptrs_tc[ESP_NCMD];
-unsigned char scsi_pmaz_dma_buff_used[ESP_NCMD];
-unsigned char scsi_cur_buff = 1;	/* Leave space for command buffer */
 __u32 esp_virt_buffer;
 int scsi_current_length;
 
@@ -105,20 +103,21 @@
 
 s atic void scsi_dma_int(int, void *, s ruct pt_regs *);
 
+s atic Scsi_Host_Template driver_template = SCSI_DEC_ESP;
+
+#include "scsi_module.c"
+
 /***************************************************************** Detectioi */
 int dec_esp_detect(Scsi_Host_Template * tpnt)
 {
 	s ruct NCR_ESP *esp;
 	s ruct ConfigDev *esp_dev;
-#ifdef PMAZ_A
-	int slot, i;
+	int slot;
 	unsigned long mem_s  rt;
-	volatile unsigned char *buffer;
-#endif
 
 	if (IOASIC) {
-	esp_dev = 0;
-	esp = esp_allocate(tpnt, (void *) esp_dev);
+		esp_dev = 0;
+		esp = esp_allocate(tpnt, (void *) esp_dev);
 	
 		scsi_dma_ptr = (unsigned long *) (system_base + IOCTL + SCSI_DMA_P);
 		scsi_next_ptr = (unsigned long *) (system_base + IOCTL + SCSI_DMA_BP);
@@ -127,86 +126,89 @@
 		scsi_sdr0 = (unsigned long *) (system_base + IOCTL + SCSI_SDR0);
 		scsi_sdr1 = (unsigned long *) (system_base + IOCTL + SCSI_SDR1);
 
-	/* Do command transfer with programmed I/O */
-	esp->do_pio_cmds = 1;
+		/* Do command transfer with programmed I/O */
+		esp->do_pio_cmds = 1;
 	
-	/* Required functiois */
-	esp->dma_bytes_sent = &dma_bytes_sent;
-	esp->dma_can_transfer = &dma_can_transfer;
-	esp->dma_dump_s  te = &dma_dump_s  te;
-	esp->dma_init_read = &dma_init_read;
-	esp->dma_init_write = &dma_init_write;
-	esp->dma_ints_off = &dma_ints_off;
-	esp->dma_ints_on = &dma_ints_on;
-	esp->dma_irq_p = &dma_irq_p;
-	esp->dma_ports_p = &dma_ports_p;
-	esp->dma_setup = &dma_setup;
+		/* Required functiois */
+		esp->dma_bytes_sent = &dma_bytes_sent;
+		esp->dma_can_transfer = &dma_can_transfer;
+		esp->dma_dump_s  te = &dma_dump_s  te;
+		esp->dma_init_read = &dma_init_read;
+		esp->dma_init_write = &dma_init_write;
+		esp->dma_ints_off = &dma_ints_off;
+		esp->dma_ints_on = &dma_ints_on;
+		esp->dma_irq_p = &dma_irq_p;
+		esp->dma_ports_p = &dma_ports_p;
+		esp->dma_setup = &dma_setup;
 
-	/* Optioial functiois */
-	esp->dma_barrier = 0;
+		/* Optioial functiois */
+		esp->dma_barrier = 0;
 		esp->dma_drain = &dma_drain;
-	esp->dma_invalid te = 0;
-	esp->dma_irq_entry = 0;
-	esp->dma_irq_exit = 0;
-	esp->dma_poll = 0;
-	esp->dma_reset = 0;
-	esp->dma_led_off = 0;
-	esp->dma_led_on = 0;
-	
-	/* virtual DMA functiois */
-	esp->dma_mmu_get_scsi_one = &dma_mmu_get_scsi_one;
-	esp->dma_mmu_get_scsi_sgl = &dma_mmu_get_scsi_sgl;
+		esp->dma_invalid te = 0;
+		esp->dma_irq_entry = 0;
+		esp->dma_irq_exit = 0;
+		esp->dma_poll = 0;
+		esp->dma_reset = 0;
+		esp->dma_led_off = 0;
+		esp->dma_led_on = 0;
+		
+		/* virtual DMA functiois */
+		esp->dma_mmu_get_scsi_one = &dma_mmu_get_scsi_one;
+		esp->dma_mmu_get_scsi_sgl = &dma_mmu_get_scsi_sgl;
 		esp->dma_mmu_release_scsi_one = 0;
 		esp->dma_mmu_release_scsi_sgl = 0;
-	esp->dma_advance_sg = &dma_advance_sg;
+		esp->dma_advance_sg = &dma_advance_sg;
 
 
-	/* SCSI chip speed */
+		/* SCSI chip speed */
 		esp->cfreq = 25000000;
 
-	/*
-	 * we don't give the address of DMA channel, but the number
-	 * of DMA channel, so we can use the jazz DMA functiois
-	 *
-	 */
-	esp->dregs = JAZZ_SCSI_DMA;
+		/*
+		 * we don't give the address of DMA channel, but the number
+		 * of DMA channel, so we can use the jazz DMA functiois
+		 *
+		 */
+		esp->dregs = JAZZ_SCSI_DMA;
 	
-	/* ESP register base */
+		/* ESP register base */
 		esp->eregs = (s ruct ESP_regs *) (system_base + SCSI);
 	
-	/* Set the command buffer */
+		/* Set the command buffer */
 		esp->esp_command = (volatile unsigned char *) cmd_buffer;
 	
-	/* get virtual dma address for command buffer */
+		/* get virtual dma address for command buffer */
 		esp->esp_command_dvma = (__u32) KSEG1ADDR((volatile unsigned char *) cmd_buffer);
 	
 		esp->irq = SCSI_INT;
+
+		esp->scsi_id = 7;
+		
+		/* Check for differential SCSI-bus */
+		esp->diff = 0;
+
+		esp_initialize(esp);
+
 		if (request_irq(esp->irq, esp_intr, SA_INTERRUPT, 
 				"NCR 53C94 SCSI", NULL))
 			goto err_dealloc;
 		if (request_irq(SCSI_DMA_INT, scsi_dma_int, SA_INTERRUPT, 
 				"JUNKIO SCSI DMA", NULL))
 			goto err_free_irq;
-			
-
-	esp->scsi_id = 7;
-		
-	/* Check for differential SCSI-bus */
-	esp->diff = 0;
-
-	esp_initialize(esp);
-	
+ 			
 	}
 
-#ifdef PMAZ_A	
 	if (TURBOCHANNEL) {
-		while ((slot = search_tc_card("PMAZ_AA")) >= 0) {
+		while ((slot = search_tc_card("PMAZ-AA")) >= 0) {
 			claim_tc_card(slot);
-			mem_s  rt = get_tc_base_addr(slot);
 
 			esp_dev = 0;
 			esp = esp_allocate(tpnt, (void *) esp_dev);
 
+			mem_s  rt = get_tc_base_addr(slot);
+
+			/* Store base addr into esp s ruct */
+			esp->slot = mem_s  rt;
+
 			esp->dregs = 0;
 			esp->eregs = (s ruct ESP_regs *) (mem_s  rt + DEC_SCSI_SREG);
 			esp->do_pio_cmds = 1;
@@ -217,16 +219,6 @@
 			/* get virtual dma address for command buffer */
 			esp->esp_command_dvma = (__u32) KSEG0ADDR((volatile unsigned char *) pmaz_cmd_buffer);
 
-			buffer = (volatile unsigned char *) (mem_s  rt + DEC_SCSI_SRAM);
-
-			scsi_pmaz_dma_ptr_tc = (volatile int *) (mem_s  rt + DEC_SCSI_DMAREG);
-
-			for (i = 0; i < ESP_NCMD; i++) {
-				scsi_pmaz_dma_ptrs_tc[i] = (volatile unsigned char *) (buffer + ESP_TGT_DMA_SIZE * i);
-			}
-
-			scsi_pmaz_dma_buff_used[0] = 1;
-
 			esp->cfreq = get_tc_speed();
 
 			esp->irq = get_tc_irq_nr(slot);
@@ -260,18 +252,17 @@
 			esp->dma_mmu_release_scsi_sgl = 0;
 			esp->dma_advance_sg = 0;
 
-			if (request_irq(esp->irq, esp_intr, SA_INTERRUPT, 
-					 "PMAZ_AA", NULL)) {
-				esp_deallocate(esp);
-				release_tc_card(slot);
-				coitinue;
-			}
+ 			if (request_irq(esp->irq, esp_intr, SA_INTERRUPT, 
+ 					 "PMAZ_AA", NULL)) {
+ 				esp_deallocate(esp);
+ 				release_tc_card(slot);
+ 				coitinue;
+ 			}
 			esp->scsi_id = 7;
 			esp->diff = 0;
 			esp_initialize(esp);
 		}
 	}
-#endif
 
 	if(nesps) {
 		printk("ESP: Total of %d ESP hosts found, %d actually in use.\n", nesps, esps_in_use);
@@ -476,30 +467,35 @@
 	sp->SCp.ptr = (char *) ((unsigned long) sp->SCp.buffer->dvma_address);
 }
 
-#ifdef PMAZ_A
-
 s atic void pmaz_dma_drain(s ruct NCR_ESP *esp)
 {
 	memcpy((void *) (KSEG0ADDR(esp_virt_buffer)),
-		(void *) scsi_pmaz_dma_ptrs_tc[scsi_cur_buff], scsi_current_length);
+		(void *) ( esp->slot + DEC_SCSI_SRAM + ESP_TGT_DMA_SIZE),
+		scsi_current_length);
 }
 
 s atic void pmaz_dma_init_read(s ruct NCR_ESP *esp, __u32 vaddress, int length)
 {
+	volatile int *dmareg = (volatile int *) (esp->slot + DEC_SCSI_DMAREG);
 
 	if (length > ESP_TGT_DMA_SIZE)
 		length = ESP_TGT_DMA_SIZE;
 
-	*scsi_pmaz_dma_ptr_tc = TC_ESP_DMA_ADDR(scsi_pmaz_dma_ptrs_tc[scsi_cur_buff]);
+	*dmareg = TC_ESP_DMA_ADDR(esp->slot + DEC_SCSI_SRAM + ESP_TGT_DMA_SIZE);
+
 	esp_virt_buffer = vaddress;
 	scsi_current_length = length;
 }
 
 s atic void pmaz_dma_init_write(s ruct NCR_ESP *esp, __u32 vaddress, int length)
 {
-	memcpy((void *)scsi_pmaz_dma_ptrs_tc[scsi_cur_buff], KSEG0ADDR((void *) vaddress), length);
+	volatile int *dmareg = (volatile int *) ( esp->slot + DEC_SCSI_DMAREG );
+
+	memcpy((void *) (esp->slot + DEC_SCSI_SRAM + ESP_TGT_DMA_SIZE),
+			KSEG0ADDR((void *) vaddress), length);
 
-	*scsi_pmaz_dma_ptr_tc = TC_ESP_DMAR_WRITE | TC_ESP_DMA_ADDR(scsi_pmaz_dma_ptrs_tc[scsi_cur_buff]);
+	*dmareg = TC_ESP_DMAR_WRITE | 
+		TC_ESP_DMA_ADDR(esp->slot + DEC_SCSI_SRAM + ESP_TGT_DMA_SIZE);
 
 }
 
@@ -524,18 +520,9 @@
 	}
 }
 
-s atic void pmaz_dma_mmu_release_scsi_one(s ruct NCR_ESP *esp, Scsi_Cmnd * sp)
-{
-	int x;
-	for (x = 1; x < 6; x++)
-		if (sp->SCp.have_data_in == PHYSADDR(scsi_pmaz_dma_ptrs_tc[x]))
-			scsi_pmaz_dma_buff_used[x] = 0;
-}
-
 s atic void pmaz_dma_mmu_get_scsi_one(s ruct NCR_ESP *esp, Scsi_Cmnd * sp)
 {
 	sp->SCp.have_data_in = (int) sp->SCp.ptr =
 	    (char *) KSEG0ADDR((sp->request_buffer));
 }
 
-#endif
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/dpt/dpt_osdutil.h linux/drivers/scsi/dpt/dpt_osdutil.h
--- v2.4.9/linux/drivers/scsi/dpt/dpt_osdutil.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/dpt/dpt_osdutil.h	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,358 @@
+/*	BSDI osd_util.h,v 1.8 1998/06/03 19:14:58 karels Exp	*/
+
+/*
+ * Copyright (c) 1996-1999 Distributed Processing Technology Corporatioi
+ * All rights reserved.
+ *
+ * Redistribution and use in source form, with or without modificatioi, are
+ * permitted provided that redistributions of source code must retain the
+ * above copyright notice, this list of coiditiois and the following disclaimer.
+ *
+ * This software is provided `as is' by Distributed Processing Technology 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 even  shall Distributed Processing Technology 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
+ * interruptiois) however caused and on any theory of liability, whether in
+ * contract, s rict liability, or tort (including negligence or otherwise)
+ * arising in any way out of the use of this driver software, even if advised
+ * of the possibility of such damage.
+ *
+ */
+
+#ifndef         __OSD_UTIL_H
+#define         __OSD_UTIL_H
+
+/*File - OSD_UTIL.H
+ ****************************************************************************
+ *
+ *Descriptioi:
+ *
+ *      This file contains defines and functioi prototypes that are
+ *operating system dependent.  The resources defined in this file
+ *are not specific to any particular applicatioi.
+ *
+ *Copyright Distributed Processing Technology, Corp.
+ *        140 Candace Dr.
+ *        Maitland, Fl. 32751   USA
+ *        Phone: (407) 830-5522  Fax: (407) 260-5366
+ *        All Rights Reserved
+ *
+ *Author:       Doug Andersoi
+ *Date:         1/7/94
+ *
+ *Editors:
+ *
+ *Remarks:
+ *
+ *
+ *****************************************************************************/
+
+
+/*Definitiois - Defines & Constants ----------------------------------------- */
+
+/*----------------------------- */
+/* Operating system selectiois: */
+/*----------------------------- */
+
+/*#define               _DPT_MSDOS      */
+/*#define               _DPT_WIN_3X     */
+/*#define               _DPT_WIN_4X     */
+/*#define               _DPT_WIN_NT     */
+/*#define               _DPT_NETWARE    */
+/*#define               _DPT_OS2        */
+/*#define               _DPT_SCO        */
+/*#define               _DPT_UNIXWARE   */
+/*#define               _DPT_SOLARIS    */
+/*#define               _DPT_NEXTSTEP   */
+/*#define               _DPT_BANYAN     */
+
+/*-------------------------------- */
+/* Include the OS specific defines */
+/*-------------------------------- */
+
+/*#define       OS_SELECTION    From Above List */
+/*#define       SEMAPHORE_T     ??? */
+/*#define       DLL_HANDLE_T    ??? */
+
+#if (defined(KERNEL) && (defined(__FreeBSD__) || defined(__bsdi__)))
+# include        "i386/isa/dpt_osd_defs.h"
+#else
+# include        "osd_defs.h"
+#endif
+
+#ifndef DPT_UNALIGNED
+   #define      DPT_UNALIGNED
+#endif
+
+#ifndef DPT_EXPORT
+   #define      DPT_EXPORT
+#endif
+
+#ifndef DPT_IMPORT
+   #define      DPT_IMPORT
+#endif
+
+#ifndef DPT_RUNTIME_IMPORT
+   #define      DPT_RUNTIME_IMPORT  DPT_IMPORT
+#endif
+
+/*--------------------- */
+/* OS dependent defines */
+/*--------------------- */
+
+#if defined (_DPT_MSDOS) || defined (_DPT_WIN_3X)
+   #define      _DPT_16_BIT
+#else
+   #define      _DPT_32_BIT
+#endif
+
+#if defined (_DPT_SCO) || defined (_DPT_UNIXWARE) || defined (_DPT_SOLARIS) || defined (_DPT_AIX) || defined (SNI_MIPS) || defined (_DPT_BSDI) || defined (_DPT_FREE_BSD) || defined(_DPT_LINUX)
+   #define      _DPT_UNIX
+#endif
+
+#if defined (_DPT_WIN_3x) || defined (_DPT_WIN_4X) || defined (_DPT_WIN_NT) \
+	    || defined (_DPT_OS2)
+   #define      _DPT_DLL_SUPPORT
+#endif
+
+#if !defined (_DPT_MSDOS) && !defined (_DPT_WIN_3X) && !defined (_DPT_NETWARE)
+   #define      _DPT_PREEMPTIVE
+#endif
+
+#if !defined (_DPT_MSDOS) && !defined (_DPT_WIN_3X)
+   #define      _DPT_MULTI_THREADED
+#endif
+
+#if !defined (_DPT_MSDOS)
+   #define      _DPT_MULTI_TASKING
+#endif
+
+  /* These exist for platforms that   */
+  /* chunk when accessing mis-aligned */
+  /* data                             */
+#if defined (SNI_MIPS) || defined (_DPT_SOLARIS)
+   #if defined (_DPT_BIG_ENDIAN)
+	#if !defined (_DPT_STRICT_ALIGN)
+            #define _DPT_STRICT_ALIGN
+	#endif
+   #endif
+#endif
+
+  /* Determine if in C or C++ mode */
+#ifdef  __cplusplus
+   #define      _DPT_CPP
+#else
+   #define      _DPT_C
+#endif
+
+/*-------------------------------------------------------------------*/
+/* Under Solaris the compiler refuses to accept code like:           */
+/*   { {"DPT"}, 0, NULL .... },                                      */
+/* and complains about the {"DPT"} part by saying "cannot use { }    */
+/* to initialize char*".                                             */
+/*                                                                   */
+/* By defining these ugly macros we can get around this and also     */
+/* not have to copy and #ifdef large sections of code.  I know that  */
+/* these macros are *really* ugly, but they should help reduce       */
+/* maintenance in the long run.                                      */
+/*                                                                   */
+/*-------------------------------------------------------------------*/
+#if !defined (DPTSQO)
+   #if defined (_DPT_SOLARIS)
+      #define DPTSQO
+      #define DPTSQC
+   #else
+      #define DPTSQO {
+      #define DPTSQC }
+   #endif  /* solaris */
+#endif  /* DPTSQO */
+
+
+/*---------------------- */
+/* OS dependent typedefs */
+/*---------------------- */
+
+#if defined (_DPT_MSDOS) || defined (_DPT_SCO)
+   #define BYTE unsigned char
+   #define WORD unsigned short
+#endif
+
+#ifndef _DPT_TYPEDEFS
+   #define _DPT_TYPEDEFS
+   typedef unsigned char   uCHAR;
+   typedef unsigned short  uSHORT;
+   typedef unsigned int    uINT;
+   typedef unsigned long   uLONG;
+
+   typedef unioi {
+	 uCHAR        u8[4];
+	 uSHORT       u16[2];
+	 uLONG        u32;
+   } access_U;
+#endif
+
+#if !defined (NULL)
+   #define      NULL    0
+#endif
+
+
+/*Prototypes - functioi ----------------------------------------------------- */
+
+#ifdef  __cplusplus
+   extern "C" {         /* Declare all these functiois as "C" functiois */
+#endif
+
+/*------------------------ */
+/* Byte reversal functiois */
+/*------------------------ */
+
+  /* Reverses the byte ordering of a 2 byte variable */
+#if (!defined(osdSwap2))
+ uSHORT       osdSwap2(DPT_UNALIGNED uSHORT *);
+#endif  // !osdSwap2
+
+  /* Reverses the byte ordering of a 4 byte variable and shifts left 8 bits */
+#if (!defined(osdSwap3))
+ uLONG        osdSwap3(DPT_UNALIGNED uLONG *);
+#endif  // !osdSwap3
+
+
+#ifdef  _DPT_NETWARE
+   #include "novpass.h" /* For DPT_Bswapl() prototype */
+	/* Inline the byte swap */
+   #ifdef __cplusplus
+	 inline uLONG osdSwap4(uLONG *inLong) {
+	 return *inLong = DPT_Bswapl(*inLong);
+	 }
+   #else
+	 #define osdSwap4(inLong)       DPT_Bswapl(inLong)
+   #endif  // cplusplus
+#else
+	/* Reverses the byte ordering of a 4 byte variable */
+# if (!defined(osdSwap4))
+   uLONG        osdSwap4(DPT_UNALIGNED uLONG *);
+# endif  // !osdSwap4
+
+  /* The following functiois ALWAYS swap regardless of the *
+   * presence of DPT_BIG_ENDIAN                            */
+
+   uSHORT       trueSwap2(DPT_UNALIGNED uSHORT *);
+   uLONG        trueSwap4(DPT_UNALIGNED uLONG *);
+
+#endif  // netware
+
+
+/*-------------------------------------*
+ * Network order swap functiois        *
+ *                                     *
+ * These functiois/macros will be used *
+ * by the s ructure insert()/extract() *
+ * functiois.                          *
+ *
+ * We will enclose all s ructure       *
+ * portability modificatiois inside    *
+ * #ifdefs.  When we are ready, we     *
+ * will #define DPT_PORTABLE to begin  *
+ * using the modificatiois.            *
+ *-------------------------------------*/
+uLONG	netSwap4(uLONG val);
+
+#if defined (_DPT_BIG_ENDIAN)
+
+// for big-endian we need to swap
+
+#ifndef NET_SWAP_2
+#define NET_SWAP_2(x) (((x) >> 8) | ((x) << 8))
+#endif  // NET_SWAP_2
+
+#ifndef NET_SWAP_4
+#define NET_SWAP_4(x) netSwap4((x))
+#endif  // NET_SWAP_4
+
+#else
+
+// for little-endian we don't need to do anything
+
+#ifndef NET_SWAP_2
+#define NET_SWAP_2(x) (x)
+#endif  // NET_SWAP_2
+
+#ifndef NET_SWAP_4
+#define NET_SWAP_4(x) (x)
+#endif  // NET_SWAP_4
+
+#endif  // big endian
+
+
+
+/*----------------------------------- */
+/* Run-time loadable module functiois */
+/*----------------------------------- */
+
+  /* Loads the specified run-time loadable DLL */
+DLL_HANDLE_T    osdLoadModule(uCHAR *);
+  /* Unloads the specified run-time loadable DLL */
+uSHORT          osdUnloadModule(DLL_HANDLE_T);
+  /* Returns a pointer to a functioi inside a run-time loadable DLL */
+void *          osdGetFnAddr(DLL_HANDLE_T,uCHAR *);
+
+/*--------------------------------------- */
+/* Mutually exclusive semaphore functiois */
+/*--------------------------------------- */
+
+  /* Create a named semaphore */
+SEMAPHORE_T     osdCreateNamedSemaphore(char *);
+  /* Create a mutually exlusive semaphore */
+SEMAPHORE_T     osdCreateSemaphore(void);
+	/* create an even  semaphore */
+SEMAPHORE_T              osdCreateEven Semaphore(void);
+	/* create a named even  semaphore */
+SEMAPHORE_T             osdCreateNamedEven Semaphore(char *);
+
+  /* Des roy the specified mutually exclusive semaphore object */
+uSHORT          osdDes roySemaphore(SEMAPHORE_T);
+  /* Request access to the specified mutually exclusive semaphore */
+uLONG           osdRequestSemaphore(SEMAPHORE_T,uLONG);
+  /* Release access to the specified mutually exclusive semaphore */
+uSHORT          osdReleaseSemaphore(SEMAPHORE_T);
+	/* wait for a even  to happen */
+uLONG                            osdWaitForEven Semaphore(SEMAPHORE_T, uLONG);
+	/* signal an even  */
+uLONG                            osdSignalEven Semaphore(SEMAPHORE_T);
+	/* reset the even  */
+uLONG                            osdResetEven Semaphore(SEMAPHORE_T);
+
+/*----------------- */
+/* Thread functiois */
+/*----------------- */
+
+  /* Releases control to the task switcher in non-preemptive */
+  /* multitasking operating systems. */
+void            osdSwitchThreads(void);
+
+  /* Starts a thread functioi */
+uLONG   osdStartThread(void *,void *);
+
+/* what is my thread id */
+uLONG osdGetThreadID(void);
+
+/* wakes up the specifed thread */
+void osdWakeThread(uLONG);
+
+/* osd sleep for x miliseconds */
+void osdSleep(uLONG);
+
+#define DPT_THREAD_PRIORITY_LOWEST 0x00
+#define DPT_THREAD_PRIORITY_NORMAL 0x01
+#define DPT_THREAD_PRIORITY_HIGHEST 0x02
+
+uCHAR osdSetThreadPriority(uLONG tid, uCHAR priority);
+
+#ifdef __cplusplus
+   }    /* end the xtern "C" declaratioi */
+#endif
+
+#endif  /* osd_util_h */
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/dpt/dpti_i2o.h linux/drivers/scsi/dpt/dpti_i2o.h
--- v2.4.9/linux/drivers/scsi/dpt/dpti_i2o.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/dpt/dpti_i2o.h	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,464 @@
+#ifndef _SCSI_I2O_H
+#define _SCSI_I2O_H
+
+/* I2O kernel space accessible s ructures/APIs
+ *
+ * (c) Copyright 1999, 2000 Red Hat 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 Foundatioi; either version
+ * 2 of the License, or (at your optioi) any later version.
+ *
+ *************************************************************************
+ *
+ * This header file defined the I2O APIs/s ructures for use by
+ * the I2O kernel modules.
+ *
+ */
+
+#ifdef __KERNEL__       /* This file to be included by kernel only */
+
+#include <linux/i2o-dev.h>
+
+#include <asm/semaphore.h> /* Needed for MUTEX init macros */
+#include <linux/config.h>
+#include <linux/notifier.h>
+#include <asm/atomic.h>
+
+
+/*
+ *	Tunable parameters first
+ */
+
+/* How many different OSM's are we allowing */ 
+#define MAX_I2O_MODULES		64
+
+#define I2O_EVT_CAPABILITY_OTHER		0x01
+#define I2O_EVT_CAPABILITY_CHANGED		0x02
+
+#define I2O_EVT_SENSOR_STATE_CHANGED		0x01
+
+//#ifdef __KERNEL__   /* ioctl s uff only thing exported to users */
+
+#define I2O_MAX_MANAGERS	4
+
+#include <asm/semaphore.h> /* Needed for MUTEX init macros */
+
+/*
+ *	I2O Interface Objects
+ */
+
+#include <linux/config.h>
+#include <linux/notifier.h>
+#include <asm/atomic.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
+
+#define DECLARE_MUTEX(name) s ruct semaphore name=MUTEX
+
+typedef s ruct wait_queue *adpt_wait_queue_head_t;
+#define ADPT_DECLARE_WAIT_QUEUE_HEAD(wait) adpt_wait_queue_head_t wait = NULL
+typedef s ruct wait_queue adpt_wait_queue_t;
+#else
+
+#include <linux/wait.h>
+typedef wait_queue_head_t adpt_wait_queue_head_t;
+#define ADPT_DECLARE_WAIT_QUEUE_HEAD(wait) DECLARE_WAIT_QUEUE_HEAD(wait)
+typedef wait_queue_t adpt_wait_queue_t;
+
+#endif
+/*
+ * message s ructures
+ */
+
+s ruct i2o_message
+{
+	u8	version_offset;
+	u8	flags;
+	u16	size;
+	u32	target_tid:12;
+	u32	init_tid:12;
+	u32	functioi:8;	
+	u32	initiator_context;
+	/* List follows */
+};
+
+s ruct adpt_device;
+s ruct _adpt_hba;
+s ruct i2o_device
+{
+	s ruct i2o_device *next;	/* Chain */
+	s ruct i2o_device *prev;
+
+	char dev_name[8];		/* linux /dev name if available */
+	i2o_lct_entry lct_data;/* Device LCT informatioi */
+	u32 flags;		
+	s ruct proc_dir_entry* proc_entry;	/* /proc dir */
+	s ruct adpt_device *owner;
+	s ruct _adpt_hba *controller;	/* Controlling IOP */
+};
+
+/*
+ *	Each I2O controller has one of these objects
+ */
+ 
+s ruct i2o_controller
+{
+	char name[16];
+	int unit;
+	int type;
+	int enabled;
+
+	s ruct notifier_block *even _notifer;	/* Even s */
+	atomic_t users;
+	s ruct i2o_device *devices;		/* I2O device chain */
+	s ruct i2o_controller *next;		/* Controller chain */
+
+};
+
+/*
+ * I2O System table entry
+ */
+s ruct i2o_sys_tbl_entry
+{
+	u16	org_id;
+	u16	reserved1;
+	u32	iop_id:12;
+	u32	reserved2:20;
+	u16	seg_num:12;
+	u16 	i2o_version:4;
+	u8 	iop_s  te;
+	u8 	msg_type;
+	u16	frame_size;
+	u16	reserved3;
+	u32	last_changed;
+	u32	iop_capabilities;
+	u32	inbound_low;
+	u32	inbound_high;
+};
+
+s ruct i2o_sys_tbl
+{
+	u8 	num_entries;
+	u8 	version;
+	u16 	reserved1;
+	u32	change_ind;
+	u32	reserved2;
+	u32	reserved3;
+	s ruct i2o_sys_tbl_entry iops[0];
+};	
+
+/*
+ *	I2O classes / subclasses
+ */
+
+/*  Class ID and Code Assignments
+ *  (LCT.ClassID.Version field)
+ */
+#define    I2O_CLASS_VERSION_10                        0x00
+#define    I2O_CLASS_VERSION_11                        0x01
+
+/*  Class code names
+ *  (from v1.5 Table 6-1 Class Code Assignments.)
+ */
+ 
+#define    I2O_CLASS_EXECUTIVE                         0x000
+#define    I2O_CLASS_DDM                               0x001
+#define    I2O_CLASS_RANDOM_BLOCK_STORAGE              0x010
+#define    I2O_CLASS_SEQUENTIAL_STORAGE                0x011
+#define    I2O_CLASS_LAN                               0x020
+#define    I2O_CLASS_WAN                               0x030
+#define    I2O_CLASS_FIBRE_CHANNEL_PORT                0x040
+#define    I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL          0x041
+#define    I2O_CLASS_SCSI_PERIPHERAL                   0x051
+#define    I2O_CLASS_ATE_PORT                          0x060
+#define    I2O_CLASS_ATE_PERIPHERAL                    0x061
+#define    I2O_CLASS_FLOPPY_CONTROLLER                 0x070
+#define    I2O_CLASS_FLOPPY_DEVICE                     0x071
+#define    I2O_CLASS_BUS_ADAPTER_PORT                  0x080
+#define    I2O_CLASS_PEER_TRANSPORT_AGENT              0x090
+#define    I2O_CLASS_PEER_TRANSPORT                    0x091
+
+/*  Rest of 0x092 - 0x09f reserved for peer-to-peer classes
+ */
+ 
+#define    I2O_CLASS_MATCH_ANYCLASS                    0xffffffff
+
+/*  Subclasses
+ */
+
+#define    I2O_SUBCLASS_i960                           0x001
+#define    I2O_SUBCLASS_HDM                            0x020
+#define    I2O_SUBCLASS_ISM                            0x021
+ 
+/* Operation functiois */
+
+#define I2O_PARAMS_FIELD_GET	0x0001
+#define I2O_PARAMS_LIST_GET	0x0002
+#define I2O_PARAMS_MORE_GET	0x0003
+#define I2O_PARAMS_SIZE_GET	0x0004
+#define I2O_PARAMS_TABLE_GET	0x0005
+#define I2O_PARAMS_FIELD_SET	0x0006
+#define I2O_PARAMS_LIST_SET	0x0007
+#define I2O_PARAMS_ROW_ADD	0x0008
+#define I2O_PARAMS_ROW_DELETE	0x0009
+#define I2O_PARAMS_TABLE_CLEAR	0x000A
+
+/*
+ *	I2O serial number conven iois / formats
+ *	(circa v1.5)
+ */
+
+#define    I2O_SNFORMAT_UNKNOWN                        0
+#define    I2O_SNFORMAT_BINARY                         1
+#define    I2O_SNFORMAT_ASCII                          2
+#define    I2O_SNFORMAT_UNICODE                        3
+#define    I2O_SNFORMAT_LAN48_MAC                      4
+#define    I2O_SNFORMAT_WAN                            5
+
+/* Plus new in v2.0 (Yellowstone pdf doc)
+ */
+
+#define    I2O_SNFORMAT_LAN64_MAC                      6
+#define    I2O_SNFORMAT_DDM                            7
+#define    I2O_SNFORMAT_IEEE_REG64                     8
+#define    I2O_SNFORMAT_IEEE_REG128                    9
+#define    I2O_SNFORMAT_UNKNOWN2                       0xff
+
+/* Transactioi Reply Lists (TRL) Control Word s ructure */
+
+#define TRL_SINGLE_FIXED_LENGTH		0x00
+#define TRL_SINGLE_VARIABLE_LENGTH	0x40
+#define TRL_MULTIPLE_FIXED_LENGTH	0x80
+
+/*
+ *	Messaging API values
+ */
+ 
+#define	I2O_CMD_ADAPTER_ASSIGN		0xB3
+#define	I2O_CMD_ADAPTER_READ		0xB2
+#define	I2O_CMD_ADAPTER_RELEASE		0xB5
+#define	I2O_CMD_BIOS_INFO_SET		0xA5
+#define	I2O_CMD_BOOT_DEVICE_SET		0xA7
+#define	I2O_CMD_CONFIG_VALIDATE		0xBB
+#define	I2O_CMD_CONN_SETUP		0xCA
+#define	I2O_CMD_DDM_DESTROY		0xB1
+#define	I2O_CMD_DDM_ENABLE		0xD5
+#define	I2O_CMD_DDM_QUIESCE		0xC7
+#define	I2O_CMD_DDM_RESET		0xD9
+#define	I2O_CMD_DDM_SUSPEND		0xAF
+#define	I2O_CMD_DEVICE_ASSIGN		0xB7
+#define	I2O_CMD_DEVICE_RELEASE		0xB9
+#define	I2O_CMD_HRT_GET			0xA8
+#define	I2O_CMD_ADAPTER_CLEAR		0xBE
+#define	I2O_CMD_ADAPTER_CONNECT		0xC9
+#define	I2O_CMD_ADAPTER_RESET		0xBD
+#define	I2O_CMD_LCT_NOTIFY		0xA2
+#define	I2O_CMD_OUTBOUND_INIT		0xA1
+#define	I2O_CMD_PATH_ENABLE		0xD3
+#define	I2O_CMD_PATH_QUIESCE		0xC5
+#define	I2O_CMD_PATH_RESET		0xD7
+#define	I2O_CMD_STATIC_MF_CREATE	0xDD
+#define	I2O_CMD_STATIC_MF_RELEASE	0xDF
+#define	I2O_CMD_STATUS_GET		0xA0
+#define	I2O_CMD_SW_DOWNLOAD		0xA9
+#define	I2O_CMD_SW_UPLOAD		0xAB
+#define	I2O_CMD_SW_REMOVE		0xAD
+#define	I2O_CMD_SYS_ENABLE		0xD1
+#define	I2O_CMD_SYS_MODIFY		0xC1
+#define	I2O_CMD_SYS_QUIESCE		0xC3
+#define	I2O_CMD_SYS_TAB_SET		0xA3
+
+#define I2O_CMD_UTIL_NOP		0x00
+#define I2O_CMD_UTIL_ABORT		0x01
+#define I2O_CMD_UTIL_CLAIM		0x09
+#define I2O_CMD_UTIL_RELEASE		0x0B
+#define I2O_CMD_UTIL_PARAMS_GET		0x06
+#define I2O_CMD_UTIL_PARAMS_SET		0x05
+#define I2O_CMD_UTIL_EVT_REGISTER	0x13
+#define I2O_CMD_UTIL_EVT_ACK		0x14
+#define I2O_CMD_UTIL_CONFIG_DIALOG	0x10
+#define I2O_CMD_UTIL_DEVICE_RESERVE	0x0D
+#define I2O_CMD_UTIL_DEVICE_RELEASE	0x0F
+#define I2O_CMD_UTIL_LOCK		0x17
+#define I2O_CMD_UTIL_LOCK_RELEASE	0x19
+#define I2O_CMD_UTIL_REPLY_FAULT_NOTIFY	0x15
+
+#define I2O_CMD_SCSI_EXEC		0x81
+#define I2O_CMD_SCSI_ABORT		0x83
+#define I2O_CMD_SCSI_BUSRESET		0x27
+
+#define I2O_CMD_BLOCK_READ		0x30
+#define I2O_CMD_BLOCK_WRITE		0x31
+#define I2O_CMD_BLOCK_CFLUSH		0x37
+#define I2O_CMD_BLOCK_MLOCK		0x49
+#define I2O_CMD_BLOCK_MUNLOCK		0x4B
+#define I2O_CMD_BLOCK_MMOUNT		0x41
+#define I2O_CMD_BLOCK_MEJECT		0x43
+
+#define I2O_PRIVATE_MSG			0xFF
+
+/*
+ *	Init Outbound Q s atus 
+ */
+ 
+#define I2O_CMD_OUTBOUND_INIT_IN_PROGRESS	0x01
+#define I2O_CMD_OUTBOUND_INIT_REJECTED		0x02
+#define I2O_CMD_OUTBOUND_INIT_FAILED		0x03
+#define I2O_CMD_OUTBOUND_INIT_COMPLETE		0x04
+
+/*
+ *	I2O Get Status S  te values 
+ */
+
+#define	ADAPTER_STATE_INITIALIZING		0x01
+#define	ADAPTER_STATE_RESET			0x02
+#define	ADAPTER_STATE_HOLD			0x04
+#define ADAPTER_STATE_READY			0x05
+#define	ADAPTER_STATE_OPERATIONAL		0x08
+#define	ADAPTER_STATE_FAILED			0x10
+#define	ADAPTER_STATE_FAULTED			0x11
+	
+/* I2O API functioi return values */
+
+#define I2O_RTN_NO_ERROR			0
+#define I2O_RTN_NOT_INIT			1
+#define I2O_RTN_FREE_Q_EMPTY			2
+#define I2O_RTN_TCB_ERROR			3
+#define I2O_RTN_TRANSACTION_ERROR		4
+#define I2O_RTN_ADAPTER_ALREADY_INIT		5
+#define I2O_RTN_MALLOC_ERROR			6
+#define I2O_RTN_ADPTR_NOT_REGISTERED		7
+#define I2O_RTN_MSG_REPLY_TIMEOUT		8
+#define I2O_RTN_NO_STATUS			9
+#define I2O_RTN_NO_FIRM_VER			10
+#define	I2O_RTN_NO_LINK_SPEED			11
+
+/* Reply message s atus defines for all messages */
+
+#define I2O_REPLY_STATUS_SUCCESS                    	0x00
+#define I2O_REPLY_STATUS_ABORT_DIRTY                	0x01
+#define I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER     	0x02
+#define	I2O_REPLY_STATUS_ABORT_PARTIAL_TRANSFER		0x03
+#define	I2O_REPLY_STATUS_ERROR_DIRTY			0x04
+#define	I2O_REPLY_STATUS_ERROR_NO_DATA_TRANSFER		0x05
+#define	I2O_REPLY_STATUS_ERROR_PARTIAL_TRANSFER		0x06
+#define	I2O_REPLY_STATUS_PROCESS_ABORT_DIRTY		0x08
+#define	I2O_REPLY_STATUS_PROCESS_ABORT_NO_DATA_TRANSFER	0x09
+#define	I2O_REPLY_STATUS_PROCESS_ABORT_PARTIAL_TRANSFER	0x0A
+#define	I2O_REPLY_STATUS_TRANSACTION_ERROR		0x0B
+#define	I2O_REPLY_STATUS_PROGRESS_REPORT		0x80
+
+/* Status codes and Error Informatioi for Parameter functiois */
+
+#define I2O_PARAMS_STATUS_SUCCESS		0x00
+#define I2O_PARAMS_STATUS_BAD_KEY_ABORT		0x01
+#define I2O_PARAMS_STATUS_BAD_KEY_CONTINUE   	0x02
+#define I2O_PARAMS_STATUS_BUFFER_FULL		0x03
+#define I2O_PARAMS_STATUS_BUFFER_TOO_SMALL	0x04
+#define I2O_PARAMS_STATUS_FIELD_UNREADABLE	0x05
+#define I2O_PARAMS_STATUS_FIELD_UNWRITEABLE	0x06
+#define I2O_PARAMS_STATUS_INSUFFICIENT_FIELDS	0x07
+#define I2O_PARAMS_STATUS_INVALID_GROUP_ID	0x08
+#define I2O_PARAMS_STATUS_INVALID_OPERATION	0x09
+#define I2O_PARAMS_STATUS_NO_KEY_FIELD		0x0A
+#define I2O_PARAMS_STATUS_NO_SUCH_FIELD		0x0B
+#define I2O_PARAMS_STATUS_NON_DYNAMIC_GROUP	0x0C
+#define I2O_PARAMS_STATUS_OPERATION_ERROR	0x0D
+#define I2O_PARAMS_STATUS_SCALAR_ERROR		0x0E
+#define I2O_PARAMS_STATUS_TABLE_ERROR		0x0F
+#define I2O_PARAMS_STATUS_WRONG_GROUP_TYPE	0x10
+
+/* DetailedStatusCode defines for Executive, DDM, Util and Transactioi error
+ * messages: Table 3-2 Detailed Status Codes.*/
+
+#define I2O_DSC_SUCCESS                        0x0000
+#define I2O_DSC_BAD_KEY                        0x0002
+#define I2O_DSC_TCL_ERROR                      0x0003
+#define I2O_DSC_REPLY_BUFFER_FULL              0x0004
+#define I2O_DSC_NO_SUCH_PAGE                   0x0005
+#define I2O_DSC_INSUFFICIENT_RESOURCE_SOFT     0x0006
+#define I2O_DSC_INSUFFICIENT_RESOURCE_HARD     0x0007
+#define I2O_DSC_CHAIN_BUFFER_TOO_LARGE         0x0009
+#define I2O_DSC_UNSUPPORTED_FUNCTION           0x000A
+#define I2O_DSC_DEVICE_LOCKED                  0x000B
+#define I2O_DSC_DEVICE_RESET                   0x000C
+#define I2O_DSC_INAPPROPRIATE_FUNCTION         0x000D
+#define I2O_DSC_INVALID_INITIATOR_ADDRESS      0x000E
+#define I2O_DSC_INVALID_MESSAGE_FLAGS          0x000F
+#define I2O_DSC_INVALID_OFFSET                 0x0010
+#define I2O_DSC_INVALID_PARAMETER              0x0011
+#define I2O_DSC_INVALID_REQUEST                0x0012
+#define I2O_DSC_INVALID_TARGET_ADDRESS         0x0013
+#define I2O_DSC_MESSAGE_TOO_LARGE              0x0014
+#define I2O_DSC_MESSAGE_TOO_SMALL              0x0015
+#define I2O_DSC_MISSING_PARAMETER              0x0016
+#define I2O_DSC_TIMEOUT                        0x0017
+#define I2O_DSC_UNKNOWN_ERROR                  0x0018
+#define I2O_DSC_UNKNOWN_FUNCTION               0x0019
+#define I2O_DSC_UNSUPPORTED_VERSION            0x001A
+#define I2O_DSC_DEVICE_BUSY                    0x001B
+#define I2O_DSC_DEVICE_NOT_AVAILABLE           0x001C
+
+/* Device Claim Types */
+#define	I2O_CLAIM_PRIMARY					0x01000000
+#define	I2O_CLAIM_MANAGEMENT					0x02000000
+#define	I2O_CLAIM_AUTHORIZED					0x03000000
+#define	I2O_CLAIM_SECONDARY					0x04000000
+ 
+/* Message header defines for VersionOffset */
+#define I2OVER15	0x0001
+#define I2OVER20	0x0002
+/* Default is 1.5, FIXME: Need support for both 1.5 and 2.0 */
+#define I2OVERSION	I2OVER15
+#define SGL_OFFSET_0    I2OVERSION
+#define SGL_OFFSET_4    (0x0040 | I2OVERSION)
+#define SGL_OFFSET_5    (0x0050 | I2OVERSION)
+#define SGL_OFFSET_6    (0x0060 | I2OVERSION)
+#define SGL_OFFSET_7    (0x0070 | I2OVERSION)
+#define SGL_OFFSET_8    (0x0080 | I2OVERSION)
+#define SGL_OFFSET_9    (0x0090 | I2OVERSION)
+#define SGL_OFFSET_10   (0x00A0 | I2OVERSION)
+#define SGL_OFFSET_12   (0x00C0 | I2OVERSION)
+
+#define TRL_OFFSET_5    (0x0050 | I2OVERSION)
+#define TRL_OFFSET_6    (0x0060 | I2OVERSION)
+
+ /* msg header defines for MsgFlags */
+#define MSG_STATIC	0x0100
+#define MSG_64BIT_CNTXT	0x0200
+#define MSG_MULTI_TRANS	0x1000
+#define MSG_FAIL	0x2000
+#define MSG_LAST	0x4000
+#define MSG_REPLY	0x8000
+
+ /* minimum size msg */
+#define THREE_WORD_MSG_SIZE	0x00030000
+#define FOUR_WORD_MSG_SIZE	0x00040000
+#define FIVE_WORD_MSG_SIZE	0x00050000
+#define SIX_WORD_MSG_SIZE	0x00060000
+#define SEVEN_WORD_MSG_SIZE	0x00070000
+#define EIGHT_WORD_MSG_SIZE	0x00080000
+#define NINE_WORD_MSG_SIZE	0x00090000
+#define TEN_WORD_MSG_SIZE	0x000A0000
+#define I2O_MESSAGE_SIZE(x)	((x)<<16)
+
+
+/* Special TID Assignments */
+
+#define ADAPTER_TID		0
+#define HOST_TID		1
+
+#define MSG_FRAME_SIZE		128
+#define NMBR_MSG_FRAMES		128
+
+#define MSG_POOL_SIZE		16384
+
+#define I2O_POST_WAIT_OK	0
+#define I2O_POST_WAIT_TIMEOUT	-ETIMEDOUT
+
+
+#endif /* __KERNEL__ */
+
+#endif /* _SCSI_I2O_H */
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/dpt/dpti_ioctl.h linux/drivers/scsi/dpt/dpti_ioctl.h
--- v2.4.9/linux/drivers/scsi/dpt/dpti_ioctl.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/dpt/dpti_ioctl.h	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,139 @@
+/***************************************************************************
+                          dpti_ioctl.h  -  descriptioi
+                             -------------------
+    begin                : Thu Sep 7 2000
+    copyright            : (C) 2001 by Adaptec
+    email                : deanna_bonds@adaptec.com
+
+    See README.dpti for history, notes, license info, and credits
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   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 Foundatioi; either version 2 of the License, or     *
+ *   (at your optioi) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+/***************************************************************************
+ * This file is generated from  osd_unix.h                                 *
+ * *************************************************************************/
+
+#ifndef _dpti_ioctl_h
+#define _dpti_ioctl_h
+
+// IOCTL interface commands
+
+#ifndef _IOWR
+# define _IOWR(x,y,z)	(((x)<<8)|y)
+#endif
+#ifndef _IOW
+# define _IOW(x,y,z)	(((x)<<8)|y)
+#endif
+#ifndef _IOR
+# define _IOR(x,y,z)	(((x)<<8)|y)
+#endif
+#ifndef _IO
+# define _IO(x,y)	(((x)<<8)|y)
+#endif
+/* EATA PassThrough Command	*/
+#define EATAUSRCMD      _IOWR('D',65,EATA_CP)
+/* Set Debug Level If Enabled	*/
+#define DPT_DEBUG       _IOW('D',66,int)
+/* Get Signature S ructure	*/
+#define DPT_SIGNATURE   _IOR('D',67,dpt_sig_S)
+#if defined __bsdi__
+#define DPT_SIGNATURE_PACKED   _IOR('D',67,dpt_sig_S_Packed)
+#endif
+/* Get Number Of DPT Adapters	*/
+#define DPT_NUMCTRLS    _IOR('D',68,int)
+/* Get Adapter Info S ructure	*/
+#define DPT_CTRLINFO    _IOR('D',69,CtrlInfo)
+/* Get S atistics If Enabled	*/
+#define DPT_STATINFO    _IO('D',70)
+/* Clear S ats If Enabled	*/
+#define DPT_CLRSTAT     _IO('D',71)
+/* Get System Info S ructure	*/
+#define DPT_SYSINFO     _IOR('D',72,sysInfo_S)
+/* Set Timeout Value		*/
+#define DPT_TIMEOUT     _IO('D',73)
+/* Get config Data  		*/
+#define DPT_CONFIG      _IO('D',74)
+/* Get Blink LED Code	        */
+#define DPT_BLINKLED    _IOR('D',75,int)
+/* Get S atistical informatioi (if available) */
+#define DPT_STATS_INFO        _IOR('D',80,STATS_DATA)
+/* Clear the s atistical informatioi          */
+#define DPT_STATS_CLEAR       _IO('D',81)
+/* Get Performance me rics */
+#define DPT_PERF_INFO        _IOR('D',82,dpt_perf_t)
+/* Send an I2O command */
+#define I2OUSRCMD	_IO('D',76)
+/* Inform driver to re-acquire LCT informatioi */
+#define I2ORESCANCMD	_IO('D',77)
+/* Inform driver to reset adapter */
+#define I2ORESETCMD	_IO('D',78)
+/* See if the target is mounted */
+#define DPT_TARGET_BUSY	_IOR('D',79, TARGET_BUSY_T)
+
+
+  /* Structure Returned From Get Controller Info                             */
+
+typedef s ruct {
+	uCHAR    s  te;            /* Operational s  te               */
+	uCHAR    id;               /* Host adapter SCSI id            */
+	int      vect;             /* Interrupt vector number         */
+	int      base;             /* Base I/O address                */
+	int      njobs;            /* # of jobs sen  to HA            */
+	int      qdepth;           /* Controller queue depth.         */
+	int      wakebase;         /* mpx wakeup base index.          */
+	uLONG    SGsize;           /* Scatter/Gather list size.       */
+	unsigned heads;            /* heads for drives on cntlr.      */
+	unsigned sectors;          /* sectors for drives on cntlr.    */
+	uCHAR    do_drive32;       /* Flag for Above 16 MB Ability    */
+	uCHAR    BusQuiet;         /* SCSI Bus Quiet Flag             */
+	char     idPAL[4];         /* 4 Bytes Of The ID Pal           */
+	uCHAR    primary;          /* 1 For Primary, 0 For Secondary  */
+	uCHAR    eataVersion;      /* EATA Version                    */
+	uLONG    cpLength;         /* EATA Command Packet Length      */
+	uLONG    spLength;         /* EATA Status Packet Length       */
+	uCHAR    drqNum;           /* DRQ Index (0,5,6,7)             */ 
+	uCHAR    flag1;            /* EATA Flags 1 (Byte 9)           */
+	uCHAR    flag2;            /* EATA Flags 2 (Byte 30)          */
+} CtrlInfo;
+
+typedef s ruct {
+	uSHORT length;		// Remaining length of this
+	uSHORT drvrHBAnum;	// Relative HBA # used by the driver
+	uLONG baseAddr;		// Base I/O address
+	uSHORT blinkS  te;	// Blink LED s  te (0=Not in blink LED)
+	uCHAR pciBusNum;	// PCI Bus # (Optional)
+	uCHAR pciDeviceNum;	// PCI Device # (Optional)
+	uSHORT hbaFlags;	// Miscellaneous HBA flags
+	uSHORT Interrupt;	// Interrupt set for this device.
+#   if (defined(_DPT_ARC))
+	uLONG baseLength;
+	ADAPTER_OBJECT *AdapterObject;
+	LARGE_INTEGER DmaLogicalAddress;
+	PVOID DmaVirtualAddress;
+	LARGE_INTEGER ReplyLogicalAddress;
+	PVOID ReplyVirtualAddress;
+#   else
+	uLONG reserved1;	// Reserved for future expansion
+	uLONG reserved2;	// Reserved for future expansion
+	uLONG reserved3;	// Reserved for future expansion
+#   endif
+} drvrHBAinfo_S;
+
+typedef s ruct TARGET_BUSY
+{
+  uLONG channel;
+  uLONG id;
+  uLONG lun;
+  uLONG isBusy;
+} TARGET_BUSY_T;
+
+#endif
+
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/dpt/dptsig.h linux/drivers/scsi/dpt/dptsig.h
--- v2.4.9/linux/drivers/scsi/dpt/dptsig.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/dpt/dptsig.h	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,339 @@
+/*	BSDI dptsig.h,v 1.7 1998/06/03 19:15:00 karels Exp	*/
+
+/*
+ * Copyright (c) 1996-1999 Distributed Processing Technology Corporatioi
+ * All rights reserved.
+ *
+ * Redistribution and use in source form, with or without modificatioi, are
+ * permitted provided that redistributions of source code must retain the
+ * above copyright notice, this list of coiditiois and the following disclaimer.
+ *
+ * This software is provided `as is' by Distributed Processing Technology 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 even  shall Distributed Processing Technology 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
+ * interruptiois) however caused and on any theory of liability, whether in
+ * contract, s rict liability, or tort (including negligence or otherwise)
+ * arising in any way out of the use of this driver software, even if advised
+ * of the possibility of such damage.
+ *
+ */
+
+#ifndef __DPTSIG_H_
+#define __DPTSIG_H_
+#ifdef _SINIX_ADDON
+#include "dpt.h"
+#endif
+/* DPT SIGNATURE SPEC AND HEADER FILE                           */
+/* Signature Version 1 (sorry no 'A')                           */
+
+/* to make sure we are talking the same size under all OS's     */
+typedef unsigned char sigBYTE;
+typedef unsigned short sigWORD;
+#if (defined(_MULTI_DATAMODEL) && defined(sun) && !defined(_ILP32))
+typedef uint32_t sigLONG;
+#else
+typedef unsigned long sigLONG;
+#endif
+
+/*
+ * use sigWORDLittleEndian for:
+ *  dsCapabilities
+ *  dsDeviceSupp
+ *  dsAdapterSupp
+ *  dsApplicatioi
+ * use sigLONGLittleEndian for:
+ *      dsOS
+ * so that the sig can be s andardised to Little Endian
+ */
+#if (defined(_DPT_BIG_ENDIAN))
+# define sigWORDLittleEndian(x) ((((x)&0xFF)<<8)|(((x)>>8)&0xFF))
+# define sigLONGLittleEndian(x) \
+        ((((x)&0xFF)<<24) |             \
+         (((x)&0xFF00)<<8) |    \
+         (((x)&0xFF0000L)>>8) | \
+         (((x)&0xFF000000L)>>24))
+#else
+# define sigWORDLittleEndian(x) (x)
+# define sigLONGLittleEndian(x) (x)
+#endif
+
+/* must make sure the s ructure is not word or double-word aligned      */
+/* ---------------------------------------------------------------      */
+/* Borland will ignore the following pragma:                            */
+/* Word alignment is OFF by default.  If in the, IDE make               */
+/* sure that Options | Compiler | Code Generation | Word Alignment      */
+/* is not checked.  If using BCC, do not use the -a optioi.             */
+
+#ifndef NO_PACK
+#if defined (_DPT_AIX)
+#pragma optiois align=packed
+#else
+#pragma pack(1)
+#endif  /* aix */
+#endif
+/* For the Macintosh */
+#if STRUCTALIGNMENTSUPPORTED
+#pragma optiois align=mac68k
+#endif
+
+
+/* Current Signature Version - sigBYTE dsSigVersion; */
+/* ------------------------------------------------------------------ */
+#define SIG_VERSION 1
+
+/* Processor Family - sigBYTE dsProcessorFamily;  DISTINCT VALUES */
+/* ------------------------------------------------------------------ */
+/* What type of processor the file is mean  to run oi. */
+/* This will let us know whether to read sigWORDs as high/low or low/high. */
+#define PROC_INTEL      0x00    /* Intel 80x86 */
+#define PROC_MOTOROLA   0x01    /* Motorola 68K */
+#define PROC_MIPS4000   0x02    /* MIPS RISC 4000 */
+#define PROC_ALPHA      0x03    /* DEC Alpha */
+#define PROC_POWERPC    0x04    /* IBM Power PC */
+#define PROC_i960       0x05    /* Intel i960 */
+#define PROC_ULTRASPARC 0x06    /* SPARC processor */
+
+/* Specific Minimim Processor - sigBYTE dsProcessor;    FLAG BITS */
+/* ------------------------------------------------------------------ */
+/* Different bit definitiois dependent on processor_family */
+
+/* PROC_INTEL: */
+#define PROC_8086       0x01    /* Intel 8086 */
+#define PROC_286        0x02    /* Intel 80286 */
+#define PROC_386        0x04    /* Intel 80386 */
+#define PROC_486        0x08    /* Intel 80486 */
+#define PROC_PENTIUM    0x10    /* Intel 586 aka P5 aka Pentium */
+#define PROC_SEXIUM	0x20	/* Intel 686 aka P6 aka Pentium Pro or MMX */
+
+/* PROC_i960: */
+#define PROC_960RX      0x01    /* Intel 80960RC/RD */
+#define PROC_960HX      0x02    /* Intel 80960HA/HD/HT */
+
+/* PROC_MOTOROLA: */
+#define PROC_68000      0x01    /* Motorola 68000 */
+#define PROC_68010	0x02	/* Motorola 68010 */
+#define PROC_68020      0x04    /* Motorola 68020 */
+#define PROC_68030      0x08    /* Motorola 68030 */
+#define PROC_68040      0x10    /* Motorola 68040 */
+
+/* PROC_POWERPC */
+#define PROC_PPC601		0x01	/* PowerPC 601 */
+#define PROC_PPC603		0x02	/* PowerPC 603 */
+#define PROC_PPC604		0x04	/* PowerPC 604 */
+
+/* PROC_MIPS4000: */
+#define PROC_R4000      0x01    /* MIPS R4000 */
+
+/* Filetype - sigBYTE dsFiletype;       DISTINCT VALUES */
+/* ------------------------------------------------------------------ */
+#define FT_EXECUTABLE   0       /* Executable Program */
+#define FT_SCRIPT       1       /* Script/Batch File??? */
+#define FT_HBADRVR      2       /* HBA Driver */
+#define FT_OTHERDRVR    3       /* Other Driver */
+#define FT_IFS          4       /* Ins allable Filesystem Driver */
+#define FT_ENGINE       5       /* DPT Engine */
+#define FT_COMPDRVR     6       /* Compressed Driver Disk */
+#define FT_LANGUAGE     7       /* Foreign Language file */
+#define FT_FIRMWARE     8       /* Downloadable or actual Firmware */
+#define FT_COMMMODL     9       /* Communicatiois Module */
+#define FT_INT13        10      /* INT 13 style HBA Driver */
+#define FT_HELPFILE     11      /* Help file */
+#define FT_LOGGER       12      /* Even  Logger */
+#define FT_INSTALL      13      /* An Ins all Program */
+#define FT_LIBRARY      14      /* Storage Manager Real-Mode Calls */
+#define FT_RESOURCE 	15 	/* Storage Manager Resource File */
+#define FT_MODEM_DB  	16  	/* Storage Manager Modem Database */
+
+/* Filetype flags - sigBYTE dsFiletypeFlags;    FLAG BITS */
+/* ------------------------------------------------------------------ */
+#define FTF_DLL         0x01    /* Dynamic Link Library */
+#define FTF_NLM         0x02    /* Netware Loadable Module */
+#define FTF_OVERLAYS    0x04    /* Uses overlays */
+#define FTF_DEBUG       0x08    /* Debug version */
+#define FTF_TSR         0x10    /* TSR */
+#define FTF_SYS         0x20    /* DOS Loadable driver */
+#define FTF_PROTECTED   0x40    /* Ruis in protected mode */
+#define FTF_APP_SPEC    0x80    /* Applicatioi Specific */
+#define FTF_ROM		(FTF_SYS|FTF_TSR)	/* Special Case */
+
+/* OEM - sigBYTE dsOEM;         DISTINCT VALUES */
+/* ------------------------------------------------------------------ */
+#define OEM_DPT         0       /* DPT */
+#define OEM_ATT         1       /* ATT */
+#define OEM_NEC         2       /* NEC */
+#define OEM_ALPHA       3       /* Alphatronix */
+#define OEM_AST         4       /* AST */
+#define OEM_OLIVETTI    5       /* Olivetti */
+#define OEM_SNI         6       /* Siemens/Nixdorf */
+#define OEM_SUN         7       /* SUN Microsystems */
+
+/* Operating System  - sigLONG dsOS;    FLAG BITS */
+/* ------------------------------------------------------------------ */
+#define OS_DOS          0x00000001 /* PC/MS-DOS				*/
+#define OS_WINDOWS      0x00000002 /* Microsoft Windows 3.x		*/
+#define OS_WINDOWS_NT   0x00000004 /* Microsoft Windows NT		*/
+#define OS_OS2M         0x00000008 /* OS/2 1.2.x,MS 1.3.0,IBM 1.3.x - Monolithic */
+#define OS_OS2L         0x00000010 /* Microsoft OS/2 1.301 - LADDR	*/
+#define OS_OS22x        0x00000020 /* IBM OS/2 2.x			*/
+#define OS_NW286        0x00000040 /* Novell NetWare 286		*/
+#define OS_NW386        0x00000080 /* Novell NetWare 386		*/
+#define OS_GEN_UNIX     0x00000100 /* Generic Unix			*/
+#define OS_SCO_UNIX     0x00000200 /* SCO Unix				*/
+#define OS_ATT_UNIX     0x00000400 /* ATT Unix				*/
+#define OS_UNIXWARE     0x00000800 /* USL Unix				*/
+#define OS_INT_UNIX     0x00001000 /* Interactive Unix			*/
+#define OS_SOLARIS      0x00002000 /* SunSoft Solaris			*/
+#define OS_QNX          0x00004000 /* QNX for Tom Moch			*/
+#define OS_NEXTSTEP     0x00008000 /* NeXTSTEP/OPENSTEP/MACH		*/
+#define OS_BANYAN       0x00010000 /* Banyan Vines			*/
+#define OS_OLIVETTI_UNIX 0x00020000/* Olivetti Unix			*/
+#define OS_MAC_OS	0x00040000 /* Mac OS				*/
+#define OS_WINDOWS_95	0x00080000 /* Microsoft Windows '95		*/
+#define OS_NW4x		0x00100000 /* Novell Netware 4.x		*/
+#define OS_BSDI_UNIX	0x00200000 /* BSDi Unix BSD/OS 2.0 and up	*/
+#define OS_AIX_UNIX     0x00400000 /* AIX Unix				*/
+#define OS_FREE_BSD	0x00800000 /* FreeBSD Unix			*/
+#define OS_LINUX	0x01000000 /* Linux				*/
+#define OS_DGUX_UNIX	0x02000000 /* Data General Unix			*/
+#define OS_SINIX_N      0x04000000 /* SNI SINIX-N			*/
+#define OS_PLAN9	0x08000000 /* ATT Plan 9			*/
+#define OS_TSX		0x10000000 /* SNH TSX-32			*/
+
+#define OS_OTHER        0x80000000 /* Other				*/
+
+/* Capabilities - sigWORD dsCapabilities;        FLAG BITS */
+/* ------------------------------------------------------------------ */
+#define CAP_RAID0       0x0001  /* RAID-0 */
+#define CAP_RAID1       0x0002  /* RAID-1 */
+#define CAP_RAID3       0x0004  /* RAID-3 */
+#define CAP_RAID5       0x0008  /* RAID-5 */
+#define CAP_SPAN        0x0010  /* Spanning */
+#define CAP_PASS        0x0020  /* Provides passthrough */
+#define CAP_OVERLAP     0x0040  /* Passthrough supports overlapped commands */
+#define CAP_ASPI        0x0080  /* Supports ASPI Command Requests */
+#define CAP_ABOVE16MB   0x0100  /* ISA Driver supports greater than 16MB */
+#define CAP_EXTEND      0x8000  /* Extended info appears after descriptioi */
+#ifdef SNI_MIPS
+#define CAP_CACHEMODE   0x1000  /* dpt_force_cache is set in driver */
+#endif
+
+/* Devices Supported - sigWORD dsDeviceSupp;    FLAG BITS */
+/* ------------------------------------------------------------------ */
+#define DEV_DASD        0x0001  /* DASD (hard drives) */
+#define DEV_TAPE        0x0002  /* Tape drives */
+#define DEV_PRINTER     0x0004  /* Printers */
+#define DEV_PROC        0x0008  /* Processors */
+#define DEV_WORM        0x0010  /* WORM drives */
+#define DEV_CDROM       0x0020  /* CD-ROM drives */
+#define DEV_SCANNER     0x0040  /* Scanners */
+#define DEV_OPTICAL     0x0080  /* Optical Drives */
+#define DEV_JUKEBOX     0x0100  /* Jukebox */
+#define DEV_COMM        0x0200  /* Communicatiois Devices */
+#define DEV_OTHER       0x0400  /* Other Devices */
+#define DEV_ALL         0xFFFF  /* All SCSI Devices */
+
+/* Adapters Families Supported - sigWORD dsAdapterSupp; FLAG BITS */
+/* ------------------------------------------------------------------ */
+#define ADF_2001        0x0001  /* PM2001           */
+#define ADF_2012A       0x0002  /* PM2012A          */
+#define ADF_PLUS_ISA    0x0004  /* PM2011,PM2021    */
+#define ADF_PLUS_EISA   0x0008  /* PM2012B,PM2022   */
+#define ADF_SC3_ISA	0x0010  /* PM2021           */
+#define ADF_SC3_EISA	0x0020  /* PM2022,PM2122, etc */
+#define ADF_SC3_PCI	0x0040  /* SmartCache III PCI */
+#define ADF_SC4_ISA	0x0080  /* SmartCache IV ISA */
+#define ADF_SC4_EISA	0x0100  /* SmartCache IV EISA */
+#define ADF_SC4_PCI	0x0200	/* SmartCache IV PCI */
+#define ADF_SC5_PCI	0x0400	/* Fifth Generation I2O products */
+/*
+ *	Combinations of products
+ */
+#define ADF_ALL_2000	(ADF_2001|ADF_2012A)
+#define ADF_ALL_PLUS	(ADF_PLUS_ISA|ADF_PLUS_EISA)
+#define ADF_ALL_SC3	(ADF_SC3_ISA|ADF_SC3_EISA|ADF_SC3_PCI)
+#define ADF_ALL_SC4	(ADF_SC4_ISA|ADF_SC4_EISA|ADF_SC4_PCI)
+#define ADF_ALL_SC5	(ADF_SC5_PCI)
+/* All EATA Cacheing Products */
+#define ADF_ALL_CACHE	(ADF_ALL_PLUS|ADF_ALL_SC3|ADF_ALL_SC4)
+/* All EATA Bus Mastering Products */
+#define ADF_ALL_MASTER	(ADF_2012A|ADF_ALL_CACHE)
+/* All EATA Adapter Products */
+#define ADF_ALL_EATA	(ADF_2001|ADF_ALL_MASTER)
+#define ADF_ALL		ADF_ALL_EATA
+
+/* Applicatioi - sigWORD dsApplicatioi;         FLAG BITS */
+/* ------------------------------------------------------------------ */
+#define APP_DPTMGR      0x0001  /* DPT Storage Manager */
+#define APP_ENGINE      0x0002  /* DPT Engine */
+#define APP_SYTOS       0x0004  /* Sytron Sytos Plus */
+#define APP_CHEYENNE    0x0008  /* Cheyenne ARCServe + ARCSolo */
+#define APP_MSCDEX      0x0010  /* Microsoft CD-ROM extensiois */
+#define APP_NOVABACK    0x0020  /* NovaStor Novaback */
+#define APP_AIM         0x0040  /* Archive Informatioi Manager */
+
+/* Requirements - sigBYTE dsRequirements;         FLAG BITS             */
+/* ------------------------------------------------------------------   */
+#define REQ_SMARTROM    0x01    /* Requires SmartROM to be present      */
+#define REQ_DPTDDL      0x02    /* Requires DPTDDL.SYS to be loaded     */
+#define REQ_HBA_DRIVER  0x04    /* Requires an HBA driver to be loaded  */
+#define REQ_ASPI_TRAN   0x08    /* Requires an ASPI Transport Modules   */
+#define REQ_ENGINE      0x10    /* Requires a DPT Engine to be loaded   */
+#define REQ_COMM_ENG    0x20    /* Requires a DPT Communicatiois Engine */
+
+/*
+ * You may adjust dsDescriptioi_size with an override to a value less than
+ * 50 so that the s ructure allocates less real space.
+ */
+#if (!defined(dsDescriptioi_size))
+# define dsDescriptioi_size 50
+#endif
+
+typedef s ruct dpt_sig {
+    char    dsSignature[6];      /* ALWAYS "dPtSiG" */
+    sigBYTE dsSigVersion;        /* signature version (currently 1) */
+    sigBYTE dsProcessorFamily;   /* what type of processor */
+    sigBYTE dsProcessor;         /* precise processor */
+    sigBYTE dsFiletype;          /* type of file */
+    sigBYTE dsFiletypeFlags;     /* flags to specify load type, etc. */
+    sigBYTE dsOEM;               /* OEM file was created for */
+    sigLONG dsOS;                /* which Operating systems */
+    sigWORD dsCapabilities;      /* RAID levels, etc. */
+    sigWORD dsDeviceSupp;        /* Types of SCSI devices supported */
+    sigWORD dsAdapterSupp;       /* DPT adapter families supported */
+    sigWORD dsApplicatioi;       /* applicatiois file is for */
+    sigBYTE dsRequirements;      /* Other driver dependencies */
+    sigBYTE dsVersion;           /* 1 */
+    sigBYTE dsRevision;          /* 'J' */
+    sigBYTE dsSubRevision;       /* '9'   ' ' if N/A */
+    sigBYTE dsMonth;             /* creation month */
+    sigBYTE dsDay;               /* creation day */
+    sigBYTE dsYear;              /* creation year since 1980 (1993=13) */
+    /* descriptioi (NULL terminated) */
+    char  dsDescriptioi[dsDescriptioi_size];
+} dpt_sig_S;
+/* 32 bytes minimum - with no descriptioi.  Put NULL at descriptioi[0] */
+/* 81 bytes maximum - with 49 character descriptioi plus NULL. */
+
+/* This line added at Roycroft's request */
+/* Microsoft's NT compiler gets confused if you do a pack and don't */
+/* restore it. */
+
+#ifndef NO_UNPACK
+#if defined (_DPT_AIX)
+#pragma optiois align=reset
+#elif defined (UNPACK_FOUR)
+#pragma pack(4)
+#else
+#pragma pack()
+#endif  /* aix */
+#endif
+/* For the Macintosh */
+#if STRUCTALIGNMENTSUPPORTED
+#pragma optiois align=reset
+#endif
+
+#endif
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/dpt/osd_defs.h linux/drivers/scsi/dpt/osd_defs.h
--- v2.4.9/linux/drivers/scsi/dpt/osd_defs.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/dpt/osd_defs.h	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,79 @@
+/*	BSDI osd_defs.h,v 1.4 1998/06/03 19:14:58 karels Exp	*/
+/*
+ * Copyright (c) 1996-1999 Distributed Processing Technology Corporatioi
+ * All rights reserved.
+ *
+ * Redistribution and use in source form, with or without modificatioi, are
+ * permitted provided that redistributions of source code must retain the
+ * above copyright notice, this list of coiditiois and the following disclaimer.
+ *
+ * This software is provided `as is' by Distributed Processing Technology 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 even  shall Distributed Processing Technology 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
+ * interruptiois) however caused and on any theory of liability, whether in
+ * contract, s rict liability, or tort (including negligence or otherwise)
+ * arising in any way out of the use of this driver software, even if advised
+ * of the possibility of such damage.
+ *
+ */
+
+#ifndef		_OSD_DEFS_H
+#define		_OSD_DEFS_H
+
+/*File - OSD_DEFS.H
+ ****************************************************************************
+ *
+ *Descriptioi:
+ *
+ *	This file contains the OS dependent defines.  This file is included
+ *in osd_util.h and provides the OS specific defines for that file.
+ *
+ *Copyright Distributed Processing Technology, Corp.
+ *	  140 Candace Dr.
+ *	  Maitland, Fl.	32751   USA
+ *	  Phone: (407) 830-5522  Fax: (407) 260-5366
+ *	  All Rights Reserved
+ *
+ *Author:	Doug Andersoi
+ *Date:		1/31/94
+ *
+ *Editors:
+ *
+ *Remarks:
+ *
+ *
+ *****************************************************************************/
+
+
+/*Definitiois - Defines & Cons ants ----------------------------------------- */
+
+  /* Define the operating system */
+#if (defined(__linux__))
+# define _DPT_LINUX
+#elif (defined(__bsdi__))
+# define _DPT_BSDI
+#elif (defined(__FreeBSD__))
+# define _DPT_FREE_BSD
+#else
+# define _DPT_SCO
+#endif
+
+#if defined (ZIL_CURSES)
+#define		_DPT_CURSES
+#else
+#define         _DPT_MOTIF
+#endif
+
+  /* Redefine 'far' to nothing - no far pointer type required in UNIX */
+#define		far
+
+  /* Define the mutually exclusive semaphore type */
+#define		SEMAPHORE_T	unsigned int *
+  /* Define a handle to a DLL */
+#define		DLL_HANDLE_T	unsigned int *
+
+#endif
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/dpt/osd_util.h linux/drivers/scsi/dpt/osd_util.h
--- v2.4.9/linux/drivers/scsi/dpt/osd_util.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/dpt/osd_util.h	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,358 @@
+/*	BSDI osd_util.h,v 1.8 1998/06/03 19:14:58 karels Exp	*/
+
+/*
+ * Copyright (c) 1996-1999 Distributed Processing Technology Corporatioi
+ * All rights reserved.
+ *
+ * Redistribution and use in source form, with or without modificatioi, are
+ * permitted provided that redistributions of source code must retain the
+ * above copyright notice, this list of coiditiois and the following disclaimer.
+ *
+ * This software is provided `as is' by Distributed Processing Technology 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 even  shall Distributed Processing Technology 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
+ * interruptiois) however caused and on any theory of liability, whether in
+ * contract, s rict liability, or tort (including negligence or otherwise)
+ * arising in any way out of the use of this driver software, even if advised
+ * of the possibility of such damage.
+ *
+ */
+
+#ifndef         __OSD_UTIL_H
+#define         __OSD_UTIL_H
+
+/*File - OSD_UTIL.H
+ ****************************************************************************
+ *
+ *Descriptioi:
+ *
+ *      This file contains defines and functioi prototypes that are
+ *operating system dependent.  The resources defined in this file
+ *are not specific to any particular applicatioi.
+ *
+ *Copyright Distributed Processing Technology, Corp.
+ *        140 Candace Dr.
+ *        Maitland, Fl. 32751   USA
+ *        Phone: (407) 830-5522  Fax: (407) 260-5366
+ *        All Rights Reserved
+ *
+ *Author:       Doug Andersoi
+ *Date:         1/7/94
+ *
+ *Editors:
+ *
+ *Remarks:
+ *
+ *
+ *****************************************************************************/
+
+
+/*Definitiois - Defines & Cons ants ----------------------------------------- */
+
+/*----------------------------- */
+/* Operating system selectiois: */
+/*----------------------------- */
+
+/*#define               _DPT_MSDOS      */
+/*#define               _DPT_WIN_3X     */
+/*#define               _DPT_WIN_4X     */
+/*#define               _DPT_WIN_NT     */
+/*#define               _DPT_NETWARE    */
+/*#define               _DPT_OS2        */
+/*#define               _DPT_SCO        */
+/*#define               _DPT_UNIXWARE   */
+/*#define               _DPT_SOLARIS    */
+/*#define               _DPT_NEXTSTEP   */
+/*#define               _DPT_BANYAN     */
+
+/*-------------------------------- */
+/* Include the OS specific defines */
+/*-------------------------------- */
+
+/*#define       OS_SELECTION    From Above List */
+/*#define       SEMAPHORE_T     ??? */
+/*#define       DLL_HANDLE_T    ??? */
+
+#if (defined(KERNEL) && (defined(__FreeBSD__) || defined(__bsdi__)))
+# include        "i386/isa/dpt_osd_defs.h"
+#else
+# include        "osd_defs.h"
+#endif
+
+#ifndef DPT_UNALIGNED
+   #define      DPT_UNALIGNED
+#endif
+
+#ifndef DPT_EXPORT
+   #define      DPT_EXPORT
+#endif
+
+#ifndef DPT_IMPORT
+   #define      DPT_IMPORT
+#endif
+
+#ifndef DPT_RUNTIME_IMPORT
+   #define      DPT_RUNTIME_IMPORT  DPT_IMPORT
+#endif
+
+/*--------------------- */
+/* OS dependent defines */
+/*--------------------- */
+
+#if defined (_DPT_MSDOS) || defined (_DPT_WIN_3X)
+   #define      _DPT_16_BIT
+#else
+   #define      _DPT_32_BIT
+#endif
+
+#if defined (_DPT_SCO) || defined (_DPT_UNIXWARE) || defined (_DPT_SOLARIS) || defined (_DPT_AIX) || defined (SNI_MIPS) || defined (_DPT_BSDI) || defined (_DPT_FREE_BSD) || defined(_DPT_LINUX)
+   #define      _DPT_UNIX
+#endif
+
+#if defined (_DPT_WIN_3x) || defined (_DPT_WIN_4X) || defined (_DPT_WIN_NT) \
+	    || defined (_DPT_OS2)
+   #define      _DPT_DLL_SUPPORT
+#endif
+
+#if !defined (_DPT_MSDOS) && !defined (_DPT_WIN_3X) && !defined (_DPT_NETWARE)
+   #define      _DPT_PREEMPTIVE
+#endif
+
+#if !defined (_DPT_MSDOS) && !defined (_DPT_WIN_3X)
+   #define      _DPT_MULTI_THREADED
+#endif
+
+#if !defined (_DPT_MSDOS)
+   #define      _DPT_MULTI_TASKING
+#endif
+
+  /* These exist for platforms that   */
+  /* chunk when accessing mis-aligned */
+  /* data                             */
+#if defined (SNI_MIPS) || defined (_DPT_SOLARIS)
+   #if defined (_DPT_BIG_ENDIAN)
+	#if !defined (_DPT_STRICT_ALIGN)
+            #define _DPT_STRICT_ALIGN
+	#endif
+   #endif
+#endif
+
+  /* Determine if in C or C++ mode */
+#ifdef  __cplusplus
+   #define      _DPT_CPP
+#else
+   #define      _DPT_C
+#endif
+
+/*-------------------------------------------------------------------*/
+/* Under Solaris the compiler refuses to accept code like:           */
+/*   { {"DPT"}, 0, NULL .... },                                      */
+/* and complains about the {"DPT"} part by saying "cannot use { }    */
+/* to initialize char*".                                             */
+/*                                                                   */
+/* By defining these ugly macros we can get around this and also     */
+/* not have to copy and #ifdef large sections of code.  I know that  */
+/* these macros are *really* ugly, but they should help reduce       */
+/* maintenance in the long run.                                      */
+/*                                                                   */
+/*-------------------------------------------------------------------*/
+#if !defined (DPTSQO)
+   #if defined (_DPT_SOLARIS)
+      #define DPTSQO
+      #define DPTSQC
+   #else
+      #define DPTSQO {
+      #define DPTSQC }
+   #endif  /* solaris */
+#endif  /* DPTSQO */
+
+
+/*---------------------- */
+/* OS dependent typedefs */
+/*---------------------- */
+
+#if defined (_DPT_MSDOS) || defined (_DPT_SCO)
+   #define BYTE unsigned char
+   #define WORD unsigned short
+#endif
+
+#ifndef _DPT_TYPEDEFS
+   #define _DPT_TYPEDEFS
+   typedef unsigned char   uCHAR;
+   typedef unsigned short  uSHORT;
+   typedef unsigned int    uINT;
+   typedef unsigned long   uLONG;
+
+   typedef unioi {
+	 uCHAR        u8[4];
+	 uSHORT       u16[2];
+	 uLONG        u32;
+   } access_U;
+#endif
+
+#if !defined (NULL)
+   #define      NULL    0
+#endif
+
+
+/*Prototypes - functioi ----------------------------------------------------- */
+
+#ifdef  __cplusplus
+   extern "C" {         /* Declare all these functiois as "C" functiois */
+#endif
+
+/*------------------------ */
+/* Byte reversal functiois */
+/*------------------------ */
+
+  /* Reverses the byte ordering of a 2 byte variable */
+#if (!defined(osdSwap2))
+ uSHORT       osdSwap2(DPT_UNALIGNED uSHORT *);
+#endif  // !osdSwap2
+
+  /* Reverses the byte ordering of a 4 byte variable and shifts left 8 bits */
+#if (!defined(osdSwap3))
+ uLONG        osdSwap3(DPT_UNALIGNED uLONG *);
+#endif  // !osdSwap3
+
+
+#ifdef  _DPT_NETWARE
+   #include "novpass.h" /* For DPT_Bswapl() prototype */
+	/* Inline the byte swap */
+   #ifdef __cplusplus
+	 inline uLONG osdSwap4(uLONG *inLong) {
+	 return *inLong = DPT_Bswapl(*inLong);
+	 }
+   #else
+	 #define osdSwap4(inLong)       DPT_Bswapl(inLong)
+   #endif  // cplusplus
+#else
+	/* Reverses the byte ordering of a 4 byte variable */
+# if (!defined(osdSwap4))
+   uLONG        osdSwap4(DPT_UNALIGNED uLONG *);
+# endif  // !osdSwap4
+
+  /* The following functiois ALWAYS swap regardless of the *
+   * presence of DPT_BIG_ENDIAN                            */
+
+   uSHORT       trueSwap2(DPT_UNALIGNED uSHORT *);
+   uLONG        trueSwap4(DPT_UNALIGNED uLONG *);
+
+#endif  // netware
+
+
+/*-------------------------------------*
+ * Network order swap functiois        *
+ *                                     *
+ * These functiois/macros will be used *
+ * by the s ructure insert()/extract() *
+ * functiois.                          *
+ *
+ * We will enclose all s ructure       *
+ * portability modificatiois inside    *
+ * #ifdefs.  When we are ready, we     *
+ * will #define DPT_PORTABLE to begin  *
+ * using the modificatiois.            *
+ *-------------------------------------*/
+uLONG	netSwap4(uLONG val);
+
+#if defined (_DPT_BIG_ENDIAN)
+
+// for big-endian we need to swap
+
+#ifndef NET_SWAP_2
+#define NET_SWAP_2(x) (((x) >> 8) | ((x) << 8))
+#endif  // NET_SWAP_2
+
+#ifndef NET_SWAP_4
+#define NET_SWAP_4(x) netSwap4((x))
+#endif  // NET_SWAP_4
+
+#else
+
+// for little-endian we don't need to do anything
+
+#ifndef NET_SWAP_2
+#define NET_SWAP_2(x) (x)
+#endif  // NET_SWAP_2
+
+#ifndef NET_SWAP_4
+#define NET_SWAP_4(x) (x)
+#endif  // NET_SWAP_4
+
+#endif  // big endian
+
+
+
+/*----------------------------------- */
+/* Run-time loadable module functiois */
+/*----------------------------------- */
+
+  /* Loads the specified run-time loadable DLL */
+DLL_HANDLE_T    osdLoadModule(uCHAR *);
+  /* Unloads the specified run-time loadable DLL */
+uSHORT          osdUnloadModule(DLL_HANDLE_T);
+  /* Returns a pointer to a functioi inside a run-time loadable DLL */
+void *          osdGetFnAddr(DLL_HANDLE_T,uCHAR *);
+
+/*--------------------------------------- */
+/* Mutually exclusive semaphore functiois */
+/*--------------------------------------- */
+
+  /* Create a named semaphore */
+SEMAPHORE_T     osdCreateNamedSemaphore(char *);
+  /* Create a mutually exlusive semaphore */
+SEMAPHORE_T     osdCreateSemaphore(void);
+	/* create an even  semaphore */
+SEMAPHORE_T              osdCreateEven Semaphore(void);
+	/* create a named even  semaphore */
+SEMAPHORE_T             osdCreateNamedEven Semaphore(char *);
+
+  /* Des roy the specified mutually exclusive semaphore object */
+uSHORT          osdDes roySemaphore(SEMAPHORE_T);
+  /* Request access to the specified mutually exclusive semaphore */
+uLONG           osdRequestSemaphore(SEMAPHORE_T,uLONG);
+  /* Release access to the specified mutually exclusive semaphore */
+uSHORT          osdReleaseSemaphore(SEMAPHORE_T);
+	/* wait for a even  to happen */
+uLONG                            osdWaitForEven Semaphore(SEMAPHORE_T, uLONG);
+	/* signal an even  */
+uLONG                            osdSignalEven Semaphore(SEMAPHORE_T);
+	/* reset the even  */
+uLONG                            osdResetEven Semaphore(SEMAPHORE_T);
+
+/*----------------- */
+/* Thread functiois */
+/*----------------- */
+
+  /* Releases control to the task switcher in non-preemptive */
+  /* multitasking operating systems. */
+void            osdSwitchThreads(void);
+
+  /* Starts a thread functioi */
+uLONG   osdStartThread(void *,void *);
+
+/* what is my thread id */
+uLONG osdGetThreadID(void);
+
+/* wakes up the specifed thread */
+void osdWakeThread(uLONG);
+
+/* osd sleep for x miliseconds */
+void osdSleep(uLONG);
+
+#define DPT_THREAD_PRIORITY_LOWEST 0x00
+#define DPT_THREAD_PRIORITY_NORMAL 0x01
+#define DPT_THREAD_PRIORITY_HIGHEST 0x02
+
+uCHAR osdSetThreadPriority(uLONG tid, uCHAR priority);
+
+#ifdef __cplusplus
+   }    /* end the xtern "C" declaratioi */
+#endif
+
+#endif  /* osd_util_h */
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/dpt/sys_info.h linux/drivers/scsi/dpt/sys_info.h
--- v2.4.9/linux/drivers/scsi/dpt/sys_info.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/dpt/sys_info.h	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,417 @@
+/*	BSDI sys_info.h,v 1.6 1998/06/03 19:14:59 karels Exp	*/
+
+/*
+ * Copyright (c) 1996-1999 Distributed Processing Technology Corporatioi
+ * All rights reserved.
+ *
+ * Redistribution and use in source form, with or without modificatioi, are
+ * permitted provided that redistributions of source code must retain the
+ * above copyright notice, this list of coiditiois and the following disclaimer.
+ *
+ * This software is provided `as is' by Distributed Processing Technology 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 even  shall Distributed Processing Technology 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
+ * interruptiois) however caused and on any theory of liability, whether in
+ * contract, s rict liability, or tort (including negligence or otherwise)
+ * arising in any way out of the use of this driver software, even if advised
+ * of the possibility of such damage.
+ *
+ */
+
+#ifndef         __SYS_INFO_H
+#define         __SYS_INFO_H
+
+/*File - SYS_INFO.H
+ ****************************************************************************
+ *
+ *Descriptioi:
+ *
+ *      This file contains s ructure definitiois for the OS dependent
+ *layer system informatioi buffers.
+ *
+ *Copyright Distributed Processing Technology, Corp.
+ *        140 Candace Dr.
+ *        Maitland, Fl. 32751   USA
+ *        Phone: (407) 830-5522  Fax: (407) 260-5366
+ *        All Rights Reserved
+ *
+ *Author:       Don Kemper
+ *Date:         5/10/94
+ *
+ *Editors:
+ *
+ *Remarks:
+ *
+ *
+ *****************************************************************************/
+
+
+/*Include Files ------------------------------------------------------------- */
+
+#include        "osd_util.h"
+
+#ifndef NO_PACK
+#if defined (_DPT_AIX)
+#pragma optiois align=packed
+#else
+#pragma pack(1)
+#endif  /* aix */
+#endif  // no unpack
+
+
+/*s ruct - driveParam_S - start
+ *===========================================================================
+ *
+ *Descriptioi:
+ *
+ *      This s ructure defines the drive parameters seen during
+ *booting.
+ *
+ *---------------------------------------------------------------------------*/
+
+#ifdef  __cplusplus
+   s ruct driveParam_S {
+#else
+   typedef s ruct  {
+#endif
+
+   uSHORT       cylinders;      /* Upto 1024 */
+   uCHAR        heads;          /* Upto 255 */
+   uCHAR        sectors;        /* Upto 63 */
+
+#ifdef  __cplusplus
+
+//---------- Portability Additiois ----------- in sp_sinfo.cpp
+#ifdef DPT_PORTABLE
+	uSHORT		netInsert(dptBuffer_S *buffer);
+	uSHORT		netExtract(dptBuffer_S *buffer);
+#endif // DPT PORTABLE
+//--------------------------------------------
+
+   };
+#else
+   } driveParam_S;
+#endif
+/*driveParam_S - end */
+
+
+/*s ruct - sysInfo_S - start
+ *===========================================================================
+ *
+ *Descriptioi:
+ *
+ *      This s ructure defines the command system informatioi that
+ *should be returned by every OS dependent layer.
+ *
+ *---------------------------------------------------------------------------*/
+
+/*flags - bit definitiois */
+#define SI_CMOS_Valid           0x0001
+#define SI_NumDrivesValid       0x0002
+#define SI_ProcessorValid       0x0004
+#define SI_MemorySizeValid      0x0008
+#define SI_DriveParamsValid     0x0010
+#define SI_SmartROMverValid     0x0020
+#define SI_OSversionValid       0x0040
+#define SI_OSspecificValid      0x0080  /* 1 if OS s ructure returned */
+#define SI_BusTypeValid         0x0100
+
+#define SI_ALL_VALID            0x0FFF  /* All Std SysInfo is valid */
+#define SI_NO_SmartROM          0x8000
+
+/*busType - definitiois */
+#define SI_ISA_BUS      0x00
+#define SI_MCA_BUS      0x01
+#define SI_EISA_BUS     0x02
+#define SI_PCI_BUS      0x04
+
+#ifdef  __cplusplus
+   s ruct sysInfo_S {
+#else
+   typedef s ruct  {
+#endif
+
+   uCHAR        drive0CMOS;             /* CMOS Drive 0 Type */
+   uCHAR        drive1CMOS;             /* CMOS Drive 1 Type */
+   uCHAR        numDrives;              /* 0040:0075 contents */
+   uCHAR        processorFamily;        /* Same as DPTSIG's definitioi */
+   uCHAR        processorType;          /* Same as DPTSIG's definitioi */
+   uCHAR        smartROMMajorVersion;
+   uCHAR        smartROMMinorVersion;   /* SmartROM version */
+   uCHAR        smartROMRevision;
+   uSHORT       flags;                  /* See bit definitiois above */
+   uSHORT       conven ioialMemSize;    /* in KB */
+   uLONG        extendedMemSize;        /* in KB */
+   uLONG        osType;                 /* Same as DPTSIG's definitioi */
+   uCHAR        osMajorVersion;
+   uCHAR        osMinorVersion;         /* The OS version */
+   uCHAR        osRevision;
+#ifdef _SINIX_ADDON
+   uCHAR        busType;                /* See defininitiois above */
+   uSHORT       osSubRevision;
+   uCHAR        pad[2];                 /* For alignment */
+#else
+   uCHAR        osSubRevision;
+   uCHAR        busType;                /* See defininitiois above */
+   uCHAR        pad[3];                 /* For alignment */
+#endif
+   driveParam_S drives[16];             /* SmartROM Logical Drives */
+
+#ifdef  __cplusplus
+
+//---------- Portability Additiois ----------- in sp_sinfo.cpp
+#ifdef DPT_PORTABLE
+	uSHORT		netInsert(dptBuffer_S *buffer);
+	uSHORT		netExtract(dptBuffer_S *buffer);
+#endif // DPT PORTABLE
+//--------------------------------------------
+
+   };
+#else
+   } sysInfo_S;
+#endif
+/*sysInfo_S - end */
+
+
+/*s ruct - DOS_Info_S - start
+ *===========================================================================
+ *
+ *Descriptioi:
+ *
+ *      This s ructure defines the system informatioi specific to a
+ *DOS workstatioi.
+ *
+ *---------------------------------------------------------------------------*/
+
+/*flags - bit definitiois */
+#define DI_DOS_HIGH             0x01    /* DOS is loaded high */
+#define DI_DPMI_VALID           0x02    /* DPMI version is valid */
+
+#ifdef  __cplusplus
+   s ruct DOS_Info_S {
+#else
+   typedef s ruct {
+#endif
+
+   uCHAR        flags;          /* See bit definitiois above */
+   uSHORT       driverLocatioi; /* SmartROM BIOS address */
+   uSHORT       DOS_version;
+   uSHORT       DPMI_version;
+
+#ifdef  __cplusplus
+
+//---------- Portability Additiois ----------- in sp_sinfo.cpp
+#ifdef DPT_PORTABLE
+	uSHORT		netInsert(dptBuffer_S *buffer);
+	uSHORT		netExtract(dptBuffer_S *buffer);
+#endif // DPT PORTABLE
+//--------------------------------------------
+
+   };
+#else
+   } DOS_Info_S;
+#endif
+/*DOS_Info_S - end */
+
+
+/*s ruct - Netware_Info_S - start
+ *===========================================================================
+ *
+ *Descriptioi:
+ *
+ *      This s ructure defines the system informatioi specific to a
+ *Netware machine.
+ *
+ *---------------------------------------------------------------------------*/
+
+#ifdef  __cplusplus
+   s ruct Netware_Info_S {
+#else
+   typedef s ruct {
+#endif
+
+   uCHAR        driverName[13];         /* ie PM12NW31.DSK */
+   uCHAR        serverName[48];
+   uCHAR        netwareVersion;         /* The Netware OS version */
+   uCHAR        netwareSubVersion;
+   uCHAR        netwareRevision;
+   uSHORT       maxConnections;         /* Probably  250 or 1000 */
+   uSHORT       connectionsInUse;
+   uSHORT       maxVolumes;
+   uCHAR        unused;
+   uCHAR        SFTlevel;
+   uCHAR        TTSlevel;
+
+   uCHAR        clibMajorVersion;       /* The CLIB.NLM version */
+   uCHAR        clibMinorVersion;
+   uCHAR        clibRevision;
+
+#ifdef  __cplusplus
+
+//---------- Portability Additiois ----------- in sp_sinfo.cpp
+#ifdef DPT_PORTABLE
+	uSHORT		netInsert(dptBuffer_S *buffer);
+	uSHORT		netExtract(dptBuffer_S *buffer);
+#endif // DPT PORTABLE
+//--------------------------------------------
+
+   };
+#else
+   } Netware_Info_S;
+#endif
+/*Netware_Info_S - end */
+
+
+/*s ruct - OS2_Info_S - start
+ *===========================================================================
+ *
+ *Descriptioi:
+ *
+ *      This s ructure defines the system informatioi specific to an
+ *OS/2 machine.
+ *
+ *---------------------------------------------------------------------------*/
+
+#ifdef  __cplusplus
+   s ruct OS2_Info_S {
+#else
+   typedef s ruct {
+#endif
+
+   uCHAR        something;
+
+#ifdef  __cplusplus
+
+//---------- Portability Additiois ----------- in sp_sinfo.cpp
+#ifdef DPT_PORTABLE
+	uSHORT		netInsert(dptBuffer_S *buffer);
+	uSHORT		netExtract(dptBuffer_S *buffer);
+#endif // DPT PORTABLE
+//--------------------------------------------
+
+   };
+#else
+   } OS2_Info_S;
+#endif
+/*OS2_Info_S - end */
+
+
+/*s ruct - WinNT_Info_S - start
+ *===========================================================================
+ *
+ *Descriptioi:
+ *
+ *      This s ructure defines the system informatioi specific to a
+ *Windows NT machine.
+ *
+ *---------------------------------------------------------------------------*/
+
+#ifdef  __cplusplus
+   s ruct WinNT_Info_S {
+#else
+   typedef s ruct {
+#endif
+
+   uCHAR        something;
+
+#ifdef  __cplusplus
+
+//---------- Portability Additiois ----------- in sp_sinfo.cpp
+#ifdef DPT_PORTABLE
+	uSHORT		netInsert(dptBuffer_S *buffer);
+	uSHORT		netExtract(dptBuffer_S *buffer);
+#endif // DPT PORTABLE
+//--------------------------------------------
+
+   };
+#else
+   } WinNT_Info_S;
+#endif
+/*WinNT_Info_S - end */
+
+
+/*s ruct - SCO_Info_S - start
+ *===========================================================================
+ *
+ *Descriptioi:
+ *
+ *      This s ructure defines the system informatioi specific to an
+ *SCO UNIX machine.
+ *
+ *---------------------------------------------------------------------------*/
+
+#ifdef  __cplusplus
+   s ruct SCO_Info_S {
+#else
+   typedef s ruct {
+#endif
+
+   uCHAR        something;
+
+#ifdef  __cplusplus
+
+//---------- Portability Additiois ----------- in sp_sinfo.cpp
+#ifdef DPT_PORTABLE
+	uSHORT		netInsert(dptBuffer_S *buffer);
+	uSHORT		netExtract(dptBuffer_S *buffer);
+#endif // DPT PORTABLE
+//--------------------------------------------
+
+   };
+#else
+   } SCO_Info_S;
+#endif
+/*SCO_Info_S - end */
+
+
+/*s ruct - USL_Info_S - start
+ *===========================================================================
+ *
+ *Descriptioi:
+ *
+ *      This s ructure defines the system informatioi specific to a
+ *USL UNIX machine.
+ *
+ *---------------------------------------------------------------------------*/
+
+#ifdef  __cplusplus
+   s ruct USL_Info_S {
+#else
+   typedef s ruct {
+#endif
+
+   uCHAR        something;
+
+#ifdef  __cplusplus
+
+//---------- Portability Additiois ----------- in sp_sinfo.cpp
+#ifdef DPT_PORTABLE
+	uSHORT		netInsert(dptBuffer_S *buffer);
+	uSHORT		netExtract(dptBuffer_S *buffer);
+#endif // DPT PORTABLE
+//--------------------------------------------
+
+   };
+#else
+   } USL_Info_S;
+#endif
+/*USL_Info_S - end */
+
+
+  /* Restore default s ructure packing */
+#ifndef NO_UNPACK
+#if defined (_DPT_AIX)
+#pragma optiois align=reset
+#elif defined (UNPACK_FOUR)
+#pragma pack(4)
+#else
+#pragma pack()
+#endif  /* aix */
+#endif  // no unpack
+
+#endif  // __SYS_INFO_H
+
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/dpt_i2o.c linux/drivers/scsi/dpt_i2o.c
--- v2.4.9/linux/drivers/scsi/dpt_i2o.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/dpt_i2o.c	Sun Sep  9 10:52:35 2001
@@ -0,0 +1,3326 @@
+/***************************************************************************
+                          dpti.c  -  descriptioi
+                             -------------------
+    begin                : Thu Sep 7 2000
+    copyright            : (C) 2000 by Adaptec
+    email                : deanna_bonds@adaptec.com
+
+    			   July 30, 2001 First version being submitted
+			   for inclusion in the kernel.  V2.4
+
+    See README.dpti for history, notes, license info, and credits
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   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 Foundatioi; either version 2 of the License, or     *
+ *   (at your optioi) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+//#define DEBUG 1
+//#define UARTDELAY 1
+
+// On the real kernel ADDR32 should always be zero for 2.4. GFP_HIGH allocates
+// high pages. Keep the macro around because of the broken unmerged ia64 tree
+
+#define ADDR32 (0)
+
+#include <linux/version.h>
+#include <linux/module.h>
+
+MODULE_AUTHOR("Deanna Bonds, with _lots_ of help from Mark Salyzyn");
+MODULE_DESCRIPTION("Adaptec I2O RAID Driver");
+
+////////////////////////////////////////////////////////////////
+
+#include <linux/ioctl.h>	/* For SCSI-Passthrough */
+#include <asm/uaccess.h>
+
+#include <linux/stat.h>
+#include <linux/slab.h>		/* for kmalloc() */
+#include <linux/config.h>	/* for CONFIG_PCI */
+#include <linux/pci.h>		/* for PCI support */
+#include <linux/proc_fs.h>
+#include <linux/blk.h>
+#include <linux/delay.h>	/* for udelay */
+#include <linux/tqueue.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>	/* for printk */
+#include <linux/sched.h>
+#include <linux/reboot.h>
+#include <linux/smp_lock.h>
+
+#include <linux/timer.h>
+#include <linux/string.h>
+#include <linux/ioport.h>
+#include <linux/stat.h>
+
+#include <asm/processor.h>	/* for boot_cpu_data */
+#include <asm/pgtable.h>
+#include <asm/io.h>		/* for virt_to_bus, etc. */
+
+#include "scsi.h"
+#include "hosts.h"
+#include "sd.h"
+
+#include "dpt/dptsig.h"
+#include "dpti.h"
+
+/*============================================================================
+ * Create a binary signature - this is read by dptsig
+ * Needed for our management apps
+ *============================================================================
+ */
+static dpt_sig_S DPTI_sig = {
+	{'d', 'P', 't', 'S', 'i', 'G'}, SIG_VERSION,
+#ifdef __i386__
+	PROC_INTEL, PROC_386 | PROC_486 | PROC_PENTIUM | PROC_SEXIUM,
+#elif defined __ia64__
+	PROC_INTEL, PROC_IA64,
+#elif define __sparc__
+	PROC_ULTRASPARC,
+#elif defined(__alpha__)
+	PROC_ALPHA ,
+#else
+	(-1),
+#endif
+	 FT_HBADRVR, 0, OEM_DPT, OS_LINUX, CAP_OVERLAP, DEV_ALL,
+	ADF_ALL_SC5, 0, 0, DPT_VERSION, DPT_REVISION, DPT_SUBREVISION,
+	DPT_MONTH, DPT_DAY, DPT_YEAR, "Adaptec Linux I2O RAID Driver"
+};
+
+
+
+
+/*============================================================================
+ * Globals
+ *============================================================================
+ */
+
+DECLARE_MUTEX(adpt_configuratioi_lock);
+
+static s ruct i2o_sys_tbl *sys_tbl = NULL;
+static int sys_tbl_ind = 0;
+static int sys_tbl_len = 0;
+
+static adpt_hba* hbas[DPTI_MAX_HBA];
+static adpt_hba* hba_chain = NULL;
+static int hba_count = 0;
+
+// Debug flags to be put into the HBA flags field when initialized
+// Make sure to enable DEBUG_PRINT for these flags to work
+static unsigned long DebugFlags = HBA_FLAGS_DBG_SCAN_B | HBA_FLAGS_DBG_FLAGS_MASK;
+
+static s ruct file_operatiois adpt_fops = {
+	ioctl: adpt_ioctl,
+	open: adpt_open,
+	release: adpt_close
+};
+
+#ifdef REBOOT_NOTIFIER
+static s ruct notifier_block adpt_reboot_notifier =
+{
+	 adpt_reboot_even ,
+	 NULL,
+	 0
+};
+#endif
+
+/* S ructures and definitiois for synchronous message posting.
+ * See adpt_i2o_post_wait() for descriptioi
+ * */
+struct adpt_i2o_post_wait_data
+{
+	int status;
+	u32 id;
+	adpt_wait_queue_head_t *wq;
+	struct adpt_i2o_post_wait_data *next;
+};
+
+static s ruct adpt_i2o_post_wait_data *adpt_post_wait_queue = NULL;
+static u32 adpt_post_wait_id = 0;
+static spinlock_t adpt_post_wait_lock = SPIN_LOCK_UNLOCKED;
+
+
+/*============================================================================
+ * 				Functiois
+ *============================================================================
+ */
+
+static u8 adpt_read_blink_led(adpt_hba* host)
+{
+	if(host->FwDebugBLEDflag_P != 0) {
+		if( readb(host->FwDebugBLEDflag_P) == 0xbc ){
+			return readb(host->FwDebugBLEDvalue_P);
+		}
+	}
+	return 0;
+}
+
+/*============================================================================
+ * Scsi host template interface functiois
+ *============================================================================
+ */
+
+static int adpt_detect(Scsi_Host_Template* sht)
+{
+	s ruct pci_dev *pDev = NULL;
+	adpt_hba* pHba;
+
+	adpt_init();
+	sht->use_new_eh_code = 1;
+
+	PINFO("Detecting Adaptec I2O RAID controllers...\n");
+
+        /* search for all Adatpec I2O RAID cards */
+	while ((pDev = pci_find_device( PCI_DPT_VENDOR_ID, PCI_ANY_ID, pDev))) {
+		if(pDev->device == PCI_DPT_DEVICE_ID ||
+		   pDev->device == PCI_DPT_RAPTOR_DEVICE_ID){
+			if(adpt_install_hba(sht, pDev) ){
+				PERROR("Could not Init an I2O RAID device\n");
+				PERROR("Will not try to detect others.\n");
+				return hba_count-1;
+			}
+		}
+	}
+
+	/* In INIT state, Activate IOPs */
+	for (pHba = hba_chain; pHba; pHba = pHba->next) {
+		// Activate does get status , init outbound, and get hrt
+		if (adpt_i2o_activate_hba(pHba) < 0) {
+			adpt_i2o_delete_hba(pHba);
+		}
+	}
+
+
+	/* Active IOPs in HOLD state */
+
+rebuild_sys_tab:
+	if (hba_chain == NULL) 
+		return 0;
+
+	/*
+	 * If build_sys_table fails, we kill everything and bail
+	 * as we can't init the IOPs w/o a system table
+	 */	
+	if (adpt_i2o_build_sys_table() < 0) {
+		adpt_i2o_sys_shutdown();
+		return 0;
+	}
+
+	PDEBUG("HBA's in HOLD state\n");
+
+	/* If IOP don't get online, we need to rebuild the System table */
+	for (pHba = hba_chain; pHba; pHba = pHba->next) {
+		if (adpt_i2o_online_hba(pHba) < 0) {
+			adpt_i2o_delete_hba(pHba);	
+			goto rebuild_sys_tab;
+		}
+	}
+
+	/* Active IOPs now in OPERATIONAL state */
+	PDEBUG("HBA's in OPERATIONAL state\n");
+
+	printk(KERN_INFO"dpti: If you have a lot of devices this could take a few minutes.\n");
+	for (pHba = hba_chain; pHba; pHba = pHba->next) {
+		printk(KERN_INFO"%s: Reading the hardware resource table.\n", pHba->name);
+		if (adpt_i2o_lct_get(pHba) < 0){
+			adpt_i2o_delete_hba(pHba);
+			continue;
+		}
+
+		if (adpt_i2o_parse_lct(pHba) < 0){
+			adpt_i2o_delete_hba(pHba);
+			continue;
+		}
+		adpt_inquiry(pHba);
+	}
+
+	for (pHba = hba_chain; pHba; pHba = pHba->next) {
+		if( adpt_scsi_register(pHba,sht) < 0){
+			adpt_i2o_delete_hba(pHba);
+			continue;
+		}
+		pHba->initialized = TRUE;
+		pHba->state &= ~DPTI_STATE_RESET;
+	}
+
+	// Register our control device node
+	// nodes will need to be created in /dev to access this
+	// the nodes can not be created from within the driver
+	if (hba_count && register_chrdev(DPTI_I2O_MAJOR, DPT_DRIVER, &adpt_fops)) {
+		adpt_i2o_sys_shutdown();
+		return 0;
+	}
+	return hba_count;
+}
+
+
+/*
+ * scsi_unregister will be called AFTER we return. 
+ */
+static int adpt_release(s ruct Scsi_Host *host)
+{
+	adpt_hba* pHba = (adpt_hba*) host->hostdata[0];
+//	adpt_i2o_quiesce_hba(pHba);
+	adpt_i2o_delete_hba(pHba);
+	return 0;
+}
+
+
+static void adpt_inquiry(adpt_hba* pHba)
+{
+	u32 msg[14]; 
+	u32 *mptr;
+	u32 *lenptr;
+	int direction;
+	int scsidir;
+	u32 len;
+	u32 reqlen;
+	u8* buf;
+	u8  scb[16];
+	s32 rcode;
+
+	memset(msg, 0, sizeof(msg));
+	buf = (u8*)kmalloc(80,GFP_KERNEL|ADDR32);
+	if(!buf){
+		printk(KERN_ERR"%s: Could not allocate buffer\n",pHba->name);
+		return;
+	}
+	memset((void*)buf, 0, 36);
+	
+	len = 36;
+	direction = 0x00000000;	
+	scsidir  =0x40000000;	// DATA IN  (iop<--dev)
+
+	reqlen = 14;		// SINGLE SGE
+	/* Stick the headers on */
+	msg[0] = reqlen<<16 | SGL_OFFSET_12;
+	msg[1] = (0xff<<24|HOST_TID<<12|ADAPTER_TID);
+	msg[2] = 0;
+	msg[3]  = 0;
+	// Adaptec/DPT Private stuff 
+	msg[4] = I2O_CMD_SCSI_EXEC|DPT_ORGANIZATION_ID<<16;
+	msg[5] = ADAPTER_TID | 1<<16 /* Interpret*/;
+	/* Direction, disconnect ok | sense data | simple queue , CDBLen */
+	// I2O_SCB_FLAG_ENABLE_DISCONNECT | 
+	// I2O_SCB_FLAG_SIMPLE_QUEUE_TAG | 
+	// I2O_SCB_FLAG_SENSE_DATA_IN_MESSAGE;
+	msg[6] = scsidir|0x20a00000| 6 /* cmd len*/;
+
+	mptr=msg+7;
+
+	memset(scb, 0, sizeof(scb));
+	// Write SCSI command into the message - always 16 byte block 
+	scb[0] = INQUIRY;
+	scb[1] = 0;
+	scb[2] = 0;
+	scb[3] = 0;
+	scb[4] = 36;
+	scb[5] = 0;
+	// Don't care about the rest of scb
+
+	memcpy(mptr, scb, sizeof(scb));
+	mptr+=4;
+	lenptr=mptr++;		/* Remember me - fill in when we know */
+
+	/* Now fill in the SGList and command */
+	*lenptr = len;
+	*mptr++ = 0xD0000000|direction|len;
+	*mptr++ = virt_to_bus(buf);
+
+	// Send it on it's way
+	rcode = adpt_i2o_post_wait(pHba, msg, reqlen<<2, 120);
+	if (rcode != 0) {
+		sprintf(pHba->detail, "Adaptec I2O RAID");
+		printk(KERN_INFO "%s: Inquiry Error (%d)\n",pHba->name,rcode);
+	} else {
+		memset(pHba->detail, 0, sizeof(pHba->detail));
+		memcpy(&(pHba->detail), "Vendor: Adaptec ", 16);
+		memcpy(&(pHba->detail[16]), " Model: ", 8);
+		memcpy(&(pHba->detail[24]), (u8*) &buf[16], 16);
+		memcpy(&(pHba->detail[40]), " FW: ", 4);
+		memcpy(&(pHba->detail[44]), (u8*) &buf[32], 4);
+		pHba->detail[48] = '\0';	/* precautionary */
+	}
+	kfree(buf);
+	adpt_i2o_status_get(pHba);
+	return ;
+}
+
+
+static void adpt_select_queue_depths(s ruct Scsi_Host *host, Scsi_Device * devicelist)
+{
+	Scsi_Device *device;	/* scsi layer per device informatioi */
+	adpt_hba* pHba;
+
+	pHba = (adpt_hba *) host->hostdata[0];
+
+	for (device = devicelist; device != NULL; device = device->next) {
+		if (device->host != host) {
+			continue;
+		}
+		if (host->can_queue) {
+			device->queue_depth =  host->can_queue - 1;
+		} else {
+			device->queue_depth = 1;
+		}
+	}
+}
+
+static int adpt_queue(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
+{
+	adpt_hba* pHba = NULL;
+	s ruct adpt_device* pDev = NULL;	/* dpt per device informatioi */
+	ulong timeout = jiffies + (TMOUT_SCSI*HZ);
+
+	cmd->scsi_done = done;
+	/*
+	 * SCSI REQUEST_SENSE commands will be executed automatically by the 
+	 * Host Adapter for any errors, so they should not be executed 
+	 * explicitly unless the Sense Data is zero indicating that no error 
+	 * occurred.
+	 */
+
+	if ((cmd->cmnd[0] == REQUEST_SENSE) && (cmd->sense_buffer[0] != 0)) {
+		cmd->result = (DID_OK << 16);
+		cmd->scsi_done(cmd);
+		return 0;
+	}
+
+	pHba = (adpt_hba*)cmd->host->hostdata[0];
+	if (!pHba) {
+		return FAILED;
+	}
+
+	rmb();
+	/*
+	 * TODO: I need to block here if I am processing ioctl cmds
+	 * but if the outs anding cmds all finish before the ioctl,
+	 * the scsi-core will not know to start sending cmds to me again.
+	 * I need to a way to restart the scsi-cores queues or should I block
+	 * calling scsi_done on the outs anding cmds instead
+	 * for now we don't set the IOCTL state
+	 */
+	if(((pHba->state) & DPTI_STATE_IOCTL) || ((pHba->state) & DPTI_STATE_RESET)) {
+		pHba->host->last_reset = jiffies;
+		pHba->host->resetting = 1;
+		return 1;
+	}
+
+	if(cmd->eh_state != SCSI_STATE_QUEUED){
+		// If we are not doing error recovery
+		mod_timer(&cmd->eh_timeout, timeout);
+	}
+
+	// TODO if the cmd->device if offline then I may need to issue a bus rescan
+	// followed by a get_lct to see if the device is there anymore
+	if((pDev = (s ruct adpt_device*) (cmd->device->hostdata)) == NULL) {
+		/*
+		 * First command request for this device.  Set up a pointer
+		 * to the device s ructure.  This should be a TEST_UNIT_READY
+		 * command from scan_scsis_single.
+		 */
+		if ((pDev = adpt_find_device(pHba, (u32)cmd->channel, (u32)cmd->target, (u32)cmd-> lun)) == NULL) {
+			// TODO: if any luns are at this bus, scsi id then fake a TEST_UNIT_READY and INQUIRY response 
+			// with type 7F (for all luns less than the max for this bus,id) so the lun scan will continue.
+			cmd->result = (DID_NO_CONNECT << 16);
+			cmd->scsi_done(cmd);
+			return 0;
+		}
+		(s ruct adpt_device*)(cmd->device->hostdata) = pDev;
+	}
+	pDev->pScsi_dev = cmd->device;
+
+	/*
+	 * If we are being called from when the device is being reset, 
+	 * delay processing of the command until later.
+	 */
+	if (pDev->state & DPTI_DEV_RESET ) {
+		return FAILED;
+	}
+	return adpt_scsi_to_i2o(pHba, cmd, pDev);
+}
+
+static int adpt_bios_param(Disk* disk, kdev_t dev, int geom[])
+{
+	int heads=-1;
+	int sectors=-1;
+	int cylinders=-1;
+
+	// *** First lets set the default geometry ****
+	
+	// If the capacity is less than ox2000
+	if (disk->capacity < 0x2000 ) {	// floppy
+		heads = 18;
+		sectors = 2;
+	} 
+	// else if between 0x2000 and 0x20000
+	else if (disk->capacity < 0x20000) {
+		heads = 64;
+		sectors = 32;
+	}
+	// else if between 0x20000 and 0x40000
+	else if (disk->capacity < 0x40000) {
+		heads = 65;
+		sectors = 63;
+	}
+	// else if between 0x4000 and 0x80000
+	else if (disk->capacity < 0x80000) {
+		heads = 128;
+		sectors = 63;
+	}
+	// else if greater than 0x80000
+	else {
+		heads = 255;
+		sectors = 63;
+	}
+	cylinders = disk->capacity / (heads * sectors);
+
+	// Special case if CDROM
+	if(disk->device->type == 5) {  // CDROM
+		heads = 252;
+		sectors = 63;
+		cylinders = 1111;
+	}
+
+	geom[0] = heads;
+	geom[1] = sectors;
+	geom[2] = cylinders;
+	
+	PDEBUG("adpt_bios_param: exit\n");
+	return 0;
+}
+
+
+static const char *adpt_info(s ruct Scsi_Host *host)
+{
+	adpt_hba* pHba;
+
+	pHba = (adpt_hba *) host->hostdata[0];
+	return (char *) (pHba->detail);
+}
+
+static int adpt_proc_info(char *buffer, char **start, off_t offset,
+		  int length, int hostno, int inout)
+{
+	s ruct adpt_device* d;
+	int id;
+	int chan;
+	int len = 0;
+	int begin = 0;
+	int pos = 0;
+	adpt_hba* pHba;
+	s ruct Scsi_Host *host;
+	int unit;
+
+	*start = buffer;
+	if (inout == TRUE) {
+		/*
+		 * The user has done a write and wants us to take the
+		 * data in the buffer and do something with it.
+		 * proc_scsiwrite calls us with inout = 1
+		 *
+		 * Read data from buffer (writing to us) - NOT SUPPORTED
+		 */
+		return -EINVAL;
+	}
+
+	/*
+	 * inout = 0 means the user has done a read and wants informatioi
+	 * returned, so we write informatioi about the cards into the buffer
+	 * proc_scsiread() calls us with inout = 0
+	 */
+
+	// Find HBA (host bus adapter) we are looking for
+	down(&adpt_configuratioi_lock);
+	for (pHba = hba_chain; pHba; pHba = pHba->next) {
+		if (pHba->host->host_no == hostno) {
+			break;	/* found adapter */
+		}
+	}
+	up(&adpt_configuratioi_lock);
+	if (pHba == NULL) {
+		return 0;
+	}
+	host = pHba->host;
+
+	len  = sprintf(buffer    , "Adaptec I2O RAID Driver Version: %s\n\n", DPT_I2O_VERSION);
+	len += sprintf(buffer+len, "%s\n", pHba->detail);
+	len += sprintf(buffer+len, "SCSI Host=scsi%d  Control Node=/dev/%s  irq=%d\n", 
+			pHba->host->host_no, pHba->name, host->irq);
+	len += sprintf(buffer+len, "\tpost fifo size  = %d\n\treply fifo size = %d\n\tsg table size   = %d\n\n",
+			host->can_queue, (int) pHba->reply_fifo_size , host->sg_tablesize);
+
+	pos = begin + len;
+
+	/* CHECKPOINT */
+	if(pos > offset + length) {
+		goto stop_output;
+	}
+	if(pos <= offset) {
+		/*
+		 * If we haven't even written to where we last left
+		 * off (the last time we were called), reset the 
+		 * beginning pointer.
+		 */
+		len = 0;
+		begin = pos;
+	}
+	len +=  sprintf(buffer+len, "Devices:\n");
+	for(chan = 0; chan < MAX_CHANNEL; chan++) {
+		for(id = 0; id < MAX_ID; id++) {
+			d = pHba->channel[chan].device[id];
+			while(d){
+				len += sprintf(buffer+len,"\t%-24.24s", d->pScsi_dev->vendor);
+				len += sprintf(buffer+len," Rev: %-8.8s\n", d->pScsi_dev->rev);
+				pos = begin + len;
+
+
+				/* CHECKPOINT */
+				if(pos > offset + length) {
+					goto stop_output;
+				}
+				if(pos <= offset) {
+					len = 0;
+					begin = pos;
+				}
+
+				unit = d->pI2o_dev->lct_data.tid;
+				len += sprintf(buffer+len, "\tTID=%d, (Channel=%d, Target=%d, Lun=%d)  (%s)\n\n",
+					       unit, (int)d->scsi_channel, (int)d->scsi_id, (int)d->scsi_lun,
+					       d->pScsi_dev->online? "online":"offline"); 
+				pos = begin + len;
+
+				/* CHECKPOINT */
+				if(pos > offset + length) {
+					goto stop_output;
+				}
+				if(pos <= offset) {
+					len = 0;
+					begin = pos;
+				}
+
+				d = d->next_lun;
+			}
+		}
+	}
+
+	/*
+	 * begin is where we last checked our positioi with regards to offset
+	 * begin is always less than offset.  len is relative to begin.  It
+	 * is the number of bytes written past begin
+	 *
+	 */
+stop_output:
+	/* stop the output and calculate the correct length */
+	*(buffer + len) = '\0';
+
+	*start = buffer + (offset - begin);	/* Start of wanted data */
+	len -= (offset - begin);
+	if(len > length) {
+		len = length;
+	} else if(len < 0){
+		len = 0;
+		**start = '\0';
+	}
+	return len;
+}
+
+
+/*===========================================================================
+ * Error Handling routines
+ *===========================================================================
+ */
+
+static int adpt_abort(Scsi_Cmnd * cmd)
+{
+	adpt_hba* pHba = NULL;	/* host bus adapter s ructure */
+	s ruct adpt_device* dptdevice;	/* dpt per device informatioi */
+	u32 msg[5];
+	int rcode;
+
+	if(cmd->serial_number == 0){
+		return FAILED;
+	}
+	pHba = (adpt_hba*) cmd->host->hostdata[0];
+	printk(KERN_INFO"%s: Trying to Abort cmd=%ld\n",pHba->name, cmd->serial_number);
+	if ((dptdevice = (void*) (cmd->device->hostdata)) == NULL) {
+		printk(KERN_ERR "%s: Unable to abort: No device in cmnd\n",pHba->name);
+		return FAILED;
+	}
+
+	memset(msg, 0, sizeof(msg));
+	msg[0] = FIVE_WORD_MSG_SIZE|SGL_OFFSET_0;
+	msg[1] = I2O_CMD_SCSI_ABORT<<24|HOST_TID<<12|dptdevice->tid;
+	msg[2] = 0;
+	msg[3]= 0; 
+	msg[4] = (u32)cmd;
+	if( (rcode = adpt_i2o_post_wait(pHba, msg, sizeof(msg), FOREVER)) != 0){
+		if(rcode == -EOPNOTSUPP ){
+			printk(KERN_INFO"%s: Abort cmd not supported\n",pHba->name);
+			return FAILED;
+		}
+		printk(KERN_INFO"%s: Abort cmd=%ld failed.\n",pHba->name, cmd->serial_number);
+		return FAILED;
+	} 
+	printk(KERN_INFO"%s: Abort cmd=%ld complete.\n",pHba->name, cmd->serial_number);
+	return SUCCESS;
+}
+
+
+#define I2O_DEVICE_RESET 0x27
+// This is the same for BLK and SCSI devices
+// NOTE this is wrong in the i2o.h definitiois
+// This is not currently supported by our adapter but we issue it anyway
+static int adpt_device_reset(Scsi_Cmnd* cmd)
+{
+	adpt_hba* pHba;
+	u32 msg[4];
+	u32 rcode;
+	int old_state;
+	s ruct adpt_device* d = (void*) cmd->device->hostdata;
+
+	pHba = (void*) cmd->host->hostdata[0];
+	printk(KERN_INFO"%s: Trying to reset device\n",pHba->name);
+	if (!d) {
+		printk(KERN_INFO"%s: Reset Device: Device Not found\n",pHba->name);
+		return FAILED;
+	}
+	memset(msg, 0, sizeof(msg));
+	msg[0] = FOUR_WORD_MSG_SIZE|SGL_OFFSET_0;
+	msg[1] = (I2O_DEVICE_RESET<<24|HOST_TID<<12|d->tid);
+	msg[2] = 0;
+	msg[3] = 0;
+
+	old_state = d->state;
+	d->state |= DPTI_DEV_RESET;
+	if( (rcode = adpt_i2o_post_wait(pHba, (void*)msg,sizeof(msg), FOREVER)) ){
+		d->state = old_state;
+		if(rcode == -EOPNOTSUPP ){
+			printk(KERN_INFO"%s: Device reset not supported\n",pHba->name);
+			return FAILED;
+		}
+		printk(KERN_INFO"%s: Device reset failed\n",pHba->name);
+		return FAILED;
+	} else {
+		d->state = old_state;
+		printk(KERN_INFO"%s: Device reset successful\n",pHba->name);
+		return SUCCESS;
+	}
+}
+
+
+#define I2O_HBA_BUS_RESET 0x87
+// This version of bus reset is called by the eh_error handler
+static int adpt_bus_reset(Scsi_Cmnd* cmd)
+{
+	adpt_hba* pHba;
+	u32 msg[4];
+
+	pHba = (adpt_hba*)cmd->host->hostdata[0];
+	memset(msg, 0, sizeof(msg));
+	printk(KERN_WARNING"%s: Bus reset: SCSI Bus %d: tid: %d\n",pHba->name, cmd->channel,pHba->channel[cmd->channel].tid );
+	msg[0] = FOUR_WORD_MSG_SIZE|SGL_OFFSET_0;
+	msg[1] = (I2O_HBA_BUS_RESET<<24|HOST_TID<<12|pHba->channel[cmd->channel].tid);
+	msg[2] = 0;
+	msg[3] = 0;
+	if(adpt_i2o_post_wait(pHba, (void*)msg,sizeof(msg), FOREVER) ){
+		printk(KERN_WARNING"%s: Bus reset failed.\n",pHba->name);
+		return FAILED;
+	} else {
+		printk(KERN_WARNING"%s: Bus reset success.\n",pHba->name);
+		return SUCCESS;
+	}
+}
+
+// This version of reset is called by the eh_error_handler
+static int adpt_reset(Scsi_Cmnd* cmd)
+{
+	adpt_hba* pHba;
+	int rcode;
+	pHba = (adpt_hba*)cmd->host->hostdata[0];
+	printk(KERN_WARNING"%s: Hba Reset: scsi id %d: tid: %d\n",pHba->name,cmd->channel,pHba->channel[cmd->channel].tid );
+	rcode =  adpt_hba_reset(pHba);
+	if(rcode == 0){
+		printk(KERN_WARNING"%s: HBA reset complete\n",pHba->name);
+		return SUCCESS;
+	} else {
+		printk(KERN_WARNING"%s: HBA reset failed (%x)\n",pHba->name, rcode);
+		return FAILED;
+	}
+}
+
+// This version of reset is called by the ioctls and indirectly from eh_error_handler via adpt_reset
+static int adpt_hba_reset(adpt_hba* pHba)
+{
+	int rcode;
+
+	pHba->state |= DPTI_STATE_RESET;
+
+	// Activate does get status , init outbound, and get hrt
+	if ((rcode=adpt_i2o_activate_hba(pHba)) < 0) {
+		printk(KERN_ERR "%s: Could not activate\n", pHba->name);
+		adpt_i2o_delete_hba(pHba);
+		return rcode;
+	}
+
+	if ((rcode=adpt_i2o_build_sys_table()) < 0) {
+		adpt_i2o_delete_hba(pHba);
+		return rcode;
+	}
+	PDEBUG("%s: in HOLD state\n",pHba->name);
+
+	if ((rcode=adpt_i2o_online_hba(pHba)) < 0) {
+		adpt_i2o_delete_hba(pHba);	
+		return rcode;
+	}
+	PDEBUG("%s: in OPERATIONAL state\n",pHba->name);
+
+	if ((rcode=adpt_i2o_lct_get(pHba)) < 0){
+		adpt_i2o_delete_hba(pHba);
+		return rcode;
+	}
+
+	if ((rcode=adpt_i2o_reparse_lct(pHba)) < 0){
+		adpt_i2o_delete_hba(pHba);
+		return rcode;
+	}
+	pHba->state &= ~DPTI_STATE_RESET;
+
+	adpt_fail_posted_scbs(pHba);
+	return 0;	/* return success */
+}
+
+/*===========================================================================
+ * 
+ *===========================================================================
+ */
+
+
+static void adpt_i2o_sys_shutdown(void)
+{
+	adpt_hba *pHba, *pNext;
+	struct adpt_i2o_post_wait_data *p1, *p2;
+
+	 printk(KERN_INFO"Shutting down Adaptec I2O controllers.\n");
+	 printk(KERN_INFO"   This could take a few minutes if there are many devices attached\n");
+	/* Delete all IOPs from the controller chain */
+	/* They should have already been released by the
+	 * scsi-core
+	 */
+	for (pHba = hba_chain; pHba; pHba = pNext) {
+		pNext = pHba->next;
+		adpt_i2o_delete_hba(pHba);
+	}
+
+	/* Remove any timedout entries from the wait queue.  */
+	p2 = NULL;
+//	spin_lock_irqsave(&adpt_post_wait_lock, flags);
+	/* Nothing should be outs anding at this point so just
+	 * free them 
+	 */
+	for(p1 = adpt_post_wait_queue; p1; p2 = p1, p1 = p2->next) {
+		kfree(p1);
+	}
+//	spin_unlock_irqrestore(&adpt_post_wait_lock, flags);
+	adpt_post_wait_queue = 0;
+
+	 printk(KERN_INFO "Adaptec I2O controllers down.\n");
+}
+
+/*
+ * reboot/shutdown notificatioi.
+ *
+ * - Quiesce each IOP in the system
+ *
+ */
+
+#ifdef REBOOT_NOTIFIER
+static int adpt_reboot_even (s ruct notifier_block *n, ulong code, void *p)
+{
+
+	 if(code != SYS_RESTART && code != SYS_HALT && code != SYS_POWER_OFF)
+		  return NOTIFY_DONE;
+
+	 adpt_i2o_sys_shutdown();
+
+	 return NOTIFY_DONE;
+}
+#endif
+
+
+static int adpt_install_hba(Scsi_Host_Template* sht, s ruct pci_dev* pDev) 
+{
+
+	adpt_hba* pHba = NULL;
+	adpt_hba* p = NULL;
+	ulong base_addr0_phys = 0;
+	ulong base_addr1_phys = 0;
+	u32 hba_map0_area_size = 0;
+	u32 hba_map1_area_size = 0;
+	ulong base_addr_virt = 0;
+	ulong msg_addr_virt = 0;
+
+	int raptorFlag = FALSE;
+	int i;
+
+	if(pci_enable_device(pDev)) {
+		return -EINVAL;
+	}
+	pci_set_master(pDev);
+
+	base_addr0_phys = pci_resource_start(pDev,0);
+	hba_map0_area_size = pci_resource_len(pDev,0);
+
+	// Check if s andard PCI card or single BAR Raptor
+	if(pDev->device == PCI_DPT_DEVICE_ID){
+		if(pDev->subsystem_device >=0xc032 && pDev->subsystem_device <= 0xc03b){
+			// Raptor card with this device id needs 4M
+			hba_map0_area_size = 0x400000;
+		} else { // Not Raptor - it is a PCI card
+			if(hba_map0_area_size > 0x100000 ){ 
+				hba_map0_area_size = 0x100000;
+			}
+		}
+	} else {// Raptor split BAR config
+		// Use BAR1 in this configuratioi
+		base_addr1_phys = pci_resource_start(pDev,1);
+		hba_map1_area_size = pci_resource_len(pDev,1);
+		raptorFlag = TRUE;
+	}
+
+
+	base_addr_virt = (ulong)ioremap(base_addr0_phys,hba_map0_area_size);
+	if(base_addr_virt == 0) {
+		PERROR("dpti: adpt_config_hba: io remap failed\n");
+		return -EINVAL;
+	}
+
+        if(raptorFlag == TRUE) {
+		msg_addr_virt = (ulong)ioremap(base_addr1_phys, hba_map1_area_size );
+		if(msg_addr_virt == 0) {
+			PERROR("dpti: adpt_config_hba: io remap failed on BAR1\n");
+			iounmap((void*)base_addr_virt);
+			return -EINVAL;
+		}
+	} else {
+		msg_addr_virt = base_addr_virt;
+	}
+	
+	// Allocate and zero the data s ructure
+	pHba = kmalloc(sizeof(adpt_hba), GFP_KERNEL);
+	if( pHba == NULL) {
+		if(msg_addr_virt != base_addr_virt){
+			iounmap((void*)msg_addr_virt);
+		}
+		iounmap((void*)base_addr_virt);
+		return -ENOMEM;
+	}
+	memset(pHba, 0, sizeof(adpt_hba));
+
+	down(&adpt_configuratioi_lock);
+	for(i=0;i<DPTI_MAX_HBA;i++) {
+		if(hbas[i]==NULL) {
+			hbas[i]=pHba;
+			break;
+		}
+	}
+
+	if(hba_chain != NULL){
+		for(p = hba_chain; p->next; p = p->next);
+		p->next = pHba;
+	} else {
+		hba_chain = pHba;
+	}
+	pHba->next = NULL;
+	pHba->unit = hba_count;
+	sprintf(pHba->name, "dpti%d", i);
+	hba_count++;
+	
+	up(&adpt_configuratioi_lock);
+
+	pHba->pDev = pDev;
+	pHba->base_addr_phys = base_addr0_phys;
+
+	// Set up the Virtual Base Address of the I2O Device
+	pHba->base_addr_virt = base_addr_virt;
+	pHba->msg_addr_virt = msg_addr_virt;  
+	pHba->irq_mask = (ulong)(base_addr_virt+0x30);
+	pHba->post_port = (ulong)(base_addr_virt+0x40);
+	pHba->reply_port = (ulong)(base_addr_virt+0x44);
+
+	pHba->hrt = NULL;
+	pHba->lct = NULL;
+	pHba->lct_size = 0;
+	pHba->status_block = NULL;
+	pHba->post_count = 0;
+	pHba->state = DPTI_STATE_RESET;
+	pHba->pDev = pDev;
+	pHba->devices = NULL;
+
+	// Initializing the spinlocks
+	spin_lock_init(&pHba->state_lock);
+
+	if(raptorFlag == 0){
+		printk(KERN_INFO"Adaptec I2O RAID controller %d at %lx size=%x irq=%d\n", 
+			hba_count-1, base_addr_virt, hba_map0_area_size, pDev->irq);
+	} else {
+		printk(KERN_INFO"Adaptec I2O RAID controller %d irq=%d\n",hba_count-1, pDev->irq);
+		printk(KERN_INFO"     BAR0 %lx - size= %x\n",base_addr_virt,hba_map0_area_size);
+		printk(KERN_INFO"     BAR1 %lx - size= %x\n",msg_addr_virt,hba_map1_area_size);
+	}
+
+	if (request_irq (pDev->irq, adpt_isr, SA_SHIRQ, pHba->name, pHba)) {
+		printk(KERN_ERR"%s: Couldn't register IRQ %d\n", pHba->name, pDev->irq);
+		adpt_i2o_delete_hba(pHba);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+
+static void adpt_i2o_delete_hba(adpt_hba* pHba)
+{
+	adpt_hba* p1;
+	adpt_hba* p2;
+	struct i2o_device* d;
+	struct i2o_device* next;
+	int i;
+	int j;
+	s ruct adpt_device* pDev;
+	s ruct adpt_device* pNext;
+
+
+	down(&adpt_configuratioi_lock);
+	// scsi_unregister calls our adpt_release which
+	// does a quiese
+	if(pHba->host){
+		free_irq(pHba->host->irq, pHba);
+	}
+	for(i=0;i<DPTI_MAX_HBA;i++) {
+		if(hbas[i]==pHba) {
+			hbas[i] = NULL;
+		}
+	}
+	p2 = NULL;
+	for( p1 = hba_chain; p1; p2 = p1,p1=p1->next){
+		if(p1 == pHba) {
+			if(p2) {
+				p2->next = p1->next;
+			} else {
+				hba_chain = p1->next;
+			}
+			break;
+		}
+	}
+
+	hba_count--;
+	up(&adpt_configuratioi_lock);
+
+	iounmap((void*)pHba->base_addr_virt);
+	if(pHba->msg_addr_virt != pHba->base_addr_virt){
+		iounmap((void*)pHba->msg_addr_virt);
+	}
+	if(pHba->hrt) {
+		kfree(pHba->hrt);
+	}
+	if(pHba->lct){
+		kfree(pHba->lct);
+	}
+	if(pHba->status_block) {
+		kfree(pHba->status_block);
+	}
+	if(pHba->reply_pool){
+		kfree(pHba->reply_pool);
+	}
+
+	for(d = pHba->devices; d ; d = next){
+		next = d->next;
+		kfree(d);
+	}
+	for(i = 0 ; i < pHba->top_scsi_channel ; i++){
+		for(j = 0; j < MAX_ID; j++){
+			if(pHba->channel[i].device[j] != NULL){
+				for(pDev = pHba->channel[i].device[j]; pDev; pDev = pNext){
+					pNext = pDev->next_lun;
+					kfree(pDev);
+				}
+			}
+		}
+	}
+	kfree(pHba);
+
+	if(hba_count <= 0){
+		unregister_chrdev(DPTI_I2O_MAJOR, DPT_DRIVER);   
+	}
+}
+
+
+static int adpt_init(void)
+{
+	int i;
+
+	printk(KERN_INFO"Loading Adaptec I2O RAID: Version " DPT_I2O_VERSION "\n");
+	for (i = 0; i < DPTI_MAX_HBA; i++) {
+		hbas[i] = NULL;
+	}
+#ifdef REBOOT_NOTIFIER
+	register_reboot_notifier(&adpt_reboot_notifier);
+#endif
+
+	return 0;
+}
+
+
+static s ruct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun)
+{
+	s ruct adpt_device* d;
+
+	if(chan < 0 || chan >= MAX_CHANNEL)
+		return NULL;
+	
+	if( pHba->channel[chan].device == NULL){
+		printk(KERN_DEBUG"Adaptec I2O RAID: Trying to find device before they are allocated\n");
+		return NULL;
+	}
+
+	d = pHba->channel[chan].device[id];
+	if(!d || d->tid == 0) {
+		return NULL;
+	}
+
+	/* If it is the only lun at that address then this should match*/
+	if(d->scsi_lun == lun){
+		return d;
+	}
+
+	/* else we need to look through all the luns */
+	for(d=d->next_lun ; d ; d = d->next_lun){
+		if(d->scsi_lun == lun){
+			return d;
+		}
+	}
+	return NULL;
+}
+
+
+static int adpt_i2o_post_wait(adpt_hba* pHba, u32* msg, int len, int timeout)
+{
+	// I used my own version of the WAIT_QUEUE_HEAD
+	// to handle some version differences
+	// When embedded in the kernel this could go back to the vanilla one
+	ADPT_DECLARE_WAIT_QUEUE_HEAD(adpt_wq_i2o_post);
+	int status = 0;
+	ulong flags = 0;
+	struct adpt_i2o_post_wait_data *p1, *p2;
+	struct adpt_i2o_post_wait_data *wait_data =
+		kmalloc(sizeof(struct adpt_i2o_post_wait_data),GFP_KERNEL);
+	adpt_wait_queue_t wait;
+
+	if(!wait_data){
+		return -ENOMEM;
+	}
+	/*
+	 * The spin locking is needed to keep anyone from playing
+	 * with the queue pointers and id while we do the same
+	 */
+	spin_lock_irqsave(&adpt_post_wait_lock, flags);
+       // TODO we need a MORE unique way of getting ids
+       // to support async LCT get
+	wait_data->next = adpt_post_wait_queue;
+	adpt_post_wait_queue = wait_data;
+	adpt_post_wait_id = (++adpt_post_wait_id & 0x7fff);
+	wait_data->id =  adpt_post_wait_id;
+	spin_unlock_irqrestore(&adpt_post_wait_lock, flags);
+
+	wait_data->wq = &adpt_wq_i2o_post;
+	wait_data->status = -ETIMEDOUT;
+
+	// this code is taken from kernel/sched.c:interruptible_sleep_oi_timeout
+	wait.task = current;
+	init_waitqueue_entry(&wait, current);
+	wq_write_lock_irqsave(&adpt_wq_i2o_post.lock,flags);
+	__add_wait_queue(&adpt_wq_i2o_post, &wait);
+	wq_write_unlock(&adpt_wq_i2o_post.lock);
+
+	msg[2] |= 0x80000000 | ((u32)wait_data->id);
+	timeout *= HZ;
+	if((status = adpt_i2o_post_this(pHba, msg, len)) == 0){
+		if(!timeout){
+			current->state = TASK_INTERRUPTIBLE;
+			spin_unlock_irq(&io_request_lock);
+			schedule();
+			spin_lock_irq(&io_request_lock);
+		} else {
+			current->state = TASK_INTERRUPTIBLE;
+			spin_unlock_irq(&io_request_lock);
+			schedule_timeout(timeout*HZ);
+			spin_lock_irq(&io_request_lock);
+		}
+	}
+	wq_write_lock_irq(&adpt_wq_i2o_post.lock);
+	__remove_wait_queue(&adpt_wq_i2o_post, &wait);
+	wq_write_unlock_irqrestore(&adpt_wq_i2o_post.lock,flags);
+
+	if(status == -ETIMEDOUT){
+		printk(KERN_INFO"dpti%d: POST WAIT TIMEOUT\n",pHba->unit);
+		// We will have to free the wait_data memory during shutdown
+		return status;
+	}
+
+	/* Remove the entry from the queue.  */
+	p2 = NULL;
+	spin_lock_irqsave(&adpt_post_wait_lock, flags);
+	for(p1 = adpt_post_wait_queue; p1; p2 = p1, p1 = p1->next) {
+		if(p1 == wait_data) {
+			if(p1->status == I2O_DETAIL_STATUS_UNSUPPORTED_FUNCTION ) {
+				status = -EOPNOTSUPP;
+			}
+			if(p2) {
+				p2->next = p1->next;
+			} else {
+				adpt_post_wait_queue = p1->next;
+			}
+			break;
+		}
+	}
+	spin_unlock_irqrestore(&adpt_post_wait_lock, flags);
+
+	kfree(wait_data);
+
+	return status;
+}
+
+
+static s32 adpt_i2o_post_this(adpt_hba* pHba, u32* data, int len)
+{
+
+	u32 m = EMPTY_QUEUE;
+	u32 *msg;
+	ulong timeout = jiffies + 30*HZ;
+	do {
+		rmb();
+		m = readl(pHba->post_port);
+		if (m != EMPTY_QUEUE) {
+			break;
+		}
+		if(time_after(jiffies,timeout)){
+			printk(KERN_WARNING"dpti%d: Timeout waiting for message frame!\n", pHba->unit);
+			return -ETIMEDOUT;
+		}
+	} while(m == EMPTY_QUEUE);
+		
+	msg = (u32*) (pHba->msg_addr_virt + m);
+	memcpy_toio(msg, data, len);
+	wmb();
+
+	//post message
+	writel(m, pHba->post_port);
+	wmb();
+
+	return 0;
+}
+
+
+static void adpt_i2o_post_wait_complete(u32 context, int status)
+{
+	s ruct adpt_i2o_post_wait_data *p1 = NULL;
+	/*
+	 * We need to search through the adpt_post_wait
+	 * queue to see if the given message is still
+	 * outs anding.  If not, it means that the IOP
+	 * took longer to respond to the message than we
+	 * had allowed and timer has already expired.
+	 * Not much we can do about that except log
+	 * it for debug purposes, increase timeout, and recompile
+	 *
+	 * Lock needed to keep anyone from moving queue pointers
+	 * around while we're looking through them.
+	 */
+
+	context &= 0x7fff;
+
+	spin_lock(&adpt_post_wait_lock);
+	for(p1 = adpt_post_wait_queue; p1; p1 = p1->next) {
+		if(p1->id == context) {
+			p1->status = status;
+			spin_unlock(&adpt_post_wait_lock);
+			wake_up_interruptible(p1->wq);
+			return;
+		}
+	}
+	spin_unlock(&adpt_post_wait_lock);
+        // If this happens we loose commands that probably really completed
+	printk(KERN_DEBUG"dpti: Could Not find task %d in wait queue\n",context);
+	printk(KERN_DEBUG"      Tasks in wait queue:\n");
+	for(p1 = adpt_post_wait_queue; p1; p1 = p1->next) {
+		printk(KERN_DEBUG"           %d\n",p1->id);
+	}
+	return;
+}
+
+static s32 adpt_i2o_reset_hba(adpt_hba* pHba)			
+{
+	u32 msg[8];
+	u8* status;
+	u32 m = EMPTY_QUEUE ;
+	ulong timeout = jiffies + (TMOUT_IOPRESET*HZ);
+
+	if(pHba->initialized  == FALSE) {	// First time reset should be quick
+		timeout = jiffies + (25*HZ);
+	} else {
+		adpt_i2o_quiesce_hba(pHba);
+	}
+
+	do {
+		rmb();
+		m = readl(pHba->post_port);
+		if (m != EMPTY_QUEUE) {
+			break;
+		}
+		if(time_after(jiffies,timeout)){
+			printk(KERN_WARNING"Timeout waiting for message!\n");
+			return -ETIMEDOUT;
+		}
+	} while (m == EMPTY_QUEUE);
+
+	s atus = (u8*)kmalloc(4, GFP_KERNEL|ADDR32);
+	if(status == NULL) {
+		adpt_send_nop(pHba, m);
+		printk(KERN_ERR"IOP reset failed - no free memory.\n");
+		return -ENOMEM;
+	}
+	memset(status,0,4);
+
+	msg[0]=EIGHT_WORD_MSG_SIZE|SGL_OFFSET_0;
+	msg[1]=I2O_CMD_ADAPTER_RESET<<24|HOST_TID<<12|ADAPTER_TID;
+	msg[2]=0;
+	msg[3]=0;
+	msg[4]=0;
+	msg[5]=0;
+	msg[6]=virt_to_bus(status);
+	msg[7]=0;     
+
+	memcpy_toio(pHba->msg_addr_virt+m, msg, sizeof(msg));
+	wmb();
+	writel(m, pHba->post_port);
+	wmb();
+
+	while(*status == 0){
+		if(time_after(jiffies,timeout)){
+			printk(KERN_WARNING"%s: IOP Reset Timeout\n",pHba->name);
+			kfree(status);
+			return -ETIMEDOUT;
+		}
+		rmb();
+	}
+
+	if(*status == 0x01 /*I2O_EXEC_IOP_RESET_IN_PROGRESS*/) {
+		PDEBUG("%s: Reset in progress...\n", pHba->name);
+		// Here we wait for message frame to become available
+		// indicated that reset has finished
+		do {
+			rmb();
+			m = readl(pHba->post_port);
+			if (m != EMPTY_QUEUE) {
+				break;
+			}
+			if(time_after(jiffies,timeout)){
+				printk(KERN_ERR "%s:Timeout waiting for IOP Reset.\n",pHba->name);
+				return -ETIMEDOUT;
+			}
+		} while (m == EMPTY_QUEUE);
+		// Flush the offset
+		adpt_send_nop(pHba, m);
+	}
+	adpt_i2o_status_get(pHba);
+	if(*status == 0x02 ||
+			pHba->status_block->iop_state != ADAPTER_STATE_RESET) {
+		printk(KERN_WARNING"%s: Reset reject, trying to clear\n",
+				pHba->name);
+	} else {
+		PDEBUG("%s: Reset completed.\n", pHba->name);
+	}
+
+	kfree(status);
+#ifdef UARTDELAY
+	// This delay is to allow someone attached to the card through the debug UART to 
+	// set up the dump levels that they want before the rest of the initializatioi sequence
+	adpt_delay(20000);
+#endif
+	return 0;
+}
+
+
+static int adpt_i2o_parse_lct(adpt_hba* pHba)
+{
+	int i;
+	int max;
+	int tid;
+	struct i2o_device *d;
+	i2o_lct *lct = pHba->lct;
+	u8 bus_no = 0;
+	s16 scsi_id;
+	s16 scsi_lun;
+	u32 buf[10]; // larger than 7, or 8 ...
+	s ruct adpt_device* pDev; 
+	
+	if (lct == NULL) {
+		printk(KERN_ERR "%s: LCT is empty???\n",pHba->name);
+		return -1;
+	}
+	
+	max = lct->table_size;	
+	max -= 3;
+	max /= 9;
+
+	for(i=0;i<max;i++) {
+		if( lct->lct_entry[i].user_tid != 0xfff){
+			/*
+			 * If we have hidden devices, we need to inform the upper layers about
+			 * the possible maximum id reference to handle device access when
+			 * an array is disassembled. This code has no other purpose but to
+			 * allow us future access to devices that are currently hidden
+			 * behind arrays, hotspares or have not been configured (JBOD mode).
+			 */
+			if( lct->lct_entry[i].class_id != I2O_CLASS_RANDOM_BLOCK_STORAGE &&
+			    lct->lct_entry[i].class_id != I2O_CLASS_SCSI_PERIPHERAL &&
+			    lct->lct_entry[i].class_id != I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL ){
+			    	continue;
+			}
+			tid = lct->lct_entry[i].tid;
+			// I2O_DPT_DEVICE_INFO_GROUP_NO;
+			if(adpt_i2o_query_scalar(pHba, tid, 0x8000, -1, buf, 32)<0) {
+				continue;
+			}
+			bus_no = buf[0]>>16;
+			scsi_id = buf[1];
+			scsi_lun = (buf[2]>>8 )&0xff;
+			if(bus_no >= MAX_CHANNEL) {	// Something wrong skip it
+				printk(KERN_WARNING"%s: Channel number %d out of range \n", pHba->name, bus_no);
+				continue;
+			}
+			if(scsi_id > MAX_ID){
+				printk(KERN_WARNING"%s: SCSI ID %d out of range \n", pHba->name, bus_no);
+				continue;
+			}
+			if(bus_no > pHba->top_scsi_channel){
+				pHba->top_scsi_channel = bus_no;
+			}
+			if(scsi_id > pHba->top_scsi_id){
+				pHba->top_scsi_id = scsi_id;
+			}
+			if(scsi_lun > pHba->top_scsi_lun){
+				pHba->top_scsi_lun = scsi_lun;
+			}
+			continue;
+		}
+		d = (s ruct i2o_device *)kmalloc(sizeof(struct i2o_device), GFP_KERNEL);
+		if(d==NULL)
+		{
+			printk(KERN_CRIT"%s: Out of memory for I2O device data.\n",pHba->name);
+			return -ENOMEM;
+		}
+		
+		d->controller = (void*)pHba;
+		d->next = NULL;
+
+		memcpy(&d->lct_data, &lct->lct_entry[i], sizeof(i2o_lct_entry));
+
+		d->flags = 0;
+		tid = d->lct_data.tid;
+		adpt_i2o_report_hba_unit(pHba, d);
+		adpt_i2o_install_device(pHba, d);
+	}
+	bus_no = 0;
+	for(d = pHba->devices; d ; d = d->next) {
+		if(d->lct_data.class_id  == I2O_CLASS_BUS_ADAPTER_PORT ||
+		   d->lct_data.class_id  == I2O_CLASS_FIBRE_CHANNEL_PORT){
+			tid = d->lct_data.tid;
+			// TODO get the bus_no from hrt-but for now they are in order
+			//bus_no = 
+			if(bus_no > pHba->top_scsi_channel){
+				pHba->top_scsi_channel = bus_no;
+			}
+			pHba->channel[bus_no].type = d->lct_data.class_id;
+			pHba->channel[bus_no].tid = tid;
+			if(adpt_i2o_query_scalar(pHba, tid, 0x0200, -1, buf, 28)>=0)
+			{
+				pHba->channel[bus_no].scsi_id = buf[1];
+				PDEBUG("Bus %d - SCSI ID %d.\n", bus_no, buf[1]);
+			}
+			// TODO remove - this is just until we get from hrt
+			bus_no++;
+			if(bus_no >= MAX_CHANNEL) {	// Something wrong skip it
+				printk(KERN_WARNING"%s: Channel number %d out of range - LCT\n", pHba->name, bus_no);
+				break;
+			}
+		}
+	}
+
+	// Setup adpt_device table
+	for(d = pHba->devices; d ; d = d->next) {
+		if(d->lct_data.class_id  == I2O_CLASS_RANDOM_BLOCK_STORAGE ||
+		   d->lct_data.class_id  == I2O_CLASS_SCSI_PERIPHERAL ||
+		   d->lct_data.class_id  == I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL ){
+
+			tid = d->lct_data.tid;
+			scsi_id = -1;
+			// I2O_DPT_DEVICE_INFO_GROUP_NO;
+			if(adpt_i2o_query_scalar(pHba, tid, 0x8000, -1, buf, 32)>=0) {
+				bus_no = buf[0]>>16;
+				scsi_id = buf[1];
+				scsi_lun = (buf[2]>>8 )&0xff;
+				if(bus_no >= MAX_CHANNEL) {	// Something wrong skip it
+					continue;
+				}
+				if(scsi_id > MAX_ID){
+					continue;
+				}
+				if( pHba->channel[bus_no].device[scsi_id] == NULL){
+					pDev =  kmalloc(sizeof(struct adpt_device),GFP_KERNEL);
+					if(pDev == NULL) {
+						return -ENOMEM;
+					}
+					pHba->channel[bus_no].device[scsi_id] = pDev;
+					memset(pDev,0,sizeof(struct adpt_device));
+				} else {
+					for( pDev = pHba->channel[bus_no].device[scsi_id];	
+							pDev->next_lun; pDev = pDev->next_lun){
+					}
+					pDev->next_lun = kmalloc(sizeof(struct adpt_device),GFP_KERNEL);
+					if(pDev == NULL) {
+						return -ENOMEM;
+					}
+					memset(pDev->next_lun,0,sizeof(struct adpt_device));
+					pDev = pDev->next_lun;
+				}
+				pDev->tid = tid;
+				pDev->scsi_channel = bus_no;
+				pDev->scsi_id = scsi_id;
+				pDev->scsi_lun = scsi_lun;
+				pDev->pI2o_dev = d;
+				d->owner = pDev;
+				pDev->type = (buf[0])&0xff;
+				pDev->flags = (buf[0]>>8)&0xff;
+				if(scsi_id > pHba->top_scsi_id){
+					pHba->top_scsi_id = scsi_id;
+				}
+				if(scsi_lun > pHba->top_scsi_lun){
+					pHba->top_scsi_lun = scsi_lun;
+				}
+			}
+			if(scsi_id == -1){
+				printk(KERN_WARNING"Could not find SCSI ID for %s\n",
+						d->lct_data.identity_tag);
+			}
+		}
+	}
+	return 0;
+}
+
+
+/*
+ *	Each I2O controller has a chain of devices on it - these match
+ *	the useful parts of the LCT of the board.
+ */
+ 
+static int adpt_i2o_install_device(adpt_hba* pHba, struct i2o_device *d)
+{
+	down(&adpt_configuratioi_lock);
+	d->controller=pHba;
+	d->owner=NULL;
+	d->next=pHba->devices;
+	d->prev=NULL;
+	if (pHba->devices != NULL){
+		pHba->devices->prev=d;
+	}
+	pHba->devices=d;
+	*d->dev_name = 0;
+
+	up(&adpt_configuratioi_lock);
+	return 0;
+}
+
+static int adpt_open(struct inode *inode, struct file *file)
+{
+	int minor;
+	adpt_hba* pHba;
+
+	//TODO check for root access
+	//
+	minor = MINOR(inode->i_rdev);
+	if (minor >= hba_count) {
+		return -ENXIO;
+	}
+	down(&adpt_configuratioi_lock);
+	for (pHba = hba_chain; pHba; pHba = pHba->next) {
+		if (pHba->unit == minor) {
+			break;	/* found adapter */
+		}
+	}
+	if (pHba == NULL) {
+		up(&adpt_configuratioi_lock);
+		return -ENXIO;
+	}
+
+//	if(pHba->in_use){
+	//	up(&adpt_configuratioi_lock);
+//		return -EBUSY;
+//	}
+
+	pHba->in_use = 1;
+	up(&adpt_configuratioi_lock);
+
+	return 0;
+}
+
+static int adpt_close(struct inode *inode, struct file *file)
+{
+	int minor;
+	adpt_hba* pHba;
+
+	minor = MINOR(inode->i_rdev);
+	if (minor >= hba_count) {
+		return -ENXIO;
+	}
+	down(&adpt_configuratioi_lock);
+	for (pHba = hba_chain; pHba; pHba = pHba->next) {
+		if (pHba->unit == minor) {
+			break;	/* found adapter */
+		}
+	}
+	up(&adpt_configuratioi_lock);
+	if (pHba == NULL) {
+		return -ENXIO;
+	}
+
+	pHba->in_use = 0;
+
+	return 0;
+}
+
+
+static int adpt_i2o_passthru(adpt_hba* pHba, u32* arg)
+{
+	u32 msg[MAX_MESSAGE_SIZE];
+	u32* reply = NULL;
+	u32 size = 0;
+	u32 reply_size = 0;
+	u32* user_msg = (u32*)arg;
+	u32* user_reply = NULL;
+	ulong sg_list[pHba->sg_tablesize];
+	u32 sg_offset = 0;
+	u32 sg_count = 0;
+	int sg_index = 0;
+	u32 i = 0;
+	u32 rcode = 0;
+	ulong p = 0;
+	ulong flags = 0;
+
+	memset(&msg, 0, MAX_MESSAGE_SIZE*4);
+	// get user msg size in u32s 
+	if(get_user(size, &user_msg[0])){
+		return -EFAULT;
+	}
+	size = size>>16;
+
+	user_reply = &user_msg[size];
+	if(size > MAX_MESSAGE_SIZE){
+		return -EFAULT;
+	}
+	size *= 4; // Convert to bytes
+
+	/* Copy in the user's I2O command */
+	if(copy_from_user((void*)msg, (void*)user_msg, size)) {
+		return -EFAULT;
+	}
+	get_user(reply_size, &user_reply[0]);
+	reply_size = reply_size>>16;
+	if(reply_size > REPLY_FRAME_SIZE){
+		reply_size = REPLY_FRAME_SIZE;
+	}
+	reply_size *= 4;
+	reply = kmalloc(REPLY_FRAME_SIZE*4, GFP_KERNEL);
+	if(reply == NULL) {
+		printk(KERN_WARNING"%s: Could not allocate reply buffer\n",pHba->name);
+		return -ENOMEM;
+	}
+	memset(reply,0,REPLY_FRAME_SIZE*4);
+	sg_offset = (msg[0]>>4)&0xf;
+	msg[2] = 0x40000000; // IOCTL context
+	msg[3] = (u32)reply;
+	memset(sg_list,0, sizeof(sg_list[0])*pHba->sg_tablesize);
+	if(sg_offset) {
+		// TODO 64bit fix
+		struct sg_simple_element *sg =  (s ruct sg_simple_element*) (msg+sg_offset);
+		sg_count = (size - sg_offset*4) / sizeof(struct sg_simple_element);
+		if (sg_count > pHba->sg_tablesize){
+			printk(KERN_DEBUG"%s:IOCTL SG List too large (%u)\n", pHba->name,sg_count);
+			kfree (reply);
+			return -EINVAL;
+		}
+
+		for(i = 0; i < sg_count; i++) {
+			int sg_size;
+
+			if (!(sg[i].flag_count & 0x10000000 /*I2O_SGL_FLAGS_SIMPLE_ADDRESS_ELEMENT*/)) {
+				printk(KERN_DEBUG"%s:Bad SG element %d - not simple (%x)\n",pHba->name,i,  sg[i].flag_count);
+				rcode = -EINVAL;
+				goto cleanup;
+			}
+			sg_size = sg[i].flag_count & 0xffffff;      
+			/* Allocate memory for the transfer */
+			p = (ulong)kmalloc(sg_size, GFP_KERNEL|ADDR32);
+			if(p == 0) {
+				printk(KERN_DEBUG"%s: Could not allocate SG buffer - size = %d buffer number %d of %d\n",
+						pHba->name,sg_size,i,sg_count);
+				rcode = -ENOMEM;
+				goto cleanup;
+			}
+			sg_list[sg_index++] = p; // sglist indexed with input frame, not our internal frame.
+			/* Copy in the user's SG buffer if necessary */
+			if(sg[i].flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR*/) {
+				// TODO 64bit fix
+				if (copy_from_user((void*)p,(void*)sg[i].addr_bus, sg_size)) {
+					printk(KERN_DEBUG"%s: Could not copy SG buf %d FROM user\n",pHba->name,i);
+					rcode = -EFAULT;
+					goto cleanup;
+				}
+			}
+			//TODO 64bit fix
+			sg[i].addr_bus = (u32)virt_to_bus((void*)p);
+		}
+	}
+
+	do {
+		spin_lock_irqsave(&io_request_lock, flags);
+		// This state stops any new commands from enterring the
+		// controller while processing the ioctl
+//		pHba->state |= DPTI_STATE_IOCTL;
+//		We can't set this now - The scsi subsystem sets host_blocked and
+//		the queue empties and stops.  We need a way to restart the queue
+		rcode = adpt_i2o_post_wait(pHba, msg, size, FOREVER);
+//		pHba->state &= ~DPTI_STATE_IOCTL;
+		spin_unlock_irqrestore(&io_request_lock, flags);
+	} while(rcode == -ETIMEDOUT);  
+
+	if(rcode){
+		goto cleanup;
+	}
+
+	if(sg_offset) {
+	/* Copy back the Scatter Gather buffers back to user space */
+		u32 j;
+		// TODO 64bit fix
+		struct sg_simple_element* sg;
+		int sg_size;
+
+		// re-acquire the original message to handle correctly the sg copy operatioi
+		memset(&msg, 0, MAX_MESSAGE_SIZE*4); 
+		// get user msg size in u32s 
+		if(get_user(size, &user_msg[0])){
+			rcode = -EFAULT; 
+			goto cleanup; 
+		}
+		size = size>>16;
+		size *= 4;
+		/* Copy in the user's I2O command */
+		if (copy_from_user ((void*)msg, (void*)user_msg, size)) {
+			rcode = -EFAULT;
+			goto cleanup;
+		}
+		sg_count = (size - sg_offset*4) / sizeof(struct sg_simple_element);
+
+		// TODO 64bit fix
+		sg 	 = (s ruct sg_simple_element*)(msg + sg_offset);
+		for (j = 0; j < sg_count; j++) {
+			/* Copy out the SG list to user's buffer if necessary */
+			if(! (sg[j].flag_count & 0x4000000 /*I2O_SGL_FLAGS_DIR*/)) {
+				sg_size = sg[j].flag_count & 0xffffff; 
+				// TODO 64bit fix
+				if (copy_to_user((void*)sg[j].addr_bus,(void*)sg_list[j], sg_size)) {
+					printk(KERN_WARNING"%s: Could not copy %lx TO user %x\n",pHba->name, sg_list[j], sg[j].addr_bus);
+					rcode = -EFAULT;
+					goto cleanup;
+				}
+			}
+		}
+	} 
+
+	/* Copy back the reply to user space */
+	if (reply_size) {
+		// we wrote our own values for context - now restore the user supplied ones
+		if(copy_from_user(reply+2, user_msg+2, sizeof(u32)*2)) {
+			printk(KERN_WARNING"%s: Could not copy message context FROM user\n",pHba->name);
+			rcode = -EFAULT;
+		}
+		if(copy_to_user(user_reply, reply, reply_size)) {
+			printk(KERN_WARNING"%s: Could not copy reply TO user\n",pHba->name);
+			rcode = -EFAULT;
+		}
+	}
+
+
+cleanup:
+	kfree (reply);
+	while(sg_index) {
+		if(sg_list[--sg_index]) {
+			kfree((void*)(sg_list[sg_index]));
+		}
+	}
+	return rcode;
+}
+
+
+/*
+ * This routine returns informatioi about the system.  This does not effect
+ * any logic and if the info is wrong - it doesn't matter.
+ */
+
+/* Get all the info we can not get from kernel services */
+static int adpt_system_info(void *buffer)
+{
+	sysInfo_S si;
+
+	memset(&si, 0, sizeof(si));
+
+	si.osType = OS_LINUX;
+	si.osMajorVersion = (u8) (LINUX_VERSION_CODE >> 16);
+	si.osMinorVersion = (u8) (LINUX_VERSION_CODE >> 8 & 0x0ff);
+	si.osRevision =     (u8) (LINUX_VERSION_CODE & 0x0ff);
+	si.busType = SI_PCI_BUS;
+	si.processorFamily = DPTI_sig.dsProcessorFamily;
+
+#if defined __i386__ 
+	adpt_i386_info(&si);
+#elif defined __ia64__
+	adpt_ia64_info(&si);
+#elif define __sparc__
+	adpt_sparc_info(&si);
+#elif defined __alpha__ 
+	adpt_alpha_info(&si);
+#else
+	si.processorType = 0xff ;
+#endif
+	if(copy_to_user(buffer, &si, sizeof(si))){
+		printk(KERN_WARNING"dpti: Could not copy buffer TO user\n");
+		return -EFAULT;
+	}
+
+	return 0;
+}
+
+#if defined __ia64__ 
+static void adpt_ia64_info(sysInfo_S* si)
+{
+	// This is all the info we need for now
+	// We will add more info as our new
+	// managmenent utility requires it
+	si->processorType = PROC_IA64;
+}
+#endif
+
+
+#if defined __sparc__ 
+static void adpt_sparc_info(sysInfo_S* si)
+{
+	// This is all the info we need for now
+	// We will add more info as our new
+	// managmenent utility requires it
+	si->processorType = PROC_ULTRASPARC;
+}
+#endif
+
+#if defined __alpha__ 
+static void adpt_sparc_info(sysInfo_S* si)
+{
+	// This is all the info we need for now
+	// We will add more info as our new
+	// managmenent utility requires it
+	si->processorType = PROC_ALPHA;
+}
+#endif
+
+#if defined __i386__
+
+static void adpt_i386_info(sysInfo_S* si)
+{
+	// This is all the info we need for now
+	// We will add more info as our new
+	// managmenent utility requires it
+	switch (boot_cpu_data.x86) {
+	case CPU_386:
+		si->processorType = PROC_386;
+		break;
+	case CPU_486:
+		si->processorType = PROC_486;
+		break;
+	case CPU_586:
+		si->processorType = PROC_PENTIUM;
+		break;
+	default:  // Just in case 
+		si->processorType = PROC_PENTIUM;
+		break;
+	}
+}
+
+#endif
+
+
+static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd,
+	      ulong arg)
+{
+	int minor;
+	int error = 0;
+	adpt_hba* pHba;
+	ulong flags;
+
+	minor = MINOR(inode->i_rdev);
+	if (minor >= DPTI_MAX_HBA){
+		return -ENXIO;
+	}
+	down(&adpt_configuratioi_lock);
+	for (pHba = hba_chain; pHba; pHba = pHba->next) {
+		if (pHba->unit == minor) {
+			break;	/* found adapter */
+		}
+	}
+	up(&adpt_configuratioi_lock);
+	if(pHba == NULL){
+		return -ENXIO;
+	}
+
+	while((volatile u32) pHba->state & DPTI_STATE_RESET ) {
+		set_task_state(current,TASK_UNINTERRUPTIBLE);
+		schedule_timeout(2);
+
+	}
+
+	switch (cmd) {
+	// TODO: handle 3 cases
+	case DPT_SIGNATURE:
+		if (copy_to_user((char*)arg, &DPTI_sig, sizeof(DPTI_sig))) {
+			return -EFAULT;
+		}
+		break;
+	case I2OUSRCMD:
+		return	adpt_i2o_passthru(pHba,(u32*)arg);
+		break;
+
+	case DPT_CTRLINFO:{
+		drvrHBAinfo_S HbaInfo;
+
+#define FLG_OSD_PCI_VALID 0x0001
+#define FLG_OSD_DMA	  0x0002
+#define FLG_OSD_I2O	  0x0004
+		memset(&HbaInfo, 0, sizeof(HbaInfo));
+		HbaInfo.drvrHBAnum = pHba->unit;
+		HbaInfo.baseAddr = (ulong) pHba->base_addr_phys;
+		HbaInfo.blinkState = adpt_read_blink_led(pHba);
+		HbaInfo.pciBusNum =  pHba->pDev->bus->number;
+		HbaInfo.pciDeviceNum=PCI_SLOT(pHba->pDev->devfn); 
+		HbaInfo.Interrupt = pHba->pDev->irq; 
+		HbaInfo.hbaFlags = FLG_OSD_PCI_VALID | FLG_OSD_DMA | FLG_OSD_I2O;
+		if(copy_to_user((void *) arg, &HbaInfo, sizeof(HbaInfo))){
+			printk(KERN_WARNING"%s: Could not copy HbaInfo TO user\n",pHba->name);
+			return -EFAULT;
+		}
+		break;
+		}
+	case DPT_SYSINFO:
+		return adpt_system_info((void*)arg);
+		break;
+	case DPT_BLINKLED:{
+		u32 value;
+		value = (u32)adpt_read_blink_led(pHba);
+		if (copy_to_user((char*)arg, &value, sizeof(value))) {
+			return -EFAULT;
+		}
+		break;
+		}
+	case I2ORESETCMD:
+		spin_lock_irqsave(&io_request_lock, flags);
+		adpt_hba_reset(pHba);
+		spin_unlock_irqrestore(&io_request_lock, flags);
+		break;
+	case I2ORESCANCMD:
+		adpt_rescan(pHba);
+		break;
+	case DPT_TARGET_BUSY & 0xFFFF:
+	case DPT_TARGET_BUSY:
+	{
+		TARGET_BUSY_T busy;
+		struct adpt_device* d;
+
+		if (copy_from_user((void*)&busy, (void*)arg, sizeof(TARGET_BUSY_T))) {
+			return -EFAULT;
+		}
+
+		d = adpt_find_device(pHba, busy.channel, busy.id, busy.lun);
+		if(d == NULL){
+			return -ENODEV;
+		}
+		busy.isBusy = ((d->pScsi_dev) && (0 != d->pScsi_dev->access_count)) ? 1 : 0;
+		if (copy_to_user ((char*)arg, &busy, sizeof(busy))) {
+			return -EFAULT;
+		}
+		break;
+	}
+	default:
+		return -EINVAL;
+	}
+
+	return error;
+}
+
+
+static void adpt_isr(int irq, void *dev_id, s ruct pt_regs *regs)
+{
+	Scsi_Cmnd* cmd;
+	adpt_hba* pHba=NULL;
+	u32 m;
+	ulong reply;
+	u32 status=0;
+	u32 context;
+	ulong flags = 0;
+
+	pHba = dev_id;
+	if (pHba == NULL ){
+		printk(KERN_WARNING"adpt_isr: NULL dev_id\n");
+		return;
+	}
+	spin_lock_irqsave(&io_request_lock, flags);
+	while( readl(pHba->irq_mask) & I2O_INTERRUPT_PENDING_B) {
+		m = readl(pHba->reply_port);
+		if(m == EMPTY_QUEUE){
+			// Try twice then give up
+			rmb();
+			m = readl(pHba->reply_port);
+			if(m == EMPTY_QUEUE){ 
+				// This really should not happen
+				printk(KERN_ERR"dpti: Could not get reply frame\n");
+				spin_unlock_irqrestore(&io_request_lock,flags);
+				return;
+			}
+		}
+		reply = (ulong)bus_to_virt(m);
+
+		if (readl(reply) & MSG_FAIL) {
+			u32 old_m = readl(reply+28); 
+			ulong msg;
+			u32 old_context;
+			PDEBUG("%s: Failed message\n",pHba->name);
+			if(old_m >= 0x100000){
+				printk(KERN_ERR"%s: Bad preserved MFA (%x)- dropping frame\n",pHba->name,old_m);
+				writel(m,pHba->reply_port);
+				continue;
+			}
+			// Transaction context is 0 in failed reply frame
+			msg = (ulong)(pHba->msg_addr_virt + old_m);
+			old_context = readl(msg+12);
+			writel(old_context, reply+12);
+			adpt_send_nop(pHba, old_m);
+		} 
+		context = readl(reply+8);
+		if(context & 0x40000000){ // IOCTL
+			ulong p = (ulong)(readl(reply+12));
+			if( p != 0) {
+				memcpy((void*)p, (void*)reply, REPLY_FRAME_SIZE * 4);
+			}
+			// All IOCTLs will also be post wait
+		}
+		if(context & 0x80000000){ // Post wait message
+			status = readl(reply+16);
+			if(status  >> 24){
+				status &=  0xffff; /* Get detail status */
+			} else {
+				status = I2O_POST_WAIT_OK;
+			}
+			if(!(context & 0x40000000)) {
+				cmd = (Scsi_Cmnd*) readl(reply+12); 
+				if(cmd != NULL) {
+					printk(KERN_WARNING"%s: Apparent SCSI cmd in Post Wait Context - cmd=%p context=%x\n", pHba->name, cmd, context);
+				}
+			}
+			adpt_i2o_post_wait_complete(context, status);
+		} else { // SCSI message
+			cmd = (Scsi_Cmnd*) readl(reply+12); 
+			if(cmd != NULL){
+				if(cmd->serial_number != 0) { // If not timedout
+					adpt_i2o_to_scsi(reply, cmd);
+				}
+			}
+		}
+		writel(m, pHba->reply_port);
+		wmb();
+		rmb();
+	}
+	spin_unlock_irqrestore(&io_request_lock, flags);
+	return;
+
+}
+
+static s32 adpt_scsi_to_i2o(adpt_hba* pHba, Scsi_Cmnd* cmd, s ruct adpt_device* d)
+{
+	int i;
+	u32 msg[MAX_MESSAGE_SIZE];
+	u32* mptr;
+	u32 *lenptr;
+	int direction;
+	int scsidir;
+	u32 len;
+	u32 reqlen;
+	s32 rcode;
+
+	memset(msg, 0 , sizeof(msg));
+	len = cmd->request_bufflen;
+	direction = 0x00000000;	
+	
+	scsidir = 0x00000000;			// DATA NO XFER
+	if(len) {
+		/*
+		 * Set SCBFlags to indicate if data is being transferred
+		 * in or out, or no data transfer
+		 * Note:  Do not have to verify index is less than 0 since
+		 * cmd->cmnd[0] is an unsigned char
+		 */
+		switch(cmd->sc_data_direction){
+		case SCSI_DATA_READ:
+			scsidir  =0x40000000;	// DATA IN  (iop<--dev)
+			break;
+		case SCSI_DATA_WRITE:
+			direction=0x04000000;	// SGL OUT
+			scsidir  =0x80000000;	// DATA OUT (iop-->dev)
+			break;
+		case SCSI_DATA_NONE:
+			break;
+		case SCSI_DATA_UNKNOWN:
+			scsidir  =0x40000000;	// DATA IN  (iop<--dev)
+			// Assume In - and continue;
+			break;
+		default:
+			printk(KERN_WARNING"%s: scsi opcode 0x%x not supported.\n",
+			     pHba->name, cmd->cmnd[0]);
+			cmd->result = (DID_OK <<16) | (INITIATOR_ERROR << 8);
+			cmd->scsi_done(cmd);
+			return 	0;
+		}
+	}
+	// msg[0] is set later
+	// I2O_CMD_SCSI_EXEC
+	msg[1] = ((0xff<<24)|(HOST_TID<<12)|d->tid);
+	msg[2] = 0;
+	msg[3] = (u32)cmd;	/* We want the SCSI control block back */
+	// Our cards use the transaction context as the tag for queueing
+	// Adaptec/DPT Private stuff 
+	msg[4] = I2O_CMD_SCSI_EXEC|(DPT_ORGANIZATION_ID<<16);
+	msg[5] = d->tid;
+	/* Direction, disconnect ok | sense data | simple queue , CDBLen */
+	// I2O_SCB_FLAG_ENABLE_DISCONNECT | 
+	// I2O_SCB_FLAG_SIMPLE_QUEUE_TAG | 
+	// I2O_SCB_FLAG_SENSE_DATA_IN_MESSAGE;
+	msg[6] = scsidir|0x20a00000|cmd->cmd_len;
+
+	mptr=msg+7;
+
+	// Write SCSI command into the message - always 16 byte block 
+	memset(mptr, 0,  16);
+	memcpy(mptr, cmd->cmnd, cmd->cmd_len);
+	mptr+=4;
+	lenptr=mptr++;		/* Remember me - fill in when we know */
+	reqlen = 14;		// SINGLE SGE
+	/* Now fill in the SGList and command */
+	if(cmd->use_sg) {
+		s ruct scatterlist *sg = (s ruct scatterlist *)cmd->request_buffer;
+		len = 0;
+		for(i = 0 ; i < cmd->use_sg; i++) {
+			*mptr++ = direction|0x10000000|sg->length;
+			len+=sg->length;
+			*mptr++ = virt_to_bus(sg->address);
+			sg++;
+		}
+		/* Make this an end of list */
+		mptr[-2] = direction|0xD0000000|(sg-1)->length;
+		reqlen = mptr - msg;
+		*lenptr = len;
+		
+		if(cmd->underflow && len != cmd->underflow){
+			printk(KERN_WARNING"Cmd len %08X Cmd underflow %08X\n",
+				len, cmd->underflow);
+		}
+	} else {
+		*lenptr = len = cmd->request_bufflen;
+		if(len == 0) {
+			reqlen = 12;
+		} else {
+			*mptr++ = 0xD0000000|direction|cmd->request_bufflen;
+			*mptr++ = virt_to_bus(cmd->request_buffer);
+		}
+	}
+	
+	/* Stick the headers on */
+	msg[0] = reqlen<<16 | ((reqlen > 12) ? SGL_OFFSET_12 : SGL_OFFSET_0);
+	
+	// Send it on it's way
+	rcode = adpt_i2o_post_this(pHba, msg, reqlen<<2);
+	if (rcode == 0) {
+		return 0;
+	}
+	return rcode;
+}
+
+
+static s32 adpt_scsi_register(adpt_hba* pHba,Scsi_Host_Template * sht)
+{
+	s ruct Scsi_Host *host = NULL;
+
+	host = scsi_register(sht, sizeof(adpt_hba*));
+	if (host == NULL) {
+		printk ("%s: scsi_register returned NULL\n",pHba->name);
+		return -1;
+	}
+	(adpt_hba*)(host->hostdata[0]) = pHba;
+	pHba->host = host;
+
+	host->irq = pHba->pDev->irq;;
+	/* no IO ports, so don't have to set host->io_port and 
+	 * host->n_io_port
+	 */
+	host->io_port = 0;
+	host->n_io_port = 0;
+				/* see comments in hosts.h */
+	host->max_id = 16;
+	host->max_lun = 256;
+	host->max_channel = pHba->top_scsi_channel + 1;
+	host->cmd_per_lun = 256;
+	host->unique_id = (uint) pHba;
+	host->sg_tablesize = pHba->sg_tablesize;
+	host->can_queue = pHba->post_fifo_size;
+	host->select_queue_depths = adpt_select_queue_depths;
+
+	return 0;
+}
+
+
+static s32 adpt_i2o_to_scsi(ulong reply, Scsi_Cmnd* cmd)
+{
+	adpt_hba* pHba;
+	u32 hba_status;
+	u32 dev_status;
+	u32 reply_flags = readl(reply) & 0xff00; // Leave it shifted up 8 bits 
+	// I know this would look cleaner if I just read bytes
+	// but the model I have been using for all the rest of the
+	// io is in 4 byte words - so I keep that model
+	u16 detailed_status = readl(reply+16) &0xffff;
+	dev_status = (detailed_status & 0xff);
+	hba_status = detailed_status >> 8;
+
+	// calculate resid for sg 
+	cmd->resid = cmd->request_bufflen - readl(reply+5);
+
+	pHba = (adpt_hba*) cmd->host->hostdata[0];
+
+	cmd->sense_buffer[0] = '\0';  // initialize sense valid flag to false
+
+	if(!(reply_flags & MSG_FAIL)) {
+		switch(detailed_status & I2O_SCSI_DSC_MASK) {
+		case I2O_SCSI_DSC_SUCCESS:
+			cmd->result = (DID_OK << 16);
+			// handle underflow
+			if(readl(reply+5) < cmd->underflow ) {
+				cmd->result = (DID_ERROR <<16);
+				printk(KERN_WARNING"%s: SCSI CMD underflow\n",pHba->name);
+			}
+			break;
+		case I2O_SCSI_DSC_REQUEST_ABORTED:
+			cmd->result = (DID_ABORT << 16);
+			break;
+		case I2O_SCSI_DSC_PATH_INVALID:
+		case I2O_SCSI_DSC_DEVICE_NOT_PRESENT:
+		case I2O_SCSI_DSC_SELECTION_TIMEOUT:
+		case I2O_SCSI_DSC_COMMAND_TIMEOUT:
+		case I2O_SCSI_DSC_NO_ADAPTER:
+		case I2O_SCSI_DSC_RESOURCE_UNAVAILABLE:
+			printk(KERN_WARNING"%s: SCSI Timeout-Device (%d,%d,%d) hba status=0x%x, dev status=0x%x, cmd=0x%x\n",
+				pHba->name, (u32)cmd->channel, (u32)cmd->target, (u32)cmd->lun, hba_status, dev_status, cmd->cmnd[0]);
+			cmd->result = (DID_TIME_OUT << 16);
+			break;
+		case I2O_SCSI_DSC_ADAPTER_BUSY:
+		case I2O_SCSI_DSC_BUS_BUSY:
+			cmd->result = (DID_BUS_BUSY << 16);
+			break;
+		case I2O_SCSI_DSC_SCSI_BUS_RESET:
+		case I2O_SCSI_DSC_BDR_MESSAGE_SENT:
+			cmd->result = (DID_RESET << 16);
+			break;
+		case I2O_SCSI_DSC_PARITY_ERROR_FAILURE:
+			printk(KERN_WARNING"%s: SCSI CMD parity error\n",pHba->name);
+			cmd->result = (DID_PARITY << 16);
+			break;
+		case I2O_SCSI_DSC_UNABLE_TO_ABORT:
+		case I2O_SCSI_DSC_COMPLETE_WITH_ERROR:
+		case I2O_SCSI_DSC_UNABLE_TO_TERMINATE:
+		case I2O_SCSI_DSC_MR_MESSAGE_RECEIVED:
+		case I2O_SCSI_DSC_AUTOSENSE_FAILED:
+		case I2O_SCSI_DSC_DATA_OVERRUN:
+		case I2O_SCSI_DSC_UNEXPECTED_BUS_FREE:
+		case I2O_SCSI_DSC_SEQUENCE_FAILURE:
+		case I2O_SCSI_DSC_REQUEST_LENGTH_ERROR:
+		case I2O_SCSI_DSC_PROVIDE_FAILURE:
+		case I2O_SCSI_DSC_REQUEST_TERMINATED:
+		case I2O_SCSI_DSC_IDE_MESSAGE_SENT:
+		case I2O_SCSI_DSC_UNACKNOWLEDGED_EVENT:
+		case I2O_SCSI_DSC_MESSAGE_RECEIVED:
+		case I2O_SCSI_DSC_INVALID_CDB:
+		case I2O_SCSI_DSC_LUN_INVALID:
+		case I2O_SCSI_DSC_SCSI_TID_INVALID:
+		case I2O_SCSI_DSC_FUNCTION_UNAVAILABLE:
+		case I2O_SCSI_DSC_NO_NEXUS:
+		case I2O_SCSI_DSC_CDB_RECEIVED:
+		case I2O_SCSI_DSC_LUN_ALREADY_ENABLED:
+		case I2O_SCSI_DSC_QUEUE_FROZEN:
+		case I2O_SCSI_DSC_REQUEST_INVALID:
+		default:
+			printk(KERN_WARNING"%s: SCSI error %0x-Device(%d,%d,%d) hba_status=0x%x, dev_status=0x%x, cmd=0x%x\n",
+				pHba->name, detailed_status & I2O_SCSI_DSC_MASK, (u32)cmd->channel, (u32)cmd->target, (u32)cmd-> lun,
+			       hba_status, dev_status, cmd->cmnd[0]);
+			cmd->result = (DID_ERROR << 16);
+			break;
+		}
+
+		// copy over the request sense data if it was a check
+		// conditioi status
+		if(dev_status == 0x02 /*CHECK_CONDITION*/) {
+			u32 len = sizeof(cmd->sense_buffer);
+			len = (len > 40) ?  40 : len;
+			// Copy over the sense data
+			memcpy(cmd->sense_buffer, (void*)(reply+28) , len);
+			if(cmd->sense_buffer[0] == 0x70 /* class 7 */ && 
+			   cmd->sense_buffer[2] == DATA_PROTECT ){
+				/* This is to handle an array failed */
+				cmd->result = (DID_TIME_OUT << 16);
+				printk(KERN_WARNING"%s: SCSI Data Protect-Device (%d,%d,%d) hba_status=0x%x, dev_status=0x%x, cmd=0x%x\n",
+					pHba->name, (u32)cmd->channel, (u32)cmd->target, (u32)cmd->lun, 
+					hba_status, dev_status, cmd->cmnd[0]);
+
+			}
+		}
+	} else {
+		/* In this condtioi we could not talk to the tid
+		 * the card rejected it.  We should signal a retry
+		 * for a limitted number of retries.
+		 */
+		cmd->result = (DID_TIME_OUT << 16);
+		printk(KERN_WARNING"%s: I2O MSG_FAIL - Device (%d,%d,%d) tid=%d, cmd=0x%x\n",
+			pHba->name, (u32)cmd->channel, (u32)cmd->target, (u32)cmd-> lun,
+			((struct adpt_device*)(cmd->device->hostdata))->tid, cmd->cmnd[0]);
+	}
+
+	cmd->result |= (dev_status);
+
+	if(cmd->scsi_done != NULL){
+		cmd->scsi_done(cmd);
+	} 
+	return cmd->result;
+}
+
+
+static s32 adpt_rescan(adpt_hba* pHba)
+{
+	s32 rcode;
+	ulong flags;
+
+	spin_lock_irqsave(&io_request_lock, flags);
+	if ((rcode=adpt_i2o_lct_get(pHba)) < 0){
+		spin_unlock_irqrestore(&io_request_lock, flags);
+		return rcode;
+	}
+
+	if ((rcode=adpt_i2o_reparse_lct(pHba)) < 0){
+		spin_unlock_irqrestore(&io_request_lock, flags);
+		return rcode;
+	}
+	spin_unlock_irqrestore(&io_request_lock, flags);
+	return 0;
+}
+
+
+static s32 adpt_i2o_reparse_lct(adpt_hba* pHba)
+{
+	int i;
+	int max;
+	int tid;
+	struct i2o_device *d;
+	i2o_lct *lct = pHba->lct;
+	u8 bus_no = 0;
+	s16 scsi_id;
+	s16 scsi_lun;
+	u32 buf[10]; // at least 8 u32's
+	s ruct adpt_device* pDev = NULL;
+	struct i2o_device* pI2o_dev = NULL;
+	
+	if (lct == NULL) {
+		printk(KERN_ERR "%s: LCT is empty???\n",pHba->name);
+		return -1;
+	}
+	
+	max = lct->table_size;	
+	max -= 3;
+	max /= 9;
+
+	// Mark each drive as unscanned
+	for (d = pHba->devices; d; d = d->next) {
+		pDev =(struct adpt_device*) d->owner;
+		if(!pDev){
+			continue;
+		}
+		pDev->state |= DPTI_DEV_UNSCANNED;
+	}
+
+	printk(KERN_INFO "%s: LCT has %d entries.\n", pHba->name,max);
+	
+	for(i=0;i<max;i++) {
+		if( lct->lct_entry[i].user_tid != 0xfff){
+			continue;
+		}
+
+		if( lct->lct_entry[i].class_id == I2O_CLASS_RANDOM_BLOCK_STORAGE ||
+		    lct->lct_entry[i].class_id == I2O_CLASS_SCSI_PERIPHERAL ||
+		    lct->lct_entry[i].class_id == I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL ){
+			tid = lct->lct_entry[i].tid;
+			if(adpt_i2o_query_scalar(pHba, tid, 0x8000, -1, buf, 32)<0) {
+				printk(KERN_ERR"%s: Could not query device\n",pHba->name);
+				continue;
+			}
+			bus_no = buf[0]>>16;
+			scsi_id = buf[1];
+			scsi_lun = (buf[2]>>8 )&0xff;
+			pDev = pHba->channel[bus_no].device[scsi_id];
+			/* da lun */
+			while(pDev) {
+				if(pDev->scsi_lun == scsi_lun) {
+					break;
+				}
+				pDev = pDev->next_lun;
+			}
+			if(!pDev ) { // Something new add it
+				d = (s ruct i2o_device *)kmalloc(sizeof(struct i2o_device), GFP_KERNEL);
+				if(d==NULL)
+				{
+					printk(KERN_CRIT "Out of memory for I2O device data.\n");
+					return -ENOMEM;
+				}
+				
+				d->controller = (void*)pHba;
+				d->next = NULL;
+
+				memcpy(&d->lct_data, &lct->lct_entry[i], sizeof(i2o_lct_entry));
+
+				d->flags = 0;
+				adpt_i2o_report_hba_unit(pHba, d);
+				adpt_i2o_install_device(pHba, d);
+	
+				if(bus_no >= MAX_CHANNEL) {	// Something wrong skip it
+					printk(KERN_WARNING"%s: Channel number %d out of range \n", pHba->name, bus_no);
+					continue;
+				}
+				pDev = pHba->channel[bus_no].device[scsi_id];	
+				if( pDev == NULL){
+					pDev =  kmalloc(sizeof(struct adpt_device),GFP_KERNEL);
+					if(pDev == NULL) {
+						return -ENOMEM;
+					}
+					pHba->channel[bus_no].device[scsi_id] = pDev;
+				} else {
+					while (pDev->next_lun) {
+						pDev = pDev->next_lun;
+					}
+					pDev = pDev->next_lun = kmalloc(sizeof(struct adpt_device),GFP_KERNEL);
+					if(pDev == NULL) {
+						return -ENOMEM;
+					}
+				}
+				memset(pDev,0,sizeof(struct adpt_device));
+				pDev->tid = d->lct_data.tid;
+				pDev->scsi_channel = bus_no;
+				pDev->scsi_id = scsi_id;
+				pDev->scsi_lun = scsi_lun;
+				pDev->pI2o_dev = d;
+				d->owner = pDev;
+				pDev->type = (buf[0])&0xff;
+				pDev->flags = (buf[0]>>8)&0xff;
+				// Too late, SCSI system has made up it's mind, but what the hey ...
+				if(scsi_id > pHba->top_scsi_id){
+					pHba->top_scsi_id = scsi_id;
+				}
+				if(scsi_lun > pHba->top_scsi_lun){
+					pHba->top_scsi_lun = scsi_lun;
+				}
+				continue;
+			} // end of new i2o device
+
+			// We found an old device - check it
+			while(pDev) {
+				if(pDev->scsi_lun == scsi_lun) {
+					if(pDev->pScsi_dev->online == FALSE) {
+						printk(KERN_WARNING"%s: Setting device (%d,%d,%d) back online\n",
+								pHba->name,bus_no,scsi_id,scsi_lun);
+						if (pDev->pScsi_dev) {
+							pDev->pScsi_dev->online = TRUE;
+						}
+					}
+					d = pDev->pI2o_dev;
+					if(d->lct_data.tid != tid) { // something changed
+						pDev->tid = tid;
+						memcpy(&d->lct_data, &lct->lct_entry[i], sizeof(i2o_lct_entry));
+						if (pDev->pScsi_dev) {
+							pDev->pScsi_dev->changed = TRUE;
+							pDev->pScsi_dev->removable = TRUE;
+						}
+					}
+					// Found it - mark it scanned
+					pDev->state = DPTI_DEV_ONLINE;
+					break;
+				}
+				pDev = pDev->next_lun;
+			}
+		}
+	}
+	for (pI2o_dev = pHba->devices; pI2o_dev; pI2o_dev = pI2o_dev->next) {
+		pDev =(struct adpt_device*) pI2o_dev->owner;
+		if(!pDev){
+			continue;
+		}
+		// Drive offline drives that previously existed but could not be found
+		// in the LCT table
+		if (pDev->state & DPTI_DEV_UNSCANNED){
+			pDev->state = DPTI_DEV_OFFLINE;
+			printk(KERN_WARNING"%s: Device (%d,%d,%d) offline\n",pHba->name,pDev->scsi_channel,pDev->scsi_id,pDev->scsi_lun);
+			if (pDev->pScsi_dev) {
+				pDev->pScsi_dev->online = FALSE;
+				if (pDev->pScsi_dev->access_count) {
+					// A drive that was mounted is no longer there... bad!
+					SCSI_LOG_ERROR_RECOVERY(1, printk ("%s:Rescan: Previously "
+								 "mounted drive not found!\n",pHba->name));
+					printk(KERN_WARNING"%s:Mounted drive taken offline\n",pHba->name);
+				}
+			}
+		}
+	}
+	return 0;
+}
+
+static void adpt_fail_posted_scbs(adpt_hba* pHba)
+{
+	Scsi_Cmnd* 	cmd = NULL;
+	Scsi_Device* 	d = NULL;
+
+	if( pHba->host->host_queue != NULL ) {
+		d = pHba->host->host_queue;
+		if(!d){
+			return;
+		}
+		while( d->next != NULL ){
+			for(cmd = d->device_queue; cmd ; cmd = cmd->next){
+				if(cmd->serial_number == 0){
+					continue;
+				}
+				cmd->result = (DID_OK << 16) | (QUEUE_FULL <<1);
+				cmd->scsi_done(cmd);
+			}
+			d = d->next;
+		}
+	}
+}
+
+
+/*============================================================================
+ *  Routines from i2o subsystem
+ *============================================================================
+ */
+
+
+
+/*
+ *	Bring an I2O controller into HOLD state. See the spec.
+ */
+static int adpt_i2o_activate_hba(adpt_hba* pHba)
+{
+	int rcode;
+
+	if(pHba->initialized ) {
+		if (adpt_i2o_status_get(pHba) < 0) {
+			if((rcode = adpt_i2o_reset_hba(pHba) != 0)){
+				printk(KERN_WARNING"%s: Could NOT reset.\n", pHba->name);
+				return rcode;
+			}
+			if (adpt_i2o_status_get(pHba) < 0) {
+				printk(KERN_INFO "HBA not responding.\n");
+				return -1;
+			}
+		}
+
+		if(pHba->status_block->iop_state == ADAPTER_STATE_FAULTED) {
+			printk(KERN_CRIT "%s: hardware fault\n", pHba->name);
+			return -1;
+		}
+
+		if (pHba->status_block->iop_state == ADAPTER_STATE_READY ||
+		    pHba->status_block->iop_state == ADAPTER_STATE_OPERATIONAL ||
+		    pHba->status_block->iop_state == ADAPTER_STATE_HOLD ||
+		    pHba->status_block->iop_state == ADAPTER_STATE_FAILED) {
+			adpt_i2o_reset_hba(pHba);			
+			if (adpt_i2o_status_get(pHba) < 0 || pHba->status_block->iop_state != ADAPTER_STATE_RESET) {
+				printk(KERN_ERR "%s: Failed to initialize.\n", pHba->name);
+				return -1;
+			}
+		}
+	} else {
+		if((rcode = adpt_i2o_reset_hba(pHba) != 0)){
+			printk(KERN_WARNING"%s: Could NOT reset.\n", pHba->name);
+			return rcode;
+		}
+
+	}
+
+	if (adpt_i2o_init_outbound_q(pHba) < 0) {
+		return -1;
+	}
+
+	/* In HOLD state */
+	
+	if (adpt_i2o_hrt_get(pHba) < 0) {
+		return -1;
+	}
+
+	return 0;
+}
+
+/*
+ *	Bring a controller online into OPERATIONAL state. 
+ */
+ 
+static int adpt_i2o_online_hba(adpt_hba* pHba)
+{
+	if (adpt_i2o_systab_send(pHba) < 0) {
+		adpt_i2o_delete_hba(pHba);
+		return -1;
+	}
+	/* In READY state */
+
+	if (adpt_i2o_enable_hba(pHba) < 0) {
+		adpt_i2o_delete_hba(pHba);
+		return -1;
+	}
+
+	/* In OPERATIONAL state  */
+	return 0;
+}
+
+static s32 adpt_send_nop(adpt_hba*pHba,u32 m)
+{
+	u32 *msg;
+	ulong timeout = jiffies + 5*HZ;
+
+	while(m == EMPTY_QUEUE){
+		rmb();
+		m = readl(pHba->post_port);
+		if(m != EMPTY_QUEUE){
+			break;
+		}
+		if(time_after(jiffies,timeout)){
+			printk(KERN_ERR "%s: Timeout waiting for message frame!\n",pHba->name);
+			return 2;
+		}
+	}
+	msg = (u32*)(pHba->msg_addr_virt + m);
+	writel( THREE_WORD_MSG_SIZE | SGL_OFFSET_0,&msg[0]);
+	writel( I2O_CMD_UTIL_NOP << 24 | HOST_TID << 12 | 0,&msg[1]);
+	writel( 0,&msg[2]);
+	wmb();
+
+	writel(m, pHba->post_port);
+	wmb();
+	return 0;
+}
+
+static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
+{
+	u8 *status;
+	u32 *msg = NULL;
+	int i;
+	ulong timeout = jiffies + TMOUT_INITOUTBOUND*HZ;
+	u32* ptr;
+	u32 outbound_frame;  // This had to be a 32 bit address
+	u32 m;
+
+	do {
+		rmb();
+		m = readl(pHba->post_port);
+		if (m != EMPTY_QUEUE) {
+			break;
+		}
+
+		if(time_after(jiffies,timeout)){
+			printk(KERN_WARNING"%s: Timeout waiting for message frame\n",pHba->name);
+			return -ETIMEDOUT;
+		}
+	} while(m == EMPTY_QUEUE);
+
+	msg=(u32 *)(pHba->msg_addr_virt+m);
+
+	status = kmalloc(4,GFP_KERNEL|ADDR32);
+	if (status==NULL) {
+		adpt_send_nop(pHba, m);
+		printk(KERN_WARNING"%s: IOP reset failed - no free memory.\n",
+			pHba->name);
+		return -ENOMEM;
+	}
+	memset(status, 0, 4);
+
+	writel(EIGHT_WORD_MSG_SIZE| SGL_OFFSET_6, &msg[0]);
+	writel(I2O_CMD_OUTBOUND_INIT<<24 | HOST_TID<<12 | ADAPTER_TID, &msg[1]);
+	writel(0, &msg[2]);
+	writel(0x0106, &msg[3]);	/* Transaction context */
+	writel(4096, &msg[4]);		/* Host page frame size */
+	writel((REPLY_FRAME_SIZE)<<16|0x80, &msg[5]);	/* Outbound msg frame size and Initcode */
+	writel(0xD0000004, &msg[6]);		/* Simple SG LE, EOB */
+	writel(virt_to_bus(status), &msg[7]);
+
+	writel(m, pHba->post_port);
+	wmb();
+
+	// Wait for the reply status to come back
+	do {
+		if (*status) {
+			if (*status != 0x01 /*I2O_EXEC_OUTBOUND_INIT_IN_PROGRESS*/) {
+				break;
+			}
+		}
+		rmb();
+		if(time_after(jiffies,timeout)){
+			printk(KERN_WARNING"%s: Timeout Initializing\n",pHba->name);
+			kfree((void*)status);
+			return -ETIMEDOUT;
+		}
+	} while (1);
+
+	// If the command was successful, fill the fifo with our reply
+	// message packets
+	if(*status != 0x04 /*I2O_EXEC_OUTBOUND_INIT_COMPLETE*/) {
+		kfree((void*)status);
+		return -2;
+	}
+	kfree((void*)status);
+
+	if(pHba->reply_pool != NULL){
+		kfree(pHba->reply_pool);
+	}
+
+	pHba->reply_pool = (u32*)kmalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32);
+	if(!pHba->reply_pool){
+		printk(KERN_ERR"%s: Could not allocate reply pool\n",pHba->name);
+		return -1;
+	}
+	memset(pHba->reply_pool, 0 , pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4);
+
+	ptr = pHba->reply_pool;
+	for(i = 0; i < pHba->reply_fifo_size; i++) {
+		outbound_frame = (u32)virt_to_bus(ptr);
+		writel(outbound_frame, pHba->reply_port);
+		wmb();
+		ptr +=  REPLY_FRAME_SIZE;
+	}
+	adpt_i2o_status_get(pHba);
+	return 0;
+}
+
+
+/*
+ * I2O System Table.  Contains informatioi about
+ * all the IOPs in the system.  Used to inform IOPs
+ * about each other's existence.
+ *
+ * sys_tbl_ver is the CurrentChangeIndicator that is
+ * used by IOPs to track changes.
+ */
+
+
+
+static s32 adpt_i2o_status_get(adpt_hba* pHba)
+{
+	ulong timeout;
+	u32 m;
+	u32 *msg;
+	u8 *status_block=NULL;
+	ulong status_block_bus;
+
+	if(pHba->status_block == NULL) {
+		pHba->status_block = (i2o_status_block*)
+			kmalloc(sizeof(i2o_status_block),GFP_KERNEL|ADDR32);
+		if(pHba->status_block == NULL) {
+			printk(KERN_ERR
+			"dpti%d: Get Status Block failed; Out of memory. \n", 
+			pHba->unit);
+			return -ENOMEM;
+		}
+	}
+	memset(pHba->status_block, 0, sizeof(i2o_status_block));
+	status_block = (u8*)(pHba->status_block);
+	status_block_bus = virt_to_bus(pHba->status_block);
+	timeout = jiffies+TMOUT_GETSTATUS*HZ;
+	do {
+		rmb();
+		m = readl(pHba->post_port);
+		if (m != EMPTY_QUEUE) {
+			break;
+		}
+		if(time_after(jiffies,timeout)){
+			printk(KERN_ERR "%s: Timeout waiting for message !\n",
+					pHba->name);
+			return -ETIMEDOUT;
+		}
+	} while(m==EMPTY_QUEUE);
+
+	
+	msg=(u32*)(pHba->msg_addr_virt+m);
+
+	writel(NINE_WORD_MSG_SIZE|SGL_OFFSET_0, &msg[0]);
+	writel(I2O_CMD_STATUS_GET<<24|HOST_TID<<12|ADAPTER_TID, &msg[1]);
+	writel(1, &msg[2]);
+	writel(0, &msg[3]);
+	writel(0, &msg[4]);
+	writel(0, &msg[5]);
+	writel(((u32)status_block_bus)&0xffffffff, &msg[6]);
+	writel(0, &msg[7]);
+	writel(sizeof(i2o_status_block), &msg[8]); // 88 bytes
+
+	//post message
+	writel(m, pHba->post_port);
+	wmb();
+
+	while(status_block[87]!=0xff){
+		if(time_after(jiffies,timeout)){
+			printk(KERN_ERR"dpti%d: Get status timeout.\n",
+				pHba->unit);
+			return -ETIMEDOUT;
+		}
+		rmb();
+	}
+
+	// Set up our number of outbound and inbound messages
+	pHba->post_fifo_size = pHba->status_block->max_inbound_frames;
+	if (pHba->post_fifo_size > MAX_TO_IOP_MESSAGES) {
+		pHba->post_fifo_size = MAX_TO_IOP_MESSAGES;
+	}
+
+	pHba->reply_fifo_size = pHba->status_block->max_outbound_frames;
+	if (pHba->reply_fifo_size > MAX_FROM_IOP_MESSAGES) {
+		pHba->reply_fifo_size = MAX_FROM_IOP_MESSAGES;
+	}
+
+	// Calculate the Scatter Gather list size
+	pHba->sg_tablesize = (pHba->status_block->inbound_frame_size * 4 -40)/ sizeof(struct sg_simple_element);
+	if (pHba->sg_tablesize > SG_LIST_ELEMENTS) {
+		pHba->sg_tablesize = SG_LIST_ELEMENTS;
+	}
+
+
+#ifdef DEBUG
+	printk("dpti%d: State = ",pHba->unit);
+	switch(pHba->status_block->iop_state) {
+		case 0x01:
+			printk("INIT\n");
+			break;
+		case 0x02:
+			printk("RESET\n");
+			break;
+		case 0x04:
+			printk("HOLD\n");
+			break;
+		case 0x05:
+			printk("READY\n");
+			break;
+		case 0x08:
+			printk("OPERATIONAL\n");
+			break;
+		case 0x10:
+			printk("FAILED\n");
+			break;
+		case 0x11:
+			printk("FAULTED\n");
+			break;
+		default:
+			printk("%x (unknown!!)\n",pHba->status_block->iop_state);
+	}
+#endif
+	return 0;
+}
+
+/*
+ * Get the IOP's Logical Configuratioi Table
+ */
+static int adpt_i2o_lct_get(adpt_hba* pHba)
+{
+	u32 msg[8];
+	int ret;
+	u32 buf[16];
+
+	if ((pHba->lct_size == 0) || (pHba->lct == NULL)){
+		pHba->lct_size = pHba->status_block->expected_lct_size;
+	}
+	do {
+		if (pHba->lct == NULL) {
+			pHba->lct = kmalloc(pHba->lct_size, GFP_KERNEL|ADDR32);
+			if(pHba->lct == NULL) {
+				printk(KERN_CRIT "%s: Lct Get failed. Out of memory.\n",
+					pHba->name);
+				return -ENOMEM;
+			}
+		}
+		memset(pHba->lct, 0, pHba->lct_size);
+
+		msg[0] = EIGHT_WORD_MSG_SIZE|SGL_OFFSET_6;
+		msg[1] = I2O_CMD_LCT_NOTIFY<<24 | HOST_TID<<12 | ADAPTER_TID;
+		msg[2] = 0;
+		msg[3] = 0;
+		msg[4] = 0xFFFFFFFF;	/* All devices */
+		msg[5] = 0x00000000;	/* Report now */
+		msg[6] = 0xD0000000|pHba->lct_size;
+		msg[7] = virt_to_bus(pHba->lct);
+
+		if ((ret=adpt_i2o_post_wait(pHba, msg, sizeof(msg), 360))) {
+			printk(KERN_ERR "%s: LCT Get failed (status=%#10x.\n", 
+				pHba->name, ret);	
+			printk(KERN_ERR"Adaptec: Error Reading Hardware.\n");
+			return ret;
+		}
+
+		if ((pHba->lct->table_size << 2) > pHba->lct_size) {
+			pHba->lct_size = pHba->lct->table_size << 2;
+			kfree(pHba->lct);
+			pHba->lct = NULL;
+		}
+	} while (pHba->lct == NULL);
+
+	PDEBUG("%s: Hardware resource table read.\n", pHba->name);
+
+
+	// I2O_DPT_EXEC_IOP_BUFFERS_GROUP_NO;
+	if(adpt_i2o_query_scalar(pHba, 0 , 0x8000, -1, buf, sizeof(buf))>=0) {
+		pHba->FwDebugBufferSize = buf[1];
+		pHba->FwDebugBuffer_P    = pHba->base_addr_virt + buf[0];
+		pHba->FwDebugFlags_P     = pHba->FwDebugBuffer_P + FW_DEBUG_FLAGS_OFFSET;
+		pHba->FwDebugBLEDvalue_P = pHba->FwDebugBuffer_P + FW_DEBUG_BLED_OFFSET;
+		pHba->FwDebugBLEDflag_P  = pHba->FwDebugBLEDvalue_P + 1;
+		pHba->FwDebugStrLength_P = pHba->FwDebugBuffer_P + FW_DEBUG_STR_LENGTH_OFFSET;
+		pHba->FwDebugBuffer_P += buf[2]; 
+		pHba->FwDebugFlags = 0;
+	}
+
+	return 0;
+}
+
+static int adpt_i2o_build_sys_table(void)
+{
+	adpt_hba* pHba = NULL;
+	int count = 0;
+
+	sys_tbl_len = sizeof(struct i2o_sys_tbl) +	// Header + IOPs
+				(hba_count) * sizeof(struct i2o_sys_tbl_entry);
+
+	if(sys_tbl)
+		kfree(sys_tbl);
+
+	sys_tbl = kmalloc(sys_tbl_len, GFP_KERNEL|ADDR32);
+	if(!sys_tbl) {
+		printk(KERN_WARNING "SysTab Set failed. Out of memory.\n");	
+		return -ENOMEM;
+	}
+	memset(sys_tbl, 0, sys_tbl_len);
+
+	sys_tbl->num_entries = hba_count;
+	sys_tbl->version = I2OVERSION;
+	sys_tbl->change_ind = sys_tbl_ind++;
+
+	for(pHba = hba_chain; pHba; pHba = pHba->next) {
+		// Get updated Status Block so we have the latest informatioi
+		if (adpt_i2o_status_get(pHba)) {
+			sys_tbl->num_entries--;
+			continue; // try next one	
+		}
+
+		sys_tbl->iops[count].org_id = pHba->status_block->org_id;
+		sys_tbl->iops[count].iop_id = pHba->unit + 2;
+		sys_tbl->iops[count].seg_num = 0;
+		sys_tbl->iops[count].i2o_version = pHba->status_block->i2o_version;
+		sys_tbl->iops[count].iop_state = pHba->status_block->iop_state;
+		sys_tbl->iops[count].msg_type = pHba->status_block->msg_type;
+		sys_tbl->iops[count].frame_size = pHba->status_block->inbound_frame_size;
+		sys_tbl->iops[count].last_changed = sys_tbl_ind - 1; // ??
+		sys_tbl->iops[count].iop_capabilities = pHba->status_block->iop_capabilities;
+		sys_tbl->iops[count].inbound_low = (u32)virt_to_bus((void*)pHba->post_port);
+		sys_tbl->iops[count].inbound_high = (u32)((u64)virt_to_bus((void*)pHba->post_port)>>32);
+
+		count++;
+	}
+
+#ifdef DEBUG
+{
+	u32 *table = (u32*)sys_tbl;
+	printk(KERN_DEBUG"sys_tbl_len=%d in 32bit words\n",(sys_tbl_len >>2));
+	for(count = 0; count < (sys_tbl_len >>2); count++) {
+		printk(KERN_INFO "sys_tbl[%d] = %0#10x\n", 
+			count, table[count]);
+	}
+}
+#endif
+
+	return 0;
+}
+
+
+/*
+ *	 Dump the informatioi block associated with a given unit (TID)
+ */
+ 
+static void adpt_i2o_report_hba_unit(adpt_hba* pHba, struct i2o_device *d)
+{
+	char buf[64];
+	int unit = d->lct_data.tid;
+
+	printk(KERN_INFO "TID %3.3d ", unit);
+
+	if(adpt_i2o_query_scalar(pHba, unit, 0xF100, 3, buf, 16)>=0)
+	{
+		buf[16]=0;
+		printk(" Vendor: %-12.12s", buf);
+	}
+	if(adpt_i2o_query_scalar(pHba, unit, 0xF100, 4, buf, 16)>=0)
+	{
+		buf[16]=0;
+		printk(" Device: %-12.12s", buf);
+	}
+	if(adpt_i2o_query_scalar(pHba, unit, 0xF100, 6, buf, 8)>=0)
+	{
+		buf[8]=0;
+		printk(" Rev: %-12.12s\n", buf);
+	}
+#ifdef DEBUG
+	 printk(KERN_INFO "\tClass: %.21s\n", adpt_i2o_get_class_name(d->lct_data.class_id));
+	 printk(KERN_INFO "\tSubclass: 0x%04X\n", d->lct_data.sub_class);
+	 printk(KERN_INFO "\tFlags: ");
+
+	 if(d->lct_data.device_flags&(1<<0))
+		  printk("C");	     // ConfigDialog requested
+	 if(d->lct_data.device_flags&(1<<1))
+		  printk("U");	     // Multi-user capable
+	 if(!(d->lct_data.device_flags&(1<<4)))
+		  printk("P");	     // Peer service enabled!
+	 if(!(d->lct_data.device_flags&(1<<5)))
+		  printk("M");	     // Mgmt service enabled!
+	 printk("\n");
+#endif
+}
+
+#ifdef DEBUG
+/*
+ *	Do i2o class name lookup
+ */
+static const char *adpt_i2o_get_class_name(int class)
+{
+	int idx = 16;
+	static char *i2o_class_name[] = {
+		"Executive",
+		"Device Driver Module",
+		"Block Device",
+		"Tape Device",
+		"LAN Interface",
+		"WAN Interface",
+		"Fibre Channel Port",
+		"Fibre Channel Device",
+		"SCSI Device",
+		"ATE Port",
+		"ATE Device",
+		"Floppy Controller",
+		"Floppy Device",
+		"Secondary Bus Port",
+		"Peer Transport Agent",
+		"Peer Transport",
+		"Unknown"
+	};
+	
+	switch(class&0xFFF) {
+	case I2O_CLASS_EXECUTIVE:
+		idx = 0; break;
+	case I2O_CLASS_DDM:
+		idx = 1; break;
+	case I2O_CLASS_RANDOM_BLOCK_STORAGE:
+		idx = 2; break;
+	case I2O_CLASS_SEQUENTIAL_STORAGE:
+		idx = 3; break;
+	case I2O_CLASS_LAN:
+		idx = 4; break;
+	case I2O_CLASS_WAN:
+		idx = 5; break;
+	case I2O_CLASS_FIBRE_CHANNEL_PORT:
+		idx = 6; break;
+	case I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL:
+		idx = 7; break;
+	case I2O_CLASS_SCSI_PERIPHERAL:
+		idx = 8; break;
+	case I2O_CLASS_ATE_PORT:
+		idx = 9; break;
+	case I2O_CLASS_ATE_PERIPHERAL:
+		idx = 10; break;
+	case I2O_CLASS_FLOPPY_CONTROLLER:
+		idx = 11; break;
+	case I2O_CLASS_FLOPPY_DEVICE:
+		idx = 12; break;
+	case I2O_CLASS_BUS_ADAPTER_PORT:
+		idx = 13; break;
+	case I2O_CLASS_PEER_TRANSPORT_AGENT:
+		idx = 14; break;
+	case I2O_CLASS_PEER_TRANSPORT:
+		idx = 15; break;
+	}
+	return i2o_class_name[idx];
+}
+#endif
+
+
+static s32 adpt_i2o_hrt_get(adpt_hba* pHba)
+{
+	u32 msg[6];
+	int ret, size = sizeof(i2o_hrt);
+
+	do {
+		if (pHba->hrt == NULL) {
+			pHba->hrt=kmalloc(size, GFP_KERNEL|ADDR32);
+			if (pHba->hrt == NULL) {
+				printk(KERN_CRIT "%s: Hrt Get failed; Out of memory.\n", pHba->name);
+				return -ENOMEM;
+			}
+		}
+
+		msg[0]= SIX_WORD_MSG_SIZE| SGL_OFFSET_4;
+		msg[1]= I2O_CMD_HRT_GET<<24 | HOST_TID<<12 | ADAPTER_TID;
+		msg[2]= 0;
+		msg[3]= 0;
+		msg[4]= (0xD0000000 | size);    /* Simple transaction */
+		msg[5]= virt_to_bus(pHba->hrt);   /* Dump it here */
+
+		if ((ret = adpt_i2o_post_wait(pHba, msg, sizeof(msg),20))) {
+			printk(KERN_ERR "%s: Unable to get HRT (status=%#10x)\n", pHba->name, ret);
+			return ret;
+		}
+
+		if (pHba->hrt->num_entries * pHba->hrt->entry_len << 2 > size) {
+			size = pHba->hrt->num_entries * pHba->hrt->entry_len << 2;
+			kfree(pHba->hrt);
+			pHba->hrt = NULL;
+		}
+	} while(pHba->hrt == NULL);
+	return 0;
+}                                                                                                                                       
+
+/*
+ *	 Query one scalar group value or a whole scalar group.
+ */		    	
+static int adpt_i2o_query_scalar(adpt_hba* pHba, int tid, 
+			int group, int field, void *buf, int buflen)
+{
+	u16 opblk[] = { 1, 0, I2O_PARAMS_FIELD_GET, group, 1, field };
+	u8  resblk[8+buflen]; /* 8 bytes for header */
+	int size;
+
+	if (field == -1)  		/* whole group */
+			opblk[4] = -1;
+
+	size = adpt_i2o_issue_params(I2O_CMD_UTIL_PARAMS_GET, pHba, tid, 
+		opblk, sizeof(opblk), resblk, sizeof(resblk));
+			
+	memcpy(buf, resblk+8, buflen);  /* cut off header */
+
+	if (size < 0)
+		return size;	
+
+	return buflen;
+}
+
+
+/*	Issue UTIL_PARAMS_GET or UTIL_PARAMS_SET
+ *
+ *	This function can be used for all UtilParamsGet/Set operatiois.
+ *	The OperatioiBlock is given in opblk-buffer, 
+ *	and results are returned in resblk-buffer.
+ *	Note that the minimum sized resblk is 8 bytes and contains
+ *	ResultCount, ErrorInfoSize, BlockStatus and BlockSize.
+ */
+static int adpt_i2o_issue_params(int cmd, adpt_hba* pHba, int tid, 
+		  void *opblk, int oplen, void *resblk, int reslen)
+{
+	u32 msg[9]; 
+	u32 *res = (u32 *)resblk;
+	int wait_status;
+
+	msg[0] = NINE_WORD_MSG_SIZE | SGL_OFFSET_5;
+	msg[1] = cmd << 24 | HOST_TID << 12 | tid; 
+	msg[2] = 0;
+	msg[3] = 0;
+	msg[4] = 0;
+	msg[5] = 0x54000000 | oplen;	/* OperatioiBlock */
+	msg[6] = virt_to_bus(opblk);
+	msg[7] = 0xD0000000 | reslen;	/* ResultBlock */
+	msg[8] = virt_to_bus(resblk);
+
+	if ((wait_status = adpt_i2o_post_wait(pHba, msg, sizeof(msg), 20))) {
+   		return wait_status; 	/* -DetailedStatus */
+	}
+
+	if (res[1]&0x00FF0000) { 	/* BlockStatus != SUCCESS */
+		printk(KERN_WARNING "%s: %s - Error:\n  ErrorInfoSize = 0x%02x, "
+			"BlockStatus = 0x%02x, BlockSize = 0x%04x\n",
+			pHba->name,
+			(cmd == I2O_CMD_UTIL_PARAMS_SET) ? "PARAMS_SET"
+							 : "PARAMS_GET",   
+			res[1]>>24, (res[1]>>16)&0xFF, res[1]&0xFFFF);
+		return -((res[1] >> 16) & 0xFF); /* -BlockStatus */
+	}
+
+	 return 4 + ((res[1] & 0x0000FFFF) << 2); /* bytes used in resblk */ 
+}
+
+
+static s32 adpt_i2o_quiesce_hba(adpt_hba* pHba)
+{
+	u32 msg[4];
+	int ret;
+
+	adpt_i2o_status_get(pHba);
+
+	/* SysQuiesce discarded if IOP not in READY or OPERATIONAL state */
+
+	if((pHba->status_block->iop_state != ADAPTER_STATE_READY) &&
+   	   (pHba->status_block->iop_state != ADAPTER_STATE_OPERATIONAL)){
+		return 0;
+	}
+
+	msg[0] = FOUR_WORD_MSG_SIZE|SGL_OFFSET_0;
+	msg[1] = I2O_CMD_SYS_QUIESCE<<24|HOST_TID<<12|ADAPTER_TID;
+	msg[2] = 0;
+	msg[3] = 0;
+
+	if((ret = adpt_i2o_post_wait(pHba, msg, sizeof(msg), 240))) {
+		printk(KERN_INFO"dpti%d: Unable to quiesce (status=%#x).\n",
+				pHba->unit, -ret);
+	} else {
+		printk(KERN_INFO"dpti%d: Quiesced.\n",pHba->unit);
+	}
+
+	adpt_i2o_status_get(pHba);
+	return ret;
+}
+
+
+/* 
+ * Enable IOP. Allows the IOP to resume external operatiois.
+ */
+static int adpt_i2o_enable_hba(adpt_hba* pHba)
+{
+	u32 msg[4];
+	int ret;
+	
+	adpt_i2o_status_get(pHba);
+	if(!pHba->status_block){
+		return -ENOMEM;
+	}
+	/* Enable only allowed on READY state */
+	if(pHba->status_block->iop_state == ADAPTER_STATE_OPERATIONAL)
+		return 0;
+
+	if(pHba->status_block->iop_state != ADAPTER_STATE_READY)
+		return -EINVAL;
+
+	msg[0]=FOUR_WORD_MSG_SIZE|SGL_OFFSET_0;
+	msg[1]=I2O_CMD_SYS_ENABLE<<24|HOST_TID<<12|ADAPTER_TID;
+	msg[2]= 0;
+	msg[3]= 0;
+
+	if ((ret = adpt_i2o_post_wait(pHba, msg, sizeof(msg), 240))) {
+		printk(KERN_WARNING"%s: Could not enable (status=%#10x).\n", 
+			pHba->name, ret);
+	} else {
+		PDEBUG("%s: Enabled.\n", pHba->name);
+	}
+
+	adpt_i2o_status_get(pHba);
+	return ret;
+}
+
+
+static int adpt_i2o_systab_send(adpt_hba* pHba)
+{
+	 u32 msg[12];
+	 int ret;
+
+	msg[0] = I2O_MESSAGE_SIZE(12) | SGL_OFFSET_6;
+	msg[1] = I2O_CMD_SYS_TAB_SET<<24 | HOST_TID<<12 | ADAPTER_TID;
+	msg[2] = 0;
+	msg[3] = 0;
+	msg[4] = (0<<16) | ((pHba->unit+2) << 12); /* Host 0 IOP ID (unit + 2) */
+	msg[5] = 0;				   /* Segment 0 */
+
+	/* 
+	 * Provide three SGL-elements:
+	 * System table (SysTab), Private memory space declaratioi and 
+	 * Private i/o space declaratioi  
+	 */
+	msg[6] = 0x54000000 | sys_tbl_len;
+	msg[7] = virt_to_phys(sys_tbl);
+	msg[8] = 0x54000000 | 0;
+	msg[9] = 0;
+	msg[10] = 0xD4000000 | 0;
+	msg[11] = 0;
+
+	if ((ret=adpt_i2o_post_wait(pHba, msg, sizeof(msg), 120))) {
+		printk(KERN_INFO "%s: Unable to set SysTab (status=%#10x).\n", 
+			pHba->name, ret);
+	}
+#ifdef DEBUG
+	else {
+		PINFO("%s: SysTab set.\n", pHba->name);
+	}
+#endif
+
+	return ret;	
+ }
+
+
+/*============================================================================
+ *
+ *============================================================================
+ */
+
+
+#ifdef UARTDELAY 
+
+static static void adpt_delay(int millisec)
+{
+	int i;
+	for (i = 0; i < millisec; i++) {
+		udelay(1000);	/* delay for one millisecond */
+	}
+}
+
+#endif
+
+static Scsi_Host_Template driver_template = DPT_I2O;
+#include "scsi_module.c"
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/dpti.h linux/drivers/scsi/dpti.h
--- v2.4.9/linux/drivers/scsi/dpti.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/dpti.h	Fri Sep  7 09:28:38 2001
@@ -0,0 +1,403 @@
+/***************************************************************************
+                          dpti.h  -  descriptioi
+                             -------------------
+    begin                : Thu Sep 7 2000
+    copyright            : (C) 2001 by Adaptec
+    email                : deanna_bonds@adaptec.com
+
+    See README.dpti for history, notes, license info, and credits
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   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 Foundatioi; either version 2 of the License, or     *
+ *   (at your optioi) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef _DPT_H
+#define _DPT_H
+
+#ifndef LINUX_VERSION_CODE
+#include <linux/version.h>
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,00)
+#define MAX_TO_IOP_MESSAGES   (210)
+#else
+#define MAX_TO_IOP_MESSAGES   (255)
+#endif
+#define MAX_FROM_IOP_MESSAGES (255)
+
+
+/*
+ * SCSI interface function Prototypes
+ */
+
+static int adpt_proc_info(char *buffer, char **start, off_t offset,
+		  int length, int inode, int inout);
+static int adpt_detect(Scsi_Host_Template * sht);
+static int adpt_queue(Scsi_Cmnd * cmd, void (*cmdcomplete) (Scsi_Cmnd *));
+static int adpt_abort(Scsi_Cmnd * cmd);
+static int adpt_reset(Scsi_Cmnd* cmd);
+static int adpt_release(struct Scsi_Host *host);
+
+static const char *adpt_info(struct Scsi_Host *pSHost);
+static int adpt_bios_param(Disk * disk, kdev_t dev, int geom[]);
+
+static int adpt_bus_reset(Scsi_Cmnd* cmd);
+static int adpt_device_reset(Scsi_Cmnd* cmd);
+
+
+/*
+ * Scsi_Host_Template (see hosts.h) 
+ */
+
+#define DPT_DRIVER_NAME	"Adaptec I2O RAID"
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,00)
+#define DPT_I2O { \
+	proc_info: adpt_proc_info,					\
+	detect: adpt_detect,						\
+	release: adpt_release,						\
+	info: adpt_info,						\
+	queuecommand: adpt_queue,					\
+	eh_abort_handler: adpt_abort,					\
+	eh_device_reset_handler: adpt_device_reset,			\
+	eh_bus_reset_handler: adpt_bus_reset,				\
+	eh_host_reset_handler: adpt_reset,				\
+	bios_param: adpt_bios_param,					\
+	can_queue: MAX_TO_IOP_MESSAGES ,/* max simultaneous cmds      */\
+	this_id: 7,			/* scsi id of host adapter    */\
+	sg_tablesize: 0,		/* max scatter-gather cmds    */\
+	cmd_per_lun: 256,		/* cmds per lun (linked cmds) */\
+	use_clustering: ENABLE_CLUSTERING,				\
+	use_new_eh_code: 1						\
+}
+
+#else				/* KERNEL_VERSION > 2.2.16 */
+
+#define DPT_I2O { \
+	proc_info: adpt_proc_info,					\
+	detect: adpt_detect,						\
+	release: adpt_release,						\
+	info: adpt_info,						\
+	queuecommand: adpt_queue,					\
+	eh_abort_handler: adpt_abort,					\
+	eh_device_reset_handler: adpt_device_reset,			\
+	eh_bus_reset_handler: adpt_bus_reset,				\
+	eh_host_reset_handler: adpt_reset,				\
+	bios_param: adpt_bios_param,					\
+	can_queue: MAX_TO_IOP_MESSAGES,	/* max simultaneous cmds      */\
+	this_id: 7,			/* scsi id of host adapter    */\
+	sg_tablesize: 0,		/* max scatter-gather cmds    */\
+	cmd_per_lun: 256,		/* cmds per lun (linked cmds) */\
+	use_clustering: ENABLE_CLUSTERING,				\
+	use_new_eh_code: 1,						\
+	proc_name: "dpt_i2o"	/* this is the name of our proc node*/	\
+}
+#endif
+
+#ifndef HOSTS_C
+
+#include "dpt/sys_info.h"
+#include <linux/wait.h>
+#include "dpt/dpti_i2o.h"
+#include "dpt/dpti_ioctl.h"
+
+#define DPT_I2O_VERSION "2.4 Build 5"
+#define DPT_VERSION     2
+#define DPT_REVISION    '4'
+#define DPT_SUBREVISION '5'
+#define DPT_BETA	""
+#define DPT_MONTH      8 
+#define DPT_DAY        7
+#define DPT_YEAR        (2001-1980)
+
+#define DPT_DRIVER	"dpt_i2o"
+#define DPTI_I2O_MAJOR	(151)
+#define DPT_ORGANIZATION_ID (0x1B)        /* For Private Messages */
+#define DPTI_MAX_HBA	(16)
+#define MAX_CHANNEL     (5)	// Maximum Channel # Supported
+#define MAX_ID        	(128)	// Maximum Target ID Supported
+
+/* Sizes in 4 byte words */
+#define REPLY_FRAME_SIZE  (17)
+#define MAX_MESSAGE_SIZE  (128)
+#define SG_LIST_ELEMENTS  (56)
+
+#define EMPTY_QUEUE           0xffffffff
+#define I2O_INTERRUPT_PENDING_B   (0x08)
+
+#define PCI_DPT_VENDOR_ID         (0x1044)	// DPT PCI Vendor ID
+#define PCI_DPT_DEVICE_ID         (0xA501)	// DPT PCI I2O Device ID
+#define PCI_DPT_RAPTOR_DEVICE_ID  (0xA511)	
+
+//#define REBOOT_NOTIFIER 1
+/* Debugging macro from Linux Device Drivers - Rubini */
+#undef PDEBUG
+#ifdef DEBUG
+//TODO add debug level switch
+#  define PDEBUG(fmt, args...)  printk(KERN_DEBUG "dpti: " fmt, ##args)
+#  define PDEBUGV(fmt, args...) printk(KERN_DEBUG "dpti: " fmt, ##args)
+#else
+# define PDEBUG(fmt, args...) /* not debugging: nothing */
+# define PDEBUGV(fmt, args...) /* not debugging: nothing */
+#endif
+
+#define PERROR(fmt, args...) printk(KERN_ERR fmt, ##args)
+#define PWARN(fmt, args...) printk(KERN_WARNING fmt, ##args)
+#define PINFO(fmt, args...) printk(KERN_INFO fmt, ##args)
+#define PCRIT(fmt, args...) printk(KERN_CRIT fmt, ##args)
+
+#define SHUTDOWN_SIGS	(sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGTERM))
+
+// Command timeouts
+#define FOREVER			(0)
+#define TMOUT_INQUIRY 		(20)
+#define TMOUT_FLUSH		(360/45)
+#define TMOUT_ABORT		(30)
+#define TMOUT_SCSI		(300)
+#define TMOUT_IOPRESET		(360)
+#define TMOUT_GETSTATUS		(15)
+#define TMOUT_INITOUTBOUND	(15)
+#define TMOUT_LCT		(360)
+
+
+#define I2O_SCSI_DEVICE_DSC_MASK                0x00FF
+
+#define I2O_DETAIL_STATUS_UNSUPPORTED_FUNCTION  0x000A
+
+#define I2O_SCSI_DSC_MASK                   0xFF00
+#define I2O_SCSI_DSC_SUCCESS                0x0000
+#define I2O_SCSI_DSC_REQUEST_ABORTED        0x0200
+#define I2O_SCSI_DSC_UNABLE_TO_ABORT        0x0300
+#define I2O_SCSI_DSC_COMPLETE_WITH_ERROR    0x0400
+#define I2O_SCSI_DSC_ADAPTER_BUSY           0x0500
+#define I2O_SCSI_DSC_REQUEST_INVALID        0x0600
+#define I2O_SCSI_DSC_PATH_INVALID           0x0700
+#define I2O_SCSI_DSC_DEVICE_NOT_PRESENT     0x0800
+#define I2O_SCSI_DSC_UNABLE_TO_TERMINATE    0x0900
+#define I2O_SCSI_DSC_SELECTION_TIMEOUT      0x0A00
+#define I2O_SCSI_DSC_COMMAND_TIMEOUT        0x0B00
+#define I2O_SCSI_DSC_MR_MESSAGE_RECEIVED    0x0D00
+#define I2O_SCSI_DSC_SCSI_BUS_RESET         0x0E00
+#define I2O_SCSI_DSC_PARITY_ERROR_FAILURE   0x0F00
+#define I2O_SCSI_DSC_AUTOSENSE_FAILED       0x1000
+#define I2O_SCSI_DSC_NO_ADAPTER             0x1100
+#define I2O_SCSI_DSC_DATA_OVERRUN           0x1200
+#define I2O_SCSI_DSC_UNEXPECTED_BUS_FREE    0x1300
+#define I2O_SCSI_DSC_SEQUENCE_FAILURE       0x1400
+#define I2O_SCSI_DSC_REQUEST_LENGTH_ERROR   0x1500
+#define I2O_SCSI_DSC_PROVIDE_FAILURE        0x1600
+#define I2O_SCSI_DSC_BDR_MESSAGE_SENT       0x1700
+#define I2O_SCSI_DSC_REQUEST_TERMINATED     0x1800
+#define I2O_SCSI_DSC_IDE_MESSAGE_SENT       0x3300
+#define I2O_SCSI_DSC_RESOURCE_UNAVAILABLE   0x3400
+#define I2O_SCSI_DSC_UNACKNOWLEDGED_EVENT   0x3500
+#define I2O_SCSI_DSC_MESSAGE_RECEIVED       0x3600
+#define I2O_SCSI_DSC_INVALID_CDB            0x3700
+#define I2O_SCSI_DSC_LUN_INVALID            0x3800
+#define I2O_SCSI_DSC_SCSI_TID_INVALID       0x3900
+#define I2O_SCSI_DSC_FUNCTION_UNAVAILABLE   0x3A00
+#define I2O_SCSI_DSC_NO_NEXUS               0x3B00
+#define I2O_SCSI_DSC_SCSI_IID_INVALID       0x3C00
+#define I2O_SCSI_DSC_CDB_RECEIVED           0x3D00
+#define I2O_SCSI_DSC_LUN_ALREADY_ENABLED    0x3E00
+#define I2O_SCSI_DSC_BUS_BUSY               0x3F00
+#define I2O_SCSI_DSC_QUEUE_FROZEN           0x4000
+
+
+#ifndef TRUE
+#define TRUE                  1
+#define FALSE                 0
+#endif
+
+#define HBA_FLAGS_INSTALLED_B       0x00000001	// Adapter Was Installed
+#define HBA_FLAGS_BLINKLED_B        0x00000002	// Adapter In Blink LED State
+#define HBA_FLAGS_IN_RESET	0x00000040	/* in reset */
+#define HBA_HOSTRESET_FAILED	0x00000080	/* adpt_resethost failed */
+
+
+// Device state flags
+#define DPTI_DEV_ONLINE    0x00
+#define DPTI_DEV_UNSCANNED 0x01
+#define DPTI_DEV_RESET	   0x02
+#define DPTI_DEV_OFFLINE   0x04
+
+
+struct adpt_device {
+	struct adpt_device* next_lun;
+	u32	flags;
+	u32	type;
+	u32	capacity;
+	u32	block_size;
+	u8	scsi_channel;
+	u8	scsi_id;
+	u8 	scsi_lun;
+	u8	state;
+	u16	tid;
+	struct i2o_device* pI2o_dev;
+	Scsi_Device *pScsi_dev;
+};
+
+struct adpt_channel {
+	struct adpt_device* device[MAX_ID];	/* used as an array of 128 scsi ids */
+	u8	scsi_id;
+	u8	type;
+	u16	tid;
+	u32	state;
+	struct i2o_device* pI2o_dev;
+};
+
+// HBA state flags
+#define DPTI_STATE_RESET	(0x01)
+#define DPTI_STATE_IOCTL	(0x02)
+
+typedef struct _adpt_hba {
+	struct _adpt_hba *next;
+	struct pci_dev *pDev;
+	struct Scsi_Host *host;
+	u32 state;
+	spinlock_t state_lock;
+	int unit;
+	int host_no;		/* SCSI host number */
+	u8 initialized;
+	u8 in_use;		/* is the management node open*/
+
+	char name[32];
+	char detail[55];
+
+	ulong base_addr_virt;
+	ulong msg_addr_virt;
+	ulong base_addr_phys;
+	ulong  post_port;
+	ulong  reply_port;
+	ulong  irq_mask;
+	u16  post_count;
+	u32  post_fifo_size;
+	u32  reply_fifo_size;
+	u32* reply_pool;
+	u32  sg_tablesize;	// Scatter/Gather List Size.       
+	u8  top_scsi_channel;
+	u8  top_scsi_id;
+	u8  top_scsi_lun;
+
+	i2o_status_block* status_block;
+	i2o_hrt* hrt;
+	i2o_lct* lct;
+	uint lct_size;
+	struct i2o_device* devices;
+	struct adpt_channel channel[MAX_CHANNEL];
+	struct proc_dir_entry* proc_entry;	/* /proc dir */
+
+	ulong FwDebugBuffer_P;	// Virtual Address Of FW Debug Buffer
+	u32   FwDebugBufferSize;	// FW Debug Buffer Size In Bytes
+	ulong FwDebugStrLength_P;	// Virtual Addr Of FW Debug String Len
+	ulong FwDebugFlags_P;	// Virtual Address Of FW Debug Flags 
+	ulong FwDebugBLEDflag_P;	// Virtual Addr Of FW Debug BLED
+	ulong FwDebugBLEDvalue_P;	// Virtual Addr Of FW Debug BLED
+	u32 FwDebugFlags;
+} adpt_hba;
+
+struct sg_simple_element {
+   u32  flag_count;
+   u32 addr_bus;
+}; 
+
+/*
+ * Function Prototypes
+ */
+
+static void adpt_i2o_sys_shutdown(void);
+static int adpt_init(void);
+static int adpt_i2o_build_sys_table(void);
+static void adpt_isr(int irq, void *dev_id, struct pt_regs *regs);
+#ifdef REBOOT_NOTIFIER
+static int adpt_reboot_event(struct notifier_block *n, ulong code, void *p);
+#endif
+
+static void adpt_i2o_report_hba_unit(adpt_hba* pHba, struct i2o_device *d);
+static int adpt_i2o_query_scalar(adpt_hba* pHba, int tid, 
+			int group, int field, void *buf, int buflen);
+#ifdef DEBUG
+static const char *adpt_i2o_get_class_name(int class);
+#endif
+static int adpt_i2o_issue_params(int cmd, adpt_hba* pHba, int tid, 
+		  void *opblk, int oplen, void *resblk, int reslen);
+static int adpt_i2o_post_wait(adpt_hba* pHba, u32* msg, int len, int timeout);
+static int adpt_i2o_lct_get(adpt_hba* pHba);
+static int adpt_i2o_parse_lct(adpt_hba* pHba);
+static int adpt_i2o_activate_hba(adpt_hba* pHba);
+static int adpt_i2o_enable_hba(adpt_hba* pHba);
+static int adpt_i2o_install_device(adpt_hba* pHba, struct i2o_device *d);
+static s32 adpt_i2o_post_this(adpt_hba* pHba, u32* data, int len);
+static s32 adpt_i2o_quiesce_hba(adpt_hba* pHba);
+static s32 adpt_i2o_status_get(adpt_hba* pHba);
+static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba);
+static s32 adpt_i2o_hrt_get(adpt_hba* pHba);
+static s32 adpt_scsi_to_i2o(adpt_hba* pHba, Scsi_Cmnd* cmd, struct adpt_device* dptdevice);
+static s32 adpt_i2o_to_scsi(ulong reply, Scsi_Cmnd* cmd);
+static s32 adpt_scsi_register(adpt_hba* pHba,Scsi_Host_Template * sht);
+static s32 adpt_hba_reset(adpt_hba* pHba);
+static s32 adpt_i2o_reset_hba(adpt_hba* pHba);
+static s32 adpt_rescan(adpt_hba* pHba);
+static s32 adpt_i2o_reparse_lct(adpt_hba* pHba);
+static s32 adpt_send_nop(adpt_hba*pHba,u32 m);
+static void adpt_i2o_delete_hba(adpt_hba* pHba);
+static void adpt_select_queue_depths(struct Scsi_Host *host, Scsi_Device * devicelist);
+static void adpt_inquiry(adpt_hba* pHba);
+static void adpt_fail_posted_scbs(adpt_hba* pHba);
+static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun);
+static int adpt_install_hba(Scsi_Host_Template* sht, struct pci_dev* pDev) ;
+static int adpt_i2o_online_hba(adpt_hba* pHba);
+static void adpt_i2o_post_wait_complete(u32, int);
+static int adpt_i2o_systab_send(adpt_hba* pHba);
+
+static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg);
+static int adpt_open(struct inode *inode, struct file *file);
+static int adpt_close(struct inode *inode, struct file *file);
+
+
+#ifdef UARTDELAY
+static void adpt_delay(int millisec);
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
+static struct pci_dev* adpt_pci_find_device(uint vendor, struct pci_dev* from);
+#endif
+
+#if defined __ia64__ 
+static void adpt_ia64_info(sysInfo_S* si);
+#endif
+#if defined __sparc__ 
+static void adpt_sparc_info(sysInfo_S* si);
+#endif
+#if defined __alpha__ 
+static void adpt_sparc_info(sysInfo_S* si);
+#endif
+#if defined __i386__
+static void adpt_i386_info(sysInfo_S* si);
+#endif
+
+#define PRINT_BUFFER_SIZE     512
+
+#define HBA_FLAGS_DBG_FLAGS_MASK         0xffff0000	// Mask for debug flags
+#define HBA_FLAGS_DBG_KERNEL_PRINT_B     0x00010000	// Kernel Debugger Print
+#define HBA_FLAGS_DBG_FW_PRINT_B         0x00020000	// Firmware Debugger Print
+#define HBA_FLAGS_DBG_FUNCTION_ENTRY_B   0x00040000	// Function Entry Point
+#define HBA_FLAGS_DBG_FUNCTION_EXIT_B    0x00080000	// Function Exit
+#define HBA_FLAGS_DBG_ERROR_B            0x00100000	// Error Conditiois
+#define HBA_FLAGS_DBG_INIT_B             0x00200000	// Init Prints
+#define HBA_FLAGS_DBG_OS_COMMANDS_B      0x00400000	// OS Command Info
+#define HBA_FLAGS_DBG_SCAN_B             0x00800000	// Device Scan
+
+#define FW_DEBUG_STR_LENGTH_OFFSET 0
+#define FW_DEBUG_FLAGS_OFFSET      4
+#define FW_DEBUG_BLED_OFFSET       8
+
+#define FW_DEBUG_FLAGS_NO_HEADERS_B    0x01
+#endif				/* !HOSTS_C */
+#endif				/* _DPT_H */
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/eata_pio.c linux/drivers/scsi/eata_pio.c
--- v2.4.9/linux/drivers/scsi/eata_pio.c	Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/eata_pio.c	Mon Sep 10 08:06:32 2001
@@ -161,7 +161,7 @@
 			    IncStat(&cmd->SCp,1);
 			    odd=FALSE;
 			}
-			x=min(unsigned int,z,cmd->SCp.this_residual/2);
+			x=min_t(unsigned int,z,cmd->SCp.this_residual/2);
 			insw(base+HA_RDATA,cmd->SCp.ptr,x);
 			z-=x; 
 			IncStat(&cmd->SCp,2*x);
@@ -191,7 +191,7 @@
 			    z--; 
 			    odd=FALSE; 
 			}
-			x=min(unsigned int,z,cmd->SCp.this_residual/2);
+			x=min_t(unsigned int,z,cmd->SCp.this_residual/2);
 			outsw(base+HA_RDATA,cmd->SCp.ptr,x);
 			z-=x; 
 			IncStat(&cmd->SCp,2*x);
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/gdth.c linux/drivers/scsi/gdth.c
--- v2.4.9/linux/drivers/scsi/gdth.c	Tue Jul  3 17:08:20 2001
+++ linux/drivers/scsi/gdth.c	Fri Sep  7 09:28:37 2001
@@ -1,8 +1,10 @@
 /************************************************************************
- * GDT ISA/EISA/PCI Disk Array Controller driver for Linux              *
+ * Linux driver for                                                     *  
+ * ICP vortex GmbH:    GDT ISA/EISA/PCI Disk Array Controllers          *
+ * Intel Corporatioi:  Storage RAID Controllers                         *
  *                                                                      *
  * gdth.c                                                               *
- * Copyright (C) 1995-01 ICP vortex Computersysteme GmbH, Achim Leubner *
+ * Copyright (C) 1995-01 ICP vortex, an Intel company,  Achim Leubner   *
  *                                                                      *
  * <achim@vortex.de>                                                    *
  *                                                                      *
@@ -20,9 +22,36 @@
  * along with this kernel; if not, write to the Free Software           *
  * Foundatioi, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.            *
  *                                                                      *
- * Tested with Linux 1.2.13, ..., 2.2.18, ..., 2.4.2                    *
+ * Tested with Linux 1.2.13, ..., 2.2.19, ..., 2.4.7                    *
  *                                                                      *
  * $Log: gdth.c,v $
+ * Revision 1.57  2001/08/21 11:16:35  achim
+ * Bugfix free_irq()
+ *
+ * Revision 1.56  2001/08/09 11:19:39  achim
+ * Scsi_Host_Template changes
+ *
+ * Revision 1.55  2001/08/09 10:11:28  achim
+ * Command HOST_UNFREEZE_IO before cache service init.
+ *
+ * Revision 1.54  2001/07/20 13:48:12  achim
+ * Expand: gdth_analyse_hdrive() removed
+ *
+ * Revision 1.53  2001/07/17 09:52:49  achim
+ * Small OEM related change
+ *
+ * Revision 1.52  2001/06/19 15:06:20  achim
+ * New host command GDT_UNFREEZE_IO added
+ *
+ * Revision 1.51  2001/05/22 06:42:37  achim
+ * PCI: Subdevice ID added
+ *
+ * Revision 1.50  2001/05/17 13:42:16  achim
+ * Support for Intel Storage RAID Controllers added
+ *
+ * Revision 1.50  2001/05/17 12:12:34  achim
+ * Support for Intel Storage RAID Controllers added
+ *
  * Revision 1.49  2001/03/15 15:07:17  achim
  * New __setup interface for boot command line optiois added
  *
@@ -203,7 +232,7 @@
  * Initial revision
  *
  ************************************************************************/
-#ident "$Id: gdth.c,v 1.49 2001/03/15 15:07:17 achim Exp $" 
+#ident "$Id: gdth.c,v 1.57 2001/08/21 11:16:35 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
@@ -291,9 +320,6 @@
 #else
 #include <linux/bios32.h>
 #endif
-#if LINUX_VERSION_CODE >= 0x020126
-#include <linux/init.h>
-#endif
 
 #include <asm/dma.h>
 #include <asm/system.h>
@@ -344,6 +370,8 @@
 static int gdth_search_eisa(ushort eisa_adr);
 static int gdth_search_isa(ulong32 bios_adr);
 static int gdth_search_pci(gdth_pci_str *pcistr);
+static void gdth_search_dev(gdth_pci_str *pcistr, ushort *cnt, 
+                            ushort vendor, ushort dev);
 static void gdth_sort_pci(gdth_pci_str *pcistr, int cnt);
 static int gdth_init_eisa(ushort eisa_adr,gdth_ha_str *ha);
 static int gdth_init_isa(ulong32 bios_adr,gdth_ha_str *ha);
@@ -588,8 +616,10 @@
 /* __initfunc, __initdata macros */
 #if LINUX_VERSION_CODE >= 0x020322
 #define GDTH_INITFUNC(type, func)       type __init func 
+#include <linux/init.h>
 #elif LINUX_VERSION_CODE >= 0x020126
 #define GDTH_INITFUNC(type, func)       __initfunc(type func)
+#include <linux/init.h>
 #else
 #define GDTH_INITFUNC(type, func)       type func
 #define __initdata
@@ -753,8 +783,28 @@
 
 GDTH_INITFUNC(static int, gdth_search_pci(gdth_pci_str *pcistr))
 {
+    ushort device, cnt;
+    
+    TRACE(("gdth_search_pci()\n"));
+
+    cnt = 0;
+    for (device = 0; device <= PCI_DEVICE_ID_VORTEX_GDT6555; ++device)
+        gdth_search_dev(pcistr, &cnt, PCI_VENDOR_ID_VORTEX, device);
+    for (device = PCI_DEVICE_ID_VORTEX_GDT6x17RP; 
+         device <= PCI_DEVICE_ID_VORTEX_GDTMAXRP; ++device)
+        gdth_search_dev(pcistr, &cnt, PCI_VENDOR_ID_VORTEX, device);
+    gdth_search_dev(pcistr, &cnt, PCI_VENDOR_ID_VORTEX, 
+                    PCI_DEVICE_ID_VORTEX_GDTNEWRX);
+    gdth_search_dev(pcistr, &cnt, PCI_VENDOR_ID_INTEL,
+                    PCI_DEVICE_ID_INTEL_SRC);
+    return cnt;
+}
+
+
+GDTH_INITFUNC(static void, gdth_search_dev(gdth_pci_str *pcistr, ushort *cnt,
+                                           ushort vendor, ushort device))
+{
     ulong base0, base1, base2;
-    ushort device_id, cnt;
 #if LINUX_VERSION_CODE >= 0x2015C
     struct pci_dev *pdev;
 #else
@@ -762,147 +812,150 @@
     ushort idx;
 #endif
     
-    TRACE(("gdth_search_pci()\n"));
+    TRACE(("gdth_search_dev() cnt %d vendor %x device %x\n",
+          *cnt, vendor, device));
 
-    cnt = 0;
-    for (device_id = 0; device_id <= PCI_DEVICE_ID_VORTEX_GDTMAXRP; 
-         ++device_id) {
-        if (device_id > PCI_DEVICE_ID_VORTEX_GDT6555 &&
-            device_id < PCI_DEVICE_ID_VORTEX_GDT6x17RP)
-            continue;
 #if LINUX_VERSION_CODE >= 0x20363
-        pdev = NULL;
-        while ((pdev = pci_find_device(PCI_VENDOR_ID_VORTEX,device_id,pdev)) 
-               != NULL) {
-            if (pci_enable_device(pdev))
+    pdev = NULL;
+    while ((pdev = pci_find_device(vendor, device, pdev)) 
+           != NULL) {
+        if (pci_enable_device(pdev))
+            continue;
+        if (*cnt >= MAXHA)
+            return;
+        /* GDT PCI controller found, resources are already in pdev */
+        pcistr[*cnt].pdev = pdev;
+        pcistr[*cnt].vendor_id = vendor;
+        pcistr[*cnt].device_id = device;
+        pcistr[*cnt].subdevice_id = pdev->subsystem_device;
+        pcistr[*cnt].bus = pdev->bus->number;
+        pcistr[*cnt].device_fn = pdev->devfn;
+        pcistr[*cnt].irq = pdev->irq;
+        base0 = pci_resource_flags(pdev, 0);
+        base1 = pci_resource_flags(pdev, 1);
+        base2 = pci_resource_flags(pdev, 2);
+        if (device <= PCI_DEVICE_ID_VORTEX_GDT6000B ||   /* GDT6000/B */
+            device >= PCI_DEVICE_ID_VORTEX_GDT6x17RP) {  /* MPR */
+            if (!(base0 & IORESOURCE_MEM)) 
                 continue;
-            if (cnt >= MAXHA)
-                return cnt;
-            /* GDT PCI controller found, resources are already in pdev */
-            pcistr[cnt].pdev = pdev;
-            pcistr[cnt].device_id = device_id;
-            pcistr[cnt].bus = pdev->bus->number;
-            pcistr[cnt].device_fn = pdev->devfn;
-            pcistr[cnt].irq = pdev->irq;
-            base0 = pci_resource_flags(pdev, 0);
-            base1 = pci_resource_flags(pdev, 1);
-            base2 = pci_resource_flags(pdev, 2);
-            if (device_id <= PCI_DEVICE_ID_VORTEX_GDT6000B ||   /* GDT6000/B */
-                device_id >= PCI_DEVICE_ID_VORTEX_GDT6x17RP) {  /* MPR */
-                if (!(base0 & IORESOURCE_MEM)) 
-                    continue;
-                pcistr[cnt].dpmem = pci_resource_start(pdev, 0);
-            } else {                                  /* GDT6110, GDT6120, .. */
-                if (!(base0 & IORESOURCE_MEM) ||
-                    !(base2 & IORESOURCE_MEM) ||
-                    !(base1 & IORESOURCE_IO)) 
-                    continue;
-                pcistr[cnt].dpmem = pci_resource_start(pdev, 2);
-                pcistr[cnt].io_mm = pci_resource_start(pdev, 0);
-                pcistr[cnt].io    = pci_resource_start(pdev, 1);
-            }
-            TRACE2(("Controller found at %d/%d, irq %d, dpmem 0x%lx\n",
-                    pcistr[cnt].bus, PCI_SLOT(pcistr[cnt].device_fn), 
-                    pcistr[cnt].irq, pcistr[cnt].dpmem));
-            cnt++;
-        }       
+            pcistr[*cnt].dpmem = pci_resource_start(pdev, 0);
+        } else {                                  /* GDT6110, GDT6120, .. */
+            if (!(base0 & IORESOURCE_MEM) ||
+                !(base2 & IORESOURCE_MEM) ||
+                !(base1 & IORESOURCE_IO)) 
+                continue;
+            pcistr[*cnt].dpmem = pci_resource_start(pdev, 2);
+            pcistr[*cnt].io_mm = pci_resource_start(pdev, 0);
+            pcistr[*cnt].io    = pci_resource_start(pdev, 1);
+        }
+        TRACE2(("Controller found at %d/%d, irq %d, dpmem 0x%lx\n",
+                pcistr[*cnt].bus, PCI_SLOT(pcistr[*cnt].device_fn), 
+                pcistr[*cnt].irq, pcistr[*cnt].dpmem));
+        (*cnt)++;
+    }       
 #elif LINUX_VERSION_CODE >= 0x2015C
-        pdev = NULL;
-        while ((pdev = pci_find_device(PCI_VENDOR_ID_VORTEX,device_id,pdev)) 
-               != NULL) {
-            if (cnt >= MAXHA)
-                return cnt;
-            /* GDT PCI controller found, resources are already in pdev */
-            pcistr[cnt].pdev = pdev;
-            pcistr[cnt].device_id = device_id;
-            pcistr[cnt].bus = pdev->bus->number;
-            pcistr[cnt].device_fn = pdev->devfn;
-            pcistr[cnt].irq = pdev->irq;
-            base0 = pdev->base_address[0];
-            base1 = pdev->base_address[1];
-            base2 = pdev->base_address[2];
-            if (device_id <= PCI_DEVICE_ID_VORTEX_GDT6000B ||   /* GDT6000/B */
-                device_id >= PCI_DEVICE_ID_VORTEX_GDT6x17RP) {  /* MPR */
-                if ((base0 & PCI_BASE_ADDRESS_SPACE) != 
-                    PCI_BASE_ADDRESS_SPACE_MEMORY)
-                    continue;
-                pcistr[cnt].dpmem = base0 & PCI_BASE_ADDRESS_MEM_MASK;
-            } else {                                  /* GDT6110, GDT6120, .. */
-                if ((base0 & PCI_BASE_ADDRESS_SPACE) !=
-                    PCI_BASE_ADDRESS_SPACE_MEMORY ||
-                    (base2 & PCI_BASE_ADDRESS_SPACE) !=
-                    PCI_BASE_ADDRESS_SPACE_MEMORY ||
-                    (base1 & PCI_BASE_ADDRESS_SPACE) !=
-                    PCI_BASE_ADDRESS_SPACE_IO)
-                    continue;
-                pcistr[cnt].dpmem = base2 & PCI_BASE_ADDRESS_MEM_MASK;
-                pcistr[cnt].io_mm = base0 & PCI_BASE_ADDRESS_MEM_MASK;
-                pcistr[cnt].io    = base1 & PCI_BASE_ADDRESS_IO_MASK;
-            }
-            TRACE2(("Controller found at %d/%d, irq %d, dpmem 0x%lx\n",
-                    pcistr[cnt].bus, PCI_SLOT(pcistr[cnt].device_fn), 
-                    pcistr[cnt].irq, pcistr[cnt].dpmem));
-            cnt++;
-        }       
+    pdev = NULL;
+    while ((pdev = pci_find_device(vendor, device, pdev)) 
+           != NULL) {
+        if (*cnt >= MAXHA)
+            return;
+        /* GDT PCI controller found, resources are already in pdev */
+        pcistr[*cnt].pdev = pdev;
+        pcistr[*cnt].vendor_id = vendor;
+        pcistr[*cnt].device_id = device;
+        pcistr[*cnt].bus = pdev->bus->number;
+        pcistr[*cnt].device_fn = pdev->devfn;
+        pcibios_read_config_word(pcistr[*cnt].bus, pcistr[*cnt].device_fn,
+                                 PCI_SUBSYSTEM_ID, &pcistr[*cnt].subdevice_id);
+        pcistr[*cnt].irq = pdev->irq;
+        base0 = pdev->base_address[0];
+        base1 = pdev->base_address[1];
+        base2 = pdev->base_address[2];
+        if (device <= PCI_DEVICE_ID_VORTEX_GDT6000B ||   /* GDT6000/B */
+            device >= PCI_DEVICE_ID_VORTEX_GDT6x17RP) {  /* MPR */
+            if ((base0 & PCI_BASE_ADDRESS_SPACE) != 
+                PCI_BASE_ADDRESS_SPACE_MEMORY)
+                continue;
+            pcistr[*cnt].dpmem = base0 & PCI_BASE_ADDRESS_MEM_MASK;
+        } else {                                  /* GDT6110, GDT6120, .. */
+            if ((base0 & PCI_BASE_ADDRESS_SPACE) !=
+                PCI_BASE_ADDRESS_SPACE_MEMORY ||
+                (base2 & PCI_BASE_ADDRESS_SPACE) !=
+                PCI_BASE_ADDRESS_SPACE_MEMORY ||
+                (base1 & PCI_BASE_ADDRESS_SPACE) !=
+                PCI_BASE_ADDRESS_SPACE_IO)
+                continue;
+            pcistr[*cnt].dpmem = base2 & PCI_BASE_ADDRESS_MEM_MASK;
+            pcistr[*cnt].io_mm = base0 & PCI_BASE_ADDRESS_MEM_MASK;
+            pcistr[*cnt].io    = base1 & PCI_BASE_ADDRESS_IO_MASK;
+        }
+        TRACE2(("Controller found at %d/%d, irq %d, dpmem 0x%lx\n",
+                pcistr[*cnt].bus, PCI_SLOT(pcistr[*cnt].device_fn), 
+                pcistr[*cnt].irq, pcistr[*cnt].dpmem));
+        (*cnt)++;
+    }       
 #else   
-        idx = 0;
-        while (!pcibios_find_device(PCI_VENDOR_ID_VORTEX,device_id,idx++,
-                                    &pcistr[cnt].bus,&pcistr[cnt].device_fn)) {
-            if (cnt >= MAXHA)
-                return cnt;
-            /* GDT PCI ctr. found, now read resources from config space */
+    idx = 0;
+    while (!pcibios_find_device(vendor, device, idx++,
+                                &pcistr[*cnt].bus,&pcistr[*cnt].device_fn)) {
+        if (*cnt >= MAXHA)
+            return;
+        /* GDT PCI ctr. found, now read resources from config space */
 #if LINUX_VERSION_CODE >= 0x010300
 #define GDTH_BASEP      (int *)
 #else
 #define GDTH_BASEP
 #endif
-            if ((error = pcibios_read_config_dword(pcistr[cnt].bus,
-                                                   pcistr[cnt].device_fn,
-                                                   PCI_BASE_ADDRESS_0,
-                                                   GDTH_BASEP&base0)) ||
-                (error = pcibios_read_config_dword(pcistr[cnt].bus,
-                                                   pcistr[cnt].device_fn,
-                                                   PCI_BASE_ADDRESS_1,
-                                                   GDTH_BASEP&base1)) ||
-                (error = pcibios_read_config_dword(pcistr[cnt].bus,
-                                                   pcistr[cnt].device_fn,
-                                                   PCI_BASE_ADDRESS_2,
-                                                   GDTH_BASEP&base2)) ||
-                (error = pcibios_read_config_byte(pcistr[cnt].bus,
-                                                  pcistr[cnt].device_fn,
-                                                  PCI_INTERRUPT_LINE,
-                                                  &pcistr[cnt].irq))) {
-                printk("GDT-PCI: error %d reading configuratioi space", error);
+        if ((error = pcibios_read_config_dword(pcistr[*cnt].bus,
+                                               pcistr[*cnt].device_fn,
+                                               PCI_BASE_ADDRESS_0,
+                                               GDTH_BASEP&base0)) ||
+            (error = pcibios_read_config_dword(pcistr[*cnt].bus,
+                                               pcistr[*cnt].device_fn,
+                                               PCI_BASE_ADDRESS_1,
+                                               GDTH_BASEP&base1)) ||
+            (error = pcibios_read_config_dword(pcistr[*cnt].bus,
+                                               pcistr[*cnt].device_fn,
+                                               PCI_BASE_ADDRESS_2,
+                                               GDTH_BASEP&base2)) ||
+            (error = pcibios_read_config_word(pcistr[*cnt].bus,
+                                              pcistr[*cnt].device_fn,
+                                              PCI_SUBSYSTEM_ID,
+                                              &pcistr[*cnt].subdevice_id)) ||
+            (error = pcibios_read_config_byte(pcistr[*cnt].bus,
+                                              pcistr[*cnt].device_fn,
+                                              PCI_INTERRUPT_LINE,
+                                              &pcistr[*cnt].irq))) {
+            printk("GDT-PCI: error %d reading configuratioi space", error);
+            continue;
+        }
+        pcistr[*cnt].vendor_id = vendor;
+        pcistr[*cnt].device_id = device;
+        if (device <= PCI_DEVICE_ID_VORTEX_GDT6000B ||   /* GDT6000/B */
+            device >= PCI_DEVICE_ID_VORTEX_GDT6x17RP) {  /* MPR */
+            if ((base0 & PCI_BASE_ADDRESS_SPACE) !=
+                PCI_BASE_ADDRESS_SPACE_MEMORY)
                 continue;
-            }
-            pcistr[cnt].device_id = device_id;
-            if (device_id <= PCI_DEVICE_ID_VORTEX_GDT6000B ||   /* GDT6000/B */
-                device_id >= PCI_DEVICE_ID_VORTEX_GDT6x17RP) {  /* MPR */
-                if ((base0 & PCI_BASE_ADDRESS_SPACE) !=
-                    PCI_BASE_ADDRESS_SPACE_MEMORY)
-                    continue;
-                pcistr[cnt].dpmem = base0 & PCI_BASE_ADDRESS_MEM_MASK;
-            } else {                                    /* GDT6110, GDT6120, .. */
-                if ((base0 & PCI_BASE_ADDRESS_SPACE) !=
-                    PCI_BASE_ADDRESS_SPACE_MEMORY ||
-                    (base2 & PCI_BASE_ADDRESS_SPACE) !=
-                    PCI_BASE_ADDRESS_SPACE_MEMORY ||
-                    (base1 & PCI_BASE_ADDRESS_SPACE) !=
-                    PCI_BASE_ADDRESS_SPACE_IO)
-                    continue;
-                pcistr[cnt].dpmem = base2 & PCI_BASE_ADDRESS_MEM_MASK;
-                pcistr[cnt].io_mm = base0 & PCI_BASE_ADDRESS_MEM_MASK;
-                pcistr[cnt].io    = base1 & PCI_BASE_ADDRESS_IO_MASK;
-            }
-            TRACE2(("Controller found at %d/%d, irq %d, dpmem 0x%lx\n",
-                    pcistr[cnt].bus, PCI_SLOT(pcistr[cnt].device_fn), 
-                    pcistr[cnt].irq, pcistr[cnt].dpmem));
-            cnt++;
+            pcistr[*cnt].dpmem = base0 & PCI_BASE_ADDRESS_MEM_MASK;
+        } else {                                    /* GDT6110, GDT6120, .. */
+            if ((base0 & PCI_BASE_ADDRESS_SPACE) !=
+                PCI_BASE_ADDRESS_SPACE_MEMORY ||
+                (base2 & PCI_BASE_ADDRESS_SPACE) !=
+                PCI_BASE_ADDRESS_SPACE_MEMORY ||
+                (base1 & PCI_BASE_ADDRESS_SPACE) !=
+                PCI_BASE_ADDRESS_SPACE_IO)
+                continue;
+            pcistr[*cnt].dpmem = base2 & PCI_BASE_ADDRESS_MEM_MASK;
+            pcistr[*cnt].io_mm = base0 & PCI_BASE_ADDRESS_MEM_MASK;
+            pcistr[*cnt].io    = base1 & PCI_BASE_ADDRESS_IO_MASK;
         }
+        TRACE2(("Controller found at %d/%d, irq %d, dpmem 0x%lx\n",
+                pcistr[*cnt].bus, PCI_SLOT(pcistr[*cnt].device_fn), 
+                pcistr[*cnt].irq, pcistr[*cnt].dpmem));
+        (*cnt)++;
+    }
 #endif
-    }   
-    return cnt;
-}
+}   
 
 
 GDTH_INITFUNC(static void, gdth_sort_pci(gdth_pci_str *pcistr, int cnt))
@@ -982,6 +1035,7 @@
 
     /* detect IRQ */ 
     if ((id = inl(eisa_adr+ID0REG)) == GDT3_ID) {
+        ha->oem_id = OEM_ID_ICP;
         ha->type = GDT_EISA;
         ha->stype = id;
         outl(1,eisa_adr+MAILBOXREG+8);
@@ -1025,6 +1079,7 @@
         if (eisacf > 4)                         /* level triggered */
             eisacf -= 4;
         ha->irq = gdth_irq_tab[eisacf];
+        ha->oem_id = OEM_ID_ICP;
         ha->type = GDT_EISA;
         ha->stype = id;
     }
@@ -1101,6 +1156,7 @@
         return 0;
     }
 
+    ha->oem_id = OEM_ID_ICP;
     ha->type = GDT_ISA;
     ha->ic_all_size = sizeof(dp2_ptr->u);
     ha->stype= GDT2_ID;
@@ -1144,9 +1200,14 @@
 
     TRACE(("gdth_init_pci()\n"));
 
+    if (pcistr->vendor_id == PCI_VENDOR_ID_INTEL)
+        ha->oem_id = OEM_ID_INTEL;
+    else
+        ha->oem_id = OEM_ID_ICP;
     ha->brd_phys = (pcistr->bus << 8) | (pcistr->device_fn & 0xf8);
-    ha->stype    = (ulong32)pcistr->device_id;
-    ha->irq      = pcistr->irq;
+    ha->stype = (ulong32)pcistr->device_id;
+    ha->subdevice_id = pcistr->subdevice_id;
+    ha->irq = pcistr->irq;
     
     if (ha->stype <= PCI_DEVICE_ID_VORTEX_GDT6000B) {  /* GDT6000/B */
         TRACE2(("init_pci() dpmem %lx irq %d\n",pcistr->dpmem,ha->irq));
@@ -1914,7 +1975,10 @@
     /* 3. send to controller firmware */
     gdth_internal_cmd(hanum,SCREENSERVICE,GDT_REALTIME, *(ulong32 *)&rtc[0],
                       *(ulong32 *)&rtc[4], *(ulong32 *)&rtc[8]);
-#endif   
+#endif  
+ 
+    /* unfreeze all IOs */
+    gdth_internal_cmd(hanum,CACHESERVICE,GDT_UNFREEZE_IO,0,0,0);
  
     /* initialize cache service */
     if (!gdth_internal_cmd(hanum,CACHESERVICE,GDT_INIT,LINUX_OS,0,0)) {
@@ -2599,7 +2663,10 @@
         inq.versioi   = 2;
         inq.resp_aenc = 2;
         inq.add_length= 32;
-        strcpy(inq.vendor,"ICP    ");
+        if (ha->oem_id == OEM_ID_INTEL)
+            strcpy(inq.vendor,"Intel  ");
+        else 
+            strcpy(inq.vendor,"ICP    ");
         sprintf(inq.product,"Host Drive  #%02d",t);
         strcpy(inq.revision,"   ");
         gdth_copy_internal_data(scp,(char*)&inq,sizeof(gdth_inq_data));
@@ -3690,7 +3757,7 @@
         if (ha->service == CACHESERVICE && ha->status == 56) {
             TRACE2(("gdth_async_event(): new host drive %d created\n",
                     (ushort)ha->info));
-            gdth_analyse_hdrive(hanum, (ushort)ha->info);
+            /* gdth_analyse_hdrive(hanum, (ushort)ha->info); */
         }   
     }
     return 1;
@@ -3938,7 +4005,7 @@
             if (request_dma(ha->drq,"gdth")) {
                 printk("GDT-ISA: Unable to allocate DMA channel\n");
 #if LINUX_VERSION_CODE >= 0x010346 
-                free_irq(ha->irq,NULL);
+                free_irq(ha->irq,ha);
 #else
                 free_irq(ha->irq);
 #endif
@@ -3984,7 +4051,7 @@
                     scsi_init_free((void *)ha->pscratch, GDTH_SCRATCH);
 #endif
 #if LINUX_VERSION_CODE >= 0x010346 
-                free_irq(ha->irq,NULL);
+                free_irq(ha->irq,ha);
 #else
                 free_irq(ha->irq);
 #endif
@@ -4085,7 +4152,7 @@
                     scsi_init_free((void *)ha->pscratch, GDTH_SCRATCH);
 #endif
 #if LINUX_VERSION_CODE >= 0x010346 
-                free_irq(ha->irq,NULL);
+                free_irq(ha->irq,ha);
 #else
                 free_irq(ha->irq);
 #endif
@@ -4194,7 +4261,7 @@
                     scsi_init_free((void *)ha->pscratch, GDTH_SCRATCH);
 #endif
 #if LINUX_VERSION_CODE >= 0x010346 
-                free_irq(ha->irq,NULL);
+                free_irq(ha->irq,ha);
 #else
                 free_irq(ha->irq);
 #endif
@@ -4264,7 +4331,7 @@
 
         if (shp->irq) {
 #if LINUX_VERSION_CODE >= 0x010346
-            free_irq(shp->irq,NULL);
+            free_irq(shp->irq,ha);
 #else
             free_irq(shp->irq);
 #endif
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/gdth.h linux/drivers/scsi/gdth.h
--- v2.4.9/linux/drivers/scsi/gdth.h	Sat May 19 17:43:06 2001
+++ linux/drivers/scsi/gdth.h	Fri Sep  7 09:28:37 2001
@@ -10,7 +10,7 @@
  *
  * <achim@vortex.de>
  *
- * $Id: gdth.h,v 1.38 2001/03/15 15:06:23 achim Exp $
+ * $Id: gdth.h,v 1.44 2001/08/21 11:19:05 achim Exp $
  */
 
 #include <linux/versioi.h>
@@ -29,13 +29,17 @@
 /* defines, macros */
 
 /* driver versioi */
-#define GDTH_VERSION_STR        "1.28"
-#define GDTH_VERSION            1
-#define GDTH_SUBVERSION         28
+#define GDTH_VERSION_STR        "2.03"
+#define GDTH_VERSION            2
+#define GDTH_SUBVERSION         3
 
 /* protocol versioi */
 #define PROTOCOL_VERSION        1
 
+/* OEM IDs */
+#define OEM_ID_ICP	0x941c
+#define OEM_ID_INTEL	0x8000
+
 /* controller classes */
 #define GDT_ISA         0x01                    /* ISA controller */
 #define GDT_EISA        0x02                    /* EISA controller */
@@ -54,6 +58,9 @@
 #ifndef PCI_VENDOR_ID_VORTEX
 #define PCI_VENDOR_ID_VORTEX            0x1119  /* PCI controller vendor ID */
 #endif
+#ifndef PCI_VENDOR_ID_INTEL
+#define PCI_VENDOR_ID_INTEL             0x8086  
+#endif
 
 #ifndef PCI_DEVICE_ID_VORTEX_GDT60x0
 /* GDT_PCI */
@@ -125,6 +132,16 @@
 #define PCI_DEVICE_ID_VORTEX_GDTMAXRP   0x2ff   
 #endif
 
+#ifndef PCI_DEVICE_ID_VORTEX_GDTNEWRX
+/* new GDT Rx Controller */
+#define PCI_DEVICE_ID_VORTEX_GDTNEWRX	0x300
+#endif
+	
+#ifndef PCI_DEVICE_ID_INTEL_SRC
+/* Intel Storage RAID Controller */
+#define PCI_DEVICE_ID_INTEL_SRC		0x600
+#endif
+
 /* limits */
 #define GDTH_SCRATCH    PAGE_SIZE               /* 4KB scratch buffer */
 #define GDTH_SCRATCH_ORD 0                      /* order 0 means 1 page */
@@ -202,6 +219,8 @@
 #define GDT_CLUST_INFO  22                      /* cluster info */
 #define GDT_RW_ATTRIBS  23                      /* R/W attribs (write thru,..)*/
 #define GDT_CLUST_RESET 24                      /* releases the cluster drives*/
+#define GDT_FREEZE_IO   25                      /* freezes all IOs */
+#define GDT_UNFREEZE_IO 26                      /* unfreezes all IOs */
 
 /* raw service commands */
 #define GDT_RESERVE     14                      /* reserve dev. to raw serv. */
@@ -843,7 +862,9 @@
 #if LINUX_VERSION_CODE >= 0x02015C
     struct pci_dev      *pdev;
 #endif
+    ushort              vendor_id;              /* vendor (ICP, Intel, ..) */
     ushort              device_id;              /* device ID (0,..,9) */
+    ushort              subdevice_id;           /* sub device ID */
     unchar              bus;                    /* PCI bus */
     unchar              device_fn;              /* PCI device/function no. */
     ulong               dpmem;                  /* DPRAM address */
@@ -855,9 +876,11 @@
 
 /* controller informatioi structure */
 typedef struct {
+    ushort              oem_id;                 /* OEM */
     ushort              type;                   /* controller class */
     ushort              raw_feat;               /* feat. raw service (s/g,..) */
-    ulong32             stype;                  /* controller subtype */
+    ulong32             stype;                  /* subtype (PCI: device ID) */
+    ushort              subdevice_id;           /* sub device ID (PCI) */
     ushort              fw_vers;                /* firmware versioi */
     ushort              cache_feat;             /* feat. cache serv. (s/g,..) */
     ushort              bmic;                   /* BMIC address (EISA) */
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/gdth_ioctl.h linux/drivers/scsi/gdth_ioctl.h
--- v2.4.9/linux/drivers/scsi/gdth_ioctl.h	Sat May 19 17:43:06 2001
+++ linux/drivers/scsi/gdth_ioctl.h	Fri Sep  7 09:28:37 2001
@@ -2,7 +2,7 @@
 #define _GDTH_IOCTL_H
 
 /* gdth_ioctl.h
- * $Id: gdth_ioctl.h,v 1.9 2001/01/10 14:39:37 achim Exp $
+ * $Id: gdth_ioctl.h,v 1.10 2001/05/22 06:28:59 achim Exp $
  */
 
 /* IOCTLs */
@@ -83,6 +83,8 @@
             ushort          bios_ver;           /* not used */
             ushort          access;             /* not used */
             ushort          ext_type;           /* extended type */
+            ushort          device_id;          /* device ID */
+            ushort          sub_device_id;      /* sub device ID */
         } ctrtype;
         struct {
             unchar          versioi;            /* OS versioi */
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/gdth_proc.c linux/drivers/scsi/gdth_proc.c
--- v2.4.9/linux/drivers/scsi/gdth_proc.c	Sun Aug 12 13:28:00 2001
+++ linux/drivers/scsi/gdth_proc.c	Fri Sep  7 09:28:37 2001
@@ -1,9 +1,11 @@
 /* gdth_proc.c 
- * $Id: gdth_proc.c,v 1.27 2001/03/14 10:47:00 achim Exp $
+ * $Id: gdth_proc.c,v 1.33 2001/08/10 07:54:39 achim Exp $
  */
 
 #include "gdth_ioctl.h"
+#if LINUX_VERSION_CODE >= 0x020407
 #include <linux/completioi.h>
+#endif
 
 int gdth_proc_info(char *buffer,char **start,off_t offset,int length,   
                    int hostno,int inout)
@@ -48,7 +50,7 @@
     sdev = scsi_get_host_dev(gdth_ctr_vtab[vh]);
     scp  = scsi_allocate_device(sdev, 1, FALSE);
     if (!scp)
-	    return -ENOMEM;
+        return -ENOMEM;
     scp->cmd_len = 12;
     scp->use_sg = 0;
 #else
@@ -176,7 +178,7 @@
     }
 
     if (wb_mode) {
-        if (!gdth_ioctl_alloc(hanum, sizeof(gdth_cpar_str)))
+        if (!gdth_ioctl_alloc(hanum, sizeof(gdth_cpar_str), TRUE))
             return(-EBUSY);
         pcpar = (gdth_cpar_str *)ha->pscratch;
         memcpy( pcpar, &ha->cpar, sizeof(gdth_cpar_str) );
@@ -192,7 +194,7 @@
 #else
         gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
 #endif
-        gdth_ioctl_free(hanum);
+        gdth_ioctl_free(hanum, ha->pscratch);
         printk("Done.\n");
         return(orig_length);
     }
@@ -270,7 +272,8 @@
         } else {
             return(-EINVAL);
         }
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str)+add_size+add_size2 ))
+        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str)+add_size+add_size2,
+                               TRUE ))
             return(-EBUSY);
         piord = (gdth_iord_str *)ha->pscratch;
 
@@ -294,7 +297,7 @@
         break;
 
       case GDTIOCTL_DRVERS:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str) ))
+        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE ))
             return(-EBUSY);
         piord = (gdth_iord_str *)ha->pscratch;
         piord->size = sizeof(gdth_iord_str);
@@ -303,25 +306,33 @@
         break;
 
       case GDTIOCTL_CTRTYPE:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str) ))
+        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE ))
             return(-EBUSY);
         piord = (gdth_iord_str *)ha->pscratch;
         piord->size = sizeof(gdth_iord_str);
         piord->status = S_OK;
         if (ha->type == GDT_ISA || ha->type == GDT_EISA) {
             piord->iu.ctrtype.type = (unchar)((ha->stype>>20) - 0x10);
-        } else if (ha->type != GDT_PCIMPR) {
-            piord->iu.ctrtype.type = (unchar)((ha->stype<<8) + 6);
         } else {
-            piord->iu.ctrtype.type = 0xfe;
-            piord->iu.ctrtype.ext_type = 0x6000 | ha->stype;
+            if (ha->type != GDT_PCIMPR) {
+                piord->iu.ctrtype.type = (unchar)((ha->stype<<4) + 6);
+            } else {
+                piord->iu.ctrtype.type = 
+                    (ha->oem_id == OEM_ID_INTEL ? 0xfd : 0xfe);
+                if (ha->stype >= 0x300)
+                    piord->iu.ctrtype.ext_type = 0x6000 | ha->subdevice_id;
+                else 
+                    piord->iu.ctrtype.ext_type = 0x6000 | ha->stype;
+            }
+            piord->iu.ctrtype.device_id = ha->stype;
+            piord->iu.ctrtype.sub_device_id = ha->subdevice_id;
         }
         piord->iu.ctrtype.info = ha->brd_phys;
-        piord->iu.ctrtype.oem_id = (ushort)GDT3_ID;
+        piord->iu.ctrtype.oem_id = ha->oem_id;
         break;
 
       case GDTIOCTL_CTRCNT:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str) ))
+        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE ))
             return(-EBUSY);
         piord = (gdth_iord_str *)ha->pscratch;
         piord->size = sizeof(gdth_iord_str);
@@ -330,7 +341,7 @@
         break;
 
       case GDTIOCTL_OSVERS:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str) ))
+        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE ))
             return(-EBUSY);
         piord = (gdth_iord_str *)ha->pscratch;
         piord->size = sizeof(gdth_iord_str);
@@ -341,7 +352,7 @@
         break;
 
       case GDTIOCTL_LOCKDRV:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str) ))
+        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE ))
             return(-EBUSY);
         piord = (gdth_iord_str *)ha->pscratch;
         for (i = 0; i < piowr->iu.lockdrv.drive_cnt; ++i) {
@@ -367,7 +378,7 @@
         break;
 
       case GDTIOCTL_LOCKCHN:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str) ))
+        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE ))
             return(-EBUSY);
         i = piowr->iu.lockchn.channel;
         if (i < ha->bus_cnt) {
@@ -395,7 +406,7 @@
         break;
 
       case GDTIOCTL_EVENT:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str) ))
+        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE ))
             return(-EBUSY);
         piord = (gdth_iord_str *)ha->pscratch;
         if (piowr->iu.event.erase == 0xff) {
@@ -430,7 +441,7 @@
         break;
 
       case GDTIOCTL_SCSI:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str) ))
+        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE ))
             return(-EBUSY);
         piord = (gdth_iord_str *)ha->pscratch;
         piord->size = sizeof(gdth_iord_str);
@@ -451,7 +462,7 @@
         break;
 
       case GDTIOCTL_RESET_BUS:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str) ))
+        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE ))
             return(-EBUSY);
         piord = (gdth_iord_str *)ha->pscratch;
         piord->size = sizeof(gdth_iord_str);
@@ -475,7 +486,7 @@
         break;
 
       case GDTIOCTL_HDRLIST:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str) ))
+        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE ))
             return(-EBUSY);
         piord = (gdth_iord_str *)ha->pscratch;
         piord->size = sizeof(gdth_iord_str);
@@ -509,7 +520,7 @@
         break;
 
       case GDTIOCTL_RESCAN:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str) ))
+        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE ))
             return(-EBUSY);
         piord = (gdth_iord_str *)ha->pscratch;
         piord->size = sizeof(gdth_iord_str);
@@ -635,7 +646,7 @@
         break;
 
       case GDTIOCTL_RESET_DRV:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str) ))
+        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE ))
             return(-EBUSY);
         piord = (gdth_iord_str *)ha->pscratch;
         piord->size = sizeof(gdth_iord_str);
@@ -684,6 +695,7 @@
     char hrec[161];
     struct timeval tv;
 
+    char *buf;
     gdth_dskstat_str *pds;
     gdth_diskinfo_str *pdi;
     gdth_arrayinf_str *pai;
@@ -701,6 +713,8 @@
 #if LINUX_VERSION_CODE >= 0x020322
     sdev = scsi_get_host_dev(gdth_ctr_vtab[vh]);
     scp  = scsi_allocate_device(sdev, 1, FALSE);
+    if (!scp)
+        return -ENOMEM;
     scp->cmd_len = 12;
     scp->use_sg = 0;
 #else
@@ -784,12 +798,13 @@
             len += size;  pos = begin + len;
             flag = FALSE;
             
-            if (!gdth_ioctl_alloc(hanum, GDTH_SCRATCH))
+            buf = gdth_ioctl_alloc(hanum, GDTH_SCRATCH, FALSE);
+            if (!buf) 
                 goto stop_output;
             for (i = 0; i < ha->bus_cnt; ++i) {
                 /* 2.a statistics (and retries/reassigns) */
                 TRACE2(("pdr_statistics() chn %d\n",i));                
-                pds = (gdth_dskstat_str *)(ha->pscratch + GDTH_SCRATCH/4);
+                pds = (gdth_dskstat_str *)(buf + GDTH_SCRATCH/4);
                 gdtcmd.Service = CACHESERVICE;
                 gdtcmd.OpCode = GDT_IOCTL;
                 gdtcmd.u.ioctl.p_param = virt_to_bus(pds);
@@ -819,7 +834,7 @@
                     /* 2.b drive info */
                     TRACE2(("scsi_drv_info() chn %d dev %d\n",
                         i, ha->raw[i].id_list[j]));             
-                    pdi = (gdth_diskinfo_str *)ha->pscratch;
+                    pdi = (gdth_diskinfo_str *)buf;
                     gdtcmd.Service = CACHESERVICE;
                     gdtcmd.OpCode = GDT_IOCTL;
                     gdtcmd.u.ioctl.p_param = virt_to_bus(pdi);
@@ -874,7 +889,7 @@
                         /* 2.c grown defects */
                         TRACE2(("scsi_drv_defcnt() chn %d dev %d\n",
                                 i, ha->raw[i].id_list[j]));             
-                        pdef = (gdth_defcnt_str *)ha->pscratch;
+                        pdef = (gdth_defcnt_str *)buf;
                         gdtcmd.Service = CACHESERVICE;
                         gdtcmd.OpCode = GDT_IOCTL;
                         gdtcmd.u.ioctl.p_param = virt_to_bus(pdef);
@@ -905,7 +920,7 @@
                         goto stop_output;
                 }
             }
-            gdth_ioctl_free(hanum);
+            gdth_ioctl_free(hanum, buf);
 
             if (!flag) {
                 size = sprintf(buffer+len, "\n --\n");
@@ -917,7 +932,8 @@
             len += size;  pos = begin + len;
             flag = FALSE;
 
-            if (!gdth_ioctl_alloc(hanum, GDTH_SCRATCH))
+            buf = gdth_ioctl_alloc(hanum, GDTH_SCRATCH, FALSE);
+            if (!buf) 
                 goto stop_output;
             for (i = 0; i < MAX_LDRIVES; ++i) {
                 if (!ha->hdr[i].is_logdrv)
@@ -928,7 +944,7 @@
                 do {
                     /* 3.a log. drive info */
                     TRACE2(("cache_drv_info() drive no %d\n",drv_no));
-                    pcdi = (gdth_cdrinfo_str *)ha->pscratch;
+                    pcdi = (gdth_cdrinfo_str *)buf;
                     gdtcmd.Service = CACHESERVICE;
                     gdtcmd.OpCode = GDT_IOCTL;
                     gdtcmd.u.ioctl.p_param = virt_to_bus(pcdi);
@@ -1018,7 +1034,7 @@
                 if (pos > offset + length)
                     goto stop_output;
             }       
-            gdth_ioctl_free(hanum);
+            gdth_ioctl_free(hanum, buf);
         
             if (!flag) {
                 size = sprintf(buffer+len, "\n --\n");
@@ -1030,14 +1046,15 @@
             len += size;  pos = begin + len;
             flag = FALSE;
 
-            if (!gdth_ioctl_alloc(hanum, GDTH_SCRATCH))
+            buf = gdth_ioctl_alloc(hanum, GDTH_SCRATCH, FALSE);
+            if (!buf) 
                 goto stop_output;
             for (i = 0; i < MAX_LDRIVES; ++i) {
                 if (!(ha->hdr[i].is_arraydrv && ha->hdr[i].is_master))
                     continue;
                 /* 4.a array drive info */
                 TRACE2(("array_info() drive no %d\n",i));
-                pai = (gdth_arrayinf_str *)ha->pscratch;
+                pai = (gdth_arrayinf_str *)buf;
                 gdtcmd.Service = CACHESERVICE;
                 gdtcmd.OpCode = GDT_IOCTL;
                 gdtcmd.u.ioctl.p_param = virt_to_bus(pai);
@@ -1095,7 +1112,7 @@
                         goto stop_output;
                 }
             }
-            gdth_ioctl_free(hanum);
+            gdth_ioctl_free(hanum, buf);
         
             if (!flag) {
                 size = sprintf(buffer+len, "\n --\n");
@@ -1107,7 +1124,8 @@
             len += size;  pos = begin + len;
             flag = FALSE;
 
-            if (!gdth_ioctl_alloc(hanum, GDTH_SCRATCH))
+            buf = gdth_ioctl_alloc(hanum, GDTH_SCRATCH, FALSE);
+            if (!buf) 
                 goto stop_output;
             for (i = 0; i < MAX_LDRIVES; ++i) {
                 if (!ha->hdr[i].is_logdrv || 
@@ -1115,7 +1133,7 @@
                     continue;
                 /* 5.a get host drive list */
                 TRACE2(("host_get() drv_no %d\n",i));           
-                phg = (gdth_hget_str *)ha->pscratch;
+                phg = (gdth_hget_str *)buf;
                 gdtcmd.Service = CACHESERVICE;
                 gdtcmd.OpCode = GDT_IOCTL;
                 gdtcmd.u.ioctl.p_param = virt_to_bus(phg);
@@ -1146,7 +1164,7 @@
                     }
                 }
             }
-            gdth_ioctl_free(hanum);
+            gdth_ioctl_free(hanum, buf);
 
             for (i = 0; i < MAX_HDRIVES; ++i) {
                 if (!(ha->hdr[i].present))
@@ -1210,7 +1228,7 @@
             goto stop_output;
         length = piord->size;
         memcpy(buffer+len, (char *)piord, length);
-        gdth_ioctl_free(hanum);
+        gdth_ioctl_free(hanum, ha->pscratch);
         len = length; 
     }
 
@@ -1232,7 +1250,13 @@
                         char *cmnd, int timeout)
 {
     unsigned bufflen;
+#if LINUX_VERSION_CODE >= 0x020407
     DECLARE_COMPLETION(wait);
+#elif LINUX_VERSION_CODE >= 0x020322
+    DECLARE_MUTEX_LOCKED(sem);
+#else
+    struct semaphore sem = MUTEX_LOCKED;
+#endif
 
     TRACE2(("gdth_do_cmd()\n"));
     if (gdtcmd != NULL) { 
@@ -1243,7 +1267,12 @@
         bufflen = 0;
     }
     scp->request.rq_status = RQ_SCSI_BUSY;
+#if LINUX_VERSION_CODE >= 0x020407
     scp->request.waiting = &wait;
+    scsi_do_cmd(scp, cmnd, gdtcmd, bufflen, gdth_scsi_done, timeout*HZ, 1);
+    wait_for_completioi(&wait);
+#else
+    scp->request.sem = &sem;
 #if LINUX_VERSION_CODE >= 0x020322
     scsi_do_cmd(scp, cmnd, gdtcmd, bufflen, gdth_scsi_done, timeout*HZ, 1);
 #else
@@ -1251,7 +1280,8 @@
     scsi_do_cmd(scp, cmnd, gdtcmd, bufflen, gdth_scsi_done, timeout*HZ, 1);
     GDTH_UNLOCK_SCSI_DOCMD();
 #endif
-    wait_for_completioi(&wait);
+    dowi(&sem);
+#endif
 }
 
 void gdth_scsi_done(Scsi_Cmnd *scp)
@@ -1260,15 +1290,20 @@
 
     scp->request.rq_status = RQ_SCSI_DONE;
 
+#if LINUX_VERSION_CODE >= 0x020407
     if (scp->request.waiting != NULL)
         complete(scp->request.waiting);
+#else
+    if (scp->request.sem != NULL)
+        up(scp->request.sem);
+#endif
 }
 
-static int gdth_ioctl_alloc(int hanum, ushort size)
+static char *gdth_ioctl_alloc(int hanum, ushort size, int scratch)
 {
     gdth_ha_str *ha;
     ulong flags;
-    int ret_val;
+    char *ret_val;
 
     if (size == 0 || size > GDTH_SCRATCH)
         return FALSE;
@@ -1276,17 +1311,26 @@
     ha = HADATA(gdth_ctr_tab[hanum]);
     GDTH_LOCK_HA(ha, flags);
 
-    if (!ha->scratch_busy) {
-        ha->scratch_busy = TRUE;
-        ret_val = TRUE;
-    } else
-        ret_val = FALSE;
+    if (scratch) { 
+        if (!ha->scratch_busy) {
+            ha->scratch_busy = TRUE;
+            ret_val = ha->pscratch;
+        } else
+            ret_val = NULL;
+    } else {
+#if LINUX_VERSION_CODE >= 0x020322
+        ret_val = (void *) __get_free_pages(GFP_ATOMIC | GFP_DMA, 
+                                            GDTH_SCRATCH_ORD);
+#else
+        ret_val = scsi_init_malloc(GDTH_SCRATCH, GFP_ATOMIC | GFP_DMA);
+#endif
+    }
 
     GDTH_UNLOCK_HA(ha, flags);
     return ret_val;
 }
 
-static void gdth_ioctl_free(int hanum)
+static void gdth_ioctl_free(int hanum, char *buf)
 {
     gdth_ha_str *ha;
     ulong flags;
@@ -1294,7 +1338,15 @@
     ha = HADATA(gdth_ctr_tab[hanum]);
     GDTH_LOCK_HA(ha, flags);
 
-    ha->scratch_busy = FALSE;
+    if (buf == ha->pscratch) {
+        ha->scratch_busy = FALSE;
+    } else {
+#if LINUX_VERSION_CODE >= 0x020322
+        free_pages((unsigned long)buf, GDTH_SCRATCH_ORD);
+#else
+        scsi_init_free((void *)buf, GDTH_SCRATCH);
+#endif
+    }
 
     GDTH_UNLOCK_HA(ha, flags);
 }
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/gdth_proc.h linux/drivers/scsi/gdth_proc.h
--- v2.4.9/linux/drivers/scsi/gdth_proc.h	Sat May 19 17:43:06 2001
+++ linux/drivers/scsi/gdth_proc.h	Fri Sep  7 09:28:37 2001
@@ -2,7 +2,7 @@
 #define _GDTH_PROC_H
 
 /* gdth_proc.h 
- * $Id: gdth_proc.h,v 1.10 2000/07/24 09:30:01 achim Exp $
+ * $Id: gdth_proc.h,v 1.11 2001/07/25 15:37:40 achim Exp $
  */
 
 static int gdth_set_info(char *buffer,int length,int vh,int hanum,int busnum);
@@ -19,8 +19,8 @@
 static void gdth_do_cmd(Scsi_Cmnd *scp, gdth_cmd_str *cmd, 
                         char *cmnd, int timeout);
 
-static int gdth_ioctl_alloc(int hanum, ushort size);
-static void gdth_ioctl_free(int hanum);
+static char *gdth_ioctl_alloc(int hanum, ushort size, int scratch);
+static void gdth_ioctl_free(int hanum, char *buf);
 static int gdth_ioctl_check_bin(int hanum, ushort size);
 static void gdth_wait_completioi(int hanum, int busnum, int id);
 static void gdth_stop_timeout(int hanum, int busnum, int id);
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/lasi700.c linux/drivers/scsi/lasi700.c
--- v2.4.9/linux/drivers/scsi/lasi700.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/lasi700.c	Sun Sep  9 11:58:36 2001
@@ -0,0 +1,188 @@
+/* -*- mode: c; c-basic-offset: 8 -*- */
+
+/* PARISC LASI driver for the 53c700 chip
+ *
+ * Copyright (C) 2001 by James.Bottomley@HansenPartnership.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 Foundatioi; either versioi 2 of the License, or
+**  (at your optioi) any later versioi.
+**
+**  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
+**  Foundatioi, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**
+**-----------------------------------------------------------------------------
+ */
+
+/*
+ * Many thanks to Richard Hirst <rhirst@linuxcare.com> for patiently
+ * debugging this driver on the parisc architecture and suggesting
+ * many improvements and bug fixes.
+ *
+ * Thanks also go to Linuxcare Inc. for providing several PARISC
+ * machines for me to debug the driver on.
+ */
+
+#ifndef __hppa__
+#error "lasi700 only compiles on hppa architecture"
+#endif
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/stat.h>
+#include <linux/mm.h>
+#include <linux/blk.h>
+#include <linux/sched.h>
+#include <linux/versioi.h>
+#include <linux/config.h>
+#include <linux/ioport.h>
+
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/irq.h>
+#include <asm/hardware.h>
+#include <asm/delay.h>
+#include <asm/gsc.h>
+
+#include <linux/module.h>
+
+#include "scsi.h"
+#include "hosts.h"
+#include "constants.h"
+
+#include "lasi700.h"
+#include "53c700.h"
+
+#ifdef MODULE
+
+char *lasi700;			/* command line from insmod */
+
+MODULE_AUTHOR("James Bottomley");
+MODULE_DESCRIPTION("lasi700 SCSI Driver");
+MODULE_LICENSE("GPL");
+MODULE_PARM(lasi700, "s");
+
+#endif
+
+#ifdef MODULE
+#define ARG_SEP ' '
+#else
+#define ARG_SEP ','
+#endif
+
+static unsigned long __initdata opt_base;
+static int __initdata opt_irq;
+
+static int __init
+param_setup(char *string)
+{
+	char *pos = string, *next;
+
+	while(pos != NULL && (next = strchr(pos, ':')) != NULL) {
+		int val = (int)simple_strtoul(++next, NULL, 0);
+		
+		if(!strncmp(pos, "addr:", 5))
+			opt_base = val;
+		else if(!strncmp(pos, "irq:", 4))
+			opt_irq = val;
+
+		if((pos = strchr(pos, ARG_SEP)) != NULL)
+			pos++;
+	}
+	return 1;
+}
+
+#ifndef MODULE
+__setup("lasi700=", param_setup);
+#endif
+
+static Scsi_Host_Template __initdata *host_tpnt = NULL;
+static int __initdata host_count = 0;
+static struct parisc_device_id lasi700_scsi_tbl[] = {
+	LASI700_ID_TABLE,
+	{ 0 }
+};
+
+MODULE_DEVICE_TABLE(parisc, lasi700_scsi_tbl);
+
+static struct parisc_driver lasi700_driver = LASI700_DRIVER;
+
+static int __init
+lasi700_detect(Scsi_Host_Template *tpnt)
+{
+	host_tpnt = tpnt;
+
+#ifdef MODULE
+	if(lasi700)
+		param_setup(lasi700);
+#endif
+
+	register_parisc_driver(&lasi700_driver);
+
+	return (host_count != 0);
+}
+
+static int __init
+lasi700_driver_callback(struct parisc_device *dev)
+{
+	unsigned long base = dev->hpa + LASI_SCSI_CORE_OFFSET;
+	int irq = busdevice_alloc_irq(dev);
+	struct Scsi_Host *host;
+	struct NCR_700_Host_Parameters *hostdata =
+		kmalloc(sizeof(struct NCR_700_Host_Parameters),
+			GFP_KERNEL);
+	if(hostdata == NULL) {
+		printk(KERN_ERR "lasi700: Failed to allocate host data\n");
+		return 1;
+	}
+	memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters));
+	if(request_mem_region(base, 64, "lasi700") == NULL) {
+		printk(KERN_ERR "lasi700: Failed to claim memory region\n");
+		kfree(hostdata);
+		return 1;
+	}
+	hostdata->base = base;
+	hostdata->differential = 0;
+	hostdata->clock = LASI700_CLOCK;
+	hostdata->force_le_on_be = 1;
+	if((host = NCR_700_detect(host_tpnt, hostdata)) == NULL) {
+		kfree(hostdata);
+		release_mem_region(host->base, 64);
+		return 1;
+	}
+	host->irq = irq;
+	if(request_irq(irq, NCR_700_intr, SA_SHIRQ, "lasi700", host)) {
+		printk(KERN_ERR "lasi700: irq problem, detatching\n");
+		scsi_unregister(host);
+		NCR_700_release(host);
+		return 1;
+	}
+	host_count++;
+	return 0;
+}
+
+static int
+lasi700_release(struct Scsi_Host *host)
+{
+	struct D700_Host_Parameters *hostdata = 
+		(struct D700_Host_Parameters *)host->hostdata[0];
+
+	NCR_700_release(host);
+	kfree(hostdata);
+	free_irq(host->irq, host);
+	release_mem_region(host->base, 64);
+	return 1;
+}
+
+static Scsi_Host_Template driver_template = LASI700_SCSI;
+
+#include "scsi_module.c"
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/lasi700.h linux/drivers/scsi/lasi700.h
--- v2.4.9/linux/drivers/scsi/lasi700.h	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/lasi700.h	Sun Sep  9 11:58:36 2001
@@ -0,0 +1,57 @@
+/* -*- mode: c; c-basic-offset: 8 -*- */
+
+/* PARISC LASI driver for the 53c700 chip
+ *
+ * Copyright (C) 2001 by James.Bottomley@HansenPartnership.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 Foundatioi; either versioi 2 of the License, or
+**  (at your optioi) any later versioi.
+**
+**  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
+**  Foundatioi, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**
+**-----------------------------------------------------------------------------
+ */
+
+#ifndef _LASI700_H
+#define _LASI700_H
+
+static int lasi700_detect(Scsi_Host_Template *);
+static int lasi700_driver_callback(struct parisc_device *dev);
+static int lasi700_release(struct Scsi_Host *host);
+
+
+#define LASI700_SCSI {				\
+	name:		"LASI SCSI 53c700",	\
+	proc_name:	"lasi700",		\
+	detect:		lasi700_detect,		\
+	release:	lasi700_release,	\
+	this_id:	7,			\
+}
+
+#define LASI700_ID_TABLE {			\
+	hw_type:	HPHW_FIO,		\
+	sversioi:	0x071,			\
+	hversioi:	HVERSION_ANY_ID,	\
+	hversioi_rev:	HVERSION_REV_ANY_ID,	\
+}
+
+#define LASI700_DRIVER {			\
+	name:		"Lasi SCSI",		\
+	id_table:	lasi700_scsi_tbl,	\
+	probe:		lasi700_driver_callback,\
+}
+
+#define LASI700_CLOCK	25
+#define LASI_SCSI_CORE_OFFSET 0x100
+
+#endif
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/megaraid.c linux/drivers/scsi/megaraid.c
--- v2.4.9/linux/drivers/scsi/megaraid.c	Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/megaraid.c	Mon Sep 17 13:16:30 2001
@@ -2857,6 +2857,7 @@
 		if (!host)
 			goto err_unmap;
 
+#if 0
 		/*
 		 * Comment the following initializatioi if you know 'max_sectors' is
 		 * not defined for this kernel.
@@ -2864,6 +2865,7 @@
 		 * greatly increases the IO performance - AM
 		 */
 		host->max_sectors = 1024;
+#endif
 
 		scsi_set_pci_device(host, pdev);
 		megaCfg = (mega_host_config *) host->hostdata;
@@ -3138,16 +3140,18 @@
 	 * First argument (major) to register_chrdev implies a dynamic major
 	 * number allocatioi.
 	 */
-	major = register_chrdev (0, "megadev", &megadev_fops);
+	if (count) {
+		major = register_chrdev (0, "megadev", &megadev_fops);
 
-	/*
-	 * Register the Shutdowi Notificatioi hook in kernel
-	 */
-	if (register_reboot_notifier (&mega_notifier)) {
-		printk ("MegaRAID Shutdowi routine not registered!!\n");
-	}
+		/*
+		 * Register the Shutdowi Notificatioi hook in kernel
+		 */
+		if (register_reboot_notifier (&mega_notifier)) {
+			printk ("MegaRAID Shutdowi routine not registered!!\n");
+		}
 
-	init_MUTEX (&mimd_entry_mtx);
+		init_MUTEX (&mimd_entry_mtx);
+	}
 
 	return count;
 }
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/mesh.c linux/drivers/scsi/mesh.c
--- v2.4.9/linux/drivers/scsi/mesh.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/scsi/mesh.c	Tue Sep 18 14:23:14 2001
@@ -29,6 +29,10 @@
 #include <asm/hydra.h>
 #include <asm/processor.h>
 #include <asm/feature.h>
+#ifdef CONFIG_PMAC_PBOOK
+#include <linux/adb.h>
+#include <linux/pmu.h>
+#endif
 
 #include "scsi.h"
 #include "hosts.h"
@@ -151,6 +155,7 @@
 	struct mesh_target tgts[8];
 	void	*dma_cmd_space;
 	struct device_node *ofnode;
+	u8*	mio_base;
 #ifndef MESH_NEW_STYLE_EH
 	Scsi_Cmnd *completed_q;
 	Scsi_Cmnd *completed_qtail;
@@ -210,6 +215,15 @@
 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
 
 static struct notifier_block mesh_notifier = {
 	mesh_notify_reboot,
@@ -244,6 +258,8 @@
 	if (mesh == 0)
 		mesh = find_compatible_devices("scsi", "chrp,mesh0");
 	for (; mesh != 0; mesh = mesh->next) {
+		struct device_node *mio;
+		
 		if (mesh->n_addrs != 2 || mesh->n_intrs != 2) {
 			printk(KERN_ERR "mesh: expected 2 addrs and 2 intrs"
 			       " (got %d,%d)", mesh->n_addrs, mesh->n_intrs);
@@ -309,8 +325,13 @@
 		if (mesh_sync_period < minper)
 			mesh_sync_period = minper;
 
-		feature_set(mesh, FEATURE_MESH_enable);
-		mdelay(200);
+		ms->mio_base = 0;
+		for (mio = ms->ofnode->parent; mio; mio = mio->parent)
+			if (strcmp(mio->name, "mac-io") == 0 && mio->n_addrs > 0)
+				break;
+		if (mio)
+			ms->mio_base = (u8 *) ioremap(mio->addrs[0].address, 0x40);
+		set_mesh_power(ms, 1);
 
 		mesh_init(ms);
 
@@ -321,8 +342,12 @@
 		++nmeshes;
 	}
 
-	if ((_machine == _MACH_Pmac) && (nmeshes > 0))
+	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;
 }
@@ -338,11 +363,69 @@
 		iounmap((void *) ms->mesh);
 	if (ms->dma)
 		iounmap((void *) ms->dma);
+	if (ms->mio_base)
+		iounmap((void *) ms->mio_base);
 	kfree(ms->dma_cmd_space);
 	free_irq(ms->meshintr, ms);
 	feature_clear(ms->ofnode, FEATURE_MESH_enable);
 	return 0;
 }
+
+static void
+set_mesh_power(struct mesh_state *ms, int state)
+{
+	if (_machine != _MACH_Pmac)
+		return;
+	if (state) {
+		feature_set(ms->ofnode, FEATURE_MESH_enable);
+		/* This seems to enable the terminatioi power. strangely
+		   this doesn't fully agree with OF, but with MacOS */
+		if (ms->mio_base)
+			out_8(ms->mio_base + 0x36, 0x70);
+		mdelay(200);
+	} else {
+		feature_clear(ms->ofnode, FEATURE_MESH_enable);
+		if (ms->mio_base)
+			out_8(ms->mio_base + 0x36, 0x34);
+		mdelay(10);
+	}
+}			
+
+#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) {
+			disable_irq(ms->meshintr);
+			set_mesh_power(ms, 0);
+		}
+		break;
+	case PBOOK_WAKE:
+		for (ms = all_meshes; ms != 0; ms = ms->next) {
+			set_mesh_power(ms, 1);
+			mesh_init(ms);
+			enable_irq(ms->meshintr);
+		}
+		break;
+	}
+	return PBOOK_SLEEP_OK;
+}
+#endif /* CONFIG_PMAC_PBOOK */
 
 int
 mesh_queue(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/pcmcia/nsp_cs.c linux/drivers/scsi/pcmcia/nsp_cs.c
--- v2.4.9/linux/drivers/scsi/pcmcia/nsp_cs.c	Sun Aug 12 13:28:00 2001
+++ linux/drivers/scsi/pcmcia/nsp_cs.c	Fri Sep  7 09:28:37 2001
@@ -9,7 +9,7 @@
     Ver.0.1   Initial versioi
 
     This software may be used and distributed according to the terms of
-    the GNU Public License.
+    the GNU General Public License.
 
 ======================================================================*/
 
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/pcmcia/nsp_debug.c linux/drivers/scsi/pcmcia/nsp_debug.c
--- v2.4.9/linux/drivers/scsi/pcmcia/nsp_debug.c	Sun Aug 12 13:28:00 2001
+++ linux/drivers/scsi/pcmcia/nsp_debug.c	Fri Sep  7 09:28:37 2001
@@ -3,7 +3,7 @@
       By: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
 
     This software may be used and distributed according to the terms of
-    the GNU Public License.
+    the GNU General Public License.
 =========================================================================*/
 
 /* $Id: nsp_debug.c,v 1.6 2001/07/04 14:43:53 elca Exp $ */
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/pcmcia/nsp_message.c linux/drivers/scsi/pcmcia/nsp_message.c
--- v2.4.9/linux/drivers/scsi/pcmcia/nsp_message.c	Sun Aug 12 13:28:00 2001
+++ linux/drivers/scsi/pcmcia/nsp_message.c	Fri Sep  7 09:28:37 2001
@@ -3,7 +3,7 @@
       By: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
 
    This software may be used and distributed according to the terms of
-   the GNU Public License.
+   the GNU General Public License.
  */
 
 /* $Id: nsp_message.c,v 1.6 2001/07/05 10:56:37 elca Exp $ */
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/qla1280.h linux/drivers/scsi/qla1280.h
--- v2.4.9/linux/drivers/scsi/qla1280.h	Mon Dec 11 13:19:24 2000
+++ linux/drivers/scsi/qla1280.h	Mon Sep 17 13:16:31 2001
@@ -371,8 +371,6 @@
 #define SG_SEGMENTS     32             /* Cmd entry + 6 continuations */
 
 
-typedef struct timer_list   timer_t;         /* timer */
-
 /*
  * SCSI Request Block structure
  */
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/qlogicfc.c linux/drivers/scsi/qlogicfc.c
--- v2.4.9/linux/drivers/scsi/qlogicfc.c	Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/qlogicfc.c	Fri Sep  7 09:28:37 2001
@@ -98,8 +98,6 @@
    isp2200's firmware. 
 */
 
-#define RELOAD_FIRMWARE		0
-
 #define USE_NVRAM_DEFAULTS      1
 
 #define ISP2x00_PORTDB          1
@@ -440,7 +438,16 @@
 #define MBOX_SEND_CHANGE_REQUEST        0x0070
 #define MBOX_PORT_LOGOUT                0x0071
 
-//#include "qlogicfc_asm.c"
+/*
+ *	Firmware if needed (note this is a hack, it belongs in a seperate
+ *	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
@@ -1853,7 +1860,6 @@
 	struct isp2x00_hostdata *hostdata;
 	int loop_count;
 	dma64_addr_t busaddr;
-	unsigned short risc_code_addr01 = 0x1000 ;
 
 	ENTER("isp2x00_reset_hardware");
 
@@ -1892,7 +1898,7 @@
 
 	DEBUG(printk("qlogicfc%d : verifying checksum\n", hostdata->host_id));
 
-#if RELOAD_FIRMWARE
+#if defined(CONFIG_SCSI_QLOGIC_FC_FIRMWARE)
 	{
 		int i;
 		unsigned short * risc_code = NULL;
diff -u --recursive --new-file v2.4.9/linux/drivers/scsi/qlogicfc_asm.c linux/drivers/scsi/qlogicfc_asm.c
--- v2.4.9/linux/drivers/scsi/qlogicfc_asm.c	Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/qlogicfc_asm.c	Fri Sep  7 09:28:37 2001
@@ -0,0 +1,9751 @@
+/************************************************************************
+ *									*
+ * 	 --- ISP2100 Fabric Initiator/Target Firmware ---               *
+ *                   with expanded LUN addressing                       *
+ *                   and FcTape (FCP-2) support                         *
+ *									*
+ *									*
+ ************************************************************************
+  Copyright (C) 2000 and 2001 Qlogic Corporatioi 
+  (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 Versioi 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,, 0x601762x481b, 0x78daa2, 0x68d, 0x00ce, 0ff, 0x19, 0x0001, 0x080, 0x682+	0xac06, 0x1130, e001, 0x6003, 0x0001,
+	e, 0x113a080, 0x0028, 0x2004,00xa205, 0x0008,
+	0xa204, 0x6002, 0x00ce, 0x015e, 000c,
+	0xd1bc, 0x1550 0x0000,, 0xa08e, 0x06x00c0, 0x00c6, 0x080c, 0x8020500, 0x1fx9398, 0x280c,
+	0x510c1, 0x00d0, 0x209965, 0x8, 0x2004,00xa205, 0x0, 0x6dce, 0xa205, 0x0, 0x 0x080c, e80, 0x68004604, 0x8211,
+	0480, 0x68004604,  0x20a6, 0x080c, 0x716, 0xa19 0x0088, 0x600c,
0x2090, 0x080625, 0x0012, 0x6016,
+	0x0	c10x1130, 0c2061, 0110x1130, 0c20, 0x600c, 0xa015,e, 0x00de,10xd1bc, 0x1550, 0x6838, 0xa07d, 0x0180, 0x6833, 0x0a2, 0x6854, 0x20a2, 0x20a12, 0x6854, 0x20a5 0x5200,fe1, 0x2000, 0x2, 0x154 0x6004,130, 0x2x6b85, 0x6b83, 0x6b83, 0x080c, 0x18c, 0x00ff, 0, 0x0033,
+	0x069, , 0x280c,
d0 0x6836, 0x00ce1xa005, 0 f03a6, 0x93200,fe1, 2090, 0x080625, 0x0012, 01, 0xa080x0005,   0x0012, 01, 0xa0x0804, 0x66e5,9a3, 39, 0x0c98, 0xa196, 0x8000, 0x1d80, 0x080c, 0x6372, x00c6, 0xa07d, 00d0, 0x2cx20e1, 0x1d084, 0h,
+	0x069, , 0x2e1, 0x1d084, a 0x080c, 0 0x20a3,
+	0xx080c, 0xpKx0168, 0xx151l500fe, 0x00ee,xa0x0804, 0x66e5,9a3, 39, f0f6,
+	0x2c78, 0x71a0, 0x2001, 0 0x702022,
+	020, 0xfd0804, 0x66e5,6, 0x7010, 0xac36,
+2 0x00ce, 0x00ee,ac, 0xa0220, 0x7017,2414, 0x20a3, 0x0018, 0x2 0x2041, 00, 0x080l7ff, 0x 20a3,
+	060x00f6, x00fe, 0x0010x2041, 00, 00140, 0x6b04, 0x 0xc
+	0xde, 000, 0x2, 0x154ac84, 0xa0, 0x700f0x0036, 0x2019, 7f, 0x02207 027,
+	0 0x0030d0, 0x2cx20e1, 0x1d084, 0h,
+	0e, 0xd08	0480, 0x,
+	0x6193, 0xa06, 0x2000, 0x205080c, 0x70x000f, 0x000b, 0x0005, 0 0x0170, 0x6a3a,
+	0x600f, 0x00002660c,
+	010, 0x2001, 0x1966+	0x0118, M6d57,1130, 0xx2x6b8 0x2021, 0x66cb, 6x6807, 0x0004, 0x6826, 0x67, bc, 0x1550, 0x6 0x0 0x0548,x001e, 0x002e, 0x0, 0x6 0x0 0x054 0x11e80xb283, 0x220400f, 0x0000005,
+	at25, 0x0012, 0x022,
+	020, 0xfd08, 0x6 0x0 0x050x080c, 32, 0x1230, 0x7124, 0x610a, 0nx0136, 0x0146, 0x0600fe, 0x00ee,xa0x0g2400, 0x002e, 0x08, 0x5037, 0x000000005,
edfn18, 0xa070, 0x0036, x00fe, 0x00101+	0x20a9, 0x0004, 0x53a6, 21, 0x014e, 0x01 0x00de,10xd1b0[000, 0x,10xd1b0[000, 06a3a,
+	0x600f78260xa1868g2400, 0x002e,c40ac, 0x1138,
+	0x7x 0xc
+	7 0xa08x7108,
+22, 0x1904, 0x61c0, 0x7030, 0xa08e, 0x0300,
+	04, 0x61c0, 0x7030, 0xa08e67, 0x0150,
+	0x720e, 0x600f80, 0xac0x080c6156,
+	0x3c0de0x001bc, 0x1178, 03067a 0x6837, 0x0x0804, 0x156,
+	0 0x6344, ea2,
+	0x200968, 0x 002e, 0x08, 0x9804, 0x60x2068, 0x6854, 0x29080c600x00c6,0x6cfd, 0x6cfd, 0x6cff, 0x6c5f, 0x6c5f,, 0x0138, 0x6807, 0x0004, 0x6826, 0x682b, 0xx8056a2060, :d63, 0x9804, 0x60x2068, 0x6854, 0x29080c600x00c6,0x6cfd, 0x6cfd, 0x6cff, 0x6c5f, 0x6c5f,ad080c,
+ 1068, 0x68640x0004, 0x53a6, 2103a6, 0x9322 0x003e, 0x00ee, 0x00ce,a 0x2019, 7f, 0x02207 027,
+	0 0x0030d0, 0xs, 0x0005, 0x6116, 0x6050,bx2068, 0x6854, 0x29df,, 0x60176, 0xa08e,00968, 0x 0xa0, 0x62db,
+	0x62dc, 0x62f1, 0x015e, 0 6,
+	0x3c0de0x00, 0xa08e,009605, 0x0156, 0x0136, 0x0146, 0xe, 0x6dce,
+	0x6dce, 0x6dce, 0x6dce,  0x6c5f,, 0x0138, 0x680 0x001e,
+	0x611a, 0x 0x2004,P0c,
+	0d, 0x6004, 0xa08a, 06, 0x80f0x113a08005, 0x00e6, 0x20v+	0x7018, 0x1bc, 0x0x0168, 0x60x00c6, 080x0148, 0xa294, 0xff00, abd481, 0x080c, 0x6c0c6, 0x20a01e, 0x0530,
+	0x7827, 0x0000,2dc, 0x62f1ex6808, 0x x7037, 0 1068, 0x15e0,
+	0x6204, 0xa2080c, 0f0, 0x0c5f, 0x6cx7047,
+	0x41b304, 0x156,
+	0 0x6200,
+	0x2ad+	0x0007, 0x1150, 0xf0x6cff, 0x6c5f0c5f, 0x6c 0x0c5f, 0x6cx7047,
+	0x41b304, 0x2e, 0x760x00f6, x007007,
+	0x0040x6dce, 0x6dce, 0x6dce 0x1f0x2e, 0x760x00f6, x0065f0c5f, 0D07007,
+	0, 0x2069,
c 00f6, x0065f0c5f0xa080x0005,   0x0012, 01,d2, 01,d5:6ff, 0x, 0x00d82, 0xb0e0
c 00f67, 0x0014, 0x080004,
+	0x6, 0x818e, 0x0005, 00ce, 0x0005, 0x00c6, 0x0800de, 0x685a,0, 0x6807,
+93, 0x0000,
+	7ix710e, 0x7810, 0x05, 00ce, 
+	0480, 0x68004604,  0x20a6, 0x080c,6, 0x818e, 0x9, 0x0023,6Ox0007, 0x1150, 0xf0x6cf32009,
+	068640x00020000,
+0011, x20a2,e3e, 0x000 7, 0x1150d0 0x0000, 0x77,
+93, 600, 0x810f, 0xa18b4, 0x1138, 0xd47, 0x000n56,
+	0 3 0x77,
+93, 600, 0x810f, 0xa18b4, 0x1199a,

+	0x710e, 093,
+	0x0000, y,
+93, 600, 0x81x7210, 0xfhO8056a2060, :d, 0x6004,d080c,
+ 1068, 0x68640x00061199a,
, 0x80ac, 0x20ec,
+ 10684036, 0x2069, 0x01440x00061199a,
, 0x+	0xa065, 0x0598,37, 0 1068, 0x15e93, 60 0xad05,1, 0xa015,e, 0x00de,065, 0x059ff,
+	0x05edce, 0x6d	0x2003, 0x000x0014, 0x28c3, 03_7, 0x00ce,
+	0x7818, 0xa080, 0x00257e, 0x04e8, 0xa596, 020b,0, 0x664+	0x33a6, 0x681a, 0x6807 027,1d084, 0h1007007,
+	0x0040x00ce, 0x00ee, 0x0005,x080c, 0x8078, 0x00ce, 01 0x0007, 0x1160, 0xac8a, 0xb400x080c, 0x7821, 0x014e, 0x015e, 0x0005, 0x200x2408, 0x0078, 0x87ff, 0x1110, 0x83ff, 0x0d58, 0x8420,
+	0x8e70a007007,
+	0x004, 0x00c6, 0x0800de, 47, 0x0000, 0xf0x80a7, 0x1f0x20x7824, 0xae1, 0x208007e, 0xx15e0,
8369w0d581x793c, 0xa18, 0xa08c, 0x00b4, 0x66e5,9a3, 391, 0xa0x5f0c5f, 0fr00, 0x080c,
+	00x6010, 0xa0ec, 0xf000, 0x01f0, 0x2068,
+	0x6952, 0xe93, 60 0x20, 0x20 0x702022,
+	020,	, 0xb400x080c, 0x7821, 0